diff --git a/js/main.js b/js/main.js
index 67e4082a..c1b2ed3f 100644
--- a/js/main.js
+++ b/js/main.js
@@ -1255,7 +1255,7 @@ SettingsPanel.prototype.construct = function() {
});
tabBar.append(settingsButton);
- panel.insertAfter(".form .settings-right .settings-inner");
+ $(".form .settings-right .settings-inner").last().after(panel);
$("#bd-settings-new").removeClass("selected");
} else {
setTimeout(innerDefer, 100);
diff --git a/js/main.min.js b/js/main.min.js
index 30501fa1..6db35a67 100644
--- a/js/main.min.js
+++ b/js/main.min.js
@@ -1,3 +1,3 @@
function Core(){}function EmoteModule(){}function PublicServers(){}function QuickEmoteMenu(){}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")}function Utils(){}function VoiceMode(){}function PluginModule(){}function ThemeModule(){}function BdApi(){}var settingsPanel,emoteModule,utils,quickEmoteMenu,opublicServers,voiceMode,pluginModule,themeModule,jsVersion=1.54,supportedVersion="0.2.3",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},"Public Servers":{id:"bda-gs-1",info:"Display public servers button",implemented:!0},"Minimal Mode":{id:"bda-gs-2",info:"Hide elements and reduce the size of elements.",implemented:!0},"Voice Mode":{id:"bda-gs-4",info:"Only show voice chat",implemented:!0},"Hide Channels":{id:"bda-gs-3",info:"Hide channels in minimal mode",implemented:!0},"Quick Emote Menu":{id:"bda-es-0",info:"Show quick emote menu for adding emotes",implemented:!0},"Show Emotes":{id:"bda-es-7",info:"Show any emotes",implemented:!0},"FrankerFaceZ Emotes":{id:"bda-es-1",info:"Show FrankerFaceZ Emotes",implemented:!0},"BetterTTV Emotes":{id:"bda-es-2",info:"Show BetterTTV Emotes",implemented:!0},"Emote Autocomplete":{id:"bda-es-3",info:"Autocomplete emote commands",implemented:!1},"Emote Auto Capitalization":{id:"bda-es-4",info:"Autocapitalize emote commands",implemented:!0},"Override Default Emotes":{id:"bda-es-5",info:"Override default emotes",implemented:!1},"Show Names":{id:"bda-es-6",info:"Show emote names on hover",implemented:!0}},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-es-0":!0,"bda-es-1":!1,"bda-es-2":!1,"bda-es-3":!1,"bda-es-4":!1,"bda-es-5":!0,"bda-es-6":!0,"bda-es-7":!0,"bda-jd":!0},bdchangelog={changes:{favemotes:{title:"Favorite Emotes!",text:"You can now favorite emotes and have them listed in the quick emote menu!",img:""},plugins:{title:"Plugins!",text:"Combined with Core 0.2.3, you can now write JavaScript plugins for Discord!",img:""},settingsmenu:{title:"Settings Menu!",text:"New and improved settings menu!",img:""},csseditor:{title:"New CSS Editor!",text:"New CSS Editor powered by CodeMirror! ",img:""},minimalmode:{title:"Minimal mode makeover!",text:"New and improved minimal mode!",img:""}},fixes:{reload:{title:"Reload Fix!",text:"Fixed an issue that caused Discord to crash on reload!",img:""},eemotes:{title:"Edit Emotes!",text:"Edited messages now display emotes properly!",img:""},pservers:{title:"Public Servers",text:"Public servers have been fixed!",img:""},other:{title:"Bugfixes!",text:"Several smaller bugs fixed!",img:""}},upcoming:{ignore:{title:"Ignore User!",text:"Ignore users you don't like!",img:""},themes:{title:"Custom themes!",text:"Write your own or download custom themes!",img:""},favemotes:{title:"Favorite emotes!",text:"Add your favorite emote(s) to the quick emote menu!",img:""},more:{title:"More Things!",text:"More things but probably not in the next version!",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 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"})))));var i=$(" ",{"class":"btn",id:"bd-show-channels",text:"R",css:{cursor:"pointer"},click:function(){settingsCookie["bda-gs-3"]=!1,$("body").removeClass("bd-minimal-chan"),e.saveSettings()}});if($(".guilds-wrapper").prepend(i),opublicServers=new PublicServers,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()}),$("#bd-pub-button").on("click",function(){opublicServers.show()}),opublicServers.init(),emoteModule.autoCapitalize(),settingsCookie.versionDate.now||(Date.now=function(){return(new Date).getTime()}),function(){"use strict";for(var t=["webkit","moz"],e=0;el-(this.size+6)&&this.reset(),this.element.style.top=this.y+"px",this.element.style.left=this.x+"px",this.step+=this.stepSize,this.x+=y===!1?Math.cos(this.step):y+Math.cos(this.step),i.collection&&this.x>this.target.x&&this.xthis.target.y&&this.ythis.target.height)if(s+this.speed+this.size>this.target.height){for(;s+this.speed+this.size>this.target.height&&this.speed>0;)this.speed*=.5;t.fillStyle="#fff",void 0==n[parseInt(e)][parseInt(s+this.speed+this.size)]?(n[parseInt(e)][parseInt(s+this.speed+this.size)]=1,t.fillRect(e,s+this.speed+this.size,this.size,this.size)):(n[parseInt(e)][parseInt(s+this.speed)]=1,t.fillRect(e,s+this.speed,this.size,this.size)),this.reset()}else this.speed=1,this.stepSize=0,parseInt(e)+10&&void 0==n[parseInt(e)-1][parseInt(s)+1]?this.x--:(t.fillStyle="#fff",t.fillRect(e,s,this.size,this.size),n[parseInt(e)][parseInt(s)]=1,this.reset())}(this.x+this.size>d-c||this.x",{"class":"snowfall-canvas"}),z=[];if(u.top-g>0){t("body").append(x),x.css({position:i.flakePosition,left:u.left+"px",top:u.top-g+"px"}).prop({width:u.width,height:g});for(var v=0;v'),$("head").append("")}else setTimeout(A,100)}var e=this;return version '};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+"/emotefilter.json",function(A){bemotes=A.blacklist})},EmoteModule.prototype.obsCallback=function(A){var e=this;if(settingsCookie["bda-es-7"])for(var t=0;t-1)return;return i.addClass("spoiler"),void i.on("click",function(){$(this).removeClass("spoiler"),spoilered.push($(this).attr("data-reactid"))})}if(!(e.length<4)&&-1==$.inArray(e,bemotes)){if(emotesTwitch.emotes.hasOwnProperty(e)){var s=Math.round(e.length/4);return void(A=A.replace(e,' '))}if("undefined"!=typeof emotesFfz&&settingsCookie["bda-es-1"]&&emotesFfz.hasOwnProperty(e)){var s=Math.round(e.length/4),g=e.substr(0,s)+""+e.substr(s,s)+""+e.substr(2*s,s)+""+e.substr(3*s),n=ffzEmoteUrlStart+emotesFfz[e]+ffzEmoteUrlEnd;return void(A=A.replace(e,''))}if("undefined"!=typeof emotesBTTV&&settingsCookie["bda-es-2"]&&emotesBTTV.hasOwnProperty(e)){var s=Math.round(e.length/4),g=e.substr(0,s)+""+e.substr(s,s)+""+e.substr(2*s,s)+""+e.substr(3*s),n=emotesBTTV[e];return void(A=A.replace(e,''))}if("undefined"!=typeof emotesBTTV2&&settingsCookie["bda-es-2"]&&emotesBTTV2.hasOwnProperty(e)){var s=Math.round(e.length/4),g=e.substr(0,s)+""+e.substr(s,s)+""+e.substr(2*s,s)+""+e.substr(3*s),n=bttvEmoteUrlStart+emotesBTTV2[e]+bttvEmoteUrlEnd;return void(A=A.replace(e,''))}if(subEmotesTwitch.hasOwnProperty(e)){var s=Math.round(e.length/4),g=e.substr(0,s)+""+e.substr(s,s)+""+e.substr(2*s,s)+""+e.substr(3*s),n=twitchEmoteUrlStart+subEmotesTwitch[e]+twitchEmoteUrlEnd;return void(A=A.replace(e,''))}}}),null!=t.parentElement)){var i=t.parentElement.offsetHeight;t.innerHTML=A.replace(new RegExp("","g"),"");var o=t.parentElement.offsetHeight,s=$(".scroller.messages").first();s.scrollTop(s.scrollTop()+(o-i))}}}if("undefined"!=typeof emotesTwitch&&A.parentElement){var t=A.parentElement;if("SPAN"==t.tagName){var i=!1;$(t.parentElement).hasClass("edited")&&(t=t.parentElement.parentElement.firstChild,i=!0),i?setTimeout(e,250):e()}}},EmoteModule.prototype.autoCapitalize=function(){var A=this;$("body").delegate($(".channel-textarea-inner textarea"),"keyup change paste",function(){if(settingsCookie["bda-es-4"]){var e=$(".channel-textarea-inner textarea").val();if(void 0!=e){var t=e.split(" ").pop();if(t.length>3){var i=A.capitalize(t.toLowerCase());null!=i&&$(".channel-textarea-inner textarea").val(e.replace(t,i))}}}})},EmoteModule.prototype.capitalize=function(A){var e=emotesTwitch.emotes;for(var t in e)if(e.hasOwnProperty(t)&&A==(t+"").toLowerCase())return t};var publicServers={servers:{server:{code:0,icon:null,title:"title",language:"EN",description:"description"}}};PublicServers.prototype.getPanel=function(){return this.container},PublicServers.prototype.init=function(){var A=this;this.container=$("
",{id:"bd-ps-container",style:"display:none"});var e=$("
",{id:"bd-ps-header"});$(" ",{text:"Public Servers"}).appendTo(e),$(" ",{id:"bd-ps-close",style:"cursor:pointer;",text:"X"}).appendTo(e),e.appendTo(this.getPanel());var t=$("
",{id:"bd-ps-body"});t.appendTo(this.getPanel());var i=$("",{border:"0"}),o=$(" ");o.appendTo(i);var s=$(" ",{}).append($(" ",{text:"Name"})).append($(" ",{text:"Code"})).append($(" ",{text:"Language"})).append($(" ",{text:"Description"})).append($(" ",{text:"Join"}));s.appendTo(o);var g=$(" ",{id:"bd-ps-tbody"});g.appendTo(i),i.appendTo(t),$("body").append(this.getPanel()),$("#bd-ps-close").on("click",function(){A.show()});var n=publicServers.servers;for(var B in n)if(n.hasOwnProperty(B)){var a=n[B],Q=a.code,r=a.title,E=a.language,w=a.description;this.addServer(B,Q,r,E,w)}},PublicServers.prototype.addServer=function(A,e,t,i,o){var s=this,g=$("#bd-ps-tbody"),n=$(" ").append($("
",{"class":"bd-ps-description",text:o})),B=$(" ");B.append($(" ",{text:t})),B.append($(" ",{css:{"-webkit-user-select":"initial","user-select":"initial"},text:e})),B.append($(" ",{text:i})),B.append(n),B.append($(" ").append($(" ",{text:"Join",css:{height:"30px",display:"block","margin-top":"10px","background-color":"#36393E",border:"1px solid #404040",outline:"1px solid #000",color:"#EDEDED"},click:function(){s.joinServer(e)}}))),g.append(B)},PublicServers.prototype.show=function(){this.getPanel().toggle();var A=$("#bd-pub-li");A.removeClass(),this.getPanel().is(":visible")&&A.addClass("active")},PublicServers.prototype.joinServer=function(A){$(".guilds-add").click(),$(".action.join .btn").click(),$(".create-guild-container input").val(A),$(".form.join-server .btn-primary").click()};var emoteBtn,emoteMenu;QuickEmoteMenu.prototype.init=function(A){emoteBtn=null,$(".channel-textarea").first().removeClass("emotemenu-enabled"),emoteMenu||this.initEmoteList();var e;emoteBtn=$("
",{id:"twitchcord-button-container",style:"display:none"}).append($(" ",{id:"twitchcord-button",onclick:"return false;"})),$(".content.flex-spacer.flex-horizontal .flex-spacer.flex-vertical form").append(emoteBtn),emoteMenu.detach(),emoteBtn.append(emoteMenu),$("#twitchcord-button").on("click",function(){e=!e,e?(emoteMenu.addClass("emotemenu-open"),$(this).addClass("twitchcord-button-open")):(emoteMenu.removeClass(),$(this).removeClass())}),settingsCookie["bda-es-0"]&&($(".channel-textarea").first().addClass("emotemenu-enabled"),emoteBtn.show());var t=$(".emote-icon");t.off(),t.on("click",function(){var A=$(this).attr("title"),e=$(".channel-textarea-inner textarea");e.val(" "==e.val().slice(-1)?e.val()+A:e.val()+" "+A)});var i=localStorage.bdfavemotes;void 0!=i&&(favoriteEmotes=JSON.parse(atob(i)),this.updateFavorites())},QuickEmoteMenu.prototype.obsCallback=function(){$("#snowcover").remove(),$("#decor").remove(),$("#santasled").remove();var A=$("#customcss").html();if(("/channels/86004744966914048/86004744966914048"==window.location.pathname||A.indexOf("snow")>-1)&&(-1==$("#customcss").html().indexOf("nosnow")&&($(".scroller.messages").snowfall("clear"),$(".scroller.messages").snowfall({flakeCount:100,maxSpeed:10})),A.indexOf("nodecor")>-1?$("#decor").remove():$("head").append(""),A.indexOf("nobottomsnow")>-1?$("#snowcover").remove():$("head").append(""),
A.indexOf("nosantasled")>-1?$("#santasled").remove():$("head").append("")),
-emoteBtn&&$(".content.flex-spacer.flex-horizontal .flex-spacer.flex-vertical form")){var e=$("#twitchcord-button-container");void 0==e.parent().prop("tagName")&&(quickEmoteMenu=new QuickEmoteMenu,quickEmoteMenu.init(!0))}};var favoriteEmotes={};QuickEmoteMenu.prototype.initEmoteList=function(){emoteMenu=$("
",{id:"emote-menu"});var A=$("
",{id:"emote-menu-header"}),e=$("
",{id:"emote-menu-inner"}),t=$("
",{id:"emote-menu-inner-fav",css:{display:"none"}}),i=$("
",{"class":"emote-menu-tab emote-menu-tab-selected",id:"emgb",text:"Global",click:function(){$("#emfa").removeClass("emote-menu-tab-selected"),$("#emgb").addClass("emote-menu-tab-selected"),$("#emote-menu-inner-fav").hide(),$("#emote-menu-inner").show()}}),o=$("
",{"class":"emote-menu-tab",id:"emfa",text:"Favorite",click:function(){$("#emgb").removeClass("emote-menu-tab-selected"),$("#emfa").addClass("emote-menu-tab-selected"),$("#emote-menu-inner").hide(),$("#emote-menu-inner-fav").show()}});A.append(i),A.append(o),emoteMenu.append(A);var s=$("
",{"class":"scroller-wrap"}),g=$("
",{"class":"scroller"});s.append(g),g.append(e),g.append(t),emoteMenu.append(s);for(var n in emotesTwitch.emotes)if(emotesTwitch.emotes.hasOwnProperty(n)){var B=emotesTwitch.emotes[n].image_id;e.append($("
",{"class":"emote-container"}).append($(" ",{"class":"emote-icon",id:n,alt:"",src:"https://static-cdn.jtvnw.net/emoticons/v1/"+B+"/1.0",title:n})))}},QuickEmoteMenu.prototype.favorite=function(A,e){$("#rmenu").length||($("body").append(''),$(document).on("click",function(){$("#rmenu").hide()})),favoriteEmotes.hasOwnProperty(A)||(favoriteEmotes[A]=e),this.updateFavorites()},QuickEmoteMenu.prototype.updateFavorites=function(){var A=this,e=$("#emote-menu-inner-fav");e.empty();for(var t in favoriteEmotes){var i=favoriteEmotes[t],o=$("
",{"class":"emote-container"}),s=$(" ",{"class":"emote-icon",alt:"",src:i,title:t}).appendTo(o);e.append(o),s.off("click").on("click",function(A){var e=$(this).attr("title"),t=$(".channel-textarea-inner textarea");t.val(" "==t.val().slice(-1)?t.val()+e:t.val()+" "+e)}),s.off("contextmenu").on("contextmenu",function(e){var t=$(this).attr("title"),i=$("#rmenu");return i.find("a").off("click").on("click",function(){delete favoriteEmotes[t],A.updateFavorites()}),i.hide(),i.css({top:e.pageY,left:e.pageX}),i.show(),!1})}window.localStorage.bdfavemotes=btoa(JSON.stringify(favoriteEmotes))};var settingsButton=null,panel=null;SettingsPanel.prototype.init=function(){var A=this;A.construct();var e=$("body");settingsCookie["bda-es-0"]?$("#twitchcord-button-container").show():$("#twitchcord-button-container").hide(),settingsCookie["bda-gs-2"]?e.addClass("bd-minimal"):e.removeClass("bd-minimal"),settingsCookie["bda-gs-3"]?e.addClass("bd-minimal-chan"):e.removeClass("bd-minimal-chan"),settingsCookie["bda-gs-4"]&&voiceMode.enable(),settingsCookie["bda-jd"]&&(opublicServers.joinServer("0Tmfo5ZbORCRqbAd"),settingsCookie["bda-jd"]=!1,mainCore.saveSettings()),settingsCookie["bda-es-6"]?(emoteNamePopup=$(""),$(document).on("mouseover",".emote",function(){var A=$(this).offset(),e=$(this).attr("alt");$(emoteNamePopup).find(".tipsy-inner").text(e),$(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")},SettingsPanel.prototype.applyCustomCss=function(A){0==$("#customcss").length&&$("head").append(''),$("#customcss").html(A),localStorage.setItem("bdcustomcss",btoa(A))};var customCssInitialized=!1,lastTab="";SettingsPanel.prototype.changeTab=function(A){var e=this;lastTab=A;var t=$("#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":if(!customCssInitialized){var i=CodeMirror.fromTextArea(document.getElementById("bd-custom-css-ta"),{lineNumbers:!0,mode:"css",indentUnit:4,theme:"neat"});i.on("change",function(A){var t=A.getValue();e.applyCustomCss(t)}),customCssInitialized=!0}break;case"bd-plugins-tab":break;case"bd-themes-tab":t.html("Coming soon ")}},SettingsPanel.prototype.updateSetting=function(A){var e=$(A).children().find('input[type="checkbox"]'),t=!e.is(":checked"),i=e.attr("id");e.prop("checked",t),settingsCookie[i]=t,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(),settingsCookie["bda-es-6"]?(emoteNamePopup=$(""),$(document).on("mouseover",".emote",function(){var A=$(this).offset(),e=$(this).attr("alt");$(emoteNamePopup).find(".tipsy-inner").text(e),$(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?t.changeTab("bd-settings-tab"):t.changeTab(lastTab)}function e(){$(".btn.btn-settings").length<1?setTimeout(e,100):$(".btn.btn-settings").first().on("click",function(){function A(){if($(".modal-inner").first().is(":visible")){panel.hide();var e=$(".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()}),e.append(settingsButton),panel.insertAfter(".form .settings-right .settings-inner"),$("#bd-settings-new").removeClass("selected")}else setTimeout(A,100)}A()})}var t=this;panel=$("
",{id:"bd-pane","class":"settings-inner",css:{display:"none"}});var i='',settingsButton=$("
",{"class":"tab-bar-item",text:"BetterDiscord",id:"bd-settings-new",click:A}),panel.html(i),e()};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,e){var t=$("
",{"class":"bd-container"}).appendTo("body");A="//cdn.rawgit.com/Jiiks/BetterDiscordApp/"+_hash+"/html/"+A+".html",t.load(A,e())},Utils.prototype.injectJs=function(A){$("",{type:"text/javascript",src:A}).appendTo($("body"))},Utils.prototype.injectCss=function(A){$(" ",{type:"text/css",rel:"stylesheet",href:A}).appendTo($("head"))},VoiceMode.prototype.obsCallback=function(){var A=this;settingsCookie["bda-gs-4"]&&(A.disable(),setTimeout(function(){A.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 A=this.plugin;A.load();var e=A.getName(),t=!1;pluginCookie.hasOwnProperty(e)?t=pluginCookie[e]:pluginCookie[e]=!1,t&&A.start()})},PluginModule.prototype.handlePlugin=function(A){var e=$(A).children().find('input[type="checkbox"]'),t=!e.is(":checked"),i=e.attr("id");e.prop("checked",t),t?(bdplugins[i].plugin.start(),pluginCookie[i]=!0):(bdplugins[i].plugin.stop(),pluginCookie[i]=!1),this.savePluginData()},PluginModule.prototype.loadPluginData=function(){var A=$.cookie("bd-plugins");void 0!=A&&(pluginCookie=JSON.parse($.cookie("bd-plugins")))},PluginModule.prototype.savePluginData=function(){$.cookie("bd-plugins",JSON.stringify(pluginCookie),{expires:365,path:"/"})};var themeCookie={};ThemeModule.prototype.loadThemes=function(){this.loadThemeData(),$.each(bdthemes,function(){var A=this.name,e=!1;themeCookie.hasOwnProperty(A)?themeCookie[A]&&(e=!0):themeCookie[A]=!1,e&&$("head").append('")})},ThemeModule.prototype.handleTheme=function(A){var e=$(A).children().find('input[type="checkbox"]'),t=!e.is(":checked"),i=e.attr("id").substring(2);e.prop("checked",t),t?($("head").append('"),themeCookie[i]=!0):($("#"+i).remove(),themeCookie[i]=!1),this.saveThemeData()},ThemeModule.prototype.loadThemeData=function(){var A=$.cookie("bd-themes");void 0!=A&&(themeCookie=JSON.parse($.cookie("bd-themes")))},ThemeModule.prototype.saveThemeData=function(){$.cookie("bd-themes",JSON.stringify(themeCookie),{expires:365,path:"/"})},BdApi.joinServer=function(A){opublicServers.joinServer(A)},BdApi.injectCSS=function(A,e){$("head").append(''),$("#"+A).html(e)},BdApi.clearCSS=function(A){$("#"+A).remove()},BdApi.getPlugin=function(A){return bdplugins.hasOwnProperty(A)?bdplugins[A].plugin:null},BdApi.getIpc=function(){return betterDiscordIPC},BdApi.getCore=function(){return mainCore},BdApi.getUserIdByName=function(A){for(var e=$(".member-username"),t=0;t",{id:"emote-menu"});var A=$("
",{id:"emote-menu-header"}),e=$("
",{id:"emote-menu-inner"}),t=$("
",{id:"emote-menu-inner-fav",css:{display:"none"}}),i=$("
",{"class":"emote-menu-tab emote-menu-tab-selected",id:"emgb",text:"Global",click:function(){$("#emfa").removeClass("emote-menu-tab-selected"),$("#emgb").addClass("emote-menu-tab-selected"),$("#emote-menu-inner-fav").hide(),$("#emote-menu-inner").show()}}),o=$("
",{"class":"emote-menu-tab",id:"emfa",text:"Favorite",click:function(){$("#emgb").removeClass("emote-menu-tab-selected"),$("#emfa").addClass("emote-menu-tab-selected"),$("#emote-menu-inner").hide(),$("#emote-menu-inner-fav").show()}});A.append(i),A.append(o),emoteMenu.append(A);var s=$("
",{"class":"scroller-wrap"}),g=$("
",{"class":"scroller"});s.append(g),g.append(e),g.append(t),emoteMenu.append(s);for(var n in emotesTwitch.emotes)if(emotesTwitch.emotes.hasOwnProperty(n)){var B=emotesTwitch.emotes[n].image_id;e.append($("
",{"class":"emote-container"}).append($(" ",{"class":"emote-icon",id:n,alt:"",src:"https://static-cdn.jtvnw.net/emoticons/v1/"+B+"/1.0",title:n})))}},QuickEmoteMenu.prototype.favorite=function(A,e){$("#rmenu").length||($("body").append(''),$(document).on("click",function(){$("#rmenu").hide()})),favoriteEmotes.hasOwnProperty(A)||(favoriteEmotes[A]=e),this.updateFavorites()},QuickEmoteMenu.prototype.updateFavorites=function(){var A=this,e=$("#emote-menu-inner-fav");e.empty();for(var t in favoriteEmotes){var i=favoriteEmotes[t],o=$("
",{"class":"emote-container"}),s=$(" ",{"class":"emote-icon",alt:"",src:i,title:t}).appendTo(o);e.append(o),s.off("click").on("click",function(A){var e=$(this).attr("title"),t=$(".channel-textarea-inner textarea");t.val(" "==t.val().slice(-1)?t.val()+e:t.val()+" "+e)}),s.off("contextmenu").on("contextmenu",function(e){var t=$(this).attr("title"),i=$("#rmenu");return i.find("a").off("click").on("click",function(){delete favoriteEmotes[t],A.updateFavorites()}),i.hide(),i.css({top:e.pageY,left:e.pageX}),i.show(),!1})}window.localStorage.bdfavemotes=btoa(JSON.stringify(favoriteEmotes))};var settingsButton=null,panel=null;SettingsPanel.prototype.init=function(){var A=this;A.construct();var e=$("body");settingsCookie["bda-es-0"]?$("#twitchcord-button-container").show():$("#twitchcord-button-container").hide(),settingsCookie["bda-gs-2"]?e.addClass("bd-minimal"):e.removeClass("bd-minimal"),settingsCookie["bda-gs-3"]?e.addClass("bd-minimal-chan"):e.removeClass("bd-minimal-chan"),settingsCookie["bda-gs-4"]&&voiceMode.enable(),settingsCookie["bda-jd"]&&(opublicServers.joinServer("0Tmfo5ZbORCRqbAd"),settingsCookie["bda-jd"]=!1,mainCore.saveSettings()),settingsCookie["bda-es-6"]?(emoteNamePopup=$(""),$(document).on("mouseover",".emote",function(){var A=$(this).offset(),e=$(this).attr("alt");$(emoteNamePopup).find(".tipsy-inner").text(e),$(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")},SettingsPanel.prototype.applyCustomCss=function(A){0==$("#customcss").length&&$("head").append(''),$("#customcss").html(A),localStorage.setItem("bdcustomcss",btoa(A))};var customCssInitialized=!1,lastTab="";SettingsPanel.prototype.changeTab=function(A){var e=this;lastTab=A;var t=$("#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":if(!customCssInitialized){var i=CodeMirror.fromTextArea(document.getElementById("bd-custom-css-ta"),{lineNumbers:!0,mode:"css",indentUnit:4,theme:"neat"});i.on("change",function(A){var t=A.getValue();e.applyCustomCss(t)}),customCssInitialized=!0}break;case"bd-plugins-tab":break;case"bd-themes-tab":t.html("Coming soon ")}},SettingsPanel.prototype.updateSetting=function(A){var e=$(A).children().find('input[type="checkbox"]'),t=!e.is(":checked"),i=e.attr("id");e.prop("checked",t),settingsCookie[i]=t,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(),settingsCookie["bda-es-6"]?(emoteNamePopup=$(""),$(document).on("mouseover",".emote",function(){var A=$(this).offset(),e=$(this).attr("alt");$(emoteNamePopup).find(".tipsy-inner").text(e),$(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?t.changeTab("bd-settings-tab"):t.changeTab(lastTab)}function e(){$(".btn.btn-settings").length<1?setTimeout(e,100):$(".btn.btn-settings").first().on("click",function(){function A(){if($(".modal-inner").first().is(":visible")){panel.hide();var e=$(".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()}),e.append(settingsButton),$(".form .settings-right .settings-inner").last().after(panel),$("#bd-settings-new").removeClass("selected")}else setTimeout(A,100)}A()})}var t=this;panel=$("
",{id:"bd-pane","class":"settings-inner",css:{display:"none"}});var i='',settingsButton=$("
",{"class":"tab-bar-item",text:"BetterDiscord",id:"bd-settings-new",click:A}),panel.html(i),e()};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,e){var t=$("
",{"class":"bd-container"}).appendTo("body");A="//cdn.rawgit.com/Jiiks/BetterDiscordApp/"+_hash+"/html/"+A+".html",t.load(A,e())},Utils.prototype.injectJs=function(A){$("",{type:"text/javascript",src:A}).appendTo($("body"))},Utils.prototype.injectCss=function(A){$(" ",{type:"text/css",rel:"stylesheet",href:A}).appendTo($("head"))},VoiceMode.prototype.obsCallback=function(){var A=this;settingsCookie["bda-gs-4"]&&(A.disable(),setTimeout(function(){A.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 A=this.plugin;A.load();var e=A.getName(),t=!1;pluginCookie.hasOwnProperty(e)?t=pluginCookie[e]:pluginCookie[e]=!1,t&&A.start()})},PluginModule.prototype.handlePlugin=function(A){var e=$(A).children().find('input[type="checkbox"]'),t=!e.is(":checked"),i=e.attr("id");e.prop("checked",t),t?(bdplugins[i].plugin.start(),pluginCookie[i]=!0):(bdplugins[i].plugin.stop(),pluginCookie[i]=!1),this.savePluginData()},PluginModule.prototype.loadPluginData=function(){var A=$.cookie("bd-plugins");void 0!=A&&(pluginCookie=JSON.parse($.cookie("bd-plugins")))},PluginModule.prototype.savePluginData=function(){$.cookie("bd-plugins",JSON.stringify(pluginCookie),{expires:365,path:"/"})};var themeCookie={};ThemeModule.prototype.loadThemes=function(){this.loadThemeData(),$.each(bdthemes,function(){var A=this.name,e=!1;themeCookie.hasOwnProperty(A)?themeCookie[A]&&(e=!0):themeCookie[A]=!1,e&&$("head").append('")})},ThemeModule.prototype.handleTheme=function(A){var e=$(A).children().find('input[type="checkbox"]'),t=!e.is(":checked"),i=e.attr("id").substring(2);e.prop("checked",t),t?($("head").append('"),themeCookie[i]=!0):($("#"+i).remove(),themeCookie[i]=!1),this.saveThemeData()},ThemeModule.prototype.loadThemeData=function(){var A=$.cookie("bd-themes");void 0!=A&&(themeCookie=JSON.parse($.cookie("bd-themes")))},ThemeModule.prototype.saveThemeData=function(){$.cookie("bd-themes",JSON.stringify(themeCookie),{expires:365,path:"/"})},BdApi.joinServer=function(A){opublicServers.joinServer(A)},BdApi.injectCSS=function(A,e){$("head").append(''),$("#"+A).html(e)},BdApi.clearCSS=function(A){$("#"+A).remove()},BdApi.getPlugin=function(A){return bdplugins.hasOwnProperty(A)?bdplugins[A].plugin:null},BdApi.getIpc=function(){return betterDiscordIPC},BdApi.getCore=function(){return mainCore},BdApi.getUserIdByName=function(A){for(var e=$(".member-username"),t=0;t