From ca2aca700d3a9fd80920e23ef4466ca454b2190f Mon Sep 17 00:00:00 2001 From: Zack Rauen Date: Thu, 23 Apr 2020 18:12:01 -0400 Subject: [PATCH] add some stubs for later --- js/main.js | 2 +- src/modules/pluginapi.js | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/js/main.js b/js/main.js index d77e0302..671a969b 100644 --- a/js/main.js +++ b/js/main.js @@ -491,7 +491,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utilities */ \"./src/modules/utilities.js\");\n/* harmony import */ var _webpackmodules__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./webpackmodules */ \"./src/modules/webpackmodules.js\");\n/* harmony import */ var _discordmodules__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./discordmodules */ \"./src/modules/discordmodules.js\");\n/* harmony import */ var _datastore__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./datastore */ \"./src/modules/datastore.js\");\n/* harmony import */ var _dommanager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./dommanager */ \"./src/modules/dommanager.js\");\n/* harmony import */ var _ui_toasts__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../ui/toasts */ \"./src/ui/toasts.js\");\n/* harmony import */ var _ui_modals__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../ui/modals */ \"./src/ui/modals.js\");\n/* harmony import */ var _pluginmanager__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./pluginmanager */ \"./src/modules/pluginmanager.js\");\n/* harmony import */ var _thememanager__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./thememanager */ \"./src/modules/thememanager.js\");\n\n\n\n\n\n\n\n\n\nconst BdApi = {\n get React() {\n return _discordmodules__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React;\n },\n\n get ReactDOM() {\n return _discordmodules__WEBPACK_IMPORTED_MODULE_2__[\"default\"].ReactDOM;\n },\n\n get WindowConfigFile() {\n if (this._windowConfigFile) return this._windowConfigFile;\n\n const electron = __webpack_require__(/*! electron */ \"electron\").remote.app;\n\n const path = __webpack_require__(/*! path */ \"path\");\n\n const base = electron.getAppPath();\n const roamingBase = electron.getPath(\"userData\");\n const roamingLocation = path.resolve(roamingBase, electron.getVersion(), \"modules\", \"discord_desktop_core\", \"injector\", \"config.json\");\n const location = path.resolve(base, \"..\", \"app\", \"config.json\");\n\n const fs = __webpack_require__(/*! fs */ \"fs\");\n\n const realLocation = fs.existsSync(location) ? location : fs.existsSync(roamingLocation) ? roamingLocation : null;\n if (!realLocation) return this._windowConfigFile = null;\n return this._windowConfigFile = realLocation;\n }\n\n};\n\nBdApi.getAllWindowPreferences = function () {\n if (!this.WindowConfigFile) return {};\n return require(this.WindowConfigFile);\n};\n\nBdApi.getWindowPreference = function (key) {\n if (!this.WindowConfigFile) return undefined;\n return this.getAllWindowPreferences()[key];\n};\n\nBdApi.setWindowPreference = function (key, value) {\n if (!this.WindowConfigFile) return;\n\n const fs = __webpack_require__(/*! fs */ \"fs\");\n\n const prefs = this.getAllWindowPreferences();\n prefs[key] = value;\n delete __webpack_require__.c[this.WindowConfigFile];\n fs.writeFileSync(this.WindowConfigFile, JSON.stringify(prefs, null, 4));\n}; //Inject CSS to document head\n//id = id of element\n//css = custom css\n\n\nBdApi.injectCSS = function (id, css) {\n _dommanager__WEBPACK_IMPORTED_MODULE_4__[\"default\"].injectStyle(id, css);\n}; //Clear css/remove any element\n//id = id of element\n\n\nBdApi.clearCSS = function (id) {\n _dommanager__WEBPACK_IMPORTED_MODULE_4__[\"default\"].removeStyle(id);\n}; //Inject CSS to document head\n//id = id of element\n//css = custom css\n\n\nBdApi.linkJS = function (id, url) {\n return _dommanager__WEBPACK_IMPORTED_MODULE_4__[\"default\"].injectScript(id, url);\n}; //Clear css/remove any element\n//id = id of element\n\n\nBdApi.unlinkJS = function (id) {\n _dommanager__WEBPACK_IMPORTED_MODULE_4__[\"default\"].removeScript(id);\n};\n/**\r\n * Shows a generic but very customizable modal.\r\n * @param {string} title - title of the modal\r\n * @param {string} content - a string of text to display in the modal\r\n */\n\n\nBdApi.alert = function (title, content) {\n _ui_modals__WEBPACK_IMPORTED_MODULE_6__[\"default\"].alert(title, content);\n};\n/**\r\n * Shows a generic but very customizable confirmation modal with optional confirm and cancel callbacks.\r\n * @param {string} title - title of the modal\r\n * @param {(string|ReactElement|Array)} children - a single or mixed array of react elements and strings. Everything is wrapped in Discord's `TextElement` component so strings will show and render properly.\r\n * @param {object} [options] - options to modify the modal\r\n * @param {boolean} [options.danger=false] - whether the main button should be red or not\r\n * @param {string} [options.confirmText=Okay] - text for the confirmation/submit button\r\n * @param {string} [options.cancelText=Cancel] - text for the cancel button\r\n * @param {callable} [options.onConfirm=NOOP] - callback to occur when clicking the submit button\r\n * @param {callable} [options.onCancel=NOOP] - callback to occur when clicking the cancel button\r\n */\n\n\nBdApi.showConfirmationModal = function (title, content, options = {}) {\n return _ui_modals__WEBPACK_IMPORTED_MODULE_6__[\"default\"].showConfirmationModal(title, content, options);\n};\n/**\r\n * This shows a toast similar to android towards the bottom of the screen.\r\n *\r\n * @param {string} content The string to show in the toast.\r\n * @param {object} options Options object. Optional parameter.\r\n * @param {string} [options.type=\"\"] Changes the type of the toast stylistically and semantically. Choices: \"\", \"info\", \"success\", \"danger\"/\"error\", \"warning\"/\"warn\". Default: \"\"\r\n * @param {boolean} [options.icon=true] Determines whether the icon should show corresponding to the type. A toast without type will always have no icon. Default: true\r\n * @param {number} [options.timeout=3000] Adjusts the time (in ms) the toast should be shown for before disappearing automatically. Default: 3000\r\n * @param {boolean} [options.forceShow=false] Whether to force showing the toast and ignore the bd setting\r\n */\n\n\nBdApi.showToast = function (content, options = {}) {\n _ui_toasts__WEBPACK_IMPORTED_MODULE_5__[\"default\"].show(content, options);\n}; // Finds module\n\n\nBdApi.findModule = function (filter) {\n return _webpackmodules__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getModule(filter);\n}; // Finds module\n\n\nBdApi.findAllModules = function (filter) {\n return _webpackmodules__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getModule(filter, false);\n}; // Finds module\n\n\nBdApi.findModuleByProps = function (...props) {\n return _webpackmodules__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getByProps(...props);\n};\n\nBdApi.findModuleByPrototypes = function (...protos) {\n return _webpackmodules__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getByPrototypes(...protos);\n};\n\nBdApi.findModuleByDisplayName = function (name) {\n return _webpackmodules__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getByDisplayName(name);\n}; // Gets react instance\n\n\nBdApi.getInternalInstance = function (node) {\n if (!(node instanceof window.jQuery) && !(node instanceof Element)) return undefined;\n if (node instanceof jQuery) node = node[0];\n return _utilities__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getReactInstance(node);\n}; // Gets data\n\n\nBdApi.loadData = function (pluginName, key) {\n return _datastore__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getPluginData(pluginName, key);\n};\n\nBdApi.getData = BdApi.loadData; // Sets data\n\nBdApi.saveData = function (pluginName, key, data) {\n return _datastore__WEBPACK_IMPORTED_MODULE_3__[\"default\"].setPluginData(pluginName, key, data);\n};\n\nBdApi.setData = BdApi.saveData; // Deletes data\n\nBdApi.deleteData = function (pluginName, key) {\n return _datastore__WEBPACK_IMPORTED_MODULE_3__[\"default\"].deletePluginData(pluginName, key);\n}; // Patches other functions\n\n\nBdApi.monkeyPatch = function (what, methodName, options) {\n const {\n before,\n after,\n instead,\n once = false,\n silent = false,\n force = false\n } = options;\n const displayName = options.displayName || what.displayName || what.name || what.constructor.displayName || what.constructor.name;\n if (!silent) console.log(\"patch\", methodName, \"of\", displayName); // eslint-disable-line no-console\n\n if (!what[methodName]) {\n if (force) what[methodName] = function () {};else return console.error(methodName, \"does not exist for\", displayName); // eslint-disable-line no-console\n }\n\n const origMethod = what[methodName];\n\n const cancel = () => {\n if (!silent) console.log(\"unpatch\", methodName, \"of\", displayName); // eslint-disable-line no-console\n\n what[methodName] = origMethod;\n };\n\n what[methodName] = function () {\n const data = {\n thisObject: this,\n methodArguments: arguments,\n cancelPatch: cancel,\n originalMethod: origMethod,\n callOriginalMethod: () => data.returnValue = data.originalMethod.apply(data.thisObject, data.methodArguments)\n };\n\n if (instead) {\n const tempRet = _utilities__WEBPACK_IMPORTED_MODULE_0__[\"default\"].suppressErrors(instead, \"`instead` callback of \" + what[methodName].displayName)(data);\n if (tempRet !== undefined) data.returnValue = tempRet;\n } else {\n if (before) _utilities__WEBPACK_IMPORTED_MODULE_0__[\"default\"].suppressErrors(before, \"`before` callback of \" + what[methodName].displayName)(data);\n data.callOriginalMethod();\n if (after) _utilities__WEBPACK_IMPORTED_MODULE_0__[\"default\"].suppressErrors(after, \"`after` callback of \" + what[methodName].displayName)(data);\n }\n\n if (once) cancel();\n return data.returnValue;\n };\n\n what[methodName].__monkeyPatched = true;\n if (!what[methodName].__originalMethod) what[methodName].__originalMethod = origMethod;\n what[methodName].displayName = \"patched \" + (what[methodName].displayName || methodName);\n return cancel;\n}; // Event when element is removed\n\n\nBdApi.onRemoved = function (node, callback) {\n return _utilities__WEBPACK_IMPORTED_MODULE_0__[\"default\"].onRemoved(node, callback);\n}; // Wraps function in try..catch\n\n\nBdApi.suppressErrors = function (method, message) {\n return _utilities__WEBPACK_IMPORTED_MODULE_0__[\"default\"].suppressErrors(method, message);\n}; // Tests for valid JSON\n\n\nBdApi.testJSON = function (data) {\n return _utilities__WEBPACK_IMPORTED_MODULE_0__[\"default\"].testJSON(data);\n}; //Get another plugin\n//name = name of plugin\n\n\nBdApi.getPlugin = function (name) {\n return _pluginmanager__WEBPACK_IMPORTED_MODULE_7__[\"default\"].addonList.find(a => a.name == name);\n};\n\nBdApi.isPluginEnabled = function (name) {\n const plugin = this.getPlugin(name);\n if (!plugin) return false;\n return _pluginmanager__WEBPACK_IMPORTED_MODULE_7__[\"default\"].isEnabled(plugin.id);\n};\n\nBdApi.isThemeEnabled = function (name) {\n const theme = _thememanager__WEBPACK_IMPORTED_MODULE_8__[\"default\"].addonList.find(a => a.name == name);\n if (!theme) return false;\n return _thememanager__WEBPACK_IMPORTED_MODULE_8__[\"default\"].isEnabled(theme.id);\n}; // Gets data\n\n\nBdApi.getBDData = function (key) {\n return _datastore__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getBDData(key);\n}; // Sets data\n\n\nBdApi.setBDData = function (key, data) {\n return _datastore__WEBPACK_IMPORTED_MODULE_3__[\"default\"].setBDData(key, data);\n}; // const makeAddonAPI = (cookie, list, manager) => new class AddonAPI {\n// get folder() {return manager.folder;}\n// isEnabled(name) {\n// return !!cookie[name];\n// }\n// enable(name) {\n// return manager.enable(name);\n// }\n// disable(name) {\n// return manager.disable(name);\n// }\n// toggle(name) {\n// if (cookie[name]) this.disable(name);\n// else this.enable(name);\n// }\n// reload(name) {\n// return manager.reload(name);\n// }\n// get(name) {\n// if (list.hasOwnProperty(name)) {\n// if (list[name].plugin) return list[name].plugin;\n// return list[name];\n// }\n// return null;\n// }\n// getAll() {\n// return Object.keys(list).map(k => this.get(k)).filter(a => a);\n// }\n// };\n// BdApi.Plugins = makeAddonAPI(pluginCookie, bdplugins, pluginModule);\n// BdApi.Themes = makeAddonAPI(themeCookie, bdthemes, themeModule);\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (BdApi);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9Db3JlLy4vc3JjL21vZHVsZXMvcGx1Z2luYXBpLmpzPzZhOTMiXSwibmFtZXMiOlsiQmRBcGkiLCJSZWFjdCIsIkRpc2Nv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bWVzID0gbWFrZUFkZG9uQVBJKHRoZW1lQ29va2llLCBiZHRoZW1lcywgdGhlbWVNb2R1bGUpO1xyXG5cclxuZXhwb3J0IGRlZmF1bHQgQmRBcGk7Il0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/modules/pluginapi.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utilities */ \"./src/modules/utilities.js\");\n/* harmony import */ var _webpackmodules__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./webpackmodules */ \"./src/modules/webpackmodules.js\");\n/* harmony import */ var _discordmodules__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./discordmodules */ \"./src/modules/discordmodules.js\");\n/* harmony import */ var _datastore__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./datastore */ \"./src/modules/datastore.js\");\n/* harmony import */ var _dommanager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./dommanager */ \"./src/modules/dommanager.js\");\n/* harmony import */ var _ui_toasts__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../ui/toasts */ \"./src/ui/toasts.js\");\n/* harmony import */ var _ui_modals__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../ui/modals */ \"./src/ui/modals.js\");\n/* harmony import */ var _pluginmanager__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./pluginmanager */ \"./src/modules/pluginmanager.js\");\n/* harmony import */ var _thememanager__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./thememanager */ \"./src/modules/thememanager.js\");\n\n\n\n\n\n\n\n\n\nconst BdApi = {\n get React() {\n return _discordmodules__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React;\n },\n\n get ReactDOM() {\n return _discordmodules__WEBPACK_IMPORTED_MODULE_2__[\"default\"].ReactDOM;\n },\n\n get WindowConfigFile() {\n if (this._windowConfigFile) return this._windowConfigFile;\n\n const electron = __webpack_require__(/*! electron */ \"electron\").remote.app;\n\n const path = __webpack_require__(/*! path */ \"path\");\n\n const base = electron.getAppPath();\n const roamingBase = electron.getPath(\"userData\");\n const roamingLocation = path.resolve(roamingBase, electron.getVersion(), \"modules\", \"discord_desktop_core\", \"injector\", \"config.json\");\n const location = path.resolve(base, \"..\", \"app\", \"config.json\");\n\n const fs = __webpack_require__(/*! fs */ \"fs\");\n\n const realLocation = fs.existsSync(location) ? location : fs.existsSync(roamingLocation) ? roamingLocation : null;\n if (!realLocation) return this._windowConfigFile = null;\n return this._windowConfigFile = realLocation;\n }\n\n};\n\nBdApi.getAllWindowPreferences = function () {\n if (!this.WindowConfigFile) return {};\n return require(this.WindowConfigFile);\n};\n\nBdApi.getWindowPreference = function (key) {\n if (!this.WindowConfigFile) return undefined;\n return this.getAllWindowPreferences()[key];\n};\n\nBdApi.setWindowPreference = function (key, value) {\n if (!this.WindowConfigFile) return;\n\n const fs = __webpack_require__(/*! fs */ \"fs\");\n\n const prefs = this.getAllWindowPreferences();\n prefs[key] = value;\n delete __webpack_require__.c[this.WindowConfigFile];\n fs.writeFileSync(this.WindowConfigFile, JSON.stringify(prefs, null, 4));\n}; //Inject CSS to document head\n//id = id of element\n//css = custom css\n\n\nBdApi.injectCSS = function (id, css) {\n _dommanager__WEBPACK_IMPORTED_MODULE_4__[\"default\"].injectStyle(id, css);\n}; //Clear css/remove any element\n//id = id of element\n\n\nBdApi.clearCSS = function (id) {\n _dommanager__WEBPACK_IMPORTED_MODULE_4__[\"default\"].removeStyle(id);\n}; //Inject CSS to document head\n//id = id of element\n//css = custom css\n\n\nBdApi.linkJS = function (id, url) {\n return _dommanager__WEBPACK_IMPORTED_MODULE_4__[\"default\"].injectScript(id, url);\n}; //Clear css/remove any element\n//id = id of element\n\n\nBdApi.unlinkJS = function (id) {\n _dommanager__WEBPACK_IMPORTED_MODULE_4__[\"default\"].removeScript(id);\n};\n/**\r\n * Shows a generic but very customizable modal.\r\n * @param {string} title - title of the modal\r\n * @param {string} content - a string of text to display in the modal\r\n */\n\n\nBdApi.alert = function (title, content) {\n _ui_modals__WEBPACK_IMPORTED_MODULE_6__[\"default\"].alert(title, content);\n};\n/**\r\n * Shows a generic but very customizable confirmation modal with optional confirm and cancel callbacks.\r\n * @param {string} title - title of the modal\r\n * @param {(string|ReactElement|Array)} children - a single or mixed array of react elements and strings. Everything is wrapped in Discord's `TextElement` component so strings will show and render properly.\r\n * @param {object} [options] - options to modify the modal\r\n * @param {boolean} [options.danger=false] - whether the main button should be red or not\r\n * @param {string} [options.confirmText=Okay] - text for the confirmation/submit button\r\n * @param {string} [options.cancelText=Cancel] - text for the cancel button\r\n * @param {callable} [options.onConfirm=NOOP] - callback to occur when clicking the submit button\r\n * @param {callable} [options.onCancel=NOOP] - callback to occur when clicking the cancel button\r\n */\n\n\nBdApi.showConfirmationModal = function (title, content, options = {}) {\n return _ui_modals__WEBPACK_IMPORTED_MODULE_6__[\"default\"].showConfirmationModal(title, content, options);\n};\n/**\r\n * This shows a toast similar to android towards the bottom of the screen.\r\n *\r\n * @param {string} content The string to show in the toast.\r\n * @param {object} options Options object. Optional parameter.\r\n * @param {string} [options.type=\"\"] Changes the type of the toast stylistically and semantically. Choices: \"\", \"info\", \"success\", \"danger\"/\"error\", \"warning\"/\"warn\". Default: \"\"\r\n * @param {boolean} [options.icon=true] Determines whether the icon should show corresponding to the type. A toast without type will always have no icon. Default: true\r\n * @param {number} [options.timeout=3000] Adjusts the time (in ms) the toast should be shown for before disappearing automatically. Default: 3000\r\n * @param {boolean} [options.forceShow=false] Whether to force showing the toast and ignore the bd setting\r\n */\n\n\nBdApi.showToast = function (content, options = {}) {\n _ui_toasts__WEBPACK_IMPORTED_MODULE_5__[\"default\"].show(content, options);\n}; // Finds module\n\n\nBdApi.findModule = function (filter) {\n return _webpackmodules__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getModule(filter);\n}; // Finds module\n\n\nBdApi.findAllModules = function (filter) {\n return _webpackmodules__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getModule(filter, false);\n}; // Finds module\n\n\nBdApi.findModuleByProps = function (...props) {\n return _webpackmodules__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getByProps(...props);\n};\n\nBdApi.findModuleByPrototypes = function (...protos) {\n return _webpackmodules__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getByPrototypes(...protos);\n};\n\nBdApi.findModuleByDisplayName = function (name) {\n return _webpackmodules__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getByDisplayName(name);\n}; // Gets react instance\n\n\nBdApi.getInternalInstance = function (node) {\n if (!(node instanceof window.jQuery) && !(node instanceof Element)) return undefined;\n if (node instanceof jQuery) node = node[0];\n return _utilities__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getReactInstance(node);\n}; // Gets data\n\n\nBdApi.loadData = function (pluginName, key) {\n return _datastore__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getPluginData(pluginName, key);\n};\n\nBdApi.getData = BdApi.loadData; // Sets data\n\nBdApi.saveData = function (pluginName, key, data) {\n return _datastore__WEBPACK_IMPORTED_MODULE_3__[\"default\"].setPluginData(pluginName, key, data);\n};\n\nBdApi.setData = BdApi.saveData; // Deletes data\n\nBdApi.deleteData = function (pluginName, key) {\n return _datastore__WEBPACK_IMPORTED_MODULE_3__[\"default\"].deletePluginData(pluginName, key);\n}; // Patches other functions\n\n\nBdApi.monkeyPatch = function (what, methodName, options) {\n const {\n before,\n after,\n instead,\n once = false,\n silent = false,\n force = false\n } = options;\n const displayName = options.displayName || what.displayName || what.name || what.constructor.displayName || what.constructor.name;\n if (!silent) console.log(\"patch\", methodName, \"of\", displayName); // eslint-disable-line no-console\n\n if (!what[methodName]) {\n if (force) what[methodName] = function () {};else return console.error(methodName, \"does not exist for\", displayName); // eslint-disable-line no-console\n }\n\n const origMethod = what[methodName];\n\n const cancel = () => {\n if (!silent) console.log(\"unpatch\", methodName, \"of\", displayName); // eslint-disable-line no-console\n\n what[methodName] = origMethod;\n };\n\n what[methodName] = function () {\n const data = {\n thisObject: this,\n methodArguments: arguments,\n cancelPatch: cancel,\n originalMethod: origMethod,\n callOriginalMethod: () => data.returnValue = data.originalMethod.apply(data.thisObject, data.methodArguments)\n };\n\n if (instead) {\n const tempRet = _utilities__WEBPACK_IMPORTED_MODULE_0__[\"default\"].suppressErrors(instead, \"`instead` callback of \" + what[methodName].displayName)(data);\n if (tempRet !== undefined) data.returnValue = tempRet;\n } else {\n if (before) _utilities__WEBPACK_IMPORTED_MODULE_0__[\"default\"].suppressErrors(before, \"`before` callback of \" + what[methodName].displayName)(data);\n data.callOriginalMethod();\n if (after) _utilities__WEBPACK_IMPORTED_MODULE_0__[\"default\"].suppressErrors(after, \"`after` callback of \" + what[methodName].displayName)(data);\n }\n\n if (once) cancel();\n return data.returnValue;\n };\n\n what[methodName].__monkeyPatched = true;\n if (!what[methodName].__originalMethod) what[methodName].__originalMethod = origMethod;\n what[methodName].displayName = \"patched \" + (what[methodName].displayName || methodName);\n return cancel;\n}; // Event when element is removed\n\n\nBdApi.onRemoved = function (node, callback) {\n return _utilities__WEBPACK_IMPORTED_MODULE_0__[\"default\"].onRemoved(node, callback);\n}; // Wraps function in try..catch\n\n\nBdApi.suppressErrors = function (method, message) {\n return _utilities__WEBPACK_IMPORTED_MODULE_0__[\"default\"].suppressErrors(method, message);\n}; // Tests for valid JSON\n\n\nBdApi.testJSON = function (data) {\n return _utilities__WEBPACK_IMPORTED_MODULE_0__[\"default\"].testJSON(data);\n}; //Get another plugin\n//name = name of plugin\n\n\nBdApi.getPlugin = function (name) {\n return _pluginmanager__WEBPACK_IMPORTED_MODULE_7__[\"default\"].addonList.find(a => a.name == name);\n};\n\nBdApi.isPluginEnabled = function (name) {\n const plugin = this.getPlugin(name);\n if (!plugin) return false;\n return _pluginmanager__WEBPACK_IMPORTED_MODULE_7__[\"default\"].isEnabled(plugin.id);\n};\n\nBdApi.isThemeEnabled = function (name) {\n const theme = _thememanager__WEBPACK_IMPORTED_MODULE_8__[\"default\"].addonList.find(a => a.name == name);\n if (!theme) return false;\n return _thememanager__WEBPACK_IMPORTED_MODULE_8__[\"default\"].isEnabled(theme.id);\n};\n\nBdApi.isSettingEnabled = function (name) {\n return null;\n}; // Gets data\n\n\nBdApi.getBDData = function (key) {\n return _datastore__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getBDData(key);\n}; // Sets data\n\n\nBdApi.setBDData = function (key, data) {\n return _datastore__WEBPACK_IMPORTED_MODULE_3__[\"default\"].setBDData(key, data);\n}; // const makeAddonAPI = (cookie, list, manager) => new class AddonAPI {\n// get folder() {return manager.folder;}\n// isEnabled(name) {\n// return !!cookie[name];\n// }\n// enable(name) {\n// return manager.enable(name);\n// }\n// disable(name) {\n// return manager.disable(name);\n// }\n// toggle(name) {\n// if (cookie[name]) this.disable(name);\n// else this.enable(name);\n// }\n// reload(name) {\n// return manager.reload(name);\n// }\n// get(name) {\n// if (list.hasOwnProperty(name)) {\n// if (list[name].plugin) return list[name].plugin;\n// return list[name];\n// }\n// return null;\n// }\n// getAll() {\n// return Object.keys(list).map(k => this.get(k)).filter(a => a);\n// }\n// };\n// BdApi.Plugins = makeAddonAPI(pluginCookie, bdplugins, pluginModule);\n// BdApi.Themes = makeAddonAPI(themeCookie, bdthemes, themeModule);\n\n\nBdApi.Plugins = BdApi.themes = new class AddonAPI {\n get folder() {\n return \"\";\n }\n\n isEnabled(name) {\n return null;\n }\n\n enable(name) {\n return null;\n }\n\n disable(name) {\n return null;\n }\n\n toggle(name) {\n return null;\n }\n\n reload(name) {\n return null;\n }\n\n get(name) {\n return null;\n }\n\n getAll() {\n return [];\n }\n\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (BdApi);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9Db3JlLy4vc3JjL21vZHVsZ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1lcyA9IG1ha2VBZGRvbkFQSSh0aGVtZUNvb2tpZSwgYmR0aGVtZXMsIHRoZW1lTW9kdWxlKTtcclxuXHJcbkJkQXBpLlBsdWdpbnMgPSBCZEFwaS50aGVtZXMgPSBuZXcgY2xhc3MgQWRkb25BUEkge1xyXG5cclxuICAgIGdldCBmb2xkZXIoKSB7cmV0dXJuIFwiXCI7fVxyXG5cclxuICAgIGlzRW5hYmxlZChuYW1lKSB7XHJcbiAgICAgICAgcmV0dXJuIG51bGw7XHJcbiAgICB9XHJcblxyXG4gICAgZW5hYmxlKG5hbWUpIHtcclxuICAgICAgICByZXR1cm4gbnVsbDtcclxuICAgIH1cclxuXHJcbiAgICBkaXNhYmxlKG5hbWUpIHtcclxuICAgICAgICByZXR1cm4gbnVsbDtcclxuICAgIH1cclxuXHJcbiAgICB0b2dnbGUobmFtZSkge1xyXG4gICAgICAgIHJldHVybiBudWxsO1xyXG4gICAgfVxyXG5cclxuICAgIHJlbG9hZChuYW1lKSB7XHJcbiAgICAgICAgcmV0dXJuIG51bGw7XHJcbiAgICB9XHJcblxyXG4gICAgZ2V0KG5hbWUpIHtcclxuICAgICAgICByZXR1cm4gbnVsbDtcclxuICAgIH1cclxuXHJcbiAgICBnZXRBbGwoKSB7XHJcbiAgICAgICAgcmV0dXJuIFtdO1xyXG4gICAgfVxyXG59O1xyXG5cclxuZXhwb3J0IGRlZmF1bHQgQmRBcGk7Il0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/modules/pluginapi.js\n"); /***/ }), diff --git a/src/modules/pluginapi.js b/src/modules/pluginapi.js index 6d5f38de..9c213389 100644 --- a/src/modules/pluginapi.js +++ b/src/modules/pluginapi.js @@ -230,6 +230,10 @@ BdApi.isThemeEnabled = function(name) { return ThemeManager.isEnabled(theme.id); }; +BdApi.isSettingEnabled = function(name) { + return null; +}; + // Gets data BdApi.getBDData = function(key) { return DataStore.getBDData(key); @@ -281,4 +285,37 @@ BdApi.setBDData = function(key, data) { // BdApi.Plugins = makeAddonAPI(pluginCookie, bdplugins, pluginModule); // BdApi.Themes = makeAddonAPI(themeCookie, bdthemes, themeModule); +BdApi.Plugins = BdApi.themes = new class AddonAPI { + + get folder() {return "";} + + isEnabled(name) { + return null; + } + + enable(name) { + return null; + } + + disable(name) { + return null; + } + + toggle(name) { + return null; + } + + reload(name) { + return null; + } + + get(name) { + return null; + } + + getAll() { + return []; + } +}; + export default BdApi; \ No newline at end of file