Proyectos de Subversion Moodle

Rev

Autoría | Ultima modificación | Ver Log |

{"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/commands_audio\n * @copyright   2022, Stevani Andolo <stevani@hotmail.com.au>\n * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {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,kBAAU,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"}