BTTV Emotes

This commit is contained in:
Jiiks 2015-10-26 00:02:31 +02:00
parent c632d0ecb9
commit f3f6485d37
1 changed files with 14 additions and 18 deletions

View File

@ -69,7 +69,6 @@ Core.prototype.init = function() {
return; return;
} }
utils = new Utils(); utils = new Utils();
emoteModule = new EmoteModule(); emoteModule = new EmoteModule();
quickEmoteMenu = new QuickEmoteMenu(); quickEmoteMenu = new QuickEmoteMenu();
@ -85,7 +84,6 @@ Core.prototype.init = function() {
function gwDefer() { function gwDefer() {
if($(".guilds-wrapper").size() > 0) { if($(".guilds-wrapper").size() > 0) {
var guilds = $(".guilds li:first-child"); var guilds = $(".guilds li:first-child");
guilds.after($("<li></li>", { id: "bd-pub-li", css: { "height": "20px", "display": settingsCookie["bda-gs-1"] == true ? "" : "none" } }).append($("<div/>", { class: "guild-inner", css: { "height": "20px" } }).append($("<a/>").append($("<div/>", { css: { "line-height": "20px" }, text: "public", id: "bd-pub-button" }))))); guilds.after($("<li></li>", { id: "bd-pub-li", css: { "height": "20px", "display": settingsCookie["bda-gs-1"] == true ? "" : "none" } }).append($("<div/>", { class: "guild-inner", css: { "height": "20px" } }).append($("<a/>").append($("<div/>", { css: { "line-height": "20px" }, text: "public", id: "bd-pub-button" })))));
@ -240,7 +238,7 @@ EmoteModule.prototype.injectEmote = function(node) {
if(typeof emotesBTTV !== 'undefined' && settingsCookie["bda-es-2"] && !replaced) { if(typeof emotesBTTV !== 'undefined' && settingsCookie["bda-es-2"] && !replaced) {
if(emotesBTTV.hasOwnProperty(word)) { if(emotesBTTV.hasOwnProperty(word)) {
replaced = true; replaced = true;
parentInnerHTML = parentInnerHTML.replace(word, "<img src=" + bttvEmoteUrlStart + emotesBTTV[word] + bttvEmoteUrlEnd + " ><\/img>"); parentInnerHTML = parentInnerHTML.replace(word, "<img src=" + emotesBTTV[word] + " ><\/img>");
} }
} }
@ -256,7 +254,7 @@ EmoteModule.prototype.injectEmote = function(node) {
var newHeight = parent.parentElement.offsetHeight; var newHeight = parent.parentElement.offsetHeight;
//Scrollfix //Scrollfix
var scrollPane = $($(".scroller.messages")[0]); var scrollPane = $(".scroller.messages").first();
scrollPane.scrollTop(scrollPane.scrollTop() + (newHeight - oldHeight)); scrollPane.scrollTop(scrollPane.scrollTop() + (newHeight - oldHeight));
}; };
@ -655,23 +653,21 @@ function VoiceMode() {
} }
VoiceMode.prototype.enable = function() { VoiceMode.prototype.enable = function() {
$(".scroller.guild-channels ul").first().css("display", "none");
$($(".scroller.guild-channels ul")[0]).css("display", "none"); $(".scroller.guild-channels header").first().css("display", "none");
$($(".scroller.guild-channels header")[0]).css("display", "none"); $(".flex-vertical.flex-spacer").first().css("overflow", "hidden");
$($(".flex-vertical.flex-spacer")[0]).css("overflow", "hidden"); $(".chat.flex-vertical.flex-spacer").first().css("visibility", "hidden").css("min-width", "0px");
$($(".chat.flex-vertical.flex-spacer")[0]).css("visibility", "hidden").css("min-width", "0px"); $(".flex-vertical.channels-wrap").first().css("width", "100%");
$($(".flex-vertical.channels-wrap")[0]).css("width", "100%"); $(".guild-header .btn.btn-hamburger").first().css("visibility", "hidden");
$($(".guild-header .btn.btn-hamburger")[0]).css("visibility", "hidden");
}; };
VoiceMode.prototype.disable = function() { VoiceMode.prototype.disable = function() {
$($(".scroller.guild-channels ul")[0]).css("display", ""); $(".scroller.guild-channels ul").first().css("display", "");
$($(".scroller.guild-channels header")[0]).css("display", ""); $(".scroller.guild-channels header").first().css("display", "");
$($(".flex-vertical.flex-spacer")[0]).css("overflow", ""); $(".flex-vertical.flex-spacer").first().css("overflow", "");
$($(".chat.flex-vertical.flex-spacer")[0]).css("visibility", "").css("min-width", ""); $(".chat.flex-vertical.flex-spacer").first().css("visibility", "").css("min-width", "");
$($(".flex-vertical.channels-wrap")[0]).css("width", ""); $(".flex-vertical.channels-wrap").first().css("width", "");
$($(".guild-header .btn.btn-hamburger")[0]).css("visibility", ""); $(".guild-header .btn.btn-hamburger").first().css("visibility", "");
}; };
/* BetterDiscordApp Utilities JavaScript /* BetterDiscordApp Utilities JavaScript