MDL-76261 tiny_equation: Use the correct icon
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
define("tiny_equation/commands",["exports","editor_tiny/utils","core/str","tiny_equation/common","tiny_equation/ui","tiny_equation/equation","tiny_equation/options"],(function(_exports,_utils,_str,_common,_ui,_equation,_options){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.getSetup=void 0;_exports.getSetup=async()=>{const[buttonText,buttonImage]=await Promise.all([(0,_str.get_string)("buttontitle",_common.component),(0,_utils.getButtonImage)("e/math","core")]);return editor=>{(0,_options.isTexFilterActive)(editor)&&(editor.ui.registry.addIcon(_common.icon,buttonImage.html),editor.ui.registry.addToggleButton(_common.buttonName,{icon:_common.icon,tooltip:buttonText,onAction:()=>{(0,_ui.handleAction)(editor)},onSetup:api=>{editor.on("NodeChange",(()=>{const result=(0,_equation.getSelectedEquation)(editor);api.setActive(result)}))}}),editor.ui.registry.addMenuItem(_common.buttonName,{icon:_common.icon,text:buttonText,onAction:()=>(0,_ui.handleAction)(editor)}))}}}));
|
||||
define("tiny_equation/commands",["exports","editor_tiny/utils","core/str","tiny_equation/common","tiny_equation/ui","tiny_equation/equation","tiny_equation/options"],(function(_exports,_utils,_str,_common,_ui,_equation,_options){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.getSetup=void 0;_exports.getSetup=async()=>{const[buttonText,buttonImage]=await Promise.all([(0,_str.get_string)("buttontitle",_common.component),(0,_utils.getButtonImage)("icon",_common.component)]);return editor=>{(0,_options.isTexFilterActive)(editor)&&(editor.ui.registry.addIcon(_common.icon,buttonImage.html),editor.ui.registry.addToggleButton(_common.buttonName,{icon:_common.icon,tooltip:buttonText,onAction:()=>{(0,_ui.handleAction)(editor)},onSetup:api=>{editor.on("NodeChange",(()=>{const result=(0,_equation.getSelectedEquation)(editor);api.setActive(result)}))}}),editor.ui.registry.addMenuItem(_common.buttonName,{icon:_common.icon,text:buttonText,onAction:()=>(0,_ui.handleAction)(editor)}))}}}));
|
||||
|
||||
//# sourceMappingURL=commands.min.js.map
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"commands.min.js","sources":["../src/commands.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\nimport {getButtonImage} from 'editor_tiny/utils';\nimport {get_string as getString} from 'core/str';\nimport {component, buttonName, icon} from 'tiny_equation/common';\nimport {handleAction} from 'tiny_equation/ui';\nimport {getSelectedEquation} from 'tiny_equation/equation';\nimport {isTexFilterActive} from 'tiny_equation/options';\n\n/**\n * Tiny Equation commands.\n *\n * @module tiny_equation/commands\n * @copyright 2022 Huong Nguyen <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nexport const getSetup = async() => {\n const [\n buttonText,\n buttonImage,\n ] = await Promise.all([\n getString('buttontitle', component),\n getButtonImage('e/math', 'core'),\n ]);\n\n return (editor) => {\n if (isTexFilterActive(editor)) {\n // Register the Equation Icon.\n editor.ui.registry.addIcon(icon, buttonImage.html);\n\n // Register the Menu Button as a toggle.\n // This means that when highlighted over an existing Equation element it will show as toggled on.\n editor.ui.registry.addToggleButton(buttonName, {\n icon,\n tooltip: buttonText,\n onAction: () => {\n handleAction(editor);\n },\n onSetup: (api) => {\n editor.on('NodeChange', () => {\n const result = getSelectedEquation(editor);\n api.setActive(result);\n });\n },\n });\n\n // Add the Equation Menu Item.\n // This allows it to be added to a standard menu, or a context menu.\n editor.ui.registry.addMenuItem(buttonName, {\n icon,\n text: buttonText,\n onAction: () => handleAction(editor),\n });\n }\n };\n};\n"],"names":["async","buttonText","buttonImage","Promise","all","component","editor","ui","registry","addIcon","icon","html","addToggleButton","buttonName","tooltip","onAction","onSetup","api","on","result","setActive","addMenuItem","text"],"mappings":"wUA8BwBA,gBAEhBC,WACAC,mBACMC,QAAQC,IAAI,EAClB,mBAAU,cAAeC,oBACzB,yBAAe,SAAU,iBAGrBC,UACA,8BAAkBA,UAElBA,OAAOC,GAAGC,SAASC,QAAQC,aAAMR,YAAYS,MAI7CL,OAAOC,GAAGC,SAASI,gBAAgBC,mBAAY,CAC3CH,KAAAA,aACAI,QAASb,WACTc,SAAU,0BACOT,SAEjBU,QAAUC,MACNX,OAAOY,GAAG,cAAc,WACdC,QAAS,iCAAoBb,QACnCW,IAAIG,UAAUD,cAO1Bb,OAAOC,GAAGC,SAASa,YAAYR,mBAAY,CACvCH,KAAAA,aACAY,KAAMrB,WACNc,SAAU,KAAM,oBAAaT"}
|
||||
{"version":3,"file":"commands.min.js","sources":["../src/commands.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\nimport {getButtonImage} from 'editor_tiny/utils';\nimport {get_string as getString} from 'core/str';\nimport {component, buttonName, icon} from 'tiny_equation/common';\nimport {handleAction} from 'tiny_equation/ui';\nimport {getSelectedEquation} from 'tiny_equation/equation';\nimport {isTexFilterActive} from 'tiny_equation/options';\n\n/**\n * Tiny Equation commands.\n *\n * @module tiny_equation/commands\n * @copyright 2022 Huong Nguyen <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nexport const getSetup = async() => {\n const [\n buttonText,\n buttonImage,\n ] = await Promise.all([\n getString('buttontitle', component),\n getButtonImage('icon', component),\n ]);\n\n return (editor) => {\n if (isTexFilterActive(editor)) {\n // Register the Equation Icon.\n editor.ui.registry.addIcon(icon, buttonImage.html);\n\n // Register the Menu Button as a toggle.\n // This means that when highlighted over an existing Equation element it will show as toggled on.\n editor.ui.registry.addToggleButton(buttonName, {\n icon,\n tooltip: buttonText,\n onAction: () => {\n handleAction(editor);\n },\n onSetup: (api) => {\n editor.on('NodeChange', () => {\n const result = getSelectedEquation(editor);\n api.setActive(result);\n });\n },\n });\n\n // Add the Equation Menu Item.\n // This allows it to be added to a standard menu, or a context menu.\n editor.ui.registry.addMenuItem(buttonName, {\n icon,\n text: buttonText,\n onAction: () => handleAction(editor),\n });\n }\n };\n};\n"],"names":["async","buttonText","buttonImage","Promise","all","component","editor","ui","registry","addIcon","icon","html","addToggleButton","buttonName","tooltip","onAction","onSetup","api","on","result","setActive","addMenuItem","text"],"mappings":"wUA8BwBA,gBAEhBC,WACAC,mBACMC,QAAQC,IAAI,EAClB,mBAAU,cAAeC,oBACzB,yBAAe,OAAQA,4BAGnBC,UACA,8BAAkBA,UAElBA,OAAOC,GAAGC,SAASC,QAAQC,aAAMR,YAAYS,MAI7CL,OAAOC,GAAGC,SAASI,gBAAgBC,mBAAY,CAC3CH,KAAAA,aACAI,QAASb,WACTc,SAAU,0BACOT,SAEjBU,QAAUC,MACNX,OAAOY,GAAG,cAAc,WACdC,QAAS,iCAAoBb,QACnCW,IAAIG,UAAUD,cAO1Bb,OAAOC,GAAGC,SAASa,YAAYR,mBAAY,CACvCH,KAAAA,aACAY,KAAMrB,WACNc,SAAU,KAAM,oBAAaT"}
|
||||
@@ -34,7 +34,7 @@ export const getSetup = async() => {
|
||||
buttonImage,
|
||||
] = await Promise.all([
|
||||
getString('buttontitle', component),
|
||||
getButtonImage('e/math', 'core'),
|
||||
getButtonImage('icon', component),
|
||||
]);
|
||||
|
||||
return (editor) => {
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generator: Adobe Illustrator 20.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 62 63.5"
|
||||
style="enable-background:new 0 0 62 63.5;" xml:space="preserve">
|
||||
<g>
|
||||
<path d="M57,56c0,2.3-1.9,4.2-4.2,4.2h-46c-2.3,0-4.2-1.9-4.2-4.2V5.6c0-2.3,1.9-4.2,4.2-4.2h46c2.3,0,4.2,1.9,4.2,4.2 V56z M52.8,7.7c0-1.2-0.9-2.1-2.1-2.1H8.9c-1.1,0-2.1,1-2.1,2.1v8.4c0,1.2,0.9,2.1,2.1,2.1h41.8c1.1,0,2.1-1,2.1-2.1V7.7z M11,22.4 c-2.3,0-4.2,1.9-4.2,4.2s1.9,4.2,4.2,4.2s4.2-1.9,4.2-4.2S13.3,22.4,11,22.4z M11,35c-2.3,0-4.2,1.9-4.2,4.2s1.9,4.2,4.2,4.2 s4.2-1.9,4.2-4.2S13.3,35,11,35z M11,47.6c-2.3,0-4.2,1.9-4.2,4.2S8.7,56,11,56s4.2-1.9,4.2-4.2S13.3,47.6,11,47.6z M23.5,22.4 c-2.3,0-4.2,1.9-4.2,4.2s1.9,4.2,4.2,4.2s4.2-1.9,4.2-4.2S25.9,22.4,23.5,22.4z M23.5,35c-2.3,0-4.2,1.9-4.2,4.2s1.9,4.2,4.2,4.2 s4.2-1.9,4.2-4.2S25.9,35,23.5,35z M23.5,47.6c-2.3,0-4.2,1.9-4.2,4.2s1.9,4.2,4.2,4.2s4.2-1.9,4.2-4.2S25.9,47.6,23.5,47.6z M36.1,22.4c-2.3,0-4.2,1.9-4.2,4.2s1.9,4.2,4.2,4.2s4.2-1.9,4.2-4.2S38.4,22.4,36.1,22.4z M36.1,35c-2.3,0-4.2,1.9-4.2,4.2 s1.9,4.2,4.2,4.2s4.2-1.9,4.2-4.2S38.4,35,36.1,35z M36.1,47.6c-2.3,0-4.2,1.9-4.2,4.2s1.9,4.2,4.2,4.2s4.2-1.9,4.2-4.2 S38.4,47.6,36.1,47.6z M48.6,22.4c-2.3,0-4.2,1.9-4.2,4.2s1.9,4.2,4.2,4.2s4.2-1.9,4.2-4.2S50.9,22.4,48.6,22.4z M52.8,39.2 c0-2.3-1.9-4.2-4.2-4.2s-4.2,1.9-4.2,4.2v12.6c0,2.3,1.9,4.2,4.2,4.2s4.2-1.9,4.2-4.2V39.2z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
Reference in New Issue
Block a user