diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index 427690d24..25d67c081 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -16042,7 +16042,7 @@ Settings = { init: function() { - var check, el, settings, + var addSection, arr, check, el, settings, _i, _len, _ref, _this = this; el = $.el('a', { className: 'settings-link', @@ -16055,11 +16055,12 @@ el: el, order: 1 }); - this.addSection('Main', this.main); - this.addSection('Filter', this.filter); - this.addSection('Sauce', this.sauce); - this.addSection('Advanced', this.advanced); - this.addSection('Keybinds', this.keybinds); + addSection = this.addSection; + _ref = [['style', 'Style'], ['themes', 'Themes'], ['mascots', 'Mascots'], ['main', 'Script'], ['filter', 'Filter'], ['sauce', 'Sauce'], ['advanced', 'Advanced'], ['keybinds', 'Keybinds']]; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + arr = _ref[_i]; + addSection(arr[1], Settings[arr[0]]); + } $.on(d, 'AddSettingsSection', this.addSection); $.on(d, 'OpenSettings', function(e) { return _this.open(e.detail); diff --git a/builds/crx/script.js b/builds/crx/script.js index 614b2bf4f..d8a38f0f7 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -16047,7 +16047,7 @@ Settings = { init: function() { - var check, el, settings, + var addSection, arr, check, el, settings, _i, _len, _ref, _this = this; el = $.el('a', { className: 'settings-link', @@ -16060,11 +16060,12 @@ el: el, order: 1 }); - this.addSection('Main', this.main); - this.addSection('Filter', this.filter); - this.addSection('Sauce', this.sauce); - this.addSection('Advanced', this.advanced); - this.addSection('Keybinds', this.keybinds); + addSection = this.addSection; + _ref = [['style', 'Style'], ['themes', 'Themes'], ['mascots', 'Mascots'], ['main', 'Script'], ['filter', 'Filter'], ['sauce', 'Sauce'], ['advanced', 'Advanced'], ['keybinds', 'Keybinds']]; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + arr = _ref[_i]; + addSection(arr[1], Settings[arr[0]]); + } $.on(d, 'AddSettingsSection', this.addSection); $.on(d, 'OpenSettings', function(e) { return _this.open(e.detail); diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee index b58913aab..6a05300df 100755 --- a/src/General/Settings.coffee +++ b/src/General/Settings.coffee @@ -12,11 +12,17 @@ Settings = el: el order: 1 - @addSection 'Main', @main - @addSection 'Filter', @filter - @addSection 'Sauce', @sauce - @addSection 'Advanced', @advanced - @addSection 'Keybinds', @keybinds + {addSection} = @ + addSection arr[1], Settings[arr[0]] for arr in [ + ['style', 'Style'] + ['themes', 'Themes'] + ['mascots', 'Mascots'] + ['main', 'Script'] + ['filter', 'Filter'] + ['sauce', 'Sauce'] + ['advanced', 'Advanced'] + ['keybinds', 'Keybinds'] + ] $.on d, 'AddSettingsSection', @addSection $.on d, 'OpenSettings', (e) => @open e.detail