stuff
This commit is contained in:
parent
3070f97ae1
commit
6254555cfa
|
@ -312,7 +312,7 @@ class ChatAliases {
|
||||||
children: [
|
children: [
|
||||||
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
||||||
label: "Add to ChatAliases",
|
label: "Add to ChatAliases",
|
||||||
action: e => {
|
action: _ => {
|
||||||
BDFDB.ContextMenuUtils.close(menu);
|
BDFDB.ContextMenuUtils.close(menu);
|
||||||
this.openAddModal(text);
|
this.openAddModal(text);
|
||||||
}
|
}
|
||||||
|
|
|
@ -304,7 +304,7 @@ class ChatFilter {
|
||||||
children: [
|
children: [
|
||||||
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
||||||
label: "Add to ChatFilter",
|
label: "Add to ChatFilter",
|
||||||
action: e => {
|
action: _ => {
|
||||||
BDFDB.ContextMenuUtils.close(menu);
|
BDFDB.ContextMenuUtils.close(menu);
|
||||||
this.openAddModal(text);
|
this.openAddModal(text);
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,7 +154,7 @@ class EditChannels {
|
||||||
children: [
|
children: [
|
||||||
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
||||||
label: this.labels.submenu_channelsettings_text,
|
label: this.labels.submenu_channelsettings_text,
|
||||||
action: e => {
|
action: _ => {
|
||||||
BDFDB.ContextMenuUtils.close(menu);
|
BDFDB.ContextMenuUtils.close(menu);
|
||||||
this.showChannelSettings(instance.props.channel);
|
this.showChannelSettings(instance.props.channel);
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ class EditChannels {
|
||||||
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
||||||
label: this.labels.submenu_resetsettings_text,
|
label: this.labels.submenu_resetsettings_text,
|
||||||
disabled: !BDFDB.DataUtils.load(this, "channels", instance.props.channel.id),
|
disabled: !BDFDB.DataUtils.load(this, "channels", instance.props.channel.id),
|
||||||
action: e => {
|
action: _ => {
|
||||||
BDFDB.ContextMenuUtils.close(menu);
|
BDFDB.ContextMenuUtils.close(menu);
|
||||||
BDFDB.DataUtils.remove(this, "channels", instance.props.channel.id);
|
BDFDB.DataUtils.remove(this, "channels", instance.props.channel.id);
|
||||||
this.forceUpdateAll();
|
this.forceUpdateAll();
|
||||||
|
|
|
@ -145,7 +145,7 @@ class EditServers {
|
||||||
children: [
|
children: [
|
||||||
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
||||||
label: this.labels.submenu_serversettings_text,
|
label: this.labels.submenu_serversettings_text,
|
||||||
action: e => {
|
action: _ => {
|
||||||
BDFDB.ContextMenuUtils.close(menu);
|
BDFDB.ContextMenuUtils.close(menu);
|
||||||
this.showServerSettings(instance.props.guild);
|
this.showServerSettings(instance.props.guild);
|
||||||
}
|
}
|
||||||
|
@ -153,7 +153,7 @@ class EditServers {
|
||||||
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
||||||
label: this.labels.submenu_resetsettings_text,
|
label: this.labels.submenu_resetsettings_text,
|
||||||
disabled: !BDFDB.DataUtils.load(this, "servers", instance.props.guild.id),
|
disabled: !BDFDB.DataUtils.load(this, "servers", instance.props.guild.id),
|
||||||
action: e => {
|
action: _ => {
|
||||||
BDFDB.ContextMenuUtils.close(menu);
|
BDFDB.ContextMenuUtils.close(menu);
|
||||||
BDFDB.DataUtils.remove(this, "servers", instance.props.guild.id);
|
BDFDB.DataUtils.remove(this, "servers", instance.props.guild.id);
|
||||||
this.forceUpdateAll(instance.props.guild.id);
|
this.forceUpdateAll(instance.props.guild.id);
|
||||||
|
|
|
@ -201,7 +201,7 @@ class EditUsers {
|
||||||
children: [
|
children: [
|
||||||
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
||||||
label: this.labels.submenu_usersettings_text,
|
label: this.labels.submenu_usersettings_text,
|
||||||
action: e => {
|
action: _ => {
|
||||||
BDFDB.ContextMenuUtils.close(menu);
|
BDFDB.ContextMenuUtils.close(menu);
|
||||||
this.showUserSettings(instance.props.user);
|
this.showUserSettings(instance.props.user);
|
||||||
}
|
}
|
||||||
|
@ -209,7 +209,7 @@ class EditUsers {
|
||||||
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
||||||
label: this.labels.submenu_resetsettings_text,
|
label: this.labels.submenu_resetsettings_text,
|
||||||
disabled: !BDFDB.DataUtils.load(this, "users", instance.props.user.id),
|
disabled: !BDFDB.DataUtils.load(this, "users", instance.props.user.id),
|
||||||
action: e => {
|
action: _ => {
|
||||||
BDFDB.ContextMenuUtils.close(menu);
|
BDFDB.ContextMenuUtils.close(menu);
|
||||||
BDFDB.DataUtils.remove(this, "users", instance.props.user.id);
|
BDFDB.DataUtils.remove(this, "users", instance.props.user.id);
|
||||||
this.forceUpdateAll();
|
this.forceUpdateAll();
|
||||||
|
|
|
@ -163,7 +163,7 @@ class GoogleTranslateOption {
|
||||||
const translateUntranslateItem = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
const translateUntranslateItem = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
||||||
label: translated ? this.labels.context_messageuntranslateoption_text : this.labels.context_messagetranslateoption_text,
|
label: translated ? this.labels.context_messageuntranslateoption_text : this.labels.context_messagetranslateoption_text,
|
||||||
hint: BDFDB.BDUtils.isPluginEnabled("MessageUtilities") ? BDFDB.BDUtils.getPlugin("MessageUtilities").getActiveShortcutString("__Translate_Message") : null,
|
hint: BDFDB.BDUtils.isPluginEnabled("MessageUtilities") ? BDFDB.BDUtils.getPlugin("MessageUtilities").getActiveShortcutString("__Translate_Message") : null,
|
||||||
action: e => {
|
action: _ => {
|
||||||
BDFDB.ContextMenuUtils.close(menu);
|
BDFDB.ContextMenuUtils.close(menu);
|
||||||
this.translateMessage(instance.props.message, instance.props.target, instance.props.channel);
|
this.translateMessage(instance.props.message, instance.props.target, instance.props.channel);
|
||||||
}
|
}
|
||||||
|
@ -177,8 +177,8 @@ class GoogleTranslateOption {
|
||||||
var foundtranslation, foundinput, foundoutput;
|
var foundtranslation, foundinput, foundoutput;
|
||||||
const searchTranslationItem = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
const searchTranslationItem = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
||||||
label: this.labels.context_googletranslateoption_text,
|
label: this.labels.context_googletranslateoption_text,
|
||||||
action: e => {
|
action: event => {
|
||||||
var item = BDFDB.DOMUtils.getParent(BDFDB.dotCN.contextmenuitem, e.target);
|
var item = BDFDB.DOMUtils.getParent(BDFDB.dotCN.contextmenuitem, event.target);
|
||||||
if (item) {
|
if (item) {
|
||||||
var createTooltip = () => {
|
var createTooltip = () => {
|
||||||
BDFDB.TooltipUtils.create(item, `From ${foundinput.name}:\n${text}\n\nTo ${foundoutput.name}:\n${foundtranslation}`, {type:"right", selector:"googletranslate-tooltip"});
|
BDFDB.TooltipUtils.create(item, `From ${foundinput.name}:\n${text}\n\nTo ${foundoutput.name}:\n${foundtranslation}`, {type:"right", selector:"googletranslate-tooltip"});
|
||||||
|
@ -214,7 +214,7 @@ class GoogleTranslateOption {
|
||||||
children.splice(index + 1, 0, BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
children.splice(index + 1, 0, BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
||||||
label: this.labels[translated ? "popout_untranslateoption_text" : "popout_translateoption_text"],
|
label: this.labels[translated ? "popout_untranslateoption_text" : "popout_translateoption_text"],
|
||||||
className: BDFDB.disCN.optionpopoutitem,
|
className: BDFDB.disCN.optionpopoutitem,
|
||||||
action: e => {
|
action: _ => {
|
||||||
this.translateMessage(instance.props.message, instance.props.target, instance.props.channel);
|
this.translateMessage(instance.props.message, instance.props.target, instance.props.channel);
|
||||||
instance.props.onClose();
|
instance.props.onClose();
|
||||||
}
|
}
|
||||||
|
|
|
@ -342,7 +342,7 @@ class PluginRepo {
|
||||||
BDFDB.TimeUtils.timeout(() => {for (let child of returnvalue.props.children) if (child && child.props && child.props.label == "BandagedBD" && Array.isArray(child.props.render)) {
|
BDFDB.TimeUtils.timeout(() => {for (let child of returnvalue.props.children) if (child && child.props && child.props.label == "BandagedBD" && Array.isArray(child.props.render)) {
|
||||||
const repoItem = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
const repoItem = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
||||||
label: "Plugin Repo",
|
label: "Plugin Repo",
|
||||||
action: e => {
|
action: _ => {
|
||||||
if (!this.loading.is) BDFDB.ContextMenuUtils.close(menu);
|
if (!this.loading.is) BDFDB.ContextMenuUtils.close(menu);
|
||||||
this.openPluginRepoModal();
|
this.openPluginRepoModal();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
class RevealAllSpoilersOption {
|
class RevealAllSpoilersOption {
|
||||||
getName () {return "RevealAllSpoilersOption";}
|
getName () {return "RevealAllSpoilersOption";}
|
||||||
|
|
||||||
getVersion () {return "1.0.2";}
|
getVersion () {return "1.0.3";}
|
||||||
|
|
||||||
getAuthor () {return "DevilBro";}
|
getAuthor () {return "DevilBro";}
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ class RevealAllSpoilersOption {
|
||||||
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
||||||
label: "Reveal all Spoilers",
|
label: "Reveal all Spoilers",
|
||||||
hint: BDFDB.BDUtils.isPluginEnabled("MessageUtilities") ? BDFDB.BDUtils.getPlugin("MessageUtilities").getActiveShortcutString("__Reveal_Spoilers") : null,
|
hint: BDFDB.BDUtils.isPluginEnabled("MessageUtilities") ? BDFDB.BDUtils.getPlugin("MessageUtilities").getActiveShortcutString("__Reveal_Spoilers") : null,
|
||||||
action: e => {
|
action: _ => {
|
||||||
BDFDB.ContextMenuUtils.close(e.instance);
|
BDFDB.ContextMenuUtils.close(e.instance);
|
||||||
this.revealAllSpoilers(messagediv);
|
this.revealAllSpoilers(messagediv);
|
||||||
}
|
}
|
||||||
|
|
|
@ -349,8 +349,8 @@ class ServerFolders {
|
||||||
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
||||||
label: this.labels.foldercontext_removefolder_text,
|
label: this.labels.foldercontext_removefolder_text,
|
||||||
danger: true,
|
danger: true,
|
||||||
action: e => {
|
action: _ => {
|
||||||
BDFDB.ContextMenuUtils.close(BDFDB.DOMUtils.getParent(BDFDB.dotCN.contextmenu, e.target));
|
BDFDB.ContextMenuUtils.close(instance);
|
||||||
BDFDB.ModalUtils.confirm(this, `Are you sure you want to remove the folder${folder.folderName ? (" '" + folder.folderName + '"') : ""}?`, () => {this.removeFolder(folderid);});
|
BDFDB.ModalUtils.confirm(this, `Are you sure you want to remove the folder${folder.folderName ? (" '" + folder.folderName + '"') : ""}?`, () => {this.removeFolder(folderid);});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -364,7 +364,7 @@ class ServerFolders {
|
||||||
let addtofolderitems = [], openguilds = BDFDB.LibraryModules.FolderStore.getSortedGuilds().filter(n => !n.folderId).map(n => n.guilds[0]);
|
let addtofolderitems = [], openguilds = BDFDB.LibraryModules.FolderStore.getSortedGuilds().filter(n => !n.folderId).map(n => n.guilds[0]);
|
||||||
for (let i = 0; i < folders.length; i++) addtofolderitems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
for (let i = 0; i < folders.length; i++) addtofolderitems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
||||||
label: folders[i].folderName || (this.labels.modal_tabheader1_text + " #" + parseInt(i+1)),
|
label: folders[i].folderName || (this.labels.modal_tabheader1_text + " #" + parseInt(i+1)),
|
||||||
action: e => {
|
action: _ => {
|
||||||
BDFDB.ContextMenuUtils.close(menu);
|
BDFDB.ContextMenuUtils.close(menu);
|
||||||
this.addGuildToFolder(folders[i].folderId, guildid);
|
this.addGuildToFolder(folders[i].folderId, guildid);
|
||||||
}
|
}
|
||||||
|
@ -379,7 +379,7 @@ class ServerFolders {
|
||||||
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
||||||
label: this.labels.serversubmenu_removefromfolder_text,
|
label: this.labels.serversubmenu_removefromfolder_text,
|
||||||
danger: true,
|
danger: true,
|
||||||
action: e => {
|
action: _ => {
|
||||||
BDFDB.ContextMenuUtils.close(menu);
|
BDFDB.ContextMenuUtils.close(menu);
|
||||||
this.removeGuildFromFolder(folder.folderId, guildid);
|
this.removeGuildFromFolder(folder.folderId, guildid);
|
||||||
}
|
}
|
||||||
|
@ -388,7 +388,7 @@ class ServerFolders {
|
||||||
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
||||||
label: this.labels.serversubmenu_createfolder_text,
|
label: this.labels.serversubmenu_createfolder_text,
|
||||||
disabled: !openguilds.length,
|
disabled: !openguilds.length,
|
||||||
action: e => {
|
action: _ => {
|
||||||
BDFDB.ContextMenuUtils.close(menu);
|
BDFDB.ContextMenuUtils.close(menu);
|
||||||
this.openFolderCreationMenu(openguilds, guildid);
|
this.openFolderCreationMenu(openguilds, guildid);
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,7 +167,7 @@ class ServerHider {
|
||||||
children: [
|
children: [
|
||||||
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
||||||
label: this.labels.submenu_openhidemenu_text,
|
label: this.labels.submenu_openhidemenu_text,
|
||||||
action: e => {
|
action: _ => {
|
||||||
BDFDB.ContextMenuUtils.close(menu);
|
BDFDB.ContextMenuUtils.close(menu);
|
||||||
this.showServerModal();
|
this.showServerModal();
|
||||||
}
|
}
|
||||||
|
@ -175,7 +175,7 @@ class ServerHider {
|
||||||
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
||||||
label: this.labels.submenu_hideserver_text,
|
label: this.labels.submenu_hideserver_text,
|
||||||
disabled: !(instance.props.guild && !instance.props.target.getAttribute("folder")),
|
disabled: !(instance.props.guild && !instance.props.target.getAttribute("folder")),
|
||||||
action: e => {
|
action: _ => {
|
||||||
BDFDB.ContextMenuUtils.close(menu);
|
BDFDB.ContextMenuUtils.close(menu);
|
||||||
this.toggleServer(instance.props.guild, instance.props.target, false);
|
this.toggleServer(instance.props.guild, instance.props.target, false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -178,7 +178,7 @@ class SpellCheck {
|
||||||
let similarWords = this.getSimilarWords(word.toLowerCase().trim());
|
let similarWords = this.getSimilarWords(word.toLowerCase().trim());
|
||||||
for (let suggestion of similarWords.sort()) items.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
for (let suggestion of similarWords.sort()) items.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
||||||
label: suggestion,
|
label: suggestion,
|
||||||
action: e => {
|
action: _ => {
|
||||||
BDFDB.ContextMenuUtils.close(menu);
|
BDFDB.ContextMenuUtils.close(menu);
|
||||||
this.replaceWord(textarea, word, suggestion);
|
this.replaceWord(textarea, word, suggestion);
|
||||||
}
|
}
|
||||||
|
@ -194,7 +194,7 @@ class SpellCheck {
|
||||||
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
||||||
label: this.labels.context_spellcheck_text,
|
label: this.labels.context_spellcheck_text,
|
||||||
hint: word,
|
hint: word,
|
||||||
action: e => {
|
action: _ => {
|
||||||
BDFDB.ContextMenuUtils.close(menu);
|
BDFDB.ContextMenuUtils.close(menu);
|
||||||
this.addToOwnDictionary(word);
|
this.addToOwnDictionary(word);
|
||||||
}
|
}
|
||||||
|
|
|
@ -402,7 +402,7 @@ class ThemeRepo {
|
||||||
BDFDB.TimeUtils.timeout(() => {for (let child of returnvalue.props.children) if (child && child.props && child.props.label == "BandagedBD" && Array.isArray(child.props.render)) {
|
BDFDB.TimeUtils.timeout(() => {for (let child of returnvalue.props.children) if (child && child.props && child.props.label == "BandagedBD" && Array.isArray(child.props.render)) {
|
||||||
const repoItem = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
const repoItem = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
|
||||||
label: "Theme Repo",
|
label: "Theme Repo",
|
||||||
action: e => {
|
action: _ => {
|
||||||
if (!this.loading.is) BDFDB.ContextMenuUtils.close(menu);
|
if (!this.loading.is) BDFDB.ContextMenuUtils.close(menu);
|
||||||
this.openThemeRepoModal();
|
this.openThemeRepoModal();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue