more emote stuff

This commit is contained in:
Zack Rauen 2018-03-16 17:01:31 -04:00
parent 2f71d66535
commit 6abe7fc114
4 changed files with 17 additions and 11 deletions

File diff suppressed because one or more lines are too long

View File

@ -35,6 +35,7 @@
"BetterDiscord", "BetterDiscord",
"Boeuf", "Boeuf",
"Bomb", "Bomb",
"BOMB",
"Brille", "Brille",
"Brofist", "Brofist",
"Bruh", "Bruh",
@ -60,12 +61,14 @@
"DENIAL", "DENIAL",
"DESU", "DESU",
"Deud", "Deud",
"Ding",
"Dirk", "Dirk",
"Dood", "Dood",
"double", "double",
"Dunked", "Dunked",
"Dunno", "Dunno",
"Eggman", "Eggman",
"eHHH",
"Elementals", "Elementals",
"elgato", "elgato",
"emote", "emote",
@ -108,6 +111,7 @@
"Hartz", "Hartz",
"hasOwnProperty", "hasOwnProperty",
"heartless", "heartless",
"HELP",
"HELLO!", "HELLO!",
"Hello", "Hello",
"Herz", "Herz",
@ -119,6 +123,7 @@
"Hobbes", "Hobbes",
"Huehue", "Huehue",
"Humm", "Humm",
"HYPE",
"Ibuki", "Ibuki",
"Ichigo", "Ichigo",
"inverse", "inverse",
@ -161,6 +166,7 @@
"Magikarp", "Magikarp",
"MainMenu", "MainMenu",
"Matty", "Matty",
"meditation",
"Memelord", "Memelord",
"Meow", "Meow",
"MERICA", "MERICA",
@ -180,6 +186,7 @@
"Nati", "Nati",
"Nebby", "Nebby",
"Nein", "Nein",
"NICK",
"Nimbus", "Nimbus",
"Nono", "Nono",
"Nooo", "Nooo",
@ -210,6 +217,7 @@
"Pineapple", "Pineapple",
"Pinto", "Pinto",
"PLAYS", "PLAYS",
"PLEASE",
"Pleure", "Pleure",
"PokeBall", "PokeBall",
"Pokeball", "Pokeball",

View File

@ -642,7 +642,7 @@ function EmoteModule() {}
EmoteModule.prototype.init = async function () { EmoteModule.prototype.init = async function () {
this.modifiers = ["flip", "spin", "pulse", "spin2", "spin3", "1spin", "2spin", "3spin", "tr", "bl", "br", "shake", "shake2", "shake3", "flap"]; this.modifiers = ["flip", "spin", "pulse", "spin2", "spin3", "1spin", "2spin", "3spin", "tr", "bl", "br", "shake", "shake2", "shake3", "flap"];
this.overrides = ['twitch', 'bttv', 'ffz']; this.overrides = ['twitch', 'bttv', 'ffz'];
this.categories = ["TwitchGlobal", "TwitchSubscriber", "BTTV", "FrankerFaceZ", "BTTV2"]; this.categories = ["TwitchGlobal", "TwitchSubscriber", "BTTV", "BTTV2", "FrankerFaceZ"];
let emoteInfo = { let emoteInfo = {
'TwitchGlobal': { 'TwitchGlobal': {
@ -788,8 +788,6 @@ EmoteModule.prototype.loadEmoteData = async function(emoteInfo) {
let file = bdConfig.dataPath + emoteFile; let file = bdConfig.dataPath + emoteFile;
let exists = _fs.existsSync(file); let exists = _fs.existsSync(file);
if (exists && !bdConfig.cache.expired) { if (exists && !bdConfig.cache.expired) {
if (settingsCookie["fork-ps-2"]) mainCore.showToast("Loading emotes from cache.", {type: "info"}); if (settingsCookie["fork-ps-2"]) mainCore.showToast("Loading emotes from cache.", {type: "info"});
utils.log("[Emotes] Loading emotes from local cache.") utils.log("[Emotes] Loading emotes from local cache.")
@ -1256,6 +1254,7 @@ Utils.prototype.jqDefer = function (fnc) {
Utils.prototype.getHash = function () { Utils.prototype.getHash = function () {
$.getJSON("https://api.github.com/repos/rauenzi/BetterDiscordApp/commits/master", function (data) { $.getJSON("https://api.github.com/repos/rauenzi/BetterDiscordApp/commits/master", function (data) {
_hash = data.sha; _hash = data.sha;
bdConfig.hash = _hash;
}); });
}; };
@ -1314,14 +1313,13 @@ Utils.prototype.insertElement = function(node, regex, element) {
if (child.nodeType != Node.TEXT_NODE) {child = child.nextSibling; continue}; if (child.nodeType != Node.TEXT_NODE) {child = child.nextSibling; continue};
var bk = 0; var bk = 0;
child.data.replace(regex, function(all) { child.data.replace(regex, function(all) {
var args = [].slice.call(arguments), var args = [].slice.call(arguments);
offset = args[args.length - 2], var offset = args[args.length - 2];
newTextNode = child.splitText(offset+bk), tag; var newTextNode = args[1] ? child.splitText(offset + args[1].length + bk) : child.splitText(offset + bk);
bk -= child.data.length + all.length; bk -= child.data.length + all.length;
newTextNode.data = newTextNode.data.substr(all.length); newTextNode.data = newTextNode.data.substr(all.trim().length);
tag = element; child.parentNode.insertBefore(element, newTextNode);
child.parentNode.insertBefore(tag, newTextNode);
child = newTextNode; child = newTextNode;
}); });

2
js/main.min.js vendored

File diff suppressed because one or more lines are too long