From b933703f4f3100c3e1c61538db1fcf470a17cac3 Mon Sep 17 00:00:00 2001 From: Alexei Stukov Date: Thu, 4 May 2017 18:47:15 +0300 Subject: [PATCH] Localization fix and layer identifiers --- js/main.min.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/main.min.js b/js/main.min.js index 8715ee08..3aef3e5f 100644 --- a/js/main.min.js +++ b/js/main.min.js @@ -374,7 +374,9 @@ settingsInner+='\ \ \ ';function showSettings(){$(".tab-bar-item").removeClass("selected");settingsButton.addClass("selected");$(".form .settings-right .settings-inner").first().hide();panel.show();if(lastTab==""){self.changeTab("bd-settings-tab")}else{self.changeTab(lastTab)}} -settingsButton=$("
",{class:"tab-bar-item",text:"BetterDiscord",id:"bd-settings-new",click:showSettings});panel.html(settingsInner);this.panel=panel};SettingsPanel.prototype.inject=function(mutation){if(this.injectNew(mutation))return;if(mutation.type!="childList")return;if(mutation.addedNodes.length<=0)return;if($(mutation.addedNodes[0]).find(".user-settings-modal").length<=0)return;var self=this;this.panel.hide();var tabBar=$(".tab-bar.SIDE").first();$(".tab-bar.SIDE .tab-bar-item").click(function(){$(".form .settings-right .settings-inner").first().show();$("#bd-settings-new").removeClass("selected");self.panel.hide()});tabBar.append(settingsButton);$(".form .settings-right .settings-inner").last().after(self.panel);$("#bd-settings-new").removeClass("selected")};SettingsPanel.prototype.injectNew=function(mutation){let self=this;if(!mutation.target.classList.contains("layers"))return;if(!$(".ui-tab-bar-header:contains('App Settings')").length)return;if($("#bd-settings-sidebar").length)return;self.v2SettingsPanel.renderSidebar();return!0};SettingsPanel.prototype.versionInfo=function(){let self=this;let element=$("
",{class:'bd-versioninfo-wrapper'}).append($("",{text:`BetterDiscord v${(typeof(version) === "undefined" ? bdVersion : version)}:${jsVersion} by `})).append($("",{text:'Jiiks',href:'https://google.com',target:'_blank'}));return element} +settingsButton=$("
",{class:"tab-bar-item",text:"BetterDiscord",id:"bd-settings-new",click:showSettings});panel.html(settingsInner);this.panel=panel};SettingsPanel.prototype.inject=function(mutation){if(this.injectNew(mutation))return;if(mutation.type!="childList")return;if(mutation.addedNodes.length<=0)return;if($(mutation.addedNodes[0]).find(".user-settings-modal").length<=0)return;var self=this;this.panel.hide();var tabBar=$(".tab-bar.SIDE").first();$(".tab-bar.SIDE .tab-bar-item").click(function(){$(".form .settings-right .settings-inner").first().show();$("#bd-settings-new").removeClass("selected");self.panel.hide()});tabBar.append(settingsButton);$(".form .settings-right .settings-inner").last().after(self.panel);$("#bd-settings-new").removeClass("selected")};SettingsPanel.prototype.injectNew=function(mutation){let self=this;if(!mutation.target.classList.contains("layers"))return;if($(".guild-settings-base-section").length){try{mutation.addedNodes[0].setAttribute('layer-id','server-settings')}catch(err){}} +if(!$(".user-settings-account").length)return;try{mutation.addedNodes[0].setAttribute('layer-id','user-settings')}catch(err){} +if($("#bd-settings-sidebar").length)return;self.v2SettingsPanel.renderSidebar();return!0};SettingsPanel.prototype.versionInfo=function(){let self=this;let element=$("
",{class:'bd-versioninfo-wrapper'}).append($("",{text:`BetterDiscord v${(typeof(version) === "undefined" ? bdVersion : version)}:${jsVersion} by `})).append($("",{text:'Jiiks',href:'https://google.com',target:'_blank'}));return element} SettingsPanel.prototype.tabBarNew=function(){let self=this;let _tabBar=$("
",{class:'tab-bar TOP',style:'border-bottom:none'});let items=[{'id':'bd-core','text':'Core'},{'id':'bd-emotes','text':'Emotes'},{'id':'bd-customcss','text':'Custom CSS'},{'id':'bd-plugins','text':'Plugins'},{'id':'bd-themes','text':'Themes'}];items.map(value=>{_tabBar.append($("
",{class:'tab-bar-item bd-tab',text:value.text,id:value.id,click:()=>self.changeTabNew(value.id)}))});return _tabBar} SettingsPanel.prototype.changeTabNew=function(id){$(".bd-tab").removeClass("selected");$(`#${id}`).addClass("selected");$(".bd-pane").hide();$(`#${id}-pane`).show();if(id==='bd-customcss'){if(!customCssInitialized){customCssEditor.init();customCssInitialized=!0}}} SettingsPanel.prototype.updateSettingNew=function(id,checked){if(id=="bda-css-2"){$("#app-mount").removeClass("bd-hide-bd");customCssEditor.hideBackdrop=checked;if(checked){$("#app-mount").addClass("bd-hide-bd")}}