Remove april fools and add emote suffixes

This commit is contained in:
Jiiks 2016-04-02 08:23:30 +03:00
parent 8f73d0ad10
commit 536cfab145
4 changed files with 73 additions and 88 deletions

View File

@ -148,6 +148,27 @@
background: rgba(123, 123, 123, 0.37);
}
.emoteflip {
transform:scaleX(-1);
}
.emotespin {
animation: 1s emote-spin infinite linear;
}
.emotepulse {
animation: 1s emote-pulse infinite linear;
}
@keyframes emote-spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
@keyframes emote-pulse {
0% {-webkit-transform: scale(1, 1);}
50% {-webkit-transform: scale(1.2, 1.2);}
100% {-webkit-transform: scale(1, 1);}
}
#tc-settings-panel {
position:fixed;
width:50%;

2
css/main.min.css vendored

File diff suppressed because one or more lines are too long

View File

@ -249,12 +249,12 @@ Core.prototype.initObserver = function () {
/*$(".message-group").each(function () {
var a = $(this).find(".avatar-large");
if (a.length > 0) {
try {
try {
var b = a.css("background-image").match(/\d+/).toString();
if (botlist.indexOf(a) > -1) {
$(this).find(".user-name").addClass("boticon");
}
}catch(err) {}
}catch(err) {}
}
});*/
}
@ -263,11 +263,11 @@ Core.prototype.initObserver = function () {
if (lastMessage != undefined) {
var a = lastMessage.find(".avatar-large");
if (a.length > 0) {
try {
try {
if (botlist.indexOf(a.css("background-image").match(/\d+/).toString()) > -1) {
lastMessage.find(".user-name").addClass("boticon");
}
}catch(err) {}
}catch(err) {}
}
}*/
if (typeof pluginModule !== "undefined") pluginModule.newMessage();
@ -521,96 +521,62 @@ EmoteModule.prototype.injectEmote = function (node) {
}
if ($.inArray(word, bemotes) != -1) return;
var d = new Date();
bdaf = (d.getMonth() == 3 && d.getDate() == 1 && !bdafo);
if (emotesTwitch.emotes.hasOwnProperty(word)) {
if(bdaf) {
var k = Object.keys(emotesTwitch["emotes"]);
var newWord = k[k.length * Math.random() << 0];
var len = Math.round(newWord.length / 4);
var name = newWord.substr(0, len) + "\uFDD9" + newWord.substr(len, len) + "\uFDD9" + newWord.substr(len * 2, len) + "\uFDD9" + newWord.substr(len * 3);
var url = twitchEmoteUrlStart + emotesTwitch.emotes[newWord].image_id + twitchEmoteUrlEnd;
parentInnerHTML = parentInnerHTML.replace(word, '<div class="emotewrapper"><img class="emote" alt="' + name + '" src="' + url + '" /><input onclick=\'quickEmoteMenu.favorite(\"' + name + '\", \"' + url + '\");\' class="fav" title="Favorite!" type="button"></div>');
return;
var useEmoteCss = false;
var sWord = word;
var emoteClass = "";
var allowedClasses = ["flip", "spin", "pulse"];
if(word.indexOf(":") > -1) {
userEmoteCss = true;
sWord = word.split(":")[0];
emoteClass = word.split(":")[1];
if(allowedClasses.indexOf(emoteClass) < 0) {
emoteClass = "";
}
var len = Math.round(word.length / 4);
var name = word.substr(0, len) + "\uFDD9" + word.substr(len, len) + "\uFDD9" + word.substr(len * 2, len) + "\uFDD9" + word.substr(len * 3);
var url = twitchEmoteUrlStart + emotesTwitch.emotes[word].image_id + twitchEmoteUrlEnd;
parentInnerHTML = parentInnerHTML.replace(word, '<div class="emotewrapper"><img class="emote" alt="' + name + '" src="' + url + '" /><input onclick=\'quickEmoteMenu.favorite(\"' + name + '\", \"' + url + '\");\' class="fav" title="Favorite!" type="button"></div>');
}
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, '<div class="emotewrapper"><img class="emote'+emoteClass+'" alt="' + name + '" src="' + url + '"/><input onclick=\'quickEmoteMenu.favorite(\"' + name + '\", \"' + url + '\");\' class="fav" title="Favorite!" type="button"></div>');
return;
}
if (subEmotesTwitch.hasOwnProperty(word)) {
if(bdaf) {
var k = Object.keys(subEmotesTwitch);
var newWord = k[k.length * Math.random() << 0];
var len = Math.round(newWord.length / 4);
var name = newWord.substr(0, len) + "\uFDD9" + newWord.substr(len, len) + "\uFDD9" + newWord.substr(len * 2, len) + "\uFDD9" + newWord.substr(len * 3);
var url = twitchEmoteUrlStart + subEmotesTwitch[newWord] + twitchEmoteUrlEnd;
parentInnerHTML = parentInnerHTML.replace(word, '<div class="emotewrapper"><img class="emote" alt="' + name + '" src="' + url + '" /><input onclick=\'quickEmoteMenu.favorite(\"' + name + '\", \"' + url + '\");\' class="fav" title="Favorite!" type="button"></div>');
return;
}
var len = Math.round(word.length / 4);
var name = word.substr(0, len) + "\uFDD9" + word.substr(len, len) + "\uFDD9" + word.substr(len * 2, len) + "\uFDD9" + word.substr(len * 3);
var url = twitchEmoteUrlStart + subEmotesTwitch[word] + twitchEmoteUrlEnd;
parentInnerHTML = parentInnerHTML.replace(word, '<div class="emotewrapper"><img class="emote" alt="' + name + '" src="' + url + '" /><input onclick=\'quickEmoteMenu.favorite(\"' + name + '\", \"' + url + '\");\' class="fav" title="Favorite!" type="button"></div>');
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, '<div class="emotewrapper"><img class="emote'+emoteClass+'" alt="' + name + '" src="' + url + '"/><input onclick=\'quickEmoteMenu.favorite(\"' + name + '\", \"' + url + '\");\' class="fav" title="Favorite!" type="button"></div>');
return;
}
if (typeof emotesFfz !== 'undefined' && settingsCookie["bda-es-1"]) {
if (emotesFfz.hasOwnProperty(word)) {
if(bdaf) {
var k = Object.keys(emotesFfz);
var newWord = k[k.length * Math.random() << 0];
var len = Math.round(newWord.length / 4);
var name = newWord.substr(0, len) + "\uFDD9" + newWord.substr(len, len) + "\uFDD9" + newWord.substr(len * 2, len) + "\uFDD9" + newWord.substr(len * 3);
var url = ffzEmoteUrlStart + emotesFfz[newWord] + ffzEmoteUrlEnd;
parentInnerHTML = parentInnerHTML.replace(word, '<div class="emotewrapper"><img class="emote" alt="' + name + '" src="' + url + '" /><input onclick=\'quickEmoteMenu.favorite(\"' + name + '\", \"' + url + '\");\' class="fav" title="Favorite!" type="button"></div>');
return;
}
var len = Math.round(word.length / 4);
var name = word.substr(0, len) + "\uFDD9" + word.substr(len, len) + "\uFDD9" + word.substr(len * 2, len) + "\uFDD9" + word.substr(len * 3);
var url = ffzEmoteUrlStart + emotesFfz[word] + ffzEmoteUrlEnd;
parentInnerHTML = parentInnerHTML.replace(word, '<div class="emotewrapper"><img class="emote" alt="' + name + '" src="' + url + '" /><input onclick=\'quickEmoteMenu.favorite(\"' + name + '\", \"' + url + '\");\' class="fav" title="Favorite!" type="button"></div>');
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, '<div class="emotewrapper"><img class="emote'+emoteClass+'" alt="' + name + '" src="' + url + '"/><input onclick=\'quickEmoteMenu.favorite(\"' + name + '\", \"' + url + '\");\' class="fav" title="Favorite!" type="button"></div>');
return;
}
}
if (typeof emotesBTTV !== 'undefined' && settingsCookie["bda-es-2"]) {
if (emotesBTTV.hasOwnProperty(word)) {
if(bdaf) {
var k = Object.keys(emotesBTTV);
var newWord = k[k.length * Math.random() << 0];
var len = Math.round(newWord.length / 4);
var name = newWord.substr(0, len) + "\uFDD9" + newWord.substr(len, len) + "\uFDD9" + newWord.substr(len * 2, len) + "\uFDD9" + newWord.substr(len * 3);
var url = emotesBTTV[newWord];
parentInnerHTML = parentInnerHTML.replace(word, '<div class="emotewrapper"><img class="emote" alt="' + name + '" src="' + url + '" /><input onclick=\'quickEmoteMenu.favorite(\"' + name + '\", \"' + url + '\");\' class="fav" title="Favorite!" type="button"></div>');
return;
}
var len = Math.round(word.length / 4);
var name = word.substr(0, len) + "\uFDD9" + word.substr(len, len) + "\uFDD9" + word.substr(len * 2, len) + "\uFDD9" + word.substr(len * 3);
var url = emotesBTTV[word];
parentInnerHTML = parentInnerHTML.replace(word, '<div class="emotewrapper"><img class="emote" alt="' + name + '" src="' + url + '" /><input onclick=\'quickEmoteMenu.favorite(\"' + name + '\", \"' + url + '\");\' class="fav" title="Favorite!" type="button"></div>');
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, '<div class="emotewrapper"><img class="emote'+emoteClass+'" alt="' + name + '" src="' + url + '"/><input onclick=\'quickEmoteMenu.favorite(\"' + name + '\", \"' + url + '\");\' class="fav" title="Favorite!" type="button"></div>');
return;
}
}
if (typeof emotesBTTV2 !== 'undefined' && settingsCookie["bda-es-2"]) {
if (emotesBTTV2.hasOwnProperty(word)) {
if(bdaf) {
var k = Object.keys(emotesBTTV2);
var newWord = k[k.length * Math.random() << 0];
var len = Math.round(newWord.length / 4);
var name = newWord.substr(0, len) + "\uFDD9" + newWord.substr(len, len) + "\uFDD9" + newWord.substr(len * 2, len) + "\uFDD9" + newWord.substr(len * 3);
var url = bttvEmoteUrlStart + emotesBTTV2[newWord] + bttvEmoteUrlEnd;
parentInnerHTML = parentInnerHTML.replace(word, '<div class="emotewrapper"><img class="emote" alt="' + name + '" src="' + url + '" /><input onclick=\'quickEmoteMenu.favorite(\"' + name + '\", \"' + url + '\");\' class="fav" title="Favorite!" type="button"></div>');
return;
}
var len = Math.round(word.length / 4);
var 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[word] + bttvEmoteUrlEnd;
parentInnerHTML = parentInnerHTML.replace(word, '<div class="emotewrapper"><img class="emote" alt="' + name + '" src="' + url + '" /><input onclick=\'quickEmoteMenu.favorite(\"' + name + '\", \"' + url + '\");\' class="fav" title="Favorite!" type="button"></div>');
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, '<div class="emotewrapper"><img class="emote'+emoteClass+'" alt="' + name + '" src="' + url + '"/><input onclick=\'quickEmoteMenu.favorite(\"' + name + '\", \"' + url + '\");\' class="fav" title="Favorite!" type="button"></div>');
return;
}
}
@ -1039,6 +1005,8 @@ QuickEmoteMenu.prototype.updateFavorites = function () {
});
}
$("#rmenu").on("click", function(e) { $(this).hide(); return false; });
var self = this;
var emoteMenuBody = $("#emote-menu-inner-fav");
emoteMenuBody.empty();

18
js/main.min.js vendored
View File

@ -19,16 +19,12 @@ function inject(){var parentInnerHTML=parent.innerHTML;var words=parentInnerHTML
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",'<img src="https://cdn.frankerfacez.com/emoticon/70852/1" style="width:25px; transform:translate(-29px, -14px);"></img>');return;}
if($.inArray(word,bemotes)!=-1)return;var d=new Date();bdaf=(d.getMonth()==3&&d.getDate()==1&&!bdafo);if(emotesTwitch.emotes.hasOwnProperty(word)){if(bdaf){var k=Object.keys(emotesTwitch["emotes"]);var newWord=k[k.length*Math.random()<<0];var len=Math.round(newWord.length / 4);var name=newWord.substr(0,len)+"\uFDD9"+newWord.substr(len,len)+"\uFDD9"+newWord.substr(len*2,len)+"\uFDD9"+newWord.substr(len*3);var url=twitchEmoteUrlStart+emotesTwitch.emotes[newWord].image_id+twitchEmoteUrlEnd;parentInnerHTML=parentInnerHTML.replace(word,'<div class="emotewrapper"><img class="emote" alt="'+name+'" src="'+url+'" /><input onclick=\'quickEmoteMenu.favorite(\"'+name+'\", \"'+url+'\");\' class="fav" title="Favorite!" type="button"></div>');return;}
var len=Math.round(word.length / 4);var name=word.substr(0,len)+"\uFDD9"+word.substr(len,len)+"\uFDD9"+word.substr(len*2,len)+"\uFDD9"+word.substr(len*3);var url=twitchEmoteUrlStart+emotesTwitch.emotes[word].image_id+twitchEmoteUrlEnd;parentInnerHTML=parentInnerHTML.replace(word,'<div class="emotewrapper"><img class="emote" alt="'+name+'" src="'+url+'" /><input onclick=\'quickEmoteMenu.favorite(\"'+name+'\", \"'+url+'\");\' class="fav" title="Favorite!" type="button"></div>');return;}
if(subEmotesTwitch.hasOwnProperty(word)){if(bdaf){var k=Object.keys(subEmotesTwitch);var newWord=k[k.length*Math.random()<<0];var len=Math.round(newWord.length / 4);var name=newWord.substr(0,len)+"\uFDD9"+newWord.substr(len,len)+"\uFDD9"+newWord.substr(len*2,len)+"\uFDD9"+newWord.substr(len*3);var url=twitchEmoteUrlStart+subEmotesTwitch[newWord]+twitchEmoteUrlEnd;parentInnerHTML=parentInnerHTML.replace(word,'<div class="emotewrapper"><img class="emote" alt="'+name+'" src="'+url+'" /><input onclick=\'quickEmoteMenu.favorite(\"'+name+'\", \"'+url+'\");\' class="fav" title="Favorite!" type="button"></div>');return;}
var len=Math.round(word.length / 4);var name=word.substr(0,len)+"\uFDD9"+word.substr(len,len)+"\uFDD9"+word.substr(len*2,len)+"\uFDD9"+word.substr(len*3);var url=twitchEmoteUrlStart+subEmotesTwitch[word]+twitchEmoteUrlEnd;parentInnerHTML=parentInnerHTML.replace(word,'<div class="emotewrapper"><img class="emote" alt="'+name+'" src="'+url+'" /><input onclick=\'quickEmoteMenu.favorite(\"'+name+'\", \"'+url+'\");\' class="fav" title="Favorite!" type="button"></div>');return;}
if(typeof emotesFfz!=='undefined'&&settingsCookie["bda-es-1"]){if(emotesFfz.hasOwnProperty(word)){if(bdaf){var k=Object.keys(emotesFfz);var newWord=k[k.length*Math.random()<<0];var len=Math.round(newWord.length / 4);var name=newWord.substr(0,len)+"\uFDD9"+newWord.substr(len,len)+"\uFDD9"+newWord.substr(len*2,len)+"\uFDD9"+newWord.substr(len*3);var url=ffzEmoteUrlStart+emotesFfz[newWord]+ffzEmoteUrlEnd;parentInnerHTML=parentInnerHTML.replace(word,'<div class="emotewrapper"><img class="emote" alt="'+name+'" src="'+url+'" /><input onclick=\'quickEmoteMenu.favorite(\"'+name+'\", \"'+url+'\");\' class="fav" title="Favorite!" type="button"></div>');return;}
var len=Math.round(word.length / 4);var name=word.substr(0,len)+"\uFDD9"+word.substr(len,len)+"\uFDD9"+word.substr(len*2,len)+"\uFDD9"+word.substr(len*3);var url=ffzEmoteUrlStart+emotesFfz[word]+ffzEmoteUrlEnd;parentInnerHTML=parentInnerHTML.replace(word,'<div class="emotewrapper"><img class="emote" alt="'+name+'" src="'+url+'" /><input onclick=\'quickEmoteMenu.favorite(\"'+name+'\", \"'+url+'\");\' class="fav" title="Favorite!" type="button"></div>');return;}}
if(typeof emotesBTTV!=='undefined'&&settingsCookie["bda-es-2"]){if(emotesBTTV.hasOwnProperty(word)){if(bdaf){var k=Object.keys(emotesBTTV);var newWord=k[k.length*Math.random()<<0];var len=Math.round(newWord.length / 4);var name=newWord.substr(0,len)+"\uFDD9"+newWord.substr(len,len)+"\uFDD9"+newWord.substr(len*2,len)+"\uFDD9"+newWord.substr(len*3);var url=emotesBTTV[newWord];parentInnerHTML=parentInnerHTML.replace(word,'<div class="emotewrapper"><img class="emote" alt="'+name+'" src="'+url+'" /><input onclick=\'quickEmoteMenu.favorite(\"'+name+'\", \"'+url+'\");\' class="fav" title="Favorite!" type="button"></div>');return;}
var len=Math.round(word.length / 4);var name=word.substr(0,len)+"\uFDD9"+word.substr(len,len)+"\uFDD9"+word.substr(len*2,len)+"\uFDD9"+word.substr(len*3);var url=emotesBTTV[word];parentInnerHTML=parentInnerHTML.replace(word,'<div class="emotewrapper"><img class="emote" alt="'+name+'" src="'+url+'" /><input onclick=\'quickEmoteMenu.favorite(\"'+name+'\", \"'+url+'\");\' class="fav" title="Favorite!" type="button"></div>');return;}}
if(typeof emotesBTTV2!=='undefined'&&settingsCookie["bda-es-2"]){if(emotesBTTV2.hasOwnProperty(word)){if(bdaf){var k=Object.keys(emotesBTTV2);var newWord=k[k.length*Math.random()<<0];var len=Math.round(newWord.length / 4);var name=newWord.substr(0,len)+"\uFDD9"+newWord.substr(len,len)+"\uFDD9"+newWord.substr(len*2,len)+"\uFDD9"+newWord.substr(len*3);var url=bttvEmoteUrlStart+emotesBTTV2[newWord]+bttvEmoteUrlEnd;parentInnerHTML=parentInnerHTML.replace(word,'<div class="emotewrapper"><img class="emote" alt="'+name+'" src="'+url+'" /><input onclick=\'quickEmoteMenu.favorite(\"'+name+'\", \"'+url+'\");\' class="fav" title="Favorite!" type="button"></div>');return;}
var len=Math.round(word.length / 4);var 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[word]+bttvEmoteUrlEnd;parentInnerHTML=parentInnerHTML.replace(word,'<div class="emotewrapper"><img class="emote" alt="'+name+'" src="'+url+'" /><input onclick=\'quickEmoteMenu.favorite(\"'+name+'\", \"'+url+'\");\' class="fav" title="Favorite!" type="button"></div>');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($.inArray(word,bemotes)!=-1)return;var useEmoteCss=false;var sWord=word;var emoteClass="";var allowedClasses=["flip","spin","pulse"];if(word.indexOf(":")>-1){userEmoteCss=true;sWord=word.split(":")[0];emoteClass=word.split(":")[1];if(allowedClasses.indexOf(emoteClass)<0){emoteClass="";}}
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,'<div class="emotewrapper"><img class="emote'+emoteClass+'" alt="'+name+'" src="'+url+'"/><input onclick=\'quickEmoteMenu.favorite(\"'+name+'\", \"'+url+'\");\' class="fav" title="Favorite!" type="button"></div>');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,'<div class="emotewrapper"><img class="emote'+emoteClass+'" alt="'+name+'" src="'+url+'"/><input onclick=\'quickEmoteMenu.favorite(\"'+name+'\", \"'+url+'\");\' class="fav" title="Favorite!" type="button"></div>');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,'<div class="emotewrapper"><img class="emote'+emoteClass+'" alt="'+name+'" src="'+url+'"/><input onclick=\'quickEmoteMenu.favorite(\"'+name+'\", \"'+url+'\");\' class="fav" title="Favorite!" type="button"></div>');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,'<div class="emotewrapper"><img class="emote'+emoteClass+'" alt="'+name+'" src="'+url+'"/><input onclick=\'quickEmoteMenu.favorite(\"'+name+'\", \"'+url+'\");\' class="fav" title="Favorite!" type="button"></div>');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,'<div class="emotewrapper"><img class="emote'+emoteClass+'" alt="'+name+'" src="'+url+'"/><input onclick=\'quickEmoteMenu.favorite(\"'+name+'\", \"'+url+'\");\' class="fav" title="Favorite!" type="button"></div>');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;}}};var publicServers={"servers":{"server":{"code":0,"icon":null,"title":"title","language":"EN","description":"description"}}};function PublicServers(){}
PublicServers.prototype.getPanel=function(){return this.container;};PublicServers.prototype.init=function(){var self=this;this.container=$("<div/>",{id:"bd-ps-container",style:"display:none"});var header=$("<div/>",{id:"bd-ps-header"});$("<h2/>",{text:"Public Servers"}).appendTo(header);$("<span/>",{id:"bd-ps-close",style:"cursor:pointer;",text:"X"}).appendTo(header);header.appendTo(this.getPanel());var psbody=$("<div/>",{id:"bd-ps-body"});psbody.appendTo(this.getPanel());var table=$("<table/>",{border:"0"});var thead=$("<thead/>");thead.appendTo(table);var headers=$("<tr/>",{}).append($("<th/>",{text:"Name"})).append($("<th/>",{text:"Code"})).append($("<th/>",{text:"Language"})).append($("<th/>",{text:"Description"})).append($("<th/>",{text:"Join"}));headers.appendTo(thead);var tbody=$("<tbody/>",{id:"bd-ps-tbody"});tbody.appendTo(table);table.appendTo(psbody);$("body").append(this.getPanel());$("#bd-ps-close").on("click",function(){self.show();});var servers=publicServers.servers;for(var server in servers){if(servers.hasOwnProperty(server)){var s=servers[server];var code=s.code;var title=s.title;var language=s.language;var description=s.description;this.addServer(server,code,title,language,description);}}};PublicServers.prototype.addServer=function(name,code,title,language,description){var self=this;var tableBody=$("#bd-ps-tbody");var desc=$("<td/>").append($("<div/>",{class:"bd-ps-description",text:description}));var tr=$("<tr/>");tr.append($("<td/>",{text:title}));tr.append($("<td/>",{css:{"-webkit-user-select":"initial","user-select":"initial"},text:code}));tr.append($("<td/>",{text:language}));tr.append(desc);tr.append($("<td/>").append($("<button/>",{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(){self.joinServer(code);}})));tableBody.append(tr);};PublicServers.prototype.show=function(){this.getPanel().toggle();var li=$("#bd-pub-li");li.removeClass();if(this.getPanel().is(":visible")){li.addClass("active");}};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();}
@ -36,7 +32,7 @@ var menuOpen;emoteBtn=$("<div/>",{id:"twitchcord-button-container",style:"displa
return false;});$(document).off("click.bdem").on("click.bdem",function(){if(menuOpen){menuOpen=!menuOpen;emoteMenu.removeClass();$("#twitchcord-button").removeClass();}});$("#emote-menu").on("click",function(){$("#rmenu").hide();return false;});if(settingsCookie["bda-es-0"]){$(".channel-textarea").first().addClass("emotemenu-enabled");emoteBtn.show();}
var emoteIcon=$(".emote-icon");emoteIcon.off();emoteIcon.on("click",function(){var emote=$(this).attr("title");var ta=$(".channel-textarea-inner textarea");ta.val(ta.val().slice(-1)==" "?ta.val()+emote:ta.val()+" "+emote);});var fe=localStorage["bdfavemotes"];if(fe!=undefined){favoriteEmotes=JSON.parse(atob(fe));this.updateFavorites();}};var bdfw={};QuickEmoteMenu.prototype.obsCallback=function(){if(!emoteBtn)return;if(!$(".content.flex-spacer.flex-horizontal .flex-spacer.flex-vertical form"))return;var tcbtn=$("#twitchcord-button-container");if(tcbtn.parent().prop("tagName")==undefined){quickEmoteMenu=new QuickEmoteMenu();quickEmoteMenu.init(true);}};var favoriteEmotes={};QuickEmoteMenu.prototype.initEmoteList=function(){emoteMenu=$("<div/>",{id:"emote-menu"});var emoteMenuHeader=$("<div/>",{id:"emote-menu-header"});var emoteMenuBody=$("<div/>",{id:"emote-menu-inner"});var emoteMenuBodyFav=$("<div/>",{id:"emote-menu-inner-fav",css:{"display":"none"}});var globalTab=$("<div/>",{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();}});var favoriteTab=$("<div/>",{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();}});emoteMenuHeader.append(globalTab);emoteMenuHeader.append(favoriteTab);emoteMenu.append(emoteMenuHeader);var swrapper=$("<div/>",{class:"scroller-wrap"});var scroller=$("<div/>",{class:"scroller"});swrapper.append(scroller);scroller.append(emoteMenuBody);scroller.append(emoteMenuBodyFav);emoteMenu.append(swrapper);for(var emote in emotesTwitch.emotes){if(emotesTwitch.emotes.hasOwnProperty(emote)){var id=emotesTwitch.emotes[emote].image_id;emoteMenuBody.append($("<div/>",{class:"emote-container"}).append($("<img/>",{class:"emote-icon",id:emote,alt:"",src:"https://static-cdn.jtvnw.net/emoticons/v1/"+id+"/1.0",title:emote})));}}};QuickEmoteMenu.prototype.favorite=function(name,url){if(!favoriteEmotes.hasOwnProperty(name)){favoriteEmotes[name]=url;}
this.updateFavorites();};QuickEmoteMenu.prototype.updateFavorites=function(){if(!$("#rmenu").length){$("body").append('<div id="rmenu"><ul><a href="#">Remove</a></ul></div>');$(document).on("click",function(){$("#rmenu").hide();});}
var self=this;var emoteMenuBody=$("#emote-menu-inner-fav");emoteMenuBody.empty();for(var emote in favoriteEmotes){var url=favoriteEmotes[emote];var econtainer=$("<div/>",{class:"emote-container"});var icon=$("<img/>",{class:"emote-icon",alt:"",src:url,title:emote}).appendTo(econtainer);emoteMenuBody.append(econtainer);icon.off("click").on("click",function(e){var emote=$(this).attr("title");var ta=$(".channel-textarea-inner textarea");ta.val(ta.val().slice(-1)==" "?ta.val()+emote:ta.val()+" "+emote);});icon.off("contextmenu").on("contextmenu",function(e){var title=$(this).attr("title");var menu=$("#rmenu");menu.find("a").off("click").on("click",function(){delete favoriteEmotes[title];self.updateFavorites();});menu.hide();menu.css({top:e.pageY,left:e.pageX});menu.show();return false;});}
$("#rmenu").on("click",function(e){$(this).hide();return false;});var self=this;var emoteMenuBody=$("#emote-menu-inner-fav");emoteMenuBody.empty();for(var emote in favoriteEmotes){var url=favoriteEmotes[emote];var econtainer=$("<div/>",{class:"emote-container"});var icon=$("<img/>",{class:"emote-icon",alt:"",src:url,title:emote}).appendTo(econtainer);emoteMenuBody.append(econtainer);icon.off("click").on("click",function(e){var emote=$(this).attr("title");var ta=$(".channel-textarea-inner textarea");ta.val(ta.val().slice(-1)==" "?ta.val()+emote:ta.val()+" "+emote);});icon.off("contextmenu").on("contextmenu",function(e){var title=$(this).attr("title");var menu=$("#rmenu");menu.find("a").off("click").on("click",function(){delete favoriteEmotes[title];self.updateFavorites();});menu.hide();menu.css({top:e.pageY,left:e.pageX});menu.show();return false;});}
window.localStorage["bdfavemotes"]=btoa(JSON.stringify(favoriteEmotes));};var settingsButton=null;var panel=null;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");}
SettingsPanel.prototype.init=function(){var self=this;self.construct();var body=$("body");if(settingsCookie["bda-es-0"]){$("#twitchcord-button-container").show();}else{$("#twitchcord-button-container").hide();}
if(settingsCookie["bda-gs-2"]){body.addClass("bd-minimal");}else{body.removeClass("bd-minimal");}