\
\
- \
+ \
\
\
\
@@ -1812,12 +1812,61 @@ Utils.prototype.importSettings = function() {
}
localStorage["bdcustomcss"] = obj.customCss;
var ccss = atob(localStorage.getItem("bdcustomcss"));
+ if (!customCssInitialized) {
+ customCssEditor.init();
+ customCssInitialized = true;
+ }
customCssEditor.applyCustomCss(ccss, settingsCookie["bda-css-0"], false);
customCssEditor.editor.setValue(ccss);
}catch(err) {
mainCore.alert("Invalid Data", err);
return false;
}
+
+ try {
+ $.each(obj.plugins, function(plugin) {
+ var enabled = obj.plugins[plugin];
+ if(bdplugins.hasOwnProperty(plugin)) {
+ pluginCookie[plugin] = enabled;
+ var cb = $("#"+plugin.replace(" ", "__"));
+ if(cb.is(":checked") && !enabled) {
+ bdplugins[plugin]["plugin"].stop();
+ cb.prop("checked", false);
+ }
+ if(!cb.is(":checked") && enabled) {
+ bdplugins[plugin]["plugin"].start();
+ cb.prop("checked", true);
+ }
+ }
+ });
+ pluginModule.savePluginData();
+ }catch(err) {
+ mainCore.alert("Failed to load plugin data", err);
+ return false;
+ }
+
+ try {
+ themeCookie = obj.themes;
+ $.each(themeCookie, function(theme) {
+ var enabled = themeCookie[theme];
+ var id = "#ti" + theme;
+ if(bdthemes.hasOwnProperty(theme)) {
+ if($(id).is(":checked") && !enabled) {
+ $(id).prop("checked", false);
+ $("#"+theme).remove();
+ }
+ if(!$(id).is(":checked") && enabled) {
+ $(id).prop("checked", true);
+ $("head").append('');
+ }
+ }
+ });
+ themeModule.saveThemeData();
+ }catch(err) {
+ mainCore.alert("Failed to load theme data", err);
+ return false;
+ }
+
return false;
});
};
@@ -1826,7 +1875,7 @@ Utils.prototype.exportSettings = function() {
var obj = {
settings: settingsCookie,
customCss: localStorage["bdcustomcss"],
- plugins: bdplugins,
+ plugins: pluginCookie,
themes: themeCookie,
favEmotes: window.localStorage["bdfavemotes"]
};
@@ -1928,7 +1977,7 @@ PluginModule.prototype.handlePlugin = function (checkbox) {
var cb = $(checkbox).children().find('input[type="checkbox"]');
var enabled = !cb.is(":checked");
- var id = cb.attr("id");
+ var id = cb.attr("id").replace("__", " ");
cb.prop("checked", enabled);
if (enabled) {
diff --git a/js/main.min.js b/js/main.min.js
index e5fa679..5edad32 100644
--- a/js/main.min.js
+++ b/js/main.min.js
@@ -1,2 +1,94 @@
-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"),$("
",{"class":"btn",id:"bd-show-channels",text:"R",css:{cursor:"pointer"},click:function(){settingsCookie["bda-gs-3"]=!1,$("body").removeClass("bd-minimal-chan"),t.saveSettings()}}));if($(".guilds-wrapper").prepend(i),opublicServers=new PublicServers,customCssEditor=new CustomCssEditor,pluginModule=new PluginModule,pluginModule.loadPlugins(),"undefined"!=typeof themesupport2&&(themeModule=new ThemeModule,themeModule.loadThemes()),settingsPanel=new SettingsPanel,settingsPanel.init(),quickEmoteMenu.init(!1),$("#tc-settings-button").on("click",function(){settingsPanel.show()}),window.addEventListener("beforeunload",function(){settingsCookie["bda-dc-0"]&&$(".btn.btn-disconnect").click()}),opublicServers.init(),emoteModule.autoCapitalize(),settingsCookie.version
.CodeMirror{ min-width:100%; }"),$("head").append('')}else setTimeout(e,100)}var t=this;if(version
Please download the latest version from BetterDiscord.net");utils=new Utils;var i=new BdWSocket;i.start(),utils.getHash(),emoteModule=new EmoteModule,quickEmoteMenu=new QuickEmoteMenu,voiceMode=new VoiceMode,emoteModule.init(),this.initSettings(),this.initObserver(),$(document).ready(function(){setTimeout(e,1e3)})},Core.prototype.initSettings=function(){if(void 0==$.cookie("better-discord"))settingsCookie=defaultCookie,this.saveSettings();else{this.loadSettings();for(var e in defaultCookie)void 0==settingsCookie[e]&&(settingsCookie[e]=defaultCookie[e],this.saveSettings())}},Core.prototype.saveSettings=function(){$.cookie("better-discord",JSON.stringify(settingsCookie),{expires:365,path:"/"})},Core.prototype.loadSettings=function(){settingsCookie=JSON.parse($.cookie("better-discord"))};var botlist=["119598467310944259"];Core.prototype.initObserver=function(){mainObserver=new MutationObserver(function(e){e.forEach(function(e){if($(e.target).find(".emoji-picker").length){var t=e.target.firstChild;t.classList.contains("popout")&&quickEmoteMenu.obsCallback($(t))}"undefined"!=typeof pluginModule&&pluginModule.rawObserver(e),null!=e.target.getAttribute("class")&&((e.target.classList.contains("title-wrap")||e.target.classList.contains("chat"))&&(voiceMode.obsCallback(),"undefined"!=typeof pluginModule&&pluginModule.channelSwitch()),-1!=e.target.getAttribute("class").indexOf("scroller messages")&&"undefined"!=typeof pluginModule&&pluginModule.newMessage()),emoteModule.obsCallback(e)})}),mainObserver.observe(document,{childList:!0,subtree:!0})},Core.prototype.constructChangelog=function(){var e=''},Core.prototype.alert=function(e,t){$("body").append('")};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,''))}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,''))}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,''))}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,''))}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,''))}}}}),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+='',i+='
',i+=' ',i+="
",i+=' ",i+='
",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+='",this.teContainer=i;var 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+='",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+='",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='',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){$("",{type:"text/javascript",src:e}).appendTo($("body"))},Utils.prototype.injectCss=function(e){$("",{type:"text/css",rel:"stylesheet",href:e}).appendTo($("head"))},Utils.prototype.log=function(e){console.info("%c[BetterDiscord]%c "+e,"color:teal; font-weight:bold;","")},Utils.prototype.err=function(e){console.info("%c[BetterDiscord]%c "+e,"color:red; font-weight:bold;","")},VoiceMode.prototype.obsCallback=function(){var e=this;settingsCookie["bda-gs-4"]&&(e.disable(),setTimeout(function(){e.enable()},300))},VoiceMode.prototype.enable=function(){$(".scroller.guild-channels ul").first().css("display","none"),$(".scroller.guild-channels header").first().css("display","none"),$(".app.flex-vertical").first().css("overflow","hidden"),$(".chat.flex-vertical.flex-spacer").first().css("visibility","hidden").css("min-width","0px"),$(".flex-vertical.channels-wrap").first().css("flex-grow","100000"),$(".guild-header .btn.btn-hamburger").first().css("visibility","hidden")},VoiceMode.prototype.disable=function(){$(".scroller.guild-channels ul").first().css("display",""),$(".scroller.guild-channels header").first().css("display",""),$(".app.flex-vertical").first().css("overflow",""),$(".chat.flex-vertical.flex-spacer").first().css("visibility","").css("min-width",""),$(".flex-vertical.channels-wrap").first().css("flex-grow",""),$(".guild-header .btn.btn-hamburger").first().css("visibility","")};var pluginCookie={};PluginModule.prototype.loadPlugins=function(){this.loadPluginData(),$.each(bdplugins,function(){var e=this.plugin;e.load();var t=e.getName(),i=!1;pluginCookie.hasOwnProperty(t)?i=pluginCookie[t]:pluginCookie[t]=!1,i&&e.start()})},PluginModule.prototype.handlePlugin=function(e){var t=$(e).children().find('input[type="checkbox"]'),i=!t.is(":checked"),s=t.attr("id");t.prop("checked",i),i?(bdplugins[s].plugin.start(),pluginCookie[s]=!0):(bdplugins[s].plugin.stop(),pluginCookie[s]=!1),this.savePluginData()},PluginModule.prototype.showSettings=function(e){if(null!=bdplugins[e]&&"function"==typeof bdplugins[e].plugin.getSettingsPanel){var t=bdplugins[e].plugin.getSettingsPanel();$(".modal-inner").off("click.bdpsm").on("click.bdpsm",function(e){$("#bd-psm-id").length?$(".bd-psm").remove():$(".bd-psm").attr("id","bd-psm-id")}),$(".modal").append(''),$("#bd-psm-s").append(t)}},PluginModule.prototype.loadPluginData=function(){var e=$.cookie("bd-plugins");void 0!=e&&(pluginCookie=JSON.parse($.cookie("bd-plugins")))},PluginModule.prototype.savePluginData=function(){$.cookie("bd-plugins",JSON.stringify(pluginCookie),{expires:365,path:"/"})},PluginModule.prototype.newMessage=function(){$.each(bdplugins,function(){pluginCookie[this.plugin.getName()]&&"function"==typeof this.plugin.onMessage&&this.plugin.onMessage()})},PluginModule.prototype.channelSwitch=function(){$.each(bdplugins,function(){pluginCookie[this.plugin.getName()]&&"function"==typeof this.plugin.onSwitch&&this.plugin.onSwitch()})},PluginModule.prototype.socketEvent=function(e,t){$.each(bdplugins,function(){pluginCookie[this.plugin.getName()]&&"function"==typeof this.plugin.socketEvent&&this.plugin.socketEvent(t)})},PluginModule.prototype.rawObserver=function(e){$.each(bdplugins,function(){pluginCookie[this.plugin.getName()]&&"function"==typeof this.plugin.observer&&this.plugin.observer(e)})};var themeCookie={};ThemeModule.prototype.loadThemes=function(){this.loadThemeData(),$.each(bdthemes,function(){var e=this.name,t=!1;themeCookie.hasOwnProperty(e)?themeCookie[e]&&(t=!0):themeCookie[e]=!1,t&&$("head").append('")})},ThemeModule.prototype.handleTheme=function(e){var t=$(e).children().find('input[type="checkbox"]'),i=!t.is(":checked"),s=t.attr("id").substring(2);t.prop("checked",i),i?($("head").append('"),themeCookie[s]=!0):($("#"+s).remove(),themeCookie[s]=!1),this.saveThemeData()},ThemeModule.prototype.loadThemeData=function(){var e=$.cookie("bd-themes");void 0!=e&&(themeCookie=JSON.parse($.cookie("bd-themes")))},ThemeModule.prototype.saveThemeData=function(){$.cookie("bd-themes",JSON.stringify(themeCookie),{expires:365,path:"/"})};var bdSocket,bdws;BdWSocket.prototype.start=function(){},BdWSocket.prototype.open=function(e){utils.log("Socket Host: "+e);try{bdSocket=new WebSocket(e),bdSocket.onopen=this.onOpen,bdSocket.onmessage=this.onMessage,bdSocket.onerror=this.onError,bdSocket.onclose=this.onClose}catch(t){utils.log(t)}},BdWSocket.prototype.onOpen=function(){utils.log("Socket Open");var e={op:2,d:{token:JSON.parse(localStorage.getItem("token")),properties:JSON.parse(localStorage.getItem("superProperties")),v:3}};bdws.send(e)},BdWSocket.prototype.onMessage=function(e){var t,i,s;try{t=JSON.parse(e.data),i=t.d,s=t.t}catch(o){return void utils.err(o)}switch(s){case"READY":bdSocket.interval=setInterval(function(){bdws.send({op:1,d:Date.now()})},i.heartbeat_interval),utils.log("Socket Ready");break;case"PRESENCE_UPDATE":pluginModule.socketEvent("PRESENCE_UPDATE",i);break;case"TYPING_START":pluginModule.socketEvent("TYPING_START",i);break;case"MESSAGE_CREATE":pluginModule.socketEvent("MESSAGE_CREATE",i);break;case"MESSAGE_UPDATE":pluginModule.socketEvent("MESSAGE_UPDATE",i)}},BdWSocket.prototype.onError=function(e){utils.log("Socket Error - "+e.message)},BdWSocket.prototype.onClose=function(e){utils.log("Socket Closed - "+e.code+" : "+e.reason),clearInterval(bdSocket.interval),bdws.start()},BdWSocket.prototype.send=function(e){1==bdSocket.readyState&&bdSocket.send(JSON.stringify(e))},BdWSocket.prototype.getSocket=function(){return bdSocket},BdApi.joinServer=function(e){opublicServers.joinServer(e)},BdApi.injectCSS=function(e,t){$("head").append(''),$("#"+e).html(t)},BdApi.clearCSS=function(e){$("#"+e).remove()},BdApi.getPlugin=function(e){return bdplugins.hasOwnProperty(e)?bdplugins[e].plugin:null},BdApi.getIpc=function(){return betterDiscordIPC},BdApi.getCore=function(){return mainCore},BdApi.getUserIdByName=function(e){for(var t=$(".member-username"),i=0;i
Please download the latest version from BetterDiscord.net");return;}
+utils=new Utils();var sock=new BdWSocket();sock.start();utils.getHash();emoteModule=new EmoteModule();quickEmoteMenu=new QuickEmoteMenu();voiceMode=new VoiceMode();emoteModule.init();this.initSettings();this.initObserver();function gwDefer(){console.log(new Date().getTime()+" Defer");if($(".guilds-wrapper .guilds").children().length>0){console.log(new Date().getTime()+" Defer Loaded");var guilds=$(".guilds>li:first-child");var showChannelsButton=$("",{class:"btn",id:"bd-show-channels",text:"R",css:{"cursor":"pointer"},click:function(){settingsCookie["bda-gs-3"]=false;$("body").removeClass("bd-minimal-chan");self.saveSettings();}});$(".guilds-wrapper").prepend(showChannelsButton);opublicServers=new PublicServers();customCssEditor=new CustomCssEditor();pluginModule=new PluginModule();pluginModule.loadPlugins();if(typeof(themesupport2)!=="undefined"){themeModule=new ThemeModule();themeModule.loadThemes();}
+settingsPanel=new SettingsPanel();settingsPanel.init();quickEmoteMenu.init(false);$("#tc-settings-button").on("click",function(){settingsPanel.show();});window.addEventListener("beforeunload",function(){if(settingsCookie["bda-dc-0"]){$('.btn.btn-disconnect').click();}});$(document).on("mousedown",function(e){});opublicServers.init();emoteModule.autoCapitalize();if(settingsCookie["version"].CodeMirror{ min-width:100%; }");$("head").append('');}else{setTimeout(gwDefer,100);}}
+$(document).ready(function(){setTimeout(gwDefer,1000);});};Core.prototype.initSettings=function(){if($.cookie("better-discord")==undefined){settingsCookie=defaultCookie;this.saveSettings();}else{this.loadSettings();for(var setting in defaultCookie){if(settingsCookie[setting]==undefined){settingsCookie[setting]=defaultCookie[setting];this.saveSettings();}}}};Core.prototype.saveSettings=function(){$.cookie("better-discord",JSON.stringify(settingsCookie),{expires:365,path:'/'});};Core.prototype.loadSettings=function(){settingsCookie=JSON.parse($.cookie("better-discord"));};var botlist=["119598467310944259"];Core.prototype.initObserver=function(){mainObserver=new MutationObserver(function(mutations){mutations.forEach(function(mutation){if($(mutation.target).find(".emoji-picker").length){var fc=mutation.target.firstChild;if(fc.classList.contains("popout")){quickEmoteMenu.obsCallback($(fc));}}
+if(typeof pluginModule!=="undefined")pluginModule.rawObserver(mutation);if(mutation.target.getAttribute('class')!=null){if(mutation.target.classList.contains('title-wrap')||mutation.target.classList.contains('chat')){voiceMode.obsCallback();if(typeof pluginModule!=="undefined")pluginModule.channelSwitch();}
+if(mutation.target.getAttribute('class').indexOf('scroller messages')!=-1){if(typeof pluginModule!=="undefined")pluginModule.newMessage();}
+if(settingsCookie["bda-gs-6"]){$(".timestamp").not("[data-24]").each(function(){var t=$(this);t.attr("data-24",true);var text=t.text();var matches=/(.*)?at\s+(\d{1,2}):(\d{1,2})\s+(.*)/.exec(text);if(matches==null)return true;if(matches.length<5)return true;var h=parseInt(matches[2]);if(matches[4]=="AM"){if(h==12)h-=12;}else if(matches[4]=="PM"){if(h<12)h+=12;}
+matches[2]=('0'+h).slice(-2);t.text(matches[1]+matches[2]+":"+matches[3]);});}
+if(settingsCookie["bda-gs-7"]){$(".user-name").not("[data-colour]").each(function(){var t=$(this);var color=t.css("color");if(color=="rgb(255, 255, 255)")return true;t.closest(".message-group").find(".markup").not("[data-colour]").each(function(){$(this).attr("data-colour",true);$(this).css("color",color);});});}}
+emoteModule.obsCallback(mutation);});});mainObserver.observe(document,{childList:true,subtree:true});};Core.prototype.constructChangelog=function(){var changeLog=''+'';return changeLog;};Core.prototype.alert=function(title,text){var id='';for(var i=0;i<5;i++)
+id+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(Math.random()*"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".length));var bdAlert=' ';$("body").append(bdAlert);utils.addBackdrop(id);};var emotesFfz={};var emotesBTTV={};var emotesTwitch={"emotes":{"emote":{"image_id":0}}};var subEmotesTwitch={};function EmoteModule(){}
+EmoteModule.prototype.init=function(){};EmoteModule.prototype.getBlacklist=function(){$.getJSON("https://cdn.rawgit.com/Jiiks/betterDiscordApp/"+_hash+"/data/emotefilter.json",function(data){bemotes=data.blacklist;});};EmoteModule.prototype.obsCallback=function(mutation){var self=this;if(!settingsCookie["bda-es-7"])return;$(".emoji").each(function(){var t=$(this);if(t.attr("src").indexOf(".png")!=-1){var next=t.next();var newText=t.attr("alt");if(next.size()>0){if(next.prop("tagName")=="SPAN"){newText+=next.text();next.remove();}}
+if(t.parent().prop("tagName")!="SPAN"){t.replaceWith(""+newText+"");}else{t.replaceWith(newText);}}});for(var i=0;i-1){return;}
+markup.addClass("spoiler");markup.on("click",function(){$(this).removeClass("spoiler");spoilered.push($(this).attr("data-reactid"));});return;}
+if(word.length<4){return;}
+if(word=="ClauZ"){parentInnerHTML=parentInnerHTML.replace("ClauZ",'');return;}
+var skipffz=false;var useEmoteCss=false;var sWord=word;var emoteClass="";var allowedClasses=["emoteflip","emotespin","emotepulse","emotespin2","emotespin3","emote1spin","emote2spin","emote3spin","emotetr","emotebl","emotebr","emoteshake","emoteshake2","emoteshake3","emoteflap"];if(word.indexOf(":")>-1){var split=word.split(/:(?!.*:)/);if(split[0]!=""&&split[1]!=""){userEmoteCss=true;sWord=split[0];if(split[1]=="bttv")skipffz=true;if(settingsCookie["bda-es-8"]){emoteClass="emote"+split[1];if(allowedClasses.indexOf(emoteClass)<0){emoteClass="";}}}}
+if($.inArray(sWord,bemotes)!=-1)return;if(emotesTwitch.emotes.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=twitchEmoteUrlStart+emotesTwitch.emotes[sWord].image_id+twitchEmoteUrlEnd;parentInnerHTML=parentInnerHTML.replace(word,'');return;}
+if(subEmotesTwitch.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=twitchEmoteUrlStart+subEmotesTwitch[sWord]+twitchEmoteUrlEnd;parentInnerHTML=parentInnerHTML.replace(word,'');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,'');return;}}
+if(typeof emotesFfz!=='undefined'&&settingsCookie["bda-es-1"]){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,'');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);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,'');return;}}});if(parent.parentElement==null)return;var oldHeight=parent.parentElement.offsetHeight;parent.innerHTML=parentInnerHTML.replace(new RegExp("\uFDD9","g"),"");var newHeight=parent.parentElement.offsetHeight;var scrollPane=$(".scroller.messages").first();scrollPane.scrollTop(scrollPane.scrollTop()+(newHeight-oldHeight));}
+if(edited){setTimeout(inject,250);}else{inject();}};EmoteModule.prototype.autoCapitalize=function(){var self=this;$('body').delegate($(".channel-textarea-inner textarea"),'keyup change paste',function(){if(!settingsCookie["bda-es-4"])return;var text=$(".channel-textarea-inner textarea").val();if(text==undefined)return;var lastWord=text.split(" ").pop();if(lastWord.length>3){if(lastWord=="danSgame")return;var ret=self.capitalize(lastWord.toLowerCase());if(ret!==null&&ret!==undefined){$(".channel-textarea-inner textarea").val(text.replace(lastWord,ret));}}});};EmoteModule.prototype.capitalize=function(value){var res=emotesTwitch.emotes;for(var p in res){if(res.hasOwnProperty(p)&&value==(p+'').toLowerCase()){return p;}}};function PublicServers(){}
+PublicServers.prototype.getPanel=function(){return this.container;};PublicServers.prototype.init=function(){this.loadingServers=false;var self=this;var guilds=$(".guilds>li:first-child");guilds.after($("",{id:"bd-pub-li",css:{"height":"20px","display":settingsCookie["bda-gs-1"]==true?"":"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(){self.show();});var panelBase='
';this.container=panelBase;if($("#bd-pub-li").length<1){setTimeout(function(){self.init();},250);}};PublicServers.prototype.show=function(){var self=this;$("body").append(this.getPanel());var dataset={"sort":[{"online":"desc"}],"from":0,"size":20,"query":{"filtered":{"query":{"match_all":{}}}}};$("#pubs-searchbtn").on("click",function(){self.search();});$("#pubs-sterm").on("keyup",function(e){if(e.keyCode==13){self.search();}});this.loadServers(dataset,false,true);var self=this;$(document).on("mouseup.bdps",function(e){if(!$("#bd-pub-button").is(e.target)&&!$("#pubs-container").is(e.target)&&$("#pubs-container").has(e.target).length===0){self.hide();}});$("#pubs-scroller").off("scroll.pubs").on("scroll.pubs",function(){if(self.loadingServers)return;var list=$("#pubs-list");if($(this).scrollTop()+550
';html+='';html+=''+source.name+'';html+='
';html+='';html+=''+source.online+'/'+source.members+' Members';html+='
';html+='';html+=''+source.region+'';html+='
';html+='';html+='';html+='
';html+='';$("#pubs-list").append(html);$("button[data-server-invite-code="+icode+"]").on("click",function(){self.joinServer(icode);});});if(search){$("#pubs-header-title").text("Public Servers - Search Results: "+$("#pubs-list").children().length);}},done:function(){$("#pubs-spinner").hide();$("#pubs-spinner-bottom").hide();$("#pubs-searchbtn").prop("disabled",false);$("#pubs-sterm").prop("disabled",false);self.loadingServers=false;},always:function(){$("#pubs-spinner").hide();$("#pubs-spinner-bottom").hide();$("#pubs-searchbtn").prop("disabled",false);$("#pubs-sterm").prop("disabled",false);self.loadingServers=false;},error:function(){$("#pubs-spinner").hide();$("#pubs-spinner-bottom").hide();$("#pubs-searchbtn").prop("disabled",false);$("#pubs-sterm").prop("disabled",false);self.loadingServers=false;},complete:function(){$("#pubs-spinner").hide();$("#pubs-spinner-bottom").hide();$("#pubs-searchbtn").prop("disabled",false);$("#pubs-sterm").prop("disabled",false);self.loadingServers=false;}});};PublicServers.prototype.search=function(){var dataset={"sort":[{"online":"desc"}],"from":0,"size":20,"query":{"filtered":{"query":{"match_all":{}}}}};var filter={"filter":{"and":[{"query":{"match_phrase_prefix":{"name":$("#pubs-sterm").val()}}}]}};if($("#pubs-sterm").val()){$.extend(dataset,filter);}
+this.loadServers(dataset,true,true);};PublicServers.prototype.joinServer=function(code){$(".guilds-add").click();$(".action.join .btn").click();$(".create-guild-container input").val(code);$(".form.join-server .btn-primary").click();};function QuickEmoteMenu(){}
+QuickEmoteMenu.prototype.init=function(){$(document).on("mousedown",function(e){if(e.target.id!="rmenu")$("#rmenu").remove();});this.favoriteEmotes={};var fe=localStorage["bdfavemotes"];if(fe!=undefined){this.favoriteEmotes=JSON.parse(atob(fe));}
+var qmeHeader="";qmeHeader+="