MDL-77559 js: Rebuild all JS with Node 16

This commit is contained in:
Andrew Nicols
2023-03-09 09:53:19 +08:00
parent a9f2cb6926
commit 511401f4f6
736 changed files with 843 additions and 845 deletions
File diff suppressed because one or more lines are too long
@@ -1,8 +1,8 @@
define("tiny_accessibilitychecker/colorbase",["exports"],(function(_exports){function _defineProperty(obj,key,value){return(key=function(arg){var key=function(input,hint){if("object"!=typeof input||null===input)return input;var prim=input[Symbol.toPrimitive];if(void 0!==prim){var res=prim.call(input,hint||"default");if("object"!=typeof res)return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}
define("tiny_accessibilitychecker/colorbase",["exports"],(function(_exports){function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}
/*
* @package tiny_accessibilitychecker
* @copyright 2022, Stevani Andolo <stevani@hotmail.com.au>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/(arg,"string");return"symbol"==typeof key?key:String(key)}(key))in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0;return _exports.default=class{constructor(){_defineProperty(this,"REGEX_HEX",/^#?([\da-fA-F]{2})([\da-fA-F]{2})([\da-fA-F]{2})(\ufffe)?/),_defineProperty(this,"REGEX_HEX3",/^#?([\da-fA-F]{1})([\da-fA-F]{1})([\da-fA-F]{1})(\ufffe)?/),_defineProperty(this,"REGEX_RGB",/rgba?\(([\d]{1,3}), ?([\d]{1,3}), ?([\d]{1,3}),? ?([.\d]*)?\)/),_defineProperty(this,"TYPES",{HEX:"hex",RGB:"rgb",RGBA:"rgba"}),_defineProperty(this,"KEYWORDS",{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"}),_defineProperty(this,"STR_HEX","#{*}{*}{*}"),_defineProperty(this,"STR_RGB","rgb({*}, {*}, {*})"),_defineProperty(this,"STR_RGBA","rgba({*}, {*}, {*}, {*})"),_defineProperty(this,"toHex",(str=>{var clr=this._convertTo(str,"hex"),isTransparent="transparent"===clr.toLowerCase();return"#"===clr.charAt(0)||isTransparent||(clr="#"+clr),isTransparent?clr.toLowerCase():clr.toUpperCase()})),_defineProperty(this,"toRGB",(str=>this._convertTo(str,"rgb").toLowerCase())),_defineProperty(this,"toRGBA",(str=>this._convertTo(str,"rgba").toLowerCase())),_defineProperty(this,"toArray",(str=>{var regex,arr,length,type=this.findType(str).toUpperCase();return"HEX"===type&&str.length<5&&(type="HEX3"),"A"===type.charAt(type.length-1)&&(type=type.slice(0,-1)),(regex=this._getRightValue("REGEX_"+type))&&(length=(arr=regex.exec(str)||[]).length)&&(arr.shift(),length--,"HEX3"===type&&(arr[0]+=arr[0],arr[1]+=arr[1],arr[2]+=arr[2]),arr[length-1]||(arr[length-1]=1)),arr})),_defineProperty(this,"fromArray",((arr,template)=>{if(arr=arr.concat(),void 0===template)return arr.join(", ");for(template=this._getRightValue("STR_"+template.toUpperCase()),3===arr.length&&4===template.match(/\{\*\}/g).length&&arr.push(1);template.indexOf("{*}")>=0&&arr.length>0;)template=template.replace("{*}",arr.shift());return template})),_defineProperty(this,"findType",(str=>{if(this.KEYWORDS[str])return"keyword";var key,index=str.indexOf("(");return index>0&&(key=str.substr(0,index)),key&&this.TYPES[key.toUpperCase()]?this.TYPES[key.toUpperCase()]:"hex"})),_defineProperty(this,"_getAlpha",(clr=>{var alpha,arr=this.toArray(clr);return arr.length>3&&(alpha=arr.pop()),+alpha||1})),_defineProperty(this,"_keywordToHex",(clr=>{var keyword=this.KEYWORDS[clr];return keyword||keyword})),_defineProperty(this,"_convertTo",((clr,to)=>{if("transparent"===clr)return clr;var needsAlpha,alpha,method,ucTo,from=this.findType(clr),originalTo=to;return"keyword"===from&&(clr=this._keywordToHex(clr),from="hex"),"hex"===from&&clr.length<5&&("#"===clr.charAt(0)&&(clr=clr.substr(1)),clr="#"+clr.charAt(0)+clr.charAt(0)+clr.charAt(1)+clr.charAt(1)+clr.charAt(2)+clr.charAt(2)),from===to||("a"===from.charAt(from.length-1)&&(from=from.slice(0,-1)),(needsAlpha="a"===to.charAt(to.length-1))&&(to=to.slice(0,-1),alpha=this._getAlpha(clr)),ucTo=to.charAt(0).toUpperCase()+to.substr(1).toLowerCase(),(method=window["_"+from+"To"+ucTo])||"rgb"!==from&&"rgb"!==to&&(clr=window["_"+from+"ToRgb"](clr),from="rgb",method=window["_"+from+"To"+ucTo]),method&&(clr=method(clr,needsAlpha)),needsAlpha&&(Array.isArray(clr)||(clr=this.toArray(clr)),clr.push(alpha),clr=this.fromArray(clr,originalTo.toUpperCase()))),clr})),_defineProperty(this,"_hexToRgb",((str,array)=>{var r,g,b;return"#"===str.charAt(0)&&(str=str.substr(1)),r=(str=parseInt(str,16))>>16,g=str>>8&255,b=255&str,array?[r,g,b]:"rgb("+r+", "+g+", "+b+")"})),_defineProperty(this,"_rgbToHex",(str=>{var rgb=this.toArray(str),hex=rgb[2]|rgb[1]<<8|rgb[0]<<16;for(hex=(+hex).toString(16);hex.length<6;)hex="0"+hex;return"#"+hex})),_defineProperty(this,"_getRightValue",(string=>{let regex=null;return"REGEX_RGB"===string?regex=this.REGEX_RGB:"REGEX_HEX"===string?regex=this.REGEX_HEX:"REGEX_HEX3"===string?regex=this.REGEX_HEX3:"STR_HEX"===string?regex=this.STR_HEX:"STR_RGB"===string?regex=this.STR_RGB:"STR_RGBA"===string&&(regex=this.STR_RGBA),regex}))}},_exports.default}));
*/Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0;return _exports.default=class{constructor(){_defineProperty(this,"REGEX_HEX",/^#?([\da-fA-F]{2})([\da-fA-F]{2})([\da-fA-F]{2})(\ufffe)?/),_defineProperty(this,"REGEX_HEX3",/^#?([\da-fA-F]{1})([\da-fA-F]{1})([\da-fA-F]{1})(\ufffe)?/),_defineProperty(this,"REGEX_RGB",/rgba?\(([\d]{1,3}), ?([\d]{1,3}), ?([\d]{1,3}),? ?([.\d]*)?\)/),_defineProperty(this,"TYPES",{HEX:"hex",RGB:"rgb",RGBA:"rgba"}),_defineProperty(this,"KEYWORDS",{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"}),_defineProperty(this,"STR_HEX","#{*}{*}{*}"),_defineProperty(this,"STR_RGB","rgb({*}, {*}, {*})"),_defineProperty(this,"STR_RGBA","rgba({*}, {*}, {*}, {*})"),_defineProperty(this,"toHex",(str=>{var clr=this._convertTo(str,"hex"),isTransparent="transparent"===clr.toLowerCase();return"#"===clr.charAt(0)||isTransparent||(clr="#"+clr),isTransparent?clr.toLowerCase():clr.toUpperCase()})),_defineProperty(this,"toRGB",(str=>this._convertTo(str,"rgb").toLowerCase())),_defineProperty(this,"toRGBA",(str=>this._convertTo(str,"rgba").toLowerCase())),_defineProperty(this,"toArray",(str=>{var regex,arr,length,type=this.findType(str).toUpperCase();return"HEX"===type&&str.length<5&&(type="HEX3"),"A"===type.charAt(type.length-1)&&(type=type.slice(0,-1)),(regex=this._getRightValue("REGEX_"+type))&&(length=(arr=regex.exec(str)||[]).length)&&(arr.shift(),length--,"HEX3"===type&&(arr[0]+=arr[0],arr[1]+=arr[1],arr[2]+=arr[2]),arr[length-1]||(arr[length-1]=1)),arr})),_defineProperty(this,"fromArray",((arr,template)=>{if(arr=arr.concat(),void 0===template)return arr.join(", ");for(template=this._getRightValue("STR_"+template.toUpperCase()),3===arr.length&&4===template.match(/\{\*\}/g).length&&arr.push(1);template.indexOf("{*}")>=0&&arr.length>0;)template=template.replace("{*}",arr.shift());return template})),_defineProperty(this,"findType",(str=>{if(this.KEYWORDS[str])return"keyword";var key,index=str.indexOf("(");return index>0&&(key=str.substr(0,index)),key&&this.TYPES[key.toUpperCase()]?this.TYPES[key.toUpperCase()]:"hex"})),_defineProperty(this,"_getAlpha",(clr=>{var alpha,arr=this.toArray(clr);return arr.length>3&&(alpha=arr.pop()),+alpha||1})),_defineProperty(this,"_keywordToHex",(clr=>{var keyword=this.KEYWORDS[clr];return keyword||keyword})),_defineProperty(this,"_convertTo",((clr,to)=>{if("transparent"===clr)return clr;var needsAlpha,alpha,method,ucTo,from=this.findType(clr),originalTo=to;return"keyword"===from&&(clr=this._keywordToHex(clr),from="hex"),"hex"===from&&clr.length<5&&("#"===clr.charAt(0)&&(clr=clr.substr(1)),clr="#"+clr.charAt(0)+clr.charAt(0)+clr.charAt(1)+clr.charAt(1)+clr.charAt(2)+clr.charAt(2)),from===to||("a"===from.charAt(from.length-1)&&(from=from.slice(0,-1)),(needsAlpha="a"===to.charAt(to.length-1))&&(to=to.slice(0,-1),alpha=this._getAlpha(clr)),ucTo=to.charAt(0).toUpperCase()+to.substr(1).toLowerCase(),(method=window["_"+from+"To"+ucTo])||"rgb"!==from&&"rgb"!==to&&(clr=window["_"+from+"ToRgb"](clr),from="rgb",method=window["_"+from+"To"+ucTo]),method&&(clr=method(clr,needsAlpha)),needsAlpha&&(Array.isArray(clr)||(clr=this.toArray(clr)),clr.push(alpha),clr=this.fromArray(clr,originalTo.toUpperCase()))),clr})),_defineProperty(this,"_hexToRgb",((str,array)=>{var r,g,b;return"#"===str.charAt(0)&&(str=str.substr(1)),r=(str=parseInt(str,16))>>16,g=str>>8&255,b=255&str,array?[r,g,b]:"rgb("+r+", "+g+", "+b+")"})),_defineProperty(this,"_rgbToHex",(str=>{var rgb=this.toArray(str),hex=rgb[2]|rgb[1]<<8|rgb[0]<<16;for(hex=(+hex).toString(16);hex.length<6;)hex="0"+hex;return"#"+hex})),_defineProperty(this,"_getRightValue",(string=>{let regex=null;return"REGEX_RGB"===string?regex=this.REGEX_RGB:"REGEX_HEX"===string?regex=this.REGEX_HEX:"REGEX_HEX3"===string?regex=this.REGEX_HEX3:"STR_HEX"===string?regex=this.STR_HEX:"STR_RGB"===string?regex=this.STR_RGB:"STR_RGBA"===string&&(regex=this.STR_RGBA),regex}))}},_exports.default}));
//# sourceMappingURL=colorbase.min.js.map
File diff suppressed because one or more lines are too long
@@ -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\n/**\n * Tiny Media Manager commands.\n *\n * @module tiny_accessibilitychecker/commands\n * @copyright 2022, Stevani Andolo <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {get_string as getString} from 'core/str';\nimport {\n component,\n accessbilityButtonName,\n icon,\n} from './common';\nimport Checker from './checker';\n\nexport const getSetup = async() => {\n const [\n buttonTooltip,\n ] = await Promise.all([\n getString('pluginname', component),\n ]);\n\n return (editor) => {\n // Register the Menu Button as a toggle.\n editor.ui.registry.addButton(accessbilityButtonName, {\n icon,\n tooltip: buttonTooltip,\n onAction: () => {\n const checker = new Checker(editor);\n checker.displayDialogue();\n }\n });\n\n editor.ui.registry.addMenuItem(accessbilityButtonName, {\n icon,\n text: buttonTooltip,\n onAction: () => {\n const checker = new Checker(editor);\n checker.displayDialogue();\n }\n });\n };\n};\n"],"names":["obj","_checker","__esModule","default","_exports","getSetup","async","buttonTooltip","Promise","all","getString","component","editor","ui","registry","addButton","accessbilityButtonName","icon","tooltip","onAction","Checker","displayDialogue","addMenuItem","text"],"mappings":"oIA6BgC,IAAAA;;;;;;;sFAAhCC,UAAgCD,IAAhCC,WAAgCD,IAAAE,WAAAF,IAAAG,CAAAA,QAAAH,KA6B9BI,SAAAC,SA3BsBC,UACpB,MACIC,qBACMC,QAAQC,IAAI,EAClB,EAAAC,iBAAU,aAAcC,QAASA,aAGrC,OAAQC,SAEJA,OAAOC,GAAGC,SAASC,UAAUC,+BAAwB,CACjDC,KAAAA,QAAIA,KACJC,QAASX,cACTY,SAAUA,KACU,IAAIC,SAAOjB,QAACS,QACpBS,iBAAiB,IAIjCT,OAAOC,GAAGC,SAASQ,YAAYN,+BAAwB,CACnDC,KAAAA,QAAIA,KACJM,KAAMhB,cACNY,SAAUA,KACU,IAAIC,SAAOjB,QAACS,QACpBS,iBAAiB,GAE/B,CACL,CACH"}
{"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\n/**\n * Tiny Media Manager commands.\n *\n * @module tiny_accessibilitychecker/commands\n * @copyright 2022, Stevani Andolo <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {get_string as getString} from 'core/str';\nimport {\n component,\n accessbilityButtonName,\n icon,\n} from './common';\nimport Checker from './checker';\n\nexport const getSetup = async() => {\n const [\n buttonTooltip,\n ] = await Promise.all([\n getString('pluginname', component),\n ]);\n\n return (editor) => {\n // Register the Menu Button as a toggle.\n editor.ui.registry.addButton(accessbilityButtonName, {\n icon,\n tooltip: buttonTooltip,\n onAction: () => {\n const checker = new Checker(editor);\n checker.displayDialogue();\n }\n });\n\n editor.ui.registry.addMenuItem(accessbilityButtonName, {\n icon,\n text: buttonTooltip,\n onAction: () => {\n const checker = new Checker(editor);\n checker.displayDialogue();\n }\n });\n };\n};\n"],"names":["async","buttonTooltip","Promise","all","component","editor","ui","registry","addButton","accessbilityButtonName","icon","tooltip","onAction","Checker","displayDialogue","addMenuItem","text"],"mappings":";;;;;;;kKA+BwBA,gBAEhBC,qBACMC,QAAQC,IAAI,EAClB,mBAAU,aAAcC,4BAGpBC,SAEJA,OAAOC,GAAGC,SAASC,UAAUC,+BAAwB,CACjDC,KAAAA,aACAC,QAASV,cACTW,SAAU,KACU,IAAIC,iBAAQR,QACpBS,qBAIhBT,OAAOC,GAAGC,SAASQ,YAAYN,+BAAwB,CACnDC,KAAAA,aACAM,KAAMf,cACNW,SAAU,KACU,IAAIC,iBAAQR,QACpBS"}
@@ -1 +1 @@
{"version":3,"file":"common.min.js","sources":["../src/common.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 * Tiny Media common values.\n *\n * @module tiny_accessibilitychecker/common\n * @copyright 2022, Stevani Andolo <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nexport default {\n pluginName: 'tiny_accessibilitychecker/plugin',\n component: 'tiny_accessibilitychecker',\n accessbilityButtonName: 'tiny_accessibilitychecker',\n icon: 'accessibility-check',\n};\n"],"names":["_exports","default","pluginName","component","accessbilityButtonName","icon"],"mappings":"0JA4BC,OAAAA,SAAAC,QALc,CACXC,WAAY,mCACZC,UAAW,4BACXC,uBAAwB,4BACxBC,KAAM,uBACTL,SAAAC,OAAA"}
{"version":3,"file":"common.min.js","sources":["../src/common.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 * Tiny Media common values.\n *\n * @module tiny_accessibilitychecker/common\n * @copyright 2022, Stevani Andolo <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nexport default {\n pluginName: 'tiny_accessibilitychecker/plugin',\n component: 'tiny_accessibilitychecker',\n accessbilityButtonName: 'tiny_accessibilitychecker',\n icon: 'accessibility-check',\n};\n"],"names":["pluginName","component","accessbilityButtonName","icon"],"mappings":"kLAuBe,CACXA,WAAY,mCACZC,UAAW,4BACXC,uBAAwB,4BACxBC,KAAM"}
@@ -1 +1 @@
{"version":3,"file":"configuration.min.js","sources":["../src/configuration.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 * Tiny Media Manager configuration.\n *\n * @module tiny_accessibilitychecker/configuration\n * @copyright 2022, Stevani Andolo <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {accessbilityButtonName} from './common';\nimport {\n addMenubarItem,\n} from 'editor_tiny/utils';\n\nexport const configure = (instanceConfig) => {\n // Update the instance configuration to add the Tools menu.\n return {\n menu: addMenubarItem(instanceConfig.menu, 'tools', accessbilityButtonName)\n };\n};\n"],"names":["_exports","configure","instanceConfig","menu","addMenubarItem","accessbilityButtonName"],"mappings":"iNAiCEA,SAAAC,UALwBC,iBAEf,CACHC,MAAM,EAAAC,OAAAA,gBAAeF,eAAeC,KAAM,QAASE,QAAsBA,yBAE/E"}
{"version":3,"file":"configuration.min.js","sources":["../src/configuration.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 * Tiny Media Manager configuration.\n *\n * @module tiny_accessibilitychecker/configuration\n * @copyright 2022, Stevani Andolo <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {accessbilityButtonName} from './common';\nimport {\n addMenubarItem,\n} from 'editor_tiny/utils';\n\nexport const configure = (instanceConfig) => {\n // Update the instance configuration to add the Tools menu.\n return {\n menu: addMenubarItem(instanceConfig.menu, 'tools', accessbilityButtonName)\n };\n};\n"],"names":["instanceConfig","menu","accessbilityButtonName"],"mappings":"oOA4B0BA,iBAEf,CACHC,MAAM,yBAAeD,eAAeC,KAAM,QAASC"}
@@ -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 <http://www.gnu.org/licenses/>.\n\n/**\n * Tiny Media Manager plugin for Moodle.\n *\n * @module tiny_accessibilitychecker/plugin\n * @copyright 2022, Stevani Andolo <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport {getTinyMCE} from 'editor_tiny/loader';\nimport {getPluginMetadata} from 'editor_tiny/utils';\n\nimport {component, pluginName} from './common';\nimport * as Commands from './commands';\nimport * as Configuration from './configuration';\n\nexport default new Promise(async(resolve) => {\n const [\n tinyMCE,\n setupCommands,\n pluginMetadata,\n ] = await Promise.all([\n getTinyMCE(),\n Commands.getSetup(),\n getPluginMetadata(component, pluginName),\n ]);\n\n tinyMCE.PluginManager.add(`${component}/plugin`, (editor) => {\n // Setup the Commands (buttons, menu items, and so on).\n setupCommands(editor);\n\n return pluginMetadata;\n });\n\n // Resolve the Media Plugin and include configuration.\n resolve([`${component}/plugin`, Configuration]);\n});\n"],"names":["_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","Commands","Configuration","_default","Promise","async","tinyMCE","setupCommands","pluginMetadata","all","getTinyMCE","getSetup","getPluginMetadata","component","pluginName","PluginManager","add","concat","editor","resolve","_exports"],"mappings":"2MA2BiD,SAAAA,yBAAAC,aAAA,GAAA,mBAAAC,QAAA,OAAA,KAAA,IAAAC,kBAAAD,IAAAA,QAAAE,iBAAAF,IAAAA,eAAAF,yBAAA,SAAAC,aAAAA,OAAAA,YAAAG,iBAAAD,oBAAAF,YAAA,CAAA,SAAAI,wBAAAC,IAAAL,aAAAA,IAAAA,aAAAK,KAAAA,IAAAC,WAAAD,OAAAA,IAAAA,GAAAA,OAAAA,KAAAA,iBAAAA,KAAAE,mBAAAF,IAAAE,MAAAA,CAAAA,QAAAF,KAAAG,IAAAA,MAAAT,yBAAAC,aAAA,GAAAQ,OAAAA,MAAAC,IAAAJ,KAAA,OAAAG,MAAAE,IAAAL,KAAA,IAAAM,OAAAC,GAAAA,sBAAAC,OAAAC,gBAAAD,OAAAE,yBAAAC,IAAAA,IAAAA,OAAAX,IAAAW,eAAAA,KAAAH,OAAAI,UAAAC,eAAAC,KAAAd,IAAAW,KAAA,CAAA,IAAAI,KAAAR,sBAAAC,OAAAE,yBAAAV,IAAAW,KAAAI,KAAAA,OAAAA,KAAAV,KAAAU,KAAAC,KAAAR,OAAAC,eAAAH,OAAAK,IAAAI,MAAAT,OAAAK,KAAAX,IAAAW,IAAAL,QAAAA,OAAAJ,QAAAF,IAAAG,OAAAA,MAAAa,IAAAhB,IAAAM,QAAAA,MAAA;;;;;;;qFADjDW,SAAAlB,wBAAAkB,UACAC,cAAAnB,wBAAAmB,eAZA,IAAAC,SAce,IAAIC,SAAQC,gBACvB,MACIC,QACAC,cACAC,sBACMJ,QAAQK,IAAI,EAClB,EAAAC,QAAUA,cACVT,SAASU,YACT,EAAAC,OAAiBA,mBAACC,QAASA,UAAEC,QAAUA,cAG3CR,QAAQS,cAAcC,IAAG,GAAAC,OAAIJ,QAAAA,UAAqBK,YAAAA,SAE9CX,cAAcW,QAEPV,kBAIXW,QAAQ,IAAAF,OAAIJ,kBAAoBX,WAAAA,eAAe,IACjD,OAAAkB,SAAAlC,QAAAiB,SAAAiB,SAAAlC,OAAA"}
{"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 <http://www.gnu.org/licenses/>.\n\n/**\n * Tiny Media Manager plugin for Moodle.\n *\n * @module tiny_accessibilitychecker/plugin\n * @copyright 2022, Stevani Andolo <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport {getTinyMCE} from 'editor_tiny/loader';\nimport {getPluginMetadata} from 'editor_tiny/utils';\n\nimport {component, pluginName} from './common';\nimport * as Commands from './commands';\nimport * as Configuration from './configuration';\n\nexport default new Promise(async(resolve) => {\n const [\n tinyMCE,\n setupCommands,\n pluginMetadata,\n ] = await Promise.all([\n getTinyMCE(),\n Commands.getSetup(),\n getPluginMetadata(component, pluginName),\n ]);\n\n tinyMCE.PluginManager.add(`${component}/plugin`, (editor) => {\n // Setup the Commands (buttons, menu items, and so on).\n setupCommands(editor);\n\n return pluginMetadata;\n });\n\n // Resolve the Media Plugin and include configuration.\n resolve([`${component}/plugin`, Configuration]);\n});\n"],"names":["Promise","async","tinyMCE","setupCommands","pluginMetadata","all","Commands","getSetup","component","pluginName","PluginManager","add","editor","resolve","Configuration"],"mappings":";;;;;;;kMA6Be,IAAIA,SAAQC,MAAAA,gBAEnBC,QACAC,cACAC,sBACMJ,QAAQK,IAAI,EAClB,wBACAC,SAASC,YACT,4BAAkBC,kBAAWC,sBAGjCP,QAAQQ,cAAcC,cAAOH,8BAAqBI,SAE9CT,cAAcS,QAEPR,kBAIXS,QAAQ,WAAIL,6BAAoBM"}
@@ -1 +1 @@
{"version":3,"file":"autosaver.min.js","sources":["../src/autosaver.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 * Storage helper for the Moodle Tiny Autosave plugin.\n *\n * @module tiny_autosave/plugin\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport * as Options from './options';\nimport * as Storage from './storage';\nimport Log from 'core/log';\nimport {getLogSource} from './common';\n\nexport const register = (editor) => {\n const undoHandler = () => {\n if (!editor.undoManager.hasUndo()) {\n Log.debug(`Ignoring undo event as there is no undo history`, getLogSource(editor));\n return;\n }\n Storage.saveDraft(editor);\n };\n\n const visibilityChangedHandler = () => {\n if (document.visibilityState === 'hidden') {\n if (Options.isInitialised(editor)) {\n Storage.saveDraft(editor);\n }\n }\n };\n\n // Attempt to store the draft one final time before the page unloads.\n // Note: This may need to be sent as a beacon instead.\n document.addEventListener('visibilitychange', visibilityChangedHandler);\n\n // When the page is submitted as a form, remove the draft.\n editor.on('submit', () => {\n document.removeEventListener('visibilitychange', visibilityChangedHandler);\n Storage.removeAutosaveSession(editor);\n });\n\n editor.on('init', () => {\n // Setup the Undo handler.\n editor.on('AddUndo', undoHandler);\n\n if (editor.dom.isEmpty(editor.getBody())) {\n Log.info(`Attempting to restore draft`, getLogSource(editor));\n Storage.restoreDraft(editor);\n } else {\n // There was nothing to restore, so we can mark the editor as initialised.\n Log.warn(`Skipping draft restoration. The editor is not empty.`, getLogSource(editor));\n Options.markInitialised(editor);\n }\n });\n};\n"],"names":["obj","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","Options","Storage","_log","_exports","register","editor","undoHandler","undoManager","hasUndo","saveDraft","Log","debug","getLogSource","visibilityChangedHandler","document","visibilityState","isInitialised","addEventListener","on","removeEventListener","removeAutosaveSession","dom","isEmpty","getBody","info","restoreDraft","warn","markInitialised"],"mappings":"4IAyB2B,IAAAA,IAAA,SAAAC,yBAAAC,aAAA,GAAA,mBAAAC,QAAA,OAAA,KAAA,IAAAC,kBAAAD,IAAAA,QAAAE,iBAAAF,IAAAA,eAAAF,yBAAA,SAAAC,aAAAA,OAAAA,YAAAG,iBAAAD,oBAAAF,YAAA,CAAA,SAAAI,wBAAAN,IAAAE,aAAAA,IAAAA,aAAAF,KAAAA,IAAAO,WAAAP,OAAAA,IAAAA,GAAAA,OAAAA,KAAAA,iBAAAA,KAAAQ,mBAAAR,IAAAQ,MAAAA,CAAAA,QAAAR,KAAAS,IAAAA,MAAAR,yBAAAC,aAAA,GAAAO,OAAAA,MAAAC,IAAAV,KAAA,OAAAS,MAAAE,IAAAX,KAAA,IAAAY,OAAAC,GAAAA,sBAAAC,OAAAC,gBAAAD,OAAAE,yBAAAC,IAAAA,IAAAA,OAAAjB,IAAAiB,eAAAA,KAAAH,OAAAI,UAAAC,eAAAC,KAAApB,IAAAiB,KAAA,CAAA,IAAAI,KAAAR,sBAAAC,OAAAE,yBAAAhB,IAAAiB,KAAAI,KAAAA,OAAAA,KAAAV,KAAAU,KAAAC,KAAAR,OAAAC,eAAAH,OAAAK,IAAAI,MAAAT,OAAAK,KAAAjB,IAAAiB,IAAAL,QAAAA,OAAAJ,QAAAR,IAAAS,OAAAA,MAAAa,IAAAtB,IAAAY,QAAAA,MAAA;;;;;;;sFAF3BW,QAAAjB,wBAAAiB,SACAC,QAAAlB,wBAAAkB,SACAC,MAA2BzB,IAA3ByB,OAA2BzB,IAAAO,WAAAP,IAAAQ,CAAAA,QAAAR,KA2CzB0B,SAAAC,SAxCuBC,SACrB,MAAMC,YAAcA,KACXD,OAAOE,YAAYC,UAIxBP,QAAQQ,UAAUJ,QAHdK,KAAGzB,QAAC0B,MAAyD,mDAAA,EAAAC,sBAAaP,QAGrD,EAGvBQ,yBAA2BA,KACI,WAA7BC,SAASC,iBACLf,QAAQgB,cAAcX,SACtBJ,QAAQQ,UAAUJ,OAE1B,EAKJS,SAASG,iBAAiB,mBAAoBJ,0BAG9CR,OAAOa,GAAG,UAAU,KAChBJ,SAASK,oBAAoB,mBAAoBN,0BACjDZ,QAAQmB,sBAAsBf,OAAO,IAGzCA,OAAOa,GAAG,QAAQ,KAEdb,OAAOa,GAAG,UAAWZ,aAEjBD,OAAOgB,IAAIC,QAAQjB,OAAOkB,YAC1Bb,KAAGzB,QAACuC,KAAoC,+BAAA,EAAAZ,sBAAaP,SACrDJ,QAAQwB,aAAapB,UAGrBK,KAAGzB,QAACyC,KAA6D,wDAAA,EAAAd,sBAAaP,SAC9EL,QAAQ2B,gBAAgBtB,QAC5B,GACF,CACJ"}
{"version":3,"file":"autosaver.min.js","sources":["../src/autosaver.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 * Storage helper for the Moodle Tiny Autosave plugin.\n *\n * @module tiny_autosave/plugin\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport * as Options from './options';\nimport * as Storage from './storage';\nimport Log from 'core/log';\nimport {getLogSource} from './common';\n\nexport const register = (editor) => {\n const undoHandler = () => {\n if (!editor.undoManager.hasUndo()) {\n Log.debug(`Ignoring undo event as there is no undo history`, getLogSource(editor));\n return;\n }\n Storage.saveDraft(editor);\n };\n\n const visibilityChangedHandler = () => {\n if (document.visibilityState === 'hidden') {\n if (Options.isInitialised(editor)) {\n Storage.saveDraft(editor);\n }\n }\n };\n\n // Attempt to store the draft one final time before the page unloads.\n // Note: This may need to be sent as a beacon instead.\n document.addEventListener('visibilitychange', visibilityChangedHandler);\n\n // When the page is submitted as a form, remove the draft.\n editor.on('submit', () => {\n document.removeEventListener('visibilitychange', visibilityChangedHandler);\n Storage.removeAutosaveSession(editor);\n });\n\n editor.on('init', () => {\n // Setup the Undo handler.\n editor.on('AddUndo', undoHandler);\n\n if (editor.dom.isEmpty(editor.getBody())) {\n Log.info(`Attempting to restore draft`, getLogSource(editor));\n Storage.restoreDraft(editor);\n } else {\n // There was nothing to restore, so we can mark the editor as initialised.\n Log.warn(`Skipping draft restoration. The editor is not empty.`, getLogSource(editor));\n Options.markInitialised(editor);\n }\n });\n};\n"],"names":["editor","undoHandler","undoManager","hasUndo","Storage","saveDraft","debug","visibilityChangedHandler","document","visibilityState","Options","isInitialised","addEventListener","on","removeEventListener","removeAutosaveSession","dom","isEmpty","getBody","info","restoreDraft","warn","markInitialised"],"mappings":";;;;;;;4OA4ByBA,eACfC,YAAc,KACXD,OAAOE,YAAYC,UAIxBC,QAAQC,UAAUL,qBAHVM,yDAAyD,wBAAaN,UAM5EO,yBAA2B,KACI,WAA7BC,SAASC,iBACLC,QAAQC,cAAcX,SACtBI,QAAQC,UAAUL,SAO9BQ,SAASI,iBAAiB,mBAAoBL,0BAG9CP,OAAOa,GAAG,UAAU,KAChBL,SAASM,oBAAoB,mBAAoBP,0BACjDH,QAAQW,sBAAsBf,WAGlCA,OAAOa,GAAG,QAAQ,KAEdb,OAAOa,GAAG,UAAWZ,aAEjBD,OAAOgB,IAAIC,QAAQjB,OAAOkB,yBACtBC,oCAAoC,wBAAanB,SACrDI,QAAQgB,aAAapB,uBAGjBqB,6DAA6D,wBAAarB,SAC9EU,QAAQY,gBAAgBtB"}
@@ -1 +1 @@
{"version":3,"file":"common.min.js","sources":["../src/common.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 * Tiny Autosave plugin for Moodle.\n *\n * @module tiny_autosave/plugin\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nexport default {\n component: 'tiny_autosave',\n pluginName: 'tiny_autosave/plugin',\n getLogSource: (editor) => `tiny_autosave/${editor.id}`,\n};\n"],"names":["_exports","default","component","pluginName","getLogSource","editor","concat","id"],"mappings":"8IA2BC,OAAAA,SAAAC,QAJc,CACXC,UAAW,gBACXC,WAAY,uBACZC,aAAeC,QAAM,iBAAAC,OAAsBD,OAAOE,KACrDP,SAAAC,OAAA"}
{"version":3,"file":"common.min.js","sources":["../src/common.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 * Tiny Autosave plugin for Moodle.\n *\n * @module tiny_autosave/plugin\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nexport default {\n component: 'tiny_autosave',\n pluginName: 'tiny_autosave/plugin',\n getLogSource: (editor) => `tiny_autosave/${editor.id}`,\n};\n"],"names":["component","pluginName","getLogSource","editor","id"],"mappings":"sKAuBe,CACXA,UAAW,gBACXC,WAAY,uBACZC,aAAeC,gCAA4BA,OAAOC"}
@@ -1 +1 @@
{"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 the Moodle Tiny Autosave plugin.\n *\n * @module tiny_autosave/plugin\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {pluginName} from './common';\nimport {\n getContextId,\n getDraftItemId,\n getPluginOptionName,\n} from 'editor_tiny/options';\nimport {ensureEditorIsValid} from 'editor_tiny/utils';\n\nconst initialisedOptionName = getPluginOptionName(pluginName, 'initialised');\nconst pageHashName = getPluginOptionName(pluginName, 'pagehash');\nconst pageInstanceName = getPluginOptionName(pluginName, 'pageinstance');\nconst backoffTime = getPluginOptionName(pluginName, 'backoffTime');\nconst autosaveHasReset = getPluginOptionName(pluginName, 'autosaveHasReset');\n\nexport const register = (editor) => {\n const registerOption = editor.options.register;\n registerOption(initialisedOptionName, {\n processor: 'boolean',\n \"default\": false,\n });\n\n registerOption(pageHashName, {\n processor: 'string',\n \"default\": '',\n });\n\n registerOption(pageInstanceName, {\n processor: 'string',\n \"default\": '',\n });\n registerOption(pageInstanceName, {\n processor: 'string',\n \"default\": '',\n });\n registerOption(backoffTime, {\n processor: 'number',\n \"default\": 500,\n });\n registerOption(autosaveHasReset, {\n processor: 'boolean',\n \"default\": false,\n });\n};\n\nexport const isInitialised = (editor) => {\n if (!ensureEditorIsValid(editor)) {\n return false;\n }\n\n return editor.options.get(initialisedOptionName);\n};\nexport const markInitialised = (editor) => editor.options.set(initialisedOptionName, true);\nexport const getPageHash = (editor) => editor.options.get(pageHashName);\nexport const getPageInstance = (editor) => editor.options.get(pageInstanceName);\nexport const getBackoffTime = (editor) => editor.options.get(backoffTime);\nexport const setAutosaveHasReset = (editor) => editor.options.set(autosaveHasReset, true);\nexport const hasAutosaveHasReset = (editor) => editor.options.get(autosaveHasReset);\n\nexport {\n getContextId,\n getDraftItemId,\n};\n"],"names":["initialisedOptionName","getPluginOptionName","pluginName","pageHashName","pageInstanceName","backoffTime","autosaveHasReset","_exports","register","editor","registerOption","options","processor","default","isInitialised","ensureEditorIsValid","get","markInitialised","set","getPageHash","getPageInstance","getBackoffTime","setAutosaveHasReset","hasAutosaveHasReset"],"mappings":";;;;;;;;AA+BA,MAAMA,uBAAwB,EAAAC,SAAAA,qBAAoBC,QAAUA,WAAE,eACxDC,cAAe,EAAAF,SAAAA,qBAAoBC,QAAUA,WAAE,YAC/CE,kBAAmB,EAAAH,SAAAA,qBAAoBC,QAAUA,WAAE,gBACnDG,aAAc,EAAAJ,SAAAA,qBAAoBC,QAAUA,WAAE,eAC9CI,kBAAmB,EAAAL,SAAAA,qBAAoBC,QAAUA,WAAE,oBA8BvDK,SAAAC,SA5BuBC,SACrB,MAAMC,eAAiBD,OAAOE,QAAQH,SACtCE,eAAeV,sBAAuB,CAClCY,UAAW,UACXC,SAAW,IAGfH,eAAeP,aAAc,CACzBS,UAAW,SACXC,QAAW,KAGfH,eAAeN,iBAAkB,CAC7BQ,UAAW,SACXC,QAAW,KAEfH,eAAeN,iBAAkB,CAC7BQ,UAAW,SACXC,QAAW,KAEfH,eAAeL,YAAa,CACxBO,UAAW,SACXC,QAAW,MAEfH,eAAeJ,iBAAkB,CAC7BM,UAAW,UACXC,SAAW,GACb,EASJN,SAAAO,cAN4BL,WACrB,EAAAM,OAAAA,qBAAoBN,SAIlBA,OAAOE,QAAQK,IAAIhB,uBAE6DO,SAAAU,gBAA3DR,QAAWA,OAAOE,QAAQO,IAAIlB,uBAAuB,GACbO,SAAAY,YAA5CV,QAAWA,OAAOE,QAAQK,IAAIb,cACsBI,SAAAa,gBAAhDX,QAAWA,OAAOE,QAAQK,IAAIZ,kBACYG,SAAAc,eAA3CZ,QAAWA,OAAOE,QAAQK,IAAIX,aAC6BE,SAAAe,oBAAtDb,QAAWA,OAAOE,QAAQO,IAAIZ,kBAAkB,GACAC,SAAAgB,oBAAhDd,QAAWA,OAAOE,QAAQK,IAAIV,iBAAkB"}
{"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 the Moodle Tiny Autosave plugin.\n *\n * @module tiny_autosave/plugin\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {pluginName} from './common';\nimport {\n getContextId,\n getDraftItemId,\n getPluginOptionName,\n} from 'editor_tiny/options';\nimport {ensureEditorIsValid} from 'editor_tiny/utils';\n\nconst initialisedOptionName = getPluginOptionName(pluginName, 'initialised');\nconst pageHashName = getPluginOptionName(pluginName, 'pagehash');\nconst pageInstanceName = getPluginOptionName(pluginName, 'pageinstance');\nconst backoffTime = getPluginOptionName(pluginName, 'backoffTime');\nconst autosaveHasReset = getPluginOptionName(pluginName, 'autosaveHasReset');\n\nexport const register = (editor) => {\n const registerOption = editor.options.register;\n registerOption(initialisedOptionName, {\n processor: 'boolean',\n \"default\": false,\n });\n\n registerOption(pageHashName, {\n processor: 'string',\n \"default\": '',\n });\n\n registerOption(pageInstanceName, {\n processor: 'string',\n \"default\": '',\n });\n registerOption(pageInstanceName, {\n processor: 'string',\n \"default\": '',\n });\n registerOption(backoffTime, {\n processor: 'number',\n \"default\": 500,\n });\n registerOption(autosaveHasReset, {\n processor: 'boolean',\n \"default\": false,\n });\n};\n\nexport const isInitialised = (editor) => {\n if (!ensureEditorIsValid(editor)) {\n return false;\n }\n\n return editor.options.get(initialisedOptionName);\n};\nexport const markInitialised = (editor) => editor.options.set(initialisedOptionName, true);\nexport const getPageHash = (editor) => editor.options.get(pageHashName);\nexport const getPageInstance = (editor) => editor.options.get(pageInstanceName);\nexport const getBackoffTime = (editor) => editor.options.get(backoffTime);\nexport const setAutosaveHasReset = (editor) => editor.options.set(autosaveHasReset, true);\nexport const hasAutosaveHasReset = (editor) => editor.options.get(autosaveHasReset);\n\nexport {\n getContextId,\n getDraftItemId,\n};\n"],"names":["initialisedOptionName","pluginName","pageHashName","pageInstanceName","backoffTime","autosaveHasReset","editor","registerOption","options","register","processor","get","set"],"mappings":";;;;;;;;MA+BMA,uBAAwB,gCAAoBC,mBAAY,eACxDC,cAAe,gCAAoBD,mBAAY,YAC/CE,kBAAmB,gCAAoBF,mBAAY,gBACnDG,aAAc,gCAAoBH,mBAAY,eAC9CI,kBAAmB,gCAAoBJ,mBAAY,sCAEhCK,eACfC,eAAiBD,OAAOE,QAAQC,SACtCF,eAAeP,sBAAuB,CAClCU,UAAW,mBACA,IAGfH,eAAeL,aAAc,CACzBQ,UAAW,iBACA,KAGfH,eAAeJ,iBAAkB,CAC7BO,UAAW,iBACA,KAEfH,eAAeJ,iBAAkB,CAC7BO,UAAW,iBACA,KAEfH,eAAeH,YAAa,CACxBM,UAAW,iBACA,MAEfH,eAAeF,iBAAkB,CAC7BK,UAAW,mBACA,4BAIWJ,WACrB,8BAAoBA,SAIlBA,OAAOE,QAAQG,IAAIX,gDAEEM,QAAWA,OAAOE,QAAQI,IAAIZ,uBAAuB,wBACzDM,QAAWA,OAAOE,QAAQG,IAAIT,uCAC1BI,QAAWA,OAAOE,QAAQG,IAAIR,0CAC/BG,QAAWA,OAAOE,QAAQG,IAAIP,0CACzBE,QAAWA,OAAOE,QAAQI,IAAIP,kBAAkB,gCAChDC,QAAWA,OAAOE,QAAQG,IAAIN"}
@@ -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 <http://www.gnu.org/licenses/>.\n\n/**\n * Tiny Autosave plugin for Moodle.\n *\n * @module tiny_autosave/plugin\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport {getTinyMCE} from 'editor_tiny/loader';\nimport {getPluginMetadata} from 'editor_tiny/utils';\n\nimport {component, pluginName} from './common';\nimport * as Options from './options';\nimport * as Autosaver from './autosaver';\n\n// Setup the autosave Plugin.\nexport default new Promise(async(resolve) => {\n const [tinyMCE, pluginMetadata] = await Promise.all([\n getTinyMCE(),\n getPluginMetadata(component, pluginName),\n ]);\n\n // Note: The PluginManager.add function does not accept a Promise.\n // Any asynchronous code must be run before this point.\n tinyMCE.PluginManager.add(pluginName, (editor) => {\n // Register options.\n Options.register(editor);\n\n // Register the Autosaver.\n Autosaver.register(editor);\n\n return pluginMetadata;\n });\n\n resolve(pluginName);\n});\n"],"names":["_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","Options","Autosaver","_default","Promise","async","tinyMCE","pluginMetadata","all","getTinyMCE","getPluginMetadata","component","pluginName","PluginManager","add","editor","register","resolve","_exports"],"mappings":"qLA2ByC,SAAAA,yBAAAC,aAAA,GAAA,mBAAAC,QAAA,OAAA,KAAA,IAAAC,kBAAAD,IAAAA,QAAAE,iBAAAF,IAAAA,eAAAF,yBAAA,SAAAC,aAAAA,OAAAA,YAAAG,iBAAAD,oBAAAF,YAAA,CAAA,SAAAI,wBAAAC,IAAAL,aAAAA,IAAAA,aAAAK,KAAAA,IAAAC,WAAAD,OAAAA,IAAAA,GAAAA,OAAAA,KAAAA,iBAAAA,KAAAE,mBAAAF,IAAAE,MAAAA,CAAAA,QAAAF,KAAAG,IAAAA,MAAAT,yBAAAC,aAAA,GAAAQ,OAAAA,MAAAC,IAAAJ,KAAA,OAAAG,MAAAE,IAAAL,KAAA,IAAAM,OAAAC,GAAAA,sBAAAC,OAAAC,gBAAAD,OAAAE,yBAAAC,IAAAA,IAAAA,OAAAX,IAAAW,eAAAA,KAAAH,OAAAI,UAAAC,eAAAC,KAAAd,IAAAW,KAAA,CAAA,IAAAI,KAAAR,sBAAAC,OAAAE,yBAAAV,IAAAW,KAAAI,KAAAA,OAAAA,KAAAV,KAAAU,KAAAC,KAAAR,OAAAC,eAAAH,OAAAK,IAAAI,MAAAT,OAAAK,KAAAX,IAAAW,IAAAL,QAAAA,OAAAJ,QAAAF,IAAAG,OAAAA,MAAAa,IAAAhB,IAAAM,QAAAA,MAAA;;;;;;;qFADzCW,QAAAlB,wBAAAkB,SACAC,UAAAnB,wBAAAmB,WAZA,IAAAC,SAee,IAAIC,SAAQC,gBACvB,MAAOC,QAASC,sBAAwBH,QAAQI,IAAI,EAChD,EAAAC,QAAUA,eACV,EAAAC,OAAiBA,mBAACC,kBAAWC,QAAAA,cAKjCN,QAAQO,cAAcC,IAAIF,QAAUA,YAAGG,SAEnCd,QAAQe,SAASD,QAGjBb,UAAUc,SAASD,QAEZR,kBAGXU,QAAQL,mBAAW,IACrB,OAAAM,SAAAhC,QAAAiB,SAAAe,SAAAhC,OAAA"}
{"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 <http://www.gnu.org/licenses/>.\n\n/**\n * Tiny Autosave plugin for Moodle.\n *\n * @module tiny_autosave/plugin\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport {getTinyMCE} from 'editor_tiny/loader';\nimport {getPluginMetadata} from 'editor_tiny/utils';\n\nimport {component, pluginName} from './common';\nimport * as Options from './options';\nimport * as Autosaver from './autosaver';\n\n// Setup the autosave Plugin.\nexport default new Promise(async(resolve) => {\n const [tinyMCE, pluginMetadata] = await Promise.all([\n getTinyMCE(),\n getPluginMetadata(component, pluginName),\n ]);\n\n // Note: The PluginManager.add function does not accept a Promise.\n // Any asynchronous code must be run before this point.\n tinyMCE.PluginManager.add(pluginName, (editor) => {\n // Register options.\n Options.register(editor);\n\n // Register the Autosaver.\n Autosaver.register(editor);\n\n return pluginMetadata;\n });\n\n resolve(pluginName);\n});\n"],"names":["Promise","async","tinyMCE","pluginMetadata","all","component","pluginName","PluginManager","add","editor","Options","register","Autosaver","resolve"],"mappings":";;;;;;;wLA8Be,IAAIA,SAAQC,MAAAA,gBAChBC,QAASC,sBAAwBH,QAAQI,IAAI,EAChD,yBACA,4BAAkBC,kBAAWC,sBAKjCJ,QAAQK,cAAcC,IAAIF,oBAAaG,SAEnCC,QAAQC,SAASF,QAGjBG,UAAUD,SAASF,QAEZN,kBAGXU,QAAQP"}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -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('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":["_exports","getSetup","async","buttonText","buttonImage","Promise","all","getString","component","getButtonImage","editor","isTexFilterActive","ui","registry","addIcon","icon","html","addToggleButton","buttonName","tooltip","onAction","handleAction","onSetup","api","on","result","getSelectedEquation","setActive","addMenuItem","text"],"mappings":"sTAqEEA,SAAAC,SAvCsBC,UACpB,MACIC,WACAC,mBACMC,QAAQC,IAAI,EAClB,EAAAC,KAAAA,YAAU,cAAeC,QAAAA,YACzB,EAAAC,OAAAA,gBAAe,OAAQD,QAAAA,aAG3B,OAAQE,UACA,EAAAC,SAAAA,mBAAkBD,UAElBA,OAAOE,GAAGC,SAASC,QAAQC,QAAAA,KAAMX,YAAYY,MAI7CN,OAAOE,GAAGC,SAASI,gBAAgBC,mBAAY,CAC3CH,KAAAA,QAAIA,KACJI,QAAShB,WACTiB,SAAUA,MACN,EAAAC,IAAAA,cAAaX,OAAO,EAExBY,QAAUC,MACNb,OAAOc,GAAG,cAAc,KACpB,MAAMC,QAAS,EAAAC,UAAmBA,qBAAChB,QACnCa,IAAII,UAAUF,OAAO,GACvB,IAMVf,OAAOE,GAAGC,SAASe,YAAYV,mBAAY,CACvCH,KAAAA,QAAIA,KACJc,KAAM1B,WACNiB,SAAUA,KAAM,EAAAC,IAAAA,cAAaX,UAErC,CACH,CACH"}
{"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"}
@@ -1 +1 @@
{"version":3,"file":"common.min.js","sources":["../src/common.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 * Tiny Equation common values.\n *\n * @module tiny_equation/common\n * @copyright 2022 Huong Nguyen <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nexport default {\n pluginName: 'tiny_equation/plugin',\n component: 'tiny_equation',\n buttonName: 'tiny_equation',\n icon: 'tiny_equation',\n};\n"],"names":["_exports","default","pluginName","component","buttonName","icon"],"mappings":"8IA4BC,OAAAA,SAAAC,QALc,CACXC,WAAY,uBACZC,UAAW,gBACXC,WAAY,gBACZC,KAAM,iBACTL,SAAAC,OAAA"}
{"version":3,"file":"common.min.js","sources":["../src/common.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 * Tiny Equation common values.\n *\n * @module tiny_equation/common\n * @copyright 2022 Huong Nguyen <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nexport default {\n pluginName: 'tiny_equation/plugin',\n component: 'tiny_equation',\n buttonName: 'tiny_equation',\n icon: 'tiny_equation',\n};\n"],"names":["pluginName","component","buttonName","icon"],"mappings":"sKAuBe,CACXA,WAAY,uBACZC,UAAW,gBACXC,WAAY,gBACZC,KAAM"}
@@ -1 +1 @@
{"version":3,"file":"configuration.min.js","sources":["../src/configuration.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 * Tiny Equation configuration.\n *\n * @module tiny_equation/configuration\n * @copyright 2022 Huong Nguyen <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {component as buttonName} from 'tiny_equation/common';\nimport {\n addMenubarItem,\n addToolbarButton,\n addToolbarSection,\n} from 'editor_tiny/utils';\n\nconst configureToolbar = (toolbar) => {\n addToolbarSection(toolbar, 'advanced', 'lists', true);\n return addToolbarButton(toolbar, 'advanced', buttonName);\n};\n\nexport const configure = (instanceConfig) => {\n // Update the instance configuration to add the Equation menu option to the menus and toolbars.\n return {\n menu: addMenubarItem(instanceConfig.menu, 'insert', buttonName),\n toolbar: configureToolbar(instanceConfig.toolbar),\n };\n};\n"],"names":["_exports","configure","instanceConfig","menu","addMenubarItem","buttonName","toolbar","addToolbarSection","addToolbarButton"],"mappings":"iNAyCEA,SAAAC,UANwBC,iBAEtB,MAAO,CACHC,MAAM,EAAAC,OAAAA,gBAAeF,eAAeC,KAAM,SAAUE,QAAAA,WACpDC,SATkBA,QASQJ,eAAeI,SAR7C,EAAAC,OAAAA,mBAAkBD,QAAS,WAAY,SAAS,IACzC,EAAAE,yBAAiBF,QAAS,WAAYD,qBAFvBC,WAUrB,CACH"}
{"version":3,"file":"configuration.min.js","sources":["../src/configuration.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 * Tiny Equation configuration.\n *\n * @module tiny_equation/configuration\n * @copyright 2022 Huong Nguyen <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {component as buttonName} from 'tiny_equation/common';\nimport {\n addMenubarItem,\n addToolbarButton,\n addToolbarSection,\n} from 'editor_tiny/utils';\n\nconst configureToolbar = (toolbar) => {\n addToolbarSection(toolbar, 'advanced', 'lists', true);\n return addToolbarButton(toolbar, 'advanced', buttonName);\n};\n\nexport const configure = (instanceConfig) => {\n // Update the instance configuration to add the Equation menu option to the menus and toolbars.\n return {\n menu: addMenubarItem(instanceConfig.menu, 'insert', buttonName),\n toolbar: configureToolbar(instanceConfig.toolbar),\n };\n};\n"],"names":["instanceConfig","menu","buttonName","toolbar"],"mappings":"oOAmC0BA,uBAEf,CACHC,MAAM,yBAAeD,eAAeC,KAAM,SAAUC,mBACpDC,SATkBA,QASQH,eAAeG,qCAR3BA,QAAS,WAAY,SAAS,IACzC,2BAAiBA,QAAS,WAAYD,qBAFvBC,IAAAA"}
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,3 +1,3 @@
define("tiny_equation/modal",["exports","core/modal","core/modal_registry"],(function(_exports,_modal,_modal_registry){var _class;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return(key=function(arg){var key=function(input,hint){if("object"!=typeof input||null===input)return input;var prim=input[Symbol.toPrimitive];if(void 0!==prim){var res=prim.call(input,hint||"default");if("object"!=typeof res)return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}(arg,"string");return"symbol"==typeof key?key:String(key)}(key))in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_modal=_interopRequireDefault(_modal),_modal_registry=_interopRequireDefault(_modal_registry);const EquationModal=(_defineProperty(_class=class extends _modal.default{registerEventListeners(){super.registerEventListeners(),this.registerCloseOnSave(),this.registerCloseOnCancel()}},"TYPE","tiny_equation/modal"),_defineProperty(_class,"TEMPLATE","tiny_equation/modal"),_class);_modal_registry.default.register(EquationModal.TYPE,EquationModal,EquationModal.TEMPLATE);var _default=EquationModal;return _exports.default=_default,_exports.default}));
define("tiny_equation/modal",["exports","core/modal","core/modal_registry"],(function(_exports,_modal,_modal_registry){var _class;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_modal=_interopRequireDefault(_modal),_modal_registry=_interopRequireDefault(_modal_registry);const EquationModal=(_defineProperty(_class=class extends _modal.default{registerEventListeners(){super.registerEventListeners(),this.registerCloseOnSave(),this.registerCloseOnCancel()}},"TYPE","tiny_equation/modal"),_defineProperty(_class,"TEMPLATE","tiny_equation/modal"),_class);_modal_registry.default.register(EquationModal.TYPE,EquationModal,EquationModal.TEMPLATE);var _default=EquationModal;return _exports.default=_default,_exports.default}));
//# sourceMappingURL=modal.min.js.map
@@ -1 +1 @@
{"version":3,"file":"modal.min.js","sources":["../src/modal.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 * Equation Modal for Tiny.\n *\n * @module tiny_equation/modal\n * @copyright 2022 Huong Nguyen <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Modal from 'core/modal';\nimport ModalRegistry from 'core/modal_registry';\n\nconst EquationModal = class extends Modal {\n static TYPE = 'tiny_equation/modal';\n static TEMPLATE = 'tiny_equation/modal';\n\n registerEventListeners() {\n // Call the parent registration.\n super.registerEventListeners();\n\n // Register to close on save/cancel.\n this.registerCloseOnSave();\n this.registerCloseOnCancel();\n }\n};\n\nModalRegistry.register(EquationModal.TYPE, EquationModal, EquationModal.TEMPLATE);\n\nexport default EquationModal;\n"],"names":["_class","_interopRequireDefault","obj","__esModule","default","_defineProperty","key","value","arg","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","String","Number","_toPrimitive","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","_modal","_modal_registry","EquationModal","Modal","registerEventListeners","super","this","registerCloseOnSave","registerCloseOnCancel","ModalRegistry","register","TYPE","TEMPLATE","_default","_exports"],"mappings":"uHAwBgD,IAAAA,OAAA,SAAAC,uBAAAC,KAAAA,OAAAA,KAAAA,IAAAC,WAAAD,IAAAE,CAAAA,QAAAF,IAAA,CAAA,SAAAG,gBAAAH,IAAAI,IAAAC,cAAAD,IAAA,SAAAE,KAAAF,IAAAA,IAAA,SAAAG,MAAAC,SAAA,iBAAAD,OAAAA,OAAAA,MAAAA,OAAAA,UAAAE,KAAAF,MAAAG,OAAAC,aAAA,QAAAC,IAAAH,UAAAI,IAAAJ,KAAAK,KAAAP,MAAAC,MAAAK,WAAAA,oBAAAA,WAAAA,IAAA,MAAA,IAAAE,UAAAP,+CAAAA,CAAAA,kBAAAA,KAAAQ,OAAAC,QAAAV,MAAA,CAAAW,CAAAZ,IAAA,UAAA,MAAAF,iBAAAA,IAAAA,IAAAY,OAAAZ,IAAA,CAAAe,CAAAf,QAAAJ,IAAAoB,OAAAC,eAAArB,IAAAI,IAAA,CAAAC,MAAAA,MAAAiB,YAAA,EAAAC,cAAAC,EAAAA,cAAAxB,IAAAI,KAAAC,MAAAL,GAAA,iFADhDyB,OAAA1B,uBAAA0B,QACAC,gBAAA3B,uBAAA2B,iBAEA,MAAMC,eAYLxB,gBAZkBL,OAAG,cAAc8B,eAIhCC,yBAEIC,MAAMD,yBAGNE,KAAKC,sBACLD,KAAKE,uBACT,UAVc,uBAAqB9B,gBAAAL,OAAA,WACjB,uBAAqBA,QAY3CoC,gBAAAA,QAAcC,SAASR,cAAcS,KAAMT,cAAeA,cAAcU,UAAU,IAAAC,SAEnEX,cAAa,OAAAY,SAAArC,QAAAoC,SAAAC,SAAArC,OAAA"}
{"version":3,"file":"modal.min.js","sources":["../src/modal.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 * Equation Modal for Tiny.\n *\n * @module tiny_equation/modal\n * @copyright 2022 Huong Nguyen <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Modal from 'core/modal';\nimport ModalRegistry from 'core/modal_registry';\n\nconst EquationModal = class extends Modal {\n static TYPE = 'tiny_equation/modal';\n static TEMPLATE = 'tiny_equation/modal';\n\n registerEventListeners() {\n // Call the parent registration.\n super.registerEventListeners();\n\n // Register to close on save/cancel.\n this.registerCloseOnSave();\n this.registerCloseOnCancel();\n }\n};\n\nModalRegistry.register(EquationModal.TYPE, EquationModal, EquationModal.TEMPLATE);\n\nexport default EquationModal;\n"],"names":["EquationModal","Modal","registerEventListeners","registerCloseOnSave","registerCloseOnCancel","register","TYPE","TEMPLATE"],"mappings":"4iBA0BMA,sCAAgB,cAAcC,eAIhCC,+BAEUA,8BAGDC,2BACAC,iCATK,yDACI,uDAYRC,SAASL,cAAcM,KAAMN,cAAeA,cAAcO,uBAEzDP"}
@@ -1 +1 @@
{"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 <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {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 libraries 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","getPluginOptionName","pluginName","texFilterName","contextIdName","texDocsUrlName","_exports","register","editor","registerOption","options","processor","default","getLibraries","get","isTexFilterActive","getContextId","getTexDocsUrl"],"mappings":";;;;;;;;AA0BA,MAAMA,eAAgB,EAAAC,SAAAA,qBAAoBC,QAAUA,WAAE,aAChDC,eAAgB,EAAAF,SAAAA,qBAAoBC,QAAUA,WAAE,aAChDE,eAAgB,EAAAH,SAAAA,qBAAoBC,QAAUA,WAAE,aAChDG,gBAAiB,EAAAJ,SAAAA,qBAAoBC,QAAUA,WAAE,cA6BrDI,SAAAC,SAtBuBC,SACrB,MAAMC,eAAiBD,OAAOE,QAAQH,SAEtCE,eAAeT,cAAe,CAC1BW,UAAW,QACXC,QAAW,KAGfH,eAAeN,cAAe,CAC1BQ,UAAW,UACXC,SAAW,IAGfH,eAAeL,cAAe,CAC1BO,UAAW,SACXC,QAAW,IAGfH,eAAeJ,eAAgB,CAC3BM,UAAW,SACXC,QAAW,IACb,EASoEN,SAAAO,aAA7CL,QAAWA,OAAOE,QAAQI,IAAId,eAOoBM,SAAAS,kBAA7CP,QAAWA,OAAOE,QAAQI,IAAIX,eAOUG,SAAAU,aAA7CR,QAAWA,OAAOE,QAAQI,IAAIV,eAOiBE,SAAAW,cAA9CT,QAAWA,OAAOE,QAAQI,IAAIT,eAAgB"}
{"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 <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {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 libraries 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"}
@@ -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 <http://www.gnu.org/licenses/>.\n\n/**\n * Tiny Equation plugin for Moodle.\n *\n * @module tiny_equation/plugin\n * @copyright 2022 Huong Nguyen <[email protected]>\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 'tiny_equation/common';\nimport * as Commands from 'tiny_equation/commands';\nimport * as Configuration from 'tiny_equation/configuration';\nimport * as Options from 'tiny_equation/options';\n\nexport default new Promise(async(resolve) => {\n const [\n tinyMCE,\n setupCommands,\n pluginMetadata,\n ] = await Promise.all([\n getTinyMCE(),\n Commands.getSetup(),\n getPluginMetadata(component, pluginName),\n ]);\n\n tinyMCE.PluginManager.add(`${component}/plugin`, (editor) => {\n // Register options.\n Options.register(editor);\n\n // Setup the Commands (buttons, menu items, and so on).\n setupCommands(editor);\n\n return pluginMetadata;\n });\n\n // Resolve the Equation Plugin and include configuration.\n resolve([`${component}/plugin`, Configuration]);\n});\n"],"names":["_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","Commands","Configuration","Options","_default","Promise","async","tinyMCE","setupCommands","pluginMetadata","all","getTinyMCE","getSetup","getPluginMetadata","component","pluginName","PluginManager","add","concat","editor","register","resolve","_exports"],"mappings":"mQA6BiD,SAAAA,yBAAAC,aAAA,GAAA,mBAAAC,QAAA,OAAA,KAAA,IAAAC,kBAAAD,IAAAA,QAAAE,iBAAAF,IAAAA,eAAAF,yBAAA,SAAAC,aAAAA,OAAAA,YAAAG,iBAAAD,oBAAAF,YAAA,CAAA,SAAAI,wBAAAC,IAAAL,aAAAA,IAAAA,aAAAK,KAAAA,IAAAC,WAAAD,OAAAA,IAAAA,GAAAA,OAAAA,KAAAA,iBAAAA,KAAAE,mBAAAF,IAAAE,MAAAA,CAAAA,QAAAF,KAAAG,IAAAA,MAAAT,yBAAAC,aAAA,GAAAQ,OAAAA,MAAAC,IAAAJ,KAAA,OAAAG,MAAAE,IAAAL,KAAA,IAAAM,OAAAC,GAAAA,sBAAAC,OAAAC,gBAAAD,OAAAE,yBAAAC,IAAAA,IAAAA,OAAAX,IAAAW,eAAAA,KAAAH,OAAAI,UAAAC,eAAAC,KAAAd,IAAAW,KAAA,CAAA,IAAAI,KAAAR,sBAAAC,OAAAE,yBAAAV,IAAAW,KAAAI,KAAAA,OAAAA,KAAAV,KAAAU,KAAAC,KAAAR,OAAAC,eAAAH,OAAAK,IAAAI,MAAAT,OAAAK,KAAAX,IAAAW,IAAAL,QAAAA,OAAAJ,QAAAF,IAAAG,OAAAA,MAAAa,IAAAhB,IAAAM,QAAAA,MAAA;;;;;;;qFAFjDW,SAAAlB,wBAAAkB,UACAC,cAAAnB,wBAAAmB,eACAC,QAAApB,wBAAAoB,SAdA,IAAAC,SAgBe,IAAIC,SAAQC,gBACvB,MACIC,QACAC,cACAC,sBACMJ,QAAQK,IAAI,EAClB,EAAAC,QAAUA,cACVV,SAASW,YACT,EAAAC,OAAiBA,mBAACC,QAASA,UAAEC,QAAUA,cAG3CR,QAAQS,cAAcC,IAAG,GAAAC,OAAIJ,QAAAA,UAAqBK,YAAAA,SAE9ChB,QAAQiB,SAASD,QAGjBX,cAAcW,QAEPV,kBAIXY,QAAQ,IAAAH,OAAIJ,kBAAoBZ,WAAAA,eAAe,IACjD,OAAAoB,SAAApC,QAAAkB,SAAAkB,SAAApC,OAAA"}
{"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 <http://www.gnu.org/licenses/>.\n\n/**\n * Tiny Equation plugin for Moodle.\n *\n * @module tiny_equation/plugin\n * @copyright 2022 Huong Nguyen <[email protected]>\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 'tiny_equation/common';\nimport * as Commands from 'tiny_equation/commands';\nimport * as Configuration from 'tiny_equation/configuration';\nimport * as Options from 'tiny_equation/options';\n\nexport default new Promise(async(resolve) => {\n const [\n tinyMCE,\n setupCommands,\n pluginMetadata,\n ] = await Promise.all([\n getTinyMCE(),\n Commands.getSetup(),\n getPluginMetadata(component, pluginName),\n ]);\n\n tinyMCE.PluginManager.add(`${component}/plugin`, (editor) => {\n // Register options.\n Options.register(editor);\n\n // Setup the Commands (buttons, menu items, and so on).\n setupCommands(editor);\n\n return pluginMetadata;\n });\n\n // Resolve the Equation Plugin and include configuration.\n resolve([`${component}/plugin`, Configuration]);\n});\n"],"names":["Promise","async","tinyMCE","setupCommands","pluginMetadata","all","Commands","getSetup","component","pluginName","PluginManager","add","editor","Options","register","resolve","Configuration"],"mappings":";;;;;;;2OA+Be,IAAIA,SAAQC,MAAAA,gBAEnBC,QACAC,cACAC,sBACMJ,QAAQK,IAAI,EAClB,wBACAC,SAASC,YACT,4BAAkBC,kBAAWC,sBAGjCP,QAAQQ,cAAcC,cAAOH,8BAAqBI,SAE9CC,QAAQC,SAASF,QAGjBT,cAAcS,QAEPR,kBAIXW,QAAQ,WAAIP,6BAAoBQ"}
@@ -1 +1 @@
{"version":3,"file":"repository.min.js","sources":["../src/repository.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 * A javascript module to handle TinyMCE Equation ajax actions.\n *\n * @module tiny_equation/repository\n * @copyright 2022 Huong Nguyen <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport Ajax from 'core/ajax';\n\n/**\n * Filter the equation for given content.\n *\n * @param {Number} contextId The context id\n * @param {String} content Content to filter\n * @return {promise}\n */\nexport const filterEquation = (contextId, content) => {\n const request = {\n methodname: 'tiny_equation_filter',\n args: {\n contextid: contextId,\n content: content,\n }\n };\n\n return Ajax.call([request])[0];\n};\n"],"names":["obj","_ajax","__esModule","default","_exports","filterEquation","contextId","content","request","methodname","args","contextid","Ajax","call"],"mappings":"oFAsB6B,IAAAA;;;;;;;4FAA7BC,OAA6BD,IAA7BC,QAA6BD,IAAAE,WAAAF,IAAAG,CAAAA,QAAAH,KAmB3BI,SAAAC,eAV4BA,CAACC,UAAWC,WACtC,MAAMC,QAAU,CACZC,WAAY,uBACZC,KAAM,CACFC,UAAWL,UACXC,QAASA,UAIjB,OAAOK,MAAAA,QAAKC,KAAK,CAACL,UAAU,EAAE,CAChC"}
{"version":3,"file":"repository.min.js","sources":["../src/repository.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 * A javascript module to handle TinyMCE Equation ajax actions.\n *\n * @module tiny_equation/repository\n * @copyright 2022 Huong Nguyen <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport Ajax from 'core/ajax';\n\n/**\n * Filter the equation for given content.\n *\n * @param {Number} contextId The context id\n * @param {String} content Content to filter\n * @return {promise}\n */\nexport const filterEquation = (contextId, content) => {\n const request = {\n methodname: 'tiny_equation_filter',\n args: {\n contextid: contextId,\n content: content,\n }\n };\n\n return Ajax.call([request])[0];\n};\n"],"names":["contextId","content","request","methodname","args","contextid","Ajax","call"],"mappings":";;;;;;;wKA+B8B,CAACA,UAAWC,iBAChCC,QAAU,CACZC,WAAY,uBACZC,KAAM,CACFC,UAAWL,UACXC,QAASA,iBAIVK,cAAKC,KAAK,CAACL,UAAU"}
@@ -1 +1 @@
{"version":3,"file":"selectors.min.js","sources":["../src/selectors.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 * Tiny Equation plugin helper function to build queryable data selectors.\n *\n * @module tiny_equation/selectors\n * @copyright 2022 Huong Nguyen <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nexport default {\n equationPatterns: [\n // We use space or not space because . does not match new lines.\n // $$ blah $$.\n /\\$\\$([\\S\\s]+?)\\$\\$/,\n // E.g. \"\\( blah \\)\".\n /\\\\\\(([\\S\\s]+?)\\\\\\)/,\n // E.g. \"\\[ blah \\]\".\n /\\\\\\[([\\S\\s]+?)\\\\\\]/,\n // E.g. \"[tex] blah [/tex]\".\n /\\[tex\\]([\\S\\s]+?)\\[\\/tex\\]/\n ],\n delimiters: {\n start: '\\\\(',\n end: '\\\\)'\n },\n cursorLatex: '\\\\Downarrow ',\n actions: {\n submit: '[data-action=\"save\"]'\n },\n elements: {\n form: 'form',\n library: '.tiny_equation_library',\n libraryItem: '.tiny_equation_library button',\n equationTextArea: '.tiny_equation_equation',\n preview: '.tiny_equation_preview',\n }\n};\n"],"names":["_exports","default","equationPatterns","delimiters","start","end","cursorLatex","actions","submit","elements","form","library","libraryItem","equationTextArea","preview"],"mappings":"iJAkDC,OAAAA,SAAAC,QA3Bc,CACXC,iBAAkB,CAGd,qBAEA,qBAEA,qBAEA,8BAEJC,WAAY,CACRC,MAAO,MACPC,IAAK,OAETC,YAAa,eACbC,QAAS,CACLC,OAAQ,wBAEZC,SAAU,CACNC,KAAM,OACNC,QAAS,yBACTC,YAAa,gCACbC,iBAAkB,0BAClBC,QAAS,2BAEhBd,SAAAC,OAAA"}
{"version":3,"file":"selectors.min.js","sources":["../src/selectors.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 * Tiny Equation plugin helper function to build queryable data selectors.\n *\n * @module tiny_equation/selectors\n * @copyright 2022 Huong Nguyen <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nexport default {\n equationPatterns: [\n // We use space or not space because . does not match new lines.\n // $$ blah $$.\n /\\$\\$([\\S\\s]+?)\\$\\$/,\n // E.g. \"\\( blah \\)\".\n /\\\\\\(([\\S\\s]+?)\\\\\\)/,\n // E.g. \"\\[ blah \\]\".\n /\\\\\\[([\\S\\s]+?)\\\\\\]/,\n // E.g. \"[tex] blah [/tex]\".\n /\\[tex\\]([\\S\\s]+?)\\[\\/tex\\]/\n ],\n delimiters: {\n start: '\\\\(',\n end: '\\\\)'\n },\n cursorLatex: '\\\\Downarrow ',\n actions: {\n submit: '[data-action=\"save\"]'\n },\n elements: {\n form: 'form',\n library: '.tiny_equation_library',\n libraryItem: '.tiny_equation_library button',\n equationTextArea: '.tiny_equation_equation',\n preview: '.tiny_equation_preview',\n }\n};\n"],"names":["equationPatterns","delimiters","start","end","cursorLatex","actions","submit","elements","form","library","libraryItem","equationTextArea","preview"],"mappings":"yKAuBe,CACXA,iBAAkB,CAGd,qBAEA,qBAEA,qBAEA,8BAEJC,WAAY,CACRC,MAAO,MACPC,IAAK,OAETC,YAAa,eACbC,QAAS,CACLC,OAAQ,wBAEZC,SAAU,CACNC,KAAM,OACNC,QAAS,yBACTC,YAAa,gCACbC,iBAAkB,0BAClBC,QAAS"}
File diff suppressed because one or more lines are too long
@@ -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\n/**\n * Tiny H5P Content configuration.\n *\n * @module tiny_h5p/commands\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {getButtonImage} from 'editor_tiny/utils';\nimport {handleAction} from './ui';\nimport {get_string as getString} from 'core/str';\nimport {\n component,\n buttonName,\n icon,\n} from './common';\nimport {hasAnyH5PPermission} from './options';\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 (!hasAnyH5PPermission(editor)) {\n return;\n }\n // Register the H5P 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 H5P element it will show as toggled on.\n editor.ui.registry.addToggleButton(buttonName, {\n icon,\n tooltip: buttonText,\n onAction: () => handleAction(editor),\n onSetup: (api) => {\n // Set the button to be active if the current selection matches the h5p formatter registered above during PreInit.\n api.setActive(editor.formatter.match('h5p'));\n const changed = editor.formatter.formatChanged('h5p', (state) => api.setActive(state));\n return () => changed.unbind();\n },\n });\n\n // Add the H5P 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"],"names":["_exports","getSetup","async","buttonText","buttonImage","Promise","all","getString","component","getButtonImage","editor","hasAnyH5PPermission","ui","registry","addIcon","icon","html","addToggleButton","buttonName","tooltip","onAction","handleAction","onSetup","api","setActive","formatter","match","changed","formatChanged","state","unbind","addMenuItem","text"],"mappings":"0OAuEEA,SAAAC,SAtCsBC,UACpB,MACIC,WACAC,mBACMC,QAAQC,IAAI,EAClB,EAAAC,KAAAA,YAAU,cAAeC,QAAAA,YACzB,EAAAC,OAAAA,gBAAe,OAAQD,QAAAA,aAG3B,OAAQE,UACC,EAAAC,SAAAA,qBAAoBD,UAIzBA,OAAOE,GAAGC,SAASC,QAAQC,QAAAA,KAAMX,YAAYY,MAI7CN,OAAOE,GAAGC,SAASI,gBAAgBC,mBAAY,CAC3CH,KAAAA,QAAIA,KACJI,QAAShB,WACTiB,SAAUA,KAAM,EAAAC,IAAYA,cAACX,QAC7BY,QAAUC,MAENA,IAAIC,UAAUd,OAAOe,UAAUC,MAAM,QACrC,MAAMC,QAAUjB,OAAOe,UAAUG,cAAc,OAAQC,OAAUN,IAAIC,UAAUK,SAC/E,MAAO,IAAMF,QAAQG,QAAQ,IAMrCpB,OAAOE,GAAGC,SAASkB,YAAYb,mBAAY,CACvCH,KAAAA,QAAIA,KACJiB,KAAM7B,WACNiB,SAAUA,KAAM,EAAAC,IAAAA,cAAaX,UAC/B,CACL,CACH"}
{"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\n/**\n * Tiny H5P Content configuration.\n *\n * @module tiny_h5p/commands\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {getButtonImage} from 'editor_tiny/utils';\nimport {handleAction} from './ui';\nimport {get_string as getString} from 'core/str';\nimport {\n component,\n buttonName,\n icon,\n} from './common';\nimport {hasAnyH5PPermission} from './options';\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 (!hasAnyH5PPermission(editor)) {\n return;\n }\n // Register the H5P 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 H5P element it will show as toggled on.\n editor.ui.registry.addToggleButton(buttonName, {\n icon,\n tooltip: buttonText,\n onAction: () => handleAction(editor),\n onSetup: (api) => {\n // Set the button to be active if the current selection matches the h5p formatter registered above during PreInit.\n api.setActive(editor.formatter.match('h5p'));\n const changed = editor.formatter.formatChanged('h5p', (state) => api.setActive(state));\n return () => changed.unbind();\n },\n });\n\n // Add the H5P 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"],"names":["async","buttonText","buttonImage","Promise","all","component","editor","ui","registry","addIcon","icon","html","addToggleButton","buttonName","tooltip","onAction","onSetup","api","setActive","formatter","match","changed","formatChanged","state","unbind","addMenuItem","text"],"mappings":"4PAiCwBA,gBAEhBC,WACAC,mBACMC,QAAQC,IAAI,EAClB,mBAAU,cAAeC,oBACzB,yBAAe,OAAQA,4BAGnBC,UACC,gCAAoBA,UAIzBA,OAAOC,GAAGC,SAASC,QAAQC,aAAMR,YAAYS,MAI7CL,OAAOC,GAAGC,SAASI,gBAAgBC,mBAAY,CAC3CH,KAAAA,aACAI,QAASb,WACTc,SAAU,KAAM,oBAAaT,QAC7BU,QAAUC,MAENA,IAAIC,UAAUZ,OAAOa,UAAUC,MAAM,cAC/BC,QAAUf,OAAOa,UAAUG,cAAc,OAAQC,OAAUN,IAAIC,UAAUK,eACxE,IAAMF,QAAQG,YAM7BlB,OAAOC,GAAGC,SAASiB,YAAYZ,mBAAY,CACvCH,KAAAA,aACAgB,KAAMzB,WACNc,SAAU,KAAM,oBAAaT"}
@@ -1 +1 @@
{"version":3,"file":"common.min.js","sources":["../src/common.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 * Tiny H5P Common values.\n *\n * @module tiny_h5p/common\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nexport default {\n pluginName: 'tiny_h5p/plugin',\n component: 'tiny_h5p',\n buttonName: 'tiny_h5p',\n icon: 'tiny_h5p',\n};\n"],"names":["_exports","default","pluginName","component","buttonName","icon"],"mappings":"yIA4BC,OAAAA,SAAAC,QALc,CACXC,WAAY,kBACZC,UAAW,WACXC,WAAY,WACZC,KAAM,YACTL,SAAAC,OAAA"}
{"version":3,"file":"common.min.js","sources":["../src/common.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 * Tiny H5P Common values.\n *\n * @module tiny_h5p/common\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nexport default {\n pluginName: 'tiny_h5p/plugin',\n component: 'tiny_h5p',\n buttonName: 'tiny_h5p',\n icon: 'tiny_h5p',\n};\n"],"names":["pluginName","component","buttonName","icon"],"mappings":"iKAuBe,CACXA,WAAY,kBACZC,UAAW,WACXC,WAAY,WACZC,KAAM"}
@@ -1 +1 @@
{"version":3,"file":"configuration.min.js","sources":["../src/configuration.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 * Tiny H5P Content configuration.\n *\n * @module tiny_h5p/configuration\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {component as buttonName} from './common';\nimport {\n addMenubarItem,\n addToolbarButton,\n} from 'editor_tiny/utils';\n\nexport const configure = (instanceConfig) => {\n // Update the instance configuration to add the H5P menu option to the menus and toolbars.\n return {\n toolbar: addToolbarButton(instanceConfig.toolbar, 'content', buttonName),\n menu: addMenubarItem(instanceConfig.menu, 'insert', buttonName),\n };\n};\n"],"names":["_exports","configure","instanceConfig","toolbar","addToolbarButton","buttonName","menu","addMenubarItem","component"],"mappings":"gMAmCEA,SAAAC,UANwBC,iBAEf,CACHC,SAAS,EAAAC,OAAAA,kBAAiBF,eAAeC,QAAS,UAAWE,QAAAA,WAC7DC,MAAM,EAAAC,OAAAA,gBAAeL,eAAeI,KAAM,SAAUD,QAAUG,YAEpE"}
{"version":3,"file":"configuration.min.js","sources":["../src/configuration.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 * Tiny H5P Content configuration.\n *\n * @module tiny_h5p/configuration\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {component as buttonName} from './common';\nimport {\n addMenubarItem,\n addToolbarButton,\n} from 'editor_tiny/utils';\n\nexport const configure = (instanceConfig) => {\n // Update the instance configuration to add the H5P menu option to the menus and toolbars.\n return {\n toolbar: addToolbarButton(instanceConfig.toolbar, 'content', buttonName),\n menu: addMenubarItem(instanceConfig.menu, 'insert', buttonName),\n };\n};\n"],"names":["instanceConfig","toolbar","buttonName","menu"],"mappings":"mNA6B0BA,iBAEf,CACHC,SAAS,2BAAiBD,eAAeC,QAAS,UAAWC,mBAC7DC,MAAM,yBAAeH,eAAeG,KAAM,SAAUD"}
@@ -1 +1 @@
{"version":3,"file":"filtercontent.min.js","sources":["../src/filtercontent.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 * Tiny H5P Content configuration.\n *\n * @module tiny_h5p/filtercontent\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {registerPlaceholderSelectors} from 'editor_tiny/options';\n\nexport const setup = async(editor) => {\n const className = 'h5p-placeholder';\n const classSelector = `.${className}`;\n // Register the H5P Formatter to the placeholder selector list.\n registerPlaceholderSelectors(editor, [classSelector]);\n // Register the H5P Formatter for use in all buttons.\n editor.on('PreInit', () => {\n editor.formatter.register('h5p', {\n inline: 'div',\n classes: className,\n });\n });\n\n editor.on('SetContent', () => {\n // Listen to the SetContent event on the editor and update any h5p-placeholder to not be editable.\n // Doing this means that the inner content of the placeholder cannot be changed without using the dialogue.\n // The SetContent event is called whenever content is changed by actions such as initial load, paste, undo, etc.\n editor.getBody().querySelectorAll(`${classSelector}:not([contenteditable])`).forEach((node) => {\n node.contentEditable = false;\n });\n });\n};\n"],"names":["_exports","setup","async","classSelector","concat","registerPlaceholderSelectors","editor","on","formatter","register","inline","classes","getBody","querySelectorAll","forEach","node","contentEditable"],"mappings":"6KA8CEA,SAAAC,MArBmBC,eACjB,MACMC,cAAa,IAAAC,OADD,oBAGlB,EAAAC,uCAA6BC,OAAQ,CAACH,gBAEtCG,OAAOC,GAAG,WAAW,KACjBD,OAAOE,UAAUC,SAAS,MAAO,CAC7BC,OAAQ,MACRC,QARU,mBASZ,IAGNL,OAAOC,GAAG,cAAc,KAIpBD,OAAOM,UAAUC,iBAAgBT,GAAAA,OAAID,cAAuC,4BAACW,SAASC,OAClFA,KAAKC,iBAAkB,CAAK,GAC9B,GACJ,CACJ"}
{"version":3,"file":"filtercontent.min.js","sources":["../src/filtercontent.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 * Tiny H5P Content configuration.\n *\n * @module tiny_h5p/filtercontent\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {registerPlaceholderSelectors} from 'editor_tiny/options';\n\nexport const setup = async(editor) => {\n const className = 'h5p-placeholder';\n const classSelector = `.${className}`;\n // Register the H5P Formatter to the placeholder selector list.\n registerPlaceholderSelectors(editor, [classSelector]);\n // Register the H5P Formatter for use in all buttons.\n editor.on('PreInit', () => {\n editor.formatter.register('h5p', {\n inline: 'div',\n classes: className,\n });\n });\n\n editor.on('SetContent', () => {\n // Listen to the SetContent event on the editor and update any h5p-placeholder to not be editable.\n // Doing this means that the inner content of the placeholder cannot be changed without using the dialogue.\n // The SetContent event is called whenever content is changed by actions such as initial load, paste, undo, etc.\n editor.getBody().querySelectorAll(`${classSelector}:not([contenteditable])`).forEach((node) => {\n node.contentEditable = false;\n });\n });\n};\n"],"names":["async","classSelector","editor","on","formatter","register","inline","classes","getBody","querySelectorAll","forEach","node","contentEditable"],"mappings":"4LAyBqBA,MAAAA,eAEXC,yBADY,6DAGWC,OAAQ,CAACD,gBAEtCC,OAAOC,GAAG,WAAW,KACjBD,OAAOE,UAAUC,SAAS,MAAO,CAC7BC,OAAQ,MACRC,QARU,uBAYlBL,OAAOC,GAAG,cAAc,KAIpBD,OAAOM,UAAUC,2BAAoBR,0CAAwCS,SAASC,OAClFA,KAAKC,iBAAkB"}
+1 -1
View File
@@ -1,3 +1,3 @@
define("tiny_h5p/modal",["exports","core/modal","core/modal_registry"],(function(_exports,_modal,_modal_registry){var _class;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return(key=function(arg){var key=function(input,hint){if("object"!=typeof input||null===input)return input;var prim=input[Symbol.toPrimitive];if(void 0!==prim){var res=prim.call(input,hint||"default");if("object"!=typeof res)return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}(arg,"string");return"symbol"==typeof key?key:String(key)}(key))in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_modal=_interopRequireDefault(_modal),_modal_registry=_interopRequireDefault(_modal_registry);const H5PModal=(_defineProperty(_class=class extends _modal.default{registerEventListeners(){super.registerEventListeners(),this.registerCloseOnSave(),this.registerCloseOnCancel()}},"TYPE","tiny_h5p/modal"),_defineProperty(_class,"TEMPLATE","tiny_h5p/modal"),_class);_modal_registry.default.register(H5PModal.TYPE,H5PModal,H5PModal.TEMPLATE);var _default=H5PModal;return _exports.default=_default,_exports.default}));
define("tiny_h5p/modal",["exports","core/modal","core/modal_registry"],(function(_exports,_modal,_modal_registry){var _class;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_modal=_interopRequireDefault(_modal),_modal_registry=_interopRequireDefault(_modal_registry);const H5PModal=(_defineProperty(_class=class extends _modal.default{registerEventListeners(){super.registerEventListeners(),this.registerCloseOnSave(),this.registerCloseOnCancel()}},"TYPE","tiny_h5p/modal"),_defineProperty(_class,"TEMPLATE","tiny_h5p/modal"),_class);_modal_registry.default.register(H5PModal.TYPE,H5PModal,H5PModal.TEMPLATE);var _default=H5PModal;return _exports.default=_default,_exports.default}));
//# sourceMappingURL=modal.min.js.map
@@ -1 +1 @@
{"version":3,"file":"modal.min.js","sources":["../src/modal.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 * H5P Management Modal for Tiny.\n *\n * @module tiny_h5p/modal\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Modal from 'core/modal';\nimport ModalRegistry from 'core/modal_registry';\n\nconst H5PModal = class extends Modal {\n static TYPE = 'tiny_h5p/modal';\n\n static TEMPLATE = 'tiny_h5p/modal';\n\n registerEventListeners() {\n // Call the parent registration.\n super.registerEventListeners();\n\n // Register to close on save/cancel.\n this.registerCloseOnSave();\n this.registerCloseOnCancel();\n }\n};\n\nModalRegistry.register(H5PModal.TYPE, H5PModal, H5PModal.TEMPLATE);\n\nexport default H5PModal;\n"],"names":["_class","_interopRequireDefault","obj","__esModule","default","_defineProperty","key","value","arg","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","String","Number","_toPrimitive","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","_modal","_modal_registry","H5PModal","Modal","registerEventListeners","super","this","registerCloseOnSave","registerCloseOnCancel","ModalRegistry","register","TYPE","TEMPLATE","_default","_exports"],"mappings":"kHAwBgD,IAAAA,OAAA,SAAAC,uBAAAC,KAAAA,OAAAA,KAAAA,IAAAC,WAAAD,IAAAE,CAAAA,QAAAF,IAAA,CAAA,SAAAG,gBAAAH,IAAAI,IAAAC,cAAAD,IAAA,SAAAE,KAAAF,IAAAA,IAAA,SAAAG,MAAAC,SAAA,iBAAAD,OAAAA,OAAAA,MAAAA,OAAAA,UAAAE,KAAAF,MAAAG,OAAAC,aAAA,QAAAC,IAAAH,UAAAI,IAAAJ,KAAAK,KAAAP,MAAAC,MAAAK,WAAAA,oBAAAA,WAAAA,IAAA,MAAA,IAAAE,UAAAP,+CAAAA,CAAAA,kBAAAA,KAAAQ,OAAAC,QAAAV,MAAA,CAAAW,CAAAZ,IAAA,UAAA,MAAAF,iBAAAA,IAAAA,IAAAY,OAAAZ,IAAA,CAAAe,CAAAf,QAAAJ,IAAAoB,OAAAC,eAAArB,IAAAI,IAAA,CAAAC,MAAAA,MAAAiB,YAAA,EAAAC,cAAAC,EAAAA,cAAAxB,IAAAI,KAAAC,MAAAL,GAAA,iFADhDyB,OAAA1B,uBAAA0B,QACAC,gBAAA3B,uBAAA2B,iBAEA,MAAMC,UAaLxB,gBAbaL,OAAG,cAAc8B,eAK3BC,yBAEIC,MAAMD,yBAGNE,KAAKC,sBACLD,KAAKE,uBACT,UAXc,kBAAgB9B,gBAAAL,OAAA,WAEZ,kBAAgBA,QAYtCoC,gBAAAA,QAAcC,SAASR,SAASS,KAAMT,SAAUA,SAASU,UAAU,IAAAC,SAEpDX,SAAQ,OAAAY,SAAArC,QAAAoC,SAAAC,SAAArC,OAAA"}
{"version":3,"file":"modal.min.js","sources":["../src/modal.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 * H5P Management Modal for Tiny.\n *\n * @module tiny_h5p/modal\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Modal from 'core/modal';\nimport ModalRegistry from 'core/modal_registry';\n\nconst H5PModal = class extends Modal {\n static TYPE = 'tiny_h5p/modal';\n\n static TEMPLATE = 'tiny_h5p/modal';\n\n registerEventListeners() {\n // Call the parent registration.\n super.registerEventListeners();\n\n // Register to close on save/cancel.\n this.registerCloseOnSave();\n this.registerCloseOnCancel();\n }\n};\n\nModalRegistry.register(H5PModal.TYPE, H5PModal, H5PModal.TEMPLATE);\n\nexport default H5PModal;\n"],"names":["H5PModal","Modal","registerEventListeners","registerCloseOnSave","registerCloseOnCancel","register","TYPE","TEMPLATE"],"mappings":"uiBA0BMA,iCAAW,cAAcC,eAK3BC,+BAEUA,8BAGDC,2BACAC,iCAVK,oDAEI,kDAYRC,SAASL,SAASM,KAAMN,SAAUA,SAASO,uBAE1CP"}
@@ -1 +1 @@
{"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 H5P plugin.\n *\n * @module tiny_h5p/options\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {getPluginOptionName} from 'editor_tiny/options';\nimport {pluginName} from './common';\n\nconst permissionsName = getPluginOptionName(pluginName, 'permissions');\n\n/**\n * Register the options for the Tiny H5P plugin.\n *\n * @param {TinyMCE} editor\n */\nexport const register = (editor) => {\n const registerOption = editor.options.register;\n\n registerOption(permissionsName, {\n processor: 'object',\n \"default\": {\n upload: false,\n embed: false,\n },\n });\n};\n\n/**\n * Get the permissions configuration for the Tiny H5P plugin.\n *\n * @param {TinyMCE} editor\n * @returns {object}\n */\nexport const getPermissions = (editor) => editor.options.get(permissionsName);\n\n/**\n * Check whether any H5P Permission is available.\n *\n * @param {TinyMCE} editor\n * @returns {boolean}\n */\nexport const hasAnyH5PPermission = (editor) => {\n const permissions = getPermissions(editor);\n return permissions.upload || permissions.embed;\n};\n"],"names":["permissionsName","getPluginOptionName","pluginName","_exports","register","editor","registerOption","options","processor","default","upload","embed","getPermissions","get","hasAnyH5PPermission","permissions"],"mappings":";;;;;;;;AA0BA,MAAMA,iBAAkB,EAAAC,SAAAA,qBAAoBC,QAAUA,WAAE,eAiBtDC,SAAAC,SAVuBC,UAGrBC,EAFuBD,OAAOE,QAAQH,UAEvBJ,gBAAiB,CAC5BQ,UAAW,SACXC,QAAW,CACPC,QAAQ,EACRC,OAAO,IAEb,EASC,MAAMC,eAAkBP,QAAWA,OAAOE,QAAQM,IAAIb,iBAAiBG,SAAAS,eAAAA,eAW5ET,SAAAW,oBAHkCT,SAChC,MAAMU,YAAcH,eAAeP,QACnC,OAAOU,YAAYL,QAAUK,YAAYJ,KAAK,CAChD"}
{"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 H5P plugin.\n *\n * @module tiny_h5p/options\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {getPluginOptionName} from 'editor_tiny/options';\nimport {pluginName} from './common';\n\nconst permissionsName = getPluginOptionName(pluginName, 'permissions');\n\n/**\n * Register the options for the Tiny H5P plugin.\n *\n * @param {TinyMCE} editor\n */\nexport const register = (editor) => {\n const registerOption = editor.options.register;\n\n registerOption(permissionsName, {\n processor: 'object',\n \"default\": {\n upload: false,\n embed: false,\n },\n });\n};\n\n/**\n * Get the permissions configuration for the Tiny H5P plugin.\n *\n * @param {TinyMCE} editor\n * @returns {object}\n */\nexport const getPermissions = (editor) => editor.options.get(permissionsName);\n\n/**\n * Check whether any H5P Permission is available.\n *\n * @param {TinyMCE} editor\n * @returns {boolean}\n */\nexport const hasAnyH5PPermission = (editor) => {\n const permissions = getPermissions(editor);\n return permissions.upload || permissions.embed;\n};\n"],"names":["permissionsName","pluginName","editor","registerOption","options","register","processor","upload","embed","getPermissions","get","permissions"],"mappings":";;;;;;;;MA0BMA,iBAAkB,gCAAoBC,mBAAY,iCAO/BC,UAGrBC,EAFuBD,OAAOE,QAAQC,UAEvBL,gBAAiB,CAC5BM,UAAW,iBACA,CACPC,QAAQ,EACRC,OAAO,YAWNC,eAAkBP,QAAWA,OAAOE,QAAQM,IAAIV,qFAQzBE,eAC1BS,YAAcF,eAAeP,eAC5BS,YAAYJ,QAAUI,YAAYH"}
@@ -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 <http://www.gnu.org/licenses/>.\n\n/**\n * Tiny H5P plugin for Moodle.\n *\n * @module tiny_h5p/plugin\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport {getTinyMCE} from 'editor_tiny/loader';\nimport {getPluginMetadata} from 'editor_tiny/utils';\n\nimport {component, pluginName} from './common';\nimport * as FilterContent from './filtercontent';\nimport * as Commands from './commands';\nimport * as Configuration from './configuration';\nimport * as Options from './options';\n\n// Setup the H5P Plugin to add a button and menu option.\nexport default new Promise(async(resolve) => {\n const [\n tinyMCE,\n setupCommands,\n pluginMetadata,\n ] = await Promise.all([\n getTinyMCE(),\n Commands.getSetup(),\n getPluginMetadata(component, pluginName),\n ]);\n\n // Note: The PluginManager.add function does not accept a Promise.\n // Any asynchronous code must be run before this point.\n tinyMCE.PluginManager.add(`${component}/plugin`, (editor) => {\n // Register options.\n Options.register(editor);\n\n // Setup the Formatter.\n FilterContent.setup(editor);\n\n // Setup the Commands (buttons, menu items, and so on).\n setupCommands(editor);\n\n return pluginMetadata;\n });\n\n // Resolve the H5P Plugin and include configuration.\n resolve([`${component}/plugin`, Configuration]);\n});\n"],"names":["_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","FilterContent","Commands","Configuration","Options","_default","Promise","async","tinyMCE","setupCommands","pluginMetadata","all","getTinyMCE","getSetup","getPluginMetadata","component","pluginName","PluginManager","add","concat","editor","register","setup","resolve","_exports"],"mappings":"8OA6BqC,SAAAA,yBAAAC,aAAA,GAAA,mBAAAC,QAAA,OAAA,KAAA,IAAAC,kBAAAD,IAAAA,QAAAE,iBAAAF,IAAAA,eAAAF,yBAAA,SAAAC,aAAAA,OAAAA,YAAAG,iBAAAD,oBAAAF,YAAA,CAAA,SAAAI,wBAAAC,IAAAL,aAAAA,IAAAA,aAAAK,KAAAA,IAAAC,WAAAD,OAAAA,IAAAA,GAAAA,OAAAA,KAAAA,iBAAAA,KAAAE,mBAAAF,IAAAE,MAAAA,CAAAA,QAAAF,KAAAG,IAAAA,MAAAT,yBAAAC,aAAA,GAAAQ,OAAAA,MAAAC,IAAAJ,KAAA,OAAAG,MAAAE,IAAAL,KAAA,IAAAM,OAAAC,GAAAA,sBAAAC,OAAAC,gBAAAD,OAAAE,yBAAAC,IAAAA,IAAAA,OAAAX,IAAAW,eAAAA,KAAAH,OAAAI,UAAAC,eAAAC,KAAAd,IAAAW,KAAA,CAAA,IAAAI,KAAAR,sBAAAC,OAAAE,yBAAAV,IAAAW,KAAAI,KAAAA,OAAAA,KAAAV,KAAAU,KAAAC,KAAAR,OAAAC,eAAAH,OAAAK,IAAAI,MAAAT,OAAAK,KAAAX,IAAAW,IAAAL,QAAAA,OAAAJ,QAAAF,IAAAG,OAAAA,MAAAa,IAAAhB,IAAAM,QAAAA,MAAA;;;;;;;qFAHrCW,cAAAlB,wBAAAkB,eACAC,SAAAnB,wBAAAmB,UACAC,cAAApB,wBAAAoB,eACAC,QAAArB,wBAAAqB,SAdA,IAAAC,SAiBe,IAAIC,SAAQC,gBACvB,MACIC,QACAC,cACAC,sBACMJ,QAAQK,IAAI,EAClB,EAAAC,QAAUA,cACVV,SAASW,YACT,EAAAC,OAAiBA,mBAACC,QAASA,UAAEC,QAAUA,cAK3CR,QAAQS,cAAcC,IAAG,GAAAC,OAAIJ,QAAAA,UAAqBK,YAAAA,SAE9ChB,QAAQiB,SAASD,QAGjBnB,cAAcqB,MAAMF,QAGpBX,cAAcW,QAEPV,kBAIXa,QAAQ,IAAAJ,OAAIJ,kBAAoBZ,WAAAA,eAAe,IACjD,OAAAqB,SAAAtC,QAAAmB,SAAAmB,SAAAtC,OAAA"}
{"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 <http://www.gnu.org/licenses/>.\n\n/**\n * Tiny H5P plugin for Moodle.\n *\n * @module tiny_h5p/plugin\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport {getTinyMCE} from 'editor_tiny/loader';\nimport {getPluginMetadata} from 'editor_tiny/utils';\n\nimport {component, pluginName} from './common';\nimport * as FilterContent from './filtercontent';\nimport * as Commands from './commands';\nimport * as Configuration from './configuration';\nimport * as Options from './options';\n\n// Setup the H5P Plugin to add a button and menu option.\nexport default new Promise(async(resolve) => {\n const [\n tinyMCE,\n setupCommands,\n pluginMetadata,\n ] = await Promise.all([\n getTinyMCE(),\n Commands.getSetup(),\n getPluginMetadata(component, pluginName),\n ]);\n\n // Note: The PluginManager.add function does not accept a Promise.\n // Any asynchronous code must be run before this point.\n tinyMCE.PluginManager.add(`${component}/plugin`, (editor) => {\n // Register options.\n Options.register(editor);\n\n // Setup the Formatter.\n FilterContent.setup(editor);\n\n // Setup the Commands (buttons, menu items, and so on).\n setupCommands(editor);\n\n return pluginMetadata;\n });\n\n // Resolve the H5P Plugin and include configuration.\n resolve([`${component}/plugin`, Configuration]);\n});\n"],"names":["Promise","async","tinyMCE","setupCommands","pluginMetadata","all","Commands","getSetup","component","pluginName","PluginManager","add","editor","Options","register","FilterContent","setup","resolve","Configuration"],"mappings":";;;;;;;gSAgCe,IAAIA,SAAQC,MAAAA,gBAEnBC,QACAC,cACAC,sBACMJ,QAAQK,IAAI,EAClB,wBACAC,SAASC,YACT,4BAAkBC,kBAAWC,sBAKjCP,QAAQQ,cAAcC,cAAOH,8BAAqBI,SAE9CC,QAAQC,SAASF,QAGjBG,cAAcC,MAAMJ,QAGpBT,cAAcS,QAEPR,kBAIXa,QAAQ,WAAIT,6BAAoBU"}
+1 -1
View File
@@ -5,6 +5,6 @@ define("tiny_h5p/ui",["exports","editor_tiny/utils","./common","./options","core
* @module tiny_h5p/commands
* @copyright 2022 Andrew Lyons <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.handleAction=void 0,_config=_interopRequireDefault(_config),_modal=_interopRequireDefault(_modal),_modal_events=_interopRequireDefault(_modal_events),_modal_factory=_interopRequireDefault(_modal_factory),_pending=_interopRequireDefault(_pending);let openingSelection=null;_exports.handleAction=editor=>{openingSelection=editor.selection.getBookmark(),displayDialogue(editor)};const getTemplateContext=(editor,data)=>{var _permissions$upload,_permissions$embed,_data$url;const permissions=(0,_options.getPermissions)(editor),canUpload=null!==(_permissions$upload=permissions.upload)&&void 0!==_permissions$upload&&_permissions$upload,canEmbed=null!==(_permissions$embed=permissions.embed)&&void 0!==_permissions$embed&&_permissions$embed,canUploadAndEmbed=canUpload&&canEmbed;return Object.assign({},{elementid:editor.id,canUpload:canUpload,canEmbed:canEmbed,canUploadAndEmbed:canUploadAndEmbed,showOptions:!1,fileURL:null!==(_data$url=null==data?void 0:data.url)&&void 0!==_data$url?_data$url:""},data)},isValidUrl=url=>!!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*").test(url),handleDialogueSubmission=async(editor,modal,data)=>{const pendingPromise=new _pending.default("tiny_h5p:handleDialogueSubmission"),form=(0,_normalise.getList)(modal.getRoot())[0].querySelector("form");if(!form)return modal.destroy(),displayDialogue(editor,Object.assign({},data)),void pendingPromise.resolve();const submittedUrl=form.querySelector('input[name="url"]').value,url=((form,submittedUrl,permissions)=>{if(!submittedUrl||!submittedUrl.startsWith(_config.default.wwwroot)&&!isValidUrl(submittedUrl))return null;const url=new URL(submittedUrl);return null!=permissions&&permissions.upload&&form.querySelector('[name="download"]').checked&&url.searchParams.append("export",1),null!=permissions&&permissions.embed&&form.querySelector('[name="embed"]').checked&&url.searchParams.append("embed",1),form.querySelector('[name="copyright"]').checked&&url.searchParams.append("copyright",1),url})(form,submittedUrl,(0,_options.getPermissions)(editor));if(!url)return modal.destroy(),displayDialogue(editor,Object.assign({},data,{url:submittedUrl,invalidUrl:!0})),void pendingPromise.resolve();const content=await(0,_templates.renderForPromise)("".concat(_common.component,"/content"),{url:url.toString()});editor.selection.moveToBookmark(openingSelection),editor.execCommand("mceInsertContent",!1,content.html),editor.selection.moveToBookmark(openingSelection),pendingPromise.resolve()},getCurrentH5PData=currentH5P=>{const data={};let url;try{url=new URL(currentH5P.textContent)}catch(error){return data}return url.searchParams.has("export")&&(data.download=!0,data.showOptions=!0,url.searchParams.delete("export")),url.searchParams.has("embed")&&(data.embed=!0,data.showOptions=!0,url.searchParams.delete("embed")),url.searchParams.has("copyright")&&(data.copyright=!0,data.showOptions=!0,url.searchParams.delete("copyright")),data.url=url.toString(),data},displayDialogue=async function(editor){let data=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const currentH5P=editor.selection.getNode().closest(".h5p-placeholder");currentH5P&&Object.assign(data,getCurrentH5PData(currentH5P));const modal=await _modal_factory.default.create({type:_modal.default.TYPE,templateContext:getTemplateContext(editor,data),large:!0});modal.show();const $root=modal.getRoot(),root=$root[0];$root.on(_modal_events.default.save,((event,modal)=>{handleDialogueSubmission(editor,modal,data)})),root.addEventListener("click",(e=>{e.target.closest('[data-target="filepicker"]')&&(0,_utils.displayFilepicker)(editor,"h5p").then((params=>{if(""!==params.url){root.querySelector('form input[name="url"]').value=params.url}return params})).catch()}))}}));
*/Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.handleAction=void 0,_config=_interopRequireDefault(_config),_modal=_interopRequireDefault(_modal),_modal_events=_interopRequireDefault(_modal_events),_modal_factory=_interopRequireDefault(_modal_factory),_pending=_interopRequireDefault(_pending);let openingSelection=null;_exports.handleAction=editor=>{openingSelection=editor.selection.getBookmark(),displayDialogue(editor)};const getTemplateContext=(editor,data)=>{var _permissions$upload,_permissions$embed,_data$url;const permissions=(0,_options.getPermissions)(editor),canUpload=null!==(_permissions$upload=permissions.upload)&&void 0!==_permissions$upload&&_permissions$upload,canEmbed=null!==(_permissions$embed=permissions.embed)&&void 0!==_permissions$embed&&_permissions$embed,canUploadAndEmbed=canUpload&&canEmbed;return Object.assign({},{elementid:editor.id,canUpload:canUpload,canEmbed:canEmbed,canUploadAndEmbed:canUploadAndEmbed,showOptions:!1,fileURL:null!==(_data$url=null==data?void 0:data.url)&&void 0!==_data$url?_data$url:""},data)},isValidUrl=url=>!!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*").test(url),handleDialogueSubmission=async(editor,modal,data)=>{const pendingPromise=new _pending.default("tiny_h5p:handleDialogueSubmission"),form=(0,_normalise.getList)(modal.getRoot())[0].querySelector("form");if(!form)return modal.destroy(),displayDialogue(editor,Object.assign({},data)),void pendingPromise.resolve();const submittedUrl=form.querySelector('input[name="url"]').value,url=((form,submittedUrl,permissions)=>{if(!submittedUrl||!submittedUrl.startsWith(_config.default.wwwroot)&&!isValidUrl(submittedUrl))return null;const url=new URL(submittedUrl);return null!=permissions&&permissions.upload&&form.querySelector('[name="download"]').checked&&url.searchParams.append("export",1),null!=permissions&&permissions.embed&&form.querySelector('[name="embed"]').checked&&url.searchParams.append("embed",1),form.querySelector('[name="copyright"]').checked&&url.searchParams.append("copyright",1),url})(form,submittedUrl,(0,_options.getPermissions)(editor));if(!url)return modal.destroy(),displayDialogue(editor,Object.assign({},data,{url:submittedUrl,invalidUrl:!0})),void pendingPromise.resolve();const content=await(0,_templates.renderForPromise)("".concat(_common.component,"/content"),{url:url.toString()});editor.selection.moveToBookmark(openingSelection),editor.execCommand("mceInsertContent",!1,content.html),editor.selection.moveToBookmark(openingSelection),pendingPromise.resolve()},getCurrentH5PData=currentH5P=>{const data={};let url;try{url=new URL(currentH5P.textContent)}catch(error){return data}return url.searchParams.has("export")&&(data.download=!0,data.showOptions=!0,url.searchParams.delete("export")),url.searchParams.has("embed")&&(data.embed=!0,data.showOptions=!0,url.searchParams.delete("embed")),url.searchParams.has("copyright")&&(data.copyright=!0,data.showOptions=!0,url.searchParams.delete("copyright")),data.url=url.toString(),data},displayDialogue=async function(editor){let data=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const selection=editor.selection.getNode(),currentH5P=selection.closest(".h5p-placeholder");currentH5P&&Object.assign(data,getCurrentH5PData(currentH5P));const modal=await _modal_factory.default.create({type:_modal.default.TYPE,templateContext:getTemplateContext(editor,data),large:!0});modal.show();const $root=modal.getRoot(),root=$root[0];$root.on(_modal_events.default.save,((event,modal)=>{handleDialogueSubmission(editor,modal,data)})),root.addEventListener("click",(e=>{e.target.closest('[data-target="filepicker"]')&&(0,_utils.displayFilepicker)(editor,"h5p").then((params=>{if(""!==params.url){root.querySelector('form input[name="url"]').value=params.url}return params})).catch()}))}}));
//# sourceMappingURL=ui.min.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
{"version":3,"file":"common.min.js","sources":["../src/common.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 * Tiny Media common values.\n *\n * @module tiny_media/common\n * @copyright 2022 Huong Nguyen <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nexport default {\n pluginName: 'tiny_media/plugin',\n component: 'tiny_media',\n imageButtonName: 'tiny_media_image',\n videoButtonName: 'tiny_media_video',\n mediaManagerButtonName: 'tiny_mediamanager',\n};\n"],"names":["_exports","default","pluginName","component","imageButtonName","videoButtonName","mediaManagerButtonName"],"mappings":"2IA6BC,OAAAA,SAAAC,QANc,CACXC,WAAY,oBACZC,UAAW,aACXC,gBAAiB,mBACjBC,gBAAiB,mBACjBC,uBAAwB,qBAC3BN,SAAAC,OAAA"}
{"version":3,"file":"common.min.js","sources":["../src/common.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 * Tiny Media common values.\n *\n * @module tiny_media/common\n * @copyright 2022 Huong Nguyen <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nexport default {\n pluginName: 'tiny_media/plugin',\n component: 'tiny_media',\n imageButtonName: 'tiny_media_image',\n videoButtonName: 'tiny_media_video',\n mediaManagerButtonName: 'tiny_mediamanager',\n};\n"],"names":["pluginName","component","imageButtonName","videoButtonName","mediaManagerButtonName"],"mappings":"mKAuBe,CACXA,WAAY,oBACZC,UAAW,aACXC,gBAAiB,mBACjBC,gBAAiB,mBACjBC,uBAAwB"}
@@ -1 +1 @@
{"version":3,"file":"configuration.min.js","sources":["../src/configuration.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 * Tiny Media configuration.\n *\n * @module tiny_media/configuration\n * @copyright 2022 Huong Nguyen <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {\n imageButtonName,\n videoButtonName,\n mediaManagerButtonName,\n} from './common';\nimport uploadFile from 'editor_tiny/uploader';\nimport {\n addContextmenuItem,\n} from 'editor_tiny/utils';\n\nconst configureMenu = (menu) => {\n // Replace the standard Media plugin with the Moodle embed.\n if (menu.insert.items.match(/\\bmedia\\b/)) {\n menu.insert.items = menu.insert.items.replace(/\\bmedia\\b/, videoButtonName);\n } else {\n menu.insert.items = `${videoButtonName} ${menu.insert.items}`;\n }\n\n // Replace the standard image plugin with the Moodle image.\n if (menu.insert.items.match(/\\bimage\\b/)) {\n menu.insert.items = menu.insert.items.replace(/\\bimage\\b/, imageButtonName);\n } else {\n menu.insert.items = `${imageButtonName} ${menu.insert.items}`;\n }\n\n // Add the Media Manager to the end of the Tools menu.\n menu.tools.items += ` ${mediaManagerButtonName}`;\n\n return menu;\n};\n\nconst configureToolbar = (toolbar) => {\n // The toolbar contains an array of named sections.\n // The Moodle integration ensures that there is a section called 'content'.\n\n return toolbar.map((section) => {\n if (section.name === 'content') {\n // Insert the image, and embed, buttons at the start of it.\n section.items.unshift(imageButtonName, videoButtonName);\n }\n\n return section;\n });\n};\n\nexport const configure = (instanceConfig) => {\n // Update the instance configuration to add the Media menu option to the menus and toolbars and upload_handler.\n return {\n contextmenu: addContextmenuItem(instanceConfig.contextmenu, imageButtonName, videoButtonName),\n menu: configureMenu(instanceConfig.menu),\n toolbar: configureToolbar(instanceConfig.toolbar),\n\n // eslint-disable-next-line camelcase\n images_upload_handler: (blobInfo, progress) => uploadFile(\n window.tinymce.activeEditor,\n 'image',\n blobInfo.blob(),\n blobInfo.filename(),\n progress\n ),\n\n // eslint-disable-next-line camelcase\n images_reuse_filename: true,\n };\n};\n"],"names":["obj","_uploader","__esModule","default","_exports","configure","instanceConfig","contextmenu","addContextmenuItem","imageButtonName","videoButtonName","menu","insert","items","match","replace","concat","tools","mediaManagerButtonName","toolbar","map","section","name","unshift","images_upload_handler","blobInfo","progress","uploadFile","window","tinymce","activeEditor","blob","filename","images_reuse_filename"],"mappings":"iJA4B8C,IAAAA;;;;;;;uFAA9CC,WAA8CD,IAA9CC,YAA8CD,IAAAE,WAAAF,IAAAG,CAAAA,QAAAH,KA2D5CI,SAAAC,UAnBwBC,iBAEtB,MAAO,CACHC,aAAa,EAAAC,OAAAA,oBAAmBF,eAAeC,YAAaE,QAAAA,gBAAiBC,QAAAA,iBAC7EC,MAvCeA,KAuCKL,eAAeK,KArCnCA,KAAKC,OAAOC,MAAMC,MAAM,aACxBH,KAAKC,OAAOC,MAAQF,KAAKC,OAAOC,MAAME,QAAQ,YAAaL,yBAE3DC,KAAKC,OAAOC,MAAK,GAAAG,OAAMN,QAAAA,gBAAeM,KAAAA,OAAIL,KAAKC,OAAOC,OAItDF,KAAKC,OAAOC,MAAMC,MAAM,aACxBH,KAAKC,OAAOC,MAAQF,KAAKC,OAAOC,MAAME,QAAQ,YAAaN,yBAE3DE,KAAKC,OAAOC,MAAK,GAAAG,OAAMP,QAAAA,gBAAeO,KAAAA,OAAIL,KAAKC,OAAOC,OAI1DF,KAAKM,MAAMJ,WAAKG,OAAQE,gCAEjBP,MAsBHQ,SAnBkBA,QAmBQb,eAAea,QAftCA,QAAQC,KAAKC,UACK,YAAjBA,QAAQC,MAERD,QAAQR,MAAMU,QAAQd,QAAeA,gBAAEC,yBAGpCW,YAYPG,sBAAuBA,CAACC,SAAUC,YAAa,EAAAC,UAAAA,SAC3CC,OAAOC,QAAQC,aACf,QACAL,SAASM,OACTN,SAASO,WACTN,UAIJO,uBAAuB,GA/BLd,YArBHR,IAqDlB,CACH"}
{"version":3,"file":"configuration.min.js","sources":["../src/configuration.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 * Tiny Media configuration.\n *\n * @module tiny_media/configuration\n * @copyright 2022 Huong Nguyen <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {\n imageButtonName,\n videoButtonName,\n mediaManagerButtonName,\n} from './common';\nimport uploadFile from 'editor_tiny/uploader';\nimport {\n addContextmenuItem,\n} from 'editor_tiny/utils';\n\nconst configureMenu = (menu) => {\n // Replace the standard Media plugin with the Moodle embed.\n if (menu.insert.items.match(/\\bmedia\\b/)) {\n menu.insert.items = menu.insert.items.replace(/\\bmedia\\b/, videoButtonName);\n } else {\n menu.insert.items = `${videoButtonName} ${menu.insert.items}`;\n }\n\n // Replace the standard image plugin with the Moodle image.\n if (menu.insert.items.match(/\\bimage\\b/)) {\n menu.insert.items = menu.insert.items.replace(/\\bimage\\b/, imageButtonName);\n } else {\n menu.insert.items = `${imageButtonName} ${menu.insert.items}`;\n }\n\n // Add the Media Manager to the end of the Tools menu.\n menu.tools.items += ` ${mediaManagerButtonName}`;\n\n return menu;\n};\n\nconst configureToolbar = (toolbar) => {\n // The toolbar contains an array of named sections.\n // The Moodle integration ensures that there is a section called 'content'.\n\n return toolbar.map((section) => {\n if (section.name === 'content') {\n // Insert the image, and embed, buttons at the start of it.\n section.items.unshift(imageButtonName, videoButtonName);\n }\n\n return section;\n });\n};\n\nexport const configure = (instanceConfig) => {\n // Update the instance configuration to add the Media menu option to the menus and toolbars and upload_handler.\n return {\n contextmenu: addContextmenuItem(instanceConfig.contextmenu, imageButtonName, videoButtonName),\n menu: configureMenu(instanceConfig.menu),\n toolbar: configureToolbar(instanceConfig.toolbar),\n\n // eslint-disable-next-line camelcase\n images_upload_handler: (blobInfo, progress) => uploadFile(\n window.tinymce.activeEditor,\n 'image',\n blobInfo.blob(),\n blobInfo.filename(),\n progress\n ),\n\n // eslint-disable-next-line camelcase\n images_reuse_filename: true,\n };\n};\n"],"names":["instanceConfig","contextmenu","imageButtonName","videoButtonName","menu","insert","items","match","replace","tools","mediaManagerButtonName","toolbar","map","section","name","unshift","images_upload_handler","blobInfo","progress","window","tinymce","activeEditor","blob","filename","images_reuse_filename"],"mappings":";;;;;;;sKAoE0BA,uBAEf,CACHC,aAAa,6BAAmBD,eAAeC,YAAaC,wBAAiBC,yBAC7EC,MAvCeA,KAuCKJ,eAAeI,KArCnCA,KAAKC,OAAOC,MAAMC,MAAM,aACxBH,KAAKC,OAAOC,MAAQF,KAAKC,OAAOC,MAAME,QAAQ,YAAaL,yBAE3DC,KAAKC,OAAOC,gBAAWH,oCAAmBC,KAAKC,OAAOC,OAItDF,KAAKC,OAAOC,MAAMC,MAAM,aACxBH,KAAKC,OAAOC,MAAQF,KAAKC,OAAOC,MAAME,QAAQ,YAAaN,yBAE3DE,KAAKC,OAAOC,gBAAWJ,oCAAmBE,KAAKC,OAAOC,OAI1DF,KAAKK,MAAMH,kBAAaI,gCAEjBN,MAsBHO,SAnBkBA,QAmBQX,eAAeW,QAftCA,QAAQC,KAAKC,UACK,YAAjBA,QAAQC,MAERD,QAAQP,MAAMS,QAAQb,wBAAiBC,yBAGpCU,YAYPG,sBAAuB,CAACC,SAAUC,YAAa,qBAC3CC,OAAOC,QAAQC,aACf,QACAJ,SAASK,OACTL,SAASM,WACTL,UAIJM,uBAAuB,GA/BLb,IAAAA,QArBHP"}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,3 +1,3 @@
define("tiny_media/embedmodal",["exports","core/modal","core/modal_registry","./common"],(function(_exports,_modal,_modal_registry,_common){var _class;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return(key=function(arg){var key=function(input,hint){if("object"!=typeof input||null===input)return input;var prim=input[Symbol.toPrimitive];if(void 0!==prim){var res=prim.call(input,hint||"default");if("object"!=typeof res)return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}(arg,"string");return"symbol"==typeof key?key:String(key)}(key))in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_modal=_interopRequireDefault(_modal),_modal_registry=_interopRequireDefault(_modal_registry);const EmbedModal=(_defineProperty(_class=class extends _modal.default{registerEventListeners(){super.registerEventListeners(),this.registerCloseOnSave(),this.registerCloseOnCancel()}},"TYPE","".concat(_common.component,"/modal")),_defineProperty(_class,"TEMPLATE","".concat(_common.component,"/embed_media_modal")),_class);_modal_registry.default.register(EmbedModal.TYPE,EmbedModal,EmbedModal.TEMPLATE);var _default=EmbedModal;return _exports.default=_default,_exports.default}));
define("tiny_media/embedmodal",["exports","core/modal","core/modal_registry","./common"],(function(_exports,_modal,_modal_registry,_common){var _class;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_modal=_interopRequireDefault(_modal),_modal_registry=_interopRequireDefault(_modal_registry);const EmbedModal=(_defineProperty(_class=class extends _modal.default{registerEventListeners(){super.registerEventListeners(),this.registerCloseOnSave(),this.registerCloseOnCancel()}},"TYPE","".concat(_common.component,"/modal")),_defineProperty(_class,"TEMPLATE","".concat(_common.component,"/embed_media_modal")),_class);_modal_registry.default.register(EmbedModal.TYPE,EmbedModal,EmbedModal.TEMPLATE);var _default=EmbedModal;return _exports.default=_default,_exports.default}));
//# sourceMappingURL=embedmodal.min.js.map
@@ -1 +1 @@
{"version":3,"file":"embedmodal.min.js","sources":["../src/embedmodal.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 * Embedded Media Management Modal for Tiny.\n *\n * @module tiny_media/modal\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Modal from 'core/modal';\nimport ModalRegistry from 'core/modal_registry';\nimport {component} from './common';\n\nconst EmbedModal = class extends Modal {\n static TYPE = `${component}/modal`;\n\n static TEMPLATE = `${component}/embed_media_modal`;\n\n registerEventListeners() {\n // Call the parent registration.\n super.registerEventListeners();\n\n // Register to close on save/cancel.\n this.registerCloseOnSave();\n this.registerCloseOnCancel();\n }\n};\n\nModalRegistry.register(EmbedModal.TYPE, EmbedModal, EmbedModal.TEMPLATE);\n\nexport default EmbedModal;\n"],"names":["_class","_interopRequireDefault","obj","__esModule","default","_defineProperty","key","value","arg","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","String","Number","_toPrimitive","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","_modal","_modal_registry","EmbedModal","Modal","registerEventListeners","super","this","registerCloseOnSave","registerCloseOnCancel","concat","component","ModalRegistry","register","TYPE","TEMPLATE","_default","_exports"],"mappings":"4IAwBgD,IAAAA,OAAA,SAAAC,uBAAAC,KAAAA,OAAAA,KAAAA,IAAAC,WAAAD,IAAAE,CAAAA,QAAAF,IAAA,CAAA,SAAAG,gBAAAH,IAAAI,IAAAC,cAAAD,IAAA,SAAAE,KAAAF,IAAAA,IAAA,SAAAG,MAAAC,SAAA,iBAAAD,OAAAA,OAAAA,MAAAA,OAAAA,UAAAE,KAAAF,MAAAG,OAAAC,aAAA,QAAAC,IAAAH,UAAAI,IAAAJ,KAAAK,KAAAP,MAAAC,MAAAK,WAAAA,oBAAAA,WAAAA,IAAA,MAAA,IAAAE,UAAAP,+CAAAA,CAAAA,kBAAAA,KAAAQ,OAAAC,QAAAV,MAAA,CAAAW,CAAAZ,IAAA,UAAA,MAAAF,iBAAAA,IAAAA,IAAAY,OAAAZ,IAAA,CAAAe,CAAAf,QAAAJ,IAAAoB,OAAAC,eAAArB,IAAAI,IAAA,CAAAC,MAAAA,MAAAiB,YAAA,EAAAC,cAAAC,EAAAA,cAAAxB,IAAAI,KAAAC,MAAAL,GAAA,iFADhDyB,OAAA1B,uBAAA0B,QACAC,gBAAA3B,uBAAA2B,iBAGA,MAAMC,YAaLxB,gBAbeL,OAAG,cAAc8B,eAK7BC,yBAEIC,MAAMD,yBAGNE,KAAKC,sBACLD,KAAKE,uBACT,GACHC,OAAAA,GAAAA,OAZoBC,QAASA,UAAA,WAAAhC,gBAAAL,OAAAoC,WAAAA,GAAAA,OAELC,QAASA,UAAA,uBAAArC,QAYlCsC,gBAAAA,QAAcC,SAASV,WAAWW,KAAMX,WAAYA,WAAWY,UAAU,IAAAC,SAE1Db,WAAU,OAAAc,SAAAvC,QAAAsC,SAAAC,SAAAvC,OAAA"}
{"version":3,"file":"embedmodal.min.js","sources":["../src/embedmodal.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 * Embedded Media Management Modal for Tiny.\n *\n * @module tiny_media/modal\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Modal from 'core/modal';\nimport ModalRegistry from 'core/modal_registry';\nimport {component} from './common';\n\nconst EmbedModal = class extends Modal {\n static TYPE = `${component}/modal`;\n\n static TEMPLATE = `${component}/embed_media_modal`;\n\n registerEventListeners() {\n // Call the parent registration.\n super.registerEventListeners();\n\n // Register to close on save/cancel.\n this.registerCloseOnSave();\n this.registerCloseOnCancel();\n }\n};\n\nModalRegistry.register(EmbedModal.TYPE, EmbedModal, EmbedModal.TEMPLATE);\n\nexport default EmbedModal;\n"],"names":["EmbedModal","Modal","registerEventListeners","registerCloseOnSave","registerCloseOnCancel","component","register","TYPE","TEMPLATE"],"mappings":"ikBA2BMA,mCAAa,cAAcC,eAK7BC,+BAEUA,8BAGDC,2BACAC,2CAVQC,yEAEIA,yEAYXC,SAASN,WAAWO,KAAMP,WAAYA,WAAWQ,uBAEhDR"}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,3 +1,3 @@
define("tiny_media/imagemodal",["exports","core/modal","core/modal_registry","./common"],(function(_exports,_modal,_modal_registry,_common){var _class;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return(key=function(arg){var key=function(input,hint){if("object"!=typeof input||null===input)return input;var prim=input[Symbol.toPrimitive];if(void 0!==prim){var res=prim.call(input,hint||"default");if("object"!=typeof res)return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}(arg,"string");return"symbol"==typeof key?key:String(key)}(key))in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_modal=_interopRequireDefault(_modal),_modal_registry=_interopRequireDefault(_modal_registry);const ImageModal=(_defineProperty(_class=class extends _modal.default{registerEventListeners(){super.registerEventListeners(),this.registerCloseOnSave(),this.registerCloseOnCancel()}},"TYPE","".concat(_common.component,"/imagemodal")),_defineProperty(_class,"TEMPLATE","".concat(_common.component,"/insert_image_modal")),_class);_modal_registry.default.register(ImageModal.TYPE,ImageModal,ImageModal.TEMPLATE);var _default=ImageModal;return _exports.default=_default,_exports.default}));
define("tiny_media/imagemodal",["exports","core/modal","core/modal_registry","./common"],(function(_exports,_modal,_modal_registry,_common){var _class;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_modal=_interopRequireDefault(_modal),_modal_registry=_interopRequireDefault(_modal_registry);const ImageModal=(_defineProperty(_class=class extends _modal.default{registerEventListeners(){super.registerEventListeners(),this.registerCloseOnSave(),this.registerCloseOnCancel()}},"TYPE","".concat(_common.component,"/imagemodal")),_defineProperty(_class,"TEMPLATE","".concat(_common.component,"/insert_image_modal")),_class);_modal_registry.default.register(ImageModal.TYPE,ImageModal,ImageModal.TEMPLATE);var _default=ImageModal;return _exports.default=_default,_exports.default}));
//# sourceMappingURL=imagemodal.min.js.map
@@ -1 +1 @@
{"version":3,"file":"imagemodal.min.js","sources":["../src/imagemodal.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 * Image Modal for Tiny.\n *\n * @module tiny_media/imagemodal\n * @copyright 2022 Huong Nguyen <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Modal from 'core/modal';\nimport ModalRegistry from 'core/modal_registry';\nimport {component} from './common';\n\nconst ImageModal = class extends Modal {\n static TYPE = `${component}/imagemodal`;\n\n static TEMPLATE = `${component}/insert_image_modal`;\n\n registerEventListeners() {\n // Call the parent registration.\n super.registerEventListeners();\n\n // Register to close on save/cancel.\n this.registerCloseOnSave();\n this.registerCloseOnCancel();\n }\n};\n\nModalRegistry.register(ImageModal.TYPE, ImageModal, ImageModal.TEMPLATE);\n\nexport default ImageModal;\n"],"names":["_class","_interopRequireDefault","obj","__esModule","default","_defineProperty","key","value","arg","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","String","Number","_toPrimitive","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","_modal","_modal_registry","ImageModal","Modal","registerEventListeners","super","this","registerCloseOnSave","registerCloseOnCancel","concat","component","ModalRegistry","register","TYPE","TEMPLATE","_default","_exports"],"mappings":"4IAwBgD,IAAAA,OAAA,SAAAC,uBAAAC,KAAAA,OAAAA,KAAAA,IAAAC,WAAAD,IAAAE,CAAAA,QAAAF,IAAA,CAAA,SAAAG,gBAAAH,IAAAI,IAAAC,cAAAD,IAAA,SAAAE,KAAAF,IAAAA,IAAA,SAAAG,MAAAC,SAAA,iBAAAD,OAAAA,OAAAA,MAAAA,OAAAA,UAAAE,KAAAF,MAAAG,OAAAC,aAAA,QAAAC,IAAAH,UAAAI,IAAAJ,KAAAK,KAAAP,MAAAC,MAAAK,WAAAA,oBAAAA,WAAAA,IAAA,MAAA,IAAAE,UAAAP,+CAAAA,CAAAA,kBAAAA,KAAAQ,OAAAC,QAAAV,MAAA,CAAAW,CAAAZ,IAAA,UAAA,MAAAF,iBAAAA,IAAAA,IAAAY,OAAAZ,IAAA,CAAAe,CAAAf,QAAAJ,IAAAoB,OAAAC,eAAArB,IAAAI,IAAA,CAAAC,MAAAA,MAAAiB,YAAA,EAAAC,cAAAC,EAAAA,cAAAxB,IAAAI,KAAAC,MAAAL,GAAA,iFADhDyB,OAAA1B,uBAAA0B,QACAC,gBAAA3B,uBAAA2B,iBAGA,MAAMC,YAaLxB,gBAbeL,OAAG,cAAc8B,eAK7BC,yBAEIC,MAAMD,yBAGNE,KAAKC,sBACLD,KAAKE,uBACT,GACHC,OAAAA,GAAAA,OAZoBC,QAASA,UAAA,gBAAAhC,gBAAAL,OAAAoC,WAAAA,GAAAA,OAELC,QAASA,UAAA,wBAAArC,QAYlCsC,gBAAAA,QAAcC,SAASV,WAAWW,KAAMX,WAAYA,WAAWY,UAAU,IAAAC,SAE1Db,WAAU,OAAAc,SAAAvC,QAAAsC,SAAAC,SAAAvC,OAAA"}
{"version":3,"file":"imagemodal.min.js","sources":["../src/imagemodal.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 * Image Modal for Tiny.\n *\n * @module tiny_media/imagemodal\n * @copyright 2022 Huong Nguyen <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Modal from 'core/modal';\nimport ModalRegistry from 'core/modal_registry';\nimport {component} from './common';\n\nconst ImageModal = class extends Modal {\n static TYPE = `${component}/imagemodal`;\n\n static TEMPLATE = `${component}/insert_image_modal`;\n\n registerEventListeners() {\n // Call the parent registration.\n super.registerEventListeners();\n\n // Register to close on save/cancel.\n this.registerCloseOnSave();\n this.registerCloseOnCancel();\n }\n};\n\nModalRegistry.register(ImageModal.TYPE, ImageModal, ImageModal.TEMPLATE);\n\nexport default ImageModal;\n"],"names":["ImageModal","Modal","registerEventListeners","registerCloseOnSave","registerCloseOnCancel","component","register","TYPE","TEMPLATE"],"mappings":"ikBA2BMA,mCAAa,cAAcC,eAK7BC,+BAEUA,8BAGDC,2BACAC,2CAVQC,8EAEIA,0EAYXC,SAASN,WAAWO,KAAMP,WAAYA,WAAWQ,uBAEhDR"}
+1 -1
View File
@@ -1,3 +1,3 @@
define("tiny_media/manager",["exports","core/templates","core/str","core/modal_factory","core/modal_events","./options","core/config"],(function(_exports,_templates,_str,Modal,ModalEvents,_options,_config){function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!=typeof obj&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!==key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}return newObj.default=obj,cache&&cache.set(obj,newObj),newObj}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return(key=function(arg){var key=function(input,hint){if("object"!=typeof input||null===input)return input;var prim=input[Symbol.toPrimitive];if(void 0!==prim){var res=prim.call(input,hint||"default");if("object"!=typeof res)return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}(arg,"string");return"symbol"==typeof key?key:String(key)}(key))in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.MediaManager=void 0,_templates=_interopRequireDefault(_templates),Modal=_interopRequireWildcard(Modal),ModalEvents=_interopRequireWildcard(ModalEvents),_config=_interopRequireDefault(_config);_exports.MediaManager=class{constructor(editor){_defineProperty(this,"editor",null),_defineProperty(this,"area",null),_defineProperty(this,"displayDialogue",(()=>{Modal.create({type:Modal.types.DEFAULT,large:!0,title:(0,_str.get_string)("mediamanagerproperties","tiny_media"),body:_templates.default.render("tiny_media/mm_iframe",{src:this.getIframeURL()})}).then((modal=>(modal.getRoot().on(ModalEvents.bodyRendered,(()=>{this.selectFirstElement()})),modal.getRoot().on(ModalEvents.hidden,(()=>{modal.destroy()})),modal.show(),document.querySelector(".modal-lg").style.cssText="max-width: 850px",modal))).catch()})),_defineProperty(this,"selectFirstElement",(()=>{const iframe=document.getElementById("mm-iframe");iframe.addEventListener("load",(function(){let intervalId=setInterval((function(){const iDocument=iframe.contentWindow.document;if(iDocument.querySelector(".filemanager")){const firstFocusableElement=iDocument.querySelector(".fp-navbar a:not([disabled])");firstFocusableElement&&firstFocusableElement.focus(),clearInterval(intervalId)}}),200)}))})),_defineProperty(this,"getIframeURL",(()=>{const url=new URL("".concat(_config.default.wwwroot,"/lib/editor/tiny/plugins/media/manage.php"));url.searchParams.append("elementid",this.editor.getElement().id);for(const key in this.area)url.searchParams.append(key,this.area[key]);return url.toString()})),this.editor=editor;const data=(0,_options.getData)(editor);this.area=data.params.area,this.area.itemid=data.fpoptions.image.itemid}}}));
define("tiny_media/manager",["exports","core/templates","core/str","core/modal_factory","core/modal_events","./options","core/config"],(function(_exports,_templates,_str,Modal,ModalEvents,_options,_config){function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!=typeof obj&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!==key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}return newObj.default=obj,cache&&cache.set(obj,newObj),newObj}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.MediaManager=void 0,_templates=_interopRequireDefault(_templates),Modal=_interopRequireWildcard(Modal),ModalEvents=_interopRequireWildcard(ModalEvents),_config=_interopRequireDefault(_config);_exports.MediaManager=class{constructor(editor){_defineProperty(this,"editor",null),_defineProperty(this,"area",null),_defineProperty(this,"displayDialogue",(()=>{Modal.create({type:Modal.types.DEFAULT,large:!0,title:(0,_str.get_string)("mediamanagerproperties","tiny_media"),body:_templates.default.render("tiny_media/mm_iframe",{src:this.getIframeURL()})}).then((modal=>(modal.getRoot().on(ModalEvents.bodyRendered,(()=>{this.selectFirstElement()})),modal.getRoot().on(ModalEvents.hidden,(()=>{modal.destroy()})),modal.show(),document.querySelector(".modal-lg").style.cssText="max-width: 850px",modal))).catch()})),_defineProperty(this,"selectFirstElement",(()=>{const iframe=document.getElementById("mm-iframe");iframe.addEventListener("load",(function(){let intervalId=setInterval((function(){const iDocument=iframe.contentWindow.document;if(iDocument.querySelector(".filemanager")){const firstFocusableElement=iDocument.querySelector(".fp-navbar a:not([disabled])");firstFocusableElement&&firstFocusableElement.focus(),clearInterval(intervalId)}}),200)}))})),_defineProperty(this,"getIframeURL",(()=>{const url=new URL("".concat(_config.default.wwwroot,"/lib/editor/tiny/plugins/media/manage.php"));url.searchParams.append("elementid",this.editor.getElement().id);for(const key in this.area)url.searchParams.append(key,this.area[key]);return url.toString()})),this.editor=editor;const data=(0,_options.getData)(editor);this.area=data.params.area,this.area.itemid=data.fpoptions.image.itemid}}}));
//# sourceMappingURL=manager.min.js.map
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
{"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 Media plugin.\n *\n * @module tiny_media/options\n * @copyright 2022 Huong Nguyen <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {getPluginOptionName} from 'editor_tiny/options';\nimport {pluginName} from './common';\n\nconst dataName = getPluginOptionName(pluginName, 'data');\nconst permissionsName = getPluginOptionName(pluginName, 'permissions');\n\n/**\n * Register the options for the Tiny Media plugin.\n *\n * @param {TinyMCE} editor\n */\nexport const register = (editor) => {\n const registerOption = editor.options.register;\n\n registerOption(permissionsName, {\n processor: 'object',\n \"default\": {\n image: {\n filepicker: false,\n }\n },\n });\n\n registerOption(dataName, {\n processor: 'object',\n });\n};\n\n/**\n * Get the permissions configuration for the Tiny Media plugin.\n *\n * @param {TinyMCE} editor\n * @returns {object}\n */\nexport const getPermissions = (editor) => editor.options.get(permissionsName);\n\n/**\n * Get the permissions configuration for the Tiny Media plugin.\n *\n * @param {TinyMCE} editor\n * @returns {object}\n */\nexport const getImagePermissions = (editor) => getPermissions(editor).image;\n\n/**\n * Get the permissions configuration for the Tiny Media plugin.\n *\n * @param {TinyMCE} editor\n * @returns {object}\n */\nexport const getEmbedPermissions = (editor) => getPermissions(editor).embed;\n\n/**\n * Get the data configuration for the Media Manager.\n *\n * @param {TinyMCE} editor\n * @returns {object}\n */\nexport const getData = (editor) => editor.options.get(dataName);\n"],"names":["dataName","getPluginOptionName","pluginName","permissionsName","_exports","register","editor","registerOption","options","processor","default","image","filepicker","getPermissions","get","getImagePermissions","getEmbedPermissions","embed","getData"],"mappings":";;;;;;;;AA0BA,MAAMA,UAAW,EAAAC,SAAAA,qBAAoBC,QAAUA,WAAE,QAC3CC,iBAAkB,EAAAF,SAAAA,qBAAoBC,QAAUA,WAAE,eAsBtDE,SAAAC,SAfuBC,SACrB,MAAMC,eAAiBD,OAAOE,QAAQH,SAEtCE,eAAeJ,gBAAiB,CAC5BM,UAAW,SACXC,QAAW,CACPC,MAAO,CACHC,YAAY,MAKxBL,eAAeP,SAAU,CACrBS,UAAW,UACb,EASC,MAAMI,eAAkBP,QAAWA,OAAOE,QAAQM,IAAIX,iBAAiBC,SAAAS,eAAAA,eAQFT,SAAAW,oBAAxCT,QAAWO,eAAeP,QAAQK,MAQMP,SAAAY,oBAAxCV,QAAWO,eAAeP,QAAQW,MAQNb,SAAAc,QAAxCZ,QAAWA,OAAOE,QAAQM,IAAId,SAAU"}
{"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 Media plugin.\n *\n * @module tiny_media/options\n * @copyright 2022 Huong Nguyen <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {getPluginOptionName} from 'editor_tiny/options';\nimport {pluginName} from './common';\n\nconst dataName = getPluginOptionName(pluginName, 'data');\nconst permissionsName = getPluginOptionName(pluginName, 'permissions');\n\n/**\n * Register the options for the Tiny Media plugin.\n *\n * @param {TinyMCE} editor\n */\nexport const register = (editor) => {\n const registerOption = editor.options.register;\n\n registerOption(permissionsName, {\n processor: 'object',\n \"default\": {\n image: {\n filepicker: false,\n }\n },\n });\n\n registerOption(dataName, {\n processor: 'object',\n });\n};\n\n/**\n * Get the permissions configuration for the Tiny Media plugin.\n *\n * @param {TinyMCE} editor\n * @returns {object}\n */\nexport const getPermissions = (editor) => editor.options.get(permissionsName);\n\n/**\n * Get the permissions configuration for the Tiny Media plugin.\n *\n * @param {TinyMCE} editor\n * @returns {object}\n */\nexport const getImagePermissions = (editor) => getPermissions(editor).image;\n\n/**\n * Get the permissions configuration for the Tiny Media plugin.\n *\n * @param {TinyMCE} editor\n * @returns {object}\n */\nexport const getEmbedPermissions = (editor) => getPermissions(editor).embed;\n\n/**\n * Get the data configuration for the Media Manager.\n *\n * @param {TinyMCE} editor\n * @returns {object}\n */\nexport const getData = (editor) => editor.options.get(dataName);\n"],"names":["dataName","pluginName","permissionsName","editor","registerOption","options","register","processor","image","filepicker","getPermissions","get","embed"],"mappings":";;;;;;;;MA0BMA,UAAW,gCAAoBC,mBAAY,QAC3CC,iBAAkB,gCAAoBD,mBAAY,iCAO/BE,eACfC,eAAiBD,OAAOE,QAAQC,SAEtCF,eAAeF,gBAAiB,CAC5BK,UAAW,iBACA,CACPC,MAAO,CACHC,YAAY,MAKxBL,eAAeJ,SAAU,CACrBO,UAAW,kBAUNG,eAAkBP,QAAWA,OAAOE,QAAQM,IAAIT,qFAQzBC,QAAWO,eAAeP,QAAQK,mCAQlCL,QAAWO,eAAeP,QAAQS,uBAQ9CT,QAAWA,OAAOE,QAAQM,IAAIX"}
@@ -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 <http://www.gnu.org/licenses/>.\n\n/**\n * Tiny Media plugin for Moodle.\n *\n * @module tiny_media/plugin\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport {getTinyMCE} from 'editor_tiny/loader';\nimport {getPluginMetadata} from 'editor_tiny/utils';\n\nimport {component, pluginName} from './common';\nimport * as Commands from './commands';\nimport * as Configuration from './configuration';\nimport * as Options from './options';\n\nexport default new Promise(async(resolve) => {\n const [\n tinyMCE,\n setupCommands,\n pluginMetadata,\n ] = await Promise.all([\n getTinyMCE(),\n Commands.getSetup(),\n getPluginMetadata(component, pluginName),\n ]);\n\n tinyMCE.PluginManager.add(`${component}/plugin`, (editor) => {\n // Register options.\n Options.register(editor);\n\n // Setup the Commands (buttons, menu items, and so on).\n setupCommands(editor);\n\n return pluginMetadata;\n });\n\n // Resolve the Media Plugin and include configuration.\n resolve([`${component}/plugin`, Configuration]);\n});\n"],"names":["_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","Commands","Configuration","Options","_default","Promise","async","tinyMCE","setupCommands","pluginMetadata","all","getTinyMCE","getSetup","getPluginMetadata","component","pluginName","PluginManager","add","concat","editor","register","resolve","_exports"],"mappings":"gNA4BqC,SAAAA,yBAAAC,aAAA,GAAA,mBAAAC,QAAA,OAAA,KAAA,IAAAC,kBAAAD,IAAAA,QAAAE,iBAAAF,IAAAA,eAAAF,yBAAA,SAAAC,aAAAA,OAAAA,YAAAG,iBAAAD,oBAAAF,YAAA,CAAA,SAAAI,wBAAAC,IAAAL,aAAAA,IAAAA,aAAAK,KAAAA,IAAAC,WAAAD,OAAAA,IAAAA,GAAAA,OAAAA,KAAAA,iBAAAA,KAAAE,mBAAAF,IAAAE,MAAAA,CAAAA,QAAAF,KAAAG,IAAAA,MAAAT,yBAAAC,aAAA,GAAAQ,OAAAA,MAAAC,IAAAJ,KAAA,OAAAG,MAAAE,IAAAL,KAAA,IAAAM,OAAAC,GAAAA,sBAAAC,OAAAC,gBAAAD,OAAAE,yBAAAC,IAAAA,IAAAA,OAAAX,IAAAW,eAAAA,KAAAH,OAAAI,UAAAC,eAAAC,KAAAd,IAAAW,KAAA,CAAA,IAAAI,KAAAR,sBAAAC,OAAAE,yBAAAV,IAAAW,KAAAI,KAAAA,OAAAA,KAAAV,KAAAU,KAAAC,KAAAR,OAAAC,eAAAH,OAAAK,IAAAI,MAAAT,OAAAK,KAAAX,IAAAW,IAAAL,QAAAA,OAAAJ,QAAAF,IAAAG,OAAAA,MAAAa,IAAAhB,IAAAM,QAAAA,MAAA;;;;;;;qFAFrCW,SAAAlB,wBAAAkB,UACAC,cAAAnB,wBAAAmB,eACAC,QAAApB,wBAAAoB,SAbA,IAAAC,SAee,IAAIC,SAAQC,gBACvB,MACIC,QACAC,cACAC,sBACMJ,QAAQK,IAAI,EAClB,EAAAC,QAAUA,cACVV,SAASW,YACT,EAAAC,OAAiBA,mBAACC,QAASA,UAAEC,QAAUA,cAG3CR,QAAQS,cAAcC,IAAG,GAAAC,OAAIJ,QAAAA,UAAqBK,YAAAA,SAE9ChB,QAAQiB,SAASD,QAGjBX,cAAcW,QAEPV,kBAIXY,QAAQ,IAAAH,OAAIJ,kBAAoBZ,WAAAA,eAAe,IACjD,OAAAoB,SAAApC,QAAAkB,SAAAkB,SAAApC,OAAA"}
{"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 <http://www.gnu.org/licenses/>.\n\n/**\n * Tiny Media plugin for Moodle.\n *\n * @module tiny_media/plugin\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport {getTinyMCE} from 'editor_tiny/loader';\nimport {getPluginMetadata} from 'editor_tiny/utils';\n\nimport {component, pluginName} from './common';\nimport * as Commands from './commands';\nimport * as Configuration from './configuration';\nimport * as Options from './options';\n\nexport default new Promise(async(resolve) => {\n const [\n tinyMCE,\n setupCommands,\n pluginMetadata,\n ] = await Promise.all([\n getTinyMCE(),\n Commands.getSetup(),\n getPluginMetadata(component, pluginName),\n ]);\n\n tinyMCE.PluginManager.add(`${component}/plugin`, (editor) => {\n // Register options.\n Options.register(editor);\n\n // Setup the Commands (buttons, menu items, and so on).\n setupCommands(editor);\n\n return pluginMetadata;\n });\n\n // Resolve the Media Plugin and include configuration.\n resolve([`${component}/plugin`, Configuration]);\n});\n"],"names":["Promise","async","tinyMCE","setupCommands","pluginMetadata","all","Commands","getSetup","component","pluginName","PluginManager","add","editor","Options","register","resolve","Configuration"],"mappings":";;;;;;;2OA8Be,IAAIA,SAAQC,MAAAA,gBAEnBC,QACAC,cACAC,sBACMJ,QAAQK,IAAI,EAClB,wBACAC,SAASC,YACT,4BAAkBC,kBAAWC,sBAGjCP,QAAQQ,cAAcC,cAAOH,8BAAqBI,SAE9CC,QAAQC,SAASF,QAGjBT,cAAcS,QAEPR,kBAIXW,QAAQ,WAAIP,6BAAoBQ"}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,3 +1,3 @@
define("tiny_recordrtc/audio_recorder",["exports","./base_recorder","./modal","core/modal_registry","tiny_recordrtc/common"],(function(_exports,_base_recorder,_modal,_modal_registry,_common){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return(key=function(arg){var key=function(input,hint){if("object"!=typeof input||null===input)return input;var prim=input[Symbol.toPrimitive];if(void 0!==prim){var res=prim.call(input,hint||"default");if("object"!=typeof res)return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}(arg,"string");return"symbol"==typeof key?key:String(key)}(key))in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_base_recorder=_interopRequireDefault(_base_recorder),_modal=_interopRequireDefault(_modal),_modal_registry=_interopRequireDefault(_modal_registry);class Audio extends _base_recorder.default{configurePlayer(){return this.modalRoot.querySelector("audio")}getSupportedTypes(){return["audio/webm;codecs=opus","audio/ogg;codecs=opus"]}getParsedRecordingOptions(){return{audioBitsPerSecond:parseInt(this.config.audiobitrate)}}getMediaConstraints(){return{audio:!0}}getRecordingType(){return"audio"}getTimeLimit(){return this.config.audiotimelimit}getEmbedTemplateName(){return"tiny_recordrtc/embed_audio"}getFileName(prefix){return"".concat(prefix,"-audio.ogg")}static getModalClass(){var _class;const modalType="".concat(_common.component,"/audio_recorder"),registration=_modal_registry.default.get(modalType);if(registration)return registration.module;const AudioModal=(_defineProperty(_class=class extends _modal.default{},"TYPE",modalType),_defineProperty(_class,"TEMPLATE","".concat(_common.component,"/audio_recorder")),_class);return _modal_registry.default.register(AudioModal.TYPE,AudioModal,AudioModal.TEMPLATE),AudioModal}}return _exports.default=Audio,_exports.default}));
define("tiny_recordrtc/audio_recorder",["exports","./base_recorder","./modal","core/modal_registry","tiny_recordrtc/common"],(function(_exports,_base_recorder,_modal,_modal_registry,_common){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_base_recorder=_interopRequireDefault(_base_recorder),_modal=_interopRequireDefault(_modal),_modal_registry=_interopRequireDefault(_modal_registry);class Audio extends _base_recorder.default{configurePlayer(){return this.modalRoot.querySelector("audio")}getSupportedTypes(){return["audio/webm;codecs=opus","audio/ogg;codecs=opus"]}getParsedRecordingOptions(){return{audioBitsPerSecond:parseInt(this.config.audiobitrate)}}getMediaConstraints(){return{audio:!0}}getRecordingType(){return"audio"}getTimeLimit(){return this.config.audiotimelimit}getEmbedTemplateName(){return"tiny_recordrtc/embed_audio"}getFileName(prefix){return"".concat(prefix,"-audio.ogg")}static getModalClass(){var _class;const modalType="".concat(_common.component,"/audio_recorder"),registration=_modal_registry.default.get(modalType);if(registration)return registration.module;const AudioModal=(_defineProperty(_class=class extends _modal.default{},"TYPE",modalType),_defineProperty(_class,"TEMPLATE","".concat(_common.component,"/audio_recorder")),_class);return _modal_registry.default.register(AudioModal.TYPE,AudioModal,AudioModal.TEMPLATE),AudioModal}}return _exports.default=Audio,_exports.default}));
//# sourceMappingURL=audio_recorder.min.js.map
@@ -1 +1 @@
{"version":3,"file":"audio_recorder.min.js","sources":["../src/audio_recorder.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 * Tiny Record RTC - audio recorder configuration.\n *\n * @module tiny_recordrtc/audio\n * @copyright 2022 Stevani Andolo <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport BaseClass from './base_recorder';\nimport Modal from './modal';\nimport ModalRegistry from 'core/modal_registry';\nimport {component} from 'tiny_recordrtc/common';\n\nexport default class Audio extends BaseClass {\n configurePlayer() {\n return this.modalRoot.querySelector('audio');\n }\n\n getSupportedTypes() {\n return [\n 'audio/webm;codecs=opus',\n 'audio/ogg;codecs=opus',\n ];\n }\n\n getParsedRecordingOptions() {\n return {\n audioBitsPerSecond: parseInt(this.config.audiobitrate),\n };\n }\n\n getMediaConstraints() {\n return {\n audio: true,\n };\n }\n\n getRecordingType() {\n return 'audio';\n }\n\n getTimeLimit() {\n return this.config.audiotimelimit;\n }\n\n getEmbedTemplateName() {\n return 'tiny_recordrtc/embed_audio';\n }\n\n getFileName(prefix) {\n return `${prefix}-audio.ogg`;\n }\n\n static getModalClass() {\n const modalType = `${component}/audio_recorder`;\n const registration = ModalRegistry.get(modalType);\n if (registration) {\n return registration.module;\n }\n\n const AudioModal = class extends Modal {\n static TYPE = modalType;\n static TEMPLATE = `${component}/audio_recorder`;\n };\n\n ModalRegistry.register(AudioModal.TYPE, AudioModal, AudioModal.TEMPLATE);\n return AudioModal;\n }\n}\n"],"names":["_interopRequireDefault","obj","__esModule","default","_defineProperty","key","value","arg","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","String","Number","_toPrimitive","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","_base_recorder","_modal","_modal_registry","Audio","BaseClass","configurePlayer","this","modalRoot","querySelector","getSupportedTypes","getParsedRecordingOptions","audioBitsPerSecond","parseInt","config","audiobitrate","getMediaConstraints","audio","getRecordingType","getTimeLimit","audiotimelimit","getEmbedTemplateName","getFileName","prefix","concat","static","_class","modalType","component","registration","ModalRegistry","get","module","AudioModal","Modal","register","TYPE","TEMPLATE","_exports"],"mappings":"+LAyBgD,SAAAA,uBAAAC,KAAAA,OAAAA,KAAAA,IAAAC,WAAAD,IAAAE,CAAAA,QAAAF,IAAA,CAAA,SAAAG,gBAAAH,IAAAI,IAAAC,cAAAD,IAAA,SAAAE,KAAAF,IAAAA,IAAA,SAAAG,MAAAC,SAAA,iBAAAD,OAAAA,OAAAA,MAAAA,OAAAA,UAAAE,KAAAF,MAAAG,OAAAC,aAAA,QAAAC,IAAAH,UAAAI,IAAAJ,KAAAK,KAAAP,MAAAC,MAAAK,WAAAA,oBAAAA,WAAAA,IAAA,MAAA,IAAAE,UAAAP,+CAAAA,CAAAA,kBAAAA,KAAAQ,OAAAC,QAAAV,MAAA,CAAAW,CAAAZ,IAAA,UAAA,MAAAF,iBAAAA,IAAAA,IAAAY,OAAAZ,IAAA,CAAAe,CAAAf,QAAAJ,IAAAoB,OAAAC,eAAArB,IAAAI,IAAA,CAAAC,MAAAA,MAAAiB,YAAA,EAAAC,cAAAC,EAAAA,cAAAxB,IAAAI,KAAAC,MAAAL,GAAA,iFAFhDyB,eAAA1B,uBAAA0B,gBACAC,OAAA3B,uBAAA2B,QACAC,gBAAA5B,uBAAA4B,iBAGe,MAAMC,cAAcC,eAAAA,QAC/BC,kBACI,OAAOC,KAAKC,UAAUC,cAAc,QACxC,CAEAC,oBACI,MAAO,CACH,yBACA,wBAER,CAEAC,4BACI,MAAO,CACHC,mBAAoBC,SAASN,KAAKO,OAAOC,cAEjD,CAEAC,sBACI,MAAO,CACHC,OAAO,EAEf,CAEAC,mBACI,MAAO,OACX,CAEAC,eACI,OAAOZ,KAAKO,OAAOM,cACvB,CAEAC,uBACI,MAAO,4BACX,CAEAC,YAAYC,QACR,MAAAC,GAAAA,OAAUD,OAAM,aACpB,CAEAE,uBAAuB,IAAAC,OACnB,MAAMC,UAAS,GAAAH,OAAMI,kBAA0B,mBACzCC,aAAeC,gBAAAA,QAAcC,IAAIJ,WACvC,GAAIE,aACA,OAAOA,aAAaG,OAGxB,MAAMC,YAGLtD,gBAHe+C,OAAG,cAAcQ,OAAKxD,UACpBiD,OAAAA,WAAShD,gBAAA+C,OAAAF,WAAAA,GAAAA,OACFI,QAAAA,UAASF,oBAAAA,QAIlC,OADAI,gBAAAA,QAAcK,SAASF,WAAWG,KAAMH,WAAYA,WAAWI,UACxDJ,UACX,EACH,OAAAK,SAAA5D,QAAA0B,MAAAkC,SAAA5D,OAAA"}
{"version":3,"file":"audio_recorder.min.js","sources":["../src/audio_recorder.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 * Tiny Record RTC - audio recorder configuration.\n *\n * @module tiny_recordrtc/audio\n * @copyright 2022 Stevani Andolo <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport BaseClass from './base_recorder';\nimport Modal from './modal';\nimport ModalRegistry from 'core/modal_registry';\nimport {component} from 'tiny_recordrtc/common';\n\nexport default class Audio extends BaseClass {\n configurePlayer() {\n return this.modalRoot.querySelector('audio');\n }\n\n getSupportedTypes() {\n return [\n 'audio/webm;codecs=opus',\n 'audio/ogg;codecs=opus',\n ];\n }\n\n getParsedRecordingOptions() {\n return {\n audioBitsPerSecond: parseInt(this.config.audiobitrate),\n };\n }\n\n getMediaConstraints() {\n return {\n audio: true,\n };\n }\n\n getRecordingType() {\n return 'audio';\n }\n\n getTimeLimit() {\n return this.config.audiotimelimit;\n }\n\n getEmbedTemplateName() {\n return 'tiny_recordrtc/embed_audio';\n }\n\n getFileName(prefix) {\n return `${prefix}-audio.ogg`;\n }\n\n static getModalClass() {\n const modalType = `${component}/audio_recorder`;\n const registration = ModalRegistry.get(modalType);\n if (registration) {\n return registration.module;\n }\n\n const AudioModal = class extends Modal {\n static TYPE = modalType;\n static TEMPLATE = `${component}/audio_recorder`;\n };\n\n ModalRegistry.register(AudioModal.TYPE, AudioModal, AudioModal.TEMPLATE);\n return AudioModal;\n }\n}\n"],"names":["Audio","BaseClass","configurePlayer","this","modalRoot","querySelector","getSupportedTypes","getParsedRecordingOptions","audioBitsPerSecond","parseInt","config","audiobitrate","getMediaConstraints","audio","getRecordingType","getTimeLimit","audiotimelimit","getEmbedTemplateName","getFileName","prefix","modalType","component","registration","ModalRegistry","get","module","AudioModal","Modal","register","TYPE","TEMPLATE"],"mappings":"+pBA4BqBA,cAAcC,uBAC/BC,yBACWC,KAAKC,UAAUC,cAAc,SAGxCC,0BACW,CACH,yBACA,yBAIRC,kCACW,CACHC,mBAAoBC,SAASN,KAAKO,OAAOC,eAIjDC,4BACW,CACHC,OAAO,GAIfC,yBACW,QAGXC,sBACWZ,KAAKO,OAAOM,eAGvBC,6BACW,6BAGXC,YAAYC,wBACEA,6DAIJC,oBAAeC,qCACfC,aAAeC,wBAAcC,IAAIJ,cACnCE,oBACOA,aAAaG,aAGlBC,mCAAa,cAAcC,wBACfP,uDACOC,6EAGXO,SAASF,WAAWG,KAAMH,WAAYA,WAAWI,UACxDJ"}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
{"version":3,"file":"commands_audio.min.js","sources":["../src/commands_audio.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 * Tiny Record RTC - record audio command.\n *\n * @module tiny_recordrtc/recordAudioCommands\n * @copyright 2022, Stevani Andolo <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {get_string as getString} from 'core/str';\nimport {getButtonImage} from 'editor_tiny/utils';\nimport {\n audioButtonName,\n component\n} from './common';\nimport Recorder from './audio_recorder';\nimport {isAudioAllowed} from './options';\n\nexport default async() => {\n if (!Recorder.isBrowserCompatible()) {\n // The browser doesn't support the plugin, so just don't show it.\n return () => false;\n }\n\n const [\n audioButtonTitle,\n audio,\n ] = await Promise.all([\n getString('audiobuttontitle', component),\n getButtonImage('audio', component),\n ]);\n\n return (editor) => {\n if (!isAudioAllowed(editor)) {\n return;\n }\n\n const icon = 'audio';\n editor.ui.registry.addIcon(icon, audio.html);\n\n editor.ui.registry.addButton(audioButtonName, {\n icon,\n tooltip: audioButtonTitle,\n onAction: () => Recorder.display(editor),\n });\n\n editor.ui.registry.addMenuItem(audioButtonName, {\n icon,\n text: audioButtonTitle,\n onAction: () => Recorder.display(editor),\n });\n };\n};\n"],"names":["obj","_audio_recorder","__esModule","default","_exports","async","Recorder","isBrowserCompatible","audioButtonTitle","audio","Promise","all","getString","component","getButtonImage","editor","isAudioAllowed","ui","registry","addIcon","html","addButton","audioButtonName","icon","tooltip","onAction","display","addMenuItem","text"],"mappings":"6LA6BwC,IAAAA;;;;;;;qFAAxCC,iBAAwCD,IAAxCC,kBAAwCD,IAAAE,WAAAF,IAAAG,CAAAA,QAAAH,KAqCvC,OAAAI,SAAAD,QAlCcE,UACX,IAAKC,gBAAAA,QAASC,sBAEV,MAAO,KAAM,EAGjB,MACIC,iBACAC,aACMC,QAAQC,IAAI,EAClB,EAAAC,KAAAA,YAAU,mBAAoBC,QAAAA,YAC9B,EAAAC,OAAAA,gBAAe,QAASD,QAAAA,aAG5B,OAAQE,SACJ,KAAK,EAAAC,SAAAA,gBAAeD,QAChB,OAIJA,OAAOE,GAAGC,SAASC,QADN,QACoBV,MAAMW,MAEvCL,OAAOE,GAAGC,SAASG,UAAUC,wBAAiB,CAC1CC,KAJS,QAKTC,QAAShB,iBACTiB,SAAUA,IAAMnB,wBAASoB,QAAQX,UAGrCA,OAAOE,GAAGC,SAASS,YAAYL,wBAAiB,CAC5CC,KAVS,QAWTK,KAAMpB,iBACNiB,SAAUA,IAAMnB,wBAASoB,QAAQX,SACnC,CACL,EACJX,SAAAD,OAAA"}
{"version":3,"file":"commands_audio.min.js","sources":["../src/commands_audio.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 * Tiny Record RTC - record audio command.\n *\n * @module tiny_recordrtc/recordAudioCommands\n * @copyright 2022, Stevani Andolo <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {get_string as getString} from 'core/str';\nimport {getButtonImage} from 'editor_tiny/utils';\nimport {\n audioButtonName,\n component\n} from './common';\nimport Recorder from './audio_recorder';\nimport {isAudioAllowed} from './options';\n\nexport default async() => {\n if (!Recorder.isBrowserCompatible()) {\n // The browser doesn't support the plugin, so just don't show it.\n return () => false;\n }\n\n const [\n audioButtonTitle,\n audio,\n ] = await Promise.all([\n getString('audiobuttontitle', component),\n getButtonImage('audio', component),\n ]);\n\n return (editor) => {\n if (!isAudioAllowed(editor)) {\n return;\n }\n\n const icon = 'audio';\n editor.ui.registry.addIcon(icon, audio.html);\n\n editor.ui.registry.addButton(audioButtonName, {\n icon,\n tooltip: audioButtonTitle,\n onAction: () => Recorder.display(editor),\n });\n\n editor.ui.registry.addMenuItem(audioButtonName, {\n icon,\n text: audioButtonTitle,\n onAction: () => Recorder.display(editor),\n });\n };\n};\n"],"names":["async","Recorder","isBrowserCompatible","audioButtonTitle","audio","Promise","all","component","editor","ui","registry","addIcon","html","addButton","audioButtonName","icon","tooltip","onAction","display","addMenuItem","text"],"mappings":";;;;;;;qLAgCeA,cACNC,wBAASC,4BAEH,KAAM,QAIbC,iBACAC,aACMC,QAAQC,IAAI,EAClB,mBAAU,mBAAoBC,oBAC9B,yBAAe,QAASA,4BAGpBC,cACC,2BAAeA,eAKpBA,OAAOC,GAAGC,SAASC,QADN,QACoBP,MAAMQ,MAEvCJ,OAAOC,GAAGC,SAASG,UAAUC,wBAAiB,CAC1CC,KAJS,QAKTC,QAASb,iBACTc,SAAU,IAAMhB,wBAASiB,QAAQV,UAGrCA,OAAOC,GAAGC,SAASS,YAAYL,wBAAiB,CAC5CC,KAVS,QAWTK,KAAMjB,iBACNc,SAAU,IAAMhB,wBAASiB,QAAQV"}
@@ -1 +1 @@
{"version":3,"file":"commands_video.min.js","sources":["../src/commands_video.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 * Tiny Record RTC - record video command.\n *\n * @module tiny_recordrtc/recordVideoCommands\n * @copyright 2022, Stevani Andolo <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {get_string as getString} from 'core/str';\nimport {getButtonImage as getVideoIcon} from 'editor_tiny/utils';\nimport {\n videoButtonName,\n component\n} from './common';\nimport {isVideoAllowed} from './options';\nimport Recorder from './video_recorder';\n\nexport default async() => {\n if (!Recorder.isBrowserCompatible()) {\n // The browser doesn't support the plugin, so just don't show it.\n return () => false;\n }\n\n const [\n videoButtonTitle,\n buttonImage,\n ] = await Promise.all([\n getString('videobuttontitle', component),\n getVideoIcon('video', component),\n ]);\n\n return (editor) => {\n if (!isVideoAllowed(editor)) {\n return;\n }\n\n const icon = 'video';\n editor.ui.registry.addIcon(icon, buttonImage.html);\n\n editor.ui.registry.addButton(videoButtonName, {\n icon,\n tooltip: videoButtonTitle,\n onAction: () => Recorder.display(editor),\n });\n\n editor.ui.registry.addMenuItem(videoButtonName, {\n icon,\n text: videoButtonTitle,\n onAction: () => Recorder.display(editor),\n });\n };\n};\n"],"names":["obj","_video_recorder","__esModule","default","_exports","async","Recorder","isBrowserCompatible","videoButtonTitle","buttonImage","Promise","all","getString","component","getVideoIcon","editor","isVideoAllowed","ui","registry","addIcon","html","addButton","videoButtonName","icon","tooltip","onAction","display","addMenuItem","text"],"mappings":"6LA8BwC,IAAAA;;;;;;;qFAAxCC,iBAAwCD,IAAxCC,kBAAwCD,IAAAE,WAAAF,IAAAG,CAAAA,QAAAH,KAoCvC,OAAAI,SAAAD,QAlCcE,UACX,IAAKC,gBAAAA,QAASC,sBAEV,MAAO,KAAM,EAGjB,MACIC,iBACAC,mBACMC,QAAQC,IAAI,EAClB,EAAAC,KAAAA,YAAU,mBAAoBC,QAAAA,YAC9B,EAAAC,OAAAA,gBAAa,QAASD,QAAAA,aAG1B,OAAQE,SACJ,KAAK,EAAAC,SAAAA,gBAAeD,QAChB,OAIJA,OAAOE,GAAGC,SAASC,QADN,QACoBV,YAAYW,MAE7CL,OAAOE,GAAGC,SAASG,UAAUC,wBAAiB,CAC1CC,KAJS,QAKTC,QAAShB,iBACTiB,SAAUA,IAAMnB,wBAASoB,QAAQX,UAGrCA,OAAOE,GAAGC,SAASS,YAAYL,wBAAiB,CAC5CC,KAVS,QAWTK,KAAMpB,iBACNiB,SAAUA,IAAMnB,wBAASoB,QAAQX,SACnC,CACL,EACJX,SAAAD,OAAA"}
{"version":3,"file":"commands_video.min.js","sources":["../src/commands_video.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 * Tiny Record RTC - record video command.\n *\n * @module tiny_recordrtc/recordVideoCommands\n * @copyright 2022, Stevani Andolo <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {get_string as getString} from 'core/str';\nimport {getButtonImage as getVideoIcon} from 'editor_tiny/utils';\nimport {\n videoButtonName,\n component\n} from './common';\nimport {isVideoAllowed} from './options';\nimport Recorder from './video_recorder';\n\nexport default async() => {\n if (!Recorder.isBrowserCompatible()) {\n // The browser doesn't support the plugin, so just don't show it.\n return () => false;\n }\n\n const [\n videoButtonTitle,\n buttonImage,\n ] = await Promise.all([\n getString('videobuttontitle', component),\n getVideoIcon('video', component),\n ]);\n\n return (editor) => {\n if (!isVideoAllowed(editor)) {\n return;\n }\n\n const icon = 'video';\n editor.ui.registry.addIcon(icon, buttonImage.html);\n\n editor.ui.registry.addButton(videoButtonName, {\n icon,\n tooltip: videoButtonTitle,\n onAction: () => Recorder.display(editor),\n });\n\n editor.ui.registry.addMenuItem(videoButtonName, {\n icon,\n text: videoButtonTitle,\n onAction: () => Recorder.display(editor),\n });\n };\n};\n"],"names":["async","Recorder","isBrowserCompatible","videoButtonTitle","buttonImage","Promise","all","component","editor","ui","registry","addIcon","html","addButton","videoButtonName","icon","tooltip","onAction","display","addMenuItem","text"],"mappings":";;;;;;;qLAgCeA,cACNC,wBAASC,4BAEH,KAAM,QAIbC,iBACAC,mBACMC,QAAQC,IAAI,EAClB,mBAAU,mBAAoBC,oBAC9B,yBAAa,QAASA,4BAGlBC,cACC,2BAAeA,eAKpBA,OAAOC,GAAGC,SAASC,QADN,QACoBP,YAAYQ,MAE7CJ,OAAOC,GAAGC,SAASG,UAAUC,wBAAiB,CAC1CC,KAJS,QAKTC,QAASb,iBACTc,SAAU,IAAMhB,wBAASiB,QAAQV,UAGrCA,OAAOC,GAAGC,SAASS,YAAYL,wBAAiB,CAC5CC,KAVS,QAWTK,KAAMjB,iBACNc,SAAU,IAAMhB,wBAASiB,QAAQV"}
@@ -1 +1 @@
{"version":3,"file":"common.min.js","sources":["../src/common.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 * Tiny Record RTC common values.\n *\n * @module tiny_recordrtc/common\n * @copyright 2022, Stevani Andolo <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nexport default {\n pluginName: 'tiny_recordrtc/plugin',\n component: 'tiny_recordrtc',\n audioButtonName: 'tiny_recordrtc_audio',\n videoButtonName: 'tiny_recordrtc_video'\n};\n"],"names":["_exports","default","pluginName","component","audioButtonName","videoButtonName"],"mappings":"+IA4BC,OAAAA,SAAAC,QALc,CACXC,WAAY,wBACZC,UAAW,iBACXC,gBAAiB,uBACjBC,gBAAiB,wBACpBL,SAAAC,OAAA"}
{"version":3,"file":"common.min.js","sources":["../src/common.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 * Tiny Record RTC common values.\n *\n * @module tiny_recordrtc/common\n * @copyright 2022, Stevani Andolo <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nexport default {\n pluginName: 'tiny_recordrtc/plugin',\n component: 'tiny_recordrtc',\n audioButtonName: 'tiny_recordrtc_audio',\n videoButtonName: 'tiny_recordrtc_video'\n};\n"],"names":["pluginName","component","audioButtonName","videoButtonName"],"mappings":"uKAuBe,CACXA,WAAY,wBACZC,UAAW,iBACXC,gBAAiB,uBACjBC,gBAAiB"}
@@ -1 +1 @@
{"version":3,"file":"configuration.min.js","sources":["../src/configuration.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 * Tiny Record RTC configuration.\n *\n * @module tiny_recordrtc/configuration\n * @copyright 2022, Stevani Andolo <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {\n audioButtonName,\n videoButtonName\n} from './common';\nimport {\n addMenubarItem,\n} from 'editor_tiny/utils';\n\nconst configureMenu = (menu) => {\n const items = menu.insert.items.split(' ');\n const inserted = items.some((item, index) => {\n // Append after the media or video button.\n if (item.match(/(media|video)\\b/)) {\n items.splice(index + 1, 0, audioButtonName, videoButtonName);\n return true;\n }\n\n return false;\n });\n\n if (inserted) {\n menu.insert.items = items.join(' ');\n } else {\n addMenubarItem(menu, 'insert', `${audioButtonName} ${videoButtonName}`);\n }\n\n return menu;\n};\n\nconst configureToolbar = (toolbar) => {\n // The toolbar contains an array of named sections.\n // The Moodle integration ensures that there is a section called 'content'.\n\n\n return toolbar.map((section) => {\n if (section.name === 'content') {\n const inserted = section.items.some((item, index) => {\n // Append after the media or video button.\n if (item.match(/(media|video)\\b/)) {\n section.items.splice(index + 1, 0, audioButtonName, videoButtonName);\n return true;\n }\n return false;\n });\n\n if (!inserted) {\n section.items.unshift(audioButtonName, videoButtonName);\n }\n }\n\n return section;\n });\n};\n\nexport const configure = (instanceConfig) => {\n // Update the instance configuration to add the Media menu option to the menus and toolbars and upload_handler.\n return {\n toolbar: configureToolbar(instanceConfig.toolbar),\n menu: configureMenu(instanceConfig.menu),\n };\n};\n"],"names":["configureMenu","menu","items","insert","split","some","item","index","match","splice","audioButtonName","videoButtonName","join","addMenubarItem","concat","_exports","configure","instanceConfig","toolbar","map","section","name","unshift"],"mappings":";;;;;;;;AA+BA,MAAMA,cAAiBC,OACnB,MAAMC,MAAQD,KAAKE,OAAOD,MAAME,MAAM,KAiBtC,OAhBiBF,MAAMG,MAAK,CAACC,KAAMC,UAE3BD,KAAKE,MAAM,qBACXN,MAAMO,OAAOF,MAAQ,EAAG,EAAGG,QAAAA,gBAAiBC,QAAAA,kBACrC,KAOXV,KAAKE,OAAOD,MAAQA,MAAMU,KAAK,MAE/B,EAAAC,OAAcA,gBAACZ,KAAM,SAAQ,GAAAa,OAAKJ,QAAeA,gBAAA,KAAAI,OAAIH,0BAGlDV,IAAI,EAkCbc,SAAAC,UANwBC,iBAEtB,MAAO,CACHC,SA5BkBA,QA4BQD,eAAeC,QAvBtCA,QAAQC,KAAKC,UACK,YAAjBA,QAAQC,OACSD,QAAQlB,MAAMG,MAAK,CAACC,KAAMC,UAEnCD,KAAKE,MAAM,qBACXY,QAAQlB,MAAMO,OAAOF,MAAQ,EAAG,EAAGG,QAAeA,gBAAEC,0BAC7C,MAMXS,QAAQlB,MAAMoB,QAAQZ,QAAeA,gBAAEC,0BAIxCS,YAQPnB,KAAMD,cAAciB,eAAehB,OA7BjBiB,WA8BrB,CACH"}
{"version":3,"file":"configuration.min.js","sources":["../src/configuration.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 * Tiny Record RTC configuration.\n *\n * @module tiny_recordrtc/configuration\n * @copyright 2022, Stevani Andolo <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {\n audioButtonName,\n videoButtonName\n} from './common';\nimport {\n addMenubarItem,\n} from 'editor_tiny/utils';\n\nconst configureMenu = (menu) => {\n const items = menu.insert.items.split(' ');\n const inserted = items.some((item, index) => {\n // Append after the media or video button.\n if (item.match(/(media|video)\\b/)) {\n items.splice(index + 1, 0, audioButtonName, videoButtonName);\n return true;\n }\n\n return false;\n });\n\n if (inserted) {\n menu.insert.items = items.join(' ');\n } else {\n addMenubarItem(menu, 'insert', `${audioButtonName} ${videoButtonName}`);\n }\n\n return menu;\n};\n\nconst configureToolbar = (toolbar) => {\n // The toolbar contains an array of named sections.\n // The Moodle integration ensures that there is a section called 'content'.\n\n\n return toolbar.map((section) => {\n if (section.name === 'content') {\n const inserted = section.items.some((item, index) => {\n // Append after the media or video button.\n if (item.match(/(media|video)\\b/)) {\n section.items.splice(index + 1, 0, audioButtonName, videoButtonName);\n return true;\n }\n return false;\n });\n\n if (!inserted) {\n section.items.unshift(audioButtonName, videoButtonName);\n }\n }\n\n return section;\n });\n};\n\nexport const configure = (instanceConfig) => {\n // Update the instance configuration to add the Media menu option to the menus and toolbars and upload_handler.\n return {\n toolbar: configureToolbar(instanceConfig.toolbar),\n menu: configureMenu(instanceConfig.menu),\n };\n};\n"],"names":["configureMenu","menu","items","insert","split","some","item","index","match","splice","audioButtonName","videoButtonName","join","instanceConfig","toolbar","map","section","name","unshift"],"mappings":";;;;;;;;MA+BMA,cAAiBC,aACbC,MAAQD,KAAKE,OAAOD,MAAME,MAAM,YACrBF,MAAMG,MAAK,CAACC,KAAMC,UAE3BD,KAAKE,MAAM,qBACXN,MAAMO,OAAOF,MAAQ,EAAG,EAAGG,wBAAiBC,0BACrC,KAOXV,KAAKE,OAAOD,MAAQA,MAAMU,KAAK,+BAEhBX,KAAM,mBAAaS,oCAAmBC,0BAGlDV,yBA4BeY,uBAEf,CACHC,SA5BkBA,QA4BQD,eAAeC,QAvBtCA,QAAQC,KAAKC,UACK,YAAjBA,QAAQC,OACSD,QAAQd,MAAMG,MAAK,CAACC,KAAMC,UAEnCD,KAAKE,MAAM,qBACXQ,QAAQd,MAAMO,OAAOF,MAAQ,EAAG,EAAGG,wBAAiBC,0BAC7C,MAMXK,QAAQd,MAAMgB,QAAQR,wBAAiBC,0BAIxCK,YAQPf,KAAMD,cAAca,eAAeZ,OA7BjBa,IAAAA"}
@@ -1 +1 @@
{"version":3,"file":"modal.min.js","sources":["../src/modal.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 * Abstract Recording Modal for TinyMCE's RecordRTC plugin.\n *\n * @module tiny_recordrtc/modal\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Modal from 'core/modal';\n\nexport default class extends Modal {\n registerEventListeners() {\n // Remove this Modal when it is closed.\n // This must be called before registering any other event listeners.\n this.setRemoveOnClose(true);\n\n // Call the parent registration.\n super.registerEventListeners();\n\n // Register to close on save/cancel.\n this.registerCloseOnSave();\n this.registerCloseOnCancel();\n }\n}\n"],"names":["obj","_modal","__esModule","default","_default","Modal","registerEventListeners","this","setRemoveOnClose","super","registerCloseOnSave","registerCloseOnCancel","_exports"],"mappings":"kFAuB+B,IAAAA;;;;;;;qFAA/BC,QAA+BD,IAA/BC,SAA+BD,IAAAE,WAAAF,IAAAG,CAAAA,QAAAH,KAEhB,MAAAI,iBAAcC,OAAAA,QACzBC,yBAGIC,KAAKC,kBAAiB,GAGtBC,MAAMH,yBAGNC,KAAKG,sBACLH,KAAKI,uBACT,EACH,OAAAC,SAAAT,QAAAC,SAAAQ,SAAAT,OAAA"}
{"version":3,"file":"modal.min.js","sources":["../src/modal.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 * Abstract Recording Modal for TinyMCE's RecordRTC plugin.\n *\n * @module tiny_recordrtc/modal\n * @copyright 2022 Andrew Lyons <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Modal from 'core/modal';\n\nexport default class extends Modal {\n registerEventListeners() {\n // Remove this Modal when it is closed.\n // This must be called before registering any other event listeners.\n this.setRemoveOnClose(true);\n\n // Call the parent registration.\n super.registerEventListeners();\n\n // Register to close on save/cancel.\n this.registerCloseOnSave();\n this.registerCloseOnCancel();\n }\n}\n"],"names":["Modal","registerEventListeners","setRemoveOnClose","registerCloseOnSave","registerCloseOnCancel"],"mappings":";;;;;;;kKAyB6BA,eACzBC,8BAGSC,kBAAiB,SAGhBD,8BAGDE,2BACAC"}
@@ -1 +1 @@
{"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 Record RTC plugin.\n *\n * @module tiny_recordrtc/options\n * @copyright 2022, Stevani Andolo <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {pluginName} from './common';\nimport {getPluginOptionName} from 'editor_tiny/options';\n\nconst dataName = getPluginOptionName(pluginName, 'data');\nconst videoAllowedName = getPluginOptionName(pluginName, 'videoAllowed');\nconst audioAllowedName = getPluginOptionName(pluginName, 'audioAllowed');\n\nexport const register = (editor) => {\n const registerOption = editor.options.register;\n\n registerOption(dataName, {\n processor: 'object',\n });\n\n registerOption(videoAllowedName, {\n processor: 'boolean',\n \"default\": false,\n });\n\n registerOption(audioAllowedName, {\n processor: 'boolean',\n \"default\": false,\n });\n};\n\nexport const getData = (editor) => editor.options.get(dataName);\n\n/**\n * Whether video may be recorded in this instance.\n *\n * @param {TinyMCE} editor\n * @returns {boolean}\n */\nexport const isAudioAllowed = (editor) => editor.options.get(audioAllowedName);\n\n/**\n * Whether audio may be recorded in this instance.\n *\n * @param {TinyMCE} editor\n * @returns {boolean}\n */\nexport const isVideoAllowed = (editor) => editor.options.get(videoAllowedName);\n"],"names":["dataName","getPluginOptionName","pluginName","videoAllowedName","audioAllowedName","_exports","register","editor","registerOption","options","processor","default","getData","get","isAudioAllowed","isVideoAllowed"],"mappings":";;;;;;;;AA0BA,MAAMA,UAAW,EAAAC,SAAAA,qBAAoBC,QAAUA,WAAE,QAC3CC,kBAAmB,EAAAF,SAAAA,qBAAoBC,QAAUA,WAAE,gBACnDE,kBAAmB,EAAAH,SAAAA,qBAAoBC,QAAUA,WAAE,gBAkBvDG,SAAAC,SAhBuBC,SACrB,MAAMC,eAAiBD,OAAOE,QAAQH,SAEtCE,eAAeR,SAAU,CACrBU,UAAW,WAGfF,eAAeL,iBAAkB,CAC7BO,UAAW,UACXC,SAAW,IAGfH,eAAeJ,iBAAkB,CAC7BM,UAAW,UACXC,SAAW,GACb,EAG0DN,SAAAO,QAAxCL,QAAWA,OAAOE,QAAQI,IAAIb,UAQyBK,SAAAS,eAAhDP,QAAWA,OAAOE,QAAQI,IAAIT,kBAQkBC,SAAAU,eAAhDR,QAAWA,OAAOE,QAAQI,IAAIV,iBAAkB"}
{"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 Record RTC plugin.\n *\n * @module tiny_recordrtc/options\n * @copyright 2022, Stevani Andolo <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {pluginName} from './common';\nimport {getPluginOptionName} from 'editor_tiny/options';\n\nconst dataName = getPluginOptionName(pluginName, 'data');\nconst videoAllowedName = getPluginOptionName(pluginName, 'videoAllowed');\nconst audioAllowedName = getPluginOptionName(pluginName, 'audioAllowed');\n\nexport const register = (editor) => {\n const registerOption = editor.options.register;\n\n registerOption(dataName, {\n processor: 'object',\n });\n\n registerOption(videoAllowedName, {\n processor: 'boolean',\n \"default\": false,\n });\n\n registerOption(audioAllowedName, {\n processor: 'boolean',\n \"default\": false,\n });\n};\n\nexport const getData = (editor) => editor.options.get(dataName);\n\n/**\n * Whether video may be recorded in this instance.\n *\n * @param {TinyMCE} editor\n * @returns {boolean}\n */\nexport const isAudioAllowed = (editor) => editor.options.get(audioAllowedName);\n\n/**\n * Whether audio may be recorded in this instance.\n *\n * @param {TinyMCE} editor\n * @returns {boolean}\n */\nexport const isVideoAllowed = (editor) => editor.options.get(videoAllowedName);\n"],"names":["dataName","pluginName","videoAllowedName","audioAllowedName","editor","registerOption","options","register","processor","get"],"mappings":";;;;;;;;MA0BMA,UAAW,gCAAoBC,mBAAY,QAC3CC,kBAAmB,gCAAoBD,mBAAY,gBACnDE,kBAAmB,gCAAoBF,mBAAY,kCAEhCG,eACfC,eAAiBD,OAAOE,QAAQC,SAEtCF,eAAeL,SAAU,CACrBQ,UAAW,WAGfH,eAAeH,iBAAkB,CAC7BM,UAAW,mBACA,IAGfH,eAAeF,iBAAkB,CAC7BK,UAAW,mBACA,sBAIKJ,QAAWA,OAAOE,QAAQG,IAAIT,kCAQvBI,QAAWA,OAAOE,QAAQG,IAAIN,0CAQ9BC,QAAWA,OAAOE,QAAQG,IAAIP"}
@@ -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 <http://www.gnu.org/licenses/>.\n\n/**\n * Tiny Record RTC plugin for Moodle.\n *\n * @module tiny_recordrtc/plugin\n * @copyright 2022, Stevani Andolo <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport {getTinyMCE} from 'editor_tiny/loader';\nimport {getPluginMetadata} from 'editor_tiny/utils';\nimport getSetupAudioCommands from './commands_audio';\nimport getSetupVideoCommands from './commands_video';\nimport * as Configuration from './configuration';\nimport * as Options from './options';\nimport {\n component,\n pluginName\n} from './common';\n\nexport default new Promise(async(resolve) => {\n const [\n tinyMCE,\n setupAudioCommands,\n setupVideoCommands,\n pluginMetadata,\n ] = await Promise.all([\n getTinyMCE(),\n getSetupAudioCommands(),\n getSetupVideoCommands(),\n getPluginMetadata(component, pluginName),\n ]);\n\n tinyMCE.PluginManager.add(`${component}/plugin`, (editor) => {\n // Register options.\n Options.register(editor);\n\n // Setup the Commands (buttons, menu items, and so on) for video.\n setupVideoCommands(editor);\n\n // Setup the Commands (buttons, menu items, and so on) for audio.\n setupAudioCommands(editor);\n\n return pluginMetadata;\n });\n\n // Resolve the Media Plugin and include configuration.\n resolve([`${component}/plugin`, Configuration]);\n});\n"],"names":["_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_interopRequireDefault","_commands_audio","_commands_video","Configuration","Options","_default","Promise","async","tinyMCE","setupAudioCommands","setupVideoCommands","pluginMetadata","all","getTinyMCE","getSetupAudioCommands","getSetupVideoCommands","getPluginMetadata","component","pluginName","PluginManager","add","concat","editor","register","resolve","_exports"],"mappings":"oQA2BqC,SAAAA,yBAAAC,aAAA,GAAA,mBAAAC,QAAA,OAAA,KAAA,IAAAC,kBAAAD,IAAAA,QAAAE,iBAAAF,IAAAA,eAAAF,yBAAA,SAAAC,aAAAA,OAAAA,YAAAG,iBAAAD,oBAAAF,YAAA,CAAA,SAAAI,wBAAAC,IAAAL,aAAAA,IAAAA,aAAAK,KAAAA,IAAAC,WAAAD,OAAAA,IAAAA,GAAAA,OAAAA,KAAAA,iBAAAA,KAAAE,mBAAAF,IAAAE,MAAAA,CAAAA,QAAAF,KAAAG,IAAAA,MAAAT,yBAAAC,aAAA,GAAAQ,OAAAA,MAAAC,IAAAJ,KAAA,OAAAG,MAAAE,IAAAL,KAAA,IAAAM,OAAAC,GAAAA,sBAAAC,OAAAC,gBAAAD,OAAAE,yBAAAC,IAAAA,IAAAA,OAAAX,IAAAW,eAAAA,KAAAH,OAAAI,UAAAC,eAAAC,KAAAd,IAAAW,KAAA,CAAA,IAAAI,KAAAR,sBAAAC,OAAAE,yBAAAV,IAAAW,KAAAI,KAAAA,OAAAA,KAAAV,KAAAU,KAAAC,KAAAR,OAAAC,eAAAH,OAAAK,IAAAI,MAAAT,OAAAK,KAAAX,IAAAW,IAAAL,QAAAA,OAAAJ,QAAAF,IAAAG,OAAAA,MAAAa,IAAAhB,IAAAM,QAAAA,MAAA,CAAA,SAAAW,uBAAAjB,KAAAA,OAAAA,KAAAA,IAAAC,WAAAD,IAAAE,CAAAA,QAAAF,IAAA;;;;;;;qFAHrCkB,gBAAAD,uBAAAC,iBACAC,gBAAAF,uBAAAE,iBACAC,cAAArB,wBAAAqB,eACAC,QAAAtB,wBAAAsB,SAZA,IAAAC,SAkBe,IAAIC,SAAQC,gBACvB,MACIC,QACAC,mBACAC,mBACAC,sBACML,QAAQM,IAAI,EAClB,EAAAC,QAAAA,eACA,EAAAC,gBAAqB7B,YACrB,EAAA8B,4BACA,EAAAC,OAAAA,mBAAkBC,QAASA,UAAEC,QAAUA,cAG3CV,QAAQW,cAAcC,IAAG,GAAAC,OAAIJ,QAAAA,UAAqBK,YAAAA,SAE9ClB,QAAQmB,SAASD,QAGjBZ,mBAAmBY,QAGnBb,mBAAmBa,QAEZX,kBAIXa,QAAQ,IAAAH,OAAIJ,kBAAoBd,WAAAA,eAAe,IACjD,OAAAsB,SAAAxC,QAAAoB,SAAAoB,SAAAxC,OAAA"}
{"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 <http://www.gnu.org/licenses/>.\n\n/**\n * Tiny Record RTC plugin for Moodle.\n *\n * @module tiny_recordrtc/plugin\n * @copyright 2022, Stevani Andolo <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport {getTinyMCE} from 'editor_tiny/loader';\nimport {getPluginMetadata} from 'editor_tiny/utils';\nimport getSetupAudioCommands from './commands_audio';\nimport getSetupVideoCommands from './commands_video';\nimport * as Configuration from './configuration';\nimport * as Options from './options';\nimport {\n component,\n pluginName\n} from './common';\n\nexport default new Promise(async(resolve) => {\n const [\n tinyMCE,\n setupAudioCommands,\n setupVideoCommands,\n pluginMetadata,\n ] = await Promise.all([\n getTinyMCE(),\n getSetupAudioCommands(),\n getSetupVideoCommands(),\n getPluginMetadata(component, pluginName),\n ]);\n\n tinyMCE.PluginManager.add(`${component}/plugin`, (editor) => {\n // Register options.\n Options.register(editor);\n\n // Setup the Commands (buttons, menu items, and so on) for video.\n setupVideoCommands(editor);\n\n // Setup the Commands (buttons, menu items, and so on) for audio.\n setupAudioCommands(editor);\n\n return pluginMetadata;\n });\n\n // Resolve the Media Plugin and include configuration.\n resolve([`${component}/plugin`, Configuration]);\n});\n"],"names":["Promise","async","tinyMCE","setupAudioCommands","setupVideoCommands","pluginMetadata","all","component","pluginName","PluginManager","add","editor","Options","register","resolve","Configuration"],"mappings":";;;;;;;gTAiCe,IAAIA,SAAQC,MAAAA,gBAEnBC,QACAC,mBACAC,mBACAC,sBACML,QAAQM,IAAI,EAClB,yBACA,8BACA,8BACA,4BAAkBC,kBAAWC,sBAGjCN,QAAQO,cAAcC,cAAOH,8BAAqBI,SAE9CC,QAAQC,SAASF,QAGjBP,mBAAmBO,QAGnBR,mBAAmBQ,QAEZN,kBAIXS,QAAQ,WAAIP,6BAAoBQ"}
@@ -1,3 +1,3 @@
define("tiny_recordrtc/video_recorder",["exports","./base_recorder","tiny_recordrtc/modal","core/modal_registry","tiny_recordrtc/common"],(function(_exports,_base_recorder,_modal,_modal_registry,_common){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return(key=function(arg){var key=function(input,hint){if("object"!=typeof input||null===input)return input;var prim=input[Symbol.toPrimitive];if(void 0!==prim){var res=prim.call(input,hint||"default");if("object"!=typeof res)return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}(arg,"string");return"symbol"==typeof key?key:String(key)}(key))in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_base_recorder=_interopRequireDefault(_base_recorder),_modal=_interopRequireDefault(_modal),_modal_registry=_interopRequireDefault(_modal_registry);class Video extends _base_recorder.default{configurePlayer(){return this.modalRoot.querySelector("video")}getSupportedTypes(){return["video/webm;codecs=vp9,opus","video/webm;codecs=h264,opus","video/webm;codecs=vp8,opus"]}getParsedRecordingOptions(){return{audioBitsPerSecond:parseInt(this.config.audiobitrate),videoBitsPerSecond:parseInt(this.config.videobitrate)}}getMediaConstraints(){return{audio:!0,video:{width:{ideal:640},height:{ideal:480}}}}playOnCapture(){return!0}getRecordingType(){return"video"}getTimeLimit(){return this.config.videotimelimit}getEmbedTemplateName(){return"tiny_recordrtc/embed_video"}getFileName(prefix){return"".concat(prefix,"-video.webm")}static getModalClass(){var _class;const modalType="".concat(_common.component,"/video_recorder"),registration=_modal_registry.default.get(modalType);if(registration)return registration.module;const VideoModal=(_defineProperty(_class=class extends _modal.default{},"TYPE",modalType),_defineProperty(_class,"TEMPLATE","".concat(_common.component,"/video_recorder")),_class);return _modal_registry.default.register(VideoModal.TYPE,VideoModal,VideoModal.TEMPLATE),VideoModal}}return _exports.default=Video,_exports.default}));
define("tiny_recordrtc/video_recorder",["exports","./base_recorder","tiny_recordrtc/modal","core/modal_registry","tiny_recordrtc/common"],(function(_exports,_base_recorder,_modal,_modal_registry,_common){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_base_recorder=_interopRequireDefault(_base_recorder),_modal=_interopRequireDefault(_modal),_modal_registry=_interopRequireDefault(_modal_registry);class Video extends _base_recorder.default{configurePlayer(){return this.modalRoot.querySelector("video")}getSupportedTypes(){return["video/webm;codecs=vp9,opus","video/webm;codecs=h264,opus","video/webm;codecs=vp8,opus"]}getParsedRecordingOptions(){return{audioBitsPerSecond:parseInt(this.config.audiobitrate),videoBitsPerSecond:parseInt(this.config.videobitrate)}}getMediaConstraints(){return{audio:!0,video:{width:{ideal:640},height:{ideal:480}}}}playOnCapture(){return!0}getRecordingType(){return"video"}getTimeLimit(){return this.config.videotimelimit}getEmbedTemplateName(){return"tiny_recordrtc/embed_video"}getFileName(prefix){return"".concat(prefix,"-video.webm")}static getModalClass(){var _class;const modalType="".concat(_common.component,"/video_recorder"),registration=_modal_registry.default.get(modalType);if(registration)return registration.module;const VideoModal=(_defineProperty(_class=class extends _modal.default{},"TYPE",modalType),_defineProperty(_class,"TEMPLATE","".concat(_common.component,"/video_recorder")),_class);return _modal_registry.default.register(VideoModal.TYPE,VideoModal,VideoModal.TEMPLATE),VideoModal}}return _exports.default=Video,_exports.default}));
//# sourceMappingURL=video_recorder.min.js.map
File diff suppressed because one or more lines are too long