AutorÃa | Ultima modificación | Ver Log |
{"version":3,"file":"options.min.js","sources":["../src/options.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Options helper for Tiny Equation plugin.\n *\n * @module tiny_equation/options\n * @copyright 2022 Huong Nguyen <huongnv13@gmail.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimpor
t {getPluginOptionName} from 'editor_tiny/options';\nimport {pluginName} from 'tiny_equation/common';\n\nconst librariesName = getPluginOptionName(pluginName, 'libraries');\nconst texFilterName = getPluginOptionName(pluginName, 'texfilter');\nconst contextIdName = getPluginOptionName(pluginName, 'contextid');\nconst texDocsUrlName = getPluginOptionName(pluginName, 'texdocsurl');\n\n/**\n * Register the options for the Tiny Equation plugin.\n *\n * @param {TinyMCE} editor\n */\nexport const register = (editor) => {\n const registerOption = editor.options.register;\n\n registerOption(librariesName, {\n processor: 'array',\n \"default\": [],\n });\n\n registerOption(texFilterName, {\n processor: 'boolean',\n \"default\": false,\n });\n\n registerOption(contextIdName, {\n processor: 'number',\n \"default\": 0,\n });\n\n registerOption(texDocsUrlName, {\n processor: 'string',\n \"default\": '',\n });\n};\n\n/**\n * Get the librarie
s configuration for the Tiny Equation plugin.\n *\n * @param {TinyMCE} editor\n * @returns {object}\n */\nexport const getLibraries = (editor) => editor.options.get(librariesName);\n/**\n * Check if the TEX filter is active or not for the Tiny Equation plugin.\n *\n * @param {TinyMCE} editor\n * @returns {boolean}\n */\nexport const isTexFilterActive = (editor) => editor.options.get(texFilterName);\n/**\n * Get the context id for the Tiny Equation plugin.\n *\n * @param {TinyMCE} editor\n * @returns {number}\n */\nexport const getContextId = (editor) => editor.options.get(contextIdName);\n/**\n * Get the Tex Docs Url for the Tiny Equation plugin.\n *\n * @param {TinyMCE} editor\n * @returns {string}\n */\nexport const getTexDocsUrl = (editor) => editor.options.get(texDocsUrlName);\n"],"names":["librariesName","pluginName","texFilterName","contextIdName","texDocsUrlName","editor","registerOption","options","register","processor","get"],"mappings":";;;;;;;;MA0BMA,eAAgB,gCAAoBC,mBAAY,aAChDC,eAAgB,gCAAoBD,mBAAY,
aAChDE,eAAgB,gCAAoBF,mBAAY,aAChDG,gBAAiB,gCAAoBH,mBAAY,gCAO9BI,eACfC,eAAiBD,OAAOE,QAAQC,SAEtCF,eAAeN,cAAe,CAC1BS,UAAW,gBACA,KAGfH,eAAeJ,cAAe,CAC1BO,UAAW,mBACA,IAGfH,eAAeH,cAAe,CAC1BM,UAAW,iBACA,IAGfH,eAAeF,eAAgB,CAC3BK,UAAW,iBACA,4BAUUJ,QAAWA,OAAOE,QAAQG,IAAIV,0CAOzBK,QAAWA,OAAOE,QAAQG,IAAIR,qCAOnCG,QAAWA,OAAOE,QAAQG,IAAIP,sCAO7BE,QAAWA,OAAOE,QAAQG,IAAIN"}