This commit is contained in:
Mirco Wittrien 2020-11-19 16:51:14 +01:00
parent 6bc9a0a4eb
commit 025a8d5279
54 changed files with 776 additions and 776 deletions

View File

@ -49,8 +49,8 @@ module.exports = (_ => {
patchPriority: 0,
defaults: {
settings: {
showToasts: {value:true, description:"Show Plugin start and stop Toasts"},
showSupportBadges: {value:true, description:"Show little Badges for Users who support my Patreon"}
showToasts: {value: true, description: "Show Plugin start and stop Toasts"},
showSupportBadges: {value: true, description: "Show little Badges for Users who support my Patreon"}
}
},
});
@ -455,7 +455,7 @@ module.exports = (_ => {
BDFDB.BDUtils.getSettings = function (key) {
if (!window.BdApi) return {};
if (typeof key == "string") return BdApi.isSettingEnabled(...key.split("."));
else return oldSettings ? BDFDB.ReactUtils.getValue(BdApi.getBDData("settings"), `${BDFDB.DiscordUtils.getBuilt()}.settings`) : BdApi.settings.map(n => n.settings.map(m => m.settings.map(l => ({id: [n.id, m.id, l.id].join("."), value:l.value})))).flat(10).reduce((newObj, setting) => (newObj[setting.id] = setting.value, newObj), {});
else return oldSettings ? BDFDB.ReactUtils.getValue(BdApi.getBDData("settings"), `${BDFDB.DiscordUtils.getBuilt()}.settings`) : BdApi.settings.map(n => n.settings.map(m => m.settings.map(l => ({id: [n.id, m.id, l.id].join("."), value: l.value})))).flat(10).reduce((newObj, setting) => (newObj[setting.id] = setting.value, newObj), {});
};
@ -611,13 +611,13 @@ module.exports = (_ => {
}
else if (document.contains(updateNotice) && !updateNotice.querySelector("#outdatedPlugins span," + BDFDB.dotCN.noticebutton)) vanishObserver.disconnect();
});
vanishObserver.observe(document.body, {childList:true, subtree:true});
vanishObserver.observe(document.body, {childList: true, subtree: true});
updateNotice = BDFDB.NotificationUtils.notice(`${BDFDB.LanguageUtils.LibraryStrings.update_notice_update}&nbsp;&nbsp;&nbsp;&nbsp;<strong id="outdatedPlugins"></strong>`, {
id:"pluginNotice",
type:"info",
html:true,
btn:!BDFDB.BDUtils.getSettings(BDFDB.BDUtils.settingsIds.automaticLoading) ? BDFDB.LanguageUtils.LanguageStrings.ERRORS_RELOAD : "",
customicon:`<svg height="100%" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="100%" version="1.1" viewBox="0 0 2000 2000"><metadata /><defs><filter id="shadow1"><feDropShadow dx="20" dy="0" stdDeviation="20" flood-color="rgba(0,0,0,0.35)"/></filter><filter id="shadow2"><feDropShadow dx="15" dy="0" stdDeviation="20" flood-color="rgba(255,255,255,0.15)"/></filter><filter id="shadow3"><feDropShadow dx="10" dy="0" stdDeviation="20" flood-color="rgba(0,0,0,0.35)"/></filter></defs><g><path style="filter: url(#shadow3)" d="M1195.44+135.442L1195.44+135.442L997.6+136.442C1024.2+149.742+1170.34+163.542+1193.64+179.742C1264.34+228.842+1319.74+291.242+1358.24+365.042C1398.14+441.642+1419.74+530.642+1422.54+629.642L1422.54+630.842L1422.54+632.042C1422.54+773.142+1422.54+1228.14+1422.54+1369.14L1422.54+1370.34L1422.54+1371.54C1419.84+1470.54+1398.24+1559.54+1358.24+1636.14C1319.74+1709.94+1264.44+1772.34+1193.64+1821.44C1171.04+1837.14+1025.7+1850.54+1000+1863.54L1193.54+1864.54C1539.74+1866.44+1864.54+1693.34+1864.54+1296.64L1864.54+716.942C1866.44+312.442+1541.64+135.442+1195.44+135.442Z" fill="#171717" opacity="1"/><path style="filter: url(#shadow2)" d="M1695.54+631.442C1685.84+278.042+1409.34+135.442+1052.94+135.442L361.74+136.442L803.74+490.442L1060.74+490.442C1335.24+490.442+1335.24+835.342+1060.74+835.342L1060.74+1164.84C1150.22+1164.84+1210.53+1201.48+1241.68+1250.87C1306.07+1353+1245.76+1509.64+1060.74+1509.64L361.74+1863.54L1052.94+1864.54C1409.24+1864.54+1685.74+1721.94+1695.54+1368.54C1695.54+1205.94+1651.04+1084.44+1572.64+999.942C1651.04+915.542+1695.54+794.042+1695.54+631.442Z" fill="#3E82E5" opacity="1"/><path style="filter: url(#shadow1)" d="M1469.25+631.442C1459.55+278.042+1183.05+135.442+826.65+135.442L135.45+135.442L135.45+1004C135.45+1004+135.427+1255.21+355.626+1255.21C575.825+1255.21+575.848+1004+575.848+1004L577.45+490.442L834.45+490.442C1108.95+490.442+1108.95+835.342+834.45+835.342L664.65+835.342L664.65+1164.84L834.45+1164.84C923.932+1164.84+984.244+1201.48+1015.39+1250.87C1079.78+1353+1019.47+1509.64+834.45+1509.64L135.45+1509.64L135.45+1864.54L826.65+1864.54C1182.95+1864.54+1459.45+1721.94+1469.25+1368.54C1469.25+1205.94+1424.75+1084.44+1346.35+999.942C1424.75+915.542+1469.25+794.042+1469.25+631.442Z" fill="#FFFFFF" opacity="1"/></g></svg>`,
id: "pluginNotice",
type: "info",
html: true,
btn: !BDFDB.BDUtils.getSettings(BDFDB.BDUtils.settingsIds.automaticLoading) ? BDFDB.LanguageUtils.LanguageStrings.ERRORS_RELOAD : "",
customicon: `<svg height="100%" style="fill-rule: evenodd;clip-rule: evenodd;stroke-linecap: round;stroke-linejoin: round;" xmlns: xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xml: space="preserve" width="100%" version="1.1" viewBox="0 0 2000 2000"><metadata /><defs><filter id="shadow1"><feDropShadow dx="20" dy="0" stdDeviation="20" flood-color="rgba(0,0,0,0.35)"/></filter><filter id="shadow2"><feDropShadow dx="15" dy="0" stdDeviation="20" flood-color="rgba(255,255,255,0.15)"/></filter><filter id="shadow3"><feDropShadow dx="10" dy="0" stdDeviation="20" flood-color="rgba(0,0,0,0.35)"/></filter></defs><g><path style="filter: url(#shadow3)" d="M1195.44+135.442L1195.44+135.442L997.6+136.442C1024.2+149.742+1170.34+163.542+1193.64+179.742C1264.34+228.842+1319.74+291.242+1358.24+365.042C1398.14+441.642+1419.74+530.642+1422.54+629.642L1422.54+630.842L1422.54+632.042C1422.54+773.142+1422.54+1228.14+1422.54+1369.14L1422.54+1370.34L1422.54+1371.54C1419.84+1470.54+1398.24+1559.54+1358.24+1636.14C1319.74+1709.94+1264.44+1772.34+1193.64+1821.44C1171.04+1837.14+1025.7+1850.54+1000+1863.54L1193.54+1864.54C1539.74+1866.44+1864.54+1693.34+1864.54+1296.64L1864.54+716.942C1866.44+312.442+1541.64+135.442+1195.44+135.442Z" fill="#171717" opacity="1"/><path style="filter: url(#shadow2)" d="M1695.54+631.442C1685.84+278.042+1409.34+135.442+1052.94+135.442L361.74+136.442L803.74+490.442L1060.74+490.442C1335.24+490.442+1335.24+835.342+1060.74+835.342L1060.74+1164.84C1150.22+1164.84+1210.53+1201.48+1241.68+1250.87C1306.07+1353+1245.76+1509.64+1060.74+1509.64L361.74+1863.54L1052.94+1864.54C1409.24+1864.54+1685.74+1721.94+1695.54+1368.54C1695.54+1205.94+1651.04+1084.44+1572.64+999.942C1651.04+915.542+1695.54+794.042+1695.54+631.442Z" fill="#3E82E5" opacity="1"/><path style="filter: url(#shadow1)" d="M1469.25+631.442C1459.55+278.042+1183.05+135.442+826.65+135.442L135.45+135.442L135.45+1004C135.45+1004+135.427+1255.21+355.626+1255.21C575.825+1255.21+575.848+1004+575.848+1004L577.45+490.442L834.45+490.442C1108.95+490.442+1108.95+835.342+834.45+835.342L664.65+835.342L664.65+1164.84L834.45+1164.84C923.932+1164.84+984.244+1201.48+1015.39+1250.87C1079.78+1353+1019.47+1509.64+834.45+1509.64L135.45+1509.64L135.45+1864.54L826.65+1864.54C1182.95+1864.54+1459.45+1721.94+1469.25+1368.54C1469.25+1205.94+1424.75+1084.44+1346.35+999.942C1424.75+915.542+1469.25+794.042+1469.25+631.442Z" fill="#FFFFFF" opacity="1"/></g></svg>`,
onClose: _ => {vanishObserver.disconnect();}
});
updateNotice.style.setProperty("z-index", "100000", "important");
@ -631,7 +631,7 @@ module.exports = (_ => {
LibraryRequires.electron.remote.getCurrentWindow().reload();
});
reloadButton.addEventListener("mouseenter", _ => {
if (window.PluginUpdates.downloaded) BDFDB.TooltipUtils.create(reloadButton, window.PluginUpdates.downloaded.join(", "), {type:"bottom", selector:"update-notice-tooltip", style: "max-width: 420px"});
if (window.PluginUpdates.downloaded) BDFDB.TooltipUtils.create(reloadButton, window.PluginUpdates.downloaded.join(", "), {type: "bottom", selector: "update-notice-tooltip", style: "max-width: 420px"});
});
}
}
@ -705,7 +705,7 @@ module.exports = (_ => {
});
BDFDB.TimeUtils.timeout(_ => {if (wasEnabled && !BDFDB.BDUtils.isPluginEnabled(newName)) BDFDB.BDUtils.enablePlugin(newName);}, 3000);
}
BDFDB.NotificationUtils.toast(BDFDB.LanguageUtils.LibraryStringsFormat("toast_plugin_updated", pluginName, "v" + oldVersion, newName, "v" + newVersion), {nopointer:true, selector:"plugin-updated-toast"});
BDFDB.NotificationUtils.toast(BDFDB.LanguageUtils.LibraryStringsFormat("toast_plugin_updated", pluginName, "v" + oldVersion, newName, "v" + newVersion), {nopointer: true, selector: "plugin-updated-toast"});
let updateNotice = document.querySelector("#pluginNotice");
if (updateNotice) {
if (updateNotice.querySelector(BDFDB.dotCN.noticebutton)) {
@ -791,7 +791,7 @@ module.exports = (_ => {
loadingIconWrapper = BDFDB.DOMUtils.create(`<div class="${BDFDB.disCN.loadingiconwrapper}"></div>`);
app.appendChild(loadingIconWrapper);
let killObserver = new MutationObserver(changes => {if (!loadingIconWrapper.firstElementChild) BDFDB.DOMUtils.remove(loadingIconWrapper);});
killObserver.observe(loadingIconWrapper, {childList:true});
killObserver.observe(loadingIconWrapper, {childList: true});
}
loadingIconWrapper.appendChild(icon);
};
@ -821,13 +821,13 @@ module.exports = (_ => {
let noChannelObserver = new MutationObserver(changes => {changes.forEach(change => {
if (change.target && BDFDB.DOMUtils.containsClass(change.target, BDFDB.disCN.nochannel)) plugin.onSwitch();
});});
BDFDB.ObserverUtils.connect(plugin, spacer.querySelector(BDFDB.dotCNC.chat + BDFDB.dotCN.nochannel), {name:"switchFixNoChannelObserver", instance:noChannelObserver}, {attributes: true});
BDFDB.ObserverUtils.connect(plugin, spacer.querySelector(BDFDB.dotCNC.chat + BDFDB.dotCN.nochannel), {name: "switchFixNoChannelObserver", instance: noChannelObserver}, {attributes: true});
let spacerObserver = new MutationObserver(changes => {changes.forEach(change => {if (change.addedNodes) {change.addedNodes.forEach(node => {
if (BDFDB.DOMUtils.containsClass(node, BDFDB.disCN.chat, BDFDB.disCN.nochannel, false)) {
BDFDB.ObserverUtils.connect(plugin, node, {name:"switchFixNoChannelObserver", instance:noChannelObserver}, {attributes: true});
BDFDB.ObserverUtils.connect(plugin, node, {name: "switchFixNoChannelObserver", instance: noChannelObserver}, {attributes: true});
}
});}});});
BDFDB.ObserverUtils.connect(plugin, spacer, {name:"switchFixSpacerObserver", instance:spacerObserver}, {childList: true});
BDFDB.ObserverUtils.connect(plugin, spacer, {name: "switchFixSpacerObserver", instance: spacerObserver}, {childList: true});
}
}
InternalBDFDB.addContextListeners(plugin);
@ -1043,7 +1043,7 @@ module.exports = (_ => {
}
};
var NotificationBars = [], DesktopNotificationQueue = {queue:[], running:false};
var NotificationBars = [], DesktopNotificationQueue = {queue: [], running: false};
BDFDB.NotificationUtils = {};
BDFDB.NotificationUtils.toast = function (text, options = {}) {
let toasts = document.querySelector(".toasts, .bd-toasts");
@ -1055,7 +1055,7 @@ module.exports = (_ => {
let width = channelRects ? (members ? channelRects.width - BDFDB.DOMUtils.getRects(members).width : channelRects.width) : window.outerWidth - 0;
let form = channels ? channels.querySelector("form") : null;
let bottom = form ? BDFDB.DOMUtils.getRects(form).height : 80;
toasts = BDFDB.DOMUtils.create(`<div class="toasts bd-toasts" style="width:${width}px; left:${left}px; bottom:${bottom}px;"></div>`);
toasts = BDFDB.DOMUtils.create(`<div class="toasts bd-toasts" style="width: ${width}px; left: ${left}px; bottom: ${bottom}px;"></div>`);
(document.querySelector(BDFDB.dotCN.app) || document.body).appendChild(toasts);
}
const {type = "", icon = true, timeout = 3000, html = false, selector = "", nopointer = false, color = ""} = options;
@ -1181,7 +1181,7 @@ module.exports = (_ => {
let fontColor = comp[0] > 180 && comp[1] > 180 && comp[2] > 180 ? "#000" : "#FFF";
let backgroundcolor = BDFDB.ColorUtils.convert(comp, "HEX");
let filter = comp[0] > 180 && comp[1] > 180 && comp[2] > 180 ? "brightness(0%)" : "brightness(100%)";
BDFDB.DOMUtils.appendLocalStyle("BDFDBcustomNotificationBarColorCorrection" + id, `${BDFDB.dotCN.noticewrapper}[notice-id="${id}"]{background-color:${backgroundcolor} !important;}${BDFDB.dotCN.noticewrapper}[notice-id="${id}"] .notice-message {color:${fontColor} !important;}${BDFDB.dotCN.noticewrapper}[notice-id="${id}"] ${BDFDB.dotCN.noticebutton} {color:${fontColor} !important;border-color:${BDFDB.ColorUtils.setAlpha(fontColor, 0.25, "RGBA")} !important;}${BDFDB.dotCN.noticewrapper}[notice-id="${id}"] ${BDFDB.dotCN.noticebutton}:hover {color:${backgroundcolor} !important;background-color:${fontColor} !important;}${BDFDB.dotCN.noticewrapper}[notice-id="${id}"] ${BDFDB.dotCN.noticedismiss} {filter:${filter} !important;}`);
BDFDB.DOMUtils.appendLocalStyle("BDFDBcustomNotificationBarColorCorrection" + id, `${BDFDB.dotCN.noticewrapper}[notice-id="${id}"]{background-color: ${backgroundcolor} !important;}${BDFDB.dotCN.noticewrapper}[notice-id="${id}"] .notice-message {color: ${fontColor} !important;}${BDFDB.dotCN.noticewrapper}[notice-id="${id}"] ${BDFDB.dotCN.noticebutton} {color: ${fontColor} !important;border-color: ${BDFDB.ColorUtils.setAlpha(fontColor, 0.25, "RGBA")} !important;}${BDFDB.dotCN.noticewrapper}[notice-id="${id}"] ${BDFDB.dotCN.noticebutton}:hover {color: ${backgroundcolor} !important;background-color: ${fontColor} !important;}${BDFDB.dotCN.noticewrapper}[notice-id="${id}"] ${BDFDB.dotCN.noticedismiss} {filter: ${filter} !important;}`);
}
else BDFDB.DOMUtils.addClass(notice, BDFDB.disCN.noticedefault);
}
@ -1286,7 +1286,7 @@ module.exports = (_ => {
let nodes = Array.from(change.removedNodes);
if (nodes.indexOf(itemLayer) > -1 || nodes.indexOf(anker) > -1 || nodes.some(n => n.contains(anker))) itemLayer.removeTooltip();
}));
observer.observe(document.body, {subtree:true, childList:true});
observer.observe(document.body, {subtree: true, childList: true});
(tooltip.setText = itemLayer.setText = newText => {
if (BDFDB.ObjectUtils.is(options.guild)) {
@ -1435,7 +1435,7 @@ module.exports = (_ => {
};
InternalBDFDB.findModule = function (type, cachestring, filter, getExport) {
if (!BDFDB.ObjectUtils.is(Cache.modules[type])) Cache.modules[type] = {module:{}, export:{}};
if (!BDFDB.ObjectUtils.is(Cache.modules[type])) Cache.modules[type] = {module: {}, export: {}};
if (getExport && Cache.modules[type].export[cachestring]) return Cache.modules[type].export[cachestring];
else if (!getExport && Cache.modules[type].module[cachestring]) return Cache.modules[type].module[cachestring];
else {
@ -1555,7 +1555,7 @@ module.exports = (_ => {
}
}
};
InternalBDFDB.patchObserverData = {observer:null, data:{}};
InternalBDFDB.patchObserverData = {observer: null, data: {}};
InternalBDFDB.patchPlugin = function (plugin) {
plugin = plugin == BDFDB && InternalBDFDB || plugin;
if (!BDFDB.ObjectUtils.is(plugin) || !BDFDB.ObjectUtils.is(plugin.patchedModules)) return;
@ -1616,7 +1616,7 @@ module.exports = (_ => {
if (pluginDataObjs.length && instance) {
let name = type.split(" _ _ ")[0];
instance = instance._reactInternalFiber && instance._reactInternalFiber.type ? instance._reactInternalFiber.type : instance;
instance = config.ignoreCheck || BDFDB.ReactUtils.isCorrectInstance(instance, name) || InternalData.ModuleUtilsConfig.LoadedInComponents[type] ? instance : (BDFDB.ReactUtils.findConstructor(instance, name) || BDFDB.ReactUtils.findConstructor(instance, name, {up:true}));
instance = config.ignoreCheck || BDFDB.ReactUtils.isCorrectInstance(instance, name) || InternalData.ModuleUtilsConfig.LoadedInComponents[type] ? instance : (BDFDB.ReactUtils.findConstructor(instance, name) || BDFDB.ReactUtils.findConstructor(instance, name, {up: true}));
if (instance) {
instance = instance._reactInternalFiber && instance._reactInternalFiber.type ? instance._reactInternalFiber.type : instance;
let toBePatched = config.nonPrototype ? instance : instance.prototype;
@ -1625,7 +1625,7 @@ module.exports = (_ => {
let patchMethods = {};
patchMethods[patchType] = e => {
return InternalBDFDB.initiateProcess(pluginData.plugin, type, {
instance: e.thisObject && window != e.thisObject ? e.thisObject : {props:e.methodArguments[0]},
instance: e.thisObject && window != e.thisObject ? e.thisObject : {props: e.methodArguments[0]},
returnvalue: e.returnValue,
methodname: e.originalMethodName,
patchtypes: [patchType]
@ -1670,11 +1670,11 @@ module.exports = (_ => {
let instanceFound = false;
if (!config.forceObserve) {
if (app) {
let appIns = BDFDB.ReactUtils.findConstructor(app, type, {unlimited:true}) || BDFDB.ReactUtils.findConstructor(app, type, {unlimited:true, up:true});
let appIns = BDFDB.ReactUtils.findConstructor(app, type, {unlimited: true}) || BDFDB.ReactUtils.findConstructor(app, type, {unlimited: true, up: true});
if (appIns && (instanceFound = true)) InternalBDFDB.patchInstance(pluginData, appIns, type, config);
}
if (!instanceFound && bdSettings) {
let bdSettingsIns = BDFDB.ReactUtils.findConstructor(bdSettings, type, {unlimited:true});
let bdSettingsIns = BDFDB.ReactUtils.findConstructor(bdSettings, type, {unlimited: true});
if (bdSettingsIns && (instanceFound = true)) InternalBDFDB.patchInstance(pluginData, bdSettingsIns, type, config);
}
}
@ -1704,10 +1704,10 @@ module.exports = (_ => {
}
}
});});});
InternalBDFDB.patchObserverData.observer.observe(appMount, {childList:true, subtree:true});
InternalBDFDB.patchObserverData.observer.observe(appMount, {childList: true, subtree: true});
}
}
if (!InternalBDFDB.patchObserverData.data[type]) InternalBDFDB.patchObserverData.data[type] = {selector, classes, found:false, config, plugins:[]};
if (!InternalBDFDB.patchObserverData.data[type]) InternalBDFDB.patchObserverData.data[type] = {selector, classes, found: false, config, plugins: []};
InternalBDFDB.patchObserverData.data[type].plugins.push(pluginData);
}
}
@ -1716,7 +1716,7 @@ module.exports = (_ => {
InternalBDFDB.isCorrectPatchInstance = function (instance, name) {
if (!instance) return false;
instance = instance._reactInternalFiber && instance._reactInternalFiber.type ? instance._reactInternalFiber.type : instance;
instance = BDFDB.ReactUtils.isCorrectInstance(instance, name) ? instance : (BDFDB.ReactUtils.findConstructor(instance, name) || BDFDB.ReactUtils.findConstructor(instance, name, {up:true}));
instance = BDFDB.ReactUtils.isCorrectInstance(instance, name) ? instance : (BDFDB.ReactUtils.findConstructor(instance, name) || BDFDB.ReactUtils.findConstructor(instance, name, {up: true}));
return !!instance;
};
@ -1877,20 +1877,20 @@ module.exports = (_ => {
try {
let filteredModules = BDFDB.ArrayUtils.removeCopies(updateDataArray.map(n => n.filteredModules).flat(10));
let specialModules = BDFDB.ArrayUtils.removeCopies(updateDataArray.map(n => n.specialModules).flat(10));
const appInsDown = BDFDB.ReactUtils.findOwner(app, {name:filteredModules, type:specialModules, all:true, group:true, unlimited:true});
const appInsUp = BDFDB.ReactUtils.findOwner(app, {name:filteredModules, type:specialModules, all:true, group:true, unlimited:true, up:true});
const appInsDown = BDFDB.ReactUtils.findOwner(app, {name: filteredModules, type: specialModules, all: true, group: true, unlimited: true});
const appInsUp = BDFDB.ReactUtils.findOwner(app, {name: filteredModules, type: specialModules, all: true, group: true, unlimited: true, up: true});
for (let type in appInsDown) {
let filteredPlugins = plugins.filter(n => updateData[n.name].filteredModules.includes(type) || updateData[n.name].specialModuleTypes.includes(type)).map(n => ({plugin:n, patchTypes:updateData[n.name].patchTypes}));
let filteredPlugins = plugins.filter(n => updateData[n.name].filteredModules.includes(type) || updateData[n.name].specialModuleTypes.includes(type)).map(n => ({plugin: n, patchTypes: updateData[n.name].patchTypes}));
for (let ins of appInsDown[type]) InternalBDFDB.forceInitiateProcess(filteredPlugins, ins, type);
}
for (let type in appInsUp) {
let filteredPlugins = plugins.filter(n => updateData[n.name].filteredModules.includes(type) || updateData[n.name].specialModuleTypes.includes(type)).map(n => ({plugin:n, patchTypes:updateData[n.name].patchTypes}));
let filteredPlugins = plugins.filter(n => updateData[n.name].filteredModules.includes(type) || updateData[n.name].specialModuleTypes.includes(type)).map(n => ({plugin: n, patchTypes: updateData[n.name].patchTypes}));
for (let ins of appInsUp[type]) InternalBDFDB.forceInitiateProcess(filteredPlugins, ins, type);
}
if (bdSettings) {
const bdSettingsIns = BDFDB.ReactUtils.findOwner(bdSettings, {name:filteredModules, type:specialModules, all:true, unlimited:true});
const bdSettingsIns = BDFDB.ReactUtils.findOwner(bdSettings, {name: filteredModules, type: specialModules, all: true, unlimited: true});
if (bdSettingsIns.length) {
const bdSettingsWrap = BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.getInstance(document.querySelector("#bd-settingspane-container > *")), {props:"onChange", up:true});
const bdSettingsWrap = BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.getInstance(document.querySelector("#bd-settingspane-container > *")), {props: "onChange", up: true});
if (bdSettingsWrap && bdSettingsWrap.props && typeof bdSettingsWrap.props.onChange == "function") bdSettingsWrap.props.onChange(bdSettingsWrap.props.type);
}
}
@ -2104,7 +2104,7 @@ module.exports = (_ => {
let start = performance.now();
let maxDepth = config.unlimited ? 999999999 : (config.depth === undefined ? 30 : config.depth);
let maxTime = config.unlimited ? 999999999 : (config.time === undefined ? 150 : config.time);
let whitelist = config.up ? {return:true, sibling:true, default:true, _reactInternalFiber:true} : {child:true, sibling:true, default:true, _reactInternalFiber:true};
let whitelist = config.up ? {return: true, sibling: true, default: true, _reactInternalFiber: true} : {child: true, sibling: true, default: true, _reactInternalFiber: true};
let foundConstructors = config.group ? {} : [];
let singleConstructor = getConstructor(instance);
@ -2169,7 +2169,7 @@ module.exports = (_ => {
let start = performance.now();
let maxDepth = config.unlimited ? 999999999 : (config.depth === undefined ? 30 : config.depth);
let maxTime = config.unlimited ? 999999999 : (config.time === undefined ? 150 : config.time);
let whitelist = config.up ? {return:true, sibling:true, _reactInternalFiber:true} : {child:true, sibling:true, _reactInternalFiber:true};
let whitelist = config.up ? {return: true, sibling: true, _reactInternalFiber: true} : {child: true, sibling: true, _reactInternalFiber: true};
let foundInstances = config.group ? {} : [];
let singleInstance = getOwner(instance);
@ -2294,7 +2294,7 @@ module.exports = (_ => {
let start = performance.now();
let maxDepth = config.unlimited ? 999999999 : (config.depth === undefined ? 30 : config.depth);
let maxTime = config.unlimited ? 999999999 : (config.time === undefined ? 150 : config.time);
let whitelist = config.up ? {return:true, sibling:true, _reactInternalFiber:true} : {child:true, sibling:true, _reactInternalFiber:true};
let whitelist = config.up ? {return: true, sibling: true, _reactInternalFiber: true} : {child: true, sibling: true, _reactInternalFiber: true};
return findProps(instance);
function findProps (instance) {
@ -2399,7 +2399,7 @@ module.exports = (_ => {
BDFDB.ReactUtils.unmountComponentAtNode(node);
}
}));
observer.observe(document.body, {subtree:true, childList:true});
observer.observe(document.body, {subtree: true, childList: true});
}
catch (err) {BDFDB.LogUtils.error("Could not render react element! " + err);}
};
@ -2414,7 +2414,7 @@ module.exports = (_ => {
if (BDFDB.DMUtils.isDMChannel(channel)) BDFDB.DMUtils.markAsRead(channel);
else BDFDB.ChannelUtils.markAsRead(channel);
}
let LayerProviderIns = BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.messageswrapper), {name:"LayerProvider", unlimited:true, up:true});
let LayerProviderIns = BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.messageswrapper), {name: "LayerProvider", unlimited: true, up: true});
let LayerProviderPrototype = BDFDB.ObjectUtils.get(LayerProviderIns, "_reactInternalFiber.type.prototype");
if (LayerProviderIns && LayerProviderPrototype) {
BDFDB.PatchUtils.patch(BDFDB, LayerProviderPrototype, "render", {after: e => {
@ -2428,7 +2428,7 @@ module.exports = (_ => {
if (!message) return;
let channel = LibraryModules.ChannelStore.getChannel(message.channel_id);
if (channel) LibraryModules.ContextMenuUtils.openContextMenu(e, function (e) {
return BDFDB.ReactUtils.createElement((BDFDB.ModuleUtils.findByName(slim ? "MessageSearchResultContextMenu" : "MessageContextMenu", false) || {exports:{}}).exports.default, Object.assign({}, e, {
return BDFDB.ReactUtils.createElement((BDFDB.ModuleUtils.findByName(slim ? "MessageSearchResultContextMenu" : "MessageContextMenu", false) || {exports: {}}).exports.default, Object.assign({}, e, {
message: message,
channel: channel
}));
@ -2484,7 +2484,7 @@ module.exports = (_ => {
if (!id || !guildId) return;
let user = LibraryModules.UserStore.getUser(id);
if (user) LibraryModules.ContextMenuUtils.openContextMenu(e, function (e) {
return BDFDB.ReactUtils.createElement((BDFDB.ModuleUtils.findByName("GuildChannelUserContextMenu", false) || {exports:{}}).exports.default, Object.assign({}, e, {
return BDFDB.ReactUtils.createElement((BDFDB.ModuleUtils.findByName("GuildChannelUserContextMenu", false) || {exports: {}}).exports.default, Object.assign({}, e, {
user: user,
guildId: guildId
}));
@ -2528,8 +2528,8 @@ module.exports = (_ => {
};
BDFDB.GuildUtils.getAll = function () {
let found = [], objs = [];
for (let ins of BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.guilds), {name:["Guild","GuildIcon"], all:true, unlimited:true})) {
if (ins.props && ins.props.guild) objs.push(Object.assign(new ins.props.guild.constructor(ins.props.guild), {div:ins.handleContextMenu && BDFDB.ReactUtils.findDOMNode(ins), instance:ins}));
for (let ins of BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.guilds), {name: ["Guild","GuildIcon"], all: true, unlimited: true})) {
if (ins.props && ins.props.guild) objs.push(Object.assign(new ins.props.guild.constructor(ins.props.guild), {div: ins.handleContextMenu && BDFDB.ReactUtils.findDOMNode(ins), instance: ins}));
}
for (let id of BDFDB.LibraryModules.FolderStore.getFlattenedGuildIds()) {
let foundobj = null;
@ -2540,7 +2540,7 @@ module.exports = (_ => {
if (foundobj) found.push(foundobj);
else {
let guild = BDFDB.LibraryModules.GuildStore.getGuild(id);
if (guild) found.push(Object.assign(new guild.constructor(guild), {div:null, instance:null}))
if (guild) found.push(Object.assign(new guild.constructor(guild), {div: null, instance: null}))
}
}
return found;
@ -2577,7 +2577,7 @@ module.exports = (_ => {
};
BDFDB.GuildUtils.getSelected = function () {
let info = LibraryModules.GuildStore.getGuild(LibraryModules.LastGuildStore.getGuildId());
if (info) return BDFDB.GuildUtils.getData(info.id) || Object.assign(new info.constructor(info), {div:null, instance:null});
if (info) return BDFDB.GuildUtils.getData(info.id) || Object.assign(new info.constructor(info), {div: null, instance: null});
else return null;
};
BDFDB.GuildUtils.openMenu = function (eleOrInfoOrId, e = mousePosition) {
@ -2585,7 +2585,7 @@ module.exports = (_ => {
let id = Node.prototype.isPrototypeOf(eleOrInfoOrId) ? BDFDB.GuildUtils.getId(eleOrInfoOrId) : (typeof eleOrInfoOrId == "object" ? eleOrInfoOrId.id : eleOrInfoOrId);
let guild = LibraryModules.GuildStore.getGuild(id);
if (guild) LibraryModules.ContextMenuUtils.openContextMenu(e, function (e) {
return BDFDB.ReactUtils.createElement((BDFDB.ModuleUtils.findByName("GuildContextMenu", false) || {exports:{}}).exports.default, Object.assign({}, e, {
return BDFDB.ReactUtils.createElement((BDFDB.ModuleUtils.findByName("GuildContextMenu", false) || {exports: {}}).exports.default, Object.assign({}, e, {
guild: guild
}));
});
@ -2603,7 +2603,7 @@ module.exports = (_ => {
BDFDB.GuildUtils.rerenderAll = function (instant) {
BDFDB.TimeUtils.clear(GuildsRerenderTimeout);
GuildsRerenderTimeout = BDFDB.TimeUtils.timeout(_ => {
let GuildsIns = BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.app), {name:"Guilds", unlimited:true});
let GuildsIns = BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.app), {name: "Guilds", unlimited: true});
let GuildsPrototype = BDFDB.ObjectUtils.get(GuildsIns, "_reactInternalFiber.type.prototype");
if (GuildsIns && GuildsPrototype) {
let injectPlaceholder = returnValue => {
@ -2632,7 +2632,7 @@ module.exports = (_ => {
if (!Node.prototype.isPrototypeOf(div) || !BDFDB.ReactUtils.getInstance(div)) return;
div = BDFDB.DOMUtils.getParent(BDFDB.dotCN.guildfolderwrapper, div);
if (!div) return;
return BDFDB.ReactUtils.findValue(div, "folderId", {up:true});
return BDFDB.ReactUtils.findValue(div, "folderId", {up: true});
};
BDFDB.FolderUtils.getDefaultName = function (folderId) {
let folder = BDFDB.LibraryModules.FolderStore.getGuildFolderById(folderId);
@ -2659,8 +2659,8 @@ module.exports = (_ => {
};
BDFDB.FolderUtils.getAll = function () {
let found = [];
for (let ins of BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.guildswrapper), {name:"GuildFolder", all:true, unlimited:true})) {
if (ins.props && ins.props.folderId) found.push(Object.assign({}, ins.props, {div:BDFDB.ReactUtils.findDOMNode(ins), instance:ins}));
for (let ins of BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.guildswrapper), {name: "GuildFolder", all: true, unlimited: true})) {
if (ins.props && ins.props.folderId) found.push(Object.assign({}, ins.props, {div: BDFDB.ReactUtils.findDOMNode(ins), instance: ins}));
}
return found;
};
@ -2715,16 +2715,16 @@ module.exports = (_ => {
};
BDFDB.ChannelUtils.getAll = function () {
let found = [];
for (let ins of BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.channels), {name: ["ChannelCategoryItem", "ChannelItem", "PrivateChannel"], all:true, unlimited:true})) if (ins.props && !ins.props.ispin && ins.props.channel && ins._reactInternalFiber.return) {
for (let ins of BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.channels), {name: ["ChannelCategoryItem", "ChannelItem", "PrivateChannel"], all: true, unlimited: true})) if (ins.props && !ins.props.ispin && ins.props.channel && ins._reactInternalFiber.return) {
let div = BDFDB.ReactUtils.findDOMNode(ins);
div = div && BDFDB.DOMUtils.containsClass(div.parentElement, BDFDB.disCN.categorycontainerdefault, BDFDB.disCN.channelcontainerdefault, false) ? div.parentElement : div;
found.push(Object.assign(new ins.props.channel.constructor(ins.props.channel), {div, instance:ins}));
found.push(Object.assign(new ins.props.channel.constructor(ins.props.channel), {div, instance: ins}));
}
return found;
};
BDFDB.ChannelUtils.getSelected = function () {
let info = LibraryModules.ChannelStore.getChannel(LibraryModules.LastChannelStore.getChannelId());
if (info) return BDFDB.ChannelUtils.getData(info.id) || Object.assign(new info.constructor(info), {div:null, instance:null});
if (info) return BDFDB.ChannelUtils.getData(info.id) || Object.assign(new info.constructor(info), {div: null, instance: null});
else return null;
};
BDFDB.ChannelUtils.markAsRead = function (channels) {
@ -2742,7 +2742,7 @@ module.exports = (_ => {
BDFDB.ChannelUtils.rerenderAll = function (instant) {
BDFDB.TimeUtils.clear(ChannelsRerenderTimeout);
ChannelsRerenderTimeout = BDFDB.TimeUtils.timeout(_ => {
let ChannelsIns = BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.guildchannels), {name:"Channels", unlimited:true});
let ChannelsIns = BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.guildchannels), {name: "Channels", unlimited: true});
let ChannelsPrototype = BDFDB.ObjectUtils.get(ChannelsIns, "_reactInternalFiber.type.prototype");
if (ChannelsIns && ChannelsPrototype) {
BDFDB.PatchUtils.patch(BDFDB, ChannelsPrototype, "render", {after: e => {
@ -2797,8 +2797,8 @@ module.exports = (_ => {
};
BDFDB.DMUtils.getAll = function () {
let found = [];
for (let ins of BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.guilds), {name:"DirectMessage", all:true, unlimited:true})) {
if (ins.props && ins.props.channel) found.push(Object.assign(new ins.props.channel.constructor(ins.props.channel), {div:BDFDB.ReactUtils.findDOMNode(ins), instance:ins}));
for (let ins of BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.guilds), {name: "DirectMessage", all: true, unlimited: true})) {
if (ins.props && ins.props.channel) found.push(Object.assign(new ins.props.channel.constructor(ins.props.channel), {div: BDFDB.ReactUtils.findDOMNode(ins), instance: ins}));
}
return found;
};
@ -2808,13 +2808,13 @@ module.exports = (_ => {
let channel = LibraryModules.ChannelStore.getChannel(id);
if (channel) {
if (channel.isMultiUserDM()) LibraryModules.ContextMenuUtils.openContextMenu(e, function (e) {
return BDFDB.ReactUtils.createElement((BDFDB.ModuleUtils.findByName("GroupDMContextMenu", false) || {exports:{}}).exports.default, Object.assign({}, e, {
return BDFDB.ReactUtils.createElement((BDFDB.ModuleUtils.findByName("GroupDMContextMenu", false) || {exports: {}}).exports.default, Object.assign({}, e, {
channel: channel,
selected: channel.id == LibraryModules.LastChannelStore.getChannelId()
}));
});
else LibraryModules.ContextMenuUtils.openContextMenu(e, function (e) {
return BDFDB.ReactUtils.createElement((BDFDB.ModuleUtils.findByName("DMUserContextMenu", false) || {exports:{}}).exports.default, Object.assign({}, e, {
return BDFDB.ReactUtils.createElement((BDFDB.ModuleUtils.findByName("DMUserContextMenu", false) || {exports: {}}).exports.default, Object.assign({}, e, {
user: LibraryModules.UserStore.getUser(channel.recipients[0]),
channel: channel,
selected: channel.id == LibraryModules.LastChannelStore.getChannelId()
@ -3180,7 +3180,7 @@ module.exports = (_ => {
if (!Node.prototype.isPrototypeOf(container)) return;
let swatches = container.querySelector(`${BDFDB.dotCN.colorpickerswatches}[number="${number}"], ${BDFDB.dotCN.colorpickerswatch}[number="${number}"]`);
if (!swatches) return null;
return BDFDB.ColorUtils.convert(BDFDB.ReactUtils.findValue(BDFDB.ReactUtils.getInstance(swatches), "selectedColor", {up:true, blacklist:{"props":true}}));
return BDFDB.ColorUtils.convert(BDFDB.ReactUtils.findValue(BDFDB.ReactUtils.getInstance(swatches), "selectedColor", {up: true, blacklist: {"props":true}}));
};
BDFDB.DOMUtils = {};
@ -3486,7 +3486,7 @@ module.exports = (_ => {
if (child.type == InternalComponents.LibraryComponents.ModalComponents.ModalTabContent) {
if (!tabBarItems.length) child.props.open = true;
else delete child.props.open;
tabBarItems.push({value:child.props.tab});
tabBarItems.push({value: child.props.tab});
}
contentChildren.push(child);
}
@ -3500,7 +3500,7 @@ module.exports = (_ => {
type: InternalComponents.LibraryComponents.TabBar.Types.TOP,
items: tabBarItems,
onItemSelect: (value, instance) => {
let tabContentInstances = BDFDB.ReactUtils.findOwner(modal, {name:"BDFDB_ModalTabContent", all:true, unlimited:true});
let tabContentInstances = BDFDB.ReactUtils.findOwner(modal, {name: "BDFDB_ModalTabContent", all: true, unlimited: true});
for (let ins of tabContentInstances) {
if (ins.props.tab == value) ins.props.open = true;
else delete ins.props.open;
@ -3613,9 +3613,9 @@ module.exports = (_ => {
};
BDFDB.ModalUtils.confirm = function (plugin, text, callback) {
if (!BDFDB.ObjectUtils.is(plugin) || typeof text != "string") return;
BDFDB.ModalUtils.open(plugin, {text, header:"Are you sure?", className:BDFDB.disCN.modalconfirmmodal, scroller:false, buttons:[
{contents: BDFDB.LanguageUtils.LanguageStrings.OKAY, close:true, color:"RED", click:typeof callback == "function" ? callback : _ => {}},
{contents: BDFDB.LanguageUtils.LanguageStrings.CANCEL, close:true}
BDFDB.ModalUtils.open(plugin, {text, header: "Are you sure?", className: BDFDB.disCN.modalconfirmmodal, scroller: false, buttons: [
{contents: BDFDB.LanguageUtils.LanguageStrings.OKAY, close: true, color: "RED", click: typeof callback == "function" ? callback : _ => {}},
{contents: BDFDB.LanguageUtils.LanguageStrings.CANCEL, close: true}
]});
};
@ -3632,7 +3632,7 @@ module.exports = (_ => {
};
BDFDB.ContextMenuUtils.close = function (nodeOrInstance) {
if (!BDFDB.ObjectUtils.is(nodeOrInstance)) return;
let instance = BDFDB.ReactUtils.findOwner(nodeOrInstance, {props:"closeContextMenu", up:true});
let instance = BDFDB.ReactUtils.findOwner(nodeOrInstance, {props: "closeContextMenu", up: true});
if (BDFDB.ObjectUtils.is(instance) && instance.props && typeof instance.props.closeContextMenu == "function") instance.props.closeContextMenu();
else BDFDB.LibraryModules.ContextMenuUtils.closeContextMenu();
};
@ -4407,7 +4407,7 @@ module.exports = (_ => {
onMouseLeave: e => {
this.setState({hovered: false});
},
children: BDFDB.ReactUtils.createElement(this.props.children, Object.assign({}, this.props.childProps, {isFocused:this.state.hovered && !this.props.disabled}))
children: BDFDB.ReactUtils.createElement(this.props.children, Object.assign({}, this.props.childProps, {isFocused: this.state.hovered && !this.props.disabled}))
});
}
};
@ -4684,7 +4684,7 @@ module.exports = (_ => {
}), "backdrop", "noRemove"));
}
};
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.Card, {backdrop:true, noRemove:false});
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.Card, {backdrop: true, noRemove: false});
InternalComponents.LibraryComponents.ChannelTextAreaButton = reactInitialized && class BDFDB_ChannelTextAreaButton extends LibraryModules.React.Component {
render() {
@ -4708,13 +4708,13 @@ module.exports = (_ => {
});
}
};
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.ChannelTextAreaButton, {tabIndex:0});
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.ChannelTextAreaButton, {tabIndex: 0});
InternalComponents.LibraryComponents.CharCounter = reactInitialized && class BDFDB_CharCounter extends LibraryModules.React.Component {
getCounterString() {
let input = this.refElement || {}, string = "";
if (BDFDB.DOMUtils.containsClass(this.refElement, BDFDB.disCN.textarea)) {
let instance = BDFDB.ReactUtils.findOwner(input, {name:"ChannelEditorContainer", up:true});
let instance = BDFDB.ReactUtils.findOwner(input, {name: "ChannelEditorContainer", up: true});
if (instance) string = instance.props.textValue;
else string = input.value || input.textContent || "";
}
@ -4872,7 +4872,7 @@ module.exports = (_ => {
});
}
};
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.CollapseContainer, {collapsed:true, mini:true});
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.CollapseContainer, {collapsed: true, mini: true});
InternalComponents.LibraryComponents.ColorPicker = reactInitialized && class BDFDB_ColorPicker extends LibraryModules.React.Component {
constructor(props) {
@ -4899,7 +4899,7 @@ module.exports = (_ => {
}
componentDidMount() {
this.domElementRef = {current: BDFDB.DOMUtils.getParent(BDFDB.dotCN.itemlayer, BDFDB.ReactUtils.findDOMNode(this))};
let popoutContainerInstance = BDFDB.ReactUtils.findOwner(this.domElementRef.current, {name:"BDFDB_PopoutContainer", up:true, unlimited:true});
let popoutContainerInstance = BDFDB.ReactUtils.findOwner(this.domElementRef.current, {name: "BDFDB_PopoutContainer", up: true, unlimited: true});
if (popoutContainerInstance) {
let mousedown = event => {
if (!this.domElementRef.current || !document.contains(this.domElementRef.current)) document.removeEventListener("mousedown", mousedown);
@ -5406,7 +5406,7 @@ module.exports = (_ => {
});
}
};
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.EmojiPickerButton, {allowManagedEmojis:false});
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.EmojiPickerButton, {allowManagedEmojis: false});
InternalComponents.LibraryComponents.FavButton = reactInitialized && class BDFDB_FavButton extends LibraryModules.React.Component {
handleClick() {
@ -5445,7 +5445,7 @@ module.exports = (_ => {
onChange: e => {
let file = e.currentTarget.files[0];
if (this.refInput && file && (!filter.length || filter.some(n => file.type.indexOf(n) == 0))) {
this.refInput.props.value = this.props.searchFolders ? file.path.split(file.name).slice(0, -1).join(file.name) : `${this.props.mode == "url" ? "url('" : ""}${(this.props.useFilePath) ? file.path : `data:${file.type};base64,${BDFDB.LibraryRequires.fs.readFileSync(file.path).toString("base64")}`}${this.props.mode ? "')" : ""}`;
this.refInput.props.value = this.props.searchFolders ? file.path.split(file.name).slice(0, -1).join(file.name) : `${this.props.mode == "url" ? "url('" : ""}${(this.props.useFilePath) ? file.path : `data: ${file.type};base64,${BDFDB.LibraryRequires.fs.readFileSync(file.path).toString("base64")}`}${this.props.mode ? "')" : ""}`;
BDFDB.ReactUtils.forceUpdate(this.refInput);
this.refInput.handleChange(this.refInput.props.value);
}
@ -5594,7 +5594,7 @@ module.exports = (_ => {
});
}
};
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.GuildComponents.Guild, {menu:true, tooltip:true, list:false, state:false, draggable:false, sorting:false});
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.GuildComponents.Guild, {menu: true, tooltip: true, list: false, state: false, draggable: false, sorting: false});
InternalComponents.LibraryComponents.GuildSummaryItem = reactInitialized && class BDFDB_GuildSummaryItem extends LibraryModules.React.Component {
defaultRenderGuild(guild, isLast) {
@ -5655,13 +5655,13 @@ module.exports = (_ => {
});
}
}
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.GuildSummaryItem, {max:10, renderMoreGuilds: (count, amount, restGuilds, props) => {
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.GuildSummaryItem, {max: 10, renderMoreGuilds: (count, amount, restGuilds, props) => {
let icon = BDFDB.ReactUtils.createElement("div", {className: BDFDB.disCN.guildsummarymoreguilds, children: count});
return props.showTooltip ? BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.TooltipContainer, {
text: restGuilds.map(guild => guild.name).join(", "),
children: icon
}) : icon;
}, renderIcon:false});
}, renderIcon: false});
InternalComponents.LibraryComponents.KeybindRecorder = reactInitialized && class BDFDB_KeybindRecorder extends LibraryModules.React.Component {
handleChange(arrays) {
@ -5826,7 +5826,7 @@ module.exports = (_ => {
}), "digits", "renderLabel"));
}
};
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.MenuItems.MenuSliderItem, {minValue:0, maxValue:100, digits:0});
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.MenuItems.MenuSliderItem, {minValue: 0, maxValue: 100, digits: 0});
InternalComponents.LibraryComponents.ModalComponents.ModalContent = reactInitialized && class BDFDB_ModalContent extends LibraryModules.React.Component {
render() {
@ -5842,7 +5842,7 @@ module.exports = (_ => {
});
}
};
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.ModalComponents.ModalContent, {scroller:true, content:true});
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.ModalComponents.ModalContent, {scroller: true, content: true});
InternalComponents.LibraryComponents.ModalComponents.ModalTabContent = reactInitialized && class BDFDB_ModalTabContent extends LibraryModules.React.Component {
render() {
@ -5855,7 +5855,7 @@ module.exports = (_ => {
})), ["display"]);
}
};
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.ModalComponents.ModalTabContent, {tab:"unnamed", render:true});
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.ModalComponents.ModalTabContent, {tab: "unnamed", render: true});
InternalComponents.LibraryComponents.ModalComponents.ModalFooter = reactInitialized && class BDFDB_ModalFooter extends LibraryModules.React.Component {
render() {
@ -6027,7 +6027,7 @@ module.exports = (_ => {
"aria-label": BDFDB.LanguageUtils.LanguageStrings.JUMP,
tooltipConfig: {zIndex: 3001},
onClick: (event, instance) => {
let jumpInput = BDFDB.ReactUtils.findOwner(instance._reactInternalFiber.return, {key:"pagination-list-jumpinput"});
let jumpInput = BDFDB.ReactUtils.findOwner(instance._reactInternalFiber.return, {key: "pagination-list-jumpinput"});
if (jumpInput) this.jump(isNaN(parseInt(jumpInput.props.value)) ? -1 : jumpInput.props.value - 1);
},
children: BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.Clickable, {
@ -6052,9 +6052,9 @@ module.exports = (_ => {
let numbers = key == "0-9", alphaItems = [];
for (let item of unsortedItems) if (item && item[this.props.alphabetKey] && (numbers && !isNaN(parseInt(item[this.props.alphabetKey][0])) || item[this.props.alphabetKey].toUpperCase().indexOf(key) == 0)) alphaItems.push(item);
for (let sortedItem of alphaItems) BDFDB.ArrayUtils.remove(unsortedItems, sortedItem);
alphabet[key] = {items:BDFDB.ArrayUtils.keySort(alphaItems, this.props.alphabetKey), disabled:!alphaItems.length};
alphabet[key] = {items: BDFDB.ArrayUtils.keySort(alphaItems, this.props.alphabetKey), disabled: !alphaItems.length};
}
alphabet["?!"] = {items:BDFDB.ArrayUtils.keySort(unsortedItems, this.props.alphabetKey), disabled:!unsortedItems.length};
alphabet["?!"] = {items: BDFDB.ArrayUtils.keySort(unsortedItems, this.props.alphabetKey), disabled: !unsortedItems.length};
for (let key in alphabet) items.push(alphabet[key].items);
items = items.flat(10);
}
@ -6082,7 +6082,7 @@ module.exports = (_ => {
});
}
};
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.PaginatedList, {amount:50, offset:0, jump:true, first:true, last:true, copyToBottom:false, fade:true});
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.PaginatedList, {amount: 50, offset: 0, jump: true, first: true, last: true, copyToBottom: false, fade: true});
InternalComponents.LibraryComponents.Popout = reactInitialized && class BDFDB_Popout extends LibraryModules.React.Component {
componentWillUnmount() {
@ -6108,7 +6108,7 @@ module.exports = (_ => {
});
}
};
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.Popout, {themed:true});
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.Popout, {themed: true});
InternalComponents.LibraryComponents.PopoutContainer = reactInitialized && class BDFDB_PopoutContainer extends LibraryModules.React.Component {
handleRender(e) {
@ -6124,7 +6124,7 @@ module.exports = (_ => {
}), "popoutStyle", "popoutClassName")));
}
componentDidMount() {
let basePopout = BDFDB.ReactUtils.findOwner(this, {name:"BasePopout"});
let basePopout = BDFDB.ReactUtils.findOwner(this, {name: "BasePopout"});
if (!basePopout || !basePopout.handleClick) return;
basePopout.isBDFDBpopout = true;
this.handleClick = e => {return basePopout.handleClick(BDFDB.ObjectUtils.is(e) ? e : (new MouseEvent({})));};
@ -6159,7 +6159,7 @@ module.exports = (_ => {
});
}
};
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.PopoutContainer, {wrap:true});
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.PopoutContainer, {wrap: true});
InternalComponents.LibraryComponents.QuickSelect = reactInitialized && class BDFDB_QuickSelect extends LibraryModules.React.Component {
handleChange(option) {
@ -6283,7 +6283,7 @@ module.exports = (_ => {
return BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.Flex, {
className: this.props.className,
wrap: InternalComponents.LibraryComponents.Flex.Wrap.WRAP,
children: [this.props.includeDMs && {name:"Direct Messages", acronym:"DMs", id:BDFDB.DiscordConstants.ME, getIconURL: _ => {}}].concat(BDFDB.LibraryModules.FolderStore.getFlattenedGuilds()).filter(n => n).map(guild => BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.TooltipContainer, {
children: [this.props.includeDMs && {name: "Direct Messages", acronym: "DMs", id: BDFDB.DiscordConstants.ME, getIconURL: _ => {}}].concat(BDFDB.LibraryModules.FolderStore.getFlattenedGuilds()).filter(n => n).map(guild => BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.TooltipContainer, {
text: guild.name,
children: BDFDB.ReactUtils.createElement("div", {
className: BDFDB.DOMUtils.formatClassName(this.props.guildClassName, BDFDB.disCN.settingsguild, this.props.disabled.includes(guild.id) && BDFDB.disCN.settingsguilddisabled),
@ -6668,7 +6668,7 @@ module.exports = (_ => {
}), "digits", "edges", "max", "min", "markerAmount"));
}
};
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.Slider, {hideBubble:false});
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.Slider, {hideBubble: false});
InternalComponents.LibraryComponents.SvgIcon = reactInitialized && class BDFDB_Icon extends LibraryModules.React.Component {
render() {
@ -7144,7 +7144,7 @@ module.exports = (_ => {
onColorChange: color => {
this.handleChange(!color ? "" : (this.props.mode == "comp" ? BDFDB.ColorUtils.convert(color, "RGBCOMP").slice(0, 3).join(",") : (this.props.noAlpha ? BDFDB.ColorUtils.convert(color, "RGB") : color)));
},
pickerConfig: {gradient:false, alpha:this.props.mode != "comp" && !this.props.noAlpha}
pickerConfig: {gradient: false, alpha: this.props.mode != "comp" && !this.props.noAlpha}
})
}) : null,
this.props.type == "file" ? BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.FileButton, {
@ -7219,13 +7219,13 @@ module.exports = (_ => {
}, 3000);
let Animation = new LibraryModules.AnimationUtils.Value(0);
Animation
.interpolate({inputRange:[0, 1], outputRange:[0, (BDFDB.DOMUtils.getRects(ele.firstElementChild).width - BDFDB.DOMUtils.getRects(ele).width) * -1]})
.interpolate({inputRange: [0, 1], outputRange: [0, (BDFDB.DOMUtils.getRects(ele.firstElementChild).width - BDFDB.DOMUtils.getRects(ele).width) * -1]})
.addListener(v => {ele.firstElementChild.style.setProperty("left", `${v.value}px`, "important");});
this.scroll = p => {
let w = p + parseFloat(ele.firstElementChild.style.getPropertyValue("left")) / (BDFDB.DOMUtils.getRects(ele.firstElementChild).width - BDFDB.DOMUtils.getRects(ele).width);
w = isNaN(w) || !isFinite(w) ? p : w;
w *= BDFDB.DOMUtils.getRects(ele.firstElementChild).width / (BDFDB.DOMUtils.getRects(ele).width * 2);
LibraryModules.AnimationUtils.parallel([LibraryModules.AnimationUtils.timing(Animation, {toValue:p, duration:Math.sqrt(w**2) * 4000 / (parseInt(this.props.speed) || 1)})]).start();
LibraryModules.AnimationUtils.parallel([LibraryModules.AnimationUtils.timing(Animation, {toValue: p, duration: Math.sqrt(w**2) * 4000 / (parseInt(this.props.speed) || 1)})]).start();
}
}
},
@ -7363,9 +7363,9 @@ module.exports = (_ => {
if (BDFDB.DOMUtils.containsClass(node, BDFDB.disCN._repocard)) InternalBDFDB.appendCustomControls(node);
if (node.nodeType != Node.TEXT_NODE) for (let child of node.querySelectorAll(BDFDB.dotCN._repocard)) InternalBDFDB.appendCustomControls(child);
});}});}));
BDFDB.ObserverUtils.connect(BDFDB, document.querySelector(`${BDFDB.dotCN.layer}[aria-label="${BDFDB.DiscordConstants.Layers.USER_SETTINGS}"]`), {name:"cardObserver", instance:cardObserver}, {childList: true, subtree:true});
BDFDB.ObserverUtils.connect(BDFDB, BDFDB.dotCN.applayers, {name:"appLayerObserver", instance:(new MutationObserver(changes => {changes.forEach(change => {if (change.addedNodes) {change.addedNodes.forEach(node => {
if (node.nodeType != Node.TEXT_NODE && node.getAttribute("aria-label") == BDFDB.DiscordConstants.Layers.USER_SETTINGS) BDFDB.ObserverUtils.connect(BDFDB, node, {name:"cardObserver", instance:cardObserver}, {childList: true, subtree:true});
BDFDB.ObserverUtils.connect(BDFDB, document.querySelector(`${BDFDB.dotCN.layer}[aria-label="${BDFDB.DiscordConstants.Layers.USER_SETTINGS}"]`), {name: "cardObserver", instance: cardObserver}, {childList: true, subtree: true});
BDFDB.ObserverUtils.connect(BDFDB, BDFDB.dotCN.applayers, {name: "appLayerObserver", instance: (new MutationObserver(changes => {changes.forEach(change => {if (change.addedNodes) {change.addedNodes.forEach(node => {
if (node.nodeType != Node.TEXT_NODE && node.getAttribute("aria-label") == BDFDB.DiscordConstants.Layers.USER_SETTINGS) BDFDB.ObserverUtils.connect(BDFDB, node, {name: "cardObserver", instance: cardObserver}, {childList: true, subtree: true});
});}});}))}, {childList: true});
for (let child of document.querySelectorAll(BDFDB.dotCN._repocard)) InternalBDFDB.appendCustomControls(child);
@ -7570,7 +7570,7 @@ module.exports = (_ => {
InternalBDFDB.patchContextMenuForPlugin = function (plugin, type, module) {
plugin = plugin == BDFDB && InternalBDFDB || plugin;
if (module && module.exports && module.exports.default) BDFDB.PatchUtils.patch(plugin, module.exports, "default", {after: e => {
if (e.returnValue && typeof plugin[`on${type}`] === "function") plugin[`on${type}`]({instance:{props:e.methodArguments[0]}, returnvalue:e.returnValue, methodname:"default", type:module.exports.default.displayName});
if (e.returnValue && typeof plugin[`on${type}`] === "function") plugin[`on${type}`]({instance: {props: e.methodArguments[0]}, returnvalue: e.returnValue, methodname: "default", type: module.exports.default.displayName});
}});
};
InternalBDFDB.executeExtraPatchedPatches = function (type, e) {
@ -7585,7 +7585,7 @@ module.exports = (_ => {
InternalBDFDB.patchPlugin(BDFDB);
for (let type of QueuedComponents) if (!PluginStores.patchQueues[type]) PluginStores.patchQueues[type] = {query:[], modules:[]};
for (let type of QueuedComponents) if (!PluginStores.patchQueues[type]) PluginStores.patchQueues[type] = {query: [], modules: []};
BDFDB.PatchUtils.patch(BDFDB, LibraryModules.ContextMenuUtils, "openContextMenu", {before: e => {
let menu = e.methodArguments[1]();
if (BDFDB.ObjectUtils.is(menu) && menu.type && menu.type.displayName) {
@ -7607,13 +7607,13 @@ module.exports = (_ => {
let toolbar = BDFDB.ReactUtils.findChild(e.returnValue, {filter: c => c && c.props && c.props.showMoreUtilities != undefined && c.props.showEmojiPicker != undefined && c.props.setPopout != undefined});
if (toolbar) BDFDB.PatchUtils.patch(BDFDB, toolbar, "type", {after: e2 => {
let menu = BDFDB.ReactUtils.findChild(e2.returnValue, {filter: c => c && c.props && typeof c.props.onRequestClose == "function" && c.props.onRequestClose.toString().indexOf("moreUtilities") > -1});
InternalBDFDB.executeExtraPatchedPatches("MessageOptionToolbar", {instance:{props:e2.methodArguments[0]}, returnvalue:e2.returnValue, methodname:"default"});
InternalBDFDB.executeExtraPatchedPatches("MessageOptionToolbar", {instance: {props: e2.methodArguments[0]}, returnvalue: e2.returnValue, methodname: "default"});
if (menu && typeof menu.props.renderPopout == "function") {
let renderPopout = menu.props.renderPopout;
menu.props.renderPopout = (...args) => {
let renderedPopout = renderPopout(...args);
BDFDB.PatchUtils.patch(BDFDB, renderedPopout, "type", {after: e3 => {
InternalBDFDB.executeExtraPatchedPatches("MessageOptionContextMenu", {instance:{props:e3.methodArguments[0]}, returnvalue:e3.returnValue, methodname:"default"});
InternalBDFDB.executeExtraPatchedPatches("MessageOptionContextMenu", {instance: {props: e3.methodArguments[0]}, returnvalue: e3.returnValue, methodname: "default"});
}}, {noCache: true});
return renderedPopout;
}
@ -7623,7 +7623,7 @@ module.exports = (_ => {
BDFDB.PatchUtils.patch(BDFDB, BDFDB.ObjectUtils.get(BDFDB.ModuleUtils.findByString("guild-header-popout", false), "exports.default.prototype"), "render", {after: e => {
BDFDB.PatchUtils.patch(BDFDB, e.returnValue.type, "type", {after: e2 => {
InternalBDFDB.executeExtraPatchedPatches("GuildHeaderContextMenu", {instance:{props:e2.methodArguments[0]}, returnvalue:e2.returnValue, methodname:"type"});
InternalBDFDB.executeExtraPatchedPatches("GuildHeaderContextMenu", {instance: {props: e2.methodArguments[0]}, returnvalue: e2.returnValue, methodname: "type"});
}}, {noCache: true});
}});
@ -7819,13 +7819,13 @@ module.exports = (_ => {
window.t = {"$filter":(m => [...strings].flat(10).filter(n => typeof n == "string").map(string => string.toLowerCase()).every(string => typeof m == "function" && (m.toString().toLowerCase().indexOf(string) > -1 || typeof m.__originalMethod == "function" && m.__originalMethod.toString().toLowerCase().indexOf(string) > -1 || typeof m.__originalFunction == "function" && m.__originalFunction.toString().toLowerCase().indexOf(string) > -1) || BDFDB.ObjectUtils.is(m) && typeof m.type == "function" && m.type.toString().toLowerCase().indexOf(string) > -1))};
for (let i in BDFDB.DevUtils.req.c) if (BDFDB.DevUtils.req.c.hasOwnProperty(i)) {
let m = BDFDB.DevUtils.req.c[i].exports;
if (m && typeof m == "function" && window.t.$filter(m)) window.t["module_" + i] = {string:m.toString(), func:m};
if (m && typeof m == "function" && window.t.$filter(m)) window.t["module_" + i] = {string: m.toString(), func: m};
if (m && m.__esModule) {
for (let j in m) if (m[j] && typeof m[j] == "function" && window.t.$filter(m[j])) window.t[j + "_module_" + i] = {string:m[j].toString(), func:m[j], module:m};
if (m.default && (typeof m.default == "object" || typeof m.default == "function")) for (let j in m.default) if (m.default[j] && typeof m.default[j] == "function" && window.t.$filter(m.default[j])) window.t[j + "_module_" + i + "_default"] = {string:m.default[j].toString(), func:m.default[j], module:m};
for (let j in m) if (m[j] && typeof m[j] == "function" && window.t.$filter(m[j])) window.t[j + "_module_" + i] = {string: m[j].toString(), func: m[j], module: m};
if (m.default && (typeof m.default == "object" || typeof m.default == "function")) for (let j in m.default) if (m.default[j] && typeof m.default[j] == "function" && window.t.$filter(m.default[j])) window.t[j + "_module_" + i + "_default"] = {string: m.default[j].toString(), func: m.default[j], module: m};
}
}
for (let i in BDFDB.DevUtils.req.m) if (typeof BDFDB.DevUtils.req.m[i] == "function" && window.t.$filter(BDFDB.DevUtils.req.m[i])) window.t["funtion_" + i] = {string:BDFDB.DevUtils.req.m[i].toString(), func:BDFDB.DevUtils.req.m[i]};
for (let i in BDFDB.DevUtils.req.m) if (typeof BDFDB.DevUtils.req.m[i] == "function" && window.t.$filter(BDFDB.DevUtils.req.m[i])) window.t["funtion_" + i] = {string: BDFDB.DevUtils.req.m[i].toString(), func: BDFDB.DevUtils.req.m[i]};
console.clear();
console.log(window.t);
};

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -52,7 +52,7 @@ module.exports = (_ => {
start() {this.load();}
stop() {}
} : (([Plugin, BDFDB]) => {
var badgeClasses, requestedUsers = {}, loadedUsers = {}, requestQueue = {queue:[], timeout:null, id:null}, cacheTimeout;
var badgeClasses, requestedUsers = {}, loadedUsers = {}, requestQueue = {queue: [], timeout: null, id: null}, cacheTimeout;
var nitroFlag, boostFlag;
var settings = {}, badges = {}, indicators = {};
@ -70,11 +70,11 @@ module.exports = (_ => {
this.defaults = {
settings: {
showInPopout: {value:true, description:"Show Badge in User Popout"},
showInChat: {value:true, description:"Show Badge in Chat Window"},
showInMemberList: {value:true, description:"Show Badge in Member List"},
useColoredVersion: {value:true, description:"Use colored version of the Badges for Chat and Members"},
showNitroDate: {value:true, description:"Show the subscription date for Nitro/Boost Badges"}
showInPopout: {value: true, description: "Show Badge in User Popout"},
showInChat: {value: true, description: "Show Badge in Chat Window"},
showInMemberList: {value: true, description: "Show Badge in Member List"},
useColoredVersion: {value: true, description: "Use colored version of the Badges for Chat and Members"},
showNitroDate: {value: true, description: "Show the subscription date for Nitro/Boost Badges"}
},
badges: {
"STAFF": {
@ -280,7 +280,7 @@ module.exports = (_ => {
badgeClasses = BDFDB.DiscordClassModules.UserBadges || {};
requestedUsers = {}, loadedUsers = {};
requestQueue = {queue:[], timeout:null, id:null};
requestQueue = {queue: [], timeout: null, id: null};
let badgeCache = BDFDB.DataUtils.load(this, "badgeCache");
if (badgeCache) {

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -71,10 +71,10 @@ module.exports = (_ => {
onLoad() {
this.defaults = {
settings: {
addTotalAmount: {value:true, description:"Add total amount for all/requested/blocked"},
addSortOptions: {value:true, description:"Add sort options"},
addSearchbar: {value:true, description:"Add searchbar"},
addMutualGuild: {value:true, description:"Add mutual servers in friend list"}
addTotalAmount: {value: true, description: "Add total amount for all/requested/blocked"},
addSortOptions: {value: true, description: "Add sort options"},
addSearchbar: {value: true, description: "Add searchbar"},
addMutualGuild: {value: true, description: "Add mutual servers in friend list"}
}
};

View File

@ -29,7 +29,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -69,7 +69,7 @@ module.exports = (_ => {
processChannelItem (e) {
if (e.instance.props.channel && e.instance.props.channel.nsfw) {
let children = BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["className", BDFDB.disCN.channelchildren]]});
let children = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.channelchildren]]});
let childrenChilds = children && BDFDB.ArrayUtils.is(children.props.children) ? children.props.children : BDFDB.ObjectUtils.get(children, "props.children.props.children");
if (BDFDB.ArrayUtils.is(childrenChilds)) {
let [oldTagParent, oldTagIndex] = BDFDB.ReactUtils.findParent(childrenChilds, {key: "NSFW-badge"});

View File

@ -26,7 +26,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -53,9 +53,9 @@ module.exports = (_ => {
onLoad() {
this.defaults = {
settings: {
addFirstLast: {value:true, description:"Add a first and last page button"},
addJumpTo: {value:true, description:"Add a jump to input field (press enter to jump)"},
cloneToTheTop: {value:true, description:"Clone the controls to the top of the results page"}
addFirstLast: {value: true, description: "Add a first and last page button"},
addJumpTo: {value: true, description: "Add a jump to input field (press enter to jump)"},
cloneToTheTop: {value: true, description: "Clone the controls to the top of the results page"}
}
};
@ -104,7 +104,7 @@ module.exports = (_ => {
processSearchResultsInner (e) {
if (e.instance.props.search) {
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name:"SearchPagination"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "SearchPagination"});
if (index > -1) {
let currentPage = parseInt(Math.floor(e.instance.props.search.offset / BDFDB.DiscordConstants.SEARCH_PAGE_SIZE)) + 1;
let maxPage = e.instance.props.search.totalResults > 5000 ? parseInt(Math.ceil(5000 / BDFDB.DiscordConstants.SEARCH_PAGE_SIZE)) : parseInt(Math.ceil(e.instance.props.search.totalResults / BDFDB.DiscordConstants.SEARCH_PAGE_SIZE));
@ -170,7 +170,7 @@ module.exports = (_ => {
text: BDFDB.LanguageUtils.LanguageStrings.JUMP,
"aria-label": BDFDB.LanguageUtils.LanguageStrings.JUMP,
onClick: (event, instance) => {
let jumpInput = BDFDB.ReactUtils.findOwner(instance._reactInternalFiber.return, {key:"BSP-pagination-jumpinput"});
let jumpInput = BDFDB.ReactUtils.findOwner(instance._reactInternalFiber.return, {key: "BSP-pagination-jumpinput"});
if (jumpInput) doJump(jumpInput.props.value);
},
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, {

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -58,22 +58,22 @@ module.exports = (_ => {
onLoad() {
this.defaults = {
configs: {
case: {value:false, description:"Handle the wordvalue case sensitive"},
exact: {value:true, description:"Handle the wordvalue as an exact word and not as part of a word"},
autoc: {value:true, description:"Add this alias in the autocomplete menu (not for RegExp)"},
regex: {value:false, description:"Handle the wordvalue as a RegExp string"},
file: {value:false, description:"Handle the replacevalue as a filepath"}
case: {value: false, description: "Handle the wordvalue case sensitive"},
exact: {value: true, description: "Handle the wordvalue as an exact word and not as part of a word"},
autoc: {value: true, description: "Add this alias in the autocomplete menu (not for RegExp)"},
regex: {value: false, description: "Handle the wordvalue as a RegExp string"},
file: {value: false, description: "Handle the replacevalue as a filepath"}
},
settings: {
replaceBeforeSend: {value:true, inner:false, description:"Replace words with your aliases before a message is sent"},
addContextMenu: {value:true, inner:false, description:"Add a contextmenu entry to faster add new aliases"},
addAutoComplete: {value:true, inner:false, description:"Add an autocomplete-menu for non-RegExp aliases"},
triggerNormal: {value:true, inner:true, description:"Normal Message Textarea"},
triggerEdit: {value:true, inner:true, description:"Edit Message Textarea"},
triggerUpload: {value:true, inner:true, description:"Upload Message Prompt"}
replaceBeforeSend: {value: true, inner: false, description: "Replace words with your aliases before a message is sent"},
addContextMenu: {value: true, inner: false, description: "Add a contextmenu entry to faster add new aliases"},
addAutoComplete: {value: true, inner: false, description: "Add an autocomplete-menu for non-RegExp aliases"},
triggerNormal: {value: true, inner: true, description: "Normal Message Textarea"},
triggerEdit: {value: true, inner: true, description: "Edit Message Textarea"},
triggerUpload: {value: true, inner: true, description: "Upload Message Prompt"}
},
amounts: {
minAliasLength: {value:2, min:1, description:"Minimal Character Length to open Autocomplete-Menu:"}
minAliasLength: {value: 2, min: 1, description: "Minimal Character Length to open Autocomplete-Menu: "}
}
};
@ -153,7 +153,7 @@ module.exports = (_ => {
return [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.AutocompleteItems.Title, {
title: [
"Aliases: ",
"Aliases:",
BDFDB.ReactUtils.createElement("strong", {
children: wordLowercase
})
@ -241,7 +241,7 @@ module.exports = (_ => {
}))
}))
}));
let values = {wordvalue:"", replacevalue:""};
let values = {wordvalue: "", replacevalue: ""};
settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.CollapseContainer, {
title: "Add new alias",
collapseStates: collapseStates,
@ -449,7 +449,7 @@ module.exports = (_ => {
newText = newText.length == 1 ? newText[0] : newText.join(" ");
newText = newText.replace(/ ([\n\t\r]) /g, "$1");
newText = this.useAliases(newText, multiAliases, files, false);
return {text:newText, files};
return {text: newText, files};
}
useAliases (string, aliases, files, singleWord) {
@ -468,7 +468,7 @@ module.exports = (_ => {
tempString1 = tempString1.slice(result.index + result[0].length);
if (config.file && typeof config.filedata == "string") {
let filedata = JSON.parse(config.filedata);
files.push(new File([Uint8Array.from(atob(filedata.data), c => c.charCodeAt(0))], filedata.name, {type:filedata.type}));
files.push(new File([Uint8Array.from(atob(filedata.data), c => c.charCodeAt(0))], filedata.name, {type: filedata.type}));
}
if (config.regex && regString.indexOf("^") == 0) result = null;
}
@ -532,7 +532,7 @@ module.exports = (_ => {
if (!values.wordvalue) instance.props.errorMessage = "Choose a wordvalue";
else if (aliases[values.wordvalue]) instance.props.errorMessage = "Wordvalue already used, saving will overwrite old alias";
else delete instance.props.errorMessage;
let addButtonIns = BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name:["BDFDB_Modal", "BDFDB_SettingsPanel"], up:true}), {key:"ADDBUTTON"});
let addButtonIns = BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name: ["BDFDB_Modal", "BDFDB_SettingsPanel"], up: true}), {key: "ADDBUTTON"});
if (addButtonIns) {
addButtonIns.props.disabled = !Object.keys(values).every(valuename => values[valuename]);
BDFDB.ReactUtils.forceUpdate(addButtonIns);
@ -554,7 +554,7 @@ module.exports = (_ => {
values.replacevalue = value.trim();
if (!values.replacevalue) instance.props.errorMessage = "Choose a replacevalue";
else delete instance.props.errorMessage;
let addButtonIns = BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name:["BDFDB_Modal", "BDFDB_SettingsPanel"], up:true}), {key:"ADDBUTTON"});
let addButtonIns = BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name: ["BDFDB_Modal", "BDFDB_SettingsPanel"], up: true}), {key: "ADDBUTTON"});
if (addButtonIns) {
addButtonIns.props.disabled = !Object.keys(values).every(valuename => values[valuename]);
BDFDB.ReactUtils.forceUpdate(addButtonIns);

View File

@ -26,7 +26,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -54,17 +54,17 @@ module.exports = (_ => {
onLoad() {
this.defaults = {
configs: {
empty: {value:false, description:"Allow the replacevalue to be empty (ignoring the default)"},
case: {value:false, description:"Handle the wordvalue case sensitive"},
exact: {value:true, description:"Handle the wordvalue as an exact word and not as part of a word"},
regex: {value:false, description:"Handle the wordvalue as a RegExp string"}
empty: {value: false, description: "Allow the replacevalue to be empty (ignoring the default)"},
case: {value: false, description: "Handle the wordvalue case sensitive"},
exact: {value: true, description: "Handle the wordvalue as an exact word and not as part of a word"},
regex: {value: false, description: "Handle the wordvalue as a RegExp string"}
},
replaces: {
blocked: {value:"~~BLOCKED~~", description:"Default replaceword for blocked messages:"},
censored: {value:"$!%&%!&", description:"Default replaceword for censored messages:"}
blocked: {value: "~~BLOCKED~~", description: "Default replaceword for blocked messages: "},
censored: {value: "$!%&%!&", description: "Default replaceword for censored messages: "}
},
settings: {
addContextMenu: {value:true, description:"Add a contextmenu entry to faster add new blocked/censored words:"}
addContextMenu: {value: true, description: "Add a contextmenu entry to faster add new blocked/censored words: "}
}
};
@ -116,7 +116,7 @@ module.exports = (_ => {
placeholder: this.defaults.replaces[rType].value
})))
}));
let values = {wordvalue:"", replacevalue:"", choice:"blocked"};
let values = {wordvalue: "", replacevalue: "", choice: "blocked"};
settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.CollapseContainer, {
title: `Add new blocked/censored word`,
collapseStates: collapseStates,
@ -349,7 +349,7 @@ module.exports = (_ => {
}
if (blocked) break;
}
if (blocked) return {blocked, censored, content:blockedReplace};
if (blocked) return {blocked, censored, content: blockedReplace};
else {
content = content.replace(/([\n\t\r])/g, " $1 ");
for (let cWord in words.censored) {
@ -399,7 +399,7 @@ module.exports = (_ => {
}
openAddModal (wordvalue) {
let values = {wordvalue, replacevalue:"", choice:"blocked"};
let values = {wordvalue, replacevalue: "", choice: "blocked"};
BDFDB.ModalUtils.open(this, {
size: "MEDIUM",
header: "Add to ChatAliases",
@ -446,7 +446,7 @@ module.exports = (_ => {
if (!values.wordvalue) instance.props.errorMessage = "Choose a wordvalue";
else if (words[values.choice][values.wordvalue]) instance.props.errorMessage = `Wordvalue already used, saving will overwrite old ${values.choice} word`;
else delete instance.props.errorMessage;
let addButtonIns = BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name:["BDFDB_Modal", "BDFDB_SettingsPanel"], up:true}), {key:"ADDBUTTON"});
let addButtonIns = BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name: ["BDFDB_Modal", "BDFDB_SettingsPanel"], up: true}), {key: "ADDBUTTON"});
if (addButtonIns) {
addButtonIns.props.disabled = !values.wordvalue;
BDFDB.ReactUtils.forceUpdate(addButtonIns);
@ -469,10 +469,10 @@ module.exports = (_ => {
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.RadioGroup, {
className: BDFDB.disCN.marginbottom8,
value: values.choice,
options: [{value:"blocked", name:"Block"}, {value:"censored", name:"Censor"}],
options: [{value: "blocked", name: "Block"}, {value: "censored", name: "Censor"}],
onChange: (value, instance) => {
values.choice = value.value;
let wordvalueInputIns = BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name:["BDFDB_Modal", "BDFDB_SettingsPanel"], up:true}), {key:"WORDVALUE"});
let wordvalueInputIns = BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name: ["BDFDB_Modal", "BDFDB_SettingsPanel"], up: true}), {key: "WORDVALUE"});
if (wordvalueInputIns) {
if (!values.wordvalue) wordvalueInputIns.props.errorMessage = "Choose a wordvalue";
else if (words[values.choice][values.wordvalue]) wordvalueInputIns.props.errorMessage = `Wordvalue already used, saving will overwrite old ${values.choice} word`;

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -59,24 +59,24 @@ module.exports = (_ => {
onLoad() {
this.defaults = {
settings: {
showInChat: {value:true, description:"Replace chat timestamp with complete timestamp"},
showInEmbed: {value:true, description:"Replace embed timestamp with complete timestamp"},
changeForChat: {value:true, description:"Change the time for the chat time tooltips"},
changeForEdit: {value:true, description:"Change the time for the edited time tooltips"},
displayTime: {value:true, description:"Display the time in the timestamp"},
displayDate: {value:true, description:"Display the date in the timestamp"},
cutSeconds: {value:false, description:"Cut off seconds of the time"},
forceZeros: {value:false, description:"Force leading zeros"},
otherOrder: {value:false, description:"Show the time before the date"}
showInChat: {value: true, description: "Replace chat timestamp with complete timestamp"},
showInEmbed: {value: true, description: "Replace embed timestamp with complete timestamp"},
changeForChat: {value: true, description: "Change the time for the chat time tooltips"},
changeForEdit: {value: true, description: "Change the time for the edited time tooltips"},
displayTime: {value: true, description: "Display the time in the timestamp"},
displayDate: {value: true, description: "Display the date in the timestamp"},
cutSeconds: {value: false, description: "Cut off seconds of the time"},
forceZeros: {value: false, description: "Force leading zeros"},
otherOrder: {value: false, description: "Show the time before the date"}
},
choices: {
timestampLang: {value:"$discord", description:"Timestamp Format"}
timestampLang: {value: "$discord", description: "Timestamp Format"}
},
formats: {
ownFormat: {value:"$hour:$minute:$second, $day.$month.$year", description:"Own Format"}
ownFormat: {value: "$hour: $minute: $second, $day.$month.$year", description: "Own Format"}
},
amounts: {
maxDaysAgo: {value:0, min:0, description:"Maximum count of days displayed in the $daysago placeholder", note:"0 equals no limit"}
maxDaysAgo: {value: 0, min: 0, description: "Maximum count of days displayed in the $daysago placeholder", note: "0 equals no limit"}
}
};
@ -122,7 +122,7 @@ module.exports = (_ => {
value: settings[key],
onChange: (value, instance) => {
settings[key] = value;
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name:"BDFDB_SettingsPanel", up:true}), {name:"BDFDB_Select", all:true, noCopies:true}));
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name: "BDFDB_SettingsPanel", up: true}), {name: "BDFDB_Select", all: true, noCopies: true}));
}
}))
}));
@ -137,7 +137,7 @@ module.exports = (_ => {
label: this.defaults.choices[key].description,
basis: "70%",
value: choices[key],
options: BDFDB.ObjectUtils.toArray(BDFDB.ObjectUtils.map(languages, (lang, id) => {return {value:id, label:lang.name}})),
options: BDFDB.ObjectUtils.toArray(BDFDB.ObjectUtils.map(languages, (lang, id) => {return {value: id, label: lang.name}})),
searchable: true,
optionRenderer: lang => {
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
@ -187,7 +187,7 @@ module.exports = (_ => {
value: formats[key],
onChange: (value, instance) => {
formats[key] = value;
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name:"BDFDB_SettingsPanel", up:true}), {name:"BDFDB_Select", all:true, noCopies:true}));
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name: "BDFDB_SettingsPanel", up: true}), {name: "BDFDB_Select", all: true, noCopies: true}));
}
}))).concat(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormDivider, {
className: BDFDB.disCN.marginbottom8
@ -255,14 +255,14 @@ module.exports = (_ => {
processMessage (e) {
if (settings.changeForChat && BDFDB.ObjectUtils.get(e, "instance.props.childrenHeader.type.type.displayName") == "MessageTimestamp") {
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: e.instance.props.childrenHeader.type});
if (index > -1) this.changeTimestamp(children, index, {child:false, tooltip:true});
if (index > -1) this.changeTimestamp(children, index, {child: false, tooltip: true});
}
}
processMessageHeader (e) {
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "MessageTimestamp"});
if (index > -1) {
this.changeTimestamp(children, index, {child:settings.showInChat, tooltip:settings.changeForChat});
this.changeTimestamp(children, index, {child: settings.showInChat, tooltip: settings.changeForChat});
this.setMaxWidth(children[index], e.instance.props.compact);
}
}
@ -270,14 +270,14 @@ module.exports = (_ => {
processMessageContent (e) {
if (e.instance.props.message.editedTimestamp && settings.changeForEdit) {
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "SuffixEdited"});
if (index > -1) this.changeTimestamp(children, index, {child:false, tooltip:true});
if (index > -1) this.changeTimestamp(children, index, {child: false, tooltip: true});
}
}
processEmbed (e) {
if (e.instance.props.embed.timestamp && settings.showInEmbed) {
let process = returnvalue => {
let [children, index] = BDFDB.ReactUtils.findParent(returnvalue, {props:[["className", BDFDB.disCN.embedfootertext]]});
let [children, index] = BDFDB.ReactUtils.findParent(returnvalue, {props: [["className", BDFDB.disCN.embedfootertext]]});
if (index > -1 && BDFDB.ArrayUtils.is(children[index].props.children)) children[index].props.children.splice(children[index].props.children.length - 1, 1, this.getTimestamp(languages[choices.timestampLang].id, e.instance.props.embed.timestamp._i));
};
if (typeof e.returnvalue.props.children == "function") {

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -58,7 +58,7 @@ module.exports = (_ => {
onLoad() {
this.defaults = {
settings: {
copyOnlySelected: {value:true, description:"Only copy selected text of a message"}
copyOnlySelected: {value: true, description: "Only copy selected text of a message"}
}
};
}
@ -117,14 +117,14 @@ module.exports = (_ => {
});
}),
action: _ => {
BDFDB.LibraryRequires.electron.clipboard.write({text:messageString});
BDFDB.LibraryRequires.electron.clipboard.write({text: messageString});
}
}),
embedString && BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: BDFDB.LanguageUtils.LanguageStrings.COPY_TEXT + " (Raw Embed)",
id: BDFDB.ContextMenuUtils.createItemId(this.name, "copy-embed"),
action: _ => {
BDFDB.LibraryRequires.electron.clipboard.write({text:embedString});
BDFDB.LibraryRequires.electron.clipboard.write({text: embedString});
}
})
].filter(n => n);
@ -150,7 +150,7 @@ module.exports = (_ => {
});
},
action: _ => {
BDFDB.LibraryRequires.electron.clipboard.write({text:e.instance.props.message.content});
BDFDB.LibraryRequires.electron.clipboard.write({text: e.instance.props.message.content});
}
}));
}
@ -164,7 +164,7 @@ module.exports = (_ => {
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, {
className: BDFDB.disCN.messagetoolbarbutton,
onClick: _ => {
BDFDB.LibraryRequires.electron.clipboard.write({text:e.instance.props.message.content});
BDFDB.LibraryRequires.electron.clipboard.write({text: e.instance.props.message.content});
},
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
className: BDFDB.disCN.messagetoolbaricon,

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -59,23 +59,23 @@ module.exports = (_ => {
onLoad() {
this.defaults = {
settings: {
addInUserPopout: {value:true, description:"Add in User Popouts"},
addInUserProfil: {value:true, description:"Add in User Profile Modal"},
displayText: {value:true, description:"Display 'Created on' text in the timestamp"},
displayTime: {value:true, description:"Display the time in the timestamp"},
displayDate: {value:true, description:"Display the date in the timestamp"},
cutSeconds: {value:false, description:"Cut off seconds of the time"},
forceZeros: {value:false, description:"Force leading zeros"},
otherOrder: {value:false, description:"Show the time before the date"}
addInUserPopout: {value: true, description: "Add in User Popouts"},
addInUserProfil: {value: true, description: "Add in User Profile Modal"},
displayText: {value: true, description: "Display 'Created on' text in the timestamp"},
displayTime: {value: true, description: "Display the time in the timestamp"},
displayDate: {value: true, description: "Display the date in the timestamp"},
cutSeconds: {value: false, description: "Cut off seconds of the time"},
forceZeros: {value: false, description: "Force leading zeros"},
otherOrder: {value: false, description: "Show the time before the date"}
},
choices: {
creationDateLang: {value:"$discord", description:"Creation Date Format"}
creationDateLang: {value: "$discord", description: "Creation Date Format"}
},
formats: {
ownFormat: {value:"$hour:$minute:$second, $day.$month.$year", description:"Own Format"}
ownFormat: {value: "$hour: $minute: $second, $day.$month.$year", description: "Own Format"}
},
amounts: {
maxDaysAgo: {value:0, min:0, description:"Maximum count of days displayed in the $daysago placeholder", note:"0 equals no limit"}
maxDaysAgo: {value: 0, min: 0, description: "Maximum count of days displayed in the $daysago placeholder", note: "0 equals no limit"}
}
};
@ -117,7 +117,7 @@ module.exports = (_ => {
value: settings[key],
onChange: (value, instance) => {
settings[key] = value;
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name:"BDFDB_SettingsPanel", up:true}), {name:"BDFDB_Select", all:true, noCopies:true}));
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name: "BDFDB_SettingsPanel", up: true}), {name: "BDFDB_Select", all: true, noCopies: true}));
}
}))
}));
@ -132,7 +132,7 @@ module.exports = (_ => {
label: this.defaults.choices[key].description,
basis: "70%",
value: choices[key],
options: BDFDB.ObjectUtils.toArray(BDFDB.ObjectUtils.map(languages, (lang, id) => {return {value:id, label:lang.name}})),
options: BDFDB.ObjectUtils.toArray(BDFDB.ObjectUtils.map(languages, (lang, id) => {return {value: id, label: lang.name}})),
searchable: true,
optionRenderer: lang => {
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
@ -182,7 +182,7 @@ module.exports = (_ => {
value: formats[key],
onChange: (value, instance) => {
formats[key] = value;
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name:"BDFDB_SettingsPanel", up:true}), {name:"BDFDB_Select", all:true, noCopies:true}));
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name: "BDFDB_SettingsPanel", up: true}), {name: "BDFDB_Select", all: true, noCopies: true}));
}
}))).concat(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormDivider, {
className: BDFDB.disCN.marginbottom8

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -93,10 +93,10 @@ module.exports = (_ => {
this.defaults = {
settings: {
quoteOnlySelected: {value:true, description:"Only insert selected text in a quoted message"},
alwaysCopy: {value:false, description:"Always copy quote to clipboard without holding shift"},
ignoreMentionInDM: {value:true, description:"Do not add a mention in DM channels"},
forceZeros: {value:false, description:"Force leading Zeros"}
quoteOnlySelected: {value: true, description: "Only insert selected text in a quoted message"},
alwaysCopy: {value: false, description: "Always copy quote to clipboard without holding shift"},
ignoreMentionInDM: {value: true, description: "Do not add a mention in DM channels"},
forceZeros: {value: false, description: "Force leading Zeros"}
}
};
}
@ -160,10 +160,10 @@ module.exports = (_ => {
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Button, {
style: {marginBottom: 1},
onClick: _ => {
for (let input of settingsPanel.querySelectorAll(".input-newquote " + BDFDB.dotCN.input)) if (!input.value || input.value.length == 0 || input.value.trim().length == 0) return BDFDB.NotificationUtils.toast("Fill out all fields to add a new quote.", {type:"danger"});
for (let input of settingsPanel.querySelectorAll(".input-newquote " + BDFDB.dotCN.input)) if (!input.value || input.value.length == 0 || input.value.trim().length == 0) return BDFDB.NotificationUtils.toast("Fill out all fields to add a new quote.", {type: "danger"});
let key = settingsPanel.querySelector(".input-name " + BDFDB.dotCN.input).value.trim();
let quote = settingsPanel.querySelector(".input-quote " + BDFDB.dotCN.input).value.trim();
if (formats[key]) return BDFDB.NotificationUtils.toast("A quote with the choosen name already exists, please choose another name", {type:"danger"});
if (formats[key]) return BDFDB.NotificationUtils.toast("A quote with the choosen name already exists, please choose another name", {type: "danger"});
else {
formats[key] = quote;
BDFDB.DataUtils.save(formats, this, "formats");
@ -263,8 +263,8 @@ module.exports = (_ => {
let item = null, action = (choice, shift) => {
format = choice;
if (shift && !settings.alwaysCopy || !shift && settings.alwaysCopy || !BDFDB.LibraryModules.QuoteUtils.canQuote(e.instance.props.message, e.instance.props.channel)) {
BDFDB.LibraryRequires.electron.clipboard.write({text:this.parseQuote(e.instance.props.message, e.instance.props.channel)});
BDFDB.NotificationUtils.toast("Quote has been copied to clipboard", {type:"success"});
BDFDB.LibraryRequires.electron.clipboard.write({text: this.parseQuote(e.instance.props.message, e.instance.props.channel)});
BDFDB.NotificationUtils.toast("Quote has been copied to clipboard", {type: "success"});
}
else BDFDB.LibraryModules.MessageManageUtils.quoteMessage(e.instance.props.channel, e.instance.props.message);
format = null;

View File

@ -26,7 +26,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -54,10 +54,10 @@ module.exports = (_ => {
onLoad() {
this.defaults = {
settings: {
onDemand: {value:false, description:"Inject the content of 'message.txt' on demand instead of automatically"}
onDemand: {value: false, description: "Inject the content of 'message.txt' on demand instead of automatically"}
},
amounts: {
maxFileSize: {value:10, min:0, description:"Max Filesize a fill will be read automatically", note: "in KB / 0 = inject all / ignored in On-Demand"}
maxFileSize: {value: 10, min: 0, description: "Max Filesize a fill will be read automatically", note: "in KB / 0 = inject all / ignored in On-Demand"}
}
};

View File

@ -29,7 +29,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -56,11 +56,11 @@ module.exports = (_ => {
onLoad() {
this.defaults = {
settings: {
showGuildIcon: {value:true, description:"Show a icon for servers"},
showGuildIcon: {value: true, description: "Show a icon for servers"},
},
amounts: {
serverListWidth: {value:240, min:45, description:"Server list width in px:"},
serverElementHeight: {value:32, min:16, description:"Server element height in px:"}
serverListWidth: {value: 240, min: 45, description: "Server list width in px: "},
serverElementHeight: {value: 32, min: 16, description: "Server element height in px: "}
}
};
@ -83,7 +83,7 @@ module.exports = (_ => {
BDFDB.DOMUtils.addClass(document.body, BDFDB.disCN._displayserversaschannelsstyled);
BDFDB.PatchUtils.patch(this, BDFDB.LibraryComponents.GuildComponents.Guild.prototype, "render", {after: e => {
if (e.thisObject.props.list) this.processGuild({instance:e.thisObject, returnvalue:e.returnValue, methodname:"render"});
if (e.thisObject.props.list) this.processGuild({instance: e.thisObject, returnvalue: e.returnValue, methodname: "render"});
}});
this.forceUpdateAll();
@ -158,7 +158,7 @@ module.exports = (_ => {
if (errorIndex > -1) errorChildren[errorIndex] = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.GuildComponents.Items.UnavailableGuildsButton, {
unavailableGuilds: BDFDB.LibraryModules.GuildUnavailableStore.totalUnavailableGuilds
});
let scroller = BDFDB.ReactUtils.findChild(returnvalue, {props:[["className", BDFDB.disCN.guildsscroller]]});
let scroller = BDFDB.ReactUtils.findChild(returnvalue, {props: [["className", BDFDB.disCN.guildsscroller]]});
if (scroller) {
scroller.props.fade = true;
scroller.type = BDFDB.LibraryComponents.Scrollers.Thin;
@ -526,7 +526,7 @@ module.exports = (_ => {
width: ${amounts.serverElementHeight/32 * 20}px;
height: ${amounts.serverElementHeight/32 * 20}px;
background: var(--text-normal);
-webkit-mask: url('data:image/svg+xml;base64,PHN2ZyB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAxOCAxOCI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBmaWxsPSJ3aGl0ZSIgZD0iTTMuNjAwOTE0ODEsNy4yMDI5NzMxMyBDMy42MDA5MTQ4MSw1LjIwOTgzNDE5IDUuMjA5ODM0MTksMy42MDA5MTQ4MSA3LjIwMjk3MzEzLDMuNjAwOTE0ODEgQzkuMTk2MTEyMDYsMy42MDA5MTQ4MSAxMC44MDUwMzE0LDUuMjA5ODM0MTkgMTAuODA1MDMxNCw3LjIwMjk3MzEzIEMxMC44MDUwMzE0LDkuMTk2MTEyMDYgOS4xOTYxMTIwNiwxMC44MDUwMzE0IDcuMjAyOTczMTMsMTAuODA1MDMxNCBDNS4yMDk4MzQxOSwxMC44MDUwMzE0IDMuNjAwOTE0ODEsOS4xOTYxMTIwNiAzLjYwMDkxNDgxLDcuMjAyOTczMTMgWiBNMTIuMDA1NzE3NiwxMC44MDUwMzE0IEwxMS4zNzMzNTYyLDEwLjgwNTAzMTQgTDExLjE0OTIyODEsMTAuNTg4OTA3OSBDMTEuOTMzNjc2NCw5LjY3NjM4NjUxIDEyLjQwNTk0NjMsOC40OTE3MDk1NSAxMi40MDU5NDYzLDcuMjAyOTczMTMgQzEyLjQwNTk0NjMsNC4zMjkzMzEwNSAxMC4wNzY2MTUyLDIgNy4yMDI5NzMxMywyIEM0LjMyOTMzMTA1LDIgMiw0LjMyOTMzMTA1IDIsNy4yMDI5NzMxMyBDMiwxMC4wNzY2MTUyIDQuMzI5MzMxMDUsMTIuNDA1OTQ2MyA3LjIwMjk3MzEzLDEyLjQwNTk0NjMgQzguNDkxNzA5NTUsMTIuNDA1OTQ2MyA5LjY3NjM4NjUxLDExLjkzMzY3NjQgMTAuNTg4OTA3OSwxMS4xNDkyMjgxIEwxMC44MDUwMzE0LDExLjM3MzM1NjIgTDEwLjgwNTAzMTQsMTIuMDA1NzE3NiBMMTQuODA3MzE4NSwxNiBMMTYsMTQuODA3MzE4NSBMMTIuMjEwMjUzOCwxMS4wMDk5Nzc2IEwxMi4wMDU3MTc2LDEwLjgwNTAzMTQgWiI+PC9wYXRoPjwvZz48L3N2Zz4=') center/cover no-repeat;
-webkit-mask: url('data: image/svg+xml;base64,PHN2ZyB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAxOCAxOCI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBmaWxsPSJ3aGl0ZSIgZD0iTTMuNjAwOTE0ODEsNy4yMDI5NzMxMyBDMy42MDA5MTQ4MSw1LjIwOTgzNDE5IDUuMjA5ODM0MTksMy42MDA5MTQ4MSA3LjIwMjk3MzEzLDMuNjAwOTE0ODEgQzkuMTk2MTEyMDYsMy42MDA5MTQ4MSAxMC44MDUwMzE0LDUuMjA5ODM0MTkgMTAuODA1MDMxNCw3LjIwMjk3MzEzIEMxMC44MDUwMzE0LDkuMTk2MTEyMDYgOS4xOTYxMTIwNiwxMC44MDUwMzE0IDcuMjAyOTczMTMsMTAuODA1MDMxNCBDNS4yMDk4MzQxOSwxMC44MDUwMzE0IDMuNjAwOTE0ODEsOS4xOTYxMTIwNiAzLjYwMDkxNDgxLDcuMjAyOTczMTMgWiBNMTIuMDA1NzE3NiwxMC44MDUwMzE0IEwxMS4zNzMzNTYyLDEwLjgwNTAzMTQgTDExLjE0OTIyODEsMTAuNTg4OTA3OSBDMTEuOTMzNjc2NCw5LjY3NjM4NjUxIDEyLjQwNTk0NjMsOC40OTE3MDk1NSAxMi40MDU5NDYzLDcuMjAyOTczMTMgQzEyLjQwNTk0NjMsNC4zMjkzMzEwNSAxMC4wNzY2MTUyLDIgNy4yMDI5NzMxMywyIEM0LjMyOTMzMTA1LDIgMiw0LjMyOTMzMTA1IDIsNy4yMDI5NzMxMyBDMiwxMC4wNzY2MTUyIDQuMzI5MzMxMDUsMTIuNDA1OTQ2MyA3LjIwMjk3MzEzLDEyLjQwNTk0NjMgQzguNDkxNzA5NTUsMTIuNDA1OTQ2MyA5LjY3NjM4NjUxLDExLjkzMzY3NjQgMTAuNTg4OTA3OSwxMS4xNDkyMjgxIEwxMC44MDUwMzE0LDExLjM3MzM1NjIgTDEwLjgwNTAzMTQsMTIuMDA1NzE3NiBMMTQuODA3MzE4NSwxNiBMMTYsMTQuODA3MzE4NSBMMTIuMjEwMjUzOCwxMS4wMDk5Nzc2IEwxMi4wMDU3MTc2LDEwLjgwNTAzMTQgWiI+PC9wYXRoPjwvZz48L3N2Zz4=') center/cover no-repeat;
}
#server-search ${BDFDB.dotCN.guildbuttonpill},
#server-search ${BDFDB.dotCN.guildsvg} {

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -58,16 +58,16 @@ module.exports = (_ => {
onLoad() {
this.defaults = {
settings: {
changeChannelIcon: {value:true, inner:false, description:"Change color of Channel Icon"},
changeInChatTextarea: {value:true, inner:true, description:"Chat Textarea"},
changeInMentions: {value:true, inner:true, description:"Mentions"},
changeInChannelList: {value:true, inner:true, description:"Channel List"},
changeInChannelHeader: {value:true, inner:true, description:"Channel Header"},
changeInRecentMentions: {value:true, inner:true, description:"Recent Mentions Popout"},
changeInAutoComplete: {value:true, inner:true, description:"Autocomplete Menu"},
changeInAuditLog: {value:true, inner:true, description:"Audit Log"},
changeInInviteLog: {value:true, inner:true, description:"Invite Log"},
changeInQuickSwitcher: {value:true, inner:true, description:"Quick Switcher"}
changeChannelIcon: {value: true, inner: false, description: "Change color of Channel Icon"},
changeInChatTextarea: {value: true, inner: true, description: "Chat Textarea"},
changeInMentions: {value: true, inner: true, description: "Mentions"},
changeInChannelList: {value: true, inner: true, description: "Channel List"},
changeInChannelHeader: {value: true, inner: true, description: "Channel Header"},
changeInRecentMentions: {value: true, inner: true, description: "Recent Mentions Popout"},
changeInAutoComplete: {value: true, inner: true, description: "Autocomplete Menu"},
changeInAuditLog: {value: true, inner: true, description: "Audit Log"},
changeInInviteLog: {value: true, inner: true, description: "Invite Log"},
changeInQuickSwitcher: {value: true, inner: true, description: "Quick Switcher"}
}
};
@ -105,7 +105,7 @@ module.exports = (_ => {
onStart() {
let observer = new MutationObserver(_ => {this.changeAppTitle();});
BDFDB.ObserverUtils.connect(this, document.head.querySelector("title"), {name:"appTitleObserver",instance:observer}, {childList:true});
BDFDB.ObserverUtils.connect(this, document.head.querySelector("title"), {name: "appTitleObserver",instance: observer}, {childList: true});
if (BDFDB.LibraryModules.AutocompleteOptions && BDFDB.LibraryModules.AutocompleteOptions.AUTOCOMPLETE_OPTIONS) BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.AutocompleteOptions.AUTOCOMPLETE_OPTIONS.CHANNELS, "queryResults", {after: e => {
let channelArray = [];
@ -183,7 +183,7 @@ module.exports = (_ => {
this.changeAppTitle();
BDFDB.PatchUtils.forceAllUpdates(this);
BDFDB.ChannelUtils.rerenderAll(instant);
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.app), {name:"Channel", unlimited:true}));
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.app), {name: "Channel", unlimited: true}));
}
onChannelContextMenu (e) {
@ -232,12 +232,12 @@ module.exports = (_ => {
if (e.instance.props.category) e.instance.props.category = this.getChannelData(e.instance.props.category.id);
}
else {
let channelName = BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["className", BDFDB.disCN.marginleft4]]});
let channelName = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.marginleft4]]});
if (channelName) this.changeChannelColor(channelName, e.instance.props.channel.id);
let channelIcon = BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["className", BDFDB.disCN.autocompleteicon]]});
let channelIcon = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.autocompleteicon]]});
if (channelIcon) this.changeChannelIconColor(channelIcon, e.instance.props.channel.id, {alpha: 0.6});
if (e.instance.props.category) {
let categoryName = BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["className", BDFDB.disCN.autocompletedescription]]});
let categoryName = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.autocompletedescription]]});
if (categoryName) this.changeChannelColor(categoryName, e.instance.props.category.id);
}
}
@ -249,7 +249,7 @@ module.exports = (_ => {
if (channel && settings.changeInAuditLog) {
if (!e.returnvalue) e.instance.props.log.options.channel = this.getChannelData(channel.id);
else {
let channelName = BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["children", [["#" + channel.name]]]]});
let channelName = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["children", [["#" + channel.name]]]]});
if (channelName) this.changeChannelColor(channelName, channel.id);
}
}
@ -294,9 +294,9 @@ module.exports = (_ => {
if (dataListId) {
let channelId = dataListId.split("_").pop();
let modify = {muted: BDFDB.LibraryModules.MutedUtils.isGuildOrCategoryOrChannelMuted(BDFDB.LibraryModules.LastGuildStore.getGuildId(), channelId)};
let categoryName = BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["className", BDFDB.disCN.categoryname]]});
let categoryName = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.categoryname]]});
if (categoryName) this.changeChannelColor(categoryName, channelId, modify);
let categoryIcon = BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["className", BDFDB.disCN.categoryicon]]});
let categoryIcon = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.categoryicon]]});
if (categoryIcon) this.changeChannelIconColor(categoryIcon, channelId, Object.assign({alpha: 0.6}, modify));
}
}
@ -311,9 +311,9 @@ module.exports = (_ => {
if (!e.returnvalue) e.instance.props.channel = this.getChannelData(e.instance.props.channel.id);
else {
let modify = BDFDB.ObjectUtils.extract(Object.assign({}, e.instance.props, e.instance.state), "muted", "locked", "selected", "unread", "connected", "hovered");
let channelName = BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["className", BDFDB.disCN.channelname]]});
let channelName = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.channelname]]});
if (channelName) this.changeChannelColor(channelName, e.instance.props.channel.id, modify);
let channelIcon = BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["className", BDFDB.disCN.channelicon]]});
let channelIcon = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.channelicon]]});
if (channelIcon) this.changeChannelIconColor(channelIcon, e.instance.props.channel.id, Object.assign({alpha: 0.6}, modify));
}
}
@ -327,12 +327,12 @@ module.exports = (_ => {
}
else {
let modify = BDFDB.ObjectUtils.extract(e.instance.props, "focused", "unread", "mentions");
let channelName = BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["className", BDFDB.disCN.quickswitchresultmatch]]});
let channelName = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.quickswitchresultmatch]]});
if (channelName) this.changeChannelColor(channelName, e.instance.props.channel.id, modify);
let channelIcon = BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["className", BDFDB.disCN.quickswitchresulticon]]});
let channelIcon = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.quickswitchresulticon]]});
if (channelIcon) this.changeChannelIconColor(channelIcon, e.instance.props.channel.id, Object.assign({alpha: 0.6}, modify));
if (e.instance.props.category) {
let categoryName = BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["className", BDFDB.disCN.quickswitchresultnote]]});
let categoryName = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.quickswitchresultnote]]});
if (categoryName) this.changeChannelColor(categoryName, e.instance.props.category.id);
}
}
@ -346,7 +346,7 @@ module.exports = (_ => {
let oldType = child.type;
child.type = (...args) => {
let instance = oldType(...args);
let channelName = BDFDB.ReactUtils.findChild(instance, {props:[["className", BDFDB.disCN.recentmentionschannelname]]});
let channelName = BDFDB.ReactUtils.findChild(instance, {props: [["className", BDFDB.disCN.recentmentionschannelname]]});
if (channelName) this.changeChannelColor(channelName, child.props.channel.id);
return instance;
};

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -58,14 +58,14 @@ module.exports = (_ => {
onLoad() {
this.defaults = {
settings: {
addOriginalTooltip: {value:true, inner:false, description:"Hovering over a changed Server Header shows the original Name as Tooltip"},
changeInGuildList: {value:true, inner:true, description:"Server List"},
changeInGuildHeader: {value:true, inner:true, description:"Server Header"},
changeInGuildInvites: {value:true, inner:true, description:"Server Invites"},
changeInChat: {value:true, inner:true, description:"Chat (Welcome Message, etc.)"},
changeInMutualGuilds: {value:true, inner:true, description:"Mutual Servers"},
changeInRecentMentions: {value:true, inner:true, description:"Recent Mentions Popout"},
changeInQuickSwitcher: {value:true, inner:true, description:"Quick Switcher"}
addOriginalTooltip: {value: true, inner: false, description: "Hovering over a changed Server Header shows the original Name as Tooltip"},
changeInGuildList: {value: true, inner: true, description: "Server List"},
changeInGuildHeader: {value: true, inner: true, description: "Server Header"},
changeInGuildInvites: {value: true, inner: true, description: "Server Invites"},
changeInChat: {value: true, inner: true, description: "Chat (Welcome Message, etc.)"},
changeInMutualGuilds: {value: true, inner: true, description: "Mutual Servers"},
changeInRecentMentions: {value: true, inner: true, description: "Recent Mentions Popout"},
changeInQuickSwitcher: {value: true, inner: true, description: "Quick Switcher"}
}
};
@ -95,7 +95,7 @@ module.exports = (_ => {
}
onStart() {
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.IconUtils, "getGuildBannerURL", {instead:e => {
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.IconUtils, "getGuildBannerURL", {instead: e => {
let guild = BDFDB.LibraryModules.GuildStore.getGuild(e.methodArguments[0].id);
if (guild) {
if (e.methodArguments[0].id == "410787888507256842") return guild.banner;
@ -106,13 +106,13 @@ module.exports = (_ => {
}});
BDFDB.PatchUtils.patch(this, BDFDB.LibraryComponents.GuildComponents.Guild.prototype, "render", {
before: e => {this.processGuild({instance:e.thisObject, returnvalue:e.returnValue, methodname:"render"});},
after: e => {this.processGuild({instance:e.thisObject, returnvalue:e.returnValue, methodname:"render"});}
before: e => {this.processGuild({instance: e.thisObject, returnvalue: e.returnValue, methodname: "render"});},
after: e => {this.processGuild({instance: e.thisObject, returnvalue: e.returnValue, methodname: "render"});}
});
BDFDB.PatchUtils.patch(this, BDFDB.LibraryComponents.Connectors.Link.prototype, "render", {
after: e => {
if (e.thisObject.props.className && e.thisObject.props.className.indexOf(BDFDB.disCN.guildiconwrapper) > -1) this.processGuildAcronym({instance:e.thisObject, returnvalue:e.returnValue, methodname:"render"});
if (e.thisObject.props.className && e.thisObject.props.className.indexOf(BDFDB.disCN.guildiconwrapper) > -1) this.processGuildAcronym({instance: e.thisObject, returnvalue: e.returnValue, methodname: "render"});
}
});
@ -253,7 +253,7 @@ module.exports = (_ => {
let renderChildren = e.returnvalue.props.children;
e.returnvalue.props.children = (...args) => {
let renderedChildren = renderChildren(...args);
let guildAcronym = BDFDB.ReactUtils.findChild(renderedChildren, {props:[["className", BDFDB.disCN.guildiconacronym]]});
let guildAcronym = BDFDB.ReactUtils.findChild(renderedChildren, {props: [["className", BDFDB.disCN.guildiconacronym]]});
if (guildAcronym) {
let fontGradient = BDFDB.ObjectUtils.is(data.color2);
guildAcronym.props.style = Object.assign({}, guildAcronym.props.style, {
@ -310,7 +310,7 @@ module.exports = (_ => {
let oldType = child.type;
child.type = (...args) => {
let instance = oldType(...args);
let guildName = BDFDB.ReactUtils.findChild(instance, {props:[["className", BDFDB.disCN.recentmentionsguildname]]});
let guildName = BDFDB.ReactUtils.findChild(instance, {props: [["className", BDFDB.disCN.recentmentionsguildname]]});
if (guildName) guildName.props.children = (this.getGuildData(e.instance.props.channel.guild_id) || {}).name || guildName.props.children;
return instance;
};
@ -352,7 +352,7 @@ module.exports = (_ => {
processWelcomeArea (e) {
if (e.instance.props.channel && settings.changeInChat) {
let name = (BDFDB.LibraryModules.GuildStore.getGuild(e.instance.props.channel.guild_id) || {}).name;
let guildName = name && BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["className", "titleName-3-Lp3Z"]]});
let guildName = name && BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", "titleName-3-Lp3Z"]]});
if (guildName && guildName.props && BDFDB.ArrayUtils.is(guildName.props.children)) {
for (let child of guildName.props.children) if (child && child.props && BDFDB.ArrayUtils.is(child.props.children) && child.props.children[0] == name) {
child.props.children = [(this.getGuildData(e.instance.props.channel.guild_id) || {}).name || name];

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -58,31 +58,31 @@ module.exports = (_ => {
onLoad() {
this.defaults = {
settings: {
changeInContextMenu: {value:true, inner:true, description:"User ContextMenu"},
changeInChatTextarea: {value:true, inner:true, description:"Chat Textarea"},
changeInChatWindow: {value:true, inner:true, description:"Messages"},
changeInReactions: {value:true, inner:true, description:"Reactions"},
changeInMentions: {value:true, inner:true, description:"Mentions"},
changeInVoiceChat: {value:true, inner:true, description:"Voice Channels"},
changeInMemberList: {value:true, inner:true, description:"Member List"},
changeInRecentDms: {value:true, inner:true, description:"Direct Message Notifications"},
changeInDmsList: {value:true, inner:true, description:"Direct Message List"},
changeInDmHeader: {value:true, inner:true, description:"Direct Message Header"},
changeInDmCalls: {value:true, inner:true, description:"Calls/ScreenShares"},
changeInTyping: {value:true, inner:true, description:"Typing List"},
changeInFriendList: {value:true, inner:true, description:"Friend List"},
changeInInviteList: {value:true, inner:true, description:"Invite List"},
changeInActivity: {value:true, inner:true, description:"Activity Page"},
changeInUserPopout: {value:true, inner:true, description:"User Popouts"},
changeInUserProfile: {value:true, inner:true, description:"User Profile Modal"},
changeInAutoComplete: {value:true, inner:true, description:"Autocomplete Menu"},
changeInAuditLog: {value:true, inner:true, description:"Audit Log"},
changeInEmojiLog: {value:true, inner:true, description:"Emoji Upload Log"},
changeInMemberLog: {value:true, inner:true, description:"Member Log"},
changeInQuickSwitcher: {value:true, inner:true, description:"Quick Switcher"},
changeInSearchPopout: {value:true, inner:true, description:"Search Popout"},
changeInUserAccount: {value:true, inner:true, description:"Your Account Information"},
changeInAppTitle: {value:true, inner:true, description:"Discord App Title (DMs)"}
changeInContextMenu: {value: true, inner: true, description: "User ContextMenu"},
changeInChatTextarea: {value: true, inner: true, description: "Chat Textarea"},
changeInChatWindow: {value: true, inner: true, description: "Messages"},
changeInReactions: {value: true, inner: true, description: "Reactions"},
changeInMentions: {value: true, inner: true, description: "Mentions"},
changeInVoiceChat: {value: true, inner: true, description: "Voice Channels"},
changeInMemberList: {value: true, inner: true, description: "Member List"},
changeInRecentDms: {value: true, inner: true, description: "Direct Message Notifications"},
changeInDmsList: {value: true, inner: true, description: "Direct Message List"},
changeInDmHeader: {value: true, inner: true, description: "Direct Message Header"},
changeInDmCalls: {value: true, inner: true, description: "Calls/ScreenShares"},
changeInTyping: {value: true, inner: true, description: "Typing List"},
changeInFriendList: {value: true, inner: true, description: "Friend List"},
changeInInviteList: {value: true, inner: true, description: "Invite List"},
changeInActivity: {value: true, inner: true, description: "Activity Page"},
changeInUserPopout: {value: true, inner: true, description: "User Popouts"},
changeInUserProfile: {value: true, inner: true, description: "User Profile Modal"},
changeInAutoComplete: {value: true, inner: true, description: "Autocomplete Menu"},
changeInAuditLog: {value: true, inner: true, description: "Audit Log"},
changeInEmojiLog: {value: true, inner: true, description: "Emoji Upload Log"},
changeInMemberLog: {value: true, inner: true, description: "Member Log"},
changeInQuickSwitcher: {value: true, inner: true, description: "Quick Switcher"},
changeInSearchPopout: {value: true, inner: true, description: "Search Popout"},
changeInUserAccount: {value: true, inner: true, description: "Your Account Information"},
changeInAppTitle: {value: true, inner: true, description: "Discord App Title (DMs)"}
}
};
@ -175,7 +175,7 @@ module.exports = (_ => {
onStart() {
let observer = new MutationObserver(_ => {this.changeAppTitle();});
BDFDB.ObserverUtils.connect(this, document.head.querySelector("title"), {name:"appTitleObserver", instance:observer}, {childList:true});
BDFDB.ObserverUtils.connect(this, document.head.querySelector("title"), {name: "appTitleObserver", instance: observer}, {childList: true});
let searchGroupData = BDFDB.ObjectUtils.get(BDFDB.ModuleUtils.findByName("SearchPopoutComponent", false), "exports.GroupData");
if (BDFDB.ObjectUtils.is(searchGroupData)) {
@ -333,7 +333,7 @@ module.exports = (_ => {
if (data && data.name) e.instance.props.nick = data.name;
}
else {
let userName = BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["className", BDFDB.disCN.marginleft8]]});
let userName = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.marginleft8]]});
if (userName) this.changeUserColor(userName, e.instance.props.user.id);
}
}
@ -398,7 +398,7 @@ module.exports = (_ => {
break;
}
if (change) {
let userName = BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["className", BDFDB.disCN.username]]});
let userName = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.username]]});
if (userName) this.changeUserColor(userName, e.instance.props.user.id, {
changeBackground: changeBackground
});
@ -428,7 +428,7 @@ module.exports = (_ => {
if (data && (data.color1 || data.color2 || data.tag)) {
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props: [["className", BDFDB.disCN.userpopoutheadernickname]]});
if (index > -1) {
this.changeUserColor(children[index], e.instance.props.user.id, {changeBackground:true});
this.changeUserColor(children[index], e.instance.props.user.id, {changeBackground: true});
this.injectBadge(children, e.instance.props.user.id, BDFDB.LibraryModules.LastGuildStore.getGuildId(), 2, {
tagClass: BDFDB.disCN.bottagnametag,
inverted: typeof e.instance.getMode == "function" && e.instance.getMode() !== "Normal"
@ -722,7 +722,7 @@ module.exports = (_ => {
}
}
else {
this.changeUserColor(e.returnvalue.props.name, e.instance.props.user.id, {changeBackground: true, guildId:e.instance.props.channel.guild_id});
this.changeUserColor(e.returnvalue.props.name, e.instance.props.user.id, {changeBackground: true, guildId: e.instance.props.channel.guild_id});
this.injectBadge(BDFDB.ObjectUtils.get(e.returnvalue, "props.decorators.props.children"), e.instance.props.user.id, BDFDB.LibraryModules.LastGuildStore.getGuildId(), 2, {
tagClass: BDFDB.disCN.bottagmember
});
@ -849,7 +849,7 @@ module.exports = (_ => {
if (e.instance.props.user && settings.changeInQuickSwitcher) {
if (!e.returnvalue) e.instance.props.user = this.getUserData(e.instance.props.user.id);
else {
let userName = BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["className", BDFDB.disCN.quickswitchresultmatch]]});
let userName = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.quickswitchresultmatch]]});
if (userName) {
let data = changedUsers[e.instance.props.user.id];
if (data && data.name) userName.props.children = data.name;
@ -867,7 +867,7 @@ module.exports = (_ => {
processSearchPopoutUserResult (e) {
if (e.instance.props.result && e.instance.props.result.user && settings.changeInSearchPopout) {
let userName = BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["className", BDFDB.disCN.searchpopoutdisplayednick]]});
let userName = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.searchpopoutdisplayednick]]});
if (userName) {
let data = changedUsers[e.instance.props.result.user.id];
if (data && data.name) userName.props.children = data.name;
@ -884,13 +884,13 @@ module.exports = (_ => {
if (channel && channel.type == BDFDB.DiscordConstants.ChannelTypes.DM) user = BDFDB.LibraryModules.UserStore.getUser(channel.recipients[0]);
}
if (user) {
let userName = BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["className", BDFDB.disCN.callincomingtitle]]});
let userName = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.callincomingtitle]]});
if (userName) {
let data = changedUsers[user.id];
if (data && data.name) userName.props.children = data.name;
this.changeUserColor(userName, user.id);
}
let avatar = BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["className", BDFDB.disCN.callincomingicon]]});
let avatar = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.callincomingicon]]});
if (avatar) avatar.props.src = this.getUserAvatar(user.id);
}
}
@ -1275,8 +1275,8 @@ module.exports = (_ => {
tag: BDFDB.LibraryComponents.FormComponents.FormTitle.Tags.H5,
value: data.ignoreTagColor,
onChange: (value, instance) => {
let colorpicker3ins = BDFDB.ReactUtils.findOwner(instance._reactInternalFiber.return, {props:[["number",3]]});
let colorpicker4ins = BDFDB.ReactUtils.findOwner(instance._reactInternalFiber.return, {props:[["number",4]]});
let colorpicker3ins = BDFDB.ReactUtils.findOwner(instance._reactInternalFiber.return, {props: [["number",3]]});
let colorpicker4ins = BDFDB.ReactUtils.findOwner(instance._reactInternalFiber.return, {props: [["number",4]]});
if (colorpicker3ins) colorpicker3ins.setState({disabled: value});
if (colorpicker4ins) colorpicker4ins.setState({disabled: value});
}

View File

@ -26,7 +26,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -91,7 +91,7 @@ module.exports = (_ => {
processEmojiPicker (e) {
this.loadEmojiList();
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name:"DiversitySelector"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "DiversitySelector"});
if (index > -1) children.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
text: "Emoji Statistics",
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, {
@ -126,7 +126,7 @@ module.exports = (_ => {
className: `${this.name}-table`,
stickyHeader: true,
sortData: false,
columns: [{key:"icon", sortkey:"index", cell:"icon"}, {key:"name", cell:"name"}, {key:"total", cell:"amount", reverse:true}, {key:"global", cell:"amount", reverse:true}, {key:"local", cell:"amount", reverse:true}, {key:"copies", cell:"amount", reverse:true}].map(data => {return {
columns: [{key: "icon", sortkey: "index", cell: "icon"}, {key: "name", cell: "name"}, {key: "total", cell: "amount", reverse: true}, {key: "global", cell: "amount", reverse: true}, {key: "local", cell: "amount", reverse: true}, {key: "copies", cell: "amount", reverse: true}].map(data => {return {
key: data.sortkey || data.key,
sort: true,
reverse: data.reverse,

View File

@ -26,7 +26,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -116,8 +116,8 @@ module.exports = (_ => {
name: "YouTube",
url: "https://www.youtube.com/"
},
rawDescription: result.split(new RegExp(BDFDB.StringUtils.regEscape('<meta property="og:description" content="'), "i"))[1].split('"')[0],
rawTitle: result.split(new RegExp(BDFDB.StringUtils.regEscape('<meta property="og:title" content="'), "i"))[1].split('"')[0],
rawDescription: result.split(new RegExp(BDFDB.StringUtils.regEscape('<meta property="og: description" content="'), "i"))[1].split('"')[0],
rawTitle: result.split(new RegExp(BDFDB.StringUtils.regEscape('<meta property="og: title" content="'), "i"))[1].split('"')[0],
thumbnail: {
url: thumbnail,
proxyURL: thumbnail,

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -85,27 +85,27 @@ module.exports = (_ => {
this.defaults = {
settings: {
addOnlineCount: {value:true, description:"Add an online friend counter to the server list (click to open logs)"},
showDiscriminator: {value:false, description:"Add the user discriminator"},
disableForNew: {value:false, description:"Disable Notifications for newly added Friends:"},
muteOnDND: {value:false, description:"Do not notify me when I am DnD"},
openOnClick: {value:false, description:"Open the DM when you click a Notification"}
addOnlineCount: {value: true, description: "Add an online friend counter to the server list (click to open logs)"},
showDiscriminator: {value: false, description: "Add the user discriminator"},
disableForNew: {value: false, description: "Disable Notifications for newly added Friends: "},
muteOnDND: {value: false, description: "Do not notify me when I am DnD"},
openOnClick: {value: false, description: "Open the DM when you click a Notification"}
},
notificationstrings: {
online: {value:"$user changed status to '$status'", libString:"STATUS_ONLINE", init:true},
mobile: {value:"$user changed status to '$status'", libString:"STATUS_ONLINE_MOBILE", init:true},
idle: {value:"$user changed status to '$status'", libString:"STATUS_IDLE", init:false},
dnd: {value:"$user changed status to '$status'", libString:"STATUS_DND", init:false},
playing: {value:"$user started playing '$game'", statusName:"Playing", init:false},
listening: {value:"$user started listening to '$song'", statusName:"Listening", init:false},
streaming: {value:"$user started streaming '$game'", libString:"STATUS_STREAMING", init:false},
offline: {value:"$user changed status to '$status'", libString:"STATUS_OFFLINE", init:true}
online: {value: "$user changed status to '$status'", libString: "STATUS_ONLINE", init: true},
mobile: {value: "$user changed status to '$status'", libString: "STATUS_ONLINE_MOBILE", init: true},
idle: {value: "$user changed status to '$status'", libString: "STATUS_IDLE", init: false},
dnd: {value: "$user changed status to '$status'", libString: "STATUS_DND", init: false},
playing: {value: "$user started playing '$game'", statusName: "Playing", init: false},
listening: {value: "$user started listening to '$song'", statusName: "Listening", init: false},
streaming: {value: "$user started streaming '$game'", libString: "STATUS_STREAMING", init: false},
offline: {value: "$user changed status to '$status'", libString: "STATUS_OFFLINE", init: true}
},
notificationsounds: {},
amounts: {
toastTime: {value:5, min:1, description:"Amount of seconds a toast notification stays on screen:"},
desktopTime: {value:5, min:1, description:"Amount of seconds a desktop notification stays on screen:"},
checkInterval: {value:10, min:5, description:"Check Users every X seconds:"}
toastTime: {value: 5, min: 1, description: "Amount of seconds a toast notification stays on screen: "},
desktopTime: {value: 5, min: 1, description: "Amount of seconds a desktop notification stays on screen: "},
checkInterval: {value: 10, min: 5, description: "Check Users every X seconds: "}
}
};
@ -136,8 +136,8 @@ module.exports = (_ => {
`;
for (let type in this.defaults.notificationstrings) {
this.defaults.notificationsounds["toast" + type] = {value:{url:null,song:null,mute:false}};
this.defaults.notificationsounds["desktop" + type] = {value:{url:null,song:null,mute:false}};
this.defaults.notificationsounds["toast" + type] = {value: {url: null,song: null,mute: false}};
this.defaults.notificationsounds["desktop" + type] = {value: {url: null,song: null,mute: false}};
}
}
@ -176,7 +176,7 @@ module.exports = (_ => {
BDFDB.PluginUtils.refreshSettingsPanel(this, settingsPanel, collapseStates);
};
let successSavedAudio = (type, parsedUrl, parsedData) => {
if (parsedUrl && parsedData) BDFDB.NotificationUtils.toast(`Sound was saved successfully.`, {type:"success"});
if (parsedUrl && parsedData) BDFDB.NotificationUtils.toast(`Sound was saved successfully.`, {type: "success"});
notificationSounds[type].url = parsedUrl;
notificationSounds[type].song = parsedData;
BDFDB.DataUtils.save(notificationSounds[type], this, "notificationsounds", type);
@ -193,7 +193,7 @@ module.exports = (_ => {
style: {backgroundColor: BDFDB.DiscordConstants.Colors.BRAND},
children: "Toast"
}),
"Notifications for that User:"
"Notifications for that User: "
]
}));
if ("Notification" in window) items.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
@ -205,7 +205,7 @@ module.exports = (_ => {
style: {backgroundColor: BDFDB.DiscordConstants.Colors.STATUS_GREEN},
children: "Desktop"
}),
"Notifications for that User:"
"Notifications for that User: "
]
}));
items.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsList, {
@ -288,12 +288,12 @@ module.exports = (_ => {
nonFriendsData[id] = Object.assign({}, friendsData[id]);
delete friendsData[id];
}
else if (id != BDFDB.UserUtils.me.id) friends.push(Object.assign({}, user, friendsData[id], {key:id, className: friendsData[id].disabled ? "" : (friendsData[id].desktop ? BDFDB.disCN.cardsuccessoutline : BDFDB.disCN.cardbrandoutline)}));
else if (id != BDFDB.UserUtils.me.id) friends.push(Object.assign({}, user, friendsData[id], {key: id, className: friendsData[id].disabled ? "" : (friendsData[id].desktop ? BDFDB.disCN.cardsuccessoutline : BDFDB.disCN.cardbrandoutline)}));
}
}
for (let id in nonFriendsData) {
let user = BDFDB.LibraryModules.UserStore.getUser(id);
if (user && id != BDFDB.UserUtils.me.id) nonFriends.push(Object.assign({}, user, nonFriendsData[id], {key:id, className: nonFriendsData[id].disabled ? "" : (nonFriendsData[id].desktop ? BDFDB.disCN.cardsuccessoutline : BDFDB.disCN.cardbrandoutline)}));
if (user && id != BDFDB.UserUtils.me.id) nonFriends.push(Object.assign({}, user, nonFriendsData[id], {key: id, className: nonFriendsData[id].disabled ? "" : (nonFriendsData[id].desktop ? BDFDB.disCN.cardsuccessoutline : BDFDB.disCN.cardbrandoutline)}));
}
BDFDB.DataUtils.save(friendsData, this, "friends");
@ -343,9 +343,9 @@ module.exports = (_ => {
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Button, {
onClick: _ => {
let userId = settingsPanel.querySelector(`.input-newstranger ` + BDFDB.dotCN.input).value.trim();
if (userId == BDFDB.UserUtils.me.id) BDFDB.NotificationUtils.toast("Are you seriously trying to stalk yourself?", {type:"error"});
else if (friendIds.includes(userId)) BDFDB.NotificationUtils.toast("User is already a friend of yours, please use the 'Friend-List' area to configure them", {type:"error"});
else if (Object.keys(nonFriends).includes(userId)) BDFDB.NotificationUtils.toast("User is already being observed as a 'Stranger'", {type:"error"});
if (userId == BDFDB.UserUtils.me.id) BDFDB.NotificationUtils.toast("Are you seriously trying to stalk yourself?", {type: "error"});
else if (friendIds.includes(userId)) BDFDB.NotificationUtils.toast("User is already a friend of yours, please use the 'Friend-List' area to configure them", {type: "error"});
else if (Object.keys(nonFriends).includes(userId)) BDFDB.NotificationUtils.toast("User is already being observed as a 'Stranger'", {type: "error"});
else {
let user = /.+#[0-9]{4}/.test(userId) ? BDFDB.LibraryModules.UserStore.findByTag(userId.split("#").slice(0, -1).join("#"), userId.split("#").pop()) : BDFDB.LibraryModules.UserStore.getUser(userId);
if (user) {
@ -353,7 +353,7 @@ module.exports = (_ => {
BDFDB.PluginUtils.refreshSettingsPanel(this, settingsPanel, collapseStates);
this.SettingsUpdated = true;
}
else BDFDB.NotificationUtils.toast("Please enter a valid UserID of a user that has been loaded in your client", {type:"error"});
else BDFDB.NotificationUtils.toast("Please enter a valid UserID of a user that has been loaded in your client", {type: "error"});
}
},
children: BDFDB.LanguageUtils.LanguageStrings.ADD
@ -399,7 +399,7 @@ module.exports = (_ => {
plugin: this,
keys: ["notificationstrings", key],
placeholder: this.defaults.notificationstrings[key].value,
label: `${BDFDB.LibraryModules.StringUtils.upperCaseFirstChar(key)} Message:`,
label: `${BDFDB.LibraryModules.StringUtils.upperCaseFirstChar(key)} Message: `,
basis: "70%",
value: notificationStrings[key]
})))
@ -417,7 +417,7 @@ module.exports = (_ => {
direction: BDFDB.LibraryComponents.Flex.Direction.HORIZONTAL,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsLabel, {
label: `${key.split(/(desktop)|(toast)/).filter(n => n).map(n => BDFDB.LibraryModules.StringUtils.upperCaseFirstChar(n)).join("-")} Notification Sound:`,
label: `${key.split(/(desktop)|(toast)/).filter(n => n).map(n => BDFDB.LibraryModules.StringUtils.upperCaseFirstChar(n)).join("-")} Notification Sound: `,
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsItem, {
type: "Switch",
@ -450,7 +450,7 @@ module.exports = (_ => {
onClick: _ => {
let source = settingsPanel.querySelector(`.input-${key}src ` + BDFDB.dotCN.input).value.trim();
if (!source.length) {
BDFDB.NotificationUtils.toast(`Sound file was removed.`, {type:"warn"});
BDFDB.NotificationUtils.toast(`Sound file was removed.`, {type: "warn"});
successSavedAudio(key, source, source);
}
else if (source.indexOf("http") == 0) BDFDB.LibraryRequires.request(source, (error, response, result) => {
@ -461,11 +461,11 @@ module.exports = (_ => {
return;
}
}
BDFDB.NotificationUtils.toast("Use a valid direct link to a video or audio source, they usually end on something like .mp3, .mp4 or .wav", {type:"danger"});
BDFDB.NotificationUtils.toast("Use a valid direct link to a video or audio source, they usually end on something like .mp3, .mp4 or .wav", {type: "danger"});
});
else BDFDB.LibraryRequires.fs.readFile(source, (error, response) => {
if (error) BDFDB.NotificationUtils.toast("Could not fetch file, please make sure the file exists", {type:"danger"});
else successSavedAudio(key, source, `data:audio/mpeg;base64,${response.toString("base64")}`);
if (error) BDFDB.NotificationUtils.toast("Could not fetch file, please make sure the file exists", {type: "danger"});
else successSavedAudio(key, source, `data: audio/mpeg;base64,${response.toString("base64")}`);
});
},
children: BDFDB.LanguageUtils.LanguageStrings.SAVE
@ -530,12 +530,12 @@ module.exports = (_ => {
getStatusWithMobileAndActivity (id, config) {
let statusName = BDFDB.UserUtils.getStatus(id);
let status = {statusName, isActivity:false};
let status = {statusName, isActivity: false};
let activity = BDFDB.UserUtils.getActivity(id);
if (activity && BDFDB.DiscordConstants.ActivityTypes[activity.type]) {
let activityName = BDFDB.DiscordConstants.ActivityTypes[activity.type].toLowerCase();
if (this.defaults.notificationstrings[activityName] && config[activityName]) {
status = Object.assign({statusName:activityName, isActivity:true}, activity);
status = Object.assign({statusName: activityName, isActivity: true}, activity);
if (activityName == "listening" || activityName == "streaming") delete status.name;
}
}
@ -599,7 +599,7 @@ module.exports = (_ => {
};
if (!observedUsers[id].desktop) {
if (!document.querySelector(`.friendnotifications-${id}-toast`)) {
let toast = BDFDB.NotificationUtils.toast(`<div class="toast-inner"><div class="toast-avatar" style="background-image:url(${avatar});"></div><div>${toastString}</div></div>`, {html:true, timeout:toastTime, color:BDFDB.UserUtils.getStatusColor(status.statusName), icon:false, selector:`friendnotifications-${status.statusName}-toast friendnotifications-${id}-toast`});
let toast = BDFDB.NotificationUtils.toast(`<div class="toast-inner"><div class="toast-avatar" style="background-image: url(${avatar});"></div><div>${toastString}</div></div>`, {html: true, timeout: toastTime, color: BDFDB.UserUtils.getStatusColor(status.statusName), icon: false, selector: `friendnotifications-${status.statusName}-toast friendnotifications-${id}-toast`});
toast.addEventListener("click", openChannel);
let notificationsound = notificationSounds["toast" + status.statusName] || {};
if (!notificationsound.mute && notificationsound.song) {
@ -613,7 +613,7 @@ module.exports = (_ => {
let desktopString = string.replace(/\$user/g, `${name}${settings.showDiscriminator ? ("#" + user.discriminator) : ""}`).replace(/\$status/g, libString);
if (status.isActivity) desktopString = desktopString.replace(/\$song|\$game/g, status.name || status.details).replace(/\$artist/g, status.state);
let notificationsound = notificationSounds["desktop" + status.statusName] || {};
BDFDB.NotificationUtils.desktop(desktopString, {icon:avatar, timeout:desktopTime, click:openChannel, silent:notificationsound.mute, sound:notificationsound.song});
BDFDB.NotificationUtils.desktop(desktopString, {icon: avatar, timeout: desktopTime, click: openChannel, silent: notificationsound.mute, sound: notificationsound.song});
}
}
}

View File

@ -25,7 +25,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -53,24 +53,24 @@ module.exports = (_ => {
onLoad() {
this.defaults = {
settings: {
useChromium: {value:false, description:"Use an inbuilt browser window instead of opening your default browser"},
useChromium: {value: false, description: "Use an inbuilt browser window instead of opening your default browser"},
},
engines: {
_all: {value:true, name:BDFDB.LanguageUtils.LanguageStrings.FORM_LABEL_ALL, url:null},
Ask: {value:true, name:"Ask", url:"https://ask.com/web?q=" + textUrlReplaceString},
Bing: {value:true, name:"Bing", url:"https://www.bing.com/search?q=" + textUrlReplaceString},
DogPile: {value:true, name:"DogPile", url:"http://www.dogpile.com/search/web?q=" + textUrlReplaceString},
DuckDuckGo: {value:true, name:"DuckDuckGo", url:"https://duckduckgo.com/?q=" + textUrlReplaceString},
Google: {value:true, name:"Google", url:"https://www.google.com/search?q=" + textUrlReplaceString},
GoogleScholar: {value:true, name:"Google Scholar", url:"https://scholar.google.com/scholar?q=" + textUrlReplaceString},
Quora: {value:true, name:"Quora", url:"https://www.quora.com/search?q=" + textUrlReplaceString},
Qwant: {value:true, name:"Qwant", url:"https://www.qwant.com/?t=all&q=" + textUrlReplaceString},
UrbanDictionary: {value:true, name:"Urban Dictionary", url:"https://www.urbandictionary.com/define.php?term=" + textUrlReplaceString},
Searx: {value:true, name:"Searx", url:"https://searx.info/?q=" + textUrlReplaceString},
WolframAlpha: {value:true, name:"Wolfram Alpha", url:"https://www.wolframalpha.com/input/?i=" + textUrlReplaceString},
Yandex: {value:true, name:"Yandex", url:"https://yandex.com/search/?text=" + textUrlReplaceString},
Yahoo: {value:true, name:"Yahoo", url:"https://search.yahoo.com/search?p=" + textUrlReplaceString},
YouTube: {value:true, name:"YouTube", url:"https://www.youtube.com/results?q=" + textUrlReplaceString}
_all: {value: true, name: BDFDB.LanguageUtils.LanguageStrings.FORM_LABEL_ALL, url: null},
Ask: {value: true, name: "Ask", url: "https://ask.com/web?q=" + textUrlReplaceString},
Bing: {value: true, name: "Bing", url: "https://www.bing.com/search?q=" + textUrlReplaceString},
DogPile: {value: true, name: "DogPile", url: "http://www.dogpile.com/search/web?q=" + textUrlReplaceString},
DuckDuckGo: {value: true, name: "DuckDuckGo", url: "https://duckduckgo.com/?q=" + textUrlReplaceString},
Google: {value: true, name: "Google", url: "https://www.google.com/search?q=" + textUrlReplaceString},
GoogleScholar: {value: true, name: "Google Scholar", url: "https://scholar.google.com/scholar?q=" + textUrlReplaceString},
Quora: {value: true, name: "Quora", url: "https://www.quora.com/search?q=" + textUrlReplaceString},
Qwant: {value: true, name: "Qwant", url: "https://www.qwant.com/?t=all&q=" + textUrlReplaceString},
UrbanDictionary: {value: true, name: "Urban Dictionary", url: "https://www.urbandictionary.com/define.php?term=" + textUrlReplaceString},
Searx: {value: true, name: "Searx", url: "https://searx.info/?q=" + textUrlReplaceString},
WolframAlpha: {value: true, name: "Wolfram Alpha", url: "https://www.wolframalpha.com/input/?i=" + textUrlReplaceString},
Yandex: {value: true, name: "Yandex", url: "https://yandex.com/search/?text=" + textUrlReplaceString},
Yahoo: {value: true, name: "Yahoo", url: "https://search.yahoo.com/search?p=" + textUrlReplaceString},
YouTube: {value: true, name: "YouTube", url: "https://www.youtube.com/results?q=" + textUrlReplaceString}
}
};
}

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -67,11 +67,11 @@ module.exports = (_ => {
const googleLanguages = ["af","am","ar","az","be","bg","bn","bs","ca","ceb","co","cs","cy","da","de","el","en","eo","es","et","eu","fa","fi","fr","fy","ga","gd","gl","gu","ha","haw","hi","hmn","hr","ht","hu","hy","id","ig","is","it","iw","ja","jw","ka","kk","km","kn","ko","ku","ky","la","lb","lo","lt","lv","mg","mi","mk","ml","mn","mr","ms","mt","my","ne","nl","no","ny","or","pa","pl","ps","pt","ro","ru","rw","sd","si","sk","sl","sm","sn","so","sq","sr","st","su","sv","sw","ta","te","tg","th","tk","tl","tr","tt","ug","uk","ur","uz","vi","xh","yi","yo","zh-CN","zu"];
const translationEngines = {
googleapi: {name:"GoogleApi", auto:true, funcName:"googleApiTranslate", languages: googleLanguages},
google: {name:"Google", auto:true, funcName:"googleTranslate", languages: googleLanguages},
itranslate: {name:"iTranslate", auto:true, funcName:"iTranslateTranslate", languages: [...new Set(["af","ar","az","be","bg","bn","bs","ca","ceb","cs","cy","da","de","el","en","eo","es","et","eu","fa","fi","fil","fr","ga","gl","gu","ha","he","hi","hmn","hr","ht","hu","hy","id","ig","is","it","ja","jw","ka","kk","km","kn","ko","la","lo","lt","lv","mg","mi","mk","ml","mn","mr","ms","mt","my","ne","nl","no","ny","pa","pl","pt-BR","pt-PT","ro","ru","si","sk","sl","so","sq","sr","st","su","sv","sw","ta","te","tg","th","tr","uk","ur","uz","vi","we","yi","yo","zh-CN","zh-TW","zu"].concat(googleLanguages))].sort()},
yandex: {name:"Yandex", auto:true, funcName:"yandexTranslate", languages: ["af","am","ar","az","ba","be","bg","bn","bs","ca","ceb","cs","cy","da","de","el","en","eo","es","et","eu","fa","fi","fr","ga","gd","gl","gu","he","hi","hr","ht","hu","hy","id","is","it","ja","jv","ka","kk","km","kn","ko","ky","la","lb","lo","lt","lv","mg","mhr","mi","mk","ml","mn","mr","ms","mt","my","ne","nl","no","pa","pap","pl","pt","ro","ru","si","sk","sl","sq","sr","su","sv","sw","ta","te","tg","th","tl","tr","tt","udm","uk","ur","uz","vi","xh","yi","zh"]},
papago: {name:"Papago", auto:false, funcName:"papagoTranslate", languages: ["en","es","fr","id","ja","ko","th","vi","zh-CN","zh-TW"]}
googleapi: {name: "GoogleApi", auto: true, funcName: "googleApiTranslate", languages: googleLanguages},
google: {name: "Google", auto: true, funcName: "googleTranslate", languages: googleLanguages},
itranslate: {name: "iTranslate", auto: true, funcName: "iTranslateTranslate", languages: [...new Set(["af","ar","az","be","bg","bn","bs","ca","ceb","cs","cy","da","de","el","en","eo","es","et","eu","fa","fi","fil","fr","ga","gl","gu","ha","he","hi","hmn","hr","ht","hu","hy","id","ig","is","it","ja","jw","ka","kk","km","kn","ko","la","lo","lt","lv","mg","mi","mk","ml","mn","mr","ms","mt","my","ne","nl","no","ny","pa","pl","pt-BR","pt-PT","ro","ru","si","sk","sl","so","sq","sr","st","su","sv","sw","ta","te","tg","th","tr","uk","ur","uz","vi","we","yi","yo","zh-CN","zh-TW","zu"].concat(googleLanguages))].sort()},
yandex: {name: "Yandex", auto: true, funcName: "yandexTranslate", languages: ["af","am","ar","az","ba","be","bg","bn","bs","ca","ceb","cs","cy","da","de","el","en","eo","es","et","eu","fa","fi","fr","ga","gd","gl","gu","he","hi","hr","ht","hu","hy","id","is","it","ja","jv","ka","kk","km","kn","ko","ky","la","lb","lo","lt","lv","mg","mhr","mi","mk","ml","mn","mr","ms","mt","my","ne","nl","no","pa","pap","pl","pt","ro","ru","si","sk","sl","sq","sr","su","sv","sw","ta","te","tg","th","tl","tr","tt","udm","uk","ur","uz","vi","xh","yi","zh"]},
papago: {name: "Papago", auto: false, funcName: "papagoTranslate", languages: ["en","es","fr","id","ja","ko","th","vi","zh-CN","zh-TW"]}
};
var languages, translating, isTranslating, translatedMessages, oldMessages;
@ -87,21 +87,21 @@ module.exports = (_ => {
this.defaults = {
settings: {
useChromium: {value:false, description:"Use an inbuilt browser window instead of opening your default browser"},
addTranslateButton: {value:true, description:"Add an translate button to the chatbar"},
sendOriginalMessage: {value:false, description:"Send the original message together with the translation"}
useChromium: {value: false, description: "Use an inbuilt browser window instead of opening your default browser"},
addTranslateButton: {value: true, description: "Add an translate button to the chatbar"},
sendOriginalMessage: {value: false, description: "Send the original message together with the translation"}
},
choices: {
inputContext: {value:"auto", direction:"input", place:"Context", description:"Input Language in received Messages:"},
outputContext: {value:"$discord", direction:"output", place:"Context", description:"Output Language in received Messages:"},
inputMessage: {value:"auto", direction:"input", place:"Message", description:"Input Language in sent Messages:"},
outputMessage: {value:"$discord", direction:"output", place:"Message", description:"Output Language in sent Messages:"}
inputContext: {value: "auto", direction: "input", place: "Context", description: "Input Language in received Messages: "},
outputContext: {value: "$discord", direction: "output", place: "Context", description: "Output Language in received Messages: "},
inputMessage: {value: "auto", direction: "input", place: "Message", description: "Input Language in sent Messages: "},
outputMessage: {value: "$discord", direction: "output", place: "Message", description: "Output Language in sent Messages: "}
},
exceptions: {
wordStart: {value:["!"], max:1, description:"Words starting with any of these will be ignored"}
wordStart: {value: ["!"], max: 1, description: "Words starting with any of these will be ignored"}
},
engines: {
translator: {value:"googleapi", description:"Translation Engine:"}
translator: {value: "googleapi", description: "Translation Engine: "}
}
};
@ -244,7 +244,7 @@ module.exports = (_ => {
let item = BDFDB.DOMUtils.getParent(BDFDB.dotCN.menuitem, event.target);
if (item) {
let 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"});
};
if (foundTranslation && foundInput && foundOutput) {
if (document.querySelector(".googletranslate-tooltip")) {
@ -334,7 +334,7 @@ module.exports = (_ => {
if (settings.addTranslateButton) {
let editor = BDFDB.ReactUtils.findChild(e.returnvalue, {name: "ChannelEditorContainer"});
if (editor && editor.props.type == BDFDB.DiscordConstants.TextareaTypes.NORMAL && !editor.props.disabled) {
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props:[["className", BDFDB.disCN.textareapickerbuttons]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props: [["className", BDFDB.disCN.textareapickerbuttons]]});
if (index > -1 && children[index].props && children[index].props.children) children[index].props.children.unshift(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.PopoutContainer, {
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ChannelTextAreaButton, {
key: "translate-button",
@ -485,7 +485,7 @@ module.exports = (_ => {
choices["output" + place] = input;
BDFDB.DataUtils.save(choices, this, "choices");
for (let selectIns of BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(e._targetInst, {name:["BDFDB_Popout", "BDFDB_SettingsPanel"], up:true}), {name:"BDFDB_Select", all:true, noCopies:true})) if (selectIns && selectIns.props && selectIns.props.id && this.defaults.choices[selectIns.props.id] && this.defaults.choices[selectIns.props.id].place == place) {
for (let selectIns of BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(e._targetInst, {name: ["BDFDB_Popout", "BDFDB_SettingsPanel"], up: true}), {name: "BDFDB_Select", all: true, noCopies: true})) if (selectIns && selectIns.props && selectIns.props.id && this.defaults.choices[selectIns.props.id] && this.defaults.choices[selectIns.props.id].place == place) {
selectIns.props.value = this.defaults.choices[selectIns.props.id].direction == "input" ? output : input;
BDFDB.ReactUtils.forceUpdate(selectIns);
}
@ -501,7 +501,7 @@ module.exports = (_ => {
menuPlacement: inPopout ? BDFDB.LibraryComponents.Select.MenuPlacements.TOP : BDFDB.LibraryComponents.Select.MenuPlacements.BOTTOM,
value: this.getLanguageChoice(key),
id: key,
options: BDFDB.ObjectUtils.toArray(BDFDB.ObjectUtils.map(isOutput ? BDFDB.ObjectUtils.filter(languages, lang => lang.id != "auto") : languages, (lang, id) => {return {value:id, label:this.getLanguageName(lang)}})),
options: BDFDB.ObjectUtils.toArray(BDFDB.ObjectUtils.map(isOutput ? BDFDB.ObjectUtils.filter(languages, lang => lang.id != "auto") : languages, (lang, id) => {return {value: id, label: this.getLanguageName(lang)}})),
searchable: true,
optionRenderer: lang => {
return languages[lang.value] ? BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
@ -540,13 +540,13 @@ module.exports = (_ => {
menuPlacement: inPopout ? BDFDB.LibraryComponents.Select.MenuPlacements.TOP : BDFDB.LibraryComponents.Select.MenuPlacements.BOTTOM,
value: engines[key],
id: key,
options: Object.keys(translationEngines).map(engineKey => {return {value:engineKey, label:translationEngines[engineKey].name}}),
options: Object.keys(translationEngines).map(engineKey => {return {value: engineKey, label: translationEngines[engineKey].name}}),
searchable: true,
onChange: (engine, instance) => {
engines[key] = engine.value;
BDFDB.DataUtils.save(engines, this, "engines");
this.setLanguages();
let popoutInstance = BDFDB.ReactUtils.findOwner(instance, {name: "BDFDB_PopoutContainer", up:true});
let popoutInstance = BDFDB.ReactUtils.findOwner(instance, {name: "BDFDB_PopoutContainer", up: true});
if (popoutInstance) {
popoutInstance.close();
popoutInstance.handleClick();
@ -636,11 +636,11 @@ module.exports = (_ => {
let output = Object.assign({}, languages[this.getLanguageChoice("output", type)]);
if (translate) {
let timer = 0;
toast = BDFDB.NotificationUtils.toast("Translating. Please wait", {timeout:0});
toast = BDFDB.NotificationUtils.toast("Translating. Please wait", {timeout: 0});
toast.interval = BDFDB.TimeUtils.interval(_ => {
if (timer++ > 40) {
finishTranslation("");
BDFDB.NotificationUtils.toast("Failed to translate text. Try another Translate Engine.", {type:"error"});
BDFDB.NotificationUtils.toast("Failed to translate text. Try another Translate Engine.", {type: "error"});
}
else toast.textContent = toast.textContent.indexOf(".....") > -1 ? "Translating. Please wait" : toast.textContent + ".";
}, 500);
@ -664,7 +664,7 @@ module.exports = (_ => {
else {
if (translationEngines[engines.translator] && typeof this[translationEngines[engines.translator].funcName] == "function") {
isTranslating = true;
this[translationEngines[engines.translator].funcName].apply(this, [{input, output, text:newText, specialcase, engine:translationEngines[engines.translator]}, finishTranslation]);
this[translationEngines[engines.translator].funcName].apply(this, [{input, output, text: newText, specialcase, engine: translationEngines[engines.translator]}, finishTranslation]);
}
else finishTranslation();
}
@ -678,7 +678,7 @@ module.exports = (_ => {
googleTranslateWindow.executeJavaScriptSafe(`
require("electron").ipcRenderer.sendTo(${BDFDB.LibraryRequires.electron.remote.getCurrentWindow().webContents.id}, "GTO-translation", [
(document.querySelector(".translation") || {}).innerText,
[(new RegExp("{code:'([^']*)',name:'" + [(new RegExp((window.source_language_detected || "").replace("%1$s", "([A-z]{2,})"), "g")).exec(document.body.innerHTML)].flat()[1] +"'}", "g")).exec(document.body.innerHTML)].flat(10)[1]
[(new RegExp("{code: '([^']*)',name: '" + [(new RegExp((window.source_language_detected || "").replace("%1$s", "([A-z]{2,})"), "g")).exec(document.body.innerHTML)].flat()[1] +"'}", "g")).exec(document.body.innerHTML)].flat(10)[1]
]);
`);
}
@ -708,7 +708,7 @@ module.exports = (_ => {
catch (err) {callback("");}
}
else {
BDFDB.NotificationUtils.toast("Failed to translate text. Translation Server is down or Request Limit per Hour is reached. Try another Translate Engine.", {type:"error"});
BDFDB.NotificationUtils.toast("Failed to translate text. Translation Server is down or Request Limit per Hour is reached. Try another Translate Engine.", {type: "error"});
callback("");
}
});
@ -744,7 +744,7 @@ module.exports = (_ => {
catch (err) {callback("");}
}
else {
BDFDB.NotificationUtils.toast("Failed to translate text. Translation Server is down or API-key outdated. Try another Translate Engine.", {type:"error"});
BDFDB.NotificationUtils.toast("Failed to translate text. Translation Server is down or API-key outdated. Try another Translate Engine.", {type: "error"});
callback("");
}
});
@ -780,7 +780,7 @@ module.exports = (_ => {
else callback("");
}
else {
BDFDB.NotificationUtils.toast("Failed to translate text. Translation Server is down or API-key outdated. Try another Translate Engine.", {type:"error"});
BDFDB.NotificationUtils.toast("Failed to translate text. Translation Server is down or API-key outdated. Try another Translate Engine.", {type: "error"});
callback("");
}
});
@ -808,7 +808,7 @@ module.exports = (_ => {
catch (err) {callback("");}
}
else {
BDFDB.NotificationUtils.toast("Failed to translate text. Translation Server is down, daily limited reached or API-key outdated. Try another Translate Engine.", {type:"error"});
BDFDB.NotificationUtils.toast("Failed to translate text. Translation Server is down, daily limited reached or API-key outdated. Try another Translate Engine.", {type: "error"});
callback("");
}
});
@ -867,7 +867,7 @@ module.exports = (_ => {
}
}
}
else BDFDB.NotificationUtils.toast("Invalid binary format. Only use 0s and 1s.", {type:"error"});
else BDFDB.NotificationUtils.toast("Invalid binary format. Only use 0s and 1s.", {type: "error"});
return string;
}
@ -917,7 +917,7 @@ module.exports = (_ => {
else {
let usedExceptions = BDFDB.ArrayUtils.is(exceptions.wordStart) ? exceptions.wordStart : [];
string.split(" ").forEach(word => {
if (word.indexOf("<@!") == 0 || word.indexOf("<#") == 0 || word.indexOf(":") == 0 || word.indexOf("<:") == 0 || word.indexOf("<a:") == 0 || word.indexOf("@") == 0 || word.indexOf("#") == 0 || usedExceptions.some(n => word.indexOf(n) == 0 && word.length > 1)) {
if (word.indexOf("<@!") == 0 || word.indexOf("<#") == 0 || word.indexOf(":") == 0 || word.indexOf("<:") == 0 || word.indexOf("<a: ") == 0 || word.indexOf("@") == 0 || word.indexOf("#") == 0 || usedExceptions.some(n => word.indexOf(n) == 0 && word.length > 1)) {
newString.push(`[/////${count}]`);
excepts[count] = word;
count++;

View File

@ -26,7 +26,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -105,41 +105,41 @@ module.exports = (_ => {
this.defaults = {
settings: {
resizeImage: {value:true, inner:false, description:"Always resize image to fit the whole image modal"},
addDetails: {value:true, inner:false, description:"Add image details (name, size, amount) in the image modal"},
showAsHeader: {value:true, inner:false, description:"Show image details as a details header above the image in the chat"},
showOnHover: {value:false, inner:false, description:"Show image details as Tooltip in the chat"},
enableGallery: {value:true, inner:false, description:"Display previous/next Images in the same message in the image modal"},
enableZoom: {value:true, inner:false, description:"Create a zoom lense if you press down on an image in the image modal"},
enableCopyImg: {value:true, inner:false, description:"Add a copy image option in the image modal"},
enableSaveImg: {value:true, inner:false, description:"Add a save image as option in the image modal"},
useChromium: {value:false, inner:false, description:"Use an inbuilt browser window instead of opening your default browser"},
addUserAvatarEntry: {value:true, inner:true, description:"User Avatars"},
addGuildIconEntry: {value:true, inner:true, description:"Server Icons"},
addEmojiEntry: {value:true, inner:true, description:"Custom Emojis/Emotes"}
resizeImage: {value: true, inner: false, description: "Always resize image to fit the whole image modal"},
addDetails: {value: true, inner: false, description: "Add image details (name, size, amount) in the image modal"},
showAsHeader: {value: true, inner: false, description: "Show image details as a details header above the image in the chat"},
showOnHover: {value: false, inner: false, description: "Show image details as Tooltip in the chat"},
enableGallery: {value: true, inner: false, description: "Display previous/next Images in the same message in the image modal"},
enableZoom: {value: true, inner: false, description: "Create a zoom lense if you press down on an image in the image modal"},
enableCopyImg: {value: true, inner: false, description: "Add a copy image option in the image modal"},
enableSaveImg: {value: true, inner: false, description: "Add a save image as option in the image modal"},
useChromium: {value: false, inner: false, description: "Use an inbuilt browser window instead of opening your default browser"},
addUserAvatarEntry: {value: true, inner: true, description: "User Avatars"},
addGuildIconEntry: {value: true, inner: true, description: "Server Icons"},
addEmojiEntry: {value: true, inner: true, description: "Custom Emojis/Emotes"}
},
amounts: {
hoverDelay: {value:0, min:0, description:"Image Tooltip delay (in millisec)"}
hoverDelay: {value: 0, min: 0, description: "Image Tooltip delay (in millisec)"}
},
inputs: {
downloadLocation: {value:"", childProps:{type: "file", searchFolders:true}, description:"Download Location"},
downloadLocation: {value: "", childProps: {type: "file", searchFolders: true}, description: "Download Location"},
},
zoomSettings: {
zoomlevel: {value:2, digits:1, minValue: 1, maxValue: 20, unit:"x", label:"ACCESSIBILITY_ZOOM_LEVEL_LABEL"},
lensesize: {value:200, digits:0, minValue: 50, maxValue: 5000, unit:"px", label:"context_lensesize_text"}
zoomlevel: {value: 2, digits: 1, minValue: 1, maxValue: 20, unit: "x", label: "ACCESSIBILITY_ZOOM_LEVEL_LABEL"},
lensesize: {value: 200, digits: 0, minValue: 50, maxValue: 5000, unit: "px", label: "context_lensesize_text"}
},
engines: {
_all: {value:true, name:BDFDB.LanguageUtils.LanguageStrings.FORM_LABEL_ALL, url:null},
Baidu: {value:true, name:"Baidu", url:"http://image.baidu.com/pcdutu?queryImageUrl=" + imgUrlReplaceString},
Bing: {value:true, name:"Bing", url:"https://www.bing.com/images/search?q=imgurl:" + imgUrlReplaceString + "&view=detailv2&iss=sbi&FORM=IRSBIQ"},
Google: {value:true, name:"Google", url:"https://images.google.com/searchbyimage?image_url=" + imgUrlReplaceString},
IQDB: {value:true, name:"IQDB", url:"https://iqdb.org/?url=" + imgUrlReplaceString},
Reddit: {value:true, name:"Reddit", url:"http://karmadecay.com/search?q=" + imgUrlReplaceString},
SauceNAO: {value:true, name:"SauceNAO", url:"https://saucenao.com/search.php?db=999&url=" + imgUrlReplaceString},
Sogou: {value:true, name:"Sogou", url:"http://pic.sogou.com/ris?flag=1&drag=0&query=" + imgUrlReplaceString + "&flag=1"},
TinEye: {value:true, name:"TinEye", url:"https://tineye.com/search?url=" + imgUrlReplaceString},
WhatAnime: {value:true, name:"WhatAnime", url:"https://trace.moe/?url=" + imgUrlReplaceString},
Yandex: {value:true, name:"Yandex", url:"https://yandex.com/images/search?url=" + imgUrlReplaceString + "&rpt=imageview"}
_all: {value: true, name: BDFDB.LanguageUtils.LanguageStrings.FORM_LABEL_ALL, url: null},
Baidu: {value: true, name: "Baidu", url: "http://image.baidu.com/pcdutu?queryImageUrl=" + imgUrlReplaceString},
Bing: {value: true, name: "Bing", url: "https://www.bing.com/images/search?q=imgurl: " + imgUrlReplaceString + "&view=detailv2&iss=sbi&FORM=IRSBIQ"},
Google: {value: true, name: "Google", url: "https://images.google.com/searchbyimage?image_url=" + imgUrlReplaceString},
IQDB: {value: true, name: "IQDB", url: "https://iqdb.org/?url=" + imgUrlReplaceString},
Reddit: {value: true, name: "Reddit", url: "http://karmadecay.com/search?q=" + imgUrlReplaceString},
SauceNAO: {value: true, name: "SauceNAO", url: "https://saucenao.com/search.php?db=999&url=" + imgUrlReplaceString},
Sogou: {value: true, name: "Sogou", url: "http://pic.sogou.com/ris?flag=1&drag=0&query=" + imgUrlReplaceString + "&flag=1"},
TinEye: {value: true, name: "TinEye", url: "https://tineye.com/search?url=" + imgUrlReplaceString},
WhatAnime: {value: true, name: "WhatAnime", url: "https://trace.moe/?url=" + imgUrlReplaceString},
Yandex: {value: true, name: "Yandex", url: "https://yandex.com/images/search?url=" + imgUrlReplaceString + "&rpt=imageview"}
}
};
@ -294,7 +294,7 @@ module.exports = (_ => {
children: [BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormTitle, {
className: BDFDB.disCN.marginbottom4,
tag: BDFDB.LibraryComponents.FormComponents.FormTitle.Tags.H3,
children: "Add additional Context Menu Entry for:"
children: "Add additional Context Menu Entry for: "
})].concat(Object.keys(settings).map(key => this.defaults.settings[key].inner && BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, {
type: "Switch",
plugin: this,
@ -437,11 +437,11 @@ module.exports = (_ => {
action: _ => {
BDFDB.LibraryRequires.request(url, {encoding: null}, (error, response, body) => {
let path = this.getDownloadLocation();
if (error) BDFDB.NotificationUtils.toast(this.labels.toast_saveimage_failed.replace("{{path}}", path), {type:"error"});
if (error) BDFDB.NotificationUtils.toast(this.labels.toast_saveimage_failed.replace("{{path}}", path), {type: "error"});
else {
BDFDB.LibraryRequires.fs.writeFile(this.getFileName(path, url.split("/").pop().split(".").slice(0, -1).join("."), response.headers["content-type"].split("/").pop().split("+")[0], 0), body, error => {
if (error) BDFDB.NotificationUtils.toast(this.labels.toast_saveimage_failed.replace("{{path}}", path), {type:"error"});
else BDFDB.NotificationUtils.toast(this.labels.toast_saveimage_success.replace("{{path}}", path), {type:"success"});
if (error) BDFDB.NotificationUtils.toast(this.labels.toast_saveimage_failed.replace("{{path}}", path), {type: "error"});
else BDFDB.NotificationUtils.toast(this.labels.toast_saveimage_success.replace("{{path}}", path), {type: "success"});
});
}
});
@ -530,7 +530,7 @@ module.exports = (_ => {
}, BDFDB.ObjectUtils.extract(this.defaults.zoomSettings[type], "digits", "minValue", "maxValue"))))
}));
};
let isVideo = (typeof e.instance.props.children == "function" && e.instance.props.children(Object.assign({}, e.instance.props, {size: e.instance.props})) || {type:{}}).type.displayName == "Video";
let isVideo = (typeof e.instance.props.children == "function" && e.instance.props.children(Object.assign({}, e.instance.props, {size: e.instance.props})) || {type: {}}).type.displayName == "Video";
children[index] = BDFDB.ReactUtils.createElement("span", {
className: BDFDB.disCN._imageutilitiesoperations,
children: [
@ -737,13 +737,13 @@ module.exports = (_ => {
releasing();
}
}));
document.removeImageUtilitiesZoomObserver.observe(document.body, {subtree:true, childList:true});
document.removeImageUtilitiesZoomObserver.observe(document.body, {subtree: true, childList: true});
});
}
}
else if (e.returnvalue) {
if (settings.showOnHover && e.instance.props.original && e.instance.props.src.indexOf("https://media.discordapp.net/attachments") == 0 && typeof e.returnvalue.props.children == "function") {
let attachment = BDFDB.ReactUtils.findValue(e.instance, "attachment", {up:true});
let attachment = BDFDB.ReactUtils.findValue(e.instance, "attachment", {up: true});
if (attachment) {
let renderChildren = e.returnvalue.props.children;
e.returnvalue.props.children = (...args) => {

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -62,23 +62,23 @@ module.exports = (_ => {
this.defaults = {
settings: {
addInUserPopout: {value:true, description:"Add in User Popouts"},
addInUserProfil: {value:true, description:"Add in User Profile Modal"},
displayText: {value:true, description:"Display 'Joined on' text in the timestamp"},
displayTime: {value:true, description:"Display the time in the timestamp"},
displayDate: {value:true, description:"Display the date in the timestamp"},
cutSeconds: {value:false, description:"Cut off seconds of the time"},
forceZeros: {value:false, description:"Force leading zeros"},
otherOrder: {value:false, description:"Show the time before the date"}
addInUserPopout: {value: true, description: "Add in User Popouts"},
addInUserProfil: {value: true, description: "Add in User Profile Modal"},
displayText: {value: true, description: "Display 'Joined on' text in the timestamp"},
displayTime: {value: true, description: "Display the time in the timestamp"},
displayDate: {value: true, description: "Display the date in the timestamp"},
cutSeconds: {value: false, description: "Cut off seconds of the time"},
forceZeros: {value: false, description: "Force leading zeros"},
otherOrder: {value: false, description: "Show the time before the date"}
},
choices: {
joinedAtDateLang: {value:"$discord", description:"Joined At Date Format"}
joinedAtDateLang: {value: "$discord", description: "Joined At Date Format"}
},
formats: {
ownFormat: {value:"$hour:$minute:$second, $day.$month.$year", description:"Own Format"}
ownFormat: {value: "$hour: $minute: $second, $day.$month.$year", description: "Own Format"}
},
amounts: {
maxDaysAgo: {value:0, min:0, description:"Maximum count of days displayed in the $daysago placeholder", note:"0 equals no limit"}
maxDaysAgo: {value: 0, min: 0, description: "Maximum count of days displayed in the $daysago placeholder", note: "0 equals no limit"}
}
};
@ -119,7 +119,7 @@ module.exports = (_ => {
value: settings[key],
onChange: (value, instance) => {
settings[key] = value;
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name:"BDFDB_SettingsPanel", up:true}), {name:"BDFDB_Select", all:true, noCopies:true}));
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name: "BDFDB_SettingsPanel", up: true}), {name: "BDFDB_Select", all: true, noCopies: true}));
}
}))
}));
@ -134,7 +134,7 @@ module.exports = (_ => {
label: this.defaults.choices[key].description,
basis: "70%",
value: choices[key],
options: BDFDB.ObjectUtils.toArray(BDFDB.ObjectUtils.map(languages, (lang, id) => {return {value:id, label:lang.name}})),
options: BDFDB.ObjectUtils.toArray(BDFDB.ObjectUtils.map(languages, (lang, id) => {return {value: id, label: lang.name}})),
searchable: true,
optionRenderer: lang => {
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
@ -184,7 +184,7 @@ module.exports = (_ => {
value: formats[key],
onChange: (value, instance) => {
formats[key] = value;
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name:"BDFDB_SettingsPanel", up:true}), {name:"BDFDB_Select", all:true, noCopies:true}));
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name: "BDFDB_SettingsPanel", up: true}), {name: "BDFDB_Select", all: true, noCopies: true}));
}
}))).concat(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormDivider, {
className: BDFDB.disCN.marginbottom8

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -62,23 +62,23 @@ module.exports = (_ => {
this.defaults = {
settings: {
addInUserPopout: {value:true, description:"Add in User Popouts"},
addInUserProfil: {value:true, description:"Add in User Profile Modal"},
displayText: {value:true, description:"Display 'Last message on' text in the timestamp"},
displayTime: {value:true, description:"Display the time in the timestamp"},
displayDate: {value:true, description:"Display the date in the timestamp"},
cutSeconds: {value:false, description:"Cut off seconds of the time"},
forceZeros: {value:false, description:"Force leading zeros"},
otherOrder: {value:false, description:"Show the time before the date"}
addInUserPopout: {value: true, description: "Add in User Popouts"},
addInUserProfil: {value: true, description: "Add in User Profile Modal"},
displayText: {value: true, description: "Display 'Last message on' text in the timestamp"},
displayTime: {value: true, description: "Display the time in the timestamp"},
displayDate: {value: true, description: "Display the date in the timestamp"},
cutSeconds: {value: false, description: "Cut off seconds of the time"},
forceZeros: {value: false, description: "Force leading zeros"},
otherOrder: {value: false, description: "Show the time before the date"}
},
choices: {
lastMessageDateLang: {value:"$discord", description:"Last Message Date Format"}
lastMessageDateLang: {value: "$discord", description: "Last Message Date Format"}
},
formats: {
ownFormat: {value:"$hour:$minute:$second, $day.$month.$year", description:"Own Format"}
ownFormat: {value: "$hour: $minute: $second, $day.$month.$year", description: "Own Format"}
},
amounts: {
maxDaysAgo: {value:0, min:0, description:"Maximum count of days displayed in the $daysago placeholder", note:"0 equals no limit"}
maxDaysAgo: {value: 0, min: 0, description: "Maximum count of days displayed in the $daysago placeholder", note: "0 equals no limit"}
}
};
@ -129,7 +129,7 @@ module.exports = (_ => {
value: settings[key],
onChange: (value, instance) => {
settings[key] = value;
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name:"BDFDB_SettingsPanel", up:true}), {name:"BDFDB_Select", all:true, noCopies:true}));
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name: "BDFDB_SettingsPanel", up: true}), {name: "BDFDB_Select", all: true, noCopies: true}));
}
}))
}));
@ -144,7 +144,7 @@ module.exports = (_ => {
label: this.defaults.choices[key].description,
basis: "70%",
value: choices[key],
options: BDFDB.ObjectUtils.toArray(BDFDB.ObjectUtils.map(languages, (lang, id) => {return {value:id, label:lang.name}})),
options: BDFDB.ObjectUtils.toArray(BDFDB.ObjectUtils.map(languages, (lang, id) => {return {value: id, label: lang.name}})),
searchable: true,
optionRenderer: lang => {
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
@ -194,7 +194,7 @@ module.exports = (_ => {
value: formats[key],
onChange: (value, instance) => {
formats[key] = value;
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name:"BDFDB_SettingsPanel", up:true}), {name:"BDFDB_Select", all:true, noCopies:true}));
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name: "BDFDB_SettingsPanel", up: true}), {name: "BDFDB_Select", all: true, noCopies: true}));
}
}))).concat(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormDivider, {
className: BDFDB.disCN.marginbottom8

View File

@ -30,7 +30,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -59,21 +59,21 @@ module.exports = (_ => {
onLoad() {
this.defaults = {
settings: {
"addHints": {value:true, description:"Add keycombo hints to contextmenus:"},
"clearOnEscape": {value:true, description:"Clear chat input when Escape is pressed:"}
"addHints": {value: true, description: "Add keycombo hints to contextmenus: "},
"clearOnEscape": {value: true, description: "Clear chat input when Escape is pressed: "}
},
toasts: {},
bindings: {
"Edit_Message": {name:"Edit Message", func:this.doEdit, value:{click:1, keycombo:[]} },
"Delete_Message": {name:"Delete Message", func:this.doDelete, value:{click:0, keycombo:[46]} },
"Pin/Unpin_Message": {name:"Pin/Unpin Message", func:this.doPinUnPin, value:{click:0, keycombo:[17]} },
"React_to_Message": {name:"Open React Menu", func:this.doOpenReact, value:{click:0, keycombo:[17,83]} },
"Copy_Raw": {name:"Copy raw Message", func:this.doCopyRaw, value:{click:0, keycombo:[17,68]} },
"Copy_Link": {name:"Copy Message Link", func:this.doCopyLink, value:{click:0, keycombo:[17,81]} },
"Quote_Message": {name:"Quote Message", func:this.doQuote, value:{click:0, keycombo:[17,87]} },
"__Note_Message": {name:"Note Message", func:this.doNote, value:{click:0, keycombo:[16]}, plugin:"PersonalPins"},
"__Translate_Message": {name:"Translate Message", func:this.doTranslate, value:{click:0, keycombo:[20]}, plugin:"GoogleTranslateOption"},
"__Reveal_Spoilers": {name:"Reveal All Spoilers", func:this.doReveal, value:{click:0, keycombo:[17,74]}, plugin:"RevealAllSpoilersOption"}
"Edit_Message": {name: "Edit Message", func: this.doEdit, value: {click: 1, keycombo: []} },
"Delete_Message": {name: "Delete Message", func: this.doDelete, value: {click: 0, keycombo: [46]} },
"Pin/Unpin_Message": {name: "Pin/Unpin Message", func: this.doPinUnPin, value: {click: 0, keycombo: [17]} },
"React_to_Message": {name: "Open React Menu", func: this.doOpenReact, value: {click: 0, keycombo: [17,83]} },
"Copy_Raw": {name: "Copy raw Message", func: this.doCopyRaw, value: {click: 0, keycombo: [17,68]} },
"Copy_Link": {name: "Copy Message Link", func: this.doCopyLink, value: {click: 0, keycombo: [17,81]} },
"Quote_Message": {name: "Quote Message", func: this.doQuote, value: {click: 0, keycombo: [17,87]} },
"__Note_Message": {name: "Note Message", func: this.doNote, value: {click: 0, keycombo: [16]}, plugin: "PersonalPins"},
"__Translate_Message": {name: "Translate Message", func: this.doTranslate, value: {click: 0, keycombo: [20]}, plugin: "GoogleTranslateOption"},
"__Reveal_Spoilers": {name: "Reveal All Spoilers", func: this.doReveal, value: {click: 0, keycombo: [17,74]}, plugin: "RevealAllSpoilersOption"}
}
};
@ -86,7 +86,7 @@ module.exports = (_ => {
for (let type in this.defaults.bindings) {
let nativeAction = type.indexOf("__") != 0;
this.defaults.settings[type] = {value: nativeAction};
if (nativeAction) this.defaults.toasts[type] = {value:type != "Edit_Message" && type != "React_to_Message" && type != "Quote_Message"};
if (nativeAction) this.defaults.toasts[type] = {value: type != "Edit_Message" && type != "React_to_Message" && type != "Quote_Message"};
}
}
@ -164,7 +164,7 @@ module.exports = (_ => {
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Select, {
value: bindings[action].click,
options: clickMap.map((label, i) => {return {value:i, label:label}}),
options: clickMap.map((label, i) => {return {value: i, label: label}}),
onChange: choice => {
bindings[action].click = choice.value;
BDFDB.DataUtils.save(bindings, this, "bindings");
@ -298,7 +298,7 @@ module.exports = (_ => {
let channel = BDFDB.LibraryModules.ChannelStore.getChannel(message.channel_id);
if ((channel && BDFDB.UserUtils.can("MANAGE_MESSAGES")) || message.author.id == BDFDB.UserUtils.me.id && message.type != 1 && message.type != 2 && message.type != 3) {
BDFDB.LibraryModules.MessageUtils.deleteMessage(message.channel_id, message.id, message.state != "SENT");
if (toasts[action]) BDFDB.NotificationUtils.toast("Message has been deleted.", {type:"success"});
if (toasts[action]) BDFDB.NotificationUtils.toast("Message has been deleted.", {type: "success"});
}
}
}
@ -306,7 +306,7 @@ module.exports = (_ => {
doEdit ({messageDiv, message}, action) {
if (message.author.id == BDFDB.UserUtils.me.id && !messageDiv.querySelector("textarea")) {
BDFDB.LibraryModules.MessageUtils.startEditMessage(message.channel_id, message.id, message.content);
if (toasts[action]) BDFDB.NotificationUtils.toast("Started editing.", {type:"success"});
if (toasts[action]) BDFDB.NotificationUtils.toast("Started editing.", {type: "success"});
}
}
@ -314,7 +314,7 @@ module.exports = (_ => {
let reactButton = messageDiv.querySelector(`${BDFDB.dotCN.messagetoolbarbutton}[aria-label="${BDFDB.LanguageUtils.LanguageStrings.ADD_REACTION}"]`);
if (reactButton) {
reactButton.click();
if (toasts[action]) BDFDB.NotificationUtils.toast("Reaction popout has been opened.", {type:"success"});
if (toasts[action]) BDFDB.NotificationUtils.toast("Reaction popout has been opened.", {type: "success"});
}
}
@ -324,11 +324,11 @@ module.exports = (_ => {
if (channel && (channel.type == 1 || channel.type == 3 || BDFDB.UserUtils.can("MANAGE_MESSAGES")) && message.type == 0) {
if (message.pinned) {
BDFDB.LibraryModules.MessagePinUtils.unpinMessage(channel, message.id);
if (toasts[action]) BDFDB.NotificationUtils.toast("Message has been unpinned.", {type:"error"});
if (toasts[action]) BDFDB.NotificationUtils.toast("Message has been unpinned.", {type: "error"});
}
else {
BDFDB.LibraryModules.MessagePinUtils.pinMessage(channel, message.id);
if (toasts[action]) BDFDB.NotificationUtils.toast("Message has been pinned.", {type:"success"});
if (toasts[action]) BDFDB.NotificationUtils.toast("Message has been pinned.", {type: "success"});
}
}
}
@ -336,8 +336,8 @@ module.exports = (_ => {
doCopyRaw ({messageDiv, message}, action) {
if (message.content) {
BDFDB.LibraryRequires.electron.clipboard.write({text:message.content});
if (toasts[action]) BDFDB.NotificationUtils.toast("Raw message content has been copied.", {type:"success"});
BDFDB.LibraryRequires.electron.clipboard.write({text: message.content});
if (toasts[action]) BDFDB.NotificationUtils.toast("Raw message content has been copied.", {type: "success"});
}
}
@ -345,7 +345,7 @@ module.exports = (_ => {
let channel = BDFDB.LibraryModules.ChannelStore.getChannel(message.channel_id);
if (channel) {
BDFDB.LibraryModules.MessageManageUtils.copyLink(channel, message);
if (toasts[action]) BDFDB.NotificationUtils.toast("Messagelink has been copied.", {type:"success"});
if (toasts[action]) BDFDB.NotificationUtils.toast("Messagelink has been copied.", {type: "success"});
}
}
@ -353,7 +353,7 @@ module.exports = (_ => {
let channel = BDFDB.LibraryModules.ChannelStore.getChannel(message.channel_id);
if (channel && BDFDB.LibraryModules.QuoteUtils.canQuote(message, channel)) {
BDFDB.LibraryModules.MessageManageUtils.quoteMessage(channel, message);
if (toasts[action]) BDFDB.NotificationUtils.toast("Quote has been created.", {type:"success"});
if (toasts[action]) BDFDB.NotificationUtils.toast("Quote has been created.", {type: "success"});
}
}
@ -383,8 +383,8 @@ module.exports = (_ => {
if (key == 27 && settings.clearOnEscape) {
let chatform = BDFDB.DOMUtils.getParent(BDFDB.dotCN.chatform, target);
if (chatform) {
let instance = BDFDB.ReactUtils.findOwner(chatform, {name:"ChannelTextAreaForm"}) || BDFDB.ReactUtils.findOwner(chatform, {name:"ChannelTextAreaForm", up:true});
if (instance) instance.setState({textValue:"", richValue:BDFDB.LibraryModules.SlateUtils.deserialize("")});
let instance = BDFDB.ReactUtils.findOwner(chatform, {name: "ChannelTextAreaForm"}) || BDFDB.ReactUtils.findOwner(chatform, {name: "ChannelTextAreaForm", up: true});
if (instance) instance.setState({textValue: "", richValue: BDFDB.LibraryModules.SlateUtils.deserialize("")});
}
}
BDFDB.TimeUtils.timeout(_ => {BDFDB.ArrayUtils.remove(firedEvents, name, true)});

View File

@ -35,7 +35,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -66,44 +66,44 @@ module.exports = (_ => {
/* NEVER CHANGE THE SRC LINKS IN THE PLUGIN FILE, TO ADD NEW SOUNDS ADD THEM IN THE SETTINGS GUI IN THE PLUGINS PAGE */
const types = {
"message1": {implemented:true, name:"New Chatmessage", src:"/assets/dd920c06a01e5bb8b09678581e29d56f.mp3", mute:true, focus:null, include:true},
"dm": {implemented:true, name:"Direct Message", src:"/assets/84c9fa3d07da865278bd77c97d952db4.mp3", mute:true, focus:true, include:false},
"mentioned": {implemented:true, name:"Mentioned", src:"/assets/a5f42064e8120e381528b14fd3188b72.mp3", mute:true, focus:true, include:false},
"role": {implemented:true, name:"Mentioned (role)", src:"/assets/a5f42064e8120e381528b14fd3188b72.mp3", mute:true, focus:true, include:false},
"everyone": {implemented:true, name:"Mentioned (@everyone)", src:"/assets/a5f42064e8120e381528b14fd3188b72.mp3", mute:true, focus:true, include:false},
"here": {implemented:true, name:"Mentioned (@here)", src:"/assets/a5f42064e8120e381528b14fd3188b72.mp3", mute:true, focus:true, include:false},
"deafen": {implemented:true, name:"Voicechat Deafen", src:"/assets/e4d539271704b87764dc465b1a061abd.mp3", mute:false, focus:null, include:true},
"mute": {implemented:true, name:"Voicechat Mute", src:"/assets/429d09ee3b86e81a75b5e06d3fb482be.mp3", mute:false, focus:null, include:true},
"disconnect": {implemented:true, name:"Voicechat Disconnect", src:"/assets/7e125dc075ec6e5ae796e4c3ab83abb3.mp3", mute:false, focus:null, include:true},
"undeafen": {implemented:true, name:"Voicechat Undeafen", src:"/assets/5a000a0d4dff083d12a1d4fc2c7cbf66.mp3", mute:false, focus:null, include:true},
"unmute": {implemented:true, name:"Voicechat Unmute", src:"/assets/43805b9dd757ac4f6b9b58c1a8ee5f0d.mp3", mute:false, focus:null, include:true},
"user_join": {implemented:true, name:"Voicechat User Joined", src:"/assets/5dd43c946894005258d85770f0d10cff.mp3", mute:false, focus:null, include:true},
"user_leave": {implemented:true, name:"Voicechat User Left", src:"/assets/4fcfeb2cba26459c4750e60f626cebdc.mp3", mute:false, focus:null, include:true},
"user_moved": {implemented:true, name:"Voicechat User Moved", src:"/assets/e81d11590762728c1b811eadfa5be766.mp3", mute:false, focus:null, include:true},
"reconnect": {implemented:false, name:"Voicechat Reconnect", src:"/assets/471cfd0005b112ff857705e894bf41a6.mp3", mute:true, focus:null, include:true},
"ptt_start": {implemented:true, name:"Push2Talk Start", src:"/assets/8b63833c8d252fedba6b9c4f2517c705.mp3", mute:false, focus:null, include:true},
"ptt_stop": {implemented:true, name:"Push2Talk Stop", src:"/assets/74ab980d6890a0fa6aa0336182f9f620.mp3", mute:false, focus:null, include:true},
"call_calling": {implemented:true, name:"Outgoing Call", src:"/assets/c6e92752668dde4eee5923d70441579f.mp3", mute:false, focus:null, include:true},
"call_ringing": {implemented:true, name:"Incoming Call", src:"/assets/84a1b4e11d634dbfa1e5dd97a96de3ad.mp3", mute:true, focus:null, include:true},
"call_ringing_beat": {implemented:false, name:"Incoming Call Beat", src:"/assets/b9411af07f154a6fef543e7e442e4da9.mp3", mute:true, focus:null, include:true},
"call_ringing_halloween": {implemented:false, name:"Incoming Call Halloween", src:"/assets/bceeb2ba92c01584dcaafc957f769bae.mp3", mute:true, focus:null, include:true},
"stream_started": {implemented:true, name:"Stream Started", src:"/assets/9ca817f41727edc1b2f1bc4f1911107c.mp3", mute:false, focus:null, include:true},
"stream_ended": {implemented:true, name:"Stream Ended", src:"/assets/4e30f98aa537854f79f49a76af822bbc.mp3", mute:false, focus:null, include:true},
"stream_user_joined": {implemented:true, name:"Stream User Joined", src:"/assets/5827bbf9a67c61cbb0e02ffbf434b654.mp3", mute:false, focus:null, include:true},
"stream_user_left": {implemented:true, name:"Stream User Left", src:"/assets/7cdcdcbc426cc43583365a671c24b740.mp3", mute:false, focus:null, include:true},
"ddr-down": {implemented:true, name:"HotKeys Window Down", src:"/assets/71f048f8aa7d4b24bf4268a87cbbb192.mp3", mute:false, focus:null, include:true},
"ddr-left": {implemented:true, name:"HotKeys Window Left", src:"/assets/1de04408e62b5d52ae3ebbb91e9e1978.mp3", mute:false, focus:null, include:true},
"ddr-right": {implemented:true, name:"HotKeys Window Right", src:"/assets/2c0433f93db8449e4a82b76dc520cb29.mp3", mute:false, focus:null, include:true},
"ddr-up": {implemented:true, name:"HotKeys Window Up", src:"/assets/68472713f7a62c7c37e0a6a5d5a1faeb.mp3", mute:false, focus:null, include:true},
"mention1": {implemented:false, name:"Mention Ping", src:"/assets/fa4d62c3cbc80733bf1f01b9c6f181de.mp3", mute:true, focus:null, include:true},
"mention2": {implemented:false, name:"Mention Ping 2", src:"/assets/a5f42064e8120e381528b14fd3188b72.mp3", mute:true, focus:null, include:true},
"mention3": {implemented:false, name:"Mention Ping 3", src:"/assets/84c9fa3d07da865278bd77c97d952db4.mp3", mute:true, focus:null, include:true},
"message2": {implemented:false, name:"New Chatmessage 2", src:"/assets/15fe810f6cfab609c7fcda61652b9b34.mp3", mute:true, focus:null, include:true},
"message3": {implemented:false, name:"New Chatmessage 3", src:"/assets/53ce6a92d3c233e8b4ac529d34d374e4.mp3", mute:true, focus:null, include:true},
"human_man": {implemented:false, name:"Human Man Voice", src:"/assets/a37dcd6272ae41cf49295d58c9806fe3.mp3", mute:true, focus:null, include:true},
"robot_man": {implemented:false, name:"Robot Man Voice", src:"/assets/66598bea6e59eb8acdf32cf2d9d75ba9.mp3", mute:true, focus:null, include:true},
"discodo": {implemented:false, name:"Discodo Launch", src:"/assets/ae7d16bb2eea76b9b9977db0fad66658.mp3", mute:true, focus:null, include:true},
"overlayunlock": {implemented:false, name:"Overlay Unlocked", src:"/assets/ad322ffe0a88436296158a80d5d11baa.mp3", mute:true, focus:null, include:true}
"message1": {implemented: true, name: "New Chatmessage", src: "/assets/dd920c06a01e5bb8b09678581e29d56f.mp3", mute: true, focus: null, include: true},
"dm": {implemented: true, name: "Direct Message", src: "/assets/84c9fa3d07da865278bd77c97d952db4.mp3", mute: true, focus: true, include: false},
"mentioned": {implemented: true, name: "Mentioned", src: "/assets/a5f42064e8120e381528b14fd3188b72.mp3", mute: true, focus: true, include: false},
"role": {implemented: true, name: "Mentioned (role)", src: "/assets/a5f42064e8120e381528b14fd3188b72.mp3", mute: true, focus: true, include: false},
"everyone": {implemented: true, name: "Mentioned (@everyone)", src: "/assets/a5f42064e8120e381528b14fd3188b72.mp3", mute: true, focus: true, include: false},
"here": {implemented: true, name: "Mentioned (@here)", src: "/assets/a5f42064e8120e381528b14fd3188b72.mp3", mute: true, focus: true, include: false},
"deafen": {implemented: true, name: "Voicechat Deafen", src: "/assets/e4d539271704b87764dc465b1a061abd.mp3", mute: false, focus: null, include: true},
"mute": {implemented: true, name: "Voicechat Mute", src: "/assets/429d09ee3b86e81a75b5e06d3fb482be.mp3", mute: false, focus: null, include: true},
"disconnect": {implemented: true, name: "Voicechat Disconnect", src: "/assets/7e125dc075ec6e5ae796e4c3ab83abb3.mp3", mute: false, focus: null, include: true},
"undeafen": {implemented: true, name: "Voicechat Undeafen", src: "/assets/5a000a0d4dff083d12a1d4fc2c7cbf66.mp3", mute: false, focus: null, include: true},
"unmute": {implemented: true, name: "Voicechat Unmute", src: "/assets/43805b9dd757ac4f6b9b58c1a8ee5f0d.mp3", mute: false, focus: null, include: true},
"user_join": {implemented: true, name: "Voicechat User Joined", src: "/assets/5dd43c946894005258d85770f0d10cff.mp3", mute: false, focus: null, include: true},
"user_leave": {implemented: true, name: "Voicechat User Left", src: "/assets/4fcfeb2cba26459c4750e60f626cebdc.mp3", mute: false, focus: null, include: true},
"user_moved": {implemented: true, name: "Voicechat User Moved", src: "/assets/e81d11590762728c1b811eadfa5be766.mp3", mute: false, focus: null, include: true},
"reconnect": {implemented: false, name: "Voicechat Reconnect", src: "/assets/471cfd0005b112ff857705e894bf41a6.mp3", mute: true, focus: null, include: true},
"ptt_start": {implemented: true, name: "Push2Talk Start", src: "/assets/8b63833c8d252fedba6b9c4f2517c705.mp3", mute: false, focus: null, include: true},
"ptt_stop": {implemented: true, name: "Push2Talk Stop", src: "/assets/74ab980d6890a0fa6aa0336182f9f620.mp3", mute: false, focus: null, include: true},
"call_calling": {implemented: true, name: "Outgoing Call", src: "/assets/c6e92752668dde4eee5923d70441579f.mp3", mute: false, focus: null, include: true},
"call_ringing": {implemented: true, name: "Incoming Call", src: "/assets/84a1b4e11d634dbfa1e5dd97a96de3ad.mp3", mute: true, focus: null, include: true},
"call_ringing_beat": {implemented: false, name: "Incoming Call Beat", src: "/assets/b9411af07f154a6fef543e7e442e4da9.mp3", mute: true, focus: null, include: true},
"call_ringing_halloween": {implemented: false, name: "Incoming Call Halloween", src: "/assets/bceeb2ba92c01584dcaafc957f769bae.mp3", mute: true, focus: null, include: true},
"stream_started": {implemented: true, name: "Stream Started", src: "/assets/9ca817f41727edc1b2f1bc4f1911107c.mp3", mute: false, focus: null, include: true},
"stream_ended": {implemented: true, name: "Stream Ended", src: "/assets/4e30f98aa537854f79f49a76af822bbc.mp3", mute: false, focus: null, include: true},
"stream_user_joined": {implemented: true, name: "Stream User Joined", src: "/assets/5827bbf9a67c61cbb0e02ffbf434b654.mp3", mute: false, focus: null, include: true},
"stream_user_left": {implemented: true, name: "Stream User Left", src: "/assets/7cdcdcbc426cc43583365a671c24b740.mp3", mute: false, focus: null, include: true},
"ddr-down": {implemented: true, name: "HotKeys Window Down", src: "/assets/71f048f8aa7d4b24bf4268a87cbbb192.mp3", mute: false, focus: null, include: true},
"ddr-left": {implemented: true, name: "HotKeys Window Left", src: "/assets/1de04408e62b5d52ae3ebbb91e9e1978.mp3", mute: false, focus: null, include: true},
"ddr-right": {implemented: true, name: "HotKeys Window Right", src: "/assets/2c0433f93db8449e4a82b76dc520cb29.mp3", mute: false, focus: null, include: true},
"ddr-up": {implemented: true, name: "HotKeys Window Up", src: "/assets/68472713f7a62c7c37e0a6a5d5a1faeb.mp3", mute: false, focus: null, include: true},
"mention1": {implemented: false, name: "Mention Ping", src: "/assets/fa4d62c3cbc80733bf1f01b9c6f181de.mp3", mute: true, focus: null, include: true},
"mention2": {implemented: false, name: "Mention Ping 2", src: "/assets/a5f42064e8120e381528b14fd3188b72.mp3", mute: true, focus: null, include: true},
"mention3": {implemented: false, name: "Mention Ping 3", src: "/assets/84c9fa3d07da865278bd77c97d952db4.mp3", mute: true, focus: null, include: true},
"message2": {implemented: false, name: "New Chatmessage 2", src: "/assets/15fe810f6cfab609c7fcda61652b9b34.mp3", mute: true, focus: null, include: true},
"message3": {implemented: false, name: "New Chatmessage 3", src: "/assets/53ce6a92d3c233e8b4ac529d34d374e4.mp3", mute: true, focus: null, include: true},
"human_man": {implemented: false, name: "Human Man Voice", src: "/assets/a37dcd6272ae41cf49295d58c9806fe3.mp3", mute: true, focus: null, include: true},
"robot_man": {implemented: false, name: "Robot Man Voice", src: "/assets/66598bea6e59eb8acdf32cf2d9d75ba9.mp3", mute: true, focus: null, include: true},
"discodo": {implemented: false, name: "Discodo Launch", src: "/assets/ae7d16bb2eea76b9b9977db0fad66658.mp3", mute: true, focus: null, include: true},
"overlayunlock": {implemented: false, name: "Overlay Unlocked", src: "/assets/ad322ffe0a88436296158a80d5d11baa.mp3", mute: true, focus: null, include: true}
};
/* NEVER CHANGE THE SRC LINKS IN THE PLUGIN FILE, TO ADD NEW SOUNDS ADD THEM IN THE SETTINGS GUI IN THE PLUGINS PAGE */
@ -189,7 +189,7 @@ module.exports = (_ => {
this.defaults = {
volumes: {
globalVolume: {value:100, description:"Global Notification Sounds Volume"}
globalVolume: {value: 100, description: "Global Notification Sounds Volume"}
}
};
@ -364,7 +364,7 @@ module.exports = (_ => {
title: "Category",
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Select, {
value: choices[type].category,
options: Object.keys(audios).map(name => ({value:name, label:name})),
options: Object.keys(audios).map(name => ({value: name, label: name})),
searchable: true,
onChange: category => {
choices[type].category = category.value;
@ -383,7 +383,7 @@ module.exports = (_ => {
title: "Sound",
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Select, {
value: choices[type].sound,
options: Object.keys(audios[choices[type].category] || {}).map(name => ({value:name, label:name})),
options: Object.keys(audios[choices[type].category] || {}).map(name => ({value: name, label: name})),
searchable: true,
onChange: sound => {
choices[type].sound = sound.value;
@ -421,7 +421,7 @@ module.exports = (_ => {
};
let successSavedAudio = data => {
BDFDB.NotificationUtils.toast(`Sound ${data.sound} was added to category ${data.category}.`, {type:"success"});
BDFDB.NotificationUtils.toast(`Sound ${data.sound} was added to category ${data.category}.`, {type: "success"});
if (!audios[data.category]) audios[data.category] = {};
audios[data.category][data.sound] = data.source;
BDFDB.DataUtils.save(audios, this, "audios");
@ -493,7 +493,7 @@ module.exports = (_ => {
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Button, {
style: {marginBottom: 1},
onClick: _ => {
for (let input of settingsPanel.querySelectorAll(".input-newsound " + BDFDB.dotCN.input)) if (!input.value || input.value.length == 0 || input.value.trim().length == 0) return BDFDB.NotificationUtils.toast("Fill out all fields to add a new sound", {type:"danger"});
for (let input of settingsPanel.querySelectorAll(".input-newsound " + BDFDB.dotCN.input)) if (!input.value || input.value.length == 0 || input.value.trim().length == 0) return BDFDB.NotificationUtils.toast("Fill out all fields to add a new sound", {type: "danger"});
let category = settingsPanel.querySelector(".input-category " + BDFDB.dotCN.input).value.trim();
let sound = settingsPanel.querySelector(".input-sound " + BDFDB.dotCN.input).value.trim();
let source = settingsPanel.querySelector(".input-source " + BDFDB.dotCN.input).value.trim();
@ -502,11 +502,11 @@ module.exports = (_ => {
let type = response.headers["content-type"];
if (type && (type.indexOf("octet-stream") > -1 || type.indexOf("audio") > -1 || type.indexOf("video") > -1)) return successSavedAudio({category, sound, source});
}
BDFDB.NotificationUtils.toast("Use a valid direct link to a video or audio source, they usually end on something like .mp3, .mp4 or .wav", {type:"danger"});
BDFDB.NotificationUtils.toast("Use a valid direct link to a video or audio source, they usually end on something like .mp3, .mp4 or .wav", {type: "danger"});
});
else BDFDB.LibraryRequires.fs.readFile(source, (error, response) => {
if (error) BDFDB.NotificationUtils.toast("Could not fetch file. Please make sure the file exists", {type:"danger"});
else return successSavedAudio({category, sound, source:`data:audio/mpeg;base64,${response.toString("base64")}`});
if (error) BDFDB.NotificationUtils.toast("Could not fetch file. Please make sure the file exists", {type: "danger"});
else return successSavedAudio({category, sound, source: `data: audio/mpeg;base64,${response.toString("base64")}`});
});
},
children: BDFDB.LanguageUtils.LanguageStrings.SAVE
@ -526,9 +526,9 @@ module.exports = (_ => {
children: Object.keys(BDFDB.ObjectUtils.filter(types, typedata => !typedata.implemented)).map(type => createSoundCard(type)).flat(10).filter(n => n)
}));
let removeableCategories = [{value:removeAllKey, label:BDFDB.LanguageUtils.LanguageStrings.FORM_LABEL_ALL}].concat(Object.keys(audios).filter(category => !(defaultAudios[category] && !Object.keys(audios[category] || {}).filter(sound => defaultAudios[category][sound] === undefined).length)).map(name => ({value:name, label:name})));
let removeableCategories = [{value: removeAllKey, label: BDFDB.LanguageUtils.LanguageStrings.FORM_LABEL_ALL}].concat(Object.keys(audios).filter(category => !(defaultAudios[category] && !Object.keys(audios[category] || {}).filter(sound => defaultAudios[category][sound] === undefined).length)).map(name => ({value: name, label: name})));
let removeableSounds = {};
for (let category of removeableCategories) removeableSounds[category.value] = [{value:removeAllKey, label:BDFDB.LanguageUtils.LanguageStrings.FORM_LABEL_ALL}].concat(Object.keys(audios[category.value] || {}).filter(sound => !(defaultAudios[category.value] && defaultAudios[category.value][sound] !== undefined)).map(name => ({value:name, label:name})));
for (let category of removeableCategories) removeableSounds[category.value] = [{value: removeAllKey, label: BDFDB.LanguageUtils.LanguageStrings.FORM_LABEL_ALL}].concat(Object.keys(audios[category.value] || {}).filter(sound => !(defaultAudios[category.value] && defaultAudios[category.value][sound] !== undefined)).map(name => ({value: name, label: name})));
settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.CollapseContainer, {
title: "Remove Sounds",
collapseStates: collapseStates,
@ -548,7 +548,7 @@ module.exports = (_ => {
options: removeableCategories,
searchable: true,
onChange: (category, instance) => {
let soundSelectIns = BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name:["BDFDB_Modal", "BDFDB_SettingsPanel"], up:true}), {key:"REMOVE_SOUND"});
let soundSelectIns = BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name: ["BDFDB_Modal", "BDFDB_SettingsPanel"], up: true}), {key: "REMOVE_SOUND"});
if (soundSelectIns && removeableSounds[category.value]) {
soundSelectIns.props.options = removeableSounds[category.value];
soundSelectIns.props.value = removeAllKey;
@ -580,9 +580,9 @@ module.exports = (_ => {
style: {marginBottom: 1},
color: BDFDB.LibraryComponents.Button.Colors.RED,
onClick: (event, instance) => {
let wrapperIns = BDFDB.ReactUtils.findOwner(instance, {name:["BDFDB_Modal", "BDFDB_SettingsPanel"], up:true});
let categorySelectIns = BDFDB.ReactUtils.findOwner(wrapperIns, {key:"REMOVE_CATEGORY"});
let soundSelectIns = BDFDB.ReactUtils.findOwner(wrapperIns, {key:"REMOVE_SOUND"});
let wrapperIns = BDFDB.ReactUtils.findOwner(instance, {name: ["BDFDB_Modal", "BDFDB_SettingsPanel"], up: true});
let categorySelectIns = BDFDB.ReactUtils.findOwner(wrapperIns, {key: "REMOVE_CATEGORY"});
let soundSelectIns = BDFDB.ReactUtils.findOwner(wrapperIns, {key: "REMOVE_SOUND"});
if (categorySelectIns && soundSelectIns) {
let soundAmount = 0;
let catAll = categorySelectIns.props.value == removeAllKey;
@ -603,7 +603,7 @@ module.exports = (_ => {
this.loadChoices();
BDFDB.PluginUtils.refreshSettingsPanel(this, settingsPanel, collapseStates);
});
else BDFDB.NotificationUtils.toast("No sounds to delete", {type:"danger"});
else BDFDB.NotificationUtils.toast("No sounds to delete", {type: "danger"});
}
},
children: BDFDB.LanguageUtils.LanguageStrings.DELETE
@ -644,7 +644,7 @@ module.exports = (_ => {
e.returnvalue.props.children[index] = null;
BDFDB.TimeUtils.timeout(_ => {
repatchIncoming = false;
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.app), {name:"App", up:true}))
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.app), {name: "App", up: true}))
});
}
else e.returnvalue.props.children[index] = BDFDB.ReactUtils.createElement(e.returnvalue.props.children[index].type, {});

View File

@ -26,7 +26,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -58,10 +58,10 @@ module.exports = (_ => {
this.defaults = {
settings: {
displayNative: {value:!!document.querySelector(".platform-linux"), description:"Display the native title bar"},
addOldBar: {value:true, description:"Display the title bar in the old fashion"},
addToSettings: {value:true, description:"Add a title bar to settings windows"},
reloadButton: {value:false, description:"Add a reload button to the title bar"}
displayNative: {value: !!document.querySelector(".platform-linux"), description: "Display the native title bar"},
addOldBar: {value: true, description: "Display the title bar in the old fashion"},
addToSettings: {value: true, description: "Add a title bar to settings windows"},
reloadButton: {value: false, description: "Add a reload button to the title bar"}
}
};
@ -163,7 +163,7 @@ module.exports = (_ => {
let notifybar = document.querySelector("#OldTitleBarNotifyBar");
if (notifybar) notifybar.querySelector(BDFDB.dotCN.noticedismiss).click();
if (patched) {
notifybar = BDFDB.NotificationUtils.notice("Changed nativebar settings, relaunch to see changes:", {type:"danger",btn:"Relaunch",id:"OldTitleBarNotifyBar"});
notifybar = BDFDB.NotificationUtils.notice("Changed nativebar settings, relaunch to see changes:", {type: "danger",btn: "Relaunch",id: "OldTitleBarNotifyBar"});
notifybar.querySelector(BDFDB.dotCN.noticebutton).addEventListener("click", _ => {
BDFDB.LibraryRequires.electron.remote.app.relaunch();
BDFDB.LibraryRequires.electron.remote.app.quit();
@ -192,7 +192,7 @@ module.exports = (_ => {
}
processApp (e) {
let [children, index] = BDFDB.ReactUtils.findParent(e.instance, {props:[["type",["WINDOWS", "MACOS"]]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.instance, {props: [["type",["WINDOWS", "MACOS"]]]});
if (index > -1) children[index] = null;
}

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -74,22 +74,22 @@ module.exports = (_ => {
this.defaults = {
settings: {
addInChatWindow: {value:true, inner:true, description:"Messages"},
addInMemberList: {value:true, inner:true, description:"Member List"},
addInUserPopout: {value:true, inner:true, description:"User Popouts"},
addInUserProfile: {value:true, inner:true, description:"User Profile Modal"},
useRoleColor: {value:true, inner:false, description:"Use the Rolecolor instead of the default blue"},
useBlackFont: {value:false, inner:false, description:"Instead of darkening the Rolecolor on bright colors use black font"},
useCrown: {value:false, inner:false, description:"Use the Crown Icon instead of the Bot Tag Style"},
hideNativeCrown: {value:true, inner:false, description:"Hide the native Crown Icon (not the Plugin one)"},
addForAdmins: {value:false, inner:false, description:"Add an Admin Tag for users with admin permissions"},
addForManagement: {value:false, inner:false, description:"Add a Management Tag for users with management permissions"},
ignoreBotAdmins: {value:false, inner:false, description:"Do not add the Admin/Management tag for bots"}
addInChatWindow: {value: true, inner: true, description: "Messages"},
addInMemberList: {value: true, inner: true, description: "Member List"},
addInUserPopout: {value: true, inner: true, description: "User Popouts"},
addInUserProfile: {value: true, inner: true, description: "User Profile Modal"},
useRoleColor: {value: true, inner: false, description: "Use the Rolecolor instead of the default blue"},
useBlackFont: {value: false, inner: false, description: "Instead of darkening the Rolecolor on bright colors use black font"},
useCrown: {value: false, inner: false, description: "Use the Crown Icon instead of the Bot Tag Style"},
hideNativeCrown: {value: true, inner: false, description: "Hide the native Crown Icon (not the Plugin one)"},
addForAdmins: {value: false, inner: false, description: "Add an Admin Tag for users with admin permissions"},
addForManagement: {value: false, inner: false, description: "Add a Management Tag for users with management permissions"},
ignoreBotAdmins: {value: false, inner: false, description: "Do not add the Admin/Management tag for bots"}
},
inputs: {
ownTagName: {value:"Owner", description:"Tag Text for Owners"},
ownAdminTagName: {value:"Admin", description:"Tag Text for Admins"},
ownManagementTagName: {value:"Management", description:"Tag Text for Management"}
ownTagName: {value: "Owner", description: "Tag Text for Owners"},
ownAdminTagName: {value: "Admin", description: "Tag Text for Admins"},
ownManagementTagName: {value: "Management", description: "Tag Text for Management"}
}
};
@ -146,7 +146,7 @@ module.exports = (_ => {
children: [BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormTitle, {
className: BDFDB.disCN.marginbottom4,
tag: BDFDB.LibraryComponents.FormComponents.FormTitle.Tags.H3,
children: "Add Tags in:"
children: "Add Tags in: "
})].concat(Object.keys(settings).map(key => this.defaults.settings[key].inner && BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, {
type: "Switch",
plugin: this,

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -68,9 +68,9 @@ module.exports = (_ => {
onLoad() {
this.defaults = {
choices: {
defaultFilter: {value:filterKeys[0], options:filterKeys, type:"filter", description:"Default choice tab"},
defaultSort: {value:sortKeys[0], options:sortKeys, type:"sort", description:"Default sort choice"},
defaultOrder: {value:orderKeys[0], options:orderKeys, type:"order", description:"Default order choice"},
defaultFilter: {value: filterKeys[0], options: filterKeys, type: "filter", description: "Default choice tab"},
defaultSort: {value: sortKeys[0], options: sortKeys, type: "sort", description: "Default sort choice"},
defaultOrder: {value: orderKeys[0], options: orderKeys, type: "order", description: "Default order choice"},
}
};

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -61,11 +61,11 @@ module.exports = (_ => {
onLoad() {
this.defaults = {
settings: {
sortInRecentOrder: {value:false, inner:true, description:"Channel List"},
sortInRecentOrderGuild: {value:false, inner:true, description:"Guild List"},
showPinIcon: {value:true, inner:false, description:"Show a little 'Pin' icon for pinned DMs in the server list:"},
showCategoryUnread: {value:true, inner:false, description:"Show the amount of unread Messages in a category in the channel list:"},
showCategoryAmount: {value:true, inner:false, description:"Show the amount of pinned DMs in a category in the channel list:"}
sortInRecentOrder: {value: false, inner: true, description: "Channel List"},
sortInRecentOrderGuild: {value: false, inner: true, description: "Guild List"},
showPinIcon: {value: true, inner: false, description: "Show a little 'Pin' icon for pinned DMs in the server list: "},
showCategoryUnread: {value: true, inner: false, description: "Show the amount of unread Messages in a category in the channel list: "},
showCategoryAmount: {value: true, inner: false, description: "Show the amount of pinned DMs in a category in the channel list: "}
}
};
@ -155,7 +155,7 @@ module.exports = (_ => {
onStop() {
this.forceUpdateAll();
let unreadDMsInstance = BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.app), {name:"UnreadDMs", unlimited:true});
let unreadDMsInstance = BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.app), {name: "UnreadDMs", unlimited: true});
if (unreadDMsInstance) {
delete unreadDMsInstance.props.pinnedPrivateChannelIds;
unreadDMsInstance.props.unreadPrivateChannelIds = BDFDB.LibraryModules.DirectMessageUnreadStore.getUnreadPrivateChannelIds();
@ -211,7 +211,7 @@ module.exports = (_ => {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.app), {name:"FluxContainer(PrivateChannels)", all:true, unlimited:true}));
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.app), {name: "FluxContainer(PrivateChannels)", all: true, unlimited: true}));
BDFDB.PatchUtils.forceAllUpdates(this);
}
@ -320,7 +320,7 @@ module.exports = (_ => {
BDFDB.ArrayUtils.remove(categories, maybedDraggedCategory, true);
categories.splice(categories.indexOf(maybedReleasedCategory) + 1, 0, maybedDraggedCategory);
let newCategories = {}, newPos = 0;
for (let category of [].concat(categories).reverse()) newCategories[category.id] = Object.assign(category, {pos:newPos++});
for (let category of [].concat(categories).reverse()) newCategories[category.id] = Object.assign(category, {pos: newPos++});
BDFDB.DataUtils.save(newCategories, this, "dmCategories");
}
draggedCategory = null;
@ -735,7 +735,7 @@ module.exports = (_ => {
BDFDB.PatchUtils.forceAllUpdates(this, "PrivateChannelsList");
}
if (e.returnvalue && this.isPinned(e.instance.props.channel.id, "pinnedRecents") && settings.showPinIcon) {
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name:"BlobMask"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "BlobMask"});
if (index > -1) children[index].props.upperLeftBadge = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Badges.IconBadge, {
className: BDFDB.disCN.guildiconbadge,
disableColor: true,

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -420,7 +420,7 @@ module.exports = (_ => {
itemClassName: BDFDB.disCN.tabbaritem,
type: BDFDB.LibraryComponents.TabBar.Types.TOP,
selectedItem: this.props.tab,
items: [{value:"Plugins"}, {value:BDFDB.LanguageUtils.LanguageStrings.SETTINGS}],
items: [{value: "Plugins"}, {value: BDFDB.LanguageUtils.LanguageStrings.SETTINGS}],
onItemSelect: (value, instance) => {
this.props.tab = list.props.tab = value;
BDFDB.ReactUtils.forceUpdate(list);
@ -472,7 +472,7 @@ module.exports = (_ => {
onLoad() {
_this = this;
loading = {is:false, timeout:null, amount:0};
loading = {is: false, timeout: null, amount: 0};
cachedPlugins = [];
grabbedPlugins = [];
@ -481,15 +481,15 @@ module.exports = (_ => {
this.defaults = {
settings: {
useChromium: {value:false, description:"Use an inbuilt browser window instead of opening your default browser"},
notifyOutdated: {value:true, description:"Get a notification when one of your Plugins is outdated"},
notifyNewEntries: {value:true, description:"Get a notification when there are new entries in the Repo"}
useChromium: {value: false, description: "Use an inbuilt browser window instead of opening your default browser"},
notifyOutdated: {value: true, description: "Get a notification when one of your Plugins is outdated"},
notifyNewEntries: {value: true, description: "Get a notification when there are new entries in the Repo"}
},
modalSettings: {
updated: {value:true, modify:true, description:"Show updated Plugins",},
outdated: {value:true, modify:true, description:"Show outdated Plugins"},
downloadable: {value:true, modify:true, description:"Show downloadable Plugins"},
rnmStart: {value:true, modify:false, description:"Start Plugin after Download"}
updated: {value: true, modify: true, description: "Show updated Plugins",},
outdated: {value: true, modify: true, description: "Show outdated Plugins"},
downloadable: {value: true, modify: true, description: "Show downloadable Plugins"},
rnmStart: {value: true, modify: false, description: "Start Plugin after Download"}
}
};
@ -602,7 +602,7 @@ module.exports = (_ => {
type: "Button",
label: "Force all Plugins to be fetched again",
onClick: _ => {
loading = {is:false, timeout:null, amount:0};
loading = {is: false, timeout: null, amount: 0};
this.loadPlugins();
},
children: BDFDB.LanguageUtils.LanguageStrings.ERRORS_RELOAD
@ -705,13 +705,13 @@ module.exports = (_ => {
grabbedPlugins = result.split("\n").filter(n => n);
foundPlugins = grabbedPlugins.concat(customList);
loading = {is:true, timeout:BDFDB.TimeUtils.timeout(_ => {
loading = {is: true, timeout: BDFDB.TimeUtils.timeout(_ => {
BDFDB.TimeUtils.clear(loading.timeout);
if (this.started) {
if (loading.is && loading.amount < 4) BDFDB.TimeUtils.timeout(_ => {this.loadPlugins();},10000);
loading = {is: false, timeout:null, amount:loading.amount};
loading = {is: false, timeout: null, amount: loading.amount};
}
}, 1200000), amount:loading.amount+1};
}, 1200000), amount: loading.amount+1};
let loadingIcon = BDFDB.DOMUtils.create(pluginRepoIcon);
BDFDB.DOMUtils.addClass(loadingIcon, "pluginrepo-loadingicon");
@ -738,7 +738,7 @@ module.exports = (_ => {
BDFDB.TimeUtils.clear(finishInterval);
BDFDB.WindowUtils.close(sandbox);
BDFDB.DOMUtils.remove(loadingIcon, ".pluginrepo-loadingicon");
loading = {is:false, timeout:null, amount:loading.amount};
loading = {is: false, timeout: null, amount: loading.amount};
BDFDB.LogUtils.log("Finished fetching Plugins.", this.name);
if (list) BDFDB.ReactUtils.forceUpdate(list);
@ -746,7 +746,7 @@ module.exports = (_ => {
if ((settings.notifyOutdated || settings.notifyOutdated == undefined) && outdated > 0) {
let oldBarButton = document.querySelector(".pluginrepo-outdate-notice " + BDFDB.dotCN.noticedismiss);
if (oldBarButton) oldBarButton.click();
let bar = BDFDB.NotificationUtils.notice(`${outdated} of your Plugins ${outdated == 1 ? "is" : "are"} outdated. Check:`, {
let bar = BDFDB.NotificationUtils.notice(`${outdated} of your Plugins ${outdated == 1 ? "is" : "are"} outdated. Check: `, {
type: "danger",
btn: "PluginRepo",
selector: "pluginrepo-notice pluginrepo-outdate-notice",
@ -763,7 +763,7 @@ module.exports = (_ => {
let oldBarButton = document.querySelector(".pluginrepo-newentries-notice " + BDFDB.dotCN.noticedismiss);
if (oldBarButton) oldBarButton.click();
let single = newEntries == 1;
let bar = BDFDB.NotificationUtils.notice(`There ${single ? "is" : "are"} ${newEntries} new Plugin${single ? "" : "s"} in the Repo. Check:`, {
let bar = BDFDB.NotificationUtils.notice(`There ${single ? "is" : "are"} ${newEntries} new Plugin${single ? "" : "s"} in the Repo. Check: `, {
type: "success",
btn: "PluginRepo",
selector: "pluginrepo-notice pluginrepo-newentries-notice",
@ -990,7 +990,7 @@ module.exports = (_ => {
checkForNewPlugins () {
BDFDB.LibraryRequires.request("https://mwittrien.github.io/BetterDiscordAddons/Plugins/PluginRepo/_res/PluginList.txt", (error, response, result) => {
if (response && !BDFDB.equals(result.replace(/\t|\r/g, "").split("\n").filter(n => n), grabbedPlugins)) {
loading = {is:false, timeout:null, amount:0};
loading = {is: false, timeout: null, amount: 0};
this.loadPlugins();
}
});
@ -998,15 +998,15 @@ module.exports = (_ => {
downloadPlugin (data) {
BDFDB.LibraryRequires.request(data.url, (error, response, body) => {
if (error) BDFDB.NotificationUtils.toast(`Unable to download Plugin "${plugin.getName}".`, {type:"danger"});
if (error) BDFDB.NotificationUtils.toast(`Unable to download Plugin "${plugin.getName}".`, {type: "danger"});
else this.createPluginFile(data.url.split("/").pop(), body);
});
}
createPluginFile (filename, content) {
BDFDB.LibraryRequires.fs.writeFile(BDFDB.LibraryRequires.path.join(BDFDB.BDUtils.getPluginsFolder(), filename), content, (error) => {
if (error) BDFDB.NotificationUtils.toast(`Unable to save Plugin "${filename}".`, {type:"danger"});
else BDFDB.NotificationUtils.toast(`Successfully saved Plugin "${filename}".`, {type:"success"});
if (error) BDFDB.NotificationUtils.toast(`Unable to save Plugin "${filename}".`, {type: "danger"});
else BDFDB.NotificationUtils.toast(`Successfully saved Plugin "${filename}".`, {type: "success"});
});
}
@ -1020,7 +1020,7 @@ module.exports = (_ => {
deletePluginFile (data) {
let filename = data.url.split("/").pop();
BDFDB.LibraryRequires.fs.unlink(BDFDB.LibraryRequires.path.join(BDFDB.BDUtils.getPluginsFolder(), filename), (error) => {
if (error) BDFDB.NotificationUtils.toast(`Unable to delete Plugin "${filename}".`, {type:"danger"});
if (error) BDFDB.NotificationUtils.toast(`Unable to delete Plugin "${filename}".`, {type: "danger"});
else BDFDB.NotificationUtils.toast(`Successfully deleted Plugin "${filename}".`);
});
}

View File

@ -26,7 +26,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -59,11 +59,11 @@ module.exports = (_ => {
onLoad() {
this.defaults = {
settings: {
addClearButton: {value:true, inner:false, description:"Add a 'Clear Mentions' button to the recent mentions popout"},
confirmClear: {value:false, inner:false, description:"Ask for your confirmation before clearing reads"},
includeGuilds: {value:true, inner:true, description:"unread Servers"},
includeMuted: {value:false, inner:true, description:"muted unread Servers"},
includeDMs: {value:false, inner:true, description:"unread DMs"}
addClearButton: {value: true, inner: false, description: "Add a 'Clear Mentions' button to the recent mentions popout"},
confirmClear: {value: false, inner: false, description: "Ask for your confirmation before clearing reads"},
includeGuilds: {value: true, inner: true, description: "unread Servers"},
includeMuted: {value: false, inner: true, description: "muted unread Servers"},
includeDMs: {value: false, inner: true, description: "unread DMs"}
}
};
@ -328,7 +328,7 @@ module.exports = (_ => {
let messages = [].concat(e.instance.props.messages).filter(n => n);
if (messages.length) {
clearing = true;
let toast = BDFDB.NotificationUtils.toast("Clearing all recent mentions, please wait...", {timeout:0});
let toast = BDFDB.NotificationUtils.toast("Clearing all recent mentions, please wait...", {timeout: 0});
for (let i = 0; i < messages.length; i++) BDFDB.TimeUtils.timeout(_ => {
BDFDB.LibraryModules.RecentMentionUtils.deleteRecentMention(messages[i].id);
if (i == messages.length - 1) {

View File

@ -35,7 +35,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -62,9 +62,9 @@ module.exports = (_ => {
onLoad() {
this.defaults = {
settings: {
removeMessages: {value:true, description:"Remove messages of blocked users"},
removeUsers: {value:true, description:"Remove blocked users (memberlist, voicechannels)"},
disableNotifications: {value:true, description:"Disable unread markers for messages of blocked users"},
removeMessages: {value: true, description: "Remove messages of blocked users"},
removeUsers: {value: true, description: "Remove blocked users (memberlist, voicechannels)"},
disableNotifications: {value: true, description: "Disable unread markers for messages of blocked users"},
}
};

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -58,16 +58,16 @@ module.exports = (_ => {
onLoad() {
this.defaults = {
settings: {
replaceOwn: {value:false, inner:false, description:"Replace your own name:"},
replaceBots: {value:true, inner:false, description:"Replace the nickname of bots:"},
addNickname: {value:false, inner:false, description:"Add nickname as parentheses:"},
swapPositions: {value:false, inner:false, description:"Swap the position of username and nickname:"},
changeInChatWindow: {value:true, inner:true, description:"Messages"},
changeInMentions: {value:true, inner:true, description:"Mentions"},
changeInVoiceChat: {value:true, inner:true, description:"Voice Channels"},
changeInMemberList: {value:true, inner:true, description:"Member List"},
changeInTyping: {value:true, inner:true, description:"Typing List"},
changeInAutoComplete: {value:true, inner:true, description:"Autocomplete Menu"}
replaceOwn: {value: false, inner: false, description: "Replace your own name: "},
replaceBots: {value: true, inner: false, description: "Replace the nickname of bots: "},
addNickname: {value: false, inner: false, description: "Add nickname as parentheses: "},
swapPositions: {value: false, inner: false, description: "Swap the position of username and nickname: "},
changeInChatWindow: {value: true, inner: true, description: "Messages"},
changeInMentions: {value: true, inner: true, description: "Mentions"},
changeInVoiceChat: {value: true, inner: true, description: "Voice Channels"},
changeInMemberList: {value: true, inner: true, description: "Member List"},
changeInTyping: {value: true, inner: true, description: "Typing List"},
changeInAutoComplete: {value: true, inner: true, description: "Autocomplete Menu"}
}
};

View File

@ -26,7 +26,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {

View File

@ -26,7 +26,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -78,7 +78,7 @@ module.exports = (_ => {
messages.filter(n => n).forEach((message, i) => {
BDFDB.TimeUtils.timeout(_ => {
e2.originalMethod(message);
if (i >= messages.length-1) BDFDB.NotificationUtils.toast(this.labels.toast_allsent_text, {type:"success"});
if (i >= messages.length-1) BDFDB.NotificationUtils.toast(this.labels.toast_allsent_text, {type: "success"});
}, messageDelay * i);
});
return Promise.resolve({

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {

View File

@ -26,7 +26,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -148,32 +148,32 @@ module.exports = (_ => {
this.defaults = {
settings: {
cutSeconds: {value:false, cat:"settings", description:"Cut off seconds of the time"},
forceZeros: {value:false, cat:"settings", description:"Force leading zeros"},
otherOrder: {value:false, cat:"settings", description:"Show the time before the date"},
addIcon: {value:true, cat:"tooltip", description:"GUILD_CREATE_UPLOAD_ICON_LABEL"},
addOwner: {value:true, cat:"tooltip", description:"GUILD_OWNER"},
addCreation: {value:true, cat:"tooltip", description:"creationdate_text"},
addJoin: {value:true, cat:"tooltip", description:"joindate_text"},
addMembers: {value:true, cat:"tooltip", description:"MEMBERS"},
addChannels: {value:true, cat:"tooltip", description:"CHANNELS"},
addRoles: {value:true, cat:"tooltip", description:"ROLES"},
addBoosters: {value:true, cat:"tooltip", description:"SUBSCRIPTIONS_TITLE"},
addRegion: {value:true, cat:"tooltip", description:"REGION"}
cutSeconds: {value: false, cat: "settings", description: "Cut off seconds of the time"},
forceZeros: {value: false, cat: "settings", description: "Force leading zeros"},
otherOrder: {value: false, cat: "settings", description: "Show the time before the date"},
addIcon: {value: true, cat: "tooltip", description: "GUILD_CREATE_UPLOAD_ICON_LABEL"},
addOwner: {value: true, cat: "tooltip", description: "GUILD_OWNER"},
addCreation: {value: true, cat: "tooltip", description: "creationdate_text"},
addJoin: {value: true, cat: "tooltip", description: "joindate_text"},
addMembers: {value: true, cat: "tooltip", description: "MEMBERS"},
addChannels: {value: true, cat: "tooltip", description: "CHANNELS"},
addRoles: {value: true, cat: "tooltip", description: "ROLES"},
addBoosters: {value: true, cat: "tooltip", description: "SUBSCRIPTIONS_TITLE"},
addRegion: {value: true, cat: "tooltip", description: "REGION"}
},
colors: {
tooltipColor: {value:"", description:"Tooltip Color"}
tooltipColor: {value: "", description: "Tooltip Color"}
},
choices: {
timeLang: {value:"$discord", description:"Date Format"}
timeLang: {value: "$discord", description: "Date Format"}
},
formats: {
ownFormat: {value:"$hour:$minute:$second, $day.$month.$year", description:"Own Format"}
ownFormat: {value: "$hour: $minute: $second, $day.$month.$year", description: "Own Format"}
},
amounts: {
tooltipDelay: {value:0, cat:"tooltip", min:0, max:10, digits:1, unit:"s", description:"Details Tooltip Delay"},
tooltipWidth: {value:300, cat:"tooltip", min:200, max:600, digits:0, unit:"px", description:"Details Tooltip Width"},
maxDaysAgo: {value:0, cat:"format", min:0, description:"Maximum count of days displayed in the $daysago placeholder", note:"0 equals no limit"}
tooltipDelay: {value: 0, cat: "tooltip", min: 0, max: 10, digits: 1, unit: "s", description: "Details Tooltip Delay"},
tooltipWidth: {value: 300, cat: "tooltip", min: 200, max: 600, digits: 0, unit: "px", description: "Details Tooltip Width"},
maxDaysAgo: {value: 0, cat: "format", min: 0, description: "Maximum count of days displayed in the $daysago placeholder", note: "0 equals no limit"}
}
};
@ -210,7 +210,7 @@ module.exports = (_ => {
onStart() {
BDFDB.PatchUtils.patch(this, BDFDB.LibraryComponents.GuildComponents.Guild.prototype, "render", {after: e => {
this.processGuild({instance:e.thisObject, returnvalue:e.returnValue, methodname:"render"});
this.processGuild({instance: e.thisObject, returnvalue: e.returnValue, methodname: "render"});
}});
languages = BDFDB.ObjectUtils.deepAssign({
@ -250,7 +250,7 @@ module.exports = (_ => {
value: settings[key],
onChange: (value, instance) => {
settings[key] = value;
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name:"BDFDB_SettingsPanel", up:true}), {name:"BDFDB_Select", all:true, noCopies:true}));
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name: "BDFDB_SettingsPanel", up: true}), {name: "BDFDB_Select", all: true, noCopies: true}));
}
}))
}));
@ -261,7 +261,7 @@ module.exports = (_ => {
children: [BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormTitle, {
className: BDFDB.disCN.marginbottom4,
tag: BDFDB.LibraryComponents.FormComponents.FormTitle.Tags.H3,
children: "Add additional details in the server tooltip for:"
children: "Add additional details in the server tooltip for: "
})].concat(Object.keys(settings).map(key => this.defaults.settings[key].cat == "tooltip" && BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, {
type: "Switch",
plugin: this,
@ -307,7 +307,7 @@ module.exports = (_ => {
label: this.defaults.choices[key].description,
basis: "70%",
value: choices[key],
options: BDFDB.ObjectUtils.toArray(BDFDB.ObjectUtils.map(languages, (lang, id) => {return {value:id, label:lang.name}})),
options: BDFDB.ObjectUtils.toArray(BDFDB.ObjectUtils.map(languages, (lang, id) => {return {value: id, label: lang.name}})),
searchable: true,
optionRenderer: lang => {
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
@ -357,7 +357,7 @@ module.exports = (_ => {
value: formats[key],
onChange: (value, instance) => {
formats[key] = value;
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name:"BDFDB_SettingsPanel", up:true}), {name:"BDFDB_Select", all:true, noCopies:true}));
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name: "BDFDB_SettingsPanel", up: true}), {name: "BDFDB_Select", all: true, noCopies: true}));
}
}))).concat(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormDivider, {
className: BDFDB.disCN.marginbottom8

View File

@ -26,7 +26,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -52,20 +52,20 @@ module.exports = (_ => {
var folderConfigs = {}, customIcons = {}, settings = {};
const folderIcons = [
{openicon:`<path d="M 200,390 H 955 L 795,770 H 200 Z" fill="REPLACE_FILL2"/><path d="M 176.6,811 C 163.9,811 155.1,802.6 155,784.7 V 212.9 C 157.9,190.5 169,179.8 195.9,176 h 246 c 20.3,3.2 34.5,18.7 41,28.6 C 494.9,228.3 492.9,240.4 494,266 l 313.6,1.3 c 17.6,0.4 23.3,3.7 23.3,3.7 8.6,4.2 14.8,10.7 19,19.5 C 856.3,319.5 854,360 854,360 h 108.9 c 4.4,2.4 13.7,1.2 11.8,23.5 L 815.8,789.4 c -2.1,5.2 -12.5,13.6 -18.7,16.1 -6.8,2.7 -18.5,5.5 -23.9,5.5 z M 767,759 897,430 H 360 L 230,759 Z" fill="REPLACE_FILL1"/>`,
closedicon:`<path d="M 175,320 V 790 H 820 V 320 Z" fill="REPLACE_FILL2"/><path d="M 183,811 c -12.2,-0.6 -17.9,-4.8 -21.5,-8.2 C 159.5,801 154.8,792.6 155,779.7 V 215.6 c 3.3,-14.1 9.3,-21.4 15.1,-26.4 7.4,-6.3 16,-11.6 36.7,-13.2 h 237.3 c 23.3,6 32.2,18.7 38.7,28.6 7.6,11.7 9.4,18.6 10.3,41.4 L 494,266 h 313.4 c 16.9,0.1 23.5,5.1 23.5,5.1 8.6,4.2 14.5,10.9 19,19.5 0,0 3.7,7.5 3.1,19.8 V 777.2 c -1.1,9 -4.1,13.7 -4.1,13.7 -4.2,8.6 -10.7,14.8 -19.5,19 L 823.3,811 Z m 602.8,-55 c 2.8,-1.7 6.9,-4.5 8.9,-7.4 2.4,-3.6 5,-10.8 5.4,-24.7 V 362 c -0.2,-10.9 -4.2,-16.3 -4.2,-16.3 -2,-3 -5.9,-6.8 -8.7,-8.6 0,0 -5.8,-3 -12.7,-3.2 h -548.1 c -7.8,0 -13.9,3.6 -13.9,3.6 -3,2 -7.3,6.7 -8.4,17.3 v 386.4 c 2.8,10.4 7.5,16 13.6,17.7 h 544.9 c 11,-0.2 18.4,-1.9 23.3,-3 z" fill="REPLACE_FILL1"/>`},
{openicon:`<path d="M 167,200 h 200 l 50,50 H 829.8 L 830,330 H 970 L 825,779 H 167 Z" fill="REPLACE_FILL2"/><path d="M 184,799 c -10.5,0 -22.3,-5.3 -27,-10 -4.7,-4.7 -9,-15.1 -9,-34 V 212 c 0,-13.3 5,-22 11,-28 4.4,-4.4 15.4,-10 30,-10 h 170.3 l 53.3,53 H 820 c 13.1,0 18.2,4.2 25,10 6.4,5.5 7,14.4 7,31 v 52 h 122.3 c 11.6,0 17.1,3.3 17.1,3.3 2.9,2.9 3.3,4.4 3.3,14.2 0,8.4 -0.9,13.5 -3.8,22.4 L 849,799 Z M 933,360 H 335 l -130,398.1 603.2,1.3 z M 289.7,334.6 c 3,-8.2 8,-14.8 17,-14.8 0,0 506.6,0.2 506.3,0.2 0,-39.8 -12.2,-53 -53,-53 L 403.3,266.7 350,213 H 240 c -37.6,0 -53,10.1 -53,53 v 382.7 z" fill="REPLACE_FILL1"/>`,
closedicon:`<path d="M 173,190 V 771 H 825 V 250 H 420 l -70,-60 z" fill="REPLACE_FILL2"/><path d="M 184.2,799 C 170.3,799 164.3,795.8 157.4,788.9 151.7,783.3 148,774.6 148,754.9 V 211.2 c 0.7,-18.6 6,-21.7 11.9,-27.6 6.8,-6.8 15.5,-9.4 29.3,-9.6 h 170.1 l 53.3,53 h 407.7 c 14.1,0 18.6,2.8 25.3,9.4 6.4,6.4 7.1,13.4 7.1,30.8 v 246.1 247.4 c 0.2,11.8 -1.9,22.1 -7.4,27.6 C 839.7,793.9 831,799 819.4,799 Z M 813,707 V 415 c 0,-36.9 -13.9,-53 -53,-53 H 240 c -38.1,0 -53,11.7 -53,53 v 292 c 0,38.8 11.5,53 53,53 h 520 c 37.8,0 53,-12.1 53,-53 z M 760,267 c 0,0 -228.6,-0.3 -356.7,-0.3 L 350,213 H 240 c -41.6,2.7 -52.2,14.3 -53,53 v 54 h 626 c -0.6,-37.5 -12,-53 -53,-53 z" fill="REPLACE_FILL1"/>`},
{openicon:`<path d="M 307,330 H 970 L 825,779 H 167 Z" fill="REPLACE_FILL2"/><path d="M 189 174 C 174.4 174 163.4 179.6 159 184 C 153 190 148 198.7 148 212 L 148 755 C 148 773.9 152.3 784.3 157 789 C 161.7 793.7 173.5 799 184 799 L 849 799 L 990.8 359.8 C 993.8 350.9 994.7 345.9 994.7 337.4 C 994.7 327.6 994.3 326.2 991.4 323.3 C 991.4 323.3 985.9 320 974.3 320 L 852 320 L 852 268 C 852 251.4 851.4 242.5 845 237 C 838.2 231.2 833.1 227 820 227 L 412.6 227 L 359.3 174 L 189 174 z M 335 360 L 933 360 L 808.2 759.3 L 205 758.1 L 335 360 z" fill="REPLACE_FILL1"/>`,
closedicon:`<path d="M 173,345 V 771 H 825 V 345 Z" fill="REPLACE_FILL2"/><path d="M 189.2 174 C 175.4 174.2 166.7 176.8 159.9 183.6 C 154 189.5 148.7 192.7 148 211.2 L 148 754.9 C 148 774.6 151.7 783.3 157.4 788.9 C 164.3 795.8 170.3 799 184.2 799 L 819.4 799 C 831 799 839.7 793.9 845.2 788.4 C 850.8 782.8 852.9 772.5 852.7 760.8 L 852.7 513.3 L 852.7 267.2 C 852.7 249.8 852 242.8 845.6 236.4 C 838.9 229.7 834.4 227 820.3 227 L 412.6 227 L 359.3 174 L 189.2 174 z M 240 362 L 760 362 C 799.1 362 813 378.1 813 415 L 813 707 C 813 747.9 797.8 760 760 760 L 240 760 C 198.5 760 187 745.8 187 707 L 187 415 C 187 373.7 201.9 362 240 362 z" fill="REPLACE_FILL1"/>`},
{openicon:`<path d="M 167,200 h 200 l 50,50 H 829.8 L 830,330 H 314 L 167,779 Z" fill="REPLACE_FILL2"/><path d="M 189 174 C 174.4 174 163.4 179.6 159 184 C 153 190 148 198.7 148 212 L 148 755 C 148 773.9 152.3 784.3 157 789 C 161.7 793.7 173.5 799 184 799 L 849 799 L 990.8 359.8 C 993.8 350.9 994.7 345.9 994.7 337.4 C 994.7 327.6 994.3 326.2 991.4 323.3 C 991.4 323.3 985.9 320 974.3 320 L 852 320 L 852 268 C 852 251.4 851.4 242.5 845 237 C 838.2 231.2 833.1 227 820 227 L 412.6 227 L 359.3 174 L 189 174 z M 240 213 L 350 213 L 403.3 266.7 L 760 267 C 800.8 267 813 280.2 813 320 C 813.3 320 306.7 319.8 306.7 319.8 C 297.7 319.8 292.7 326.4 289.7 334.6 L 187 648.7 L 187 266 C 187 223.1 202.4 213 240 213 z" fill="REPLACE_FILL1"/>`,
closedicon:`<path d="M 173,190 V 350 H 825 V 250 H 420 l -70,-60 z" fill="REPLACE_FILL2"/><path d="M 189.2 174 C 175.4 174.2 166.7 176.8 159.9 183.6 C 154 189.5 148.7 192.7 148 211.2 L 148 754.9 C 148 774.6 151.7 783.3 157.4 788.9 C 164.3 795.8 170.3 799 184.2 799 L 819.4 799 C 831 799 839.7 793.9 845.2 788.4 C 850.8 782.8 852.9 772.5 852.7 760.8 L 852.7 513.3 L 852.7 267.2 C 852.7 249.8 852 242.8 845.6 236.4 C 838.9 229.7 834.4 227 820.3 227 L 412.6 227 L 359.3 174 L 189.2 174 z M 240 213 L 350 213 L 403.3 266.7 C 531.4 266.7 760 267 760 267 C 801 267 812.4 282.5 813 320 L 187 320 L 187 266 C 187.8 227.3 198.4 215.7 240 213 z" fill="REPLACE_FILL1"/>`},
{openicon:`<path d="M 132,305 H 880 V 750 H 132 Z" fill="REPLACE_FILL2"/><path d="M 135,188 c -5.6,0 -13.9,2.9 -19.8,8.9 C 109.4,203 107,206.8 107,216 c 0,189.7 0,379.3 0,569 0,11.1 1.7,14.8 7,20.2 C 120.5,811.6 125.4,813 135,813 h 717 c 16.7,0 16.7,-1.6 18.6,-6.6 L 981.3,423.4 c 0,-5.8 -1,-6.2 -2.8,-8.1 -1.9,-1.9 -4.3,-2 -11.9,-2 l -691.9,2.1 c -16.4,0 -21.3,11.5 -23.4,17.2 l -80.9,263 -0.2,0 C 159.1,714.4 147,704.3 147,677.2 V 334 h 733 v -26 c 0,-7.7 -1.6,-14.7 -7.6,-19.8 C 866.3,283.1 860.4,280 852,280 H 440 l -20,-82 c -1.2,-2.5 -3.1,-6.8 -5.8,-7.7 0,0 -3,-2.3 -10.2,-2.3 z" fill="REPLACE_FILL1"/>`,
closedicon:`<path d="M 132,305 H 880 V 750 H 132 Z" fill="REPLACE_FILL2"/><path d="M 135,813 c -10.3,0 -14.5,-1.4 -21,-7.8 C 108.7,799.8 107,796.1 107,785 c 0,-189.7 0,-379.3 0,-569 0,-9.2 2.4,-13 8.2,-19.1 C 121.1,190.9 129.4,188 135,188 h 269 c 7.2,0 10.2,2.3 10.2,2.3 2.7,0.9 4.6,5.2 5.8,7.7 l 20,82 h 412 c 8.4,0 14.3,3.1 20.4,8.2 C 878.4,293.3 880,300.3 880,308 v 26 H 147 v 343.2 c 0,27.1 18.1,25.2 21.7,5.4 l 32.7,-277.7 c 0.7,-2.8 2.7,-7.5 5.8,-10.6 C 210.4,391.1 214.5,388 222.7,388 H 852 c 7.9,0 15.9,2.9 20.5,7.5 C 878.3,401.3 880,408.6 880,416 v 369 c 0,6.9 -1.8,14.7 -7.4,19.3 C 866.2,809.6 858.9,813 852,813 Z" fill="REPLACE_FILL1"/>`},
{openicon:`<path d="M 186.3,187 c -20,0 -35.7,7.4 -47.4,19.3 -11.7,11.9 -17.6,25 -17.6,45.7 v 80 l -0.3,416 c 0,10.9 4.6,32.6 16.7,45.1 C 149.8,805.6 168,813 186.3,813 365.7,749.3 880.3,734.5 880.3,734.5 c 0,0 0,-255.4 0,-402.5 0,-16.9 -4.7,-35 -17.2,-47.4 -12.5,-12.4 -30.1,-17.6 -47.8,-17.6 h -310 l -79,-80 z" fill="REPLACE_FILL1"/><path d="m 175.1,810.3 79.1,-393 c 8.3,-23.6 21.8,-42.9 53.1,-43 H 920.6 c 17.7,0 35.9,19.5 33.7,29.3 l -73.7,365.7 c -9,24.8 -11.1,41.3 -51.8,44 H 185.6 c -3.6,0 -6.4,-0.1 -11.1,-0.9 z" fill="REPLACE_FILL2"/>`,
closedicon:`<path d="M 121,252 c 0,-20.7 5.9,-33.8 17.6,-45.7 C 150.3,194.4 166,187 186,187 h 240 l 79,80 -384,113 z" fill="REPLACE_FILL1"/><path d="M 186,813 c -18.4,0 -36.5,-7.4 -48.6,-19.9 C 125.3,780.6 120.7,758.9 120.7,748 L 121,332 c 0,-16.9 7.2,-31.7 18.6,-43.5 C 151,276.7 170.1,267 186,267 h 629 c 17.6,0 35.2,5.3 47.8,17.6 C 875.3,297 880,315.1 880,332 v 416 c 0,14.8 -3.4,36.6 -17,47.9 C 849.5,807.2 830.9,813 815,813 Z" fill="REPLACE_FILL2"/>`},
{openicon:`<path d="M 160,253 h 614 c 14.8,0 29.7,8.6 36.9,15.8 C 819.4,277.3 826,289.4 826,305 v 95 H 160 Z" fill="REPLACE_FILL2"/><path d="M 199,200 c -26.2,0 -33.9,6.5 -41.5,15.6 C 149.8,224.8 147,231.8 147,252 V 386.7 387 c -20.9,0.5 -56.5,-3.5 -70.3,6.9 -2.5,1.9 -5.4,3.2 -8.3,9.8 -6.8,25.6 -0.3,54.8 1.1,70.3 9.1,59.2 69.1,294.7 74.9,310 3.7,9.8 4.6,13.6 10,15 h 689.6 c 6.3,-1.4 11.6,-15 11.6,-15 L 931.8,474 c 2.7,-20 8.3,-54 -0.2,-70.3 -2,-3.5 -6.5,-8.1 -9.3,-9.8 C 902.5,385.1 881.9,387 853,387 852.6,369.4 855,346.8 846.6,333 842.4,326.2 830.5,321.3 826,321.3 V 387 L 173.2,386.7 173,387 v -82 c 0,-14.6 2.8,-25.9 12.4,-35.5 C 195.9,259 207.7,253 225,253 h 201 l -54,-53 z" fill="REPLACE_FILL1"/>`,
closedicon:`<path d="M 160,400 V 253 h 440 v 147 z" fill="REPLACE_FILL2"/><path d="M 186,799 c -24.2,0 -34,-8 -39.7,-13.6 C 140.8,779.9 134,769.1 134,747 V 372 c 0,-21.5 13,-32 13,-32 V 252 c 0,-20.2 2.8,-27.2 10.5,-36.4 C 165.1,206.5 172.8,200 199,200 h 173 l 54,53 H 225 c -17.3,0 -29.1,6 -39.6,16.5 C 175.8,279.1 173,290.4 173,305 l -0.4,19 c 0,0 9.6,-4 20.9,-4 H 494 L 614,200 h 186 c 17.7,0 26.6,7.1 36,14.2 C 846.5,222 852,233.6 852,252 v 495 c 0,16.1 -7.5,30.2 -14.1,36.7 C 831.4,790.2 815.9,799 800,799 Z" fill="REPLACE_FILL1"/>`}
{openicon: `<path d="M 200,390 H 955 L 795,770 H 200 Z" fill="REPLACE_FILL2"/><path d="M 176.6,811 C 163.9,811 155.1,802.6 155,784.7 V 212.9 C 157.9,190.5 169,179.8 195.9,176 h 246 c 20.3,3.2 34.5,18.7 41,28.6 C 494.9,228.3 492.9,240.4 494,266 l 313.6,1.3 c 17.6,0.4 23.3,3.7 23.3,3.7 8.6,4.2 14.8,10.7 19,19.5 C 856.3,319.5 854,360 854,360 h 108.9 c 4.4,2.4 13.7,1.2 11.8,23.5 L 815.8,789.4 c -2.1,5.2 -12.5,13.6 -18.7,16.1 -6.8,2.7 -18.5,5.5 -23.9,5.5 z M 767,759 897,430 H 360 L 230,759 Z" fill="REPLACE_FILL1"/>`,
closedicon: `<path d="M 175,320 V 790 H 820 V 320 Z" fill="REPLACE_FILL2"/><path d="M 183,811 c -12.2,-0.6 -17.9,-4.8 -21.5,-8.2 C 159.5,801 154.8,792.6 155,779.7 V 215.6 c 3.3,-14.1 9.3,-21.4 15.1,-26.4 7.4,-6.3 16,-11.6 36.7,-13.2 h 237.3 c 23.3,6 32.2,18.7 38.7,28.6 7.6,11.7 9.4,18.6 10.3,41.4 L 494,266 h 313.4 c 16.9,0.1 23.5,5.1 23.5,5.1 8.6,4.2 14.5,10.9 19,19.5 0,0 3.7,7.5 3.1,19.8 V 777.2 c -1.1,9 -4.1,13.7 -4.1,13.7 -4.2,8.6 -10.7,14.8 -19.5,19 L 823.3,811 Z m 602.8,-55 c 2.8,-1.7 6.9,-4.5 8.9,-7.4 2.4,-3.6 5,-10.8 5.4,-24.7 V 362 c -0.2,-10.9 -4.2,-16.3 -4.2,-16.3 -2,-3 -5.9,-6.8 -8.7,-8.6 0,0 -5.8,-3 -12.7,-3.2 h -548.1 c -7.8,0 -13.9,3.6 -13.9,3.6 -3,2 -7.3,6.7 -8.4,17.3 v 386.4 c 2.8,10.4 7.5,16 13.6,17.7 h 544.9 c 11,-0.2 18.4,-1.9 23.3,-3 z" fill="REPLACE_FILL1"/>`},
{openicon: `<path d="M 167,200 h 200 l 50,50 H 829.8 L 830,330 H 970 L 825,779 H 167 Z" fill="REPLACE_FILL2"/><path d="M 184,799 c -10.5,0 -22.3,-5.3 -27,-10 -4.7,-4.7 -9,-15.1 -9,-34 V 212 c 0,-13.3 5,-22 11,-28 4.4,-4.4 15.4,-10 30,-10 h 170.3 l 53.3,53 H 820 c 13.1,0 18.2,4.2 25,10 6.4,5.5 7,14.4 7,31 v 52 h 122.3 c 11.6,0 17.1,3.3 17.1,3.3 2.9,2.9 3.3,4.4 3.3,14.2 0,8.4 -0.9,13.5 -3.8,22.4 L 849,799 Z M 933,360 H 335 l -130,398.1 603.2,1.3 z M 289.7,334.6 c 3,-8.2 8,-14.8 17,-14.8 0,0 506.6,0.2 506.3,0.2 0,-39.8 -12.2,-53 -53,-53 L 403.3,266.7 350,213 H 240 c -37.6,0 -53,10.1 -53,53 v 382.7 z" fill="REPLACE_FILL1"/>`,
closedicon: `<path d="M 173,190 V 771 H 825 V 250 H 420 l -70,-60 z" fill="REPLACE_FILL2"/><path d="M 184.2,799 C 170.3,799 164.3,795.8 157.4,788.9 151.7,783.3 148,774.6 148,754.9 V 211.2 c 0.7,-18.6 6,-21.7 11.9,-27.6 6.8,-6.8 15.5,-9.4 29.3,-9.6 h 170.1 l 53.3,53 h 407.7 c 14.1,0 18.6,2.8 25.3,9.4 6.4,6.4 7.1,13.4 7.1,30.8 v 246.1 247.4 c 0.2,11.8 -1.9,22.1 -7.4,27.6 C 839.7,793.9 831,799 819.4,799 Z M 813,707 V 415 c 0,-36.9 -13.9,-53 -53,-53 H 240 c -38.1,0 -53,11.7 -53,53 v 292 c 0,38.8 11.5,53 53,53 h 520 c 37.8,0 53,-12.1 53,-53 z M 760,267 c 0,0 -228.6,-0.3 -356.7,-0.3 L 350,213 H 240 c -41.6,2.7 -52.2,14.3 -53,53 v 54 h 626 c -0.6,-37.5 -12,-53 -53,-53 z" fill="REPLACE_FILL1"/>`},
{openicon: `<path d="M 307,330 H 970 L 825,779 H 167 Z" fill="REPLACE_FILL2"/><path d="M 189 174 C 174.4 174 163.4 179.6 159 184 C 153 190 148 198.7 148 212 L 148 755 C 148 773.9 152.3 784.3 157 789 C 161.7 793.7 173.5 799 184 799 L 849 799 L 990.8 359.8 C 993.8 350.9 994.7 345.9 994.7 337.4 C 994.7 327.6 994.3 326.2 991.4 323.3 C 991.4 323.3 985.9 320 974.3 320 L 852 320 L 852 268 C 852 251.4 851.4 242.5 845 237 C 838.2 231.2 833.1 227 820 227 L 412.6 227 L 359.3 174 L 189 174 z M 335 360 L 933 360 L 808.2 759.3 L 205 758.1 L 335 360 z" fill="REPLACE_FILL1"/>`,
closedicon: `<path d="M 173,345 V 771 H 825 V 345 Z" fill="REPLACE_FILL2"/><path d="M 189.2 174 C 175.4 174.2 166.7 176.8 159.9 183.6 C 154 189.5 148.7 192.7 148 211.2 L 148 754.9 C 148 774.6 151.7 783.3 157.4 788.9 C 164.3 795.8 170.3 799 184.2 799 L 819.4 799 C 831 799 839.7 793.9 845.2 788.4 C 850.8 782.8 852.9 772.5 852.7 760.8 L 852.7 513.3 L 852.7 267.2 C 852.7 249.8 852 242.8 845.6 236.4 C 838.9 229.7 834.4 227 820.3 227 L 412.6 227 L 359.3 174 L 189.2 174 z M 240 362 L 760 362 C 799.1 362 813 378.1 813 415 L 813 707 C 813 747.9 797.8 760 760 760 L 240 760 C 198.5 760 187 745.8 187 707 L 187 415 C 187 373.7 201.9 362 240 362 z" fill="REPLACE_FILL1"/>`},
{openicon: `<path d="M 167,200 h 200 l 50,50 H 829.8 L 830,330 H 314 L 167,779 Z" fill="REPLACE_FILL2"/><path d="M 189 174 C 174.4 174 163.4 179.6 159 184 C 153 190 148 198.7 148 212 L 148 755 C 148 773.9 152.3 784.3 157 789 C 161.7 793.7 173.5 799 184 799 L 849 799 L 990.8 359.8 C 993.8 350.9 994.7 345.9 994.7 337.4 C 994.7 327.6 994.3 326.2 991.4 323.3 C 991.4 323.3 985.9 320 974.3 320 L 852 320 L 852 268 C 852 251.4 851.4 242.5 845 237 C 838.2 231.2 833.1 227 820 227 L 412.6 227 L 359.3 174 L 189 174 z M 240 213 L 350 213 L 403.3 266.7 L 760 267 C 800.8 267 813 280.2 813 320 C 813.3 320 306.7 319.8 306.7 319.8 C 297.7 319.8 292.7 326.4 289.7 334.6 L 187 648.7 L 187 266 C 187 223.1 202.4 213 240 213 z" fill="REPLACE_FILL1"/>`,
closedicon: `<path d="M 173,190 V 350 H 825 V 250 H 420 l -70,-60 z" fill="REPLACE_FILL2"/><path d="M 189.2 174 C 175.4 174.2 166.7 176.8 159.9 183.6 C 154 189.5 148.7 192.7 148 211.2 L 148 754.9 C 148 774.6 151.7 783.3 157.4 788.9 C 164.3 795.8 170.3 799 184.2 799 L 819.4 799 C 831 799 839.7 793.9 845.2 788.4 C 850.8 782.8 852.9 772.5 852.7 760.8 L 852.7 513.3 L 852.7 267.2 C 852.7 249.8 852 242.8 845.6 236.4 C 838.9 229.7 834.4 227 820.3 227 L 412.6 227 L 359.3 174 L 189.2 174 z M 240 213 L 350 213 L 403.3 266.7 C 531.4 266.7 760 267 760 267 C 801 267 812.4 282.5 813 320 L 187 320 L 187 266 C 187.8 227.3 198.4 215.7 240 213 z" fill="REPLACE_FILL1"/>`},
{openicon: `<path d="M 132,305 H 880 V 750 H 132 Z" fill="REPLACE_FILL2"/><path d="M 135,188 c -5.6,0 -13.9,2.9 -19.8,8.9 C 109.4,203 107,206.8 107,216 c 0,189.7 0,379.3 0,569 0,11.1 1.7,14.8 7,20.2 C 120.5,811.6 125.4,813 135,813 h 717 c 16.7,0 16.7,-1.6 18.6,-6.6 L 981.3,423.4 c 0,-5.8 -1,-6.2 -2.8,-8.1 -1.9,-1.9 -4.3,-2 -11.9,-2 l -691.9,2.1 c -16.4,0 -21.3,11.5 -23.4,17.2 l -80.9,263 -0.2,0 C 159.1,714.4 147,704.3 147,677.2 V 334 h 733 v -26 c 0,-7.7 -1.6,-14.7 -7.6,-19.8 C 866.3,283.1 860.4,280 852,280 H 440 l -20,-82 c -1.2,-2.5 -3.1,-6.8 -5.8,-7.7 0,0 -3,-2.3 -10.2,-2.3 z" fill="REPLACE_FILL1"/>`,
closedicon: `<path d="M 132,305 H 880 V 750 H 132 Z" fill="REPLACE_FILL2"/><path d="M 135,813 c -10.3,0 -14.5,-1.4 -21,-7.8 C 108.7,799.8 107,796.1 107,785 c 0,-189.7 0,-379.3 0,-569 0,-9.2 2.4,-13 8.2,-19.1 C 121.1,190.9 129.4,188 135,188 h 269 c 7.2,0 10.2,2.3 10.2,2.3 2.7,0.9 4.6,5.2 5.8,7.7 l 20,82 h 412 c 8.4,0 14.3,3.1 20.4,8.2 C 878.4,293.3 880,300.3 880,308 v 26 H 147 v 343.2 c 0,27.1 18.1,25.2 21.7,5.4 l 32.7,-277.7 c 0.7,-2.8 2.7,-7.5 5.8,-10.6 C 210.4,391.1 214.5,388 222.7,388 H 852 c 7.9,0 15.9,2.9 20.5,7.5 C 878.3,401.3 880,408.6 880,416 v 369 c 0,6.9 -1.8,14.7 -7.4,19.3 C 866.2,809.6 858.9,813 852,813 Z" fill="REPLACE_FILL1"/>`},
{openicon: `<path d="M 186.3,187 c -20,0 -35.7,7.4 -47.4,19.3 -11.7,11.9 -17.6,25 -17.6,45.7 v 80 l -0.3,416 c 0,10.9 4.6,32.6 16.7,45.1 C 149.8,805.6 168,813 186.3,813 365.7,749.3 880.3,734.5 880.3,734.5 c 0,0 0,-255.4 0,-402.5 0,-16.9 -4.7,-35 -17.2,-47.4 -12.5,-12.4 -30.1,-17.6 -47.8,-17.6 h -310 l -79,-80 z" fill="REPLACE_FILL1"/><path d="m 175.1,810.3 79.1,-393 c 8.3,-23.6 21.8,-42.9 53.1,-43 H 920.6 c 17.7,0 35.9,19.5 33.7,29.3 l -73.7,365.7 c -9,24.8 -11.1,41.3 -51.8,44 H 185.6 c -3.6,0 -6.4,-0.1 -11.1,-0.9 z" fill="REPLACE_FILL2"/>`,
closedicon: `<path d="M 121,252 c 0,-20.7 5.9,-33.8 17.6,-45.7 C 150.3,194.4 166,187 186,187 h 240 l 79,80 -384,113 z" fill="REPLACE_FILL1"/><path d="M 186,813 c -18.4,0 -36.5,-7.4 -48.6,-19.9 C 125.3,780.6 120.7,758.9 120.7,748 L 121,332 c 0,-16.9 7.2,-31.7 18.6,-43.5 C 151,276.7 170.1,267 186,267 h 629 c 17.6,0 35.2,5.3 47.8,17.6 C 875.3,297 880,315.1 880,332 v 416 c 0,14.8 -3.4,36.6 -17,47.9 C 849.5,807.2 830.9,813 815,813 Z" fill="REPLACE_FILL2"/>`},
{openicon: `<path d="M 160,253 h 614 c 14.8,0 29.7,8.6 36.9,15.8 C 819.4,277.3 826,289.4 826,305 v 95 H 160 Z" fill="REPLACE_FILL2"/><path d="M 199,200 c -26.2,0 -33.9,6.5 -41.5,15.6 C 149.8,224.8 147,231.8 147,252 V 386.7 387 c -20.9,0.5 -56.5,-3.5 -70.3,6.9 -2.5,1.9 -5.4,3.2 -8.3,9.8 -6.8,25.6 -0.3,54.8 1.1,70.3 9.1,59.2 69.1,294.7 74.9,310 3.7,9.8 4.6,13.6 10,15 h 689.6 c 6.3,-1.4 11.6,-15 11.6,-15 L 931.8,474 c 2.7,-20 8.3,-54 -0.2,-70.3 -2,-3.5 -6.5,-8.1 -9.3,-9.8 C 902.5,385.1 881.9,387 853,387 852.6,369.4 855,346.8 846.6,333 842.4,326.2 830.5,321.3 826,321.3 V 387 L 173.2,386.7 173,387 v -82 c 0,-14.6 2.8,-25.9 12.4,-35.5 C 195.9,259 207.7,253 225,253 h 201 l -54,-53 z" fill="REPLACE_FILL1"/>`,
closedicon: `<path d="M 160,400 V 253 h 440 v 147 z" fill="REPLACE_FILL2"/><path d="M 186,799 c -24.2,0 -34,-8 -39.7,-13.6 C 140.8,779.9 134,769.1 134,747 V 372 c 0,-21.5 13,-32 13,-32 V 252 c 0,-20.2 2.8,-27.2 10.5,-36.4 C 165.1,206.5 172.8,200 199,200 h 173 l 54,53 H 225 c -17.3,0 -29.1,6 -39.6,16.5 C 175.8,279.1 173,290.4 173,305 l -0.4,19 c 0,0 9.6,-4 20.9,-4 H 494 L 614,200 h 186 c 17.7,0 26.6,7.1 36,14.2 C 846.5,222 852,233.6 852,252 v 495 c 0,16.1 -7.5,30.2 -14.1,36.7 C 831.4,790.2 815.9,799 800,799 Z" fill="REPLACE_FILL1"/>`}
];
var folderGuildContent = null;
@ -233,7 +233,7 @@ module.exports = (_ => {
}
};
var redCross = `'data:image/svg+xml; base64, PHN2ZyB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSI0MDAiIGhlaWdodD0iNDAwIj48cGF0aCBkPSJNNDAuNDAwIDE3LjE3OCBDIDM5Ljg1MCAxNy4zNjYsMzguNzkzIDE3LjUzOCwzOC4wNTAgMTcuNTYwIEMgMzMuMzUxIDE3LjY5OSwyMy4zOTcgMjQuNzg4LDIxLjM4MSAyOS40MzIgQyAyMS4wODcgMzAuMTA5LDIwLjU2NiAzMC44OTYsMjAuMjIzIDMxLjE4MSBDIDE5Ljg4MCAzMS40NjUsMTkuNjAwIDMxLjg2NiwxOS42MDAgMzIuMDcxIEMgMTkuNjAwIDMyLjI3NiwxOS4yMzYgMzMuMjQyLDE4Ljc5MiAzNC4yMTggQyAxNi4zNDUgMzkuNTg5LDE2LjM0NSA0OS42MTEsMTguNzkyIDU0Ljk4MiBDIDE5LjIzNiA1NS45NTgsMTkuNjAwIDU2LjkxOCwxOS42MDAgNTcuMTE2IEMgMTkuNjAwIDU3LjMxNCwxOS45NjAgNTcuODAyLDIwLjQwMCA1OC4yMDAgQyAyMC44NDAgNTguNTk4LDIxLjIwMCA1OS4xMzEsMjEuMjAwIDU5LjM4NSBDIDIxLjIwMCA2MC4zOTEsMjUuNjgwIDY0Ljk0Miw5MS41MDUgMTMwLjgwMCBDIDEyOC45OTUgMTY4LjMxMCwxNTkuODQ5IDE5OS4zMjYsMTYwLjA2OCAxOTkuNzI0IEMgMTYwLjQwOSAyMDAuMzQ0LDE1MC45NTAgMjA5Ljk2NCw5My45ODkgMjY2LjkyNCBDIDE4Ljc5OCAzNDIuMTEzLDE5LjYwMCAzNDEuMjkyLDE5LjYwMCAzNDMuMTI2IEMgMTkuNjAwIDM0My4yODMsMTkuMjUwIDM0NC4wNjUsMTguODIyIDM0NC44NjQgQyAxNS40MjkgMzUxLjE5NSwxNS45NTggMzYyLjkxOCwxOS45MzIgMzY5LjQ0MCBDIDIyLjA5NCAzNzIuOTkwLDI3LjQ3NCAzNzguODAwLDI4LjU5OCAzNzguODAwIEMgMjguODYxIDM3OC44MDAsMjkuNDAyIDM3OS4xNjAsMjkuODAwIDM3OS42MDAgQyAzMC4xOTggMzgwLjA0MCwzMC43MDMgMzgwLjQwMCwzMC45MjIgMzgwLjQwMCBDIDMxLjE0MSAzODAuNDAwLDMyLjIzOCAzODAuODMxLDMzLjM2MCAzODEuMzU4IEMgMzQuNDgyIDM4MS44ODYsMzYuNDgwIDM4Mi41MzMsMzcuODAwIDM4Mi43OTcgQyA0My43ODYgMzgzLjk5NCw0NC4zMjMgMzg0LjAyNyw0Ny4yOTkgMzgzLjM4NiBDIDQ4Ljg5NSAzODMuMDQyLDUxLjAxMCAzODIuNjE5LDUyLjAwMCAzODIuNDQ2IEMgNTIuOTkwIDM4Mi4yNzQsNTQuNTE3IDM4MS43NDMsNTUuMzk0IDM4MS4yNjYgQyA1Ni4yNzEgMzgwLjc5MCw1Ny4xODggMzgwLjQwMCw1Ny40MzIgMzgwLjQwMCBDIDU3LjY3NiAzODAuNDAwLDU4LjIwMiAzODAuMDQwLDU4LjYwMCAzNzkuNjAwIEMgNTguOTk4IDM3OS4xNjAsNTkuNTk4IDM3OC44MDAsNTkuOTMyIDM3OC44MDAgQyA2MC4yNjcgMzc4LjgwMCw5MS43MjUgMzQ3LjYxNSwxMjkuODM5IDMwOS41MDAgQyAxNjkuMDU3IDI3MC4yODEsMTk5LjQ5NiAyNDAuMTQ1LDE5OS45NjQgMjQwLjA3MyBDIDIwMC42MDIgMjM5Ljk3NSwyMTYuMDAxIDI1NS4xOTMsMjY3LjQ5NSAzMDYuODE0IEMgMzI3LjA0NiAzNjYuNTExLDMzOS41MzEgMzc4LjgwMCwzNDAuNjI3IDM3OC44MDAgQyAzNDAuNzk4IDM3OC44MDAsMzQxLjI2NSAzNzkuMDk3LDM0MS42NjcgMzc5LjQ2MSBDIDM0NS43MjggMzgzLjEzNiwzNjEuMDEzIDM4NC40MDksMzY1LjY4NSAzODEuNDYxIEMgMzY2LjE4OCAzODEuMTQzLDM2Ny4wMjQgMzgwLjc1NywzNjcuNTQxIDM4MC42MDIgQyAzNzAuNTgzIDM3OS42OTEsMzc2LjYyMyAzNzQuMjAwLDM3OS4zODIgMzY5LjgzNiBDIDM4NS4xMDUgMzYwLjc4NSwzODQuMDM5IDM0Ni40MDksMzc3LjAzOSAzMzguMjI4IEMgMzc2LjA4NCAzMzcuMTEzLDM0NC44NDYgMzA1Ljc0MywzMDcuNjIxIDI2OC41MTcgQyAyNTUuMzI5IDIxNi4yMjQsMjM5Ljk2OSAyMDAuNjQ3LDI0MC4wNzAgMjAwLjAwOSBDIDI0MC4xNDMgMTk5LjU0NSwyNzAuMDYyIDE2OS4yODgsMzA4LjIxNiAxMzEuMDkxIEMgMzQ1LjYyNSA5My42NDEsMzc2LjcyMyA2Mi4zNzAsMzc3LjMyNCA2MS42MDAgQyAzODQuMjg2IDUyLjY3OCwzODUuMDM2IDQwLjYyMSwzNzkuMjc3IDMwLjE3MSBDIDM3Ni4xMzYgMjQuNDY5LDM2Ny45MDYgMTguNTM3LDM2MS42NjggMTcuNDc3IEMgMzU0LjY1NiAxNi4yODYsMzQ1LjA5NSAxNy42NjUsMzQxLjg4MyAyMC4zMzEgQyAzNDEuNTY3IDIwLjU5NCwzNDAuNTQ5IDIxLjMxOCwzMzkuNjIyIDIxLjk0MSBDIDMzOC42OTUgMjIuNTYzLDMwNy4wMzEgNTMuOTcyLDI2OS4yNTkgOTEuNzM3IEMgMjMxLjQ4NiAxMjkuNTAxLDIwMC4zMzAgMTYwLjQwMCwyMDAuMDIyIDE2MC40MDAgQyAxOTkuNzE0IDE2MC40MDAsMTY4LjkzOCAxMjkuODY5LDEzMS42MzEgOTIuNTU0IEMgNTYuMjI1IDE3LjEzMSw2MC4yODggMjEuMDQ3LDU1LjIwMCAxOC44ODcgQyA1MS41OTEgMTcuMzU0LDQyLjgzNiAxNi4zNDMsNDAuNDAwIDE3LjE3OHoiIGZpbGw9InJnYigyNDAsIDcxLCA3MSkiPjwvcGF0aD48L3N2Zz4='`;
var redCross = `'data: image/svg+xml; base64, PHN2ZyB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSI0MDAiIGhlaWdodD0iNDAwIj48cGF0aCBkPSJNNDAuNDAwIDE3LjE3OCBDIDM5Ljg1MCAxNy4zNjYsMzguNzkzIDE3LjUzOCwzOC4wNTAgMTcuNTYwIEMgMzMuMzUxIDE3LjY5OSwyMy4zOTcgMjQuNzg4LDIxLjM4MSAyOS40MzIgQyAyMS4wODcgMzAuMTA5LDIwLjU2NiAzMC44OTYsMjAuMjIzIDMxLjE4MSBDIDE5Ljg4MCAzMS40NjUsMTkuNjAwIDMxLjg2NiwxOS42MDAgMzIuMDcxIEMgMTkuNjAwIDMyLjI3NiwxOS4yMzYgMzMuMjQyLDE4Ljc5MiAzNC4yMTggQyAxNi4zNDUgMzkuNTg5LDE2LjM0NSA0OS42MTEsMTguNzkyIDU0Ljk4MiBDIDE5LjIzNiA1NS45NTgsMTkuNjAwIDU2LjkxOCwxOS42MDAgNTcuMTE2IEMgMTkuNjAwIDU3LjMxNCwxOS45NjAgNTcuODAyLDIwLjQwMCA1OC4yMDAgQyAyMC44NDAgNTguNTk4LDIxLjIwMCA1OS4xMzEsMjEuMjAwIDU5LjM4NSBDIDIxLjIwMCA2MC4zOTEsMjUuNjgwIDY0Ljk0Miw5MS41MDUgMTMwLjgwMCBDIDEyOC45OTUgMTY4LjMxMCwxNTkuODQ5IDE5OS4zMjYsMTYwLjA2OCAxOTkuNzI0IEMgMTYwLjQwOSAyMDAuMzQ0LDE1MC45NTAgMjA5Ljk2NCw5My45ODkgMjY2LjkyNCBDIDE4Ljc5OCAzNDIuMTEzLDE5LjYwMCAzNDEuMjkyLDE5LjYwMCAzNDMuMTI2IEMgMTkuNjAwIDM0My4yODMsMTkuMjUwIDM0NC4wNjUsMTguODIyIDM0NC44NjQgQyAxNS40MjkgMzUxLjE5NSwxNS45NTggMzYyLjkxOCwxOS45MzIgMzY5LjQ0MCBDIDIyLjA5NCAzNzIuOTkwLDI3LjQ3NCAzNzguODAwLDI4LjU5OCAzNzguODAwIEMgMjguODYxIDM3OC44MDAsMjkuNDAyIDM3OS4xNjAsMjkuODAwIDM3OS42MDAgQyAzMC4xOTggMzgwLjA0MCwzMC43MDMgMzgwLjQwMCwzMC45MjIgMzgwLjQwMCBDIDMxLjE0MSAzODAuNDAwLDMyLjIzOCAzODAuODMxLDMzLjM2MCAzODEuMzU4IEMgMzQuNDgyIDM4MS44ODYsMzYuNDgwIDM4Mi41MzMsMzcuODAwIDM4Mi43OTcgQyA0My43ODYgMzgzLjk5NCw0NC4zMjMgMzg0LjAyNyw0Ny4yOTkgMzgzLjM4NiBDIDQ4Ljg5NSAzODMuMDQyLDUxLjAxMCAzODIuNjE5LDUyLjAwMCAzODIuNDQ2IEMgNTIuOTkwIDM4Mi4yNzQsNTQuNTE3IDM4MS43NDMsNTUuMzk0IDM4MS4yNjYgQyA1Ni4yNzEgMzgwLjc5MCw1Ny4xODggMzgwLjQwMCw1Ny40MzIgMzgwLjQwMCBDIDU3LjY3NiAzODAuNDAwLDU4LjIwMiAzODAuMDQwLDU4LjYwMCAzNzkuNjAwIEMgNTguOTk4IDM3OS4xNjAsNTkuNTk4IDM3OC44MDAsNTkuOTMyIDM3OC44MDAgQyA2MC4yNjcgMzc4LjgwMCw5MS43MjUgMzQ3LjYxNSwxMjkuODM5IDMwOS41MDAgQyAxNjkuMDU3IDI3MC4yODEsMTk5LjQ5NiAyNDAuMTQ1LDE5OS45NjQgMjQwLjA3MyBDIDIwMC42MDIgMjM5Ljk3NSwyMTYuMDAxIDI1NS4xOTMsMjY3LjQ5NSAzMDYuODE0IEMgMzI3LjA0NiAzNjYuNTExLDMzOS41MzEgMzc4LjgwMCwzNDAuNjI3IDM3OC44MDAgQyAzNDAuNzk4IDM3OC44MDAsMzQxLjI2NSAzNzkuMDk3LDM0MS42NjcgMzc5LjQ2MSBDIDM0NS43MjggMzgzLjEzNiwzNjEuMDEzIDM4NC40MDksMzY1LjY4NSAzODEuNDYxIEMgMzY2LjE4OCAzODEuMTQzLDM2Ny4wMjQgMzgwLjc1NywzNjcuNTQxIDM4MC42MDIgQyAzNzAuNTgzIDM3OS42OTEsMzc2LjYyMyAzNzQuMjAwLDM3OS4zODIgMzY5LjgzNiBDIDM4NS4xMDUgMzYwLjc4NSwzODQuMDM5IDM0Ni40MDksMzc3LjAzOSAzMzguMjI4IEMgMzc2LjA4NCAzMzcuMTEzLDM0NC44NDYgMzA1Ljc0MywzMDcuNjIxIDI2OC41MTcgQyAyNTUuMzI5IDIxNi4yMjQsMjM5Ljk2OSAyMDAuNjQ3LDI0MC4wNzAgMjAwLjAwOSBDIDI0MC4xNDMgMTk5LjU0NSwyNzAuMDYyIDE2OS4yODgsMzA4LjIxNiAxMzEuMDkxIEMgMzQ1LjYyNSA5My42NDEsMzc2LjcyMyA2Mi4zNzAsMzc3LjMyNCA2MS42MDAgQyAzODQuMjg2IDUyLjY3OCwzODUuMDM2IDQwLjYyMSwzNzkuMjc3IDMwLjE3MSBDIDM3Ni4xMzYgMjQuNDY5LDM2Ny45MDYgMTguNTM3LDM2MS42NjggMTcuNDc3IEMgMzU0LjY1NiAxNi4yODYsMzQ1LjA5NSAxNy42NjUsMzQxLjg4MyAyMC4zMzEgQyAzNDEuNTY3IDIwLjU5NCwzNDAuNTQ5IDIxLjMxOCwzMzkuNjIyIDIxLjk0MSBDIDMzOC42OTUgMjIuNTYzLDMwNy4wMzEgNTMuOTcyLDI2OS4yNTkgOTEuNzM3IEMgMjMxLjQ4NiAxMjkuNTAxLDIwMC4zMzAgMTYwLjQwMCwyMDAuMDIyIDE2MC40MDAgQyAxOTkuNzE0IDE2MC40MDAsMTY4LjkzOCAxMjkuODY5LDEzMS42MzEgOTIuNTU0IEMgNTYuMjI1IDE3LjEzMSw2MC4yODggMjEuMDQ3LDU1LjIwMCAxOC44ODcgQyA1MS41OTEgMTcuMzU0LDQyLjgzNiAxNi4zNDMsNDAuNDAwIDE3LjE3OHoiIGZpbGw9InJnYigyNDAsIDcxLCA3MSkiPjwvcGF0aD48L3N2Zz4='`;
const folderIconCustomPreviewComponent = class FolderIconCustomPreview extends BdApi.React.Component {
componentDidMount() {
@ -248,14 +248,14 @@ module.exports = (_ => {
checkImage(base64OrUrl, callback) {
if (base64OrUrl.indexOf("https://") == 0 || base64OrUrl.indexOf("http://") == 0) BDFDB.LibraryRequires.request(base64OrUrl.trim(), (error, response, body) => {
if (response && response.headers["content-type"] && response.headers["content-type"].indexOf("image") != -1 && response.headers["content-type"] != "image/gif") {
this.resizeImage("data:" + response.headers["content-type"] + ";base64," + (new Buffer(body).toString("base64")), callback);
this.resizeImage("data: " + response.headers["content-type"] + ";base64," + (new Buffer(body).toString("base64")), callback);
}
else callback(base64OrUrl);
});
else this.resizeImage(base64OrUrl, callback);
}
resizeImage(base64, callback) {
let type = base64.split("data:").slice(1).join(" ").split(";")[0];
let type = base64.split("data: ").slice(1).join(" ").split(";")[0];
if (type == "image/gif") callback(base64);
else {
let img = new Image();
@ -342,7 +342,7 @@ module.exports = (_ => {
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Button, {
children: BDFDB.LanguageUtils.LanguageStrings.ADD,
onClick: (e, instance) => {
let inputIns = BDFDB.ReactUtils.findOwner(this, {name: "BDFDB_TextInput", all:true, unlimited:true});
let inputIns = BDFDB.ReactUtils.findOwner(this, {name: "BDFDB_TextInput", all: true, unlimited: true});
if (inputIns.length == 2 && inputIns[0].props.value && inputIns[1].props.value) {
this.checkImage(inputIns[0].props.value, openIcon => {
this.checkImage(inputIns[1].props.value, closedIcon => {
@ -351,11 +351,11 @@ module.exports = (_ => {
this.props.open = null;
this.props.closed = null;
BDFDB.PatchUtils.forceAllUpdates(_this, "GuildFolderSettingsModal");
BDFDB.NotificationUtils.toast("Custom Icon was added to selection", {type:"success"});
BDFDB.NotificationUtils.toast("Custom Icon was added to selection", {type: "success"});
});
})
}
else BDFDB.NotificationUtils.toast("Add an image for the open and the closed icon", {type:"danger"});
else BDFDB.NotificationUtils.toast("Add an image for the open and the closed icon", {type: "danger"});
}
})
]
@ -375,13 +375,13 @@ module.exports = (_ => {
this.defaults = {
settings: {
closeOtherFolders: {value:false, description:"Close other folders when opening a folder"},
closeTheFolder: {value:false, description:"Close the folder when selecting a server"},
closeAllFolders: {value:false, description:"Close all folders when selecting a server"},
forceOpenFolder: {value:false, description:"Force a folder to open when switching to a server of that folder"},
showCountBadge: {value:true, description:"Display badge for amount of servers in a folder"},
extraColumn: {value:true, description:"Move the servers from opened folders in an extra column"},
addSeparators: {value:true, description:"Add separators between servers of different folders in extra column"}
closeOtherFolders: {value: false, description: "Close other folders when opening a folder"},
closeTheFolder: {value: false, description: "Close the folder when selecting a server"},
closeAllFolders: {value: false, description: "Close all folders when selecting a server"},
forceOpenFolder: {value: false, description: "Force a folder to open when switching to a server of that folder"},
showCountBadge: {value: true, description: "Display badge for amount of servers in a folder"},
extraColumn: {value: true, description: "Move the servers from opened folders in an extra column"},
addSeparators: {value: true, description: "Add separators between servers of different folders in extra column"}
}
};
@ -614,7 +614,7 @@ module.exports = (_ => {
action: state => {
data.muteFolder = state;
BDFDB.DataUtils.save(data, this, "folders", e.instance.props.folderId);
for (let guildId of folder.guildIds) if (BDFDB.LibraryModules.MutedUtils.isGuildOrCategoryOrChannelMuted(guildId) != state) BDFDB.LibraryModules.GuildNotificationsUtils.updateGuildNotificationSettings(guildId, {muted:state, suppress_everyone:state, suppress_roles:state});
for (let guildId of folder.guildIds) if (BDFDB.LibraryModules.MutedUtils.isGuildOrCategoryOrChannelMuted(guildId) != state) BDFDB.LibraryModules.GuildNotificationsUtils.updateGuildNotificationSettings(guildId, {muted: state, suppress_everyone: state, suppress_roles: state});
}
})
}));
@ -644,7 +644,7 @@ module.exports = (_ => {
processGuilds (e) {
if (settings.extraColumn) {
let topBar = BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["className", BDFDB.disCN.guildswrapperunreadmentionsbartop]]});
let topBar = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.guildswrapperunreadmentionsbartop]]});
if (topBar) {
let topIsVisible = topBar.props.isVisible;
topBar.props.isVisible = (...args) => {
@ -653,7 +653,7 @@ module.exports = (_ => {
return topIsVisible(...args);
};
}
let bottomBar = BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["className", BDFDB.disCN.guildswrapperunreadmentionsbarbottom]]});
let bottomBar = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.guildswrapperunreadmentionsbarbottom]]});
if (bottomBar) {
let bottomIsVisible = bottomBar.props.isVisible;
bottomBar.props.isVisible = (...args) => {
@ -671,7 +671,7 @@ module.exports = (_ => {
else BDFDB.DOMUtils.removeClassFromDOM(BDFDB.disCN._serverfoldersfoldercontentisopen);
let data = this.getFolderConfig(e.instance.props.folderId);
if (data.muteFolder) for (let guildId of e.instance.props.guildIds) if (!BDFDB.LibraryModules.MutedUtils.isGuildOrCategoryOrChannelMuted(guildId)) BDFDB.LibraryModules.GuildNotificationsUtils.updateGuildNotificationSettings(guildId, {muted:true, suppress_everyone:true});
if (data.muteFolder) for (let guildId of e.instance.props.guildIds) if (!BDFDB.LibraryModules.MutedUtils.isGuildOrCategoryOrChannelMuted(guildId)) BDFDB.LibraryModules.GuildNotificationsUtils.updateGuildNotificationSettings(guildId, {muted: true, suppress_everyone: true});
let state = this.getState(e.instance);
if (folderStates[e.instance.props.folderId] && !BDFDB.equals(state, folderStates[e.instance.props.folderId])) {
@ -709,7 +709,7 @@ module.exports = (_ => {
}
}
if (settings.showCountBadge) {
[children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name:"BlobMask"});
[children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "BlobMask"});
if (index > -1) {
children[index].props.upperLeftBadgeWidth = BDFDB.LibraryComponents.Badges.getBadgeWidthForValue(e.instance.props.guildIds.length);
children[index].props.upperLeftBadge = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Badges.NumberBadge, {
@ -787,7 +787,7 @@ module.exports = (_ => {
{value: this.labels.modal_tabheader4_text}
],
onItemSelect: (value, instance) => {
let tabContentInstances = BDFDB.ReactUtils.findOwner(e.instance, {name:"BDFDB_ModalTabContent", all:true, unlimited:true});
let tabContentInstances = BDFDB.ReactUtils.findOwner(e.instance, {name: "BDFDB_ModalTabContent", all: true, unlimited: true});
for (let ins of tabContentInstances) {
if (ins.props.tab == value) ins.props.open = true;
else delete ins.props.open;
@ -1009,7 +1009,7 @@ module.exports = (_ => {
svg += `</linearGradient>`;
}
svg += `${paths.replace("REPLACE_FILL1", isGradient1 ? "url(#grad1)" : BDFDB.ColorUtils.convert(color1, "RGBA")).replace("REPLACE_FILL2", isGradient2 ? "url(#grad2)" : BDFDB.ColorUtils.convert(color2, "RGBA"))}</svg>`;
return `data:image/svg+xml;base64,${btoa(svg)}`;
return `data: image/svg+xml;base64,${btoa(svg)}`;
}
openFolderCreationMenu (guilds, initGuildId) {
@ -1091,7 +1091,7 @@ module.exports = (_ => {
let oldGuildFolders = [].concat(BDFDB.LibraryModules.FolderStore.guildFolders), guildFolders = [], guildPositions = [];
for (let oldFolder of oldGuildFolders) {
if (oldFolder.folderId == folderId) {
for (let guildId of oldFolder.guildIds) guildFolders.push({guildIds:[guildId]});
for (let guildId of oldFolder.guildIds) guildFolders.push({guildIds: [guildId]});
}
else guildFolders.push(oldFolder);
}
@ -1121,7 +1121,7 @@ module.exports = (_ => {
let newFolder = Object.assign({}, oldFolder);
BDFDB.ArrayUtils.remove(newFolder.guildIds, guildId);
guildFolders.push(newFolder);
guildFolders.push({guildIds:[guildId]});
guildFolders.push({guildIds: [guildId]});
}
else guildFolders.push(oldFolder);
}

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -176,7 +176,7 @@ module.exports = (_ => {
let hiddenGuildIds = hiddenEles.servers || [];
let hiddenFolderIds = hiddenEles.folders || [];
if (hiddenGuildIds.length || hiddenFolderIds.length) {
let [children, index] = BDFDB.ReactUtils.findParent(returnvalue, {props:["folderId", "guildId"], someProps:true});
let [children, index] = BDFDB.ReactUtils.findParent(returnvalue, {props: ["folderId", "guildId"], someProps: true});
if (index > -1) for (let i in children) if (children[i] && children[i].props) {
if (children[i].props.folderId) {
if (hiddenFolderIds.includes(children[i].props.folderId)) children[i] = null;
@ -281,7 +281,7 @@ module.exports = (_ => {
BDFDB.DataUtils.save(hiddenGuildIds, this, "hidden", "servers");
hiddenFolderIds = [].concat(enabled ? [] : folders.map(n => n.folderId));
BDFDB.DataUtils.save(hiddenFolderIds, this, "hidden", "folders");
let switchInstances = BDFDB.ReactUtils.findOwner(instance, {name:"BDFDB_Switch", all:true, unlimited:true});
let switchInstances = BDFDB.ReactUtils.findOwner(instance, {name: "BDFDB_Switch", all: true, unlimited: true});
for (let switchIns of switchInstances) switchIns.props.value = enabled;
BDFDB.ReactUtils.forceUpdate(switchInstances);
BDFDB.PatchUtils.forceAllUpdates(this);

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -145,12 +145,12 @@ module.exports = (_ => {
this.defaults = {
settings: {
sortNative: {value:false, description:"Sort hidden Channels in the native Order"},
showText: {value:true, description:"Show hidden Text Channels"},
showVoice: {value:true, description:"Show hidden Voice Channels"},
showAnnouncement: {value:true, description:"Show hidden Announcement Channels"},
showStore: {value:true, description:"Show hidden Store Channels"},
showForNormal: {value:true, description:"Add Access-Overview ContextMenu Entry for non-hidden Channels"},
sortNative: {value: false, description: "Sort hidden Channels in the native Order"},
showText: {value: true, description: "Show hidden Text Channels"},
showVoice: {value: true, description: "Show hidden Voice Channels"},
showAnnouncement: {value: true, description: "Show hidden Announcement Channels"},
showStore: {value: true, description: "Show hidden Store Channels"},
showForNormal: {value: true, description: "Add Access-Overview ContextMenu Entry for non-hidden Channels"},
}
};
@ -407,7 +407,7 @@ module.exports = (_ => {
nativeClass: true,
iconSVG: `<svg class="${BDFDB.disCN.channelicon}" width="24" height="24" viewBox="0 0 24 24"><mask id="${this.name + e.instance.props.channel.id}" fill="black"><path d="M 0 0 H 24 V 24 H 0 Z" fill="white"></path><path d="M24 0 H 13 V 12 H 24 Z" fill="black"></path></mask><path mask="url(#${this.name + e.instance.props.channel.id})" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="${this.channelIcons[BDFDB.DiscordConstants.ChannelTypes[e.instance.props.channel.type]] || this.channelIcons.DEFAULT}"></path><path fill="currentColor" d="M 21.025 5 V 4 C 21.025 2.88 20.05 2 19 2 C 17.95 2 17 2.88 17 4 V 5 C 16.4477 5 16 5.44772 16 6 V 9 C 16 9.55228 16.4477 10 17 10 H 19 H 21 C 21.5523 10 22 9.55228 22 9 V 5.975C22 5.43652 21.5635 5 21.025 5 Z M 20 5 H 18 V 4 C 18 3.42857 18.4667 3 19 3 C 19.5333 3 20 3.42857 20 4 V 5 Z"></path></svg>`
});
let channelChildren = BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["className", BDFDB.disCN.channelchildren]]});
let channelChildren = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.channelchildren]]});
if (channelChildren && channelChildren.props && channelChildren.props.children) {
channelChildren.props.children = [BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
text: BDFDB.LanguageUtils.LanguageStrings.CHANNEL_LOCKED_SHORT,
@ -421,12 +421,12 @@ module.exports = (_ => {
})
})];
}
let wrapper = BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["className", BDFDB.disCN.channelwrapper]]});
let wrapper = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.channelwrapper]]});
if (wrapper) {
wrapper.props.onMouseDown = _ => {};
wrapper.props.onMouseUp = _ => {};
}
let mainContent = BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["className", BDFDB.disCN.channelmaincontent]]});
let mainContent = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.channelmaincontent]]});
if (mainContent) {
mainContent.props.onClick = _ => {};
mainContent.props.href = null;
@ -441,7 +441,7 @@ module.exports = (_ => {
getHiddenChannels (guild) {
if (!guild) return [{}, 0];
let roles = (BDFDB.LibraryModules.MemberStore.getMember(guild.id, BDFDB.UserUtils.me.id) || {roles:[]}).roles.length;
let roles = (BDFDB.LibraryModules.MemberStore.getMember(guild.id, BDFDB.UserUtils.me.id) || {roles: []}).roles.length;
if (hiddenChannelCache[guild.id] && hiddenChannelCache[guild.id].roles == roles) return [hiddenChannelCache[guild.id].hidden, hiddenChannelCache[guild.id].amount];
else {
let all = BDFDB.LibraryModules.ChannelStore.getGuildChannels(), hidden = {}, amount = 0;

View File

@ -25,7 +25,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -58,14 +58,14 @@ module.exports = (_ => {
this.defaults = {
settings: {
downloadDictionary: {value:false, description:"Use local dictionary file (downloads dictionary on first usage)"}
downloadDictionary: {value: false, description: "Use local dictionary file (downloads dictionary on first usage)"}
},
choices: {
dictionaryLanguage: {value:"en", force:true, description:"Primary Language:"},
secondaryLanguage: {value:"-", force:false, description:"Secondary Language:"}
dictionaryLanguage: {value: "en", force: true, description: "Primary Language: "},
secondaryLanguage: {value: "-", force: false, description: "Secondary Language: "}
},
amounts: {
maxSimilarAmount: {value:6, min:1, max:30, description:"Maximal Amount of suggested Words:"}
maxSimilarAmount: {value: 6, min: 1, max: 30, description: "Maximal Amount of suggested Words: "}
}
};
@ -77,7 +77,7 @@ module.exports = (_ => {
this.css = `
${BDFDB.dotCNS._spellcheckoverlay + BDFDB.dotCN._spellcheckerror} {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAADCAYAAABbNsX4AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAACNJREFUeNpi+M/A8P////8McMzAgGAg0ygqYGwAAAAA//8DAOGVJ9llMWQlAAAAAElFTkSuQmCC');
background-image: url('data: image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAADCAYAAABbNsX4AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAACNJREFUeNpi+M/A8P////8McMzAgGAg0ygqYGwAAAAA//8DAOGVJ9llMWQlAAAAAElFTkSuQmCC');
background-repeat: repeat-x;
background-position: bottom;
}
@ -132,7 +132,7 @@ module.exports = (_ => {
label: this.defaults.choices[key].description,
basis: "70%",
value: choices[key],
options: (this.defaults.choices[key].force ? [] : [{value:"-", label:BDFDB.LanguageUtils.LanguageStrings.FORM_LABEL_NOTHING}]).concat(BDFDB.ObjectUtils.toArray(BDFDB.ObjectUtils.map(languages, (lang, id) => ({value:id, label:this.getLanguageName(lang)})))),
options: (this.defaults.choices[key].force ? [] : [{value: "-", label: BDFDB.LanguageUtils.LanguageStrings.FORM_LABEL_NOTHING}]).concat(BDFDB.ObjectUtils.toArray(BDFDB.ObjectUtils.map(languages, (lang, id) => ({value: id, label: this.getLanguageName(lang)})))),
searchable: true,
onChange: value => {
this.setDictionary(key, value);
@ -189,7 +189,7 @@ module.exports = (_ => {
}
onSlateContextMenu (e) {
let [SCparent, SCindex] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "spellcheck", group:true});
let [SCparent, SCindex] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "spellcheck", group: true});
if (SCindex > -1) SCparent.splice(SCindex, 1);
let textarea = BDFDB.DOMUtils.getParent(BDFDB.dotCN.textarea, e.instance.props.target), word = null;
if (textarea) for (let error of textarea.parentElement.querySelectorAll(BDFDB.dotCN._spellcheckerror)) {
@ -312,7 +312,7 @@ module.exports = (_ => {
if (!ownDictionary.includes(wordLow)) {
ownDictionary.push(wordLow);
BDFDB.DataUtils.save(ownDictionary, this, "owndics", choices.dictionaryLanguage);
BDFDB.NotificationUtils.toast(this.labels.toast_wordadd_text.replace("${word}", word).replace("${dicName}", this.getLanguageName(languages[choices.dictionaryLanguage])), {type:"success"});
BDFDB.NotificationUtils.toast(this.labels.toast_wordadd_text.replace("${word}", word).replace("${dicName}", this.getLanguageName(languages[choices.dictionaryLanguage])), {type: "success"});
dictionaries.dictionaryLanguage = this.formatDictionary(langDictionaries.dictionaryLanguage.concat(ownDictionary));
}
}
@ -323,7 +323,7 @@ module.exports = (_ => {
this.killLanguageToast(key);
if (languages[lang]) {
let ownDictionary = BDFDB.DataUtils.load(this, "owndics", lang) || [];
languageToasts[key] = BDFDB.NotificationUtils.toast("Grabbing dictionary (" + this.getLanguageName(languages[lang]) + "). Please wait", {timeout:0});
languageToasts[key] = BDFDB.NotificationUtils.toast("Grabbing dictionary (" + this.getLanguageName(languages[lang]) + "). Please wait", {timeout: 0});
languageToasts[key].interval = BDFDB.TimeUtils.interval(_ => {
languageToasts[key].textContent = languageToasts[key].textContent.indexOf(".....") > -1 ? "Grabbing dictionary (" + this.getLanguageName(languages[lang]) + "). Please wait" : languageToasts[key].textContent + ".";
}, 500);

View File

@ -26,7 +26,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -179,7 +179,7 @@ module.exports = (_ => {
onClick: _ => {
let url = BDFDB.ObjectUtils.get(playbackState, "item.external_urls.spotify") || BDFDB.ObjectUtils.get(playbackState, "context.external_urls.spotify");
if (url) {
BDFDB.LibraryRequires.electron.clipboard.write({text:url});
BDFDB.LibraryRequires.electron.clipboard.write({text: url});
BDFDB.NotificationUtils.toast("Song URL was copied to clipboard", {type: "success"});
}
else BDFDB.NotificationUtils.toast("Could not copy song URL to clipboard", {type: "error"});
@ -401,16 +401,16 @@ module.exports = (_ => {
this.defaults = {
settings: {
addTimeline: {value:true, description:"Show the song timeline in the controls"}
addTimeline: {value: true, description: "Show the song timeline in the controls"}
},
buttonConfigs: {
share: {value:{small:false, big:true}, icons: [""], description:"Share"},
shuffle: {value:{small:false, big:true}, icons: [""], description:"Shuffle"},
previous: {value:{small:true, big:true}, icons: [""], description:"Previous"},
pauseplay: {value:{small:true, big:true}, icons: ["", ""], description:"Pause/Play"},
next: {value:{small:true, big:true}, icons: [""], description:"Next"},
repeat: {value:{small:false, big:true}, icons: ["", ""], description:"Repeat"},
volume: {value:{small:false, big:true}, icons: ["", "", "", ""], description:"Volume"}
share: {value: {small: false, big: true}, icons: [""], description: "Share"},
shuffle: {value: {small: false, big: true}, icons: [""], description: "Shuffle"},
previous: {value: {small: true, big: true}, icons: [""], description: "Previous"},
pauseplay: {value: {small: true, big: true}, icons: ["", ""], description: "Pause/Play"},
next: {value: {small: true, big: true}, icons: [""], description: "Next"},
repeat: {value: {small: false, big: true}, icons: ["", ""], description: "Repeat"},
volume: {value: {small: false, big: true}, icons: ["", "", "", ""], description: "Volume"}
}
};
@ -650,7 +650,7 @@ module.exports = (_ => {
children: [BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormTitle, {
className: BDFDB.disCN.marginbottom4,
tag: BDFDB.LibraryComponents.FormComponents.FormTitle.Tags.H3,
children: "Add control buttons in small and/or big player version:"
children: "Add control buttons in small and/or big player version: "
})].concat(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsList, {
settings: Object.keys(this.defaults.buttonConfigs[Object.keys(this.defaults.buttonConfigs)[0]].value),
data: Object.keys(buttonConfigs).map(key => Object.assign({}, buttonConfigs[key], {

View File

@ -26,7 +26,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -57,7 +57,7 @@ module.exports = (_ => {
onLoad() {
this.defaults = {
settings: {
useChromium: {value:false, description:"Use inbuilt browser instead of default if fails to open Steam"}
useChromium: {value: false, description: "Use inbuilt browser instead of default if fails to open Steam"}
}
};
}

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -272,7 +272,7 @@ module.exports = (_ => {
label: "Choose a Generator Theme",
basis: "60%",
value: this.props.currentGenerator && this.props.currentGenerator.value || "-----",
options: [{value:"-----", label:"-----"}, nativeCSSvars && {value:"nativediscord", label:"Discord", native:true}].concat((generatorThemes).map(url => ({value:url, label:(loadedThemes[url] || {}).name || "-----"})).sort((x, y) => (x.label < y.label ? -1 : x.label > y.label ? 1 : 0))).filter(n => n),
options: [{value: "-----", label: "-----"}, nativeCSSvars && {value: "nativediscord", label: "Discord", native: true}].concat((generatorThemes).map(url => ({value: url, label: (loadedThemes[url] || {}).name || "-----"})).sort((x, y) => (x.label < y.label ? -1 : x.label > y.label ? 1 : 0))).filter(n => n),
searchable: true,
onChange: (value, instance) => {
if (loadedThemes[value.value] || value.native) {
@ -352,7 +352,7 @@ module.exports = (_ => {
}
}
let varDescription = varStr.join("").replace(/\*\/|\/\*/g, "").replace(/:/g, ": ").replace(/: \//g, ":/").replace(/--/g, " --").replace(/\( --/g, "(--").trim();
this.props.generatorValues[varName] = {value:oldValue, oldValue};
this.props.generatorValues[varName] = {value: oldValue, oldValue};
inputRefs.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsItem, {
dividerBottom: vars[vars.length-1] != varStr,
type: "TextInput",
@ -546,7 +546,7 @@ module.exports = (_ => {
onChange: (value, instance) => {
if (!list) return;
if (list.props.currentTheme) for (let ins of BDFDB.ReactUtils.findOwner(this._reactInternalFiber.return, {name:"ThemeCard", all:true}).filter(ins => ins && ins.props && ins.props.theme && ins.props.theme.url == list.props.currentTheme.url)) BDFDB.ReactUtils.forceUpdate(ins);
if (list.props.currentTheme) for (let ins of BDFDB.ReactUtils.findOwner(this._reactInternalFiber.return, {name: "ThemeCard", all: true}).filter(ins => ins && ins.props && ins.props.theme && ins.props.theme.url == list.props.currentTheme.url)) BDFDB.ReactUtils.forceUpdate(ins);
if (value) list.props.currentTheme = this.props.theme;
else delete list.props.currentTheme;
@ -711,7 +711,7 @@ module.exports = (_ => {
itemClassName: BDFDB.disCN.tabbaritem,
type: BDFDB.LibraryComponents.TabBar.Types.TOP,
selectedItem: this.props.tab,
items: [{value:"Themes"}, {value:"Generator"}, {value:BDFDB.LanguageUtils.LanguageStrings.SETTINGS}],
items: [{value: "Themes"}, {value: "Generator"}, {value: BDFDB.LanguageUtils.LanguageStrings.SETTINGS}],
onItemSelect: (value, instance) => {
this.props.tab = list.props.tab = value;
BDFDB.ReactUtils.forceUpdate(list);
@ -762,7 +762,7 @@ module.exports = (_ => {
onLoad() {
_this = this;
loading = {is:false, timeout:null, amount:0};
loading = {is: false, timeout: null, amount: 0};
cachedThemes = [];
grabbedThemes = [];
@ -772,16 +772,16 @@ module.exports = (_ => {
this.defaults = {
settings: {
useChromium: {value:false, description:"Use an inbuilt browser window instead of opening your default browser"},
keepOnTop: {value:false, description:"Keep the preview window always on top"},
notifyOutdated: {value:true, description:"Get a notification when one of your Themes is outdated"},
notifyNewentries: {value:true, description:"Get a notification when there are new entries in the Repo"}
useChromium: {value: false, description: "Use an inbuilt browser window instead of opening your default browser"},
keepOnTop: {value: false, description: "Keep the preview window always on top"},
notifyOutdated: {value: true, description: "Get a notification when one of your Themes is outdated"},
notifyNewentries: {value: true, description: "Get a notification when there are new entries in the Repo"}
},
modalSettings: {
updated: {value:true, modify:true, description:"Show updated Themes",},
outdated: {value:true, modify:true, description:"Show outdated Themes"},
downloadable: {value:true, modify:true, description:"Show downloadable Themes"},
rnmStart: {value:true, modify:false, description:"Apply Theme after Download"}
updated: {value: true, modify: true, description: "Show updated Themes",},
outdated: {value: true, modify: true, description: "Show outdated Themes"},
downloadable: {value: true, modify: true, description: "Show downloadable Themes"},
rnmStart: {value: true, modify: false, description: "Apply Theme after Download"}
}
};
@ -894,7 +894,7 @@ module.exports = (_ => {
margin: 0,
label: "Force all Themes to be fetched again",
onClick: _ => {
loading = {is:false, timeout:null, amount:0};
loading = {is: false, timeout: null, amount: 0};
this.loadThemes();
},
children: BDFDB.LanguageUtils.LanguageStrings.ERRORS_RELOAD
@ -1001,7 +1001,7 @@ module.exports = (_ => {
generateTheme (fullCSS, generatorValues) {
if (!fullCSS || !BDFDB.ObjectUtils.is(generatorValues)) return "";
for (let inputId in generatorValues) if (generatorValues[inputId].value && generatorValues[inputId].value.trim() && generatorValues[inputId].value != generatorValues[inputId].oldValue) fullCSS = fullCSS.replace(new RegExp(`--${BDFDB.StringUtils.regEscape(inputId)}(\\s*):(\\s*)${BDFDB.StringUtils.regEscape(generatorValues[inputId].oldValue)}`,"g"),`--${inputId}$1:$2${generatorValues[inputId].value}`);
for (let inputId in generatorValues) if (generatorValues[inputId].value && generatorValues[inputId].value.trim() && generatorValues[inputId].value != generatorValues[inputId].oldValue) fullCSS = fullCSS.replace(new RegExp(`--${BDFDB.StringUtils.regEscape(inputId)}(\\s*):(\\s*)${BDFDB.StringUtils.regEscape(generatorValues[inputId].oldValue)}`,"g"),`--${inputId}$1: $2${generatorValues[inputId].value}`);
return fullCSS;
}
@ -1020,13 +1020,13 @@ module.exports = (_ => {
grabbedThemes = body.split("\n").filter(n => n);
foundThemes = grabbedThemes.concat(customList);
loading = {is:true, timeout:BDFDB.TimeUtils.timeout(_ => {
loading = {is: true, timeout: BDFDB.TimeUtils.timeout(_ => {
BDFDB.TimeUtils.clear(loading.timeout);
if (this.started) {
if (loading.is && loading.amount < 4) BDFDB.TimeUtils.timeout(_ => {this.loadThemes();}, 10000);
loading = {is: false, timeout:null, amount:loading.amount};
loading = {is: false, timeout: null, amount: loading.amount};
}
}, 1200000), amount:loading.amount+1};
}, 1200000), amount: loading.amount+1};
let loadingIcon = BDFDB.DOMUtils.create(themeRepoIcon);
BDFDB.DOMUtils.addClass(loadingIcon, "themerepo-loadingicon");
@ -1047,7 +1047,7 @@ module.exports = (_ => {
}
BDFDB.TimeUtils.clear(loading.timeout);
BDFDB.DOMUtils.remove(loadingIcon, ".themerepo-loadingicon");
loading = {is:false, timeout:null, amount:loading.amount};
loading = {is: false, timeout: null, amount: loading.amount};
BDFDB.LogUtils.log("Finished fetching Themes", this.name);
if (list) BDFDB.ReactUtils.forceUpdate(list);
@ -1055,7 +1055,7 @@ module.exports = (_ => {
if ((settings.notifyOutdated || settings.notifyOutdated == undefined) && outdated > 0) {
let oldBarButton = document.querySelector(".themerepo-outdate-notice " + BDFDB.dotCN.noticedismiss);
if (oldBarButton) oldBarButton.click();
let bar = BDFDB.NotificationUtils.notice(`${outdated} of your Themes ${outdated == 1 ? "is" : "are"} outdated. Check:`, {
let bar = BDFDB.NotificationUtils.notice(`${outdated} of your Themes ${outdated == 1 ? "is" : "are"} outdated. Check: `, {
type: "danger",
btn: "ThemeRepo",
selector: "themerepo-notice themerepo-outdate-notice",
@ -1072,7 +1072,7 @@ module.exports = (_ => {
let oldBarButton = document.querySelector(".themerepo-newentries-notice " + BDFDB.dotCN.noticedismiss);
if (oldBarButton) oldBarButton.click();
let single = newEntries == 1;
let bar = BDFDB.NotificationUtils.notice(`There ${single ? "is" : "are"} ${newEntries} new Theme${single ? "" : "s"} in the Repo. Check:`, {
let bar = BDFDB.NotificationUtils.notice(`There ${single ? "is" : "are"} ${newEntries} new Theme${single ? "" : "s"} in the Repo. Check: `, {
type: "success",
btn: "ThemeRepo",
selector: "themerepo-notice themerepo-newentries-notice",
@ -1187,7 +1187,7 @@ module.exports = (_ => {
checkForNewThemes () {
BDFDB.LibraryRequires.request("https://mwittrien.github.io/BetterDiscordAddons/Plugins/ThemeRepo/_res/ThemeList.txt", (error, response, result) => {
if (response && !BDFDB.equals(result.replace(/\t|\r/g, "").split("\n").filter(n => n), grabbedThemes)) {
loading = {is:false, timeout:null, amount:0};
loading = {is: false, timeout: null, amount: 0};
this.loadThemes();
}
});
@ -1195,15 +1195,15 @@ module.exports = (_ => {
downloadTheme (data) {
BDFDB.LibraryRequires.request(data.url, (error, response, body) => {
if (error) BDFDB.NotificationUtils.toast(`Unable to download Theme "${data.name}".`, {type:"danger"});
if (error) BDFDB.NotificationUtils.toast(`Unable to download Theme "${data.name}".`, {type: "danger"});
else this.createThemeFile(data.url.split("/").pop(), body);
});
}
createThemeFile (filename, content) {
BDFDB.LibraryRequires.fs.writeFile(BDFDB.LibraryRequires.path.join(BDFDB.BDUtils.getThemesFolder(), filename), content, (error) => {
if (error) BDFDB.NotificationUtils.toast(`Unable to save Theme "${filename}".`, {type:"danger"});
else BDFDB.NotificationUtils.toast(`Successfully saved Theme "${filename}".`, {type:"success"});
if (error) BDFDB.NotificationUtils.toast(`Unable to save Theme "${filename}".`, {type: "danger"});
else BDFDB.NotificationUtils.toast(`Successfully saved Theme "${filename}".`, {type: "success"});
});
}
@ -1219,7 +1219,7 @@ module.exports = (_ => {
deleteThemeFile (data) {
let filename = data.url.split("/").pop();
BDFDB.LibraryRequires.fs.unlink(BDFDB.LibraryRequires.path.join(BDFDB.BDUtils.getThemesFolder(), filename), (error) => {
if (error) BDFDB.NotificationUtils.toast(`Unable to delete Theme "${filename}".`, {type:"danger"});
if (error) BDFDB.NotificationUtils.toast(`Unable to delete Theme "${filename}".`, {type: "danger"});
else BDFDB.NotificationUtils.toast(`Successfully deleted Theme "${filename}".`);
});
}

View File

@ -31,7 +31,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -66,9 +66,9 @@ module.exports = (_ => {
if (BDFDB.DOMUtils.containsClass(node, BDFDB.disCN._repocard)) this.appendSettingsButton(node);
if (node.nodeType != Node.TEXT_NODE) for (let child of node.querySelectorAll(BDFDB.dotCN._repocard)) this.appendSettingsButton(child);
});}});}));
BDFDB.ObserverUtils.connect(this, document.querySelector(`${BDFDB.dotCN.layer}[aria-label="${BDFDB.DiscordConstants.Layers.USER_SETTINGS}"]`), {name:"cardObserver", instance:cardObserver}, {childList: true, subtree:true});
BDFDB.ObserverUtils.connect(this, BDFDB.dotCN.applayers, {name:"appLayerObserver", instance:(new MutationObserver(changes => {changes.forEach(change => {if (change.addedNodes) {change.addedNodes.forEach(node => {
if (node.nodeType != Node.TEXT_NODE && node.getAttribute("aria-label") == BDFDB.DiscordConstants.Layers.USER_SETTINGS) BDFDB.ObserverUtils.connect(this, node, {name:"cardObserver", instance:cardObserver}, {childList: true, subtree:true});
BDFDB.ObserverUtils.connect(this, document.querySelector(`${BDFDB.dotCN.layer}[aria-label="${BDFDB.DiscordConstants.Layers.USER_SETTINGS}"]`), {name: "cardObserver", instance: cardObserver}, {childList: true, subtree: true});
BDFDB.ObserverUtils.connect(this, BDFDB.dotCN.applayers, {name: "appLayerObserver", instance: (new MutationObserver(changes => {changes.forEach(change => {if (change.addedNodes) {change.addedNodes.forEach(node => {
if (node.nodeType != Node.TEXT_NODE && node.getAttribute("aria-label") == BDFDB.DiscordConstants.Layers.USER_SETTINGS) BDFDB.ObserverUtils.connect(this, node, {name: "cardObserver", instance: cardObserver}, {childList: true, subtree: true});
});}});}))}, {childList: true});
for (let child of document.querySelectorAll(BDFDB.dotCN._repocard)) this.appendSettingsButton(child);
}
@ -99,7 +99,7 @@ module.exports = (_ => {
className: BDFDB.disCN._repomodal,
size: "MEDIUM",
children: BDFDB.ReactUtils.elementToReact(this.createThemeVarInputs(addon, vars)),
buttons:[{contents: "Update", color: "GREEN", click: modal => {this.updateTheme(modal, addon);}}]
buttons: [{contents: "Update", color: "GREEN", click: modal => {this.updateTheme(modal, addon);}}]
});
});
}
@ -158,18 +158,18 @@ module.exports = (_ => {
let newValue = input.value;
if (newValue && newValue.trim() && newValue != oldValue) {
let varName = input.getAttribute("varName");
css = css.replace(new RegExp(`--${BDFDB.StringUtils.regEscape(varName)}(\\s*):(\\s*)${BDFDB.StringUtils.regEscape(oldValue)}`,"g"),`--${varName}$1:$2${newValue}`);
css = css.replace(new RegExp(`--${BDFDB.StringUtils.regEscape(varName)}(\\s*):(\\s*)${BDFDB.StringUtils.regEscape(oldValue)}`,"g"),`--${varName}$1: $2${newValue}`);
input.setAttribute("placeholder", newValue);
amount++;
}
}
if (amount > 0) {
BDFDB.LibraryRequires.fs.writeFileSync(path, css);
BDFDB.NotificationUtils.toast(`Updated ${amount} variable${amount == 1 ? "" : "s"} in ${addon.filename}`, {type:"success"});
BDFDB.NotificationUtils.toast(`Updated ${amount} variable${amount == 1 ? "" : "s"} in ${addon.filename}`, {type: "success"});
}
else BDFDB.NotificationUtils.toast(`There are no changed variables to be updated in ${addon.filename}`, {type:"warning"});
else BDFDB.NotificationUtils.toast(`There are no changed variables to be updated in ${addon.filename}`, {type: "warning"});
}
else BDFDB.NotificationUtils.toast(`Could not find themefile: ${addon.filename}`, {type:"error"});
else BDFDB.NotificationUtils.toast(`Could not find themefile: ${addon.filename}`, {type: "error"});
}
getThemeVars (css) {

View File

@ -26,7 +26,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -57,8 +57,8 @@ module.exports = (_ => {
running: {value: true}
},
values: {
timer1: {value:25},
timer2: {value:75}
timer1: {value: 25},
timer2: {value: 75}
}
};
@ -108,7 +108,7 @@ module.exports = (_ => {
if (slider) BDFDB.DOMUtils.toggleClass(slider, BDFDB.disCN.sliderdisabled, !value);
}
}),
BDFDB.ReactUtils.elementToReact(BDFDB.DOMUtils.create(`<div class="${BDFDB.disCNS.slider + BDFDB.disCN.margintop20}${!settings.running ? (" " + BDFDB.disCN.sliderdisabled): ""}"><input type="number" timer="timer1" class="${BDFDB.disCN.sliderinput}" value="${values.timer1}" readonly=""><input type="number" timer="timer2" class="${BDFDB.disCN.sliderinput}" value="${values.timer2}" readonly=""><div class="${BDFDB.disCN.slidertrack}"><div class="${BDFDB.disCN.slidermark}" style="left: 0%;"><div class="${BDFDB.disCN.slidermarkvalue}">00:00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div><div class="${BDFDB.disCN.slidermark}" style="left: 12.5%;"><div class="${BDFDB.disCN.slidermarkvalue}">03:00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div><div class="${BDFDB.disCN.slidermark}" style="left: 25%;"><div class="${BDFDB.disCN.slidermarkvalue}">06:00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div><div class="${BDFDB.disCN.slidermark}" style="left: 37.5%;"><div class="${BDFDB.disCN.slidermarkvalue}">09:00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div><div class="${BDFDB.disCN.slidermark}" style="left: 50%;"><div class="${BDFDB.disCN.slidermarkvalue}">12:00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div><div class="${BDFDB.disCN.slidermark}" style="left: 62.5%;"><div class="${BDFDB.disCN.slidermarkvalue}">15:00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div><div class="${BDFDB.disCN.slidermark}" style="left: 75%;"><div class="${BDFDB.disCN.slidermarkvalue}">18:00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div><div class="${BDFDB.disCN.slidermark}" style="left: 87.5%;"><div class="${BDFDB.disCN.slidermarkvalue}">21:00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div><div class="${BDFDB.disCN.slidermark}" style="left: 100%;"><div class="${BDFDB.disCN.slidermarkvalue}">24:00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div></div><div class="${BDFDB.disCN.sliderbar}"><div class="${BDFDB.disCN.sliderbarfill}"></div></div><div class="${BDFDB.disCN.slidertrack}"><div class="${BDFDB.disCNS.slidergrabber + BDFDB.disCN._timedlightdarkmodetimergrabber}" timer="timer1" style="left: ${values.timer1}%;"></div><div class="${BDFDB.disCNS.slidergrabber + BDFDB.disCN._timedlightdarkmodetimergrabber}" timer="timer2" style="left: ${values.timer2}%;"></div><div class="${BDFDB.disCNS.slidergrabber + BDFDB.disCN._timedlightdarkmodedategrabber}" timer="current" style="left: ${this.getPercent(new Date())}%; cursor: help !important; height: 12px; margin-top: -7px;"></div></div></div>`), node => {
BDFDB.ReactUtils.elementToReact(BDFDB.DOMUtils.create(`<div class="${BDFDB.disCNS.slider + BDFDB.disCN.margintop20}${!settings.running ? (" " + BDFDB.disCN.sliderdisabled): ""}"><input type="number" timer="timer1" class="${BDFDB.disCN.sliderinput}" value="${values.timer1}" readonly=""><input type="number" timer="timer2" class="${BDFDB.disCN.sliderinput}" value="${values.timer2}" readonly=""><div class="${BDFDB.disCN.slidertrack}"><div class="${BDFDB.disCN.slidermark}" style="left: 0%;"><div class="${BDFDB.disCN.slidermarkvalue}">00: 00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div><div class="${BDFDB.disCN.slidermark}" style="left: 12.5%;"><div class="${BDFDB.disCN.slidermarkvalue}">03: 00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div><div class="${BDFDB.disCN.slidermark}" style="left: 25%;"><div class="${BDFDB.disCN.slidermarkvalue}">06: 00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div><div class="${BDFDB.disCN.slidermark}" style="left: 37.5%;"><div class="${BDFDB.disCN.slidermarkvalue}">09: 00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div><div class="${BDFDB.disCN.slidermark}" style="left: 50%;"><div class="${BDFDB.disCN.slidermarkvalue}">12: 00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div><div class="${BDFDB.disCN.slidermark}" style="left: 62.5%;"><div class="${BDFDB.disCN.slidermarkvalue}">15: 00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div><div class="${BDFDB.disCN.slidermark}" style="left: 75%;"><div class="${BDFDB.disCN.slidermarkvalue}">18: 00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div><div class="${BDFDB.disCN.slidermark}" style="left: 87.5%;"><div class="${BDFDB.disCN.slidermarkvalue}">21: 00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div><div class="${BDFDB.disCN.slidermark}" style="left: 100%;"><div class="${BDFDB.disCN.slidermarkvalue}">24: 00</div><div class="${BDFDB.disCN.slidermarkdash}"></div></div></div><div class="${BDFDB.disCN.sliderbar}"><div class="${BDFDB.disCN.sliderbarfill}"></div></div><div class="${BDFDB.disCN.slidertrack}"><div class="${BDFDB.disCNS.slidergrabber + BDFDB.disCN._timedlightdarkmodetimergrabber}" timer="timer1" style="left: ${values.timer1}%;"></div><div class="${BDFDB.disCNS.slidergrabber + BDFDB.disCN._timedlightdarkmodetimergrabber}" timer="timer2" style="left: ${values.timer2}%;"></div><div class="${BDFDB.disCNS.slidergrabber + BDFDB.disCN._timedlightdarkmodedategrabber}" timer="current" style="left: ${this.getPercent(new Date())}%; cursor: help !important; height: 12px; margin-top: -7px;"></div></div></div>`), node => {
if (Node.prototype.isPrototypeOf(node)) {
slider = node;
this.updateSlider(slider, values);
@ -149,8 +149,8 @@ module.exports = (_ => {
changeTheme (dark) {
let theme = BDFDB.DiscordUtils.getTheme();
if (dark && theme == BDFDB.disCN.themelight) BDFDB.LibraryModules.SettingsUtils.updateLocalSettings({theme:"dark"});
else if (!dark && theme == BDFDB.disCN.themedark) BDFDB.LibraryModules.SettingsUtils.updateLocalSettings({theme:"light"});
if (dark && theme == BDFDB.disCN.themelight) BDFDB.LibraryModules.SettingsUtils.updateLocalSettings({theme: "dark"});
else if (!dark && theme == BDFDB.disCN.themedark) BDFDB.LibraryModules.SettingsUtils.updateLocalSettings({theme: "light"});
}
showCurrentTime (grabber) {

View File

@ -30,7 +30,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {
@ -57,14 +57,14 @@ module.exports = (_ => {
onLoad() {
this.defaults = {
settings: {
showInChat: {value:true, inner:true, description:"Chat Window"},
showInMemberList: {value:true, inner:true, description:"Member List"},
useOtherStyle: {value:false, inner:false, description:"Use BotTag Style instead of the Role Style"},
useBlackFont: {value:false, inner:false, description:"Instead of darkening the color for BotTag Style on bright colors use black font"},
includeColorless: {value:false, inner:false, description:"Include colorless roles"},
showOwnerRole: {value:false, inner:false, description:`Display Role Tag of Serverowner as "${BDFDB.LanguageUtils.LanguageStrings.GUILD_OWNER}".`},
disableForBots: {value:false, inner:false, description:"Disable Role Tag for Bots"},
addUserID: {value:false, inner:false, description:"Add the UserID as a Tag to the Chat Window"}
showInChat: {value: true, inner: true, description: "Chat Window"},
showInMemberList: {value: true, inner: true, description: "Member List"},
useOtherStyle: {value: false, inner: false, description: "Use BotTag Style instead of the Role Style"},
useBlackFont: {value: false, inner: false, description: "Instead of darkening the color for BotTag Style on bright colors use black font"},
includeColorless: {value: false, inner: false, description: "Include colorless roles"},
showOwnerRole: {value: false, inner: false, description: `Display Role Tag of Serverowner as "${BDFDB.LanguageUtils.LanguageStrings.GUILD_OWNER}".`},
disableForBots: {value: false, inner: false, description: "Disable Role Tag for Bots"},
addUserID: {value: false, inner: false, description: "Add the UserID as a Tag to the Chat Window"}
}
};

View File

@ -26,7 +26,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {

View File

@ -26,7 +26,7 @@ module.exports = (_ => {
getDescription () {return config.info.description;}
load() {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue:[]});
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
BdApi.showConfirmationModal("Library Missing", `The library plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, {

View File

@ -171,19 +171,19 @@
let getDiscordClass = function (item, selector) {
let className = fallbackClassName = "Preview_undefined";
if (DiscordClasses[item] === undefined) {
if (userId == "278543574059057154") console.warn(`%c[Preview]%c`, 'color:#3a71c1; font-weight:700;', '', item + ' not found in DiscordClasses');
if (userId == "278543574059057154") console.warn(`%c[Preview]%c`, 'color: #3a71c1; font-weight: 700;', '', item + ' not found in DiscordClasses');
return className;
}
else if (!Array.isArray(DiscordClasses[item]) || DiscordClasses[item].length != 2) {
if (userId == "278543574059057154") console.warn(`%c[Preview]%c`, 'color:#3a71c1; font-weight:700;', '', item + ' is not an Array of Length 2 in DiscordClasses');
if (userId == "278543574059057154") console.warn(`%c[Preview]%c`, 'color: #3a71c1; font-weight: 700;', '', item + ' is not an Array of Length 2 in DiscordClasses');
return className;
}
else if (DiscordClassModules[DiscordClasses[item][0]] === undefined) {
if (userId == "278543574059057154") console.warn(`%c[Preview]%c`, 'color:#3a71c1; font-weight:700;', '', DiscordClasses[item][0] + ' not found in DiscordClassModules');
if (userId == "278543574059057154") console.warn(`%c[Preview]%c`, 'color: #3a71c1; font-weight: 700;', '', DiscordClasses[item][0] + ' not found in DiscordClassModules');
return className;
}
else if ([DiscordClasses[item][1]].flat().every(prop => DiscordClassModules[DiscordClasses[item][0]][prop] === undefined)) {
if (userId == "278543574059057154") console.warn(`%c[Preview]%c`, 'color:#3a71c1; font-weight:700;', '', DiscordClasses[item][1] + ' not found in ' + DiscordClasses[item][0] + ' in DiscordClassModules');
if (userId == "278543574059057154") console.warn(`%c[Preview]%c`, 'color: #3a71c1; font-weight: 700;', '', DiscordClasses[item][1] + ' not found in ' + DiscordClasses[item][0] + ' in DiscordClassModules');
return className;
}
else {