fix some more emote crap
This commit is contained in:
parent
1d89fb9e71
commit
1a6db9e2ab
Binary file not shown.
45
css/main.css
45
css/main.css
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
32
js/main.js
32
js/main.js
|
@ -90,7 +90,7 @@ betterDiscordIPC.on('asynchronous-reply', (event, arg) => {
|
||||||
var settingsPanel, emoteModule, utils, quickEmoteMenu, voiceMode, pluginModule, themeModule, dMode, publicServersModule;
|
var settingsPanel, emoteModule, utils, quickEmoteMenu, voiceMode, pluginModule, themeModule, dMode, publicServersModule;
|
||||||
var jsVersion = 1.792;
|
var jsVersion = 1.792;
|
||||||
var supportedVersion = "0.2.81";
|
var supportedVersion = "0.2.81";
|
||||||
var bbdVersion = "0.0.3";
|
var bbdVersion = "0.0.4";
|
||||||
|
|
||||||
var mainObserver;
|
var mainObserver;
|
||||||
|
|
||||||
|
@ -218,9 +218,6 @@ Core.prototype.init = function () {
|
||||||
voiceMode = new VoiceMode();
|
voiceMode = new VoiceMode();
|
||||||
dMode = new devMode();
|
dMode = new devMode();
|
||||||
|
|
||||||
utils.log("Initializing EmoteModule");
|
|
||||||
emoteModule.init();
|
|
||||||
|
|
||||||
utils.log("Initializing Settings");
|
utils.log("Initializing Settings");
|
||||||
this.initSettings();
|
this.initSettings();
|
||||||
|
|
||||||
|
@ -231,6 +228,9 @@ Core.prototype.init = function () {
|
||||||
console.log(new Date().getTime() + " Defer Loaded");
|
console.log(new Date().getTime() + " Defer Loaded");
|
||||||
self.injectExternals();
|
self.injectExternals();
|
||||||
|
|
||||||
|
utils.log("Initializing EmoteModule");
|
||||||
|
emoteModule.init();
|
||||||
|
|
||||||
// Add check for backwards compatibility
|
// Add check for backwards compatibility
|
||||||
if (!bdpluginErrors) bdpluginErrors = [];
|
if (!bdpluginErrors) bdpluginErrors = [];
|
||||||
if (!bdthemeErrors) bdthemeErrors = [];
|
if (!bdthemeErrors) bdthemeErrors = [];
|
||||||
|
@ -250,7 +250,7 @@ Core.prototype.init = function () {
|
||||||
settingsPanel.updateSettings();
|
settingsPanel.updateSettings();
|
||||||
|
|
||||||
utils.log("Initializing QuickEmoteMenu");
|
utils.log("Initializing QuickEmoteMenu");
|
||||||
quickEmoteMenu.init(false);
|
quickEmoteMenu.init();
|
||||||
|
|
||||||
window.addEventListener("beforeunload", function(){
|
window.addEventListener("beforeunload", function(){
|
||||||
if(settingsCookie["bda-dc-0"]){
|
if(settingsCookie["bda-dc-0"]){
|
||||||
|
@ -270,8 +270,6 @@ Core.prototype.init = function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.log("Removing Loading Icon");
|
utils.log("Removing Loading Icon");
|
||||||
$("head").append("<style>.CodeMirror{ min-width:100%; }</style>");
|
|
||||||
$("head").append('<style id="bdemotemenustyle"></style>');
|
|
||||||
document.getElementsByClassName("bd-loaderv2")[0].remove();
|
document.getElementsByClassName("bd-loaderv2")[0].remove();
|
||||||
// Show loading errors
|
// Show loading errors
|
||||||
if (settingsCookie["fork-ps-1"]) {
|
if (settingsCookie["fork-ps-1"]) {
|
||||||
|
@ -360,7 +358,7 @@ Core.prototype.initObserver = function () {
|
||||||
|
|
||||||
// Emoji Picker
|
// Emoji Picker
|
||||||
if (node.classList.contains('popout') && !node.classList.contains('popout-left')) {
|
if (node.classList.contains('popout') && !node.classList.contains('popout-left')) {
|
||||||
if (node.getElementsByClassName('emoji-picker').length) quickEmoteMenu.obsCallback(node);
|
if (node.getElementsByClassName('emoji-picker').length || node.getElementsByClassName('emojiPicker-3g68GS').length) quickEmoteMenu.obsCallback(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
// onSwitch()
|
// onSwitch()
|
||||||
|
@ -454,8 +452,8 @@ Core.prototype.injectColoredText = function(node) {
|
||||||
let color = elem.style.color;
|
let color = elem.style.color;
|
||||||
if (color === "rgb(255, 255, 255)") return;
|
if (color === "rgb(255, 255, 255)") return;
|
||||||
elem.closest(".message-group").querySelectorAll('.markup').forEach(elem => {
|
elem.closest(".message-group").querySelectorAll('.markup').forEach(elem => {
|
||||||
if (elem.getAttribute("data-color")) return;
|
if (elem.getAttribute("data-colour")) return;
|
||||||
elem.setAttribute("data-color", true);
|
elem.setAttribute("data-colour", true);
|
||||||
elem.style.setProperty("color", color);
|
elem.style.setProperty("color", color);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -464,8 +462,8 @@ Core.prototype.injectColoredText = function(node) {
|
||||||
Core.prototype.removeColoredText = function(node) {
|
Core.prototype.removeColoredText = function(node) {
|
||||||
node.querySelectorAll('.user-name').forEach(elem => {
|
node.querySelectorAll('.user-name').forEach(elem => {
|
||||||
elem.closest(".message-group").querySelectorAll('.markup').forEach(elem => {
|
elem.closest(".message-group").querySelectorAll('.markup').forEach(elem => {
|
||||||
if (!elem.getAttribute("data-color")) return;
|
if (!elem.getAttribute("data-colour")) return;
|
||||||
elem.removeAttribute("data-color");
|
elem.removeAttribute("data-colour");
|
||||||
elem.style.setProperty("color", "");
|
elem.style.setProperty("color", "");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -781,6 +779,8 @@ EmoteModule.prototype.loadEmoteData = async function(emoteInfo) {
|
||||||
|
|
||||||
try { _fs.writeFileSync(file, JSON.stringify(bdEmotes), "utf8"); }
|
try { _fs.writeFileSync(file, JSON.stringify(bdEmotes), "utf8"); }
|
||||||
catch(err) { utils.err("[Emotes] Could not save emote data.", err); }
|
catch(err) { utils.err("[Emotes] Could not save emote data.", err); }
|
||||||
|
|
||||||
|
quickEmoteMenu.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
EmoteModule.prototype.downloadEmotes = function(emoteMeta) {
|
EmoteModule.prototype.downloadEmotes = function(emoteMeta) {
|
||||||
|
@ -1043,7 +1043,7 @@ QuickEmoteMenu.prototype.switchQem = function(id) {
|
||||||
fav.removeClass("active");
|
fav.removeClass("active");
|
||||||
emojis.removeClass("active");
|
emojis.removeClass("active");
|
||||||
|
|
||||||
$(".emoji-picker").hide();
|
$(".emoji-picker, .emojiPicker-3g68GS").hide();
|
||||||
$("#bda-qem-favourite-container").hide();
|
$("#bda-qem-favourite-container").hide();
|
||||||
$("#bda-qem-twitch-container").hide();
|
$("#bda-qem-twitch-container").hide();
|
||||||
|
|
||||||
|
@ -1058,8 +1058,8 @@ QuickEmoteMenu.prototype.switchQem = function(id) {
|
||||||
break;
|
break;
|
||||||
case "bda-qem-emojis":
|
case "bda-qem-emojis":
|
||||||
emojis.addClass("active");
|
emojis.addClass("active");
|
||||||
$(".emoji-picker").show();
|
$(".emoji-picker, .emojiPicker-3g68GS").show();
|
||||||
$(".emoji-picker .search-bar-inner input").focus();
|
$(".emoji-picker .search-bar-inner input, .emojiPicker-3g68GS .search-bar-inner input").focus();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
this.lastTab = id;
|
this.lastTab = id;
|
||||||
|
@ -3096,7 +3096,7 @@ class V2_SettingsPanel {
|
||||||
children: [
|
children: [
|
||||||
BDV2.react.createElement(V2Components.SettingsPanel, { key: "fspanel", title: "Zere's Fork Settings", onChange: this.onChange, settings: this.forkSettings, button: {
|
BDV2.react.createElement(V2Components.SettingsPanel, { key: "fspanel", title: "Zere's Fork Settings", onChange: this.onChange, settings: this.forkSettings, button: {
|
||||||
title: "Clear Emote Cache",
|
title: "Clear Emote Cache",
|
||||||
onClick: () => { emoteModule.clearEmoteData(); emoteModule.init(); }
|
onClick: () => { emoteModule.clearEmoteData(); emoteModule.init(); quickEmoteMenu.init(); }
|
||||||
}}),
|
}}),
|
||||||
BDV2.react.createElement(V2Components.Tools, { key: "tools" })
|
BDV2.react.createElement(V2Components.Tools, { key: "tools" })
|
||||||
]
|
]
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue