This commit is contained in:
Mirco Wittrien 2019-11-11 10:48:30 +01:00
parent 402cbb6577
commit b704460e05
16 changed files with 21 additions and 21 deletions

View File

@ -8396,7 +8396,7 @@ var BDFDB = {
var BDFDBprocessFunctions = {}; var BDFDBprocessFunctions = {};
BDFDBprocessFunctions.processV2CContentColumn = function (e) { BDFDBprocessFunctions.processV2CContentColumn = function (e) {
if (window.PluginUpdates && window.PluginUpdates.plugins && e.instance.props && e.instance.props.title == "Plugins") { if (window.PluginUpdates && window.PluginUpdates.plugins && e.instance.props.title == "Plugins") {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {key: "folder-button"}); let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {key: "folder-button"});
if (index > -1) children.splice(index + 1, 0, BDFDB.ReactUtils.createElement(LibraryComponents.TooltipContainer, { if (index > -1) children.splice(index + 1, 0, BDFDB.ReactUtils.createElement(LibraryComponents.TooltipContainer, {
text: "Only checks for updates of plugins, which support the updatecheck. Rightclick for a list of supported plugins. (Listed ≠ Outdated)", text: "Only checks for updates of plugins, which support the updatecheck. Rightclick for a list of supported plugins. (Listed ≠ Outdated)",

File diff suppressed because one or more lines are too long

View File

@ -68,7 +68,7 @@ class BetterNsfwTag {
// begin of own functions // begin of own functions
processChannelItem (e) { processChannelItem (e) {
if (e.instance.props && e.instance.props.channel && e.instance.props.channel.nsfw) { if (e.instance.props.channel && e.instance.props.channel.nsfw) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["className", BDFDB.disCN.channelchildren]]}); let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["className", BDFDB.disCN.channelchildren]]});
if (index > -1 && children[index].props && children[index].props.children) { if (index > -1 && children[index].props && children[index].props.children) {
let [oldTagParent, oldTagIndex] = BDFDB.ReactUtils.findChildren(children[index], {key: "NSFW-badge"}); let [oldTagParent, oldTagIndex] = BDFDB.ReactUtils.findChildren(children[index], {key: "NSFW-badge"});

View File

@ -136,7 +136,7 @@ class BetterSearchPage {
} }
processSearchResults (e) { processSearchResults (e) {
if (e.instance.props && e.instance.props.search) { if (e.instance.props.search) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name:"Pagination"}); let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name:"Pagination"});
if (index > -1) { if (index > -1) {
let settings = BDFDB.DataUtils.get(this, "settings"); let settings = BDFDB.DataUtils.get(this, "settings");

View File

@ -125,7 +125,7 @@ class CharCounter {
// begin of own functions // begin of own functions
processChannelTextArea (e) { processChannelTextArea (e) {
if (e.instance.props && e.instance.props.type && this.maxLenghts[e.instance.props.type]) { if (e.instance.props.type && this.maxLenghts[e.instance.props.type]) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "TextAreaAutosize"}); let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "TextAreaAutosize"});
if (index > -1) this.injectCounter(e.returnvalue, children, e.instance.props.type, BDFDB.dotCN.textarea, true); if (index > -1) this.injectCounter(e.returnvalue, children, e.instance.props.type, BDFDB.dotCN.textarea, true);
} }

View File

@ -59,7 +59,7 @@ class CopyRawMessage {
// begin of own functions // begin of own functions
onMessageContextMenu (e) { onMessageContextMenu (e) {
if (e.instance.props && e.instance.props.message && e.instance.props.message.content) { if (e.instance.props.message && e.instance.props.message.content) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]}); let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]});
const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, { const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
children: [ children: [
@ -79,7 +79,7 @@ class CopyRawMessage {
} }
onMessageOptionPopout (e) { onMessageOptionPopout (e) {
if (e.instance.props && e.instance.props.message) { if (e.instance.props.message) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["label", BDFDB.LanguageUtils.LanguageStrings.DELETE]]}); let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["label", BDFDB.LanguageUtils.LanguageStrings.DELETE]]});
children.splice(index, 0, BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, { children.splice(index, 0, BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: BDFDB.LanguageUtils.LanguageStrings.COPY_TEXT + " (Raw)", label: BDFDB.LanguageUtils.LanguageStrings.COPY_TEXT + " (Raw)",

View File

@ -228,7 +228,7 @@ class CreationDate {
} }
processAnalyticsContext (e) { processAnalyticsContext (e) {
if (typeof e.returnvalue.props.children == "function" && e.instance.props && e.instance.props.section == "Profile Modal" && BDFDB.DataUtils.get(this, "settings", "addInUserProfil")) { if (typeof e.returnvalue.props.children == "function" && e.instance.props.section == "Profile Modal" && BDFDB.DataUtils.get(this, "settings", "addInUserProfil")) {
let renderChildren = e.returnvalue.props.children; let renderChildren = e.returnvalue.props.children;
e.returnvalue.props.children = () => { e.returnvalue.props.children = () => {
let renderedChildren = renderChildren(e.instance); let renderedChildren = renderChildren(e.instance);

View File

@ -106,11 +106,11 @@ class GoogleSearchReplace {
// begin of own functions // begin of own functions
onNativeContextMenu (e) { onNativeContextMenu (e) {
if (e.instance.props && e.instance.props.type == "NATIVE_TEXT" && e.instance.props.value) this.injectItem(e, e.instance.props.value); if (e.instance.props.type == "NATIVE_TEXT" && e.instance.props.value) this.injectItem(e, e.instance.props.value);
} }
onMessageContextMenu (e) { onMessageContextMenu (e) {
if (e.instance.props && e.instance.props.message && e.instance.props.channel && e.instance.props.target) { if (e.instance.props.message && e.instance.props.channel && e.instance.props.target) {
let text = document.getSelection().toString(); let text = document.getSelection().toString();
if (text) this.injectItem(e, text); if (text) this.injectItem(e, text);
} }

View File

@ -230,7 +230,7 @@ class JoinedAtDate {
} }
processAnalyticsContext (e) { processAnalyticsContext (e) {
if (typeof e.returnvalue.props.children == "function" && e.instance.props && e.instance.props.section == "Profile Modal" && BDFDB.DataUtils.get(this, "settings", "addInUserProfil")) { if (typeof e.returnvalue.props.children == "function" && e.instance.props.section == "Profile Modal" && BDFDB.DataUtils.get(this, "settings", "addInUserProfil")) {
let renderChildren = e.returnvalue.props.children; let renderChildren = e.returnvalue.props.children;
e.returnvalue.props.children = () => { e.returnvalue.props.children = () => {
let renderedChildren = renderChildren(e.instance); let renderedChildren = renderChildren(e.instance);

View File

@ -237,7 +237,7 @@ class LastMessageDate {
} }
processAnalyticsContext (e) { processAnalyticsContext (e) {
if (typeof e.returnvalue.props.children == "function" && e.instance.props && e.instance.props.section == "Profile Modal" && BDFDB.DataUtils.get(this, "settings", "addInUserProfil")) { if (typeof e.returnvalue.props.children == "function" && e.instance.props.section == "Profile Modal" && BDFDB.DataUtils.get(this, "settings", "addInUserProfil")) {
let renderChildren = e.returnvalue.props.children; let renderChildren = e.returnvalue.props.children;
e.returnvalue.props.children = () => { e.returnvalue.props.children = () => {
let renderedChildren = renderChildren(e.instance); let renderedChildren = renderChildren(e.instance);

View File

@ -120,7 +120,7 @@ class PersonalPins {
// begin of own functions // begin of own functions
onMessageContextMenu (e) { onMessageContextMenu (e) {
if (e.instance.props && e.instance.props.message && e.instance.props.channel && e.instance.props.target) { if (e.instance.props.message && e.instance.props.channel && e.instance.props.target) {
let {messagediv, pos} = this.getMessageAndPos(e.instance.props.target); let {messagediv, pos} = this.getMessageAndPos(e.instance.props.target);
if (!messagediv || pos == -1) return; if (!messagediv || pos == -1) return;
let note = this.getNoteData(e.instance.props.message, e.instance.props.target, e.instance.props.channel); let note = this.getNoteData(e.instance.props.message, e.instance.props.target, e.instance.props.channel);

View File

@ -60,7 +60,7 @@ class RevealAllSpoilersOption {
// begin of own functions // begin of own functions
onMessageContextMenu (e) { onMessageContextMenu (e) {
if (e.instance.props && e.instance.props.message && e.instance.props.target) { if (e.instance.props.message && e.instance.props.target) {
let messagediv = BDFDB.DOMUtils.getParent(BDFDB.dotCN.messagegroup + "> [aria-disabled]," + 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; if (!messagediv || !messagediv.querySelector(BDFDB.dotCN.spoilerhidden)) return;
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]}); let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]});

View File

@ -116,25 +116,25 @@ class ReverseImageSearch {
// begin of own functions // begin of own functions
onGuildContextMenu (e) { onGuildContextMenu (e) {
if (e.instance.props && e.instance.props.guild && e.instance.props.target) { if (e.instance.props.guild && e.instance.props.target) {
let guildicon = BDFDB.DOMUtils.containsClass(e.instance.props.target, BDFDB.disCN.avataricon) ? e.instance.props.target : e.instance.props.target.querySelector(BDFDB.dotCN.guildicon); let guildicon = BDFDB.DOMUtils.containsClass(e.instance.props.target, BDFDB.disCN.avataricon) ? e.instance.props.target : e.instance.props.target.querySelector(BDFDB.dotCN.guildicon);
if (guildicon && BDFDB.DataUtils.get(this, "settings", "addGuildIconEntry")) this.injectItem(e, guildicon.tagName == "IMG" ? guildicon.getAttribute("src") : guildicon.style.getPropertyValue("background-image")); if (guildicon && BDFDB.DataUtils.get(this, "settings", "addGuildIconEntry")) this.injectItem(e, guildicon.tagName == "IMG" ? guildicon.getAttribute("src") : guildicon.style.getPropertyValue("background-image"));
} }
} }
onUserContextMenu (e) { onUserContextMenu (e) {
if (e.instance.props && e.instance.props.user && e.instance.props.target) { if (e.instance.props.user && e.instance.props.target) {
let avatar = BDFDB.DOMUtils.containsClass(e.instance.props.target, BDFDB.disCN.avataricon) ? e.instance.props.target : e.instance.props.target.querySelector(BDFDB.dotCN.avatar); let avatar = BDFDB.DOMUtils.containsClass(e.instance.props.target, BDFDB.disCN.avataricon) ? e.instance.props.target : e.instance.props.target.querySelector(BDFDB.dotCN.avatar);
if (avatar && BDFDB.DataUtils.get(this, "settings", "addUserAvatarEntry")) this.injectItem(e, avatar.tagName == "IMG" ? avatar.getAttribute("src") : avatar.style.getPropertyValue("background-image")); if (avatar && BDFDB.DataUtils.get(this, "settings", "addUserAvatarEntry")) this.injectItem(e, avatar.tagName == "IMG" ? avatar.getAttribute("src") : avatar.style.getPropertyValue("background-image"));
} }
} }
onNativeContextMenu (e) { onNativeContextMenu (e) {
if (e.instance.props && e.instance.props.type == "NATIVE_IMAGE" && (e.instance.props.href || e.instance.props.src)) this.injectItem(e, e.instance.props.href || e.instance.props.src); if (e.instance.props.type == "NATIVE_IMAGE" && (e.instance.props.href || e.instance.props.src)) this.injectItem(e, e.instance.props.href || e.instance.props.src);
} }
onMessageContextMenu (e) { onMessageContextMenu (e) {
if (e.instance.props && e.instance.props.message && e.instance.props.channel && e.instance.props.target) { if (e.instance.props.message && e.instance.props.channel && e.instance.props.target) {
if (e.instance.props.attachment) this.injectItem(e, e.instance.props.attachment.url); if (e.instance.props.attachment) this.injectItem(e, e.instance.props.attachment.url);
else if (e.instance.props.target.tagName == "A" && e.instance.props.message.embeds && e.instance.props.message.embeds[0] && e.instance.props.message.embeds[0].type == "image") this.injectItem(e, e.instance.props.target.href); else if (e.instance.props.target.tagName == "A" && e.instance.props.message.embeds && e.instance.props.message.embeds[0] && e.instance.props.message.embeds[0].type == "image") this.injectItem(e, e.instance.props.target.href);
else if (e.instance.props.target.tagName == "IMG" && BDFDB.DOMUtils.containsClass(e.instance.props.target, "emoji", "emote", false) && BDFDB.DataUtils.get(this, "settings", "addEmojiEntry")) this.injectItem(e, e.instance.props.target.src); else if (e.instance.props.target.tagName == "IMG" && BDFDB.DOMUtils.containsClass(e.instance.props.target, "emoji", "emote", false) && BDFDB.DataUtils.get(this, "settings", "addEmojiEntry")) this.injectItem(e, e.instance.props.target.src);

View File

@ -69,7 +69,7 @@ class ThemeSettings {
// begin of own functions // begin of own functions
processV2CThemeCard (e) { processV2CThemeCard (e) {
if (e.instance.props && e.instance.props.theme && !e.instance.state.settings) { if (e.instance.props.theme && !e.instance.state.settings) {
let vars = this.getThemeVars(e.instance.props.theme.css); let vars = this.getThemeVars(e.instance.props.theme.css);
if (vars.length) { if (vars.length) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props: [["className", BDFDB.disCN._repofooter]]}); let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props: [["className", BDFDB.disCN._repofooter]]});

View File

@ -87,7 +87,7 @@ class UserNotes {
// begin of own functions // begin of own functions
onUserContextMenu (e) { onUserContextMenu (e) {
if (e.instance.props && e.instance.props.user) { if (e.instance.props.user) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]}); let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]});
const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, { const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
children: [ children: [

View File

@ -64,7 +64,7 @@ class WriteUpperCase {
// begin of own functions // begin of own functions
processChannelTextArea (e) { processChannelTextArea (e) {
if (e.instance.props && e.instance.props.type) { if (e.instance.props.type) {
var textarea = e.node.querySelector("textarea"); var textarea = e.node.querySelector("textarea");
if (!textarea) return; if (!textarea) return;
BDFDB.ListenerUtils.add(this, textarea, "keyup", () => { BDFDB.ListenerUtils.add(this, textarea, "keyup", () => {