mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	This commit prepares the frontend code to be consumed by webpack. It is a hack: In theory, modules should be declaring and importing the modules they depend on and the globals they expose directly. However, that requires significant per-module work, which we don't really want to block moving our toolchain to webpack on. So we expose the modules by setting window.varName = varName; as needed in the js files.
		
			
				
	
	
		
			42 lines
		
	
	
		
			969 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			969 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
var settings_toggle = (function () {
 | 
						|
 | 
						|
var exports = {};
 | 
						|
 | 
						|
var toggler;
 | 
						|
 | 
						|
exports.highlight_toggle = function (tab_name) {
 | 
						|
    if (toggler) {
 | 
						|
        toggler.goto(tab_name);
 | 
						|
    }
 | 
						|
};
 | 
						|
 | 
						|
exports.initialize = function () {
 | 
						|
    toggler = components.toggle({
 | 
						|
        child_wants_focus: true,
 | 
						|
        values: [
 | 
						|
            { label: i18n.t("Settings"), key: "settings" },
 | 
						|
            { label: i18n.t("Organization"), key: "organization" },
 | 
						|
        ],
 | 
						|
        callback: function (name, key) {
 | 
						|
            if (key === "organization") {
 | 
						|
                settings_panel_menu.show_org_settings();
 | 
						|
            } else {
 | 
						|
                settings_panel_menu.show_normal_settings();
 | 
						|
            }
 | 
						|
        },
 | 
						|
    });
 | 
						|
 | 
						|
    settings_panel_menu.set_key_handlers(toggler);
 | 
						|
 | 
						|
    $("#settings_overlay_container .tab-container").append(toggler.get());
 | 
						|
};
 | 
						|
 | 
						|
return exports;
 | 
						|
 | 
						|
}());
 | 
						|
 | 
						|
if (typeof module !== 'undefined') {
 | 
						|
    module.exports = settings_toggle;
 | 
						|
}
 | 
						|
window.settings_toggle = settings_toggle;
 |