plugins
This commit is contained in:
parent
953e2a976c
commit
3c6828d825
|
@ -3,7 +3,7 @@
|
|||
class GoogleSearchReplace {
|
||||
getName () {return "GoogleSearchReplace";}
|
||||
|
||||
getVersion () {return "1.1.9";}
|
||||
getVersion () {return "1.2.0";}
|
||||
|
||||
getAuthor () {return "DevilBro";}
|
||||
|
||||
|
@ -11,7 +11,7 @@ class GoogleSearchReplace {
|
|||
|
||||
constructor () {
|
||||
this.changelog = {
|
||||
"fixed":[["Light Theme Update","Fixed bugs for the Light Theme Update, which broke 99% of my plugins"]]
|
||||
"improved":[["New Library Structure & React","Restructured my Library and switched to React rendering instead of DOM manipulation"]]
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -42,19 +42,24 @@ class GoogleSearchReplace {
|
|||
getSettingsPanel () {
|
||||
if (!global.BDFDB || typeof BDFDB != "object" || !BDFDB.loaded || !this.started) return;
|
||||
let engines = BDFDB.DataUtils.get(this, "engines");
|
||||
let settingshtml = `<div class="${this.name}-settings BDFDB-settings"><div class="${BDFDB.disCNS.titledefault + BDFDB.disCNS.titlesize18 + BDFDB.disCNS.height24 + BDFDB.disCNS.weightnormal + BDFDB.disCN.marginbottom8}">${this.name}</div><div class="BDFDB-settings-inner">`;
|
||||
settingshtml += `<div class="${BDFDB.disCNS.flex + BDFDB.disCNS.horizontal + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8}" style="flex: 1 1 auto;"><h3 class="${BDFDB.disCNS.titledefault + BDFDB.disCNS.marginreset + BDFDB.disCNS.weightmedium + BDFDB.disCNS.titlesize16 + BDFDB.disCNS.height24 + BDFDB.disCN.flexchild}" style="flex: 0 0 auto;">Search Engines:</h3></div><div class="BDFDB-settings-inner-list">`;
|
||||
for (let key in engines) {
|
||||
settingshtml += `<div class="${BDFDB.disCNS.flex + BDFDB.disCNS.horizontal + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8}" style="flex: 1 1 auto;"><h3 class="${BDFDB.disCNS.titledefault + BDFDB.disCNS.marginreset + BDFDB.disCNS.weightmedium + BDFDB.disCNS.titlesize16 + BDFDB.disCNS.height24 + BDFDB.disCN.flexchild}" style="flex: 1 1 auto;">${this.defaults.engines[key].name}</h3><div class="${BDFDB.disCNS.flexchild + BDFDB.disCNS.switchenabled + BDFDB.disCNS.switch + BDFDB.disCNS.switchvalue + BDFDB.disCNS.switchsizedefault + BDFDB.disCNS.switchsize + BDFDB.disCN.switchthemedefault}" style="flex: 0 0 auto;"><input type="checkbox" value="engines ${key}" class="${BDFDB.disCNS.switchinnerenabled + BDFDB.disCN.switchinner} settings-switch"${engines[key] ? " checked" : ""}></div></div>`;
|
||||
}
|
||||
settingshtml += `</div>`;
|
||||
settingshtml += `</div></div>`;
|
||||
|
||||
let settingspanel = BDFDB.DOMUtils.create(settingshtml);
|
||||
|
||||
BDFDB.initElements(settingspanel, this);
|
||||
|
||||
return settingspanel;
|
||||
let settingsitems = [], inneritems = [];
|
||||
|
||||
for (let key in engines) inneritems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, {
|
||||
className: BDFDB.disCN.marginbottom8,
|
||||
type: "Switch",
|
||||
plugin: this,
|
||||
keys: ["engines", key],
|
||||
label: this.defaults.engines[key].name,
|
||||
value: engines[key]
|
||||
}));
|
||||
settingsitems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsPanelInner, {
|
||||
title: "Search Engines:",
|
||||
first: settingsitems.length == 0,
|
||||
last: true,
|
||||
children: inneritems
|
||||
}));
|
||||
|
||||
return BDFDB.PluginUtils.createSettingsPanel(this, settingsitems);
|
||||
}
|
||||
|
||||
//legacy
|
||||
|
@ -100,27 +105,26 @@ class GoogleSearchReplace {
|
|||
|
||||
// begin of own functions
|
||||
|
||||
onNativeContextMenu (instance, menu, returnvalue) {
|
||||
if (instance.props && instance.props.type == "NATIVE_TEXT" && instance.props.value && !menu.querySelector(`${this.name}-contextMenuSubItem`)) {
|
||||
this.appendItem(menu, returnvalue, instance.props.value);
|
||||
}
|
||||
onNativeContextMenu (e) {
|
||||
if (e.instance.props && e.instance.props.type == "NATIVE_TEXT" && e.instance.props.value) this.injectItem(e, e.instance.props.value);
|
||||
}
|
||||
|
||||
onMessageContextMenu (instance, menu, returnvalue) {
|
||||
if (instance.props && instance.props.message && instance.props.channel && instance.props.target && !menu.querySelector(`${this.name}-contextMenuSubItem`)) {
|
||||
onMessageContextMenu (e) {
|
||||
if (e.instance.props && e.instance.props.message && e.instance.props.channel && e.instance.props.target) {
|
||||
let text = document.getSelection().toString();
|
||||
if (text) this.appendItem(menu, returnvalue, text);
|
||||
if (text) this.injectItem(e, text);
|
||||
}
|
||||
}
|
||||
|
||||
appendItem (menu, returnvalue, text) {
|
||||
injectItem (e, text) {
|
||||
let engines = BDFDB.DataUtils.get(this, "engines");
|
||||
let items = [];
|
||||
for (let key in engines) if (engines[key]) items.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
||||
label: this.defaults.engines[key].name,
|
||||
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-engine-contextMenuItem`,
|
||||
danger: key == "_all",
|
||||
action: e => {
|
||||
if (!e.shiftKey) BDFDB.ContextMenuUtils.close(menu);
|
||||
if (!e.shiftKey) BDFDB.ContextMenuUtils.close(e.instance);
|
||||
if (key == "_all") {
|
||||
for (let key2 in engines) if (key2 != "_all" && engines[key2]) window.open(this.defaults.engines[key2].url.replace(this.textUrlReplaceString, encodeURIComponent(text)), "_blank");
|
||||
}
|
||||
|
@ -132,7 +136,7 @@ class GoogleSearchReplace {
|
|||
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-disabled-contextMenuItem`,
|
||||
disabled: true
|
||||
}));
|
||||
let [children, index] = BDFDB.ReactUtils.findChildren(returnvalue, {name:"SearchWithGoogle"});
|
||||
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name:"SearchWithGoogle"});
|
||||
const item = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuSubItem, {
|
||||
label: this.labels.context_googlesearchreplace_text,
|
||||
className: `BDFDB-contextMenuSubItem ${this.name}-contextMenuSubItem ${this.name}-search-contextMenuSubItem`,
|
||||
|
|
|
@ -118,7 +118,6 @@ class RepoControls {
|
|||
this.stopping = true;
|
||||
|
||||
BDFDB.ModuleUtils.forceAllUpdates(this);
|
||||
//BDFDB.DOMUtils.removeClassFromDOM("repocontrols-added");
|
||||
|
||||
BDFDB.PluginUtils.clear(this);
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
class RevealAllSpoilersOption {
|
||||
getName () {return "RevealAllSpoilersOption";}
|
||||
|
||||
getVersion () {return "1.0.1";}
|
||||
getVersion () {return "1.0.2";}
|
||||
|
||||
getAuthor () {return "DevilBro";}
|
||||
|
||||
|
@ -11,11 +11,7 @@ class RevealAllSpoilersOption {
|
|||
|
||||
constructor () {
|
||||
this.changelog = {
|
||||
"fixed":[["Light Theme Update","Fixed bugs for the Light Theme Update, which broke 99% of my plugins"]]
|
||||
};
|
||||
|
||||
this.patchModules = {
|
||||
"StandardSidebarView":"componentWillUnmount"
|
||||
"improved":[["New Library Structure & React","Restructured my Library and switched to React rendering instead of DOM manipulation"]]
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -63,11 +59,11 @@ class RevealAllSpoilersOption {
|
|||
|
||||
// begin of own functions
|
||||
|
||||
onMessageContextMenu (instance, menu, returnvalue) {
|
||||
if (instance.props && instance.props.message && instance.props.target && !menu.querySelector(`${this.name}-contextMenuItem`)) {
|
||||
let messagediv = BDFDB.DOMUtils.getParent(BDFDB.dotCN.messagegroup + "> [aria-disabled]", instance.props.target);
|
||||
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);
|
||||
if (!messagediv || !messagediv.querySelector(BDFDB.dotCN.spoilerhidden)) return;
|
||||
let [children, index] = BDFDB.ReactUtils.findChildren(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, {
|
||||
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
|
||||
children: [
|
||||
|
@ -76,7 +72,7 @@ class RevealAllSpoilersOption {
|
|||
hint: BDFDB.BDUtils.isPluginEnabled("MessageUtilities") ? BDFDB.BDUtils.getPlugin("MessageUtilities").getActiveShortcutString("__Reveal_Spoilers") : null,
|
||||
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-reveal-contextMenuItem`,
|
||||
action: e => {
|
||||
BDFDB.ContextMenuUtils.close(menu);
|
||||
BDFDB.ContextMenuUtils.close(e.instance);
|
||||
this.revealAllSpoilers(messagediv);
|
||||
}
|
||||
})
|
||||
|
@ -88,7 +84,7 @@ class RevealAllSpoilersOption {
|
|||
}
|
||||
|
||||
revealAllSpoilers (target) {
|
||||
let messagediv = BDFDB.DOMUtils.getParent(BDFDB.dotCN.messagegroup + "> [aria-disabled]", target);
|
||||
let messagediv = BDFDB.DOMUtils.getParent(BDFDB.dotCN.messagegroup + "> [aria-disabled]", target) || BDFDB.DOMUtils.getParent(BDFDB.dotCN.messagegroup + "> * > [aria-disabled]", target);
|
||||
if (!messagediv) return;
|
||||
for (let spoiler of messagediv.querySelectorAll(BDFDB.dotCN.spoilerhidden)) spoiler.click();
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
class ReverseImageSearch {
|
||||
getName () {return "ReverseImageSearch";}
|
||||
|
||||
getVersion () {return "3.4.6";}
|
||||
getVersion () {return "3.4.7";}
|
||||
|
||||
getAuthor () {return "DevilBro";}
|
||||
|
||||
|
@ -11,7 +11,7 @@ class ReverseImageSearch {
|
|||
|
||||
constructor () {
|
||||
this.changelog = {
|
||||
"added":[["New Options","Right clicking a user avatar/server icon/custom emoji now also adds a context menu entry to reverse image search the image, can be disabled"]]
|
||||
"improved":[["New Library Structure & React","Restructured my Library and switched to React rendering instead of DOM manipulation"]]
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -42,26 +42,34 @@ class ReverseImageSearch {
|
|||
|
||||
getSettingsPanel () {
|
||||
if (!global.BDFDB || typeof BDFDB != "object" || !BDFDB.loaded || !this.started) return;
|
||||
let settings = BDFDB.DataUtils.get(this, "settings");
|
||||
let settings = BDFDB.DataUtils.get(this, "engines");
|
||||
let engines = BDFDB.DataUtils.get(this, "engines");
|
||||
let settingshtml = `<div class="${this.name}-settings BDFDB-settings"><div class="${BDFDB.disCNS.titledefault + BDFDB.disCNS.titlesize18 + BDFDB.disCNS.height24 + BDFDB.disCNS.weightnormal + BDFDB.disCN.marginbottom8}">${this.name}</div><div class="BDFDB-settings-inner">`;
|
||||
settingshtml += `<div class="${BDFDB.disCNS.flex + BDFDB.disCNS.horizontal + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8}" style="flex: 1 1 auto;"><h3 class="${BDFDB.disCNS.titledefault + BDFDB.disCNS.marginreset + BDFDB.disCNS.weightmedium + BDFDB.disCNS.titlesize16 + BDFDB.disCNS.height24 + BDFDB.disCN.flexchild}" style="flex: 0 0 auto;">Add a contextmenu entry when right clicking</h3></div><div class="BDFDB-settings-inner-list">`;
|
||||
for (let key in settings) {
|
||||
settingshtml += `<div class="${BDFDB.disCNS.flex + BDFDB.disCNS.horizontal + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8}" style="flex: 1 1 auto;"><h3 class="${BDFDB.disCNS.titledefault + BDFDB.disCNS.marginreset + BDFDB.disCNS.weightmedium + BDFDB.disCNS.titlesize16 + BDFDB.disCNS.height24 + BDFDB.disCN.flexchild}" style="flex: 1 1 auto;">${this.defaults.settings[key].description}</h3><div class="${BDFDB.disCNS.flexchild + BDFDB.disCNS.switchenabled + BDFDB.disCNS.switch + BDFDB.disCNS.switchvalue + BDFDB.disCNS.switchsizedefault + BDFDB.disCNS.switchsize + BDFDB.disCN.switchthemedefault}" style="flex: 0 0 auto;"><input type="checkbox" value="settings ${key}" class="${BDFDB.disCNS.switchinnerenabled + BDFDB.disCN.switchinner} settings-switch"${settings[key] ? " checked" : ""}></div></div>`;
|
||||
}
|
||||
settingshtml += `</div>`;
|
||||
settingshtml += `<div class="${BDFDB.disCNS.flex + BDFDB.disCNS.horizontal + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8}" style="flex: 1 1 auto;"><h3 class="${BDFDB.disCNS.titledefault + BDFDB.disCNS.marginreset + BDFDB.disCNS.weightmedium + BDFDB.disCNS.titlesize16 + BDFDB.disCNS.height24 + BDFDB.disCN.flexchild}" style="flex: 0 0 auto;">Search Engines:</h3></div><div class="BDFDB-settings-inner-list">`;
|
||||
for (let key in engines) {
|
||||
settingshtml += `<div class="${BDFDB.disCNS.flex + BDFDB.disCNS.horizontal + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8}" style="flex: 1 1 auto;"><h3 class="${BDFDB.disCNS.titledefault + BDFDB.disCNS.marginreset + BDFDB.disCNS.weightmedium + BDFDB.disCNS.titlesize16 + BDFDB.disCNS.height24 + BDFDB.disCN.flexchild}" style="flex: 1 1 auto;">${this.defaults.engines[key].name}</h3><div class="${BDFDB.disCNS.flexchild + BDFDB.disCNS.switchenabled + BDFDB.disCNS.switch + BDFDB.disCNS.switchvalue + BDFDB.disCNS.switchsizedefault + BDFDB.disCNS.switchsize + BDFDB.disCN.switchthemedefault}" style="flex: 0 0 auto;"><input type="checkbox" value="engines ${key}" class="${BDFDB.disCNS.switchinnerenabled + BDFDB.disCN.switchinner} settings-switch"${engines[key] ? " checked" : ""}></div></div>`;
|
||||
}
|
||||
settingshtml += `</div>`;
|
||||
settingshtml += `</div></div>`;
|
||||
|
||||
let settingspanel = BDFDB.DOMUtils.create(settingshtml);
|
||||
|
||||
BDFDB.initElements(settingspanel, this);
|
||||
|
||||
return settingspanel;
|
||||
let settingsitems = [], inneritems = [];
|
||||
|
||||
for (let key in settings) settingsitems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, {
|
||||
className: BDFDB.disCN.marginbottom8,
|
||||
type: "Switch",
|
||||
plugin: this,
|
||||
keys: ["settings", key],
|
||||
label: this.defaults.settings[key].description,
|
||||
value: settings[key]
|
||||
}));
|
||||
for (let key in engines) inneritems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, {
|
||||
className: BDFDB.disCN.marginbottom8,
|
||||
type: "Switch",
|
||||
plugin: this,
|
||||
keys: ["engines", key],
|
||||
label: this.defaults.engines[key].name,
|
||||
value: engines[key]
|
||||
}));
|
||||
settingsitems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsPanelInner, {
|
||||
title: "Search Engines:",
|
||||
first: settingsitems.length == 0,
|
||||
last: true,
|
||||
children: inneritems
|
||||
}));
|
||||
|
||||
return BDFDB.PluginUtils.createSettingsPanel(this, settingsitems);
|
||||
}
|
||||
|
||||
//legacy
|
||||
|
@ -107,41 +115,33 @@ class ReverseImageSearch {
|
|||
|
||||
// begin of own functions
|
||||
|
||||
onGuildContextMenu (instance, menu, returnvalue) {
|
||||
if (instance.props && instance.props.guild && instance.props.target) {
|
||||
let guildicon = BDFDB.DOMUtils.containsClass(instance.props.target, BDFDB.disCN.avataricon) ? instance.props.target : instance.props.target.querySelector(BDFDB.dotCN.guildicon);
|
||||
if (guildicon && BDFDB.DataUtils.get(this, "settings", "addGuildIconEntry")) this.appendItem(menu, returnvalue, guildicon.tagName == "IMG" ? guildicon.getAttribute("src") : guildicon.style.getPropertyValue("background-image"));
|
||||
onGuildContextMenu (e) {
|
||||
if (e.instance.props && 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);
|
||||
if (guildicon && BDFDB.DataUtils.get(this, "settings", "addGuildIconEntry")) this.injectItem(e, guildicon.tagName == "IMG" ? guildicon.getAttribute("src") : guildicon.style.getPropertyValue("background-image"));
|
||||
}
|
||||
}
|
||||
|
||||
onUserContextMenu (instance, menu, returnvalue) {
|
||||
if (instance.props && instance.props.user && instance.props.target) {
|
||||
let avatar = BDFDB.DOMUtils.containsClass(instance.props.target, BDFDB.disCN.avataricon) ? instance.props.target : instance.props.target.querySelector(BDFDB.dotCN.avatar);
|
||||
if (avatar && BDFDB.DataUtils.get(this, "settings", "addUserAvatarEntry")) this.appendItem(menu, returnvalue, avatar.tagName == "IMG" ? avatar.getAttribute("src") : avatar.style.getPropertyValue("background-image"));
|
||||
onUserContextMenu (e) {
|
||||
if (e.instance.props && 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);
|
||||
if (avatar && BDFDB.DataUtils.get(this, "settings", "addUserAvatarEntry")) this.injectItem(e, avatar.tagName == "IMG" ? avatar.getAttribute("src") : avatar.style.getPropertyValue("background-image"));
|
||||
}
|
||||
}
|
||||
|
||||
onNativeContextMenu (instance, menu, returnvalue) {
|
||||
if (instance.props && instance.props.type == "NATIVE_IMAGE" && (instance.props.href || instance.props.src) && !menu.querySelector(`${this.name}-contextMenuSubItem`)) {
|
||||
this.appendItem(menu, returnvalue, instance.props.href || instance.props.src);
|
||||
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);
|
||||
}
|
||||
|
||||
onMessageContextMenu (e) {
|
||||
if (e.instance.props && 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);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
onMessageContextMenu (instance, menu, returnvalue) {
|
||||
if (instance.props && instance.props.message && instance.props.channel && instance.props.target && !menu.querySelector(".reverseimagesearch-item")) {
|
||||
if (instance.props.attachment) {
|
||||
this.appendItem(menu, returnvalue, instance.props.attachment.url);
|
||||
}
|
||||
if (instance.props.target.tagName == "A" && instance.props.message.embeds && instance.props.message.embeds[0] && instance.props.message.embeds[0].type == "image") {
|
||||
this.appendItem(menu, returnvalue, instance.props.target.href);
|
||||
}
|
||||
if (instance.props.target.tagName == "IMG" && BDFDB.DOMUtils.containsClass(instance.props.target, "emoji", "emote", false) && BDFDB.DataUtils.get(this, "settings", "addEmojiEntry")) {
|
||||
this.appendItem(menu, returnvalue, instance.props.target.src);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
appendItem (menu, returnvalue, url) {
|
||||
injectItem (e, url) {
|
||||
if (url && url.indexOf("discordapp.com/assets/") == -1 && !url.endsWith(".mp4")) {
|
||||
url = url.replace(/^url\(|\)$|"|'/g, "").replace(/\?size\=\d+$/, "?size=4096");
|
||||
if (url.indexOf("https://images-ext-1.discordapp.net/external/") > -1) {
|
||||
|
@ -155,7 +155,7 @@ class ReverseImageSearch {
|
|||
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-engine-contextMenuItem`,
|
||||
danger: key == "_all",
|
||||
action: e => {
|
||||
if (!e.shiftKey) BDFDB.ContextMenuUtils.close(menu);
|
||||
if (!e.shiftKey) BDFDB.ContextMenuUtils.close(e.instance);
|
||||
if (key == "_all") {
|
||||
for (let key2 in engines) if (key2 != "_all" && engines[key2]) window.open(this.defaults.engines[key2].url.replace(this.imgUrlReplaceString, encodeURIComponent(url)), "_blank");
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ class ReverseImageSearch {
|
|||
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-disabled-contextMenuItem`,
|
||||
disabled: true
|
||||
}));
|
||||
let [children, index] = BDFDB.ReactUtils.findChildren(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, {
|
||||
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
|
||||
children: [
|
||||
|
|
Loading…
Reference in New Issue