Fix for latest Discord Update
This commit is contained in:
parent
90f1c5dbac
commit
b7e68d1f6b
|
@ -6,3 +6,4 @@ devjs/.idea/devjs.iml
|
||||||
*.xpi
|
*.xpi
|
||||||
Firefox/data/js/jquery-2.1.4.min.js
|
Firefox/data/js/jquery-2.1.4.min.js
|
||||||
*.dev.*
|
*.dev.*
|
||||||
|
/nbproject/private/
|
26
js/main.js
26
js/main.js
|
@ -239,11 +239,11 @@ Core.prototype.loadSettings = function () {
|
||||||
};
|
};
|
||||||
var botlist = ["119598467310944259"]; //Temp
|
var botlist = ["119598467310944259"]; //Temp
|
||||||
Core.prototype.initObserver = function () {
|
Core.prototype.initObserver = function () {
|
||||||
|
|
||||||
mainObserver = new MutationObserver(function (mutations) {
|
mainObserver = new MutationObserver(function (mutations) {
|
||||||
mutations.forEach(function (mutation) {
|
mutations.forEach(function (mutation) {
|
||||||
if (mutation.target.getAttribute('class') != null) {
|
if (mutation.target.getAttribute('class') != null) {
|
||||||
if (mutation.target.getAttribute('class').indexOf("titlebar") != -1) {
|
//console.log(mutation.target)
|
||||||
|
if(mutation.target.classList.contains('title-wrap') || mutation.target.classList.contains('chat')){
|
||||||
quickEmoteMenu.obsCallback();
|
quickEmoteMenu.obsCallback();
|
||||||
voiceMode.obsCallback();
|
voiceMode.obsCallback();
|
||||||
if (typeof pluginModule !== "undefined") pluginModule.channelSwitch();
|
if (typeof pluginModule !== "undefined") pluginModule.channelSwitch();
|
||||||
|
@ -887,12 +887,10 @@ QuickEmoteMenu.prototype.init = function (reload) {
|
||||||
var bdfw = {};
|
var bdfw = {};
|
||||||
|
|
||||||
QuickEmoteMenu.prototype.obsCallback = function () {
|
QuickEmoteMenu.prototype.obsCallback = function () {
|
||||||
|
|
||||||
if (!emoteBtn) return;
|
if (!emoteBtn) return;
|
||||||
if (!$(".content.flex-spacer.flex-horizontal .flex-spacer.flex-vertical form")) return;
|
if (!$(".content.flex-spacer.flex-horizontal .flex-spacer.flex-vertical form")) return;
|
||||||
|
|
||||||
var tcbtn = $("#twitchcord-button-container");
|
var tcbtn = $("#twitchcord-button-container");
|
||||||
|
|
||||||
if (tcbtn.parent().prop("tagName") == undefined) {
|
if (tcbtn.parent().prop("tagName") == undefined) {
|
||||||
quickEmoteMenu = new QuickEmoteMenu();
|
quickEmoteMenu = new QuickEmoteMenu();
|
||||||
quickEmoteMenu.init(true);
|
quickEmoteMenu.init(true);
|
||||||
|
@ -918,7 +916,7 @@ QuickEmoteMenu.prototype.initEmoteList = function () {
|
||||||
css: {
|
css: {
|
||||||
"display": "none"
|
"display": "none"
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
var globalTab = $("<div/>", {
|
var globalTab = $("<div/>", {
|
||||||
class: "emote-menu-tab emote-menu-tab-selected",
|
class: "emote-menu-tab emote-menu-tab-selected",
|
||||||
|
@ -1099,7 +1097,7 @@ SettingsPanel.prototype.init = function () {
|
||||||
$("div[data-reactid='.0.1.1']").append($(emoteNamePopup));
|
$("div[data-reactid='.0.1.1']").append($(emoteNamePopup));
|
||||||
});
|
});
|
||||||
$(document).on("mouseleave", ".emote", function () {
|
$(document).on("mouseleave", ".emote", function () {
|
||||||
$(".tipsy").remove()
|
$(".tipsy").remove();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$(document).off('mouseover', '.emote');
|
$(document).off('mouseover', '.emote');
|
||||||
|
@ -1208,14 +1206,14 @@ SettingsPanel.prototype.updateSetting = function (checkbox) {
|
||||||
$("div[data-reactid='.0.1.1']").append($(emoteNamePopup));
|
$("div[data-reactid='.0.1.1']").append($(emoteNamePopup));
|
||||||
});
|
});
|
||||||
$(document).on("mouseleave", ".emote", function () {
|
$(document).on("mouseleave", ".emote", function () {
|
||||||
$(".tipsy").remove()
|
$(".tipsy").remove();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$(document).off('mouseover', '.emote');
|
$(document).off('mouseover', '.emote');
|
||||||
}
|
}
|
||||||
|
|
||||||
mainCore.saveSettings();
|
mainCore.saveSettings();
|
||||||
}
|
};
|
||||||
|
|
||||||
SettingsPanel.prototype.construct = function () {
|
SettingsPanel.prototype.construct = function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
@ -1419,8 +1417,8 @@ Utils.prototype.jqDefer = function (fnc) {
|
||||||
fnc();
|
fnc();
|
||||||
} else {
|
} else {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
this.jqDefer(fnc)
|
this.jqDefer(fnc);
|
||||||
}, 100)
|
}, 100);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1484,7 +1482,7 @@ VoiceMode.prototype.obsCallback = function () {
|
||||||
self.enable();
|
self.enable();
|
||||||
}, 300);
|
}, 300);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
VoiceMode.prototype.enable = function () {
|
VoiceMode.prototype.enable = function () {
|
||||||
$(".scroller.guild-channels ul").first().css("display", "none");
|
$(".scroller.guild-channels ul").first().css("display", "none");
|
||||||
|
@ -1749,10 +1747,10 @@ BdWSocket.prototype.onMessage = function (e) {
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "READY":
|
case "READY":
|
||||||
bdSocket.interval = setInterval(() => bdws.send({
|
bdSocket.interval = setInterval(function(){bdws.send({
|
||||||
op: 1,
|
op: 1,
|
||||||
d: Date.now()
|
d: Date.now()
|
||||||
}), data.heartbeat_interval);
|
});}, data.heartbeat_interval);
|
||||||
utils.log("Socket Ready");
|
utils.log("Socket Ready");
|
||||||
break;
|
break;
|
||||||
case "PRESENCE_UPDATE":
|
case "PRESENCE_UPDATE":
|
||||||
|
@ -1815,7 +1813,7 @@ BdApi.joinServer = function (code) {
|
||||||
//id = id of element
|
//id = id of element
|
||||||
//css = custom css
|
//css = custom css
|
||||||
BdApi.injectCSS = function (id, css) {
|
BdApi.injectCSS = function (id, css) {
|
||||||
$("head").append('<style id="' + id + '"></style>')
|
$("head").append('<style id="' + id + '"></style>');
|
||||||
$("#" + id).html(css);
|
$("#" + id).html(css);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue