diff --git a/js/main.js b/js/main.js index 8ddd8823..bc7fcd06 100644 --- a/js/main.js +++ b/js/main.js @@ -539,6 +539,7 @@ EmoteModule.prototype.injectEmote = function (node) { return; } + var skipffz = false; var useEmoteCss = false; var sWord = word; var emoteClass = ""; @@ -548,6 +549,10 @@ EmoteModule.prototype.injectEmote = function (node) { if (split[0] != "" && split[1] != "") { userEmoteCss = true; sWord = split[0]; + + //check for bttv mod + if(split[1] == "bttv") skipffz = true; + if(settingsCookie["bda-es-8"]) { emoteClass = "emote" + split[1]; if(allowedClasses.indexOf(emoteClass) < 0) { @@ -573,16 +578,6 @@ EmoteModule.prototype.injectEmote = function (node) { parentInnerHTML = parentInnerHTML.replace(word, '
' + name + '
'); return; } - - if (typeof emotesBTTV2 !== 'undefined' && settingsCookie["bda-es-2"]) { - if (emotesBTTV2.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 = bttvEmoteUrlStart + emotesBTTV2[sWord] + bttvEmoteUrlEnd; - parentInnerHTML = parentInnerHTML.replace(word, '
' + name + '
'); - return; - } - } if (typeof emotesBTTV !== 'undefined' && settingsCookie["bda-es-2"]) { if (emotesBTTV.hasOwnProperty(sWord)) { @@ -594,11 +589,28 @@ EmoteModule.prototype.injectEmote = function (node) { } } - if (typeof emotesFfz !== 'undefined' && settingsCookie["bda-es-1"]) { - if (emotesFfz.hasOwnProperty(sWord)) { + if (typeof emotesFfz !== 'undefined' && settingsCookie["bda-es-1"]) { + //only skip ffz if there is a bttv emote for it + if(!skipffz || !emotesBTTV2.hasOwnProperty(sWord)){ + 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 emotesBTTV2 !== 'undefined' && settingsCookie["bda-es-2"]) { + if (emotesBTTV2.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; + + //if bttv emote is forced change its name for fav. and tooltip and to be able to copy them with the mod + if (skipffz) name = word.substr(0, len) + "\uFDD9" + word.substr(len, len) + "\uFDD9" + word.substr(len * 2, len) + "\uFDD9" + word.substr(len * 3); + + var url = bttvEmoteUrlStart + emotesBTTV2[sWord] + bttvEmoteUrlEnd; parentInnerHTML = parentInnerHTML.replace(word, '
' + name + '
'); return; } diff --git a/js/main.min.js b/js/main.min.js index e259359d..e5fa679a 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 e(){if(console.log((new Date).getTime()+" Defer"),$(".guilds-wrapper .guilds").children().length>0){console.log((new Date).getTime()+" Defer Loaded");var i=($(".guilds>li:first-child"),$("
';if(null!=bdchangelog.changes){e+='

New Stuff

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

Fixed

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

Coming Soon

"}return e+='
'},Core.prototype.alert=function(e,t){$("body").append('
'+e+'
×
'+t+"
")};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(e){bemotes=e.blacklist})},EmoteModule.prototype.obsCallback=function(e){var t=this;if(settingsCookie["bda-es-7"]){$(".emoji").each(function(){var e=$(this);if(-1!=e.attr("src").indexOf(".png")){var t=e.next(),i=e.attr("alt");t.size()>0&&"SPAN"==t.prop("tagName")&&(i+=t.text(),t.remove()),"SPAN"!=e.parent().prop("tagName")?e.replaceWith(""+i+""):e.replaceWith(i)}});for(var i=0;i-1)return;return s.addClass("spoiler"),void s.on("click",function(){$(this).removeClass("spoiler"),spoilered.push($(this).attr("data-reactid"))})}if(!(t.length<4)){if("ClauZ"==t)return void(e=e.replace("ClauZ",''));var n=t,a="",d=["emoteflip","emotespin","emotepulse","emotespin2","emotespin3","emote1spin","emote2spin","emote3spin","emotetr","emotebl","emotebr","emoteshake","emoteshake2","emoteshake3","emoteflap"];if(t.indexOf(":")>-1){var r=t.split(/:(?!.*:)/);""!=r[0]&&""!=r[1]&&(userEmoteCss=!0,n=r[0],settingsCookie["bda-es-8"]&&(a="emote"+r[1],d.indexOf(a)<0&&(a="")))}if(-1==$.inArray(n,bemotes)){if(emotesTwitch.emotes.hasOwnProperty(n)){var c=Math.round(n.length/4),l=n.substr(0,c)+"﷙"+n.substr(c,c)+"﷙"+n.substr(2*c,c)+"﷙"+n.substr(3*c),p=twitchEmoteUrlStart+emotesTwitch.emotes[n].image_id+twitchEmoteUrlEnd;return void(e=e.replace(t,'
'+l+'
'))}if(subEmotesTwitch.hasOwnProperty(n)){var c=Math.round(n.length/4),l=n.substr(0,c)+"﷙"+n.substr(c,c)+"﷙"+n.substr(2*c,c)+"﷙"+n.substr(3*c),p=twitchEmoteUrlStart+subEmotesTwitch[n]+twitchEmoteUrlEnd;return void(e=e.replace(t,'
'+l+'
'))}if("undefined"!=typeof emotesBTTV2&&settingsCookie["bda-es-2"]&&emotesBTTV2.hasOwnProperty(n)){var c=Math.round(n.length/4),l=n.substr(0,c)+"﷙"+n.substr(c,c)+"﷙"+n.substr(2*c,c)+"﷙"+n.substr(3*c),p=bttvEmoteUrlStart+emotesBTTV2[n]+bttvEmoteUrlEnd;return void(e=e.replace(t,'
'+l+'
'))}if("undefined"!=typeof emotesBTTV&&settingsCookie["bda-es-2"]&&emotesBTTV.hasOwnProperty(n)){var c=Math.round(n.length/4),l=n.substr(0,c)+"﷙"+n.substr(c,c)+"﷙"+n.substr(2*c,c)+"﷙"+n.substr(3*c),p=emotesBTTV[n];return void(e=e.replace(t,'
'+l+'
'))}if("undefined"!=typeof emotesFfz&&settingsCookie["bda-es-1"]&&emotesFfz.hasOwnProperty(n)){var c=Math.round(n.length/4),l=n.substr(0,c)+"﷙"+n.substr(c,c)+"﷙"+n.substr(2*c,c)+"﷙"+n.substr(3*c),p=ffzEmoteUrlStart+emotesFfz[n]+ffzEmoteUrlEnd;return void(e=e.replace(t,'
'+l+'
'))}}}}),null!=i.parentElement)){var s=i.parentElement.offsetHeight;i.innerHTML=e.replace(new RegExp("﷙","g"),"");var o=i.parentElement.offsetHeight,n=$(".scroller.messages").first();n.scrollTop(n.scrollTop()+(o-s))}}if("undefined"!=typeof emotesTwitch&&e.parentElement){var i=e.parentElement;if("SPAN"==i.tagName&&($(i.parentElement).hasClass("markup")||$(i.parentElement).hasClass("message-content"))){var s=!1;$(i.parentElement).hasClass("edited")&&(i=i.parentElement.parentElement.firstChild,s=!0),s?setTimeout(t,250):t()}}},EmoteModule.prototype.autoCapitalize=function(){var e=this;$("body").delegate($(".channel-textarea-inner textarea"),"keyup change paste",function(){if(settingsCookie["bda-es-4"]){var t=$(".channel-textarea-inner textarea").val();if(void 0!=t){var i=t.split(" ").pop();if(i.length>3){if("danSgame"==i)return;var s=e.capitalize(i.toLowerCase());null!==s&&void 0!==s&&$(".channel-textarea-inner textarea").val(t.replace(i,s))}}}})},EmoteModule.prototype.capitalize=function(e){var t=emotesTwitch.emotes;for(var i in t)if(t.hasOwnProperty(i)&&e==(i+"").toLowerCase())return i},PublicServers.prototype.getPanel=function(){return this.container},PublicServers.prototype.init=function(){var e=this,t=$(".guilds>li:first-child");t.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(){e.show()});var i="";i+='",this.container=i,$("#bd-pub-li").length<1&&setTimeout(function(){e.init()},250)},PublicServers.prototype.show=function(){var e=this;$("body").append(this.getPanel());var t={sort:[{online:"desc"}],from:0,size:20,query:{filtered:{query:{match_all:{}}}}};$("#sbtn").on("click",function(){e.search()}),$("#sterm").on("keyup",function(t){13==t.keyCode&&e.search()}),this.loadServers(t,!1);var e=this;$(document).on("mouseup.bdps",function(t){$("#bd-pub-button").is(t.target)||$("#pubs-container").is(t.target)||0!==$("#pubs-container").has(t.target).length||e.hide()})},PublicServers.prototype.hide=function(){$("#pubs-container").remove(),$(document).off("mouseup.bdps")},PublicServers.prototype.loadServers=function(e,t){var i=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(e),success:function(e){var s=e.hits.hits;t?$("#pubs-header-title").text("Public Servers - Search Results: "+s.length):$("#pubs-header-title").text("Public Servers"),s.forEach(function(e){var t=e._source,s=t.invite_code,o='
    ';o+='
    ',o+='
    ',o+=""+t.name+" by "+t.owner.name+"",o+="
    ",o+='
    ',o+=""+t.online+"/"+t.members+" Members",o+="
    ",o+='
    ',o+=""+t.region+"",o+="
    ",o+='
    ',o+="",o+="
    ",o+="
    ",$("#slist").append(o),$("button[data-server-invite-code="+s+"]").on("click",function(){i.joinServer(s)})})},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 e={sort:[{online:"desc"}],from:0,size:20,query:{filtered:{query:{match_all:{}}}}},t={filter:{and:[{query:{match_phrase_prefix:{name:$("#sterm").val()}}}]}};$("#sterm").val()&&$.extend(e,t),this.loadServers(e,!0)},PublicServers.prototype.joinServer=function(e){$(".guilds-add").click(),$(".action.join .btn").click(),$(".create-guild-container input").val(e),$(".form.join-server .btn-primary").click()},QuickEmoteMenu.prototype.init=function(){$(document).on("mousedown",function(e){"rmenu"!=e.target.id&&$("#rmenu").remove()}),this.favoriteEmotes={};var e=localStorage.bdfavemotes;void 0!=e&&(this.favoriteEmotes=JSON.parse(atob(e)));var t="";t+='
    ',t+=' ',t+=" ",t+="
    ",this.qmeHeader=t;var i="";i+='
    ',i+='
    ',i+='
    ',i+='
    ';for(var s in emotesTwitch.emotes)if(emotesTwitch.emotes.hasOwnProperty(s)){var o=emotesTwitch.emotes[s].image_id;i+='
    ',i+=' ',i+=" ",i+="
    "}i+="
    ",i+="
    ",i+="
    ",i+="
    ",this.teContainer=i;var n="";n+='
    ',n+='
    ',n+='
    ',n+='
    ';for(var s in this.favoriteEmotes){var a=this.favoriteEmotes[s];n+='
    ',n+=' ",n+=" ",n+="
    "}n+="
    ",n+="
    ",n+="
    ",n+="
    ",this.faContainer=n},QuickEmoteMenu.prototype.favContext=function(e,t){e.stopPropagation();var i=$("
    ",{id:"rmenu","data-emoteid":$(t).prop("title"),text:"Remove"});return i.css({top:e.pageY-$("#bda-qem-favourite-container").offset().top,left:e.pageX-$("#bda-qem-favourite-container").offset().left}),$(t).parent().append(i),i.on("click",function(e){return e.preventDefault(),e.stopPropagation(),$(this).remove(),console.log($(this).data("emoteid")),delete quickEmoteMenu.favoriteEmotes[$(this).data("emoteid")],quickEmoteMenu.updateFavorites(),!1}),!1},QuickEmoteMenu.prototype.switchHandler=function(e){this.switchQem($(e).attr("id"))},QuickEmoteMenu.prototype.switchQem=function(e){var t=$("#bda-qem-twitch"),i=$("#bda-qem-favourite"),s=$("#bda-qem-emojis");switch(t.removeClass("active"),i.removeClass("active"),s.removeClass("active"),$(".emoji-picker").hide(),$("#bda-qem-favourite-container").hide(),$("#bda-qem-twitch-container").hide(),e){case"bda-qem-twitch":t.addClass("active"),$("#bda-qem-twitch-container").show();break;case"bda-qem-favourite":i.addClass("active"),$("#bda-qem-favourite-container").show();break;case"bda-qem-emojis":s.addClass("active"),$(".emoji-picker").show()}this.lastTab=e;var o=$(".emote-icon");o.off(),o.on("click",function(){var e=$(this).attr("title"),t=$(".channel-textarea-inner textarea");t.val(" "==t.val().slice(-1)?t.val()+e:t.val()+" "+e)})},QuickEmoteMenu.prototype.obsCallback=function(e){if(settingsCookie["bda-es-9"]?e.removeClass("bda-qme-hidden"):e.addClass("bda-qme-hidden"),settingsCookie["bda-es-0"]){e.prepend(this.qmeHeader),e.append(this.teContainer),e.append(this.faContainer),void 0==this.lastTab&&(this.lastTab="bda-qem-favourite"),this.switchQem(this.lastTab)}},QuickEmoteMenu.prototype.favorite=function(e,t){this.favoriteEmotes.hasOwnProperty(e)||(this.favoriteEmotes[e]=t),this.updateFavorites()},QuickEmoteMenu.prototype.updateFavorites=function(){var e="";e+='
    ',e+='
    ',e+='
    ',e+='
    ';for(var t in this.favoriteEmotes){var i=this.favoriteEmotes[t];e+='
    ',e+=' ",e+=" ",e+="
    "}e+="
    ",e+="
    ",e+="
    ",e+="
    ",this.faContainer=e,$("#bda-qem-favourite-container").replaceWith(e),window.localStorage.bdfavemotes=btoa(JSON.stringify(this.favoriteEmotes))},CustomCssEditor.prototype.init=function(){var e=this;e.hideBackdrop=!1,e.editor=CodeMirror.fromTextArea(document.getElementById("bd-custom-css-ta"),{lineNumbers:!0,mode:"css",indentUnit:4,theme:"neat"}),e.editor.on("change",function(t){var i=t.getValue();e.applyCustomCss(i,!1,!1)});var t="";t+='
    ',t+='
      ',t+="
    • ",t+='
      ',t+='
      ",t+=' Live Update',t+="
      ",t+="
    • ",t+="
    • ",t+='
      ',t+='
      ",t+=' Autosave',t+="
      ",t+="
    • ",t+="
    • ",t+='
      ',t+='
      ",t+=' Hide Backdrop',t+="
      ",t+="
    • ",t+="
    ",t+='
    ',t+=' ',t+=' ',t+=' ',t+="
    ",t+="
    ",this.attachEditor=t,$("#bd-customcss-innerpane").append(t),$("#bd-customcss-detached-update").on("click",function(){return e.applyCustomCss(e.editor.getValue(),!0,!1),!1}),$("#bd-customcss-detached-save").on("click",function(){return e.applyCustomCss(e.editor.getValue(),!1,!0),!1});var i="";i+='
    ',i+='
    ',i+="
    ",i+="
    ",this.detachedEditor=i},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(e,t,i){0==$("#customcss").length&&$("head").append(''),(t||settingsCookie["bda-css-0"])&&$("#customcss").html(e),(i||settingsCookie["bda-css-1"])&&localStorage.setItem("bdcustomcss",btoa(e))};var settingsButton=null,panel=null;SettingsPanel.prototype.init=function(){var e=this;e.construct();var t=$("body");settingsCookie["bda-es-0"]?$("#twitchcord-button-container").show():$("#twitchcord-button-container").hide(),settingsCookie["bda-gs-2"]?t.addClass("bd-minimal"):t.removeClass("bd-minimal"),settingsCookie["bda-gs-3"]?t.addClass("bd-minimal-chan"):t.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 e=$(this).offset(),t=$(this).attr("alt");$(emoteNamePopup).find(".tipsy-inner").text(t),$(emoteNamePopup).css("left",e.left-25),$(emoteNamePopup).css("top",e.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(e){lastTab=e;$("#bd-control-groups");switch($(".bd-tab").removeClass("selected"),$(".bd-pane").hide(),$("#"+e).addClass("selected"),$("#"+e.replace("tab","pane")).show(),e){case"bd-settings-tab":break;case"bd-customcss-tab":customCssInitialized||(customCssEditor.init(),customCssInitialized=!0)}},SettingsPanel.prototype.updateSetting=function(e){var t=$(e).children().find('input[type="checkbox"]'),i=!t.is(":checked"),s=t.attr("id");t.prop("checked",i),"bda-css-2"==s&&($("#app-mount").removeClass("bd-hide-bd"),customCssEditor.hideBackdrop=i,i&&$("#app-mount").addClass("bd-hide-bd")),settingsCookie[s]=i,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 e=$(this).offset(),t=$(this).attr("alt");$(emoteNamePopup).find(".tipsy-inner").text(t),$(emoteNamePopup).css("left",e.left-25),$(emoteNamePopup).css("top",e.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 e(){$(".tab-bar-item").removeClass("selected"),settingsButton.addClass("selected"),$(".form .settings-right .settings-inner").first().hide(),panel.show(),""==lastTab?i.changeTab("bd-settings-tab"):i.changeTab(lastTab)}function t(){$(".btn.btn-settings").length<1?setTimeout(t,100):$(".btn.btn-settings").first().on("click",function(){function e(){if($(".modal-inner").first().is(":visible")){panel.hide();var t=$(".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()}),t.append(settingsButton),$(".form .settings-right .settings-inner").last().after(panel),$("#bd-settings-new").removeClass("selected")}else setTimeout(e,100)}e()})}var i=this;panel=$("
    ",{id:"bd-pane","class":"settings-inner",css:{display:"none"}});var s='
    Core
    Emotes
    Custom CSS
    Plugins
    Themes
    ';if(null!=bdchangelog.changes){e+='

    New Stuff

      ';for(var t in bdchangelog.changes)t=bdchangelog.changes[t],e+="
    • "+t.title+"
      "+t.text+"
    • ";e+="
    "}if(null!=bdchangelog.fixes){e+='

    Fixed

      ';for(var i in bdchangelog.fixes)i=bdchangelog.fixes[i],e+="
    • "+i.title+"
      "+i.text+"
    • ";e+="
    "}if(null!=bdchangelog.upcoming){e+='

    Coming Soon

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