diff --git a/amd/build/plugin.min.js b/amd/build/plugin.min.js index 57cc166..e9ddbf4 100644 --- a/amd/build/plugin.min.js +++ b/amd/build/plugin.min.js @@ -5,6 +5,6 @@ define("tiny_codepro/plugin",["exports","editor_tiny/loader","editor_tiny/utils" * @module tiny_codepro/plugin * @copyright 2023 Josep Mulet Pol * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */(Configuration);var _default=new Promise((async resolve=>{const[tinyMCE,pluginMetadata,setupCommands]=await Promise.all([(0,_loader.getTinyMCE)(),(0,_utils.getPluginMetadata)(_common.component,_common.pluginName,"https://github.com/jmulet/moodle-tiny_codepro"),(0,_commands.getSetup)()]);tinyMCE.PluginManager.add(_common.pluginName,(editor=>((0,_options.register)(editor),editor.once("SetContent",(()=>{setupCommands(editor)})),pluginMetadata))),resolve([_common.pluginName,Configuration])}));return _exports.default=_default,_exports.default})); + */(Configuration);var _default=new Promise((async resolve=>{const[tinyMCE,pluginMetadata,setupCommands]=await Promise.all([(0,_loader.getTinyMCE)(),(0,_utils.getPluginMetadata)(_common.component,_common.pluginName,"https://github.com/jmulet/moodle-tiny_codepro"),(0,_commands.getSetup)()]);tinyMCE.PluginManager.add(_common.pluginName,(editor=>((0,_options.register)(editor),setupCommands(editor),pluginMetadata))),resolve([_common.pluginName,Configuration])}));return _exports.default=_default,_exports.default})); //# sourceMappingURL=plugin.min.js.map \ No newline at end of file diff --git a/amd/build/plugin.min.js.map b/amd/build/plugin.min.js.map index 76fc0e6..363e6e2 100644 --- a/amd/build/plugin.min.js.map +++ b/amd/build/plugin.min.js.map @@ -1 +1 @@ -{"version":3,"file":"plugin.min.js","sources":["../src/plugin.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 .\n\n/**\n * Tiny CodePro plugin.\n *\n * @module tiny_codepro/plugin\n * @copyright 2023 Josep Mulet Pol \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {getTinyMCE} from 'editor_tiny/loader';\nimport {getPluginMetadata} from 'editor_tiny/utils';\n\nimport {component, pluginName} from './common';\nimport {register as registerOptions} from './options';\nimport {getSetup as getCommandSetup} from './commands';\nimport * as Configuration from './configuration';\n\nconst documentationUrl = 'https://github.com/jmulet/moodle-tiny_codepro';\n\n// Setup the Plugin.\n// eslint-disable-next-line no-async-promise-executor\nexport default new Promise(async(resolve) => {\n const [\n tinyMCE,\n pluginMetadata,\n setupCommands,\n ] = await Promise.all([\n getTinyMCE(),\n getPluginMetadata(component, pluginName, documentationUrl),\n getCommandSetup(),\n ]);\n\n tinyMCE.PluginManager.add(pluginName, (editor) => {\n // Register options.\n registerOptions(editor);\n // Resolve the Plugin and include configuration.\n // Setup commands (only if the content has been set) to prevent from opening the modal without content.\n editor.once('SetContent', () => {\n setupCommands(editor);\n });\n return pluginMetadata;\n });\n\n resolve([pluginName, Configuration]);\n});\n"],"names":["Promise","async","tinyMCE","pluginMetadata","setupCommands","all","component","pluginName","PluginManager","add","editor","once","resolve","Configuration"],"mappings":";;;;;;;kCAmCe,IAAIA,SAAQC,MAAAA,gBAEnBC,QACAC,eACAC,qBACMJ,QAAQK,IAAI,EAClB,yBACA,4BAAkBC,kBAAWC,mBAXZ,kDAYjB,0BAGJL,QAAQM,cAAcC,IAAIF,oBAAaG,+BAEnBA,QAGhBA,OAAOC,KAAK,cAAc,KACtBP,cAAcM,WAEXP,kBAGXS,QAAQ,CAACL,mBAAYM"} \ No newline at end of file +{"version":3,"file":"plugin.min.js","sources":["../src/plugin.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 .\n\n/**\n * Tiny CodePro plugin.\n *\n * @module tiny_codepro/plugin\n * @copyright 2023 Josep Mulet Pol \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {getTinyMCE} from 'editor_tiny/loader';\nimport {getPluginMetadata} from 'editor_tiny/utils';\n\nimport {component, pluginName} from './common';\nimport {register as registerOptions} from './options';\nimport {getSetup as getCommandSetup} from './commands';\nimport * as Configuration from './configuration';\n\nconst documentationUrl = 'https://github.com/jmulet/moodle-tiny_codepro';\n\n// Setup the Plugin.\n// eslint-disable-next-line no-async-promise-executor\nexport default new Promise(async(resolve) => {\n const [\n tinyMCE,\n pluginMetadata,\n setupCommands,\n ] = await Promise.all([\n getTinyMCE(),\n getPluginMetadata(component, pluginName, documentationUrl),\n getCommandSetup(),\n ]);\n\n tinyMCE.PluginManager.add(pluginName, (editor) => {\n // Register options.\n registerOptions(editor);\n // Resolve the Plugin and include configuration.\n setupCommands(editor);\n return pluginMetadata;\n });\n\n resolve([pluginName, Configuration]);\n});\n"],"names":["Promise","async","tinyMCE","pluginMetadata","setupCommands","all","component","pluginName","PluginManager","add","editor","resolve","Configuration"],"mappings":";;;;;;;kCAmCe,IAAIA,SAAQC,MAAAA,gBAEnBC,QACAC,eACAC,qBACMJ,QAAQK,IAAI,EAClB,yBACA,4BAAkBC,kBAAWC,mBAXZ,kDAYjB,0BAGJL,QAAQM,cAAcC,IAAIF,oBAAaG,+BAEnBA,QAEhBN,cAAcM,QACPP,kBAGXQ,QAAQ,CAACJ,mBAAYK"} \ No newline at end of file diff --git a/amd/src/plugin.js b/amd/src/plugin.js index 6894214..786ef46 100644 --- a/amd/src/plugin.js +++ b/amd/src/plugin.js @@ -48,10 +48,7 @@ export default new Promise(async(resolve) => { // Register options. registerOptions(editor); // Resolve the Plugin and include configuration. - // Setup commands (only if the content has been set) to prevent from opening the modal without content. - editor.once('SetContent', () => { - setupCommands(editor); - }); + setupCommands(editor); return pluginMetadata; });