diff --git a/js/main.js b/js/main.js index 90193ffa..8ddd8823 100644 --- a/js/main.js +++ b/js/main.js @@ -573,26 +573,6 @@ EmoteModule.prototype.injectEmote = function (node) { parentInnerHTML = parentInnerHTML.replace(word, '
' + name + '
'); return; } - - if (typeof emotesFfz !== 'undefined' && settingsCookie["bda-es-1"]) { - if (emotesFfz.hasOwnProperty(sWord)) { - var len = Math.round(sWord.length / 4); - var name = sWord.substr(0, len) + "\uFDD9" + sWord.substr(len, len) + "\uFDD9" + sWord.substr(len * 2, len) + "\uFDD9" + sWord.substr(len * 3); - var url = ffzEmoteUrlStart + emotesFfz[sWord] + ffzEmoteUrlEnd; - parentInnerHTML = parentInnerHTML.replace(word, '
' + name + '
'); - return; - } - } - - if (typeof emotesBTTV !== 'undefined' && settingsCookie["bda-es-2"]) { - if (emotesBTTV.hasOwnProperty(sWord)) { - var len = Math.round(sWord.length / 4); - var name = sWord.substr(0, len) + "\uFDD9" + sWord.substr(len, len) + "\uFDD9" + sWord.substr(len * 2, len) + "\uFDD9" + sWord.substr(len * 3); - var url = emotesBTTV[sWord]; - parentInnerHTML = parentInnerHTML.replace(word, '
' + name + '
'); - return; - } - } if (typeof emotesBTTV2 !== 'undefined' && settingsCookie["bda-es-2"]) { if (emotesBTTV2.hasOwnProperty(sWord)) { @@ -603,7 +583,27 @@ EmoteModule.prototype.injectEmote = function (node) { return; } } - + + if (typeof emotesBTTV !== 'undefined' && settingsCookie["bda-es-2"]) { + if (emotesBTTV.hasOwnProperty(sWord)) { + var len = Math.round(sWord.length / 4); + var name = sWord.substr(0, len) + "\uFDD9" + sWord.substr(len, len) + "\uFDD9" + sWord.substr(len * 2, len) + "\uFDD9" + sWord.substr(len * 3); + var url = emotesBTTV[sWord]; + parentInnerHTML = parentInnerHTML.replace(word, '
' + name + '
'); + return; + } + } + + if (typeof emotesFfz !== 'undefined' && settingsCookie["bda-es-1"]) { + if (emotesFfz.hasOwnProperty(sWord)) { + var len = Math.round(sWord.length / 4); + var name = sWord.substr(0, len) + "\uFDD9" + sWord.substr(len, len) + "\uFDD9" + sWord.substr(len * 2, len) + "\uFDD9" + sWord.substr(len * 3); + var url = ffzEmoteUrlStart + emotesFfz[sWord] + ffzEmoteUrlEnd; + parentInnerHTML = parentInnerHTML.replace(word, '
' + name + '
'); + return; + } + } + }); if (parent.parentElement == null) return; diff --git a/js/main.min.js b/js/main.min.js index 8e9c12de..e259359d 100644 --- a/js/main.min.js +++ b/js/main.min.js @@ -1,2 +1,2 @@ -function Core(){}function EmoteModule(){}function PublicServers(){}function QuickEmoteMenu(){}function CustomCssEditor(){}function SettingsPanel(){utils.injectJs("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.9.0/codemirror.min.js"),utils.injectJs("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.9.0/mode/css/css.min.js"),utils.injectJs("https://cdnjs.cloudflare.com/ajax/libs/Sortable/1.4.2/Sortable.min.js")}function Utils(){}function VoiceMode(){}function PluginModule(){}function ThemeModule(){}function BdWSocket(){bdws=this}function BdApi(){}var settingsPanel,emoteModule,utils,quickEmoteMenu,opublicServers,voiceMode,pluginModule,themeModule,customCssEditor,jsVersion=1.63,supportedVersion="0.2.5",mainObserver,twitchEmoteUrlStart="https://static-cdn.jtvnw.net/emoticons/v1/",twitchEmoteUrlEnd="/1.0",ffzEmoteUrlStart="https://cdn.frankerfacez.com/emoticon/",ffzEmoteUrlEnd="/1",bttvEmoteUrlStart="https://cdn.betterttv.net/emote/",bttvEmoteUrlEnd="/1x",mainCore,settings={"Save logs locally":{id:"bda-gs-0",info:"Saves chat logs locally",implemented:!1,hidden:!1,cat:"core"},"Public Servers":{id:"bda-gs-1",info:"Display public servers button",implemented:!0,hidden:!1,cat:"core"},"Minimal Mode":{id:"bda-gs-2",info:"Hide elements and reduce the size of elements.",implemented:!0,hidden:!1,cat:"core"},"Voice Mode":{id:"bda-gs-4",info:"Only show voice chat",implemented:!0,hidden:!1,cat:"core"},"Hide Channels":{id:"bda-gs-3",info:"Hide channels in minimal mode",implemented:!0,hidden:!1,cat:"core"},"Dark Mode":{id:"bda-gs-5",info:"Make certain elements dark by default(wip)",implemented:!0,hidden:!1,cat:"core"},"Override Default Emotes":{id:"bda-es-5",info:"Override default emotes",implemented:!1,hidden:!1,cat:"core"},"Voice Disconnect":{id:"bda-dc-0",info:"Disconnect from voice server when closing Discord",implemented:!0,hidden:!1,cat:"core"},"Custom css live update":{id:"bda-css-0",info:"",implemented:!0,hidden:!0,cat:"core"},"Custom css auto udpate":{id:"bda-css-1",info:"",implemented:!0,hidden:!0,cat:"core"},"Show Emotes":{id:"bda-es-7",info:"Show any emotes",implemented:!0,hidden:!1,cat:"emote"},"FrankerFaceZ Emotes":{id:"bda-es-1",info:"Show FrankerFaceZ Emotes",implemented:!0,hidden:!1,cat:"emote"},"BetterTTV Emotes":{id:"bda-es-2",info:"Show BetterTTV Emotes",implemented:!0,hidden:!1,cat:"emote"},"Emote Menu":{id:"bda-es-0",info:"Show Twitch/Favourite emotes in emote menu",implemented:!0,hidden:!1,cat:"emote"},"Emoji Menu":{id:"bda-es-9",info:"Show Discord emoji menu",implemented:!0,hidden:!1,cat:"emote"},"Emote Autocomplete":{id:"bda-es-3",info:"Autocomplete emote commands",implemented:!1,hidden:!1,cat:"emote"},"Emote Auto Capitalization":{id:"bda-es-4",info:"Autocapitalize emote commands",implemented:!0,hidden:!1,cat:"emote"},"Show Names":{id:"bda-es-6",info:"Show emote names on hover",implemented:!0,hidden:!1,cat:"emote"},"Show emote modifiers":{id:"bda-es-8",info:"Enable emote mods",implemented:!0,hidden:!1,cat:"emote"}},links={"Jiiks.net":{text:"Jiiks.net",href:"http://jiiks.net",target:"_blank"},twitter:{text:"Twitter",href:"http://twitter.com/jiiksi",target:"_blank"},github:{text:"Github",href:"http://github.com/jiiks",target:"_blank"}},defaultCookie={version:jsVersion,"bda-gs-0":!1,"bda-gs-1":!0,"bda-gs-2":!1,"bda-gs-3":!1,"bda-gs-4":!1,"bda-gs-5":!0,"bda-es-0":!0,"bda-es-1":!0,"bda-es-2":!0,"bda-es-3":!1,"bda-es-4":!1,"bda-es-5":!0,"bda-es-6":!0,"bda-es-7":!0,"bda-es-8":!0,"bda-jd":!0,"bda-es-8":!0,"bda-dc-0":!1,"bda-css-0":!1,"bda-css-1":!1,"bda-es-9":!0},bdchangelog={changes:{darkmode:{title:"v1.63 : Dark Mode",text:"Dark mode makes certain elements dark by default(currently only applies to emote menu)",img:""},emotemenu:{title:"v1.62 : Brand new emote menu that fits in Discord emoji menu!",text:"The emote menu has been replaced by a new one that injects itself in the Discord emoji menu!",img:""},cccss:{title:"v1.61 : New custom CSS editor",text:"The custom CSS editor now has options and can be detached!",img:""},vdc:{title:"v1.61 : Voice Disconnect",text:"Disconnect from voice server when closing Discord!",img:""},pslist:{title:"v1.60 : New public server list!",text:'New and shiny public server list powered by DiscordServers.com!',img:""},api:{title:"v1.59 : New plugin api callback",text:"Use the `observer(e)` callback instead of creating your own MutationObserver",img:""},emotemods:{title:"v1.59 : New emote mods!",text:"The following emote mods have been added: :shake2, :shake3, :flap",img:""},minmode:{title:"v1.59: Minimal mode",text:"Minimal mode embed fixed size has been removed",img:""}},fixes:{modal:{title:"v1.62 : Fixed modals",text:"Fixed broken modal introduced by 0.0.287",imt:""},emotes:{title:"v1.59 : Native sub emote mods",text:"Emote mods now work with native sub emotes!",img:""},emotes2:{title:"v1.59 : Emote mods and custom emotes",text:"Emote mods will no longer interfere with custom emotes using :",img:""}}},settingsCookie={};Core.prototype.init=function(){function a(){if(console.log((new Date).getTime()+" Defer"),$(".guilds-wrapper .guilds").children().length>0){console.log((new Date).getTime()+" Defer Loaded");var c=($(".guilds>li:first-child"),$("
';if(null!=bdchangelog.changes){a+='

New Stuff

"}if(null!=bdchangelog.fixes){a+='

Fixed

"}if(null!=bdchangelog.upcoming){a+='

Coming Soon

"}return a+='
'},Core.prototype.alert=function(a,b){$("body").append('
'+a+'
×
'+b+"
")};var emotesFfz={},emotesBTTV={},emotesTwitch={emotes:{emote:{image_id:0}}},subEmotesTwitch={};EmoteModule.prototype.init=function(){},EmoteModule.prototype.getBlacklist=function(){$.getJSON("https://cdn.rawgit.com/Jiiks/betterDiscordApp/"+_hash+"/data/emotefilter.json",function(a){bemotes=a.blacklist})},EmoteModule.prototype.obsCallback=function(a){var b=this;if(settingsCookie["bda-es-7"]){$(".emoji").each(function(){var a=$(this);if(-1!=a.attr("src").indexOf(".png")){var b=a.next(),c=a.attr("alt");b.size()>0&&"SPAN"==b.prop("tagName")&&(c+=b.text(),b.remove()),"SPAN"!=a.parent().prop("tagName")?a.replaceWith(""+c+""):a.replaceWith(c)}});for(var c=0;c-1)return;return d.addClass("spoiler"),void d.on("click",function(){$(this).removeClass("spoiler"),spoilered.push($(this).attr("data-reactid"))})}if(!(b.length<4)){if("ClauZ"==b)return void(a=a.replace("ClauZ",''));var f=b,g="",h=["emoteflip","emotespin","emotepulse","emotespin2","emotespin3","emote1spin","emote2spin","emote3spin","emotetr","emotebl","emotebr","emoteshake","emoteshake2","emoteshake3","emoteflap"];if(b.indexOf(":")>-1){var i=b.split(/:(?!.*:)/);""!=i[0]&&""!=i[1]&&(userEmoteCss=!0,f=i[0],settingsCookie["bda-es-8"]&&(g="emote"+i[1],h.indexOf(g)<0&&(g="")))}if(-1==$.inArray(f,bemotes)){if(emotesTwitch.emotes.hasOwnProperty(f)){var j=Math.round(f.length/4),k=f.substr(0,j)+"﷙"+f.substr(j,j)+"﷙"+f.substr(2*j,j)+"﷙"+f.substr(3*j),l=twitchEmoteUrlStart+emotesTwitch.emotes[f].image_id+twitchEmoteUrlEnd;return void(a=a.replace(b,'
'+k+'
'))}if(subEmotesTwitch.hasOwnProperty(f)){var j=Math.round(f.length/4),k=f.substr(0,j)+"﷙"+f.substr(j,j)+"﷙"+f.substr(2*j,j)+"﷙"+f.substr(3*j),l=twitchEmoteUrlStart+subEmotesTwitch[f]+twitchEmoteUrlEnd;return void(a=a.replace(b,'
'+k+'
'))}if("undefined"!=typeof emotesFfz&&settingsCookie["bda-es-1"]&&emotesFfz.hasOwnProperty(f)){var j=Math.round(f.length/4),k=f.substr(0,j)+"﷙"+f.substr(j,j)+"﷙"+f.substr(2*j,j)+"﷙"+f.substr(3*j),l=ffzEmoteUrlStart+emotesFfz[f]+ffzEmoteUrlEnd;return void(a=a.replace(b,'
'+k+'
'))}if("undefined"!=typeof emotesBTTV&&settingsCookie["bda-es-2"]&&emotesBTTV.hasOwnProperty(f)){var j=Math.round(f.length/4),k=f.substr(0,j)+"﷙"+f.substr(j,j)+"﷙"+f.substr(2*j,j)+"﷙"+f.substr(3*j),l=emotesBTTV[f];return void(a=a.replace(b,'
'+k+'
'))}if("undefined"!=typeof emotesBTTV2&&settingsCookie["bda-es-2"]&&emotesBTTV2.hasOwnProperty(f)){var j=Math.round(f.length/4),k=f.substr(0,j)+"﷙"+f.substr(j,j)+"﷙"+f.substr(2*j,j)+"﷙"+f.substr(3*j),l=bttvEmoteUrlStart+emotesBTTV2[f]+bttvEmoteUrlEnd;return void(a=a.replace(b,'
'+k+'
'))}}}}),null!=c.parentElement)){var d=c.parentElement.offsetHeight;c.innerHTML=a.replace(new RegExp("﷙","g"),"");var e=c.parentElement.offsetHeight,f=$(".scroller.messages").first();f.scrollTop(f.scrollTop()+(e-d))}}if("undefined"!=typeof emotesTwitch&&a.parentElement){var c=a.parentElement;if("SPAN"==c.tagName&&($(c.parentElement).hasClass("markup")||$(c.parentElement).hasClass("message-content"))){var d=!1;$(c.parentElement).hasClass("edited")&&(c=c.parentElement.parentElement.firstChild,d=!0),d?setTimeout(b,250):b()}}},EmoteModule.prototype.autoCapitalize=function(){var a=this;$("body").delegate($(".channel-textarea-inner textarea"),"keyup change paste",function(){if(settingsCookie["bda-es-4"]){var b=$(".channel-textarea-inner textarea").val();if(void 0!=b){var c=b.split(" ").pop();if(c.length>3){if("danSgame"==c)return;var d=a.capitalize(c.toLowerCase());null!==d&&void 0!==d&&$(".channel-textarea-inner textarea").val(b.replace(c,d))}}}})},EmoteModule.prototype.capitalize=function(a){var b=emotesTwitch.emotes;for(var c in b)if(b.hasOwnProperty(c)&&a==(c+"").toLowerCase())return c},PublicServers.prototype.getPanel=function(){return this.container},PublicServers.prototype.init=function(){var a=this,b=$(".guilds>li:first-child");b.after($("
  • ",{id:"bd-pub-li",css:{height:"20px",display:1==settingsCookie["bda-gs-1"]?"":"none"}}).append($("
    ",{class:"guild-inner",css:{height:"20px","border-radius":"4px"}}).append($("").append($("
    ",{css:{"line-height":"20px","font-size":"12px"},text:"public",id:"bd-pub-button"}))))),$("#bd-pub-button").on("click",function(){a.show()});var c="";c+='",this.container=c,$("#bd-pub-li").length<1&&setTimeout(function(){a.init()},250)},PublicServers.prototype.show=function(){var a=this;$("body").append(this.getPanel());var b={sort:[{online:"desc"}],from:0,size:20,query:{filtered:{query:{match_all:{}}}}};$("#sbtn").on("click",function(){a.search()}),$("#sterm").on("keyup",function(b){13==b.keyCode&&a.search()}),this.loadServers(b,!1);var a=this;$(document).on("mouseup.bdps",function(b){$("#bd-pub-button").is(b.target)||$("#pubs-container").is(b.target)||0!==$("#pubs-container").has(b.target).length||a.hide()})},PublicServers.prototype.hide=function(){$("#pubs-container").remove(),$(document).off("mouseup.bdps")},PublicServers.prototype.loadServers=function(a,b){var c=this;$("#sbtn").prop("disabled",!0),$("#sterm").prop("disabled",!0),$("#slist").empty(),$("#pubs-spinner").show(),$.ajax({type:"POST",dataType:"json",url:"https://search-discordservers-izrtub5nprzrl76ugyy6hdooe4.us-west-1.es.amazonaws.com/app/_search",crossDomain:!0,data:JSON.stringify(a),success:function(a){var d=a.hits.hits;b?$("#pubs-header-title").text("Public Servers - Search Results: "+d.length):$("#pubs-header-title").text("Public Servers"),d.forEach(function(a){var b=a._source,d=b.invite_code,e='
    ';e+='
    ',e+='
    ',e+=""+b.name+" by "+b.owner.name+"",e+="
    ",e+='
    ',e+=""+b.online+"/"+b.members+" Members",e+="
    ",e+='
    ',e+=""+b.region+"",e+="
    ",e+='
    ',e+="",e+="
    ",e+="
    ",$("#slist").append(e),$("button[data-server-invite-code="+d+"]").on("click",function(){c.joinServer(d)})})},done:function(){$("#pubs-spinner").hide(),$("#sbtn").prop("disabled",!1),$("#sterm").prop("disabled",!1)},always:function(){$("#pubs-spinner").hide(),$("#sbtn").prop("disabled",!1),$("#sterm").prop("disabled",!1)},error:function(){$("#pubs-spinner").hide(),$("#sbtn").prop("disabled",!1),$("#sterm").prop("disabled",!1)},complete:function(){$("#pubs-spinner").hide(),$("#sbtn").prop("disabled",!1),$("#sterm").prop("disabled",!1)}})},PublicServers.prototype.search=function(){var a={sort:[{online:"desc"}],from:0,size:20,query:{filtered:{query:{match_all:{}}}}},b={filter:{and:[{query:{match_phrase_prefix:{name:$("#sterm").val()}}}]}};$("#sterm").val()&&$.extend(a,b),this.loadServers(a,!0)},PublicServers.prototype.joinServer=function(a){$(".guilds-add").click(),$(".action.join .btn").click(),$(".create-guild-container input").val(a),$(".form.join-server .btn-primary").click()},QuickEmoteMenu.prototype.init=function(){$(document).on("mousedown",function(a){"rmenu"!=a.target.id&&$("#rmenu").remove()}),this.favoriteEmotes={};var a=localStorage.bdfavemotes;void 0!=a&&(this.favoriteEmotes=JSON.parse(atob(a)));var b="";b+='
    ',b+=' ',b+=" ",b+="
    ",this.qmeHeader=b;var c="";c+='
    ',c+='
    ',c+='
    ',c+='
    ';for(var d in emotesTwitch.emotes)if(emotesTwitch.emotes.hasOwnProperty(d)){var e=emotesTwitch.emotes[d].image_id;c+='
    ',c+=' ',c+=" ",c+="
    "}c+="
    ",c+="
    ",c+="
    ",c+="
    ",this.teContainer=c;var f="";f+='
    ',f+='
    ',f+='
    ',f+='
    ';for(var d in this.favoriteEmotes){var g=this.favoriteEmotes[d];f+='
    ',f+=' ",f+=" ",f+="
    "}f+="
    ",f+="
    ",f+="
    ",f+="
    ",this.faContainer=f},QuickEmoteMenu.prototype.favContext=function(a,b){a.stopPropagation();var c=$("
    ",{id:"rmenu","data-emoteid":$(b).prop("title"),text:"Remove"});return c.css({top:a.pageY-$("#bda-qem-favourite-container").offset().top,left:a.pageX-$("#bda-qem-favourite-container").offset().left}),$(b).parent().append(c),c.on("click",function(a){return a.preventDefault(),a.stopPropagation(),$(this).remove(),console.log($(this).data("emoteid")),delete quickEmoteMenu.favoriteEmotes[$(this).data("emoteid")],quickEmoteMenu.updateFavorites(),!1}),!1},QuickEmoteMenu.prototype.switchHandler=function(a){this.switchQem($(a).attr("id"))},QuickEmoteMenu.prototype.switchQem=function(a){var b=$("#bda-qem-twitch"),c=$("#bda-qem-favourite"),d=$("#bda-qem-emojis");switch(b.removeClass("active"),c.removeClass("active"),d.removeClass("active"),$(".emoji-picker").hide(),$("#bda-qem-favourite-container").hide(),$("#bda-qem-twitch-container").hide(),a){case"bda-qem-twitch":b.addClass("active"),$("#bda-qem-twitch-container").show();break;case"bda-qem-favourite":c.addClass("active"),$("#bda-qem-favourite-container").show();break;case"bda-qem-emojis":d.addClass("active"),$(".emoji-picker").show()}this.lastTab=a;var e=$(".emote-icon");e.off(),e.on("click",function(){var a=$(this).attr("title"),b=$(".channel-textarea-inner textarea");b.val(" "==b.val().slice(-1)?b.val()+a:b.val()+" "+a)})},QuickEmoteMenu.prototype.obsCallback=function(a){if(settingsCookie["bda-es-9"]?a.removeClass("bda-qme-hidden"):a.addClass("bda-qme-hidden"),settingsCookie["bda-es-0"]){a.prepend(this.qmeHeader),a.append(this.teContainer),a.append(this.faContainer),void 0==this.lastTab&&(this.lastTab="bda-qem-favourite"),this.switchQem(this.lastTab)}},QuickEmoteMenu.prototype.favorite=function(a,b){this.favoriteEmotes.hasOwnProperty(a)||(this.favoriteEmotes[a]=b),this.updateFavorites()},QuickEmoteMenu.prototype.updateFavorites=function(){var a="";a+='
    ',a+='
    ',a+='
    ',a+='
    ';for(var b in this.favoriteEmotes){var c=this.favoriteEmotes[b];a+='
    ',a+=' ",a+=" ",a+="
    "}a+="
    ",a+="
    ",a+="
    ",a+="
    ",this.faContainer=a,$("#bda-qem-favourite-container").replaceWith(a),window.localStorage.bdfavemotes=btoa(JSON.stringify(this.favoriteEmotes))},CustomCssEditor.prototype.init=function(){var a=this;a.hideBackdrop=!1,a.editor=CodeMirror.fromTextArea(document.getElementById("bd-custom-css-ta"),{lineNumbers:!0,mode:"css",indentUnit:4,theme:"neat"}),a.editor.on("change",function(b){var c=b.getValue();a.applyCustomCss(c,!1,!1)});var b="";b+='
    ',b+='
      ',b+="
    • ",b+='
      ',b+='
      ",b+=' Live Update',b+="
      ",b+="
    • ",b+="
    • ",b+='
      ',b+='
      ",b+=' Autosave',b+="
      ",b+="
    • ",b+="
    • ",b+='
      ',b+='
      ",b+=' Hide Backdrop',b+="
      ",b+="
    • ",b+="
    ",b+='
    ',b+=' ',b+=' ',b+=' ',b+="
    ",b+="
    ",this.attachEditor=b,$("#bd-customcss-innerpane").append(b),$("#bd-customcss-detached-update").on("click",function(){return a.applyCustomCss(a.editor.getValue(),!0,!1),!1}),$("#bd-customcss-detached-save").on("click",function(){return a.applyCustomCss(a.editor.getValue(),!1,!0),!1});var c="";c+='
    ',c+='
    ',c+="
    ",c+="
    ",this.detachedEditor=c},CustomCssEditor.prototype.attach=function(){$("#editor-detached").hide(),$("#app-mount").removeClass("bd-detached-editor"),$("#bd-customcss-pane").append($("#bd-customcss-innerpane")),$("#bd-customcss-detached-detach").show(),$("#bd-customcss-detach-container").remove()},CustomCssEditor.prototype.detach=function(){this.attach(),$("#editor-detached").show(),$("#bd-customcss-detached-detach").hide(),$("#app-mount").addClass("bd-detached-editor"),$(".app").parent().append(this.detachedEditor),$("#bd-customcss-detach-editor").append($("#bd-customcss-innerpane"))},CustomCssEditor.prototype.applyCustomCss=function(a,b,c){0==$("#customcss").length&&$("head").append(''),(b||settingsCookie["bda-css-0"])&&$("#customcss").html(a),(c||settingsCookie["bda-css-1"])&&localStorage.setItem("bdcustomcss",btoa(a))};var settingsButton=null,panel=null;SettingsPanel.prototype.init=function(){var a=this;a.construct();var b=$("body");settingsCookie["bda-es-0"]?$("#twitchcord-button-container").show():$("#twitchcord-button-container").hide(),settingsCookie["bda-gs-2"]?b.addClass("bd-minimal"):b.removeClass("bd-minimal"),settingsCookie["bda-gs-3"]?b.addClass("bd-minimal-chan"):b.removeClass("bd-minimal-chan"),settingsCookie["bda-gs-4"]&&voiceMode.enable(),settingsCookie["bda-gs-5"]&&$("#app-mount").addClass("bda-dark"),settingsCookie["bda-es-6"]?(emoteNamePopup=$("
    "),$(document).on("mouseover",".emote",function(){var a=$(this).offset(),b=$(this).attr("alt");$(emoteNamePopup).find(".tipsy-inner").text(b),$(emoteNamePopup).css("left",a.left-25),$(emoteNamePopup).css("top",a.top-32),$("div[data-reactid='.0.1.1']").append($(emoteNamePopup))}),$(document).on("mouseleave",".emote",function(){$(".tipsy").remove()})):$(document).off("mouseover",".emote")};var customCssInitialized=!1,lastTab="";SettingsPanel.prototype.changeTab=function(a){lastTab=a;$("#bd-control-groups");switch($(".bd-tab").removeClass("selected"),$(".bd-pane").hide(),$("#"+a).addClass("selected"),$("#"+a.replace("tab","pane")).show(),a){case"bd-settings-tab":break;case"bd-customcss-tab":customCssInitialized||(customCssEditor.init(),customCssInitialized=!0)}},SettingsPanel.prototype.updateSetting=function(a){var b=$(a).children().find('input[type="checkbox"]'),c=!b.is(":checked"),d=b.attr("id");b.prop("checked",c),"bda-css-2"==d&&($("#app-mount").removeClass("bd-hide-bd"),customCssEditor.hideBackdrop=c,c&&$("#app-mount").addClass("bd-hide-bd")),settingsCookie[d]=c,settingsCookie["bda-es-0"]?$("#twitchcord-button-container").show():$("#twitchcord-button-container").hide(),settingsCookie["bda-gs-2"]?$("body").addClass("bd-minimal"):$("body").removeClass("bd-minimal"),settingsCookie["bda-gs-3"]?$("body").addClass("bd-minimal-chan"):$("body").removeClass("bd-minimal-chan"),settingsCookie["bda-gs-1"]?$("#bd-pub-li").show():$("#bd-pub-li").hide(),settingsCookie["bda-gs-4"]?voiceMode.enable():voiceMode.disable(),$("#app-mount").removeClass("bda-dark"),settingsCookie["bda-gs-5"]&&$("#app-mount").addClass("bda-dark"),settingsCookie["bda-es-6"]?(emoteNamePopup=$("
    "),$(document).on("mouseover",".emote",function(){var a=$(this).offset(),b=$(this).attr("alt");$(emoteNamePopup).find(".tipsy-inner").text(b),$(emoteNamePopup).css("left",a.left-25),$(emoteNamePopup).css("top",a.top-32),$("div[data-reactid='.0.1.1']").append($(emoteNamePopup))}),$(document).on("mouseleave",".emote",function(){$(".tipsy").remove()})):$(document).off("mouseover",".emote"),mainCore.saveSettings()},SettingsPanel.prototype.construct=function(){function a(){$(".tab-bar-item").removeClass("selected"),settingsButton.addClass("selected"),$(".form .settings-right .settings-inner").first().hide(),panel.show(),""==lastTab?c.changeTab("bd-settings-tab"):c.changeTab(lastTab)}function b(){$(".btn.btn-settings").length<1?setTimeout(b,100):$(".btn.btn-settings").first().on("click",function(){function a(){if($(".modal-inner").first().is(":visible")){panel.hide();var b=$(".tab-bar.SIDE").first();$(".tab-bar.SIDE .tab-bar-item").click(function(){$(".form .settings-right .settings-inner").first().show(),$("#bd-settings-new").removeClass("selected"),panel.hide()}),b.append(settingsButton),$(".form .settings-right .settings-inner").last().after(panel),$("#bd-settings-new").removeClass("selected")}else setTimeout(a,100)}a()})}var c=this;panel=$("
    ",{id:"bd-pane",class:"settings-inner",css:{display:"none"}});var d='
    Core
    Emotes
    Custom CSS
    Plugins
    Themes
    ",d+='";var h=atob(localStorage.getItem("bdcustomcss"));customCssEditor.applyCustomCss(h,!0,!1),d+='
    BetterDiscord v'+version+"(JSv"+jsVersion+') by Jiiks BetterDiscord.net
    ',settingsButton=$("
    ",{class:"tab-bar-item",text:"BetterDiscord",id:"bd-settings-new",click:a}),panel.html(d),b()};var _hash;Utils.prototype.getTextArea=function(){return $(".channel-textarea-inner textarea")},Utils.prototype.jqDefer=function(a){window.jQuery?a():setTimeout(function(){this.jqDefer(a)},100)},Utils.prototype.getHash=function(){$.getJSON("https://api.github.com/repos/Jiiks/BetterDiscordApp/commits/master",function(a){_hash=a.sha,emoteModule.getBlacklist()})},Utils.prototype.loadHtml=function(a,b){var c=$("
    ",{class:"bd-container"}).appendTo("body");a="//cdn.rawgit.com/Jiiks/BetterDiscordApp/"+_hash+"/html/"+a+".html",c.load(a,b())},Utils.prototype.injectJs=function(a){$("