diff --git a/js/main.min.js b/js/main.min.js
index c1cd11a13..253d94e31 100644
--- a/js/main.min.js
+++ b/js/main.min.js
@@ -1 +1,2043 @@
-function Core(){}function EmoteModule(){}function PublicServers(){}function QuickEmoteMenu(){}function SettingsPanel(){}function Utils(){}function VoiceMode(){}var settingsPanel,emoteModule,utils,quickEmoteMenu,opublicServers,voiceMode,jsVersion=1.52,supportedVersion="0.1.5",mainObserver,twitchEmoteUrlStart="https://static-cdn.jtvnw.net/emoticons/v1/",twitchEmoteUrlEnd="/1.0",ffzEmoteUrlStart="https://cdn.frankerfacez.com/emoticon/",ffzEmoteUrlEnd="/1",bttvEmoteUrlStart="",bttvEmoteUrlEnd="",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:null,fixes:{compact:{title:"Compact Mode Emotes!",text:"Compact Mode Emotes have been fixed and should now be visible!",img:""}},upcoming:{ignore:{title:"Ignore User!",text:"Ignore users you don't like",img:""},more:{title:"More Things!",text:"More things but probably not in the next version.",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");i.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 s=$(" ",{"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(s),opublicServers=new PublicServers,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')}else setTimeout(e,100)}var t=this;return version '};var emotesFfz={},emotesBTTV={},emotesTwitch={emotes:{emote:{image_id:0}}},subEmotesTwitch={},twitchAc={"4head":"4Head",anele:"ANELE",argieb8:"ArgieB8",arsonnosexy:"ArsonNoSexy",asianglow:"AsianGlow",atgl:"AtGL",athenapms:"AthenaPMS",ativy:"AtIvy",atww:"AtWW",babyrage:"BabyRage",batchest:"BatChest",bcwarrior:"BCWarrior",biblethump:"BibleThump",bigbrother:"BigBrother",bionicbunion:"BionicBunion",blargnaut:"BlargNaut",bloodtrail:"BloodTrail",bort:"BORT",brainslug:"BrainSlug",brokeback:"BrokeBack",buddhabar:"BuddhaBar",coolcat:"CoolCat",corgiderp:"CorgiDerp",cougarhunt:"CougarHunt",daesuppy:"DAESuppy",dansgame:"DansGame",dathass:"DatHass",datsheffy:"DatSheffy",dbstyle:"DBstyle",deexcite:"deExcite",deilluminati:"deIlluminati",dendiface:"DendiFace",dogface:"DogFace",doomguy:"DOOMGuy",eagleeye:"EagleEye",elegiggle:"EleGiggle",evilfetus:"EvilFetus",failfish:"FailFish",fpsmarksman:"FPSMarksman",frankerz:"FrankerZ",freakinstinkin:"FreakinStinkin",fungineer:"FUNgineer",funrun:"FunRun",fuzzyotteroo:"FuzzyOtterOO",gasjoker:"GasJoker",gingerpower:"GingerPower",grammarking:"GrammarKing",hassanchop:"HassanChop",heyguys:"HeyGuys",hotpokket:"HotPokket",humblelife:"HumbleLife",itsboshytime:"ItsBoshyTime",jebaited:"Jebaited",jkanstyle:"JKanStyle",joncarnage:"JonCarnage",kapow:"KAPOW",kappa:"Kappa",kappapride:"KappaPride",keepo:"Keepo",kevinturtle:"KevinTurtle",kippa:"Kippa",kreygasm:"Kreygasm",kzskull:"KZskull",mau5:"Mau5",mcat:"mcaT",mechasupes:"MechaSupes",mrdestructoid:"MrDestructoid",mvgame:"MVGame",nightbat:"NightBat",ninjatroll:"NinjaTroll",nonospot:"NoNoSpot",notatk:"NotATK",notlikethis:"NotLikeThis",omgscoots:"OMGScoots",onehand:"OneHand",opieop:"OpieOP",optimizeprime:"OptimizePrime",osbeaver:"OSbeaver",osbury:"OSbury",osdeo:"OSdeo",osfrog:"OSfrog",oskomodo:"OSkomodo",osrob:"OSrob",ossloth:"OSsloth",panicbasket:"panicBasket",panicvis:"PanicVis",pazpazowitz:"PazPazowitz",peopleschamp:"PeoplesChamp",permasmug:"PermaSmug",picomause:"PicoMause",pipehype:"PipeHype",pjharley:"PJHarley",pjsalt:"PJSalt",pmstwin:"PMSTwin",pogchamp:"PogChamp",poooound:"Poooound",praiseit:"PraiseIt",prchase:"PRChase",punchtrees:"PunchTrees",puppeyface:"PuppeyFace",raccattack:"RaccAttack",ralpherz:"RalpherZ",redcoat:"RedCoat",residentsleeper:"ResidentSleeper",ritzmitz:"RitzMitz",rulefive:"RuleFive",shadylulu:"ShadyLulu",shazam:"Shazam",shazamicon:"shazamicon",shazbotstix:"ShazBotstix",shibez:"ShibeZ",smorc:"SMOrc",smskull:"SMSkull",sobayed:"SoBayed",soonerlater:"SoonerLater",srihead:"SriHead",ssssss:"SSSsss",stonelightning:"StoneLightning",strawbeary:"StrawBeary",supervinlin:"SuperVinlin",swiftrage:"SwiftRage",tbbaconbiscuit:"tbBaconBiscuit",tbchickenbiscuit:"tbChickenBiscuit",tbquesarito:"tbQuesarito",tbsausagebiscuit:"tbSausageBiscuit",tbspicy:"tbSpicy",tbsriracha:"tbSriracha",tf2john:"TF2John",theking:"TheKing",theringer:"TheRinger",thetarfu:"TheTarFu",thething:"TheThing",thunbeast:"ThunBeast",tinyface:"TinyFace",toospicy:"TooSpicy",trihard:"TriHard",ttours:"TTours",uleetbackup:"UleetBackup",unclenox:"UncleNox",unsane:"UnSane",vaultboy:"VaultBoy",volcania:"Volcania",wholewheat:"WholeWheat",winwaker:"WinWaker",wtruck:"WTRuck",wutface:"WutFace",youwhy:"YouWHY"};EmoteModule.prototype.init=function(){},EmoteModule.prototype.getBlacklist=function(){$.getJSON("https://cdn.rawgit.com/Jiiks/betterDiscordApp/"+_hash+"/emotefilter.json",function(e){bemotes=e.blacklist})},EmoteModule.prototype.obsCallback=function(e){var t=this;if(settingsCookie["bda-es-7"])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(-1==$.inArray(e,bemotes)&&!(e.length<4))return emotesTwitch.emotes.hasOwnProperty(e)?settingsCookie["bda-es-6"]?void(i=i.replace(e,' ')):void(i=i.replace(e," ")):"undefined"!=typeof emotesFfz&&settingsCookie["bda-es-1"]&&emotesFfz.hasOwnProperty(e)?settingsCookie["bda-es-6"]?void(i=i.replace(e,' ')):void(i=i.replace(e," ")):"undefined"!=typeof emotesBTTV&&settingsCookie["bda-es-2"]&&emotesBTTV.hasOwnProperty(e)?settingsCookie["bda-es-6"]?void(i=i.replace(e,' ')):void(i=i.replace(e," ")):subEmotesTwitch.hasOwnProperty(e)?settingsCookie["bda-es-6"]?void(i=i.replace(e,' ')):void(i=i.replace(e," ")):void 0}),null!=t.parentElement)){var o=t.parentElement.offsetHeight;t.innerHTML=i.replace(new RegExp("","g"),"");var n=t.parentElement.offsetHeight,a=$(".scroller.messages").first();a.scrollTop(a.scrollTop()+(n-o))}}}},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){var s=e.capitalize(i.toLowerCase());null!=s&&$(".channel-textarea-inner textarea").val(t.replace(i,s))}}}})},EmoteModule.prototype.capitalize=function(e){return twitchAc.hasOwnProperty(e)?twitchAc[e]:null};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 e=this;this.container=$("
",{id:"bd-ps-container",style:"display:none"});var t=$("
",{id:"bd-ps-header"});$(" ",{text:"Public Servers"}).appendTo(t),$(" ",{id:"bd-ps-close",style:"cursor:pointer;",text:"X"}).appendTo(t),t.appendTo(this.getPanel());var i=$("
",{id:"bd-ps-body"});i.appendTo(this.getPanel());var s=$("",{border:"0"}),o=$(" ");o.appendTo(s);var n=$(" ",{}).append($(" ",{text:"Name"})).append($(" ",{text:"Code"})).append($(" ",{text:"Language"})).append($(" ",{text:"Description"})).append($(" ",{text:"Join"}));n.appendTo(o);var a=$(" ",{id:"bd-ps-tbody"});a.appendTo(s),s.appendTo(i),$("body").append(this.getPanel()),$("#bd-ps-close").on("click",function(){e.show()});var r=publicServers.servers;for(var l in r)if(r.hasOwnProperty(l)){var d=r[l],c=d.code,p=d.title,h=d.language,u=d.description;this.addServer(l,c,p,h,u)}},PublicServers.prototype.addServer=function(e,t,i,s,o){var n=this,a=$("#bd-ps-tbody"),r=$(" ").append($("
",{"class":"bd-ps-description",text:o})),l=$(" ");l.append($(" ",{text:i})),l.append($(" ",{css:{"-webkit-user-select":"initial","user-select":"initial"},text:t})),l.append($(" ",{text:s})),l.append(r),l.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(){n.joinServer(t)}}))),a.append(l)},PublicServers.prototype.show=function(){this.getPanel().toggle();var e=$("#bd-pub-li");e.removeClass(),this.getPanel().is(":visible")&&e.addClass("active")},PublicServers.prototype.joinServer=function(e){$(".guilds-add").click(),$(".action.join .btn").click(),$(".create-guild-container input").val(e),$(".form.join-server .btn-primary").click()};var emoteBtn,emoteMenu;QuickEmoteMenu.prototype.init=function(e){emoteBtn=null,$(".channel-textarea").first().removeClass("emotemenu-enabled"),emoteMenu||this.initEmoteList();var t;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(){t=!t,t?(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 i=$(".emote-icon");i.off(),i.on("click",function(){var e=$(this).attr("id"),t=$(".channel-textarea-inner textarea");t.val(" "==t.val().slice(-1)?t.val()+e:t.val()+" "+e)})},QuickEmoteMenu.prototype.obsCallback=function(){if(("/channels/86004744966914048/86004744966914048"==window.location.pathname||$("#customcss").html().indexOf("snow")>-1)&&-1==$("#customcss").html().indexOf("nosnow")&&($(".scroller.messages").snowfall("clear"),$(".scroller.messages").snowfall({flakeCount:100,maxSpeed:10})),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))}},QuickEmoteMenu.prototype.initEmoteList=function(){emoteMenu=$("
",{id:"emote-menu"});var e=$("
",{id:"emote-menu-header"}).append($(" ",{text:"Global Emotes"})),t=$("
",{id:"emote-menu-inner"});emoteMenu.append(e),emoteMenu.append(t);for(var i in emotesTwitch.emotes)if(emotesTwitch.emotes.hasOwnProperty(i)){var s=emotesTwitch.emotes[i].image_id;t.append($("
",{"class":"emote-container"}).append($(" ",{"class":"emote-icon",id:i,alt:"",src:"https://static-cdn.jtvnw.net/emoticons/v1/"+s+"/1.0",title:i})))}};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-jd"]&&(opublicServers.joinServer("0Tmfo5ZbORCRqbAd"),settingsCookie["bda-jd"]=!1,mainCore.saveSettings())},SettingsPanel.prototype.applyCustomCss=function(e){0==$("#customcss").length&&$("head").append(''),$("#customcss").html(e),localStorage.setItem("bdcustomcss",btoa(e))},SettingsPanel.prototype.construct=function(){function e(){var e=$(this).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(),mainCore.saveSettings()}function t(){$(".tab-bar-item").removeClass("selected"),settingsButton.addClass("selected"),$(".form .settings-right .settings-inner").first().hide(),panel.show()}function i(){$(".btn.btn-settings").length<1?setTimeout(i,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),panel.insertAfter(".form .settings-right .settings-inner"),$("#bd-settings-new").removeClass("selected")}else setTimeout(e,100)}e()})}var s=this;panel=$("
",{"class":"settings-inner",style:"display:none;"});var o=$("
",{"class":" scroller-wrap polyfil"});panel.append(o);var n=$("
",{"class":"scroller settings-wrapper settings-panel"}),a=$("
",{"class":"scrollbar"}).append($("
",{"class":"track"}).append($("
",{"class":"thumb"})));n.append(a),o.append(n);var r=$("
",{"class":"control-groups"}),l=$("
",{"class":"control-groups"});n.append(r),n.append(l);var d=$("
",{"class":"control-group"}),c=$("
",{"class":"control-group"});r.append(d),l.append(c),d.append($(" ",{text:"BetterDiscord Settings"})),c.append($(" ",{text:"Custom CSS"}));var p=$("",{id:"custom-css-ta"}),h=atob(localStorage.getItem("bdcustomcss"));s.applyCustomCss(h),p.val(h),c.append(p),p.on("input propertychange",function(){s.applyCustomCss($(this).val())});var u=$("",{"class":"checkbox-group"});for(var m in settings){var g=settings[m],b=g.id;g.implemented&&u.append($(" ").append($("
",{"class":"checkbox",click:e}).append($("
",{"class":"checkbox-inner"}).append($(" ",{type:"checkbox",id:b,prop:{checked:settingsCookie[b]}})).append($(" "))).append($(" ",{text:m+" - "+g.info}))))}d.append(u);var f=$("
",{css:{background:"#1A1A1A",color:"#ADADAD",height:"30px",position:"absolute",bottom:"0",left:"0",right:"0"}}),v=$(" ",{text:"BetterDiscord v"+version+"(JSv"+jsVersion+") by Jiiks",css:{"line-height":"30px","margin-left":"10px"}}),w=$(" ",{css:{"float":"right","line-height":"30px","margin-right":"10px"}});for(var k in links)$(" ",{text:links[k].text,href:links[k].href,target:links[k].target}).append($(" ",{text:" | "})).appendTo(w);f.append(v),f.append(w),o.append(f),settingsButton=$("
",{"class":"tab-bar-item",text:"BetterDiscord",id:"bd-settings-new",click:t}),i()};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()})},VoiceMode.prototype.obsCallback=function(){console.log("voiceMode obs");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","")};
\ No newline at end of file
+/* BetterDiscordApp Core JavaScript
+ * Version: 1.53
+ * Author: Jiiks | http://jiiks.net
+ * Date: 27/08/2015 - 16:36
+ * Last Update: 02/04/2016
+ * https://github.com/Jiiks/BetterDiscordApp
+ */
+var settingsPanel, emoteModule, utils, quickEmoteMenu, opublicServers, voiceMode, pluginModule, themeModule, customCssEditor;
+var jsVersion = 1.6;
+var supportedVersion = "0.2.5";
+
+var mainObserver;
+
+var twitchEmoteUrlStart = "https://static-cdn.jtvnw.net/emoticons/v1/";
+var twitchEmoteUrlEnd = "/1.0";
+var ffzEmoteUrlStart = "https://cdn.frankerfacez.com/emoticon/";
+var ffzEmoteUrlEnd = "/1";
+var bttvEmoteUrlStart = "https://cdn.betterttv.net/emote/";
+var bttvEmoteUrlEnd = "/1x";
+
+var mainCore;
+
+var settings = {
+ "Save logs locally": { "id": "bda-gs-0", "info": "Saves chat logs locally", "implemented": false, "hidden": false},
+ "Public Servers": { "id": "bda-gs-1", "info": "Display public servers button", "implemented": true, "hidden": false},
+ "Minimal Mode": { "id": "bda-gs-2", "info": "Hide elements and reduce the size of elements.", "implemented": true, "hidden": false},
+ "Voice Mode": { "id": "bda-gs-4", "info": "Only show voice chat", "implemented": true, "hidden": false},
+ "Hide Channels": { "id": "bda-gs-3", "info": "Hide channels in minimal mode", "implemented": true, "hidden": false},
+ "Quick Emote Menu": { "id": "bda-es-0", "info": "Show quick emote menu for adding emotes", "implemented": true, "hidden": false},
+ "Show Emotes": { "id": "bda-es-7", "info": "Show any emotes", "implemented": true, "hidden": false},
+ "FrankerFaceZ Emotes": { "id": "bda-es-1", "info": "Show FrankerFaceZ Emotes", "implemented": true, "hidden": false},
+ "BetterTTV Emotes": { "id": "bda-es-2", "info": "Show BetterTTV Emotes", "implemented": true, "hidden": false},
+ "Emote Autocomplete": { "id": "bda-es-3", "info": "Autocomplete emote commands", "implemented": false, "hidden": false},
+ "Emote Auto Capitalization": { "id": "bda-es-4", "info": "Autocapitalize emote commands", "implemented": true, "hidden": false},
+ "Override Default Emotes": { "id": "bda-es-5", "info": "Override default emotes", "implemented": false, "hidden": false},
+ "Show Names": { "id": "bda-es-6", "info": "Show emote names on hover", "implemented": true, "hidden": false},
+ "Show emote modifiers": { "id": "bda-es-8", "info": "Enable/Disable emote mods", "implemented": true, "hidden": false},
+ "Custom css live update": { "id": "bda-css-0", "info": "", "implemented": true, "hidden": true },
+ "Custom css auto udpate": { "id": "bda-css-1", "info": "", "implemented": true, "hidden": true }
+};
+
+var 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" }
+};
+
+var defaultCookie = {
+ "version": jsVersion,
+ "bda-gs-0": false,
+ "bda-gs-1": true,
+ "bda-gs-2": false,
+ "bda-gs-3": false,
+ "bda-gs-4": false,
+ "bda-es-0": true,
+ "bda-es-1": true,
+ "bda-es-2": true,
+ "bda-es-3": false,
+ "bda-es-4": false,
+ "bda-es-5": true,
+ "bda-es-6": true,
+ "bda-es-7": true,
+ "bda-es-8": true,
+ "bda-jd": true,
+ "bda-es-8": true,
+ "bda-css-0": false,
+ "bda-css-1": false
+};
+
+var bdchangelog = {
+ "changes": {
+ "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": {
+ "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": ""
+ }
+ }
+};
+
+var settingsCookie = {};
+
+function Core() {}
+
+Core.prototype.init = function () {
+ var self = this;
+
+ if (version < supportedVersion) {
+ this.alert("Not Supported", "BetterDiscord v" + version + "(your version)" + " is not supported by the latest js(" + jsVersion + "). 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();
+
+ //Incase were too fast
+ 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();
+ });
+
+ opublicServers.init();
+
+ emoteModule.autoCapitalize();
+
+ /*Display new features in BetterDiscord*/
+ if (settingsCookie["version"] < jsVersion) {
+ var cl = self.constructChangelog();
+ $("body").append(cl);
+ settingsCookie["version"] = jsVersion;
+ self.saveSettings();
+ }
+
+ $("head").append("");
+ $("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"]; //Temp
+Core.prototype.initObserver = function () {
+ mainObserver = new MutationObserver(function (mutations) {
+ mutations.forEach(function (mutation) {
+ if (typeof pluginModule !== "undefined") pluginModule.rawObserver(mutation);
+ if (mutation.target.getAttribute('class') != null) {
+ //console.log(mutation.target)
+ if(mutation.target.classList.contains('title-wrap') || mutation.target.classList.contains('chat')){
+ quickEmoteMenu.obsCallback();
+ voiceMode.obsCallback();
+ if (typeof pluginModule !== "undefined") pluginModule.channelSwitch();
+ }
+ if (mutation.target.getAttribute('class').indexOf('scroller messages') != -1) {
+ if (typeof pluginModule !== "undefined") pluginModule.newMessage();
+ }
+ }
+ emoteModule.obsCallback(mutation);
+ });
+ });
+
+ //noinspection JSCheckFunctionSignatures
+ mainObserver.observe(document, {
+ childList: true,
+ subtree: true
+ });
+};
+
+Core.prototype.constructChangelog = function () {
+ var changeLog = '' +
+ '' +
+ '
' +
+ '
' +
+ ' ' +
+ '
' +
+ ' ' +
+ '
' +
+ '
' +
+ '
';
+
+ return changeLog;
+};
+
+Core.prototype.alert = function (title, text) {
+ $("body").append('' +
+ '');
+};
+
+/* BetterDiscordApp EmoteModule JavaScript
+ * Version: 1.5
+ * Author: Jiiks | http://jiiks.net
+ * Date: 26/08/2015 - 15:29
+ * Last Update: 14/10/2015 - 09:48
+ * https://github.com/Jiiks/BetterDiscordApp
+ * Note: Due to conflicts autocapitalize only supports global emotes
+ */
+
+/*
+ * =Changelog=
+ * -v1.5
+ * --Twitchemotes.com api
+ */
+
+var emotesFfz = {};
+var emotesBTTV = {};
+var emotesTwitch = {
+ "emotes": {
+ "emote": {
+ "image_id": 0
+ }
+ }
+}; //for ide
+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 < mutation.addedNodes.length; ++i) {
+ var next = mutation.addedNodes.item(i);
+ if (next) {
+ var nodes = self.getNodes(next);
+ for (var node in nodes) {
+ if (nodes.hasOwnProperty(node)) {
+ self.injectEmote(nodes[node]);
+ }
+ }
+ }
+ }
+};
+
+EmoteModule.prototype.getNodes = function (node) {
+ var next;
+ var nodes = [];
+
+ var treeWalker = document.createTreeWalker(node, NodeFilter.SHOW_TEXT, null, false);
+
+ while (next = treeWalker.nextNode()) {
+ nodes.push(next);
+ }
+
+
+ return nodes;
+};
+
+var bemotes = [];
+var spoilered = [];
+
+EmoteModule.prototype.injectEmote = function (node) {
+
+ if (typeof emotesTwitch === 'undefined') return;
+
+ if (!node.parentElement) return;
+
+ var parent = node.parentElement;
+
+ if (parent.tagName != "SPAN") return;
+ if (!$(parent.parentElement).hasClass("markup") && !$(parent.parentElement).hasClass("message-content")) {
+ return;
+ }
+
+ var edited = false;
+
+ if ($(parent.parentElement).hasClass("edited")) {
+ parent = parent.parentElement.parentElement.firstChild;
+ edited = true;
+ }
+
+ function inject() {
+ var parentInnerHTML = parent.innerHTML;
+ var words = parentInnerHTML.split(/\s+/g);
+
+ if (!words) return;
+
+ words.some(function (word) {
+ if (word.slice(0, 4) == "[!s]") {
+
+ parentInnerHTML = parentInnerHTML.replace("[!s]", "");
+ var markup = $(parent).parent();
+ var reactId = markup.attr("data-reactid");
+
+ if (spoilered.indexOf(reactId) > -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 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) {
+ // userEmoteCss = true;
+ //sWord = word.split(":")[0];
+ var split = word.split(/:(?!.*:)/);
+ if (split[0] != "" && split[1] != "") {
+ userEmoteCss = true;
+ sWord = split[0];
+ if(settingsCookie["bda-es-8"]) {
+ // emoteClass = "emote" + word.split(":")[1];
+ 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 emotesFfz !== 'undefined' && settingsCookie["bda-es-1"]) {
+ if (emotesFfz.hasOwnProperty(sWord)) {
+ var len = Math.round(sWord.length / 4);
+ var name = sWord.substr(0, len) + "\uFDD9" + sWord.substr(len, len) + "\uFDD9" + sWord.substr(len * 2, len) + "\uFDD9" + sWord.substr(len * 3);
+ var url = ffzEmoteUrlStart + emotesFfz[sWord] + ffzEmoteUrlEnd;
+ parentInnerHTML = parentInnerHTML.replace(word, '');
+ 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 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, '');
+ 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;
+ }
+ }
+};
+
+/* BetterDiscordApp PublicSevers JavaScripts
+ * Version: 1.0
+ * Author: Jiiks | http://jiiks.net
+ * Date: 27/08/2015 - 14:16
+ * https://github.com/Jiiks/BetterDiscordApp
+ */
+
+function PublicServers() {
+
+}
+
+PublicServers.prototype.getPanel = function () {
+ return this.container;
+};
+
+PublicServers.prototype.init = function () {
+ 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="";
+ panelBase += "";
+ panelBase += "
";
+ panelBase += " <\/span><\/span><\/span><\/span>";
+ panelBase += " <\/div>";
+ panelBase += "