BetterTTV Emote Support
This commit is contained in:
parent
986f392846
commit
13f4ca29e1
15
js/main.js
15
js/main.js
|
@ -17,8 +17,8 @@ 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 = "";
|
||||
var bttvEmoteUrlEnd = "";
|
||||
var bttvEmoteUrlStart = "https://cdn.betterttv.net/emote/";
|
||||
var bttvEmoteUrlEnd = "/1x";
|
||||
|
||||
var mainCore;
|
||||
|
||||
|
@ -435,6 +435,17 @@ EmoteModule.prototype.injectEmote = function(node) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
console.log("Checking for bttv2");
|
||||
|
||||
if(typeof emotesBTTV2 !== 'undefined' && settingsCookie["bda-es-2"]) {
|
||||
if(emotesBTTV2.hasOwnProperty(word)) {
|
||||
console.log("bttv2 has word: " + word);
|
||||
var len = Math.round(word.length / 4);
|
||||
parentInnerHTML = parentInnerHTML.replace(word, '<img class="emote" alt="' + word.substr(0, len) + "\uFDD9" + word.substr(len, len) + "\uFDD9" + word.substr(len * 2, len) + "\uFDD9" + word.substr(len * 3) + '" src="' + bttvEmoteUrlStart + emotesBTTV2[word] + bttvEmoteUrlEnd + '" />');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (subEmotesTwitch.hasOwnProperty(word)) {
|
||||
var len = Math.round(word.length / 4);
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -239,7 +239,7 @@ BetterDiscord.prototype.ipcAsyncMessage = function(event, arg) {
|
|||
'resource': 'Main CSS',
|
||||
'domain': _updater.CDN,
|
||||
'url': '//' + _updater.CDN + '/' + _repo + '/BetterDiscordApp/' + _hash + '/css/main.min.css',
|
||||
'localurl': _localServer + '/BetterDiscord/css/main.css',
|
||||
'localurl': _localServer + '/BetterDiscordApp/css/main.css',
|
||||
'message': 'load-mainJS',
|
||||
'cacheable': false,
|
||||
'variable': null
|
||||
|
@ -249,7 +249,7 @@ BetterDiscord.prototype.ipcAsyncMessage = function(event, arg) {
|
|||
'resource': 'Main JS',
|
||||
'domain': _updater.CDN,
|
||||
'url': '//' + _updater.CDN + '/' + _repo + '/BetterDiscordApp/' + _hash + '/js/main.min.js',
|
||||
'localurl': _localServer + '/BetterDiscord/js/main.js',
|
||||
'localurl': _localServer + '/BetterDiscordApp/js/main.js',
|
||||
'message': 'load-publicServers',
|
||||
'cacheable': false,
|
||||
'variable': null
|
||||
|
@ -315,7 +315,7 @@ BetterDiscord.prototype.ipcAsyncMessage = function(event, arg) {
|
|||
'domain': 'api.betterttv.net',
|
||||
'url': '/emotes',
|
||||
'localurl': null,
|
||||
'message': 'start-bd',
|
||||
'message': 'load-emoteData-bttv-2',
|
||||
'cacheable': true,
|
||||
'variable': 'emotesBTTV',
|
||||
'localpath': _dataPath + "/emotes_bttv.json",
|
||||
|
@ -323,6 +323,21 @@ BetterDiscord.prototype.ipcAsyncMessage = function(event, arg) {
|
|||
'https': true,
|
||||
'parse': false,
|
||||
'specialparser': 3
|
||||
},
|
||||
'load-emoteData-bttv-2': {
|
||||
'type': 'emotedata',
|
||||
'resource': 'BTTV Emotedata',
|
||||
'domain': _updater.CDN,
|
||||
'url': '/' + _repo + '/BetterDiscordApp/' + _hash + '/emotedata_bttv.json',
|
||||
'localurl': null,
|
||||
'message': 'start-bd',
|
||||
'cacheable': true,
|
||||
'variable': 'emotesBTTV2',
|
||||
'localpath': _dataPath + "/emotes_bttv_2.json",
|
||||
'encoding': "utf8",
|
||||
'https': true,
|
||||
'parse': false,
|
||||
'specialparser': 4
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -431,6 +446,9 @@ BetterDiscord.prototype.parseEmoteData = function(loadMe, emoteData) {
|
|||
|
||||
returnData = JSON.stringify(returnData);
|
||||
break;
|
||||
case 4:
|
||||
returnData = emoteData;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue