From 79322b8b6a838e7026acb16b66be912dbc5dc6ff Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Fri, 8 Nov 2019 14:36:57 +0100 Subject: [PATCH] plugins --- Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js | 2 +- Plugins/PersonalPins/PersonalPins.plugin.js | 2 +- .../RevealAllSpoilersOption/RevealAllSpoilersOption.plugin.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js b/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js index 05cdd816ae..2a8a3f2556 100644 --- a/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js +++ b/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js @@ -422,7 +422,7 @@ class GoogleTranslateOption { } getMessageAndPos (target) { - let messagediv = BDFDB.DOMUtils.getParent(BDFDB.dotCN.messagegroup + "> [aria-disabled]", target) || BDFDB.DOMUtils.getParent(BDFDB.dotCN.messagegroup + "> * > [aria-disabled]", target); + let messagediv = BDFDB.DOMUtils.getParent(BDFDB.dotCN.messagegroup + "> [aria-disabled]," + BDFDB.dotCN.messagegroup + "> * > [aria-disabled]", target); let pos = messagediv ? Array.from(messagediv.parentElement.childNodes).filter(n => n.nodeType != Node.TEXT_NODE).indexOf(messagediv) : -1; return {messagediv, pos}; } diff --git a/Plugins/PersonalPins/PersonalPins.plugin.js b/Plugins/PersonalPins/PersonalPins.plugin.js index 3e36f1d484..2c356dfc59 100644 --- a/Plugins/PersonalPins/PersonalPins.plugin.js +++ b/Plugins/PersonalPins/PersonalPins.plugin.js @@ -575,7 +575,7 @@ class PersonalPins { } getMessageAndPos (target) { - let messagediv = BDFDB.DOMUtils.getParent(BDFDB.dotCN.messagegroup + "> [aria-disabled]", target); + let messagediv = BDFDB.DOMUtils.getParent(BDFDB.dotCN.messagegroup + "> [aria-disabled]," + BDFDB.dotCN.messagegroup + "> * > [aria-disabled]", target); let pos = messagediv ? Array.from(messagediv.parentElement.childNodes).filter(n => n.nodeType != Node.TEXT_NODE).indexOf(messagediv) : -1; return {messagediv, pos}; } diff --git a/Plugins/RevealAllSpoilersOption/RevealAllSpoilersOption.plugin.js b/Plugins/RevealAllSpoilersOption/RevealAllSpoilersOption.plugin.js index d5dfc94789..25fec35ce3 100644 --- a/Plugins/RevealAllSpoilersOption/RevealAllSpoilersOption.plugin.js +++ b/Plugins/RevealAllSpoilersOption/RevealAllSpoilersOption.plugin.js @@ -61,7 +61,7 @@ class RevealAllSpoilersOption { onMessageContextMenu (e) { if (e.instance.props && e.instance.props.message && e.instance.props.target) { - let messagediv = BDFDB.DOMUtils.getParent(BDFDB.dotCN.messagegroup + "> [aria-disabled]", e.instance.props.target) || BDFDB.DOMUtils.getParent(BDFDB.dotCN.messagegroup + "> * > [aria-disabled]", e.instance.props.target); + let messagediv = BDFDB.DOMUtils.getParent(BDFDB.dotCN.messagegroup + "> [aria-disabled]," + BDFDB.dotCN.messagegroup + "> * > [aria-disabled]", e.instance.props.target); if (!messagediv || !messagediv.querySelector(BDFDB.dotCN.spoilerhidden)) return; let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]}); const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, { @@ -82,7 +82,7 @@ class RevealAllSpoilersOption { } revealAllSpoilers (target) { - let messagediv = BDFDB.DOMUtils.getParent(BDFDB.dotCN.messagegroup + "> [aria-disabled]", target) || BDFDB.DOMUtils.getParent(BDFDB.dotCN.messagegroup + "> * > [aria-disabled]", target); + let messagediv = BDFDB.DOMUtils.getParent(BDFDB.dotCN.messagegroup + "> [aria-disabled]," + BDFDB.dotCN.messagegroup + "> * > [aria-disabled]", target); if (!messagediv) return; for (let spoiler of messagediv.querySelectorAll(BDFDB.dotCN.spoilerhidden)) spoiler.click(); }