//META{"name":"p_quoter"}*// /*@cc_on @if (@_jscript) // Offer to self-install for clueless users that try to run this directly. var shell = WScript.CreateObject("WScript.Shell"); var fs = new ActiveXObject("Scripting.FileSystemObject"); var pathPlugins = shell.ExpandEnvironmentStrings("%APPDATA%\\BetterDiscord\\plugins"); var pathSelf = WScript.ScriptFullName; // Put the user at ease by addressing them in the first person shell.Popup("It looks like you tried to run me directly. This is not desired behavior! It will work now, but likely will not work with other plugins. Even worse, with other untrusted plugins it may lead computer virus infection!", 0, "I'm a plugin for BetterDiscord", 0x30); if (fs.GetParentFolderName(pathSelf) === fs.GetAbsolutePathName(pathPlugins)) { shell.Popup("I'm in the correct folder already.\nJust reload Discord with Ctrl+R.", 0, "I'm already installed", 0x40); } else if (!fs.FolderExists(pathPlugins)) { shell.Popup("I can't find the BetterDiscord plugins folder.\nAre you sure it's even installed?", 0, "Can't install myself", 0x10); } else if (shell.Popup("Should I copy myself to BetterDiscord's plugins folder for you?", 0, "Do you need some help?", 0x34) === 6) { fs.CopyFile(pathSelf, fs.BuildPath(pathPlugins, fs.GetFileName(pathSelf)), true); // Show the user where to put plugins in the future shell.Exec("explorer " + pathPlugins); shell.Popup("I'm installed!\nJust reload Discord with Ctrl+R.", 0, "Successfully installed", 0x40); } WScript.Quit(); @else @*/ var p_quoter = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(18); /***/ }), /* 1 */, /* 2 */, /* 3 */ /***/ (function(module, exports) { /** * BetterDiscord Plugin Base Class * Copyright (c) 2015-present Jiiks - https://jiiks.net * All rights reserved. * https://github.com/Jiiks/BetterDiscordApp - https://betterdiscord.net * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ 'use strict'; class Plugin { constructor(props) { this.props = props; } get authors() { return this.props.authors; } get version() { return this.props.version; } get name() { return this.props.name; } get description() { return this.props.description; } get reloadable() { return this.props.reloadable; } get permissions() { return this.props.permissions; } get storage() { return this.internal.storage; } get settings() { return this.storage.settings; } saveSettings() { this.storage.save(); this.onSave(this.settings); } getSetting(id) { let setting = this.storage.settings.find(setting => { return setting.id === id; }); if (setting && setting.value !== undefined) return setting.value; } get enabled() { return this.getSetting("enabled"); } } module.exports = Plugin; /***/ }), /* 4 */ /***/ (function(module, exports, __webpack_require__) { /** * BetterDiscord Plugin Api * Copyright (c) 2015-present Jiiks - https://jiiks.net * All rights reserved. * https://github.com/Jiiks/BetterDiscordApp - https://betterdiscord.net * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ 'use strict'; const Logger = __webpack_require__(5); const Api = __webpack_require__(6); class PluginApi { constructor(props) { this.props = props; } log(message, level) { Logger.log(this.props.name, message, level); } injectStyle(id, css) { Api.injectStyle(id, css); } removeStyle(id) { Api.removeStyle(id); } injectScript(id, script) { Api.injectScript(id, script); } removeScript(id) { Api.removeScript(id); } } module.exports = PluginApi; /***/ }), /* 5 */ /***/ (function(module, exports) { /** * BetterDiscord Logger Module * Copyright (c) 2015-present Jiiks - https://jiiks.net * All rights reserved. * https://github.com/Jiiks/BetterDiscordApp - https://betterdiscord.net * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ 'use strict'; class Logger { static log(moduleName, message, level = 'log') { level = this.parseLevel(level); console[level]('[%cBetter%cDiscord:%s] %s', 'color: #3E82E5', '', `${moduleName}${level === 'debug' ? '|DBG' : ''}`, message); } static logObject(moduleName, message, object, level) { if (message) this.log(moduleName, message, level); console.log(object); } static debug(moduleName, message, level, force) { if (!force) { if (!window.BetterDiscord || !window.BetterDiscord.debug) return; } this.log(moduleName, message, 'debug', true); } static debugObject(moduleName, message, object, level, force) { if (!force) { if (!window.BetterDiscord || !window.BetterDiscord.debug) return; } if (message) this.debug(moduleName, message, level, force); console.debug(object); } static parseLevel(level) { return { 'log': 'log', 'warn': 'warn', 'err': 'error', 'error': 'error', 'debug': 'debug', 'dbg': 'debug', 'info': 'info' }[level]; } } module.exports = Logger; /***/ }), /* 6 */ /***/ (function(module, exports) { module.exports = {}; /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { /** * BetterDiscord Plugin Storage * Copyright (c) 2015-present Jiiks - https://jiiks.net * All rights reserved. * https://github.com/Jiiks/BetterDiscordApp - https://betterdiscord.net * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ 'use strict'; const Utils = __webpack_require__(6); class PluginStorage { constructor(path, defaults) { this.path = `${path}/settings.json`; this.defaultConfig = defaults; this.load(); } load() { this.settings = JSON.parse(JSON.stringify(this.defaultConfig)); const loadSettings = Utils.tryParse(Utils.readFileSync(this.path)); if (loadSettings) { Object.keys(loadSettings).map(key => { this.setSetting(key, loadSettings[key]); }); } if (!this.getSetting('enabled')) this.setSetting('enabled', false); } save() { const reduced = this.settings.reduce((result, item) => { result[item.id] = item.value; return result; }, {}); Utils.writeFileSync(this.path, JSON.stringify(reduced)); } getSetting(id) { const setting = this.settings.find(setting => setting.id === id); if (!setting) return null; return setting.value; } setSetting(id, value) { const setting = this.settings.find(setting => setting.id === id); if (!setting) { this.settings.push({ id, value }); } else { setting.value = value; } this.save(); } setSettings(settings) { this.settings = settings; } } module.exports = PluginStorage; /***/ }), /* 8 */, /* 9 */, /* 10 */, /* 11 */, /* 12 */, /* 13 */, /* 14 */, /* 15 */, /* 16 */, /* 17 */, /* 18 */ /***/ (function(module, exports, __webpack_require__) { const v1transpile_version = 6; module.exports = class { constructor() { const config = __webpack_require__(19); if (!window.v1transpile || window.v1transpile.version < v1transpile_version) { window.v1transpile = window.v1transpile || {}; window.v1transpile.version = v1transpile_version; window.v1transpile.Plugin = window.v1transpile.Plugin || __webpack_require__(3); window.v1transpile.PluginApi = window.v1transpile.PluginApi || __webpack_require__(4); window.v1transpile.PluginStorage = window.v1transpile.PluginStorage || __webpack_require__(7); window.v1transpile.Settings = window.v1transpile.Settings || { /** * Create and return a new top-level settings panel * @author noodlebox * @return {jQuery} */ topPanel() { return $("
").addClass("form").css("width", "100%"); }, /** * Create and return a container for control groups * @author noodlebox * @return {jQuery} */ controlGroups() { return $("
").addClass("control-groups"); }, /** * Create and return a flexible control group * @author noodlebox * @param {object} settings Settings object * @param {Element|jQuery|string} settings.label an element or something JQuery-ish or, if string, use as plain text * @return {jQuery} */ controlGroup(settings) { const group = $("
").addClass("control-group"); if (typeof settings.label === "string") { group.append($("