From 2574de3a698be7cca12154f8d9df2422e55eb916 Mon Sep 17 00:00:00 2001 From: Jiiks Date: Fri, 11 Dec 2015 11:21:16 +0200 Subject: [PATCH] Versioning, changelog --- js/main.js | 96 +++++++++++++++++++++++++++++------------------------- 1 file changed, 51 insertions(+), 45 deletions(-) diff --git a/js/main.js b/js/main.js index af8f3ed..108e262 100644 --- a/js/main.js +++ b/js/main.js @@ -8,8 +8,8 @@ var settingsPanel, emoteModule, utils, quickEmoteMenu, opublicServers, voiceMode, pluginModule; -var jsVersion = 1.52; -var supportedVersion = "0.1.5"; +var jsVersion = 1.53; +var supportedVersion = "0.2.3"; var mainObserver; @@ -63,11 +63,17 @@ var defaultCookie = { }; var bdchangelog = { - "changes": null, + "changes": { + "plugins": { + "title": "Plugins!", + "text": "Combined with Core 0.2.4, you can now write/use JavaScript plugins for Discord!", + "img": "" + } + }, "fixes": { - "compact": { - "title": "Compact Mode Emotes!", - "text": "Compact Mode Emotes have been fixed and should now be visible!", + "eemotes": { + "title": "Edit Emotes!", + "text": "Edited messages now display emotes properly!", "img": "" } }, @@ -416,58 +422,58 @@ EmoteModule.prototype.injectEmote = function(node) { return; } - if(word.length < 4) { - return; - } - - if($.inArray(word, bemotes) != -1) return; - - if (emotesTwitch.emotes.hasOwnProperty(word)) { - var len = Math.round(word.length / 4); - parentInnerHTML = parentInnerHTML.replace(word, '' + word.substr(0, len) + ' ); - return; - } - - if (typeof emotesFfz !== 'undefined' && settingsCookie["bda-es-1"]) { - if (emotesFfz.hasOwnProperty(word)) { - var len = Math.round(word.length / 4); - parentInnerHTML = parentInnerHTML.replace(word, '' + word.substr(0, len) + '); + if(word.length < 4) { return; } - } - if (typeof emotesBTTV !== 'undefined' && settingsCookie["bda-es-2"]) { - if (emotesBTTV.hasOwnProperty(word)) { + if($.inArray(word, bemotes) != -1) return; + + if (emotesTwitch.emotes.hasOwnProperty(word)) { var len = Math.round(word.length / 4); - parentInnerHTML = parentInnerHTML.replace(word, '' + word.substr(0, len) + '); + parentInnerHTML = parentInnerHTML.replace(word, '' + word.substr(0, len) + ' ); return; } - } + + if (typeof emotesFfz !== 'undefined' && settingsCookie["bda-es-1"]) { + if (emotesFfz.hasOwnProperty(word)) { + var len = Math.round(word.length / 4); + parentInnerHTML = parentInnerHTML.replace(word, '' + word.substr(0, len) + '); + return; + } + } + + if (typeof emotesBTTV !== 'undefined' && settingsCookie["bda-es-2"]) { + if (emotesBTTV.hasOwnProperty(word)) { + var len = Math.round(word.length / 4); + parentInnerHTML = parentInnerHTML.replace(word, '' + word.substr(0, len) + '); + return; + } + } - if(typeof emotesBTTV2 !== 'undefined' && settingsCookie["bda-es-2"]) { - if(emotesBTTV2.hasOwnProperty(word)) { + if(typeof emotesBTTV2 !== 'undefined' && settingsCookie["bda-es-2"]) { + if(emotesBTTV2.hasOwnProperty(word)) { + var len = Math.round(word.length / 4); + parentInnerHTML = parentInnerHTML.replace(word, '' + word.substr(0, len) + '); + return; + } + } + + if (subEmotesTwitch.hasOwnProperty(word)) { var len = Math.round(word.length / 4); - parentInnerHTML = parentInnerHTML.replace(word, '' + word.substr(0, len) + '); + parentInnerHTML = parentInnerHTML.replace(word, '' + word.substr(0, len) + '); return; } - } + }); - if (subEmotesTwitch.hasOwnProperty(word)) { - var len = Math.round(word.length / 4); - parentInnerHTML = parentInnerHTML.replace(word, '' + word.substr(0, len) + '); - return; - } - }); + if(parent.parentElement == null) 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 oldHeight = parent.parentElement.offsetHeight; - parent.innerHTML = parentInnerHTML.replace(new RegExp("\uFDD9", "g"), ""); - var newHeight = parent.parentElement.offsetHeight; - - //Scrollfix - var scrollPane = $(".scroller.messages").first(); - scrollPane.scrollTop(scrollPane.scrollTop() + (newHeight - oldHeight)); + //Scrollfix + var scrollPane = $(".scroller.messages").first(); + scrollPane.scrollTop(scrollPane.scrollTop() + (newHeight - oldHeight)); } if(edited) {