From eb4358e626ca610441718510db5093ea549eebec Mon Sep 17 00:00:00 2001 From: Zack Rauen Date: Wed, 26 Jun 2019 14:34:01 -0400 Subject: [PATCH] bugfixes for last night --- js/main.js | 10 +++++----- src/builtins/customcss.js | 9 +++++---- src/modules/reactcomponents.js | 5 +++-- src/modules/settingsmanager.js | 8 ++------ src/modules/strings.js | 1 - src/ui/customcss/csseditor.jsx | 2 +- src/ui/settings.js | 13 ++++++++++--- 7 files changed, 26 insertions(+), 22 deletions(-) diff --git a/js/main.js b/js/main.js index aa3c3493..d198dc28 100644 --- a/js/main.js +++ b/js/main.js @@ -143,7 +143,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _str /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _structs_builtin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../structs/builtin */ \"./src/structs/builtin.js\");\n/* harmony import */ var modules__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! modules */ \"./src/modules/modules.js\");\n/* harmony import */ var _ui_customcss_csseditor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../ui/customcss/csseditor */ \"./src/ui/customcss/csseditor.jsx\");\n/* harmony import */ var _ui_floating_container__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ui/floating/container */ \"./src/ui/floating/container.jsx\");\n/* harmony import */ var _ui_settings_title__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../ui/settings/title */ \"./src/ui/settings/title.jsx\");\n\n\n\n\n\n\nconst fs = __webpack_require__(/*! fs */ \"fs\");\n\nconst electron = __webpack_require__(/*! electron */ \"electron\");\n\nconst UserSettings = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"updateAccount\");\nconst Dispatcher = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"dirtyDispatch\");\nconst ActionTypes = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"ActionTypes\").ActionTypes;\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class CustomCSS extends _structs_builtin__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n get name() {\n return \"Custom CSS\";\n }\n\n get category() {\n return \"customcss\";\n }\n\n get id() {\n return \"customcss\";\n }\n\n get startDetached() {\n return modules__WEBPACK_IMPORTED_MODULE_1__[\"Settings\"].get(this.collection, this.category, \"startDetached\");\n }\n\n get nativeOpen() {\n return modules__WEBPACK_IMPORTED_MODULE_1__[\"Settings\"].get(this.collection, this.category, \"nativeOpen\");\n }\n\n constructor() {\n super();\n this.savedCss = \"\";\n this.insertedCss = \"\";\n this.isDetached = false;\n }\n\n async enabled() {\n if (!window.ace) {\n modules__WEBPACK_IMPORTED_MODULE_1__[\"DOMManager\"].injectScript(\"ace-script\", \"https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ace.js\").then(() => {\n if (window.require.original) window.require = window.require.original;\n });\n }\n\n modules__WEBPACK_IMPORTED_MODULE_1__[\"Settings\"].registerPanel(this.id, modules__WEBPACK_IMPORTED_MODULE_1__[\"Strings\"].Panels.customcss, {\n order: 2,\n element: () => [modules__WEBPACK_IMPORTED_MODULE_1__[\"React\"].createElement(_ui_settings_title__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n text: modules__WEBPACK_IMPORTED_MODULE_1__[\"Strings\"].CustomCSS.editorTitle\n }), modules__WEBPACK_IMPORTED_MODULE_1__[\"React\"].createElement(_ui_customcss_csseditor__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n css: this.savedCss,\n save: this.saveCSS.bind(this),\n update: this.insertCSS.bind(this),\n openNative: this.openNative.bind(this),\n openDetached: this.openDetached.bind(this),\n onChange: this.onChange.bind(this)\n })],\n onClick: thisObject => {\n if (this.isDetached) return;\n if (this.nativeOpen) this.openNative();else if (this.startDetached) this.openDetached();else thisObject._reactInternalFiber.child.memoizedProps.children.props.onSetSection(modules__WEBPACK_IMPORTED_MODULE_1__[\"Strings\"].Panels.customcss);\n this.setSection = thisObject._reactInternalFiber.child.memoizedProps.children.props.onSetSection;\n }\n });\n this.loadCSS();\n this.insertCSS(this.savedCss);\n this.watchContent();\n }\n\n disabled() {\n modules__WEBPACK_IMPORTED_MODULE_1__[\"Settings\"].removePanel(this.id);\n this.unwatchContent();\n }\n\n watchContent() {\n if (this.watcher) return this.error(\"Already watching content.\");\n const timeCache = {};\n this.log(\"Starting to watch content.\");\n this.watcher = fs.watch(modules__WEBPACK_IMPORTED_MODULE_1__[\"DataStore\"].customCSS, {\n persistent: false\n }, async (eventType, filename) => {\n if (!eventType || !filename) return;\n await new Promise(r => setTimeout(r, 50));\n\n try {\n fs.statSync(modules__WEBPACK_IMPORTED_MODULE_1__[\"DataStore\"].customCSS);\n } catch (err) {\n if (err.code !== \"ENOENT\") return;\n delete timeCache[filename];\n this.saveCSS(\"\");\n }\n\n const stats = fs.statSync(modules__WEBPACK_IMPORTED_MODULE_1__[\"DataStore\"].customCSS);\n if (!stats || !stats.mtime || !stats.mtime.getTime()) return;\n if (typeof stats.mtime.getTime() !== \"number\") return;\n if (timeCache[filename] == stats.mtime.getTime()) return;\n timeCache[filename] = stats.mtime.getTime();\n\n if (eventType == \"change\") {\n const newCSS = modules__WEBPACK_IMPORTED_MODULE_1__[\"DataStore\"].loadCustomCSS();\n if (newCSS == this.savedCss) return;\n this.savedCss = newCSS;\n this.insertCSS(this.savedCss);\n modules__WEBPACK_IMPORTED_MODULE_1__[\"Events\"].emit(\"customcss-updated\", this.savedCss);\n }\n });\n }\n\n unwatchContent() {\n if (!this.watcher) return this.error(\"Was not watching content.\");\n this.watcher.close();\n delete this.watcher;\n this.log(\"No longer watching content.\");\n }\n\n onChange(value) {\n if (!modules__WEBPACK_IMPORTED_MODULE_1__[\"Settings\"].get(\"settings\", \"customcss\", \"liveUpdate\")) return;\n this.insertCSS(value);\n this.saveCSS(value);\n }\n\n loadCSS() {\n this.savedCss = modules__WEBPACK_IMPORTED_MODULE_1__[\"DataStore\"].loadCustomCSS();\n }\n\n insertCSS(newCss) {\n if (typeof newCss === \"undefined\") newCss = this.insertedCss;else this.insertedCss = newCss;\n modules__WEBPACK_IMPORTED_MODULE_1__[\"DOMManager\"].updateCustomCSS(newCss);\n }\n\n saveCSS(newCss) {\n if (typeof newCss !== \"undefined\") this.savedCss = newCss;\n modules__WEBPACK_IMPORTED_MODULE_1__[\"DataStore\"].saveCustomCSS(this.savedCss);\n }\n\n openNative() {\n electron.shell.openExternal(`file://${modules__WEBPACK_IMPORTED_MODULE_1__[\"DataStore\"].customCSS}`);\n }\n\n openDetached(currentCSS) {\n const editorRef = modules__WEBPACK_IMPORTED_MODULE_1__[\"React\"].createRef();\n const editor = modules__WEBPACK_IMPORTED_MODULE_1__[\"React\"].createElement(_ui_customcss_csseditor__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n id: \"bd-floating-editor\",\n ref: editorRef,\n css: currentCSS,\n save: this.saveCSS.bind(this),\n update: this.insertCSS.bind(this),\n openNative: this.openNative.bind(this),\n onChange: this.onChange.bind(this)\n });\n _ui_floating_container__WEBPACK_IMPORTED_MODULE_3__[\"default\"].open({\n onClose: () => {\n this.isDetached = false;\n },\n onResize: () => {\n if (!editorRef || !editorRef.current || !editorRef.current.resize) return;\n editorRef.current.resize();\n },\n title: modules__WEBPACK_IMPORTED_MODULE_1__[\"Strings\"].CustomCSS.editorTitle,\n id: \"floating-editor-window\",\n height: 470,\n width: 410,\n center: true,\n resizable: true,\n children: editor,\n confirmClose: () => {\n if (!editorRef || !editorRef.current) return false;\n return editorRef.current.hasUnsavedChanges;\n },\n confirmationText: modules__WEBPACK_IMPORTED_MODULE_1__[\"Strings\"].CustomCSS.confirmationText\n });\n this.isDetached = true;\n UserSettings.close();\n Dispatcher.dirtyDispatch({\n type: ActionTypes.LAYER_POP\n });\n }\n\n}());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;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WVudChDU1NFZGl0b3IsIHtcclxuICAgICAgICAgICAgICAgIGNzczogdGhpcy5zYXZlZENzcyxcclxuICAgICAgICAgICAgICAgIHNhdmU6IHRoaXMuc2F2ZUNTUy5iaW5kKHRoaXMpLFxyXG4gICAgICAgICAgICAgICAgdXBkYXRlOiB0aGlzLmluc2VydENTUy5iaW5kKHRoaXMpLFxyXG4gICAgICAgICAgICAgICAgb3Blbk5hdGl2ZTogdGhpcy5vcGVuTmF0aXZlLmJpbmQodGhpcyksXHJcbiAgICAgICAgICAgICAgICBvcGVuRGV0YWNoZWQ6IHRoaXMub3BlbkRldGFjaGVkLmJpbmQodGhpcyksXHJcbiAgICAgICAgICAgICAgICBvbkNoYW5nZTogdGhpcy5vbkNoYW5nZS5iaW5kKHRoaXMpXHJcbiAgICAgICAgICAgIH0pXSxcclxuICAgICAgICAgICAgb25DbGljazogKHRoaXNPYmplY3QpID0+IHtcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLmlzRGV0YWNoZWQpIHJldHVybjtcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLm5hdGl2ZU9wZW4pIHRoaXMub3Blbk5hdGl2ZSgpO1xyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAodGhpcy5zdGFydERldGFjaGVkKSB0aGlzLm9wZW5EZXRhY2hlZCgpO1xyXG4gICAgICAgICAgICAgICAgZWxzZSB0aGlzT2JqZWN0Ll9yZWFjdEludGVybmFsRmliZXIuY2hpbGQubWVtb2l6ZWRQcm9wcy5jaGlsZHJlbi5wcm9wcy5vblNldFNlY3Rpb24oU3RyaW5ncy5QYW5lbHMuY3VzdG9tY3NzKTtcclxuICAgICAgICAgICAgICAgIHRoaXMuc2V0U2VjdGlvbiA9IHRoaXNPYmplY3QuX3JlYWN0SW50ZXJuYWxGaWJlci5jaGlsZC5tZW1vaXplZFByb3BzLmNoaWxkcmVuLnByb3BzLm9uU2V0U2VjdGlvbjtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0p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lbnQucmVzaXplKCk7XHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIHRpdGxlOiBTdHJpbmdzLkN1c3RvbUNTUy5lZGl0b3JUaXRsZSxcclxuICAgICAgICAgICAgaWQ6IFwiZmxvYXRpbmctZWRpdG9yLXdpbmRvd1wiLFxyXG4gICAgICAgICAgICBoZWlnaHQ6IDQ3MCxcclxuICAgICAgICAgICAgd2lkdGg6IDQxMCxcclxuICAgICAgICAgICAgY2VudGVyOiB0cnVlLFxyXG4gICAgICAgICAgICByZXNpemFibGU6IHRydWUsXHJcbiAgICAgICAgICAgIGNoaWxkcmVuOiBlZGl0b3IsXHJcbiAgICAgICAgICAgIGNvbmZpcm1DbG9zZTogKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgaWYgKCFlZGl0b3JSZWYgfHwgIWVkaXRvclJlZi5jdXJyZW50KSByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gZWRpdG9yUmVmLmN1cnJlbnQuaGFzVW5zYXZlZENoYW5nZXM7XHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIGNvbmZpcm1hdGlvblRleHQ6IFN0cmluZ3MuQ3VzdG9tQ1NTLmNvbmZpcm1hdGlvblRleHRcclxuICAgICAgICB9KTtcclxuICAgICAgICB0aGlzLmlzRGV0YWNoZWQgPSB0cnVlO1xyXG4gICAgICAgIFVzZXJTZXR0aW5ncy5jbG9zZSgpO1xyXG4gICAgICAgIERpc3BhdGNoZXIuZGlydHlEaXNwYXRjaCh7dHlwZTogQWN0aW9uVHlwZXMuTEFZRVJfUE9QfSk7XHJcbiAgICB9XHJcbn07Il0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/builtins/customcss.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _structs_builtin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../structs/builtin */ \"./src/structs/builtin.js\");\n/* harmony import */ var modules__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! modules */ \"./src/modules/modules.js\");\n/* harmony import */ var _ui_customcss_csseditor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../ui/customcss/csseditor */ \"./src/ui/customcss/csseditor.jsx\");\n/* harmony import */ var _ui_floating_container__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ui/floating/container */ \"./src/ui/floating/container.jsx\");\n/* harmony import */ var _ui_settings_title__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../ui/settings/title */ \"./src/ui/settings/title.jsx\");\n/* harmony import */ var _modules_utilities__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../modules/utilities */ \"./src/modules/utilities.js\");\n\n\n\n\n\n\n\nconst fs = __webpack_require__(/*! fs */ \"fs\");\n\nconst electron = __webpack_require__(/*! electron */ \"electron\");\n\nconst UserSettings = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"updateAccount\");\nconst Dispatcher = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"dirtyDispatch\");\nconst ActionTypes = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"ActionTypes\").ActionTypes;\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class CustomCSS extends _structs_builtin__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n get name() {\n return \"Custom CSS\";\n }\n\n get category() {\n return \"customcss\";\n }\n\n get id() {\n return \"customcss\";\n }\n\n get startDetached() {\n return modules__WEBPACK_IMPORTED_MODULE_1__[\"Settings\"].get(this.collection, this.category, \"startDetached\");\n }\n\n get nativeOpen() {\n return modules__WEBPACK_IMPORTED_MODULE_1__[\"Settings\"].get(this.collection, this.category, \"nativeOpen\");\n }\n\n constructor() {\n super();\n this.savedCss = \"\";\n this.insertedCss = \"\";\n this.isDetached = false;\n }\n\n async enabled() {\n if (!window.ace) {\n modules__WEBPACK_IMPORTED_MODULE_1__[\"DOMManager\"].injectScript(\"ace-script\", \"https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ace.js\").then(() => {\n if (window.require.original) window.require = window.require.original;\n });\n }\n\n modules__WEBPACK_IMPORTED_MODULE_1__[\"Settings\"].registerPanel(this.id, modules__WEBPACK_IMPORTED_MODULE_1__[\"Strings\"].Panels.customcss, {\n order: 2,\n element: () => [modules__WEBPACK_IMPORTED_MODULE_1__[\"React\"].createElement(_ui_settings_title__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n text: modules__WEBPACK_IMPORTED_MODULE_1__[\"Strings\"].CustomCSS.editorTitle\n }), modules__WEBPACK_IMPORTED_MODULE_1__[\"React\"].createElement(_ui_customcss_csseditor__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n css: this.savedCss,\n save: this.saveCSS.bind(this),\n update: this.insertCSS.bind(this),\n openNative: this.openNative.bind(this),\n openDetached: this.openDetached.bind(this),\n onChange: this.onChange.bind(this)\n })],\n onClick: thisObject => {\n if (this.isDetached) return;\n if (this.nativeOpen) return this.openNative();else if (this.startDetached) return this.openDetached();\n const settingsView = _modules_utilities__WEBPACK_IMPORTED_MODULE_5__[\"default\"].findInRenderTree(thisObject._reactInternalFiber, m => m && m.onSetSection, {\n walkable: [\"child\", \"memoizedProps\", \"props\", \"children\"]\n });\n if (settingsView && settingsView.onSetSection) settingsView.onSetSection(this.id);\n }\n });\n this.loadCSS();\n this.insertCSS(this.savedCss);\n this.watchContent();\n }\n\n disabled() {\n modules__WEBPACK_IMPORTED_MODULE_1__[\"Settings\"].removePanel(this.id);\n this.unwatchContent();\n }\n\n watchContent() {\n if (this.watcher) return this.error(\"Already watching content.\");\n const timeCache = {};\n this.log(\"Starting to watch content.\");\n this.watcher = fs.watch(modules__WEBPACK_IMPORTED_MODULE_1__[\"DataStore\"].customCSS, {\n persistent: false\n }, async (eventType, filename) => {\n if (!eventType || !filename) return;\n await new Promise(r => setTimeout(r, 50));\n\n try {\n fs.statSync(modules__WEBPACK_IMPORTED_MODULE_1__[\"DataStore\"].customCSS);\n } catch (err) {\n if (err.code !== \"ENOENT\") return;\n delete timeCache[filename];\n this.saveCSS(\"\");\n }\n\n const stats = fs.statSync(modules__WEBPACK_IMPORTED_MODULE_1__[\"DataStore\"].customCSS);\n if (!stats || !stats.mtime || !stats.mtime.getTime()) return;\n if (typeof stats.mtime.getTime() !== \"number\") return;\n if (timeCache[filename] == stats.mtime.getTime()) return;\n timeCache[filename] = stats.mtime.getTime();\n\n if (eventType == \"change\") {\n const newCSS = modules__WEBPACK_IMPORTED_MODULE_1__[\"DataStore\"].loadCustomCSS();\n if (newCSS == this.savedCss) return;\n this.savedCss = newCSS;\n this.insertCSS(this.savedCss);\n modules__WEBPACK_IMPORTED_MODULE_1__[\"Events\"].emit(\"customcss-updated\", this.savedCss);\n }\n });\n }\n\n unwatchContent() {\n if (!this.watcher) return this.error(\"Was not watching content.\");\n this.watcher.close();\n delete this.watcher;\n this.log(\"No longer watching content.\");\n }\n\n onChange(value) {\n if (!modules__WEBPACK_IMPORTED_MODULE_1__[\"Settings\"].get(\"settings\", \"customcss\", \"liveUpdate\")) return;\n this.insertCSS(value);\n this.saveCSS(value);\n }\n\n loadCSS() {\n this.savedCss = modules__WEBPACK_IMPORTED_MODULE_1__[\"DataStore\"].loadCustomCSS();\n }\n\n insertCSS(newCss) {\n if (typeof newCss === \"undefined\") newCss = this.insertedCss;else this.insertedCss = newCss;\n modules__WEBPACK_IMPORTED_MODULE_1__[\"DOMManager\"].updateCustomCSS(newCss);\n }\n\n saveCSS(newCss) {\n if (typeof newCss !== \"undefined\") this.savedCss = newCss;\n modules__WEBPACK_IMPORTED_MODULE_1__[\"DataStore\"].saveCustomCSS(this.savedCss);\n }\n\n openNative() {\n electron.shell.openExternal(`file://${modules__WEBPACK_IMPORTED_MODULE_1__[\"DataStore\"].customCSS}`);\n }\n\n openDetached(currentCSS) {\n const editorRef = modules__WEBPACK_IMPORTED_MODULE_1__[\"React\"].createRef();\n const editor = modules__WEBPACK_IMPORTED_MODULE_1__[\"React\"].createElement(_ui_customcss_csseditor__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n id: \"bd-floating-editor\",\n ref: editorRef,\n css: currentCSS,\n save: this.saveCSS.bind(this),\n update: this.insertCSS.bind(this),\n openNative: this.openNative.bind(this),\n onChange: this.onChange.bind(this)\n });\n _ui_floating_container__WEBPACK_IMPORTED_MODULE_3__[\"default\"].open({\n onClose: () => {\n this.isDetached = false;\n },\n onResize: () => {\n if (!editorRef || !editorRef.current || !editorRef.current.resize) return;\n editorRef.current.resize();\n },\n title: modules__WEBPACK_IMPORTED_MODULE_1__[\"Strings\"].CustomCSS.editorTitle,\n id: \"floating-editor-window\",\n height: 470,\n width: 410,\n center: true,\n resizable: true,\n children: editor,\n confirmClose: () => {\n if (!editorRef || !editorRef.current) return false;\n return editorRef.current.hasUnsavedChanges;\n },\n confirmationText: modules__WEBPACK_IMPORTED_MODULE_1__[\"Strings\"].CustomCSS.confirmationText\n });\n this.isDetached = true;\n UserSettings.close();\n Dispatcher.dirtyDispatch({\n type: ActionTypes.LAYER_POP\n });\n }\n\n}());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9Db3JlLy4vc3JjL2J1aWx0aW5zL2N1c3RvbWNzcy5qcz9jM2YyIl0sIm5hbWVzIjpbImZzIiwicmVxdWlyZSIsImVsZWN0cm9uIiwiVXNlclNldHRpbmdzIiwiV2VicGFja01vZHVsZXMiLCJnZXRCeVByb3BzIiwiRGlzcGF0Y2hlciIsIkFjdGlvblR5cGVzIiwiQ3VzdG9tQ1NTIiwiQnVpbHRpbiIsIm5hbWUiLCJjYXRlZ29yeSIsImlkIiwic3RhcnREZXRhY2hlZCIsIlNldHRpbmdzIiwiZ2V0IiwiY29sbGVjdGlvbiIsIm5hdGl2ZU9wZW4iLCJ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cy5vcGVuTmF0aXZlLmJpbmQodGhpcyksXHJcbiAgICAgICAgICAgICAgICBvcGVuRGV0YWNoZWQ6IHRoaXMub3BlbkRldGFjaGVkLmJpbmQodGhpcyksXHJcbiAgICAgICAgICAgICAgICBvbkNoYW5nZTogdGhpcy5vbkNoYW5nZS5iaW5kKHRoaXMpXHJcbiAgICAgICAgICAgIH0pXSxcclxuICAgICAgICAgICAgb25DbGljazogKHRoaXNPYmplY3QpID0+IHtcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLmlzRGV0YWNoZWQpIHJldHVybjtcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLm5hdGl2ZU9wZW4pIHJldHVybiB0aGlzLm9wZW5OYXRpdmUoKTtcclxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHRoaXMuc3RhcnREZXRhY2hlZCkgcmV0dXJuIHRoaXMub3BlbkRldGFjaGVkKCk7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBzZXR0aW5nc1ZpZXcgPSBVdGlsaXRpZXMuZmluZEluUmVuZGVyVHJlZSh0aGlzT2JqZWN0Ll9yZWFjdEludGVybmFsRmliZXIsIG0gPT4gbSAmJiBtLm9uU2V0U2VjdGlvbiwge3dhbGthYmxlOiBbXCJjaGlsZFwiLCBcIm1lbW9pemVkUHJvcHNcIiwgXCJwcm9wc1wiLCBcImNoaWxkcmVuXCJdfSk7XHJcbiAgICAgICAgICAgICAgICBpZiAoc2V0dGluZ3NWaWV3ICYmIHNldHRpbmdzVmlldy5vblNldFNlY3Rpb24pIHNldHRpbmdzVmlldy5vblNldFNlY3Rpb24odGhpcy5pZCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuICAgICAgICB0aGlzLmxvYWRDU1MoKTtcclxuICAgICAgICB0aGlzLmluc2VydENTUyh0aGlzLnNhdmVkQ3NzKTtcclxuICAgICAgICB0aGlzLndhdGNoQ29udGVudCgpO1xyXG4gICAgfVxyXG5cclxuICAgIGRpc2FibGVk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BlZGl0b3JSZWYgPSBSZWFjdC5jcmVhdGVSZWYoKTtcclxuICAgICAgICBjb25zdCBlZGl0b3IgPSBSZWFjdC5jcmVhdGVFbGVtZW50KENTU0VkaXRvciwge1xyXG4gICAgICAgICAgICBpZDogXCJiZC1mbG9hdGluZy1lZGl0b3JcIixcclxuICAgICAgICAgICAgcmVmOiBlZGl0b3JSZWYsXHJcbiAgICAgICAgICAgIGNzczogY3VycmVudENTUyxcclxuICAgICAgICAgICAgc2F2ZTogdGhpcy5zYXZlQ1NTLmJpbmQodGhpcyksXHJcbiAgICAgICAgICAgIHVwZGF0ZTogdGhpcy5pbnNlcnRDU1MuYmluZCh0aGlzKSxcclxuICAgICAgICAgICAgb3Blbk5hdGl2ZTogdGhpcy5vcGVuTmF0aXZlLmJpbmQodGhpcyksXHJcbiAgICAgICAgICAgIG9uQ2hhbmdlOiB0aGlzLm9uQ2hhbmdlLmJpbmQodGhpcylcclxuICAgICAgICB9KTtcclxuXHJcbiAgICAgICAgRmxvYXRpbmdXaW5kb3dDb250YWluZXIub3Blbih7XHJcbiAgICAgICAgICAgIG9uQ2xvc2U6ICgpID0+IHtcclxuICAgICAgICAgICAgICAgIHRoaXMuaXNEZXRhY2hlZCA9IGZhbHNlO1xyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBvblJlc2l6ZTogKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgaWYgKCFlZGl0b3JSZWYgfHwgIWVkaXRvclJlZi5jdXJyZW50IHx8ICFlZGl0b3JSZWYuY3VycmVudC5yZXNpemUpIHJldHVybjtcclxuICAgICAgICAgICAgICAgIGVkaXRvclJlZi5jdXJyZW50LnJlc2l6ZSgpO1xyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICB0aXRsZTogU3RyaW5ncy5DdXN0b21DU1MuZWRpdG9yVGl0bGUsXHJcbiAgICAgICAgICAgIGlkOiBcImZsb2F0aW5nLWVkaXRvci13aW5kb3dcIixcclxuICAgICAgICAgICAgaGVpZ2h0OiA0NzAsXHJcbiAgICAgICAgICAgIHdpZHRoOiA0MTAsXHJcbiAgICAgICAgICAgIGNlbnRlcjogdHJ1ZSxcclxuICAgICAgICAgICAgcmVzaXphYmxlOiB0cnVlLFxyXG4gICAgICAgICAgICBjaGlsZHJlbjogZWRpdG9yLFxyXG4gICAgICAgICAgICBjb25maXJtQ2xvc2U6ICgpID0+IHtcclxuICAgICAgICAgICAgICAgIGlmICghZWRpdG9yUmVmIHx8ICFlZGl0b3JSZWYuY3VycmVudCkgcmV0dXJuIGZhbHNlO1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGVkaXRvclJlZi5jdXJyZW50Lmhhc1Vuc2F2ZWRDaGFuZ2VzO1xyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBjb25maXJtYXRpb25UZXh0OiBTdHJpbmdzLkN1c3RvbUNTUy5jb25maXJtYXRpb25UZXh0XHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgdGhpcy5pc0RldGFjaGVkID0gdHJ1ZTtcclxuICAgICAgICBVc2VyU2V0dGluZ3MuY2xvc2UoKTtcclxuICAgICAgICBEaXNwYXRjaGVyLmRpcnR5RGlzcGF0Y2goe3R5cGU6IEFjdGlvblR5cGVzLkxBWUVSX1BPUH0pO1xyXG4gICAgfVxyXG59OyJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/builtins/customcss.js\n"); /***/ }), @@ -515,7 +515,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dis /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! data */ \"./src/data/data.js\");\n/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./logger */ \"./src/modules/logger.js\");\n/* harmony import */ var _datastore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./datastore */ \"./src/modules/datastore.js\");\n/* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./emitter */ \"./src/modules/emitter.js\");\n/* harmony import */ var _discordmodules__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./discordmodules */ \"./src/modules/discordmodules.js\");\n/* harmony import */ var _strings__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./strings */ \"./src/modules/strings.js\");\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class SettingsManager {\n constructor() {\n this.state = {};\n this.collections = [];\n this.panels = [];\n this.registerCollection(\"settings\", \"Settings\", data__WEBPACK_IMPORTED_MODULE_0__[\"SettingsConfig\"]);\n this.updateStrings = this.updateStrings.bind(this);\n }\n\n initialize() {\n this.loadSettings();\n this.updateStrings();\n _emitter__WEBPACK_IMPORTED_MODULE_3__[\"default\"].on(\"strings-updated\", this.updateStrings); // this.patchSections();\n }\n\n registerCollection(id, name, settings, button = null) {\n if (this.collections.find(c => c.id == id)) return _logger__WEBPACK_IMPORTED_MODULE_1__[\"default\"].error(\"Settings\", \"Already have a collection with id \" + id);\n this.collections.push({\n type: \"collection\",\n id: id,\n name: name,\n settings: settings,\n button: button\n });\n this.setup();\n this.updateStrings();\n }\n\n removeCollection(id) {\n const location = this.collections.findIndex(c => c.id == id);\n if (!location < 0) return _logger__WEBPACK_IMPORTED_MODULE_1__[\"default\"].error(\"Settings\", \"No collection with id \" + id);\n this.collections.splice(location, 1);\n } // TODO: Move this to SettingsRenderer and also add a registerContentPanel\n\n\n registerPanel(id, name, options) {\n if (this.panels.find(p => p.id == id)) return _logger__WEBPACK_IMPORTED_MODULE_1__[\"default\"].error(\"Settings\", \"Already have a panel with id \" + id);\n const {\n element,\n onClick,\n order = 1\n } = options;\n const section = {\n id,\n order,\n label: name,\n section: name\n };\n if (onClick) section.clickListener = onClick;\n if (element) section.element = element instanceof _discordmodules__WEBPACK_IMPORTED_MODULE_4__[\"default\"].React.Component ? () => _discordmodules__WEBPACK_IMPORTED_MODULE_4__[\"default\"].React.createElement(element, {}) : typeof element == \"function\" ? element : () => element;\n this.panels.push(section);\n }\n\n removePanel(id) {\n const location = this.panels.findIndex(c => c.id == id);\n if (!location < 0) return _logger__WEBPACK_IMPORTED_MODULE_1__[\"default\"].error(\"Settings\", \"No collection with id \" + id);\n this.panels.splice(location, 1);\n }\n\n getPath(path, collectionId = \"\", categoryId = \"\") {\n const collection = path.length == 3 ? path[0] : collectionId;\n const category = path.length == 3 ? path[1] : path.length == 2 ? path[0] : categoryId;\n const setting = path[path.length - 1];\n return {\n collection,\n category,\n setting\n };\n }\n\n setup() {\n for (let c = 0; c < this.collections.length; c++) {\n const collection = this.collections[c];\n const categories = this.collections[c].settings;\n if (!this.state[collection.id]) this.state[collection.id] = {};\n\n for (let cc = 0; cc < categories.length; cc++) {\n const category = categories[cc];\n\n if (category.type != \"category\") {\n if (!this.state[collection.id].hasOwnProperty(category.id)) this.state[collection.id][category.id] = category.value;\n } else {\n if (!this.state[collection.id].hasOwnProperty(category.id)) this.state[collection.id][category.id] = {};\n\n for (let s = 0; s < category.settings.length; s++) {\n const setting = category.settings[s];\n if (!this.state[collection.id][category.id].hasOwnProperty(setting.id)) this.state[collection.id][category.id][setting.id] = setting.value;\n\n if (setting.enableWith) {\n const path = this.getPath(setting.enableWith.split(\".\"), collection.id, category.id);\n if (setting.hasOwnProperty(\"disabled\")) continue;\n Object.defineProperty(setting, \"disabled\", {\n get: () => {\n return !this.state[path.collection][path.category][path.setting];\n }\n });\n }\n\n if (setting.disableWith) {\n const path = this.getPath(setting.disableWith.split(\".\"), collection.id, category.id);\n if (setting.hasOwnProperty(\"disabled\")) continue;\n Object.defineProperty(setting, \"disabled\", {\n get: () => {\n return this.state[path.collection][path.category][path.setting];\n }\n });\n }\n }\n }\n }\n }\n }\n\n saveSettings() {\n _datastore__WEBPACK_IMPORTED_MODULE_2__[\"default\"].setData(\"settings\", this.state);\n }\n\n loadSettings() {\n const previousState = _datastore__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getData(\"settings\");\n if (!previousState) return this.saveSettings();\n\n for (const collection in this.state) {\n if (!previousState[collection]) Object.assign(previousState, {\n [collection]: this.state[collection]\n });\n\n for (const category in this.state[collection]) {\n if (!previousState[collection][category]) Object.assign(previousState[collection], {\n [category]: this.state[collection][category]\n });\n\n for (const setting in this.state[collection][category]) {\n if (previousState[collection][category][setting] == undefined) continue;\n this.state[collection][category][setting] = previousState[collection][category][setting];\n }\n }\n }\n\n this.saveSettings(); // in case new things were added\n }\n\n onSettingChange(collection, category, id, value) {\n // const before = this.collections.length + this.panels.length;\n this.state[collection][category][id] = value;\n _emitter__WEBPACK_IMPORTED_MODULE_3__[\"default\"].dispatch(\"setting-updated\", collection, category, id, value); // const after = this.collections.length + this.panels.length;\n\n this.saveSettings(); // if (before != after) setTimeout(this.forceUpdate.bind(this), 50);\n }\n\n getSetting(collection, category, id) {\n if (arguments.length == 2) return this.collections[0].find(c => c.id == arguments[0]).settings.find(s => s.id == arguments[1]);\n return this.collections.find(c => c.id == collection).find(c => c.id == category).settings.find(s => s.id == id);\n }\n\n get(collection, category, id) {\n if (arguments.length == 2) {\n id = category;\n category = collection;\n collection = \"settings\";\n }\n\n if (!this.state[collection] || !this.state[collection][category]) return false;\n return this.state[collection][category][id];\n }\n\n set(collection, category, id, value) {\n if (arguments.length == 3) {\n value = id;\n id = category;\n category = collection;\n collection = \"settings\";\n }\n\n return this.onSettingChange(collection, category, id, value);\n }\n\n on(collection, category, identifier, callback) {\n const handler = (col, cat, id, value) => {\n if (col !== collection || cat !== category || id !== identifier) return;\n callback(value);\n };\n\n _emitter__WEBPACK_IMPORTED_MODULE_3__[\"default\"].on(\"setting-updated\", handler);\n return () => {\n _emitter__WEBPACK_IMPORTED_MODULE_3__[\"default\"].off(\"setting-updated\", handler);\n };\n }\n\n updateStrings() {\n // Update settings collections\n for (let c = 0; c < this.collections.length; c++) {\n const collection = this.collections[c];\n const CS = _strings__WEBPACK_IMPORTED_MODULE_5__[\"default\"].Collections[collection.id];\n console.log(CS);\n if (!CS) continue;\n collection.name = CS.name || collection.name;\n const categories = this.collections[c].settings;\n\n for (let cat = 0; cat < categories.length; cat++) {\n const category = categories[cat];\n const CatStr = CS[category.id];\n if (!CatStr) continue;\n category.name = CatStr.name || category.name;\n\n for (let s = 0; s < category.settings.length; s++) {\n const setting = category.settings[s];\n const SetStr = CatStr[setting.id];\n if (!SetStr) continue;\n setting.name = SetStr.name || setting.name;\n setting.note = SetStr.note || setting.note;\n }\n }\n } // Update panel labels\n\n\n for (let p = 0; p < this.panels.length; p++) {\n const panel = this.panels[p];\n const Str = _strings__WEBPACK_IMPORTED_MODULE_5__[\"default\"].Panels[panel.id];\n panel.name = Str || panel.name;\n }\n }\n\n}());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9Db3JlLy4vc3JjL21vZHVsZXMvc2V0dGluZ3NtYW5hZ2VyLmpzP2IyZjkiXSwibmFtZXMiOlsiU2V0dGluZ3NNYW5hZ2VyIiwiY29uc3RydWN0b3IiLCJzdGF0ZSIsImNvbGxlY3Rpb25zIiwicGFuZWxzIiwicmVnaXN0ZXJDb2xsZWN0aW9uIiwiU2V0dGluZ3NDb25maWciLCJ1cGRhdGVTdHJpbmdzIiwiYmluZCIsImluaXRpYWxpemUiLCJsb2FkU2V0dGluZ3MiLCJFdmVudHMiLCJvbiIsImlkIiwibmFtZSIsInNldHRpbmdzIiwiYnV0dG9uIiwiZmluZCIsImMiLCJMb2dnZXIiLCJlcnJvciIsInB1c2giLCJ0eXBlIiwic2V0dXAiLCJyZW1vdmVDb2xsZWN0aW9uIiwibG9jYXRpb24iLCJmaW5kSW5kZXgiLCJzcGxpY2UiLCJyZWdpc3RlclBhbmVsIiwib3B0aW9ucyIsInAiLCJlbGVtZW50Iiwib25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uaWRdLmhhc093blByb3BlcnR5KHNldHRpbmcuaWQpKSB0aGlzLnN0YXRlW2NvbGxlY3Rpb24uaWRdW2NhdGVnb3J5LmlkXVtzZXR0aW5nLmlkXSA9IHNldHRpbmcudmFsdWU7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZXR0aW5nLmVuYWJsZVdpdGgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHBhdGggPSB0aGlzLmdldFBhdGgoc2V0dGluZy5lbmFibGVXaXRoLnNwbGl0KFwiLlwiKSwgY29sbGVjdGlvbi5pZCwgY2F0ZWdvcnkuaWQpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNldHRpbmcuaGFzT3duUHJvcGVydHkoXCJkaXNhYmxlZFwiKSkgY29udGludWU7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoc2V0dGluZywgXCJkaXNhYmxlZFwiLCB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0OiAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAhdGhpcy5zdGF0ZVtwYXRoLmNvbGxlY3Rpb25dW3BhdGguY2F0ZWdvcnldW3BhdGguc2V0dGluZ107XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZXR0aW5nLmRpc2FibGVXaXRoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBwYXRoID0gdGhpcy5nZXRQYXRoKHNldHRpbmcuZGlzYWJsZVdpdGguc3BsaXQoXCIuXCIpLCBjb2xsZWN0aW9uLmlkLCBjYXRlZ29yeS5pZCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2V0dGluZy5oYXNPd25Qcm9wZXJ0eShcImRpc2FibGVkXCIpKSBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShzZXR0aW5nLCBcImRpc2FibGVkXCIsIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXQ6ICgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuc3RhdGVbcGF0aC5jb2xsZWN0aW9uXVtwYXRoLmNhdGVnb3J5XVtwYXRoLnNldHRpbmddO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIHNhdmVTZXR0aW5ncygpIHtcclxuICAgICAgICBEYXRhU3RvcmUuc2V0RGF0YShcInNldHRpbmdzXCIsIHRoaXMuc3RhdGUpO1xyXG4gICAgfVxyXG5cclxuICAgIGxvYWRTZXR0aW5ncygpIHtcclxuICAgICAgICBjb25zdCBwcmV2aW91c1N0YXRlID0gRGF0YVN0b3JlLmdldERhdGEoXCJzZXR0aW5nc1wiKTtcclxuICAgICAgICBpZiAoIXByZXZpb3VzU3RhdGUpIHJldHVybiB0aGlzLnNhdmVTZXR0aW5ncygpO1xyXG4gICAgICAgIGZvciAoY29uc3QgY29sbGVjdGlvbiBpbiB0aGlzLnN0YXRlKSB7XHJcbiAgICAgICAgICAgIGlmICghcHJldmlvdXNTdGF0ZVtjb2xsZWN0aW9uXSkgT2JqZWN0LmFzc2lnbihwcmV2aW91c1N0YXRlLCB7W2NvbG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KyspIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBzZXR0aW5nID0gY2F0ZWdvcnkuc2V0dGluZ3Nbc107XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgU2V0U3RyID0gQ2F0U3RyW3NldHRpbmcuaWRdO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmICghU2V0U3RyKSBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgICAgICBzZXR0aW5nLm5hbWUgPSBTZXRTdHIubmFtZSB8fCBzZXR0aW5nLm5hbWU7XHJcbiAgICAgICAgICAgICAgICAgICAgc2V0dGluZy5ub3RlID0gU2V0U3RyLm5vdGUgfHwgc2V0dGluZy5ub3RlO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvLyBVcGRhdGUgcGFuZWwgbGFiZWxzXHJcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCB0aGlzLnBhbmVscy5sZW5ndGg7IHArKykge1xyXG4gICAgICAgICAgICBjb25zdCBwYW5lbCA9IHRoaXMucGFuZWxzW3BdO1xyXG4gICAgICAgICAgICBjb25zdCBTdHIgPSBTdHJpbmdzLlBhbmVsc1twYW5lbC5pZF07XHJcbiAgICAgICAgICAgIHBhbmVsLm5hbWUgPSBTdHIgfHwgcGFuZWwubmFtZTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn07Il0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/modules/settingsmanager.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! data */ \"./src/data/data.js\");\n/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./logger */ \"./src/modules/logger.js\");\n/* harmony import */ var _datastore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./datastore */ \"./src/modules/datastore.js\");\n/* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./emitter */ \"./src/modules/emitter.js\");\n/* harmony import */ var _discordmodules__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./discordmodules */ \"./src/modules/discordmodules.js\");\n/* harmony import */ var _strings__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./strings */ \"./src/modules/strings.js\");\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class SettingsManager {\n constructor() {\n this.state = {};\n this.collections = [];\n this.panels = [];\n this.registerCollection(\"settings\", \"Settings\", data__WEBPACK_IMPORTED_MODULE_0__[\"SettingsConfig\"]);\n this.updateStrings = this.updateStrings.bind(this);\n }\n\n initialize() {\n this.loadSettings();\n this.updateStrings();\n _emitter__WEBPACK_IMPORTED_MODULE_3__[\"default\"].on(\"strings-updated\", this.updateStrings); // this.patchSections();\n }\n\n registerCollection(id, name, settings, button = null) {\n if (this.collections.find(c => c.id == id)) return _logger__WEBPACK_IMPORTED_MODULE_1__[\"default\"].error(\"Settings\", \"Already have a collection with id \" + id);\n this.collections.push({\n type: \"collection\",\n id: id,\n name: name,\n settings: settings,\n button: button\n });\n this.setup();\n this.updateStrings();\n }\n\n removeCollection(id) {\n const location = this.collections.findIndex(c => c.id == id);\n if (!location < 0) return _logger__WEBPACK_IMPORTED_MODULE_1__[\"default\"].error(\"Settings\", \"No collection with id \" + id);\n this.collections.splice(location, 1);\n } // TODO: Move this to SettingsRenderer and also add a registerContentPanel\n\n\n registerPanel(id, name, options) {\n if (this.panels.find(p => p.id == id)) return _logger__WEBPACK_IMPORTED_MODULE_1__[\"default\"].error(\"Settings\", \"Already have a panel with id \" + id);\n const {\n element,\n onClick,\n order = 1\n } = options;\n const section = {\n id,\n order,\n label: name,\n section: id\n };\n if (onClick) section.clickListener = onClick;\n if (element) section.element = element instanceof _discordmodules__WEBPACK_IMPORTED_MODULE_4__[\"default\"].React.Component ? () => _discordmodules__WEBPACK_IMPORTED_MODULE_4__[\"default\"].React.createElement(element, {}) : typeof element == \"function\" ? element : () => element;\n this.panels.push(section);\n }\n\n removePanel(id) {\n const location = this.panels.findIndex(c => c.id == id);\n if (!location < 0) return _logger__WEBPACK_IMPORTED_MODULE_1__[\"default\"].error(\"Settings\", \"No collection with id \" + id);\n this.panels.splice(location, 1);\n }\n\n getPath(path, collectionId = \"\", categoryId = \"\") {\n const collection = path.length == 3 ? path[0] : collectionId;\n const category = path.length == 3 ? path[1] : path.length == 2 ? path[0] : categoryId;\n const setting = path[path.length - 1];\n return {\n collection,\n category,\n setting\n };\n }\n\n setup() {\n for (let c = 0; c < this.collections.length; c++) {\n const collection = this.collections[c];\n const categories = this.collections[c].settings;\n if (!this.state[collection.id]) this.state[collection.id] = {};\n\n for (let cc = 0; cc < categories.length; cc++) {\n const category = categories[cc];\n\n if (category.type != \"category\") {\n if (!this.state[collection.id].hasOwnProperty(category.id)) this.state[collection.id][category.id] = category.value;\n } else {\n if (!this.state[collection.id].hasOwnProperty(category.id)) this.state[collection.id][category.id] = {};\n\n for (let s = 0; s < category.settings.length; s++) {\n const setting = category.settings[s];\n if (!this.state[collection.id][category.id].hasOwnProperty(setting.id)) this.state[collection.id][category.id][setting.id] = setting.value;\n\n if (setting.enableWith) {\n const path = this.getPath(setting.enableWith.split(\".\"), collection.id, category.id);\n if (setting.hasOwnProperty(\"disabled\")) continue;\n Object.defineProperty(setting, \"disabled\", {\n get: () => {\n return !this.state[path.collection][path.category][path.setting];\n }\n });\n }\n\n if (setting.disableWith) {\n const path = this.getPath(setting.disableWith.split(\".\"), collection.id, category.id);\n if (setting.hasOwnProperty(\"disabled\")) continue;\n Object.defineProperty(setting, \"disabled\", {\n get: () => {\n return this.state[path.collection][path.category][path.setting];\n }\n });\n }\n }\n }\n }\n }\n }\n\n saveSettings() {\n _datastore__WEBPACK_IMPORTED_MODULE_2__[\"default\"].setData(\"settings\", this.state);\n }\n\n loadSettings() {\n const previousState = _datastore__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getData(\"settings\");\n if (!previousState) return this.saveSettings();\n\n for (const collection in this.state) {\n if (!previousState[collection]) Object.assign(previousState, {\n [collection]: this.state[collection]\n });\n\n for (const category in this.state[collection]) {\n if (!previousState[collection][category]) Object.assign(previousState[collection], {\n [category]: this.state[collection][category]\n });\n\n for (const setting in this.state[collection][category]) {\n if (previousState[collection][category][setting] == undefined) continue;\n this.state[collection][category][setting] = previousState[collection][category][setting];\n }\n }\n }\n\n this.saveSettings(); // in case new things were added\n }\n\n onSettingChange(collection, category, id, value) {\n // const before = this.collections.length + this.panels.length;\n this.state[collection][category][id] = value;\n _emitter__WEBPACK_IMPORTED_MODULE_3__[\"default\"].dispatch(\"setting-updated\", collection, category, id, value); // const after = this.collections.length + this.panels.length;\n\n this.saveSettings(); // if (before != after) setTimeout(this.forceUpdate.bind(this), 50);\n }\n\n getSetting(collection, category, id) {\n if (arguments.length == 2) return this.collections[0].find(c => c.id == arguments[0]).settings.find(s => s.id == arguments[1]);\n return this.collections.find(c => c.id == collection).find(c => c.id == category).settings.find(s => s.id == id);\n }\n\n get(collection, category, id) {\n if (arguments.length == 2) {\n id = category;\n category = collection;\n collection = \"settings\";\n }\n\n if (!this.state[collection] || !this.state[collection][category]) return false;\n return this.state[collection][category][id];\n }\n\n set(collection, category, id, value) {\n if (arguments.length == 3) {\n value = id;\n id = category;\n category = collection;\n collection = \"settings\";\n }\n\n return this.onSettingChange(collection, category, id, value);\n }\n\n on(collection, category, identifier, callback) {\n const handler = (col, cat, id, value) => {\n if (col !== collection || cat !== category || id !== identifier) return;\n callback(value);\n };\n\n _emitter__WEBPACK_IMPORTED_MODULE_3__[\"default\"].on(\"setting-updated\", handler);\n return () => {\n _emitter__WEBPACK_IMPORTED_MODULE_3__[\"default\"].off(\"setting-updated\", handler);\n };\n }\n\n updateStrings() {\n // Update settings collections\n for (let c = 0; c < this.collections.length; c++) {\n const collection = this.collections[c];\n const CS = _strings__WEBPACK_IMPORTED_MODULE_5__[\"default\"].Collections[collection.id];\n if (!CS) continue;\n collection.name = CS.name || collection.name;\n const categories = this.collections[c].settings;\n\n for (let cat = 0; cat < categories.length; cat++) {\n const category = categories[cat];\n const CatStr = CS[category.id];\n if (!CatStr) continue;\n category.name = CatStr.name || category.name;\n\n for (let s = 0; s < category.settings.length; s++) {\n const setting = category.settings[s];\n const SetStr = CatStr[setting.id];\n if (!SetStr) continue;\n setting.name = SetStr.name || setting.name;\n setting.note = SetStr.note || setting.note;\n }\n }\n } // Update panel labels\n\n\n for (let p = 0; p < this.panels.length; p++) {\n const panel = this.panels[p];\n const Str = _strings__WEBPACK_IMPORTED_MODULE_5__[\"default\"].Panels[panel.id];\n panel.label = Str || panel.label;\n }\n }\n\n}());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9Db3JlLy4vc3JjL21vZHVsZXMvc2V0dGluZ3NtYW5hZ2VyLmpzP2IyZjkiXSwibmFtZXMiOlsiU2V0dGluZ3NNYW5hZ2VyIiwiY29uc3RydWN0b3IiLCJzdGF0ZSIsImNvbGxlY3Rpb25zIiwicGFuZWxzIiwicmVnaXN0ZXJDb2xsZWN0aW9uIiwiU2V0dGluZ3NDb25maWciLCJ1cGRhdGVTdHJpbmdzIiwiYmluZCIsImluaXRpYWxpemUiLCJsb2FkU2V0dGluZ3MiLCJFdmVudHMiLCJvbiIsImlkIiwibmFtZSIsInNldHRpbmdzIiwiYnV0dG9uIiwiZmluZCIsImMiLCJMb2dnZXIiLCJlcnJvciIsInB1c2giLCJ0eXBlIiwic2V0dXAiLCJyZW1vdmVDb2xsZWN0aW9uIiwibG9jYXRpb24iLCJmaW5kSW5kZXgiLCJzcGxpY2UiLCJyZWdpc3RlclBhbmVsIiwib3B0aW9ucyIsInAiLCJlbGVtZW50Iiwib25DbGljayIsIm9yZGVyIiwic2VjdGlvbiIsImxhYmVs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3J5LmlkXVtzZXR0aW5nLmlkXSA9IHNldHRpbmcudmFsdWU7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZXR0aW5nLmVuYWJsZVdpdGgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHBhdGggPSB0aGlzLmdldFBhdGgoc2V0dGluZy5lbmFibGVXaXRoLnNwbGl0KFwiLlwiKSwgY29sbGVjdGlvbi5pZCwgY2F0ZWdvcnkuaWQpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNldHRpbmcuaGFzT3duUHJvcGVydHkoXCJkaXNhYmxlZFwiKSkgY29udGludWU7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoc2V0dGluZywgXCJkaXNhYmxlZFwiLCB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0OiAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAhdGhpcy5zdGF0ZVtwYXRoLmNvbGxlY3Rpb25dW3BhdGguY2F0ZWdvcnldW3BhdGguc2V0dGluZ107XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZXR0aW5nLmRpc2FibGVXaXRoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBwYXRoID0gdGhpcy5nZXRQYXRoKHNldHRpbmcuZGlzYWJsZVdpdGguc3BsaXQoXCIuXCIpLCBjb2xsZWN0aW9uLmlkLCBjYXRlZ29yeS5pZCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2V0dGluZy5oYXNPd25Qcm9wZXJ0eShcImRpc2FibGVkXCIpKSBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShzZXR0aW5nLCBcImRpc2FibGVkXCIsIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXQ6ICgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuc3RhdGVbcGF0aC5jb2xsZWN0aW9uXVtwYXRoLmNhdGVnb3J5XVtwYXRoLnNldHRpbmddO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIHNhdmVTZXR0aW5ncygpIHtcclxuICAgICAgICBEYXRhU3RvcmUuc2V0RGF0YShcInNldHRpbmdzXCIsIHRoaXMuc3RhdGUpO1xyXG4gICAgfVxyXG5cclxuICAgIGxvYWRTZXR0aW5ncygpIHtcclxuICAgICAgICBjb25zdCBwcmV2aW91c1N0YXRlID0gRGF0YVN0b3JlLmdldERhdGEoXCJzZXR0aW5nc1wiKTtcclxuICAgICAgICBpZiAoIXByZXZpb3VzU3RhdGUpIHJldHVybiB0aGlzLnNhdmVTZXR0aW5ncygpO1xyXG4gICAgICAgIGZvciAoY29uc3QgY29sbGVjdGlvbiBpbiB0aGlzLnN0YXRlKSB7XHJcbiAgICAgICAgICAgIGlmICghcHJldmlvdXNTdGF0ZVtjb2xsZWN0aW9uXSkgT2JqZWN0LmFzc2lnbihwcmV2aW91c1N0YXRlLCB7W2NvbGxlY3Rpb25dOiB0aGlzLnN0YXRlW2NvbGxlY3Rpb25dfSk7XHJcbiAgICAgICAgICAgIGZvciAoY29uc3QgY2F0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IFNldFN0ciA9IENhdFN0cltzZXR0aW5nLmlkXTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoIVNldFN0cikgY29udGludWU7XHJcbiAgICAgICAgICAgICAgICAgICAgc2V0dGluZy5uYW1lID0gU2V0U3RyLm5hbWUgfHwgc2V0dGluZy5uYW1lO1xyXG4gICAgICAgICAgICAgICAgICAgIHNldHRpbmcubm90ZSA9IFNldFN0ci5ub3RlIHx8IHNldHRpbmcubm90ZTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy8gVXBkYXRlIHBhbmVsIGxhYmVsc1xyXG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgdGhpcy5wYW5lbHMubGVuZ3RoOyBwKyspIHtcclxuICAgICAgICAgICAgY29uc3QgcGFuZWwgPSB0aGlzLnBhbmVsc1twXTtcclxuICAgICAgICAgICAgY29uc3QgU3RyID0gU3RyaW5ncy5QYW5lbHNbcGFuZWwuaWRdO1xyXG4gICAgICAgICAgICBwYW5lbC5sYWJlbCA9IFN0ciB8fCBwYW5lbC5sYWJlbDtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn07Il0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/modules/settingsmanager.js\n"); /***/ }), @@ -527,7 +527,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var data /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"currentLocale\", function() { return currentLocale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setLocale\", function() { return setLocale; });\n/* harmony import */ var _discordmodules__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./discordmodules */ \"./src/modules/discordmodules.js\");\n/* harmony import */ var _data_strings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../data/strings */ \"./src/data/strings.js\");\n/* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utilities */ \"./src/modules/utilities.js\");\n/* harmony import */ var _structs_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../structs/string */ \"./src/structs/string.js\");\n/* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./emitter */ \"./src/modules/emitter.js\");\n\n\n\n\n\nconst {\n Dispatcher,\n DiscordConstants,\n UserSettingsStore\n} = _discordmodules__WEBPACK_IMPORTED_MODULE_0__[\"default\"];\nconst Messages = {};\nconst discordLocale = UserSettingsStore.locale.split(\"-\")[0];\nlet currentLocale = \"en\";\nfunction setLocale(newLocale) {\n currentLocale = newLocale;\n _utilities__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(Messages, _data_strings__WEBPACK_IMPORTED_MODULE_1__[\"default\"][currentLocale]);\n _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].emit(\"strings-updated\");\n console.log(\"Changed to \" + newLocale);\n}\n_utilities__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(Messages, _data_strings__WEBPACK_IMPORTED_MODULE_1__[\"default\"][currentLocale]);\nif (_data_strings__WEBPACK_IMPORTED_MODULE_1__[\"default\"][discordLocale] && discordLocale != \"en\") setLocale(discordLocale);\nDispatcher.subscribe(DiscordConstants.ActionTypes.USER_SETTINGS_UPDATE, ({\n settings\n}) => {\n const newLocale = settings.locale;\n if (newLocale && newLocale != currentLocale) setLocale(newLocale.split(\"-\")[0]);\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (new Proxy(Messages, {\n get: function (strings, category) {\n if (!strings.hasOwnProperty(category)) {\n return new Proxy({}, {\n get: function () {\n return `String group \"${category}\" not found.`;\n }\n });\n }\n\n return new Proxy(strings[category], {\n get: function (obj, prop) {\n if (typeof obj[prop] == \"string\") return new _structs_string__WEBPACK_IMPORTED_MODULE_3__[\"default\"](obj[prop]);\n return obj[prop];\n }\n });\n }\n}));//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9Db3JlLy4vc3JjL21vZHVsZXMvc3RyaW5ncy5qcz8zNTllIl0sIm5hbWVzIjpbIkRpc3BhdGNoZXIiLCJEaXNjb3JkQ29uc3RhbnRzIiwiVXNlclNldHRpbmdzU3RvcmUiLCJEaXNjb3JkTW9kdWxlcyIsIk1lc3NhZ2VzIiwiZGlzY29yZExvY2FsZSIsImxvY2FsZSIsInNwbGl0IiwiY3VycmVudExvY2FsZSIsInNldExvY2FsZSIsIm5ld0xvY2FsZSIsIlV0aWxpdGllcyIsImV4dGVuZCIsIlJhd1N0cmluZ3MiLCJFdmVudHMiLCJlbWl0IiwiY29uc29sZSIsImxvZyIsInN1YnNjcmliZSIsIkFjdGlvblR5cGVzIiwiVVNFUl9TRVRUSU5HU19VUERBVEUiLCJzZXR0aW5ncyIsIlByb3h5IiwiZ2V0Iiwic3RyaW5ncyIsImNhdGVnb3J5IiwiaGFzT3duUHJvcGVydHkiLCJvYmoiLCJwcm9wIiwiRm9ybWF0dGFibGVTdHJpbmciXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUEsTUFBTTtBQUFDQSxZQUFEO0FBQWFDLGtCQUFiO0FBQStCQztBQUEvQixJQUFvREMsdURBQTFEO0FBQ0EsTUFBTUMsUUFBUSxHQUFHLEVBQWpCO0FBRUEsTUFBTUMsYUFBYSxHQUFHSCxpQkFBaUIsQ0FBQ0ksTUFBbEIsQ0FBeUJDLEtBQXpCLENBQStCLEdBQS9CLEVBQW9DLENBQXBDLENBQXRCO0FBRU8sSUFBSUMsYUFBYSxHQUFHLElBQXBCO0FBQ0EsU0FBU0Ms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b3J5KSkge1xyXG5cdFx0XHRyZXR1cm4gbmV3IFByb3h5KHt9LCB7XHJcblx0XHRcdFx0Z2V0OiBmdW5jdGlvbigpIHtcclxuXHRcdFx0XHRcdHJldHVybiBgU3RyaW5nIGdyb3VwIFwiJHtjYXRlZ29yeX1cIiBub3QgZm91bmQuYDtcclxuXHRcdFx0XHR9XHJcblx0XHRcdH0pO1xyXG5cdFx0fVxyXG5cdFx0cmV0dXJuIG5ldyBQcm94eShzdHJpbmdzW2NhdGVnb3J5XSwge1xyXG5cdFx0XHRnZXQ6IGZ1bmN0aW9uKG9iaiwgcHJvcCkge1xyXG5cdFx0XHRcdGlmICh0eXBlb2Yob2JqW3Byb3BdKSA9PSBcInN0cmluZ1wiKSByZXR1cm4gbmV3IEZvcm1hdHRhYmxlU3RyaW5nKG9ialtwcm9wXSk7XHJcblx0XHRcdFx0cmV0dXJuIG9ialtwcm9wXTtcclxuXHRcdFx0fVxyXG5cdFx0fSk7XHJcblx0fVxyXG59KTtcclxuXHJcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/modules/strings.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"currentLocale\", function() { return currentLocale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setLocale\", function() { return setLocale; });\n/* harmony import */ var _discordmodules__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./discordmodules */ \"./src/modules/discordmodules.js\");\n/* harmony import */ var _data_strings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../data/strings */ \"./src/data/strings.js\");\n/* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utilities */ \"./src/modules/utilities.js\");\n/* harmony import */ var _structs_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../structs/string */ \"./src/structs/string.js\");\n/* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./emitter */ \"./src/modules/emitter.js\");\n\n\n\n\n\nconst {\n Dispatcher,\n DiscordConstants,\n UserSettingsStore\n} = _discordmodules__WEBPACK_IMPORTED_MODULE_0__[\"default\"];\nconst Messages = {};\nconst discordLocale = UserSettingsStore.locale.split(\"-\")[0];\nlet currentLocale = \"en\";\nfunction setLocale(newLocale) {\n currentLocale = newLocale;\n _utilities__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(Messages, _data_strings__WEBPACK_IMPORTED_MODULE_1__[\"default\"][currentLocale]);\n _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].emit(\"strings-updated\");\n}\n_utilities__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(Messages, _data_strings__WEBPACK_IMPORTED_MODULE_1__[\"default\"][currentLocale]);\nif (_data_strings__WEBPACK_IMPORTED_MODULE_1__[\"default\"][discordLocale] && discordLocale != \"en\") setLocale(discordLocale);\nDispatcher.subscribe(DiscordConstants.ActionTypes.USER_SETTINGS_UPDATE, ({\n settings\n}) => {\n const newLocale = settings.locale;\n if (newLocale && newLocale != currentLocale) setLocale(newLocale.split(\"-\")[0]);\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (new Proxy(Messages, {\n get: function (strings, category) {\n if (!strings.hasOwnProperty(category)) {\n return new Proxy({}, {\n get: function () {\n return `String group \"${category}\" not found.`;\n }\n });\n }\n\n return new Proxy(strings[category], {\n get: function (obj, prop) {\n if (typeof obj[prop] == \"string\") return new _structs_string__WEBPACK_IMPORTED_MODULE_3__[\"default\"](obj[prop]);\n return obj[prop];\n }\n });\n }\n}));//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9Db3JlLy4vc3JjL21vZHVsZXMvc3RyaW5ncy5qcz8zNTllIl0sIm5hbWVzIjpbIkRpc3BhdGNoZXIiLCJEaXNjb3JkQ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cdFx0XHRcdGlmICh0eXBlb2Yob2JqW3Byb3BdKSA9PSBcInN0cmluZ1wiKSByZXR1cm4gbmV3IEZvcm1hdHRhYmxlU3RyaW5nKG9ialtwcm9wXSk7XHJcblx0XHRcdFx0cmV0dXJuIG9ialtwcm9wXTtcclxuXHRcdFx0fVxyXG5cdFx0fSk7XHJcblx0fVxyXG59KTtcclxuXHJcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/modules/strings.js\n"); /***/ }), @@ -659,7 +659,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 export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return CssEditor; });\n/* harmony import */ var modules__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! modules */ \"./src/modules/modules.js\");\n/* harmony import */ var _editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./editor */ \"./src/ui/customcss/editor.jsx\");\n/* harmony import */ var _icons_reload__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../icons/reload */ \"./src/ui/icons/reload.jsx\");\n/* harmony import */ var _icons_save__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../icons/save */ \"./src/ui/icons/save.jsx\");\n/* harmony import */ var _icons_edit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../icons/edit */ \"./src/ui/icons/edit.jsx\");\n/* harmony import */ var _icons_cog__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../icons/cog */ \"./src/ui/icons/cog.jsx\");\n/* harmony import */ var _icons_detach__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../icons/detach */ \"./src/ui/icons/detach.jsx\");\n\n // import Checkbox from \"./checkbox\";\n\n\n\n\n\n\nclass CssEditor extends modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].Component {\n constructor(props) {\n super(props);\n this.hasUnsavedChanges = false;\n this.onChange = this.onChange.bind(this);\n this.toggleLiveUpdate = this.toggleLiveUpdate.bind(this);\n this.updateCss = this.updateCss.bind(this);\n this.saveCss = this.saveCss.bind(this);\n this.openDetached = this.props.openDetached ? this.openDetached.bind(this) : null;\n this.openNative = this.openNative.bind(this);\n this.updateEditor = this.updateEditor.bind(this);\n this.controls = [{\n label: modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(_icons_reload__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n size: \"18px\"\n }),\n tooltip: modules__WEBPACK_IMPORTED_MODULE_0__[\"Strings\"].CustomCSS.update,\n onClick: this.updateCss\n }, {\n label: modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(_icons_save__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n size: \"18px\"\n }),\n tooltip: modules__WEBPACK_IMPORTED_MODULE_0__[\"Strings\"].CustomCSS.save,\n onClick: this.saveCss\n }, {\n label: modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(_icons_edit__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n size: \"18px\"\n }),\n tooltip: modules__WEBPACK_IMPORTED_MODULE_0__[\"Strings\"].CustomCSS.openNative,\n onClick: this.openNative\n }, {\n label: modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(_icons_cog__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n size: \"18px\"\n }),\n tooltip: modules__WEBPACK_IMPORTED_MODULE_0__[\"Strings\"].CustomCSS.settings,\n onClick: \"showSettings\"\n }, {\n label: modules__WEBPACK_IMPORTED_MODULE_0__[\"Strings\"].Collections.settings.developer.liveUpdate.name,\n type: \"checkbox\",\n onChange: this.toggleLiveUpdate,\n checked: modules__WEBPACK_IMPORTED_MODULE_0__[\"Settings\"].get(\"settings\", \"customcss\", \"liveUpdate\"),\n side: \"right\"\n }];\n if (this.openDetached) this.controls.push({\n label: modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(_icons_detach__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n size: \"18px\"\n }),\n tooltip: modules__WEBPACK_IMPORTED_MODULE_0__[\"Strings\"].CustomCSS.openDetached,\n onClick: this.openDetached,\n side: \"right\"\n });\n }\n\n componentDidMount() {\n modules__WEBPACK_IMPORTED_MODULE_0__[\"Events\"].on(\"customcss-updated\", this.updateEditor);\n }\n\n componentWillUnmount() {\n modules__WEBPACK_IMPORTED_MODULE_0__[\"Events\"].off(\"customcss-updated\", this.updateEditor);\n }\n\n updateEditor(newCSS) {\n if (!this.editor) return;\n this.editor.value = newCSS;\n }\n\n get value() {\n return this.editor.session.getValue();\n }\n\n set value(newValue) {\n this.editor.setValue(newValue);\n }\n\n showSettings() {\n return this.editor.keyBinding.$defaultHandler.commands.showSettingsMenu.exec(this.editor);\n }\n\n resize() {\n return this.editor.resize();\n }\n\n setEditorRef(editor) {\n this.editor = editor;\n if (this.props.editorRef && typeof this.props.editorRef.current !== \"undefined\") this.props.editorRef.current = editor;else if (this.props.editorRef) this.props.editorRef = editor;\n }\n\n onChange() {\n this.hasUnsavedChanges = true;\n if (this.props.onChange) this.props.onChange(...arguments);\n }\n\n render() {\n return modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(_editor__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n ref: this.setEditorRef.bind(this),\n readOnly: this.props.readOnly,\n id: this.props.id || \"bd-customcss-editor\",\n onChange: this.onChange,\n controls: this.controls,\n value: this.props.css\n });\n }\n\n toggleLiveUpdate(checked) {\n modules__WEBPACK_IMPORTED_MODULE_0__[\"Settings\"].set(\"settings\", \"customcss\", \"liveUpdate\", checked);\n }\n\n updateCss(event, newCss) {\n if (this.props.update) this.props.update(newCss);\n }\n\n saveCss(event, newCss) {\n this.hasUnsavedChanges = false;\n if (this.props.save) this.props.save(newCss);\n }\n\n openDetached(event, currentCSS) {\n if (!this.props.openDetached) return;\n this.props.openDetached(currentCSS);\n }\n\n openNative() {\n if (this.props.openNative) this.props.openNative();\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9Db3JlLy4vc3JjL3VpL2N1c3RvbWNzcy9jc3NlZGl0b3IuanN4PzQyMzAiXSwibmFtZXMiOlsiQ3NzRWRpdG9yIiwiUmVhY3QiLCJDb21wb25lbnQiLCJjb25zdHJ1Y3RvciIsInByb3BzIiwiaGFzVW5zYXZlZENoYW5nZXMiLCJvbkNoYW5nZSIsImJpbmQiLCJ0b2dnbGVMaXZlVXBkYXRlIiwidXBkYXRlQ3NzIiwic2F2ZUNzcyIsIm9wZW5EZXRhY2hlZCIsIm9wZW5OYXRpdmUiLCJ1cGRhdGVFZGl0b3IiLCJjb250cm9scyIsImxhYmVsIiwiY3JlYXRlRWxlbWVudCIsIlJlZnJlc2giLCJzaXplIiwidG9vbHRpcCIsIlN0cmluZ3MiLCJDdXN0b21DU1MiLCJ1cGRhdGUiLCJvbkNsaWNrIiwiU2F2ZSIsInNhdmUiLCJFZGl0IiwiQ29nIiwic2V0dGluZ3MiLCJDb2xsZWN0aW9ucyIsImRldmVsb3BlciIsImxpdmVVcGRhdGUiLCJuYW1lIiwidHlwZSIsImNoZWNrZWQiLCJTZXR0aW5ncyIsImdldCIsInNpZGUiLCJwdXNoIiwiRGV0YWNoIiwiY29tcG9uZW50RGlkTW91bnQiLCJFdmVudHMiLCJvbiIsImNvbXBvbmVudFdpbGxVbm1vdW50Iiwib2ZmIiwibmV3Q1NTIiwiZWRpdG9yIiwidmFsdWUiLCJzZXNzaW9uIiwiZ2V0VmFsdWUiLCJuZXdWYWx1ZSIsInNldFZhbHVlIiwic2hvd1NldHRpbmdzIiwia2V5QmluZGluZyIsIiRkZWZhdWx0SGFuZGxlciIsImNvbW1hbmRzIiwic2hvd1NldHRpbmdzTWVudSIsImV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ZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/ui/customcss/csseditor.jsx\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return CssEditor; });\n/* harmony import */ var modules__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! modules */ \"./src/modules/modules.js\");\n/* harmony import */ var _editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./editor */ \"./src/ui/customcss/editor.jsx\");\n/* harmony import */ var _icons_reload__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../icons/reload */ \"./src/ui/icons/reload.jsx\");\n/* harmony import */ var _icons_save__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../icons/save */ \"./src/ui/icons/save.jsx\");\n/* harmony import */ var _icons_edit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../icons/edit */ \"./src/ui/icons/edit.jsx\");\n/* harmony import */ var _icons_cog__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../icons/cog */ \"./src/ui/icons/cog.jsx\");\n/* harmony import */ var _icons_detach__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../icons/detach */ \"./src/ui/icons/detach.jsx\");\n\n // import Checkbox from \"./checkbox\";\n\n\n\n\n\n\nclass CssEditor extends modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].Component {\n constructor(props) {\n super(props);\n this.hasUnsavedChanges = false;\n this.onChange = this.onChange.bind(this);\n this.toggleLiveUpdate = this.toggleLiveUpdate.bind(this);\n this.updateCss = this.updateCss.bind(this);\n this.saveCss = this.saveCss.bind(this);\n this.openDetached = this.props.openDetached ? this.openDetached.bind(this) : null;\n this.openNative = this.openNative.bind(this);\n this.updateEditor = this.updateEditor.bind(this);\n this.controls = [{\n label: modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(_icons_reload__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n size: \"18px\"\n }),\n tooltip: modules__WEBPACK_IMPORTED_MODULE_0__[\"Strings\"].CustomCSS.update,\n onClick: this.updateCss\n }, {\n label: modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(_icons_save__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n size: \"18px\"\n }),\n tooltip: modules__WEBPACK_IMPORTED_MODULE_0__[\"Strings\"].CustomCSS.save,\n onClick: this.saveCss\n }, {\n label: modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(_icons_edit__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n size: \"18px\"\n }),\n tooltip: modules__WEBPACK_IMPORTED_MODULE_0__[\"Strings\"].CustomCSS.openNative,\n onClick: this.openNative\n }, {\n label: modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(_icons_cog__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n size: \"18px\"\n }),\n tooltip: modules__WEBPACK_IMPORTED_MODULE_0__[\"Strings\"].CustomCSS.settings,\n onClick: \"showSettings\"\n }, {\n label: modules__WEBPACK_IMPORTED_MODULE_0__[\"Strings\"].Collections.settings.customcss.liveUpdate.name,\n type: \"checkbox\",\n onChange: this.toggleLiveUpdate,\n checked: modules__WEBPACK_IMPORTED_MODULE_0__[\"Settings\"].get(\"settings\", \"customcss\", \"liveUpdate\"),\n side: \"right\"\n }];\n if (this.openDetached) this.controls.push({\n label: modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(_icons_detach__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n size: \"18px\"\n }),\n tooltip: modules__WEBPACK_IMPORTED_MODULE_0__[\"Strings\"].CustomCSS.openDetached,\n onClick: this.openDetached,\n side: \"right\"\n });\n }\n\n componentDidMount() {\n modules__WEBPACK_IMPORTED_MODULE_0__[\"Events\"].on(\"customcss-updated\", this.updateEditor);\n }\n\n componentWillUnmount() {\n modules__WEBPACK_IMPORTED_MODULE_0__[\"Events\"].off(\"customcss-updated\", this.updateEditor);\n }\n\n updateEditor(newCSS) {\n if (!this.editor) return;\n this.editor.value = newCSS;\n }\n\n get value() {\n return this.editor.session.getValue();\n }\n\n set value(newValue) {\n this.editor.setValue(newValue);\n }\n\n showSettings() {\n return this.editor.keyBinding.$defaultHandler.commands.showSettingsMenu.exec(this.editor);\n }\n\n resize() {\n return this.editor.resize();\n }\n\n setEditorRef(editor) {\n this.editor = editor;\n if (this.props.editorRef && typeof this.props.editorRef.current !== \"undefined\") this.props.editorRef.current = editor;else if (this.props.editorRef) this.props.editorRef = editor;\n }\n\n onChange() {\n this.hasUnsavedChanges = true;\n if (this.props.onChange) this.props.onChange(...arguments);\n }\n\n render() {\n return modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(_editor__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n ref: this.setEditorRef.bind(this),\n readOnly: this.props.readOnly,\n id: this.props.id || \"bd-customcss-editor\",\n onChange: this.onChange,\n controls: this.controls,\n value: this.props.css\n });\n }\n\n toggleLiveUpdate(checked) {\n modules__WEBPACK_IMPORTED_MODULE_0__[\"Settings\"].set(\"settings\", \"customcss\", \"liveUpdate\", checked);\n }\n\n updateCss(event, newCss) {\n if (this.props.update) this.props.update(newCss);\n }\n\n saveCss(event, newCss) {\n this.hasUnsavedChanges = false;\n if (this.props.save) this.props.save(newCss);\n }\n\n openDetached(event, currentCSS) {\n if (!this.props.openDetached) return;\n this.props.openDetached(currentCSS);\n }\n\n openNative() {\n if (this.props.openNative) this.props.openNative();\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9Db3JlLy4vc3JjL3VpL2N1c3RvbWNzcy9jc3NlZGl0b3IuanN4PzQyMzAiXSwibmFtZXMiOlsiQ3NzRWRpdG9yIiwiUmVhY3QiLCJDb21wb25lbnQiLCJjb25zdHJ1Y3RvciIsInByb3BzIi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BTZXR0aW5ncy5zZXQoXCJzZXR0aW5nc1wiLCBcImN1c3RvbWNzc1wiLCBcImxpdmVVcGRhdGVcIiwgY2hlY2tlZCk7XHJcbiAgICB9XHJcblxyXG4gICAgdXBkYXRlQ3NzKGV2ZW50LCBuZXdDc3MpIHtcclxuICAgICAgICBpZiAodGhpcy5wcm9wcy51cGRhdGUpIHRoaXMucHJvcHMudXBkYXRlKG5ld0Nzcyk7XHJcbiAgICB9XHJcblxyXG4gICAgc2F2ZUNzcyhldmVudCwgbmV3Q3NzKSB7XHJcbiAgICAgICAgdGhpcy5oYXNVbnNhdmVkQ2hhbmdlcyA9IGZhbHNlO1xyXG4gICAgICAgIGlmICh0aGlzLnByb3BzLnNhdmUpIHRoaXMucHJvcHMuc2F2ZShuZXdDc3MpO1xyXG4gICAgfVxyXG5cclxuICAgIG9wZW5EZXRhY2hlZChldmVudCwgY3VycmVudENTUykge1xyXG4gICAgICAgIGlmICghdGhpcy5wcm9wcy5vcGVuRGV0YWNoZWQpIHJldHVybjtcclxuICAgICAgICB0aGlzLnByb3BzLm9wZW5EZXRhY2hlZChjdXJyZW50Q1NTKTtcclxuICAgIH1cclxuXHJcbiAgICBvcGVuTmF0aXZlKCkge1xyXG4gICAgICAgIGlmICh0aGlzLnByb3BzLm9wZW5OYXRpdmUpIHRoaXMucHJvcHMub3Blbk5hdGl2ZSgpO1xyXG4gICAgfVxyXG59Il0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/ui/customcss/csseditor.jsx\n"); /***/ }), @@ -839,7 +839,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 data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! data */ \"./src/data/data.js\");\n/* harmony import */ var modules__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! modules */ \"./src/modules/modules.js\");\n/* harmony import */ var _settings_contentlist__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./settings/contentlist */ \"./src/ui/settings/contentlist.jsx\");\n/* harmony import */ var _settings_group__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./settings/group */ \"./src/ui/settings/group.jsx\");\n/* harmony import */ var _settings_title__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./settings/title */ \"./src/ui/settings/title.jsx\");\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class SettingsRenderer {\n constructor() {\n this.patchSections();\n }\n\n buildSettingsPanel(title, config, state, onChange, button = null) {\n config.forEach(section => {\n section.settings.forEach(item => item.value = state[section.id][item.id]);\n });\n return this.getSettingsPanel(title, config, onChange, button);\n }\n\n getSettingsPanel(title, groups, onChange, button = null) {\n return [modules__WEBPACK_IMPORTED_MODULE_1__[\"React\"].createElement(_settings_title__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n text: title,\n button: button\n }), groups.map(section => {\n return modules__WEBPACK_IMPORTED_MODULE_1__[\"React\"].createElement(_settings_group__WEBPACK_IMPORTED_MODULE_3__[\"default\"], Object.assign({}, section, {\n onChange\n }));\n })];\n }\n\n getContentPanel(title, contentList, contentState, options = {}) {\n return modules__WEBPACK_IMPORTED_MODULE_1__[\"React\"].createElement(_settings_contentlist__WEBPACK_IMPORTED_MODULE_2__[\"default\"], Object.assign({}, {\n title: title,\n contentList: contentList,\n contentState: contentState\n }, options));\n }\n\n get attribution() {\n return modules__WEBPACK_IMPORTED_MODULE_1__[\"React\"].createElement(\"div\", {\n className: \"bd-version\",\n style: {\n fontSize: \"12px\",\n fontWeight: \"600\",\n color: \"#72767d\",\n padding: \"2px 10px\"\n }\n }, `BBD v${data__WEBPACK_IMPORTED_MODULE_0__[\"Config\"].bbdVersion} by `, modules__WEBPACK_IMPORTED_MODULE_1__[\"React\"].createElement(\"a\", {\n href: \"https://github.com/rauenzi/\",\n target: \"_blank\"\n }, \"Zerebos\"));\n }\n\n async patchSections() {\n modules__WEBPACK_IMPORTED_MODULE_1__[\"Patcher\"].after(\"SettingsManager\", modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByDisplayName(\"FluxContainer(GuildSettings)\").prototype, \"render\", thisObject => {\n thisObject._reactInternalFiber.return.return.return.return.return.return.memoizedProps.id = \"guild-settings\";\n });\n console.log(\"getting user settings\");\n const UserSettings = await modules__WEBPACK_IMPORTED_MODULE_1__[\"ReactComponents\"].get(\"UserSettings\", m => m.prototype && m.prototype.generateSections);\n console.log(\"got 'em\");\n modules__WEBPACK_IMPORTED_MODULE_1__[\"Patcher\"].after(\"SettingsManager\", UserSettings.prototype, \"render\", thisObject => {\n thisObject._reactInternalFiber.return.return.return.return.return.return.return.memoizedProps.id = \"user-settings\";\n });\n modules__WEBPACK_IMPORTED_MODULE_1__[\"Patcher\"].after(\"SettingsManager\", UserSettings.prototype, \"generateSections\", (thisObject, args, returnValue) => {\n let location = returnValue.findIndex(s => s.section.toLowerCase() == \"linux\") + 1;\n\n const insert = section => {\n returnValue.splice(location, 0, section);\n location++;\n };\n\n insert({\n section: \"DIVIDER\"\n });\n insert({\n section: \"HEADER\",\n label: \"BandagedBD\"\n });\n\n for (const collection of modules__WEBPACK_IMPORTED_MODULE_1__[\"Settings\"].collections) {\n if (collection.disabled) continue;\n insert({\n section: collection.name,\n label: collection.name,\n element: () => this.buildSettingsPanel(collection.name, collection.settings, modules__WEBPACK_IMPORTED_MODULE_1__[\"Settings\"].state[collection.id], modules__WEBPACK_IMPORTED_MODULE_1__[\"Settings\"].onSettingChange.bind(modules__WEBPACK_IMPORTED_MODULE_1__[\"Settings\"], collection.id), collection.button ? collection.button : null)\n });\n }\n\n for (const panel of modules__WEBPACK_IMPORTED_MODULE_1__[\"Settings\"].panels.sort((a, b) => a.order > b.order)) {\n if (panel.clickListener) panel.onClick = event => panel.clickListener(thisObject, event, returnValue);\n insert(panel);\n }\n\n insert({\n section: \"CUSTOM\",\n element: () => this.attribution\n });\n });\n this.forceUpdate();\n }\n\n forceUpdate() {\n const viewClass = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"standardSidebarView\").standardSidebarView.split(\" \")[0];\n const node = document.querySelector(`.${viewClass}`);\n modules__WEBPACK_IMPORTED_MODULE_1__[\"Utilities\"].getReactInstance(node).return.return.return.return.return.return.stateNode.forceUpdate();\n }\n\n}());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9Db3JlLy4vc3JjL3VpL3NldHRpbmdzLmpzPzc2YmUiXSwibmFtZXMiOlsiU2V0dGluZ3NSZW5kZXJlciIsImNvbnN0cnVjdG9yIiwicGF0Y2hTZWN0aW9ucyIsImJ1aWxkU2V0dGluZ3NQYW5lbCIsInRpdGxlIiwiY29uZmlnIiwic3RhdGUiLCJvbkNoYW5nZSIsImJ1dHRvbiIsImZvckVhY2giLCJzZWN0aW9uIiwic2V0dGluZ3MiLCJpdGVtIiwidmFsdWUiLCJpZCIsImdldFNldHRpbmdzUGFuZWwiLCJncm91cHMiLCJSZWFjdCIsImNyZWF0ZUVsZW1lbnQiLCJTZXR0aW5nc1RpdGxlIiwidGV4dCIsIm1hcCIsIlNldHRpbmdzR3JvdXAiLCJPYmplY3QiLCJhc3NpZ24iLCJnZXRDb250ZW50UGFuZWwiLCJjb250ZW50TGlzdCIsImNvbnRlbnRTdGF0ZSIsIm9wdGlvbnMiLCJDb250ZW50TGlzdCIsImF0dHJpYnV0aW9uIiwiY2xhc3NOYW1lIiwic3R5bGUiLCJmb250U2l6ZSIsImZvbnRXZWlnaHQiLCJjb2xvciIsInBhZGRpbmciLCJDb25maWciLCJiYmRWZXJzaW9uIiwiaHJlZiIsInRhcmdldCIsIlBhdGNoZXIiLCJhZnRlciIsIldlYnBhY2tNb2R1bGVzIiwiZ2V0QnlEaXNwbGF5Tm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IHJldHVybiBSZWFjdC5jcmVhdGVFbGVtZW50KFNldHRpbmdzR3JvdXAsIE9iamVjdC5hc3NpZ24oe30sIHNlY3Rpb24sIHtvbkNoYW5nZX0pKTtcclxuICAgICAgICB9KV07XHJcbiAgICB9XHJcblxyXG4gICAgZ2V0Q29udGVudFBhbmVsKHRpdGxlLCBjb250ZW50TGlzdCwgY29udGVudFN0YXRlLCBvcHRpb25zID0ge30pIHtcclxuICAgICAgICByZXR1cm4gUmVhY3QuY3JlYXRlRWxlbWVudChDb250ZW50TGlzdCwgT2JqZWN0LmFzc2lnbih7fSwge1xyXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXHJcbiAgICAgICAgICAgIGNvbnRlbnRMaXN0OiBjb250ZW50TGlzdCxcclxuICAgICAgICAgICAgY29udGVudFN0YXRlOiBjb250ZW50U3RhdGVcclxuICAgICAgICB9LCBvcHRpb25zKSk7XHJcbiAgICB9XHJcblxyXG4gICAgZ2V0IGF0dHJpYnV0aW9uKCkge1xyXG4gICAgICAgIHJldHVybiBSZWFjdC5jcmVhdGVFbGVtZW50KFwiZGl2XCIsIHtjbGFzc05hbWU6IFwiYmQtdmVyc2lvblwiLCBzdHlsZToge2ZvbnRTaXplOiBcIjEycHhcIiwgZm9udFdlaWdodDogXCI2MDBcIiwgY29sb3I6IFwiIzcyNzY3ZFwiLCBwYWRkaW5nOiBcIjJweCAxMHB4XCJ9fSxcclxuICAgICAgICAgICAgYEJCRCB2JHtDb25maWcuYmJkVmVyc2lvbn0gYnkgYCxcclxuICAgICAgICAgICAgUmVhY3QuY3JlYXRlRWxlbWVudChcImFcIiwge2hyZWY6IFwiaHR0cHM6Ly9naXRodWIuY29tL3JhdWVuemkvXCIsIHRhcmdldDogXCJfYmxhbmtcIn0sIFwiWmVyZWJvc1wiKVxyXG4gICAgICAgICk7XHJcbiAgICB9XHJcblxyXG4gICAgYXN5bmMgcGF0Y2hTZWN0aW9ucygpIHtcclxuICAgICAgICBQYXRjaGVyLmFmdG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ourceURL=webpack-internal:///./src/ui/settings.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! data */ \"./src/data/data.js\");\n/* harmony import */ var modules__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! modules */ \"./src/modules/modules.js\");\n/* harmony import */ var _settings_contentlist__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./settings/contentlist */ \"./src/ui/settings/contentlist.jsx\");\n/* harmony import */ var _settings_group__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./settings/group */ \"./src/ui/settings/group.jsx\");\n/* harmony import */ var _settings_title__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./settings/title */ \"./src/ui/settings/title.jsx\");\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class SettingsRenderer {\n constructor() {\n this.patchSections();\n }\n\n onChange(onChange) {\n return (collection, category, id) => {\n const before = modules__WEBPACK_IMPORTED_MODULE_1__[\"Settings\"].collections.length + modules__WEBPACK_IMPORTED_MODULE_1__[\"Settings\"].panels.length;\n onChange(collection, category, id);\n const after = modules__WEBPACK_IMPORTED_MODULE_1__[\"Settings\"].collections.length + modules__WEBPACK_IMPORTED_MODULE_1__[\"Settings\"].panels.length;\n if (before != after) setTimeout(this.forceUpdate.bind(this), 50);\n };\n }\n\n buildSettingsPanel(title, config, state, onChange, button = null) {\n config.forEach(section => {\n section.settings.forEach(item => item.value = state[section.id][item.id]);\n });\n return this.getSettingsPanel(title, config, this.onChange(onChange), button);\n }\n\n getSettingsPanel(title, groups, onChange, button = null) {\n return [modules__WEBPACK_IMPORTED_MODULE_1__[\"React\"].createElement(_settings_title__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n text: title,\n button: button\n }), groups.map(section => {\n return modules__WEBPACK_IMPORTED_MODULE_1__[\"React\"].createElement(_settings_group__WEBPACK_IMPORTED_MODULE_3__[\"default\"], Object.assign({}, section, {\n onChange\n }));\n })];\n }\n\n getContentPanel(title, contentList, contentState, options = {}) {\n return modules__WEBPACK_IMPORTED_MODULE_1__[\"React\"].createElement(_settings_contentlist__WEBPACK_IMPORTED_MODULE_2__[\"default\"], Object.assign({}, {\n title: title,\n contentList: contentList,\n contentState: contentState\n }, options));\n }\n\n get attribution() {\n return modules__WEBPACK_IMPORTED_MODULE_1__[\"React\"].createElement(\"div\", {\n className: \"bd-version\",\n style: {\n fontSize: \"12px\",\n fontWeight: \"600\",\n color: \"#72767d\",\n padding: \"2px 10px\"\n }\n }, `BBD v${data__WEBPACK_IMPORTED_MODULE_0__[\"Config\"].bbdVersion} by `, modules__WEBPACK_IMPORTED_MODULE_1__[\"React\"].createElement(\"a\", {\n href: \"https://github.com/rauenzi/\",\n target: \"_blank\"\n }, \"Zerebos\"));\n }\n\n async patchSections() {\n modules__WEBPACK_IMPORTED_MODULE_1__[\"Patcher\"].after(\"SettingsManager\", modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByDisplayName(\"FluxContainer(GuildSettings)\").prototype, \"render\", thisObject => {\n thisObject._reactInternalFiber.return.return.return.return.return.return.memoizedProps.id = \"guild-settings\";\n });\n const UserSettings = await modules__WEBPACK_IMPORTED_MODULE_1__[\"ReactComponents\"].get(\"UserSettings\", m => m.prototype && m.prototype.generateSections);\n modules__WEBPACK_IMPORTED_MODULE_1__[\"Patcher\"].after(\"SettingsManager\", UserSettings.prototype, \"render\", thisObject => {\n thisObject._reactInternalFiber.return.return.return.return.return.return.return.memoizedProps.id = \"user-settings\";\n });\n modules__WEBPACK_IMPORTED_MODULE_1__[\"Patcher\"].after(\"SettingsManager\", UserSettings.prototype, \"generateSections\", (thisObject, args, returnValue) => {\n let location = returnValue.findIndex(s => s.section.toLowerCase() == \"linux\") + 1;\n\n const insert = section => {\n returnValue.splice(location, 0, section);\n location++;\n };\n\n insert({\n section: \"DIVIDER\"\n });\n insert({\n section: \"HEADER\",\n label: \"BandagedBD\"\n });\n\n for (const collection of modules__WEBPACK_IMPORTED_MODULE_1__[\"Settings\"].collections) {\n if (collection.disabled) continue;\n insert({\n section: collection.name,\n label: collection.name,\n element: () => this.buildSettingsPanel(collection.name, collection.settings, modules__WEBPACK_IMPORTED_MODULE_1__[\"Settings\"].state[collection.id], modules__WEBPACK_IMPORTED_MODULE_1__[\"Settings\"].onSettingChange.bind(modules__WEBPACK_IMPORTED_MODULE_1__[\"Settings\"], collection.id), collection.button ? collection.button : null)\n });\n }\n\n for (const panel of modules__WEBPACK_IMPORTED_MODULE_1__[\"Settings\"].panels.sort((a, b) => a.order > b.order)) {\n if (panel.clickListener) panel.onClick = event => panel.clickListener(thisObject, event, returnValue);\n insert(panel);\n }\n\n insert({\n section: \"CUSTOM\",\n element: () => this.attribution\n });\n });\n this.forceUpdate();\n }\n\n forceUpdate() {\n const viewClass = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"standardSidebarView\").standardSidebarView.split(\" \")[0];\n const node = document.querySelector(`.${viewClass}`);\n modules__WEBPACK_IMPORTED_MODULE_1__[\"Utilities\"].getReactInstance(node).return.return.return.return.return.return.stateNode.forceUpdate();\n }\n\n}());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9Db3JlLy4vc3JjL3VpL3NldHRpbmdzLmpzPzc2YmUiXSwibmFtZXMiOlsiU2V0dGluZ3NSZW5kZXJlciIsImNvbnN0cnVjdG9yIiwicGF0Y2hTZWN0aW9ucyIsIm9uQ2hhbmdlIiwiY29sbGVjdGlvbiIsImNhdGVnb3J5IiwiaWQiLCJiZWZvcmUiLCJTZXR0aW5ncyIsImNvbGxlY3Rpb25zIiwibGVuZ3RoIiwicGFuZWxzIiwiYWZ0ZXIiLCJzZXRUaW1lb3V0IiwiZm9yY2VVcGRhdGUiLCJiaW5kIiwiYnVpbGRTZXR0aW5nc1Bhb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cInJlbmRlclwiLCAodGhpc09iamVjdCkgPT4ge1xyXG4gICAgICAgICAgICB0aGlzT2JqZWN0Ll9yZWFjdEludGVybmFsRmliZXIucmV0dXJuLnJldHVybi5yZXR1cm4ucmV0dXJuLnJldHVybi5yZXR1cm4ucmV0dXJuLm1lbW9pemVkUHJvcHMuaWQgPSBcInVzZXItc2V0dGluZ3NcIjtcclxuICAgICAgICB9KTtcclxuICAgICAgICBQYXRjaGVyLmFmdGVyKFwiU2V0dGluZ3NNYW5hZ2VyXCIsIFVzZXJTZXR0aW5ncy5wcm90b3R5cGUsIFwiZ2VuZXJhdGVTZWN0aW9uc1wiLCAodGhpc09iamVjdCwgYXJncywgcmV0dXJuVmFsdWUpID0+IHtcclxuICAgICAgICAgICAgbGV0IGxvY2F0aW9uID0gcmV0dXJuVmFsdWUuZmluZEluZGV4KHMgPT4gcy5zZWN0aW9uLnRvTG93ZXJDYXNlKCkgPT0gXCJsaW51eFwiKSArIDE7XHJcbiAgICAgICAgICAgIGNvbnN0IGluc2VydCA9IChzZWN0aW9uKSA9PiB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm5WYWx1ZS5zcGxpY2UobG9jYXRpb24sIDAsIHNlY3Rpb24pO1xyXG4gICAgICAgICAgICAgICAgbG9jYXRpb24rKztcclxuICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgaW5zZXJ0KHtzZWN0aW9uOiBcIkRJVklERVJcIn0pO1xyXG4gICAgICAgICAgICBpbnNlcnQoe3NlY3Rpb246IFwiSEVBREVSXCIsIGxhYmVsOiBcIkJhbmRhZ2VkQkRcIn0pO1xyXG4gICAgICAgICAgICBmb3IgKGNvbnN0IGNvbGxlY3Rpb24gb2YgU2V0dGluZ3MuY29sbGVjdGlvbnMpIHtcclxuICAgICAgICAgICAgICAgIGlmIChjb2xsZWN0aW9uLmRpc2FibGVkKSBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgIGluc2VydCh7XHJcbiAgICAgICAgICAgICAgICAgICAgc2V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kZWJhclZpZXdcIikuc3RhbmRhcmRTaWRlYmFyVmlldy5zcGxpdChcIiBcIilbMF07XHJcbiAgICAgICAgY29uc3Qgbm9kZSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoYC4ke3ZpZXdDbGFzc31gKTtcclxuICAgICAgICBVdGlsaXRpZXMuZ2V0UmVhY3RJbnN0YW5jZShub2RlKS5yZXR1cm4ucmV0dXJuLnJldHVybi5yZXR1cm4ucmV0dXJuLnJldHVybi5zdGF0ZU5vZGUuZm9yY2VVcGRhdGUoKTtcclxuICAgIH1cclxufTsiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/ui/settings.js\n"); /***/ }), diff --git a/src/builtins/customcss.js b/src/builtins/customcss.js index cfe3224f..7072049b 100644 --- a/src/builtins/customcss.js +++ b/src/builtins/customcss.js @@ -3,6 +3,7 @@ import {Settings, DataStore, React, WebpackModules, Events, DOMManager, Strings} import CSSEditor from "../ui/customcss/csseditor"; import FloatingWindowContainer from "../ui/floating/container"; import SettingsTitle from "../ui/settings/title"; +import Utilities from "../modules/utilities"; const fs = require("fs"); const electron = require("electron"); @@ -42,10 +43,10 @@ export default new class CustomCSS extends Builtin { })], onClick: (thisObject) => { if (this.isDetached) return; - if (this.nativeOpen) this.openNative(); - else if (this.startDetached) this.openDetached(); - else thisObject._reactInternalFiber.child.memoizedProps.children.props.onSetSection(Strings.Panels.customcss); - this.setSection = thisObject._reactInternalFiber.child.memoizedProps.children.props.onSetSection; + if (this.nativeOpen) return this.openNative(); + else if (this.startDetached) return this.openDetached(); + const settingsView = Utilities.findInRenderTree(thisObject._reactInternalFiber, m => m && m.onSetSection, {walkable: ["child", "memoizedProps", "props", "children"]}); + if (settingsView && settingsView.onSetSection) settingsView.onSetSection(this.id); } }); this.loadCSS(); diff --git a/src/modules/reactcomponents.js b/src/modules/reactcomponents.js index 57373792..004b18d1 100644 --- a/src/modules/reactcomponents.js +++ b/src/modules/reactcomponents.js @@ -13,7 +13,6 @@ export default new class ReactComponents { get listeners() {return listeners;} constructor() { - this.walkReactTree(document.querySelector("#app-mount")._reactRootContainer._internalRoot.current); Patcher.after("ReactComponents", React, "createElement", (_, __, returnValue) => { this.walkRenderTree(returnValue); }); @@ -32,7 +31,9 @@ export default new class ReactComponents { }); } - initialize() {} + initialize() { + this.walkReactTree(document.querySelector("#app-mount")._reactRootContainer._internalRoot.current); + } get(name, filter) { return new Promise(resolve => { diff --git a/src/modules/settingsmanager.js b/src/modules/settingsmanager.js index 3139ce18..0b42c55f 100644 --- a/src/modules/settingsmanager.js +++ b/src/modules/settingsmanager.js @@ -45,7 +45,7 @@ export default new class SettingsManager { registerPanel(id, name, options) { if (this.panels.find(p => p.id == id)) return Logger.error("Settings", "Already have a panel with id " + id); const {element, onClick, order = 1} = options; - const section = {id, order, label: name, section: name}; + const section = {id, order, label: name, section: id}; if (onClick) section.clickListener = onClick; if (element) section.element = element instanceof DiscordModules.React.Component ? () => DiscordModules.React.createElement(element, {}) : typeof(element) == "function" ? element : () => element; this.panels.push(section); @@ -124,12 +124,9 @@ export default new class SettingsManager { } onSettingChange(collection, category, id, value) { - // const before = this.collections.length + this.panels.length; this.state[collection][category][id] = value; Events.dispatch("setting-updated", collection, category, id, value); - // const after = this.collections.length + this.panels.length; this.saveSettings(); - // if (before != after) setTimeout(this.forceUpdate.bind(this), 50); } getSetting(collection, category, id) { @@ -171,7 +168,6 @@ export default new class SettingsManager { for (let c = 0; c < this.collections.length; c++) { const collection = this.collections[c]; const CS = Strings.Collections[collection.id]; - console.log(CS); if (!CS) continue; collection.name = CS.name || collection.name; const categories = this.collections[c].settings; @@ -194,7 +190,7 @@ export default new class SettingsManager { for (let p = 0; p < this.panels.length; p++) { const panel = this.panels[p]; const Str = Strings.Panels[panel.id]; - panel.name = Str || panel.name; + panel.label = Str || panel.label; } } }; \ No newline at end of file diff --git a/src/modules/strings.js b/src/modules/strings.js index 1bf1efb2..a6f58e20 100644 --- a/src/modules/strings.js +++ b/src/modules/strings.js @@ -14,7 +14,6 @@ export function setLocale(newLocale) { currentLocale = newLocale; Utilities.extend(Messages, RawStrings[currentLocale]); Events.emit("strings-updated"); - console.log("Changed to " + newLocale); } Utilities.extend(Messages, RawStrings[currentLocale]); diff --git a/src/ui/customcss/csseditor.jsx b/src/ui/customcss/csseditor.jsx index cf8ad76a..f586b25e 100644 --- a/src/ui/customcss/csseditor.jsx +++ b/src/ui/customcss/csseditor.jsx @@ -28,7 +28,7 @@ export default class CssEditor extends React.Component { {label: React.createElement(Save, {size: "18px"}), tooltip: Strings.CustomCSS.save, onClick: this.saveCss}, {label: React.createElement(Edit, {size: "18px"}), tooltip: Strings.CustomCSS.openNative, onClick: this.openNative}, {label: React.createElement(Cog, {size: "18px"}), tooltip: Strings.CustomCSS.settings, onClick: "showSettings"}, - {label: Strings.Collections.settings.developer.liveUpdate.name, type:"checkbox", onChange: this.toggleLiveUpdate, checked: Settings.get("settings", "customcss", "liveUpdate"), side: "right"} + {label: Strings.Collections.settings.customcss.liveUpdate.name, type:"checkbox", onChange: this.toggleLiveUpdate, checked: Settings.get("settings", "customcss", "liveUpdate"), side: "right"} ]; if (this.openDetached) this.controls.push({label: React.createElement(Detach, {size: "18px"}), tooltip: Strings.CustomCSS.openDetached, onClick: this.openDetached, side: "right"}); } diff --git a/src/ui/settings.js b/src/ui/settings.js index e5881ad6..3f245a3c 100644 --- a/src/ui/settings.js +++ b/src/ui/settings.js @@ -11,11 +11,20 @@ export default new class SettingsRenderer { this.patchSections(); } + onChange(onChange) { + return (collection, category, id) => { + const before = Settings.collections.length + Settings.panels.length; + onChange(collection, category, id); + const after = Settings.collections.length + Settings.panels.length; + if (before != after) setTimeout(this.forceUpdate.bind(this), 50); + }; + } + buildSettingsPanel(title, config, state, onChange, button = null) { config.forEach(section => { section.settings.forEach(item => item.value = state[section.id][item.id]); }); - return this.getSettingsPanel(title, config, onChange, button); + return this.getSettingsPanel(title, config, this.onChange(onChange), button); } getSettingsPanel(title, groups, onChange, button = null) { @@ -43,9 +52,7 @@ export default new class SettingsRenderer { Patcher.after("SettingsManager", WebpackModules.getByDisplayName("FluxContainer(GuildSettings)").prototype, "render", (thisObject) => { thisObject._reactInternalFiber.return.return.return.return.return.return.memoizedProps.id = "guild-settings"; }); - console.log("getting user settings") const UserSettings = await ReactComponents.get("UserSettings", m => m.prototype && m.prototype.generateSections); - console.log("got 'em") Patcher.after("SettingsManager", UserSettings.prototype, "render", (thisObject) => { thisObject._reactInternalFiber.return.return.return.return.return.return.return.memoizedProps.id = "user-settings"; });