diff --git a/js/main.js b/js/main.js index 4aab2649..6d474323 100644 --- a/js/main.js +++ b/js/main.js @@ -654,7 +654,7 @@ PublicServers.prototype.init = function () { }))))); $("#bd-pub-button").on("click", function () { - this.show(); + self.show(); }); var panelBase=""; diff --git a/js/main.min.js b/js/main.min.js index 9c7b8f26..963051ad 100644 --- a/js/main.min.js +++ b/js/main.min.js @@ -27,7 +27,7 @@ if(typeof emotesFfz!=='undefined'&&settingsCookie["bda-es-1"]){if(emotesFfz.hasO if(typeof emotesBTTV!=='undefined'&&settingsCookie["bda-es-2"]){if(emotesBTTV.hasOwnProperty(sWord)){var len=Math.round(sWord.length / 4);var name=sWord.substr(0,len)+"\uFDD9"+sWord.substr(len,len)+"\uFDD9"+sWord.substr(len*2,len)+"\uFDD9"+sWord.substr(len*3);var url=emotesBTTV[sWord];parentInnerHTML=parentInnerHTML.replace(word,'
'+name+'
');return;}} if(typeof emotesBTTV2!=='undefined'&&settingsCookie["bda-es-2"]){if(emotesBTTV2.hasOwnProperty(sWord)){var len=Math.round(sWord.length / 4);var name=sWord.substr(0,len)+"\uFDD9"+sWord.substr(len,len)+"\uFDD9"+sWord.substr(len*2,len)+"\uFDD9"+sWord.substr(len*3);var url=bttvEmoteUrlStart+emotesBTTV2[sWord]+bttvEmoteUrlEnd;parentInnerHTML=parentInnerHTML.replace(word,'
'+name+'
');return;}}});if(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(){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(){this.show();});var panelBase="";panelBase+="
    ";panelBase+="
    ";panelBase+=" <\/span><\/span><\/span><\/span>";panelBase+=" <\/div>";panelBase+="
    ";panelBase+="

    Public Servers<\/h2>";panelBase+=" ';html+='

    ';html+='
    ';$("#slist").append(html);$("button[data-server-invite-code="+icode+"]").on("click",function(){self.joinServer(icode);});});},done:function(){$("#pubs-spinner").hide();$("#sbtn").prop("disabled",false);$("#sterm").prop("disabled",false);},always:function(){$("#pubs-spinner").hide();$("#sbtn").prop("disabled",false);$("#sterm").prop("disabled",false);},error:function(){$("#pubs-spinner").hide();$("#sbtn").prop("disabled",false);$("#sterm").prop("disabled",false);},complete:function(){$("#pubs-spinner").hide();$("#sbtn").prop("disabled",false);$("#sterm").prop("disabled",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":$("#sterm").val()}}}]}};if($("#sterm").val()){$.extend(dataset,filter);} this.loadServers(dataset,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();};var emoteBtn,emoteMenu;var eiarr=[1,3,4,6,7,8,10,11,12,13,14];function QuickEmoteMenu(){} QuickEmoteMenu.prototype.init=function(reload){emoteBtn=null;$(".channel-textarea").first().removeClass("emotemenu-enabled");if(!emoteMenu){this.initEmoteList();}