diff --git a/README.md b/README.md index 23d2821..ad75556 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ moodle-tiny_fontcolor ======================== -![Release](https://img.shields.io/badge/Release-0.6-blue.svg) +![Release](https://img.shields.io/badge/Release-0.7-blue.svg) [![Moodle Plugin CI](https://github.com/bfh/moodle-tiny_fontcolor/workflows/Moodle%20Plugin%20CI/badge.svg?branch=main)](https://github.com/bfh/moodle-tiny_fontcolor/actions?query=workflow%3A%22Moodle+Plugin+CI%22+branch%3Amain) [![PHP Support](https://img.shields.io/badge/php-7.4--8.3-blue)](https://github.com/bfh/moodle-tiny_fontcolor/action) [![Moodle Support](https://img.shields.io/badge/Moodle-4.1--4.4-orange)](https://github.com/bfh/moodle-tiny_fontcolor/actions) @@ -61,6 +61,12 @@ over the appropriate color square. ## Version History +### 0.7 +- Fix [HTML areas without files seem to fail with the tiny_fontcolor enabled #16](https://github.com/bfh/moodle-tiny_fontcolor/issues/16) and +[TinyMCE fails when creating a qtype_multichoice question #17](https://github.com/bfh/moodle-tiny_fontcolor/issues/17). The introduced context menu items in 0.6 didn't show up under +some conditions (e.g. in mc questions for answers and feedback) when there was no previously +defined contextmenu. + ### 0.6 - [Add quickbar support #14](https://github.com/bfh/moodle-tiny_fontcolor/issues/14) by [Thomas Ludwig](https://github.com/tholudwig) diff --git a/amd/build/configuration.min.js b/amd/build/configuration.min.js index be6ec87..098d961 100644 --- a/amd/build/configuration.min.js +++ b/amd/build/configuration.min.js @@ -6,6 +6,6 @@ define("tiny_fontcolor/configuration",["exports","editor_tiny/utils","./common"] * @copyright 2023 Luca Bösch * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -const configureContextMenu=menu=>(0,_utils.addContextmenuItem)(null!=menu?menu:"","|",_common.forecolor,_common.backcolor);_exports.configure=instanceConfig=>{return{toolbar:(toolbar=instanceConfig.toolbar,toolbar=(0,_utils.addToolbarButtons)(toolbar,"formatting",[_common.forecolor,_common.backcolor])),menu:(menu=instanceConfig.menu,menu=(0,_utils.addMenubarItem)(menu,"format",_common.forecolor),menu=(0,_utils.addMenubarItem)(menu,"format",_common.backcolor)),quickbars_selection_toolbar:configureContextMenu(instanceConfig.quickbars_selection_toolbar)};var menu,toolbar}})); +const configureContextMenu=menu=>(menu||(menu=""),(0,_utils.addContextmenuItem)(menu,"|",_common.forecolor,_common.backcolor));_exports.configure=instanceConfig=>{return{toolbar:(toolbar=instanceConfig.toolbar,toolbar=(0,_utils.addToolbarButtons)(toolbar,"formatting",[_common.forecolor,_common.backcolor])),menu:(menu=instanceConfig.menu,menu=(0,_utils.addMenubarItem)(menu,"format",_common.forecolor),menu=(0,_utils.addMenubarItem)(menu,"format",_common.backcolor)),quickbars_selection_toolbar:configureContextMenu(instanceConfig.quickbars_selection_toolbar)};var menu,toolbar}})); //# sourceMappingURL=configuration.min.js.map \ No newline at end of file diff --git a/amd/build/configuration.min.js.map b/amd/build/configuration.min.js.map index ca8863c..01dc20c 100644 --- a/amd/build/configuration.min.js.map +++ b/amd/build/configuration.min.js.map @@ -1 +1 @@ -{"version":3,"file":"configuration.min.js","sources":["../src/configuration.js"],"sourcesContent":["// This file is part of Moodle - https://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 tiny_fontcolor for Moodle.\n *\n * @module tiny_fontcolor\n * @copyright 2023 Luca Bösch \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {addMenubarItem, addContextmenuItem, addToolbarButtons} from 'editor_tiny/utils';\nimport {forecolor, backcolor} from './common';\n\nconst configureToolbar = (toolbar) => {\n toolbar = addToolbarButtons(toolbar, 'formatting', [forecolor, backcolor]);\n return toolbar;\n};\n\nconst configureMenu = (menu) => {\n menu = addMenubarItem(menu, 'format', forecolor);\n menu = addMenubarItem(menu, 'format', backcolor);\n return menu;\n};\n\nconst configureContextMenu = (menu) => {\n return addContextmenuItem(menu ?? '', '|', forecolor, backcolor);\n};\n\nexport const configure = (instanceConfig) => {\n return {\n toolbar: configureToolbar(instanceConfig.toolbar),\n menu: configureMenu(instanceConfig.menu),\n // eslint-disable-next-line camelcase\n quickbars_selection_toolbar: configureContextMenu(instanceConfig.quickbars_selection_toolbar),\n };\n};\n"],"names":["configureContextMenu","menu","forecolor","backcolor","instanceConfig","toolbar","quickbars_selection_toolbar"],"mappings":";;;;;;;;MAqCMA,qBAAwBC,OACnB,6BAAmBA,MAAAA,KAAAA,KAAQ,GAAI,IAAKC,kBAAWC,sCAGhCC,uBACf,CACHC,SAjBkBA,QAiBQD,eAAeC,QAhB7CA,SAAU,4BAAkBA,QAAS,aAAc,CAACH,kBAAWC,qBAiB3DF,MAbeA,KAaKG,eAAeH,KAZvCA,MAAO,yBAAeA,KAAM,SAAUC,mBACtCD,MAAO,yBAAeA,KAAM,SAAUE,oBAalCG,4BAA6BN,qBAAqBI,eAAeE,8BAflDL,IAAAA,KALGI"} \ No newline at end of file +{"version":3,"file":"configuration.min.js","sources":["../src/configuration.js"],"sourcesContent":["// This file is part of Moodle - https://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 tiny_fontcolor for Moodle.\n *\n * @module tiny_fontcolor\n * @copyright 2023 Luca Bösch \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {addMenubarItem, addContextmenuItem, addToolbarButtons} from 'editor_tiny/utils';\nimport {forecolor, backcolor} from './common';\n\nconst configureToolbar = (toolbar) => {\n toolbar = addToolbarButtons(toolbar, 'formatting', [forecolor, backcolor]);\n return toolbar;\n};\n\nconst configureMenu = (menu) => {\n menu = addMenubarItem(menu, 'format', forecolor);\n menu = addMenubarItem(menu, 'format', backcolor);\n return menu;\n};\n\nconst configureContextMenu = (menu) => {\n if (!menu) {\n menu = '';\n }\n return addContextmenuItem(menu, '|', forecolor, backcolor);\n};\n\nexport const configure = (instanceConfig) => {\n return {\n toolbar: configureToolbar(instanceConfig.toolbar),\n menu: configureMenu(instanceConfig.menu),\n // eslint-disable-next-line camelcase\n quickbars_selection_toolbar: configureContextMenu(instanceConfig.quickbars_selection_toolbar),\n };\n};\n"],"names":["configureContextMenu","menu","forecolor","backcolor","instanceConfig","toolbar","quickbars_selection_toolbar"],"mappings":";;;;;;;;MAqCMA,qBAAwBC,OACrBA,OACDA,KAAO,KAEJ,6BAAmBA,KAAM,IAAKC,kBAAWC,uCAG1BC,uBACf,CACHC,SApBkBA,QAoBQD,eAAeC,QAnB7CA,SAAU,4BAAkBA,QAAS,aAAc,CAACH,kBAAWC,qBAoB3DF,MAhBeA,KAgBKG,eAAeH,KAfvCA,MAAO,yBAAeA,KAAM,SAAUC,mBACtCD,MAAO,yBAAeA,KAAM,SAAUE,oBAgBlCG,4BAA6BN,qBAAqBI,eAAeE,8BAlBlDL,IAAAA,KALGI"} \ No newline at end of file diff --git a/amd/src/configuration.js b/amd/src/configuration.js index 4540960..e470a27 100644 --- a/amd/src/configuration.js +++ b/amd/src/configuration.js @@ -36,7 +36,10 @@ const configureMenu = (menu) => { }; const configureContextMenu = (menu) => { - return addContextmenuItem(menu ?? '', '|', forecolor, backcolor); + if (!menu) { + menu = ''; + } + return addContextmenuItem(menu, '|', forecolor, backcolor); }; export const configure = (instanceConfig) => { diff --git a/version.php b/version.php index 4209166..acafc91 100644 --- a/version.php +++ b/version.php @@ -25,8 +25,8 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = 'tiny_fontcolor'; -$plugin->release = '0.6'; -$plugin->version = 2024062700; +$plugin->release = '0.7'; +$plugin->version = 2024082000; $plugin->requires = 2022112800; $plugin->maturity = MATURITY_STABLE; $plugin->supported = [401, 404];