AutorÃa | Ultima modificación | Ver Log |
{"version":3,"file":"editor_display.min.js","sources":["../src/editor_display.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 * This module handles the display of the H5P authoring tool.\n *\n * @module core_h5p/editor_display\n * @copyright 2020 Victor Deniz <victor@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU
GPL v3 or later\n */\n\nimport $ from 'jquery';\n/* global H5PEditor */\n\n/**\n * Display the H5P authoring tool.\n *\n * @param {String} elementId Root element.\n */\nexport const init = (elementId) => {\n const editorwrapper = $('#' + elementId);\n const editor = $('.h5p-editor');\n const mform = editor.closest(\"form\");\n const editorupload = $(\"h5p-editor-upload\");\n const h5plibrary = $('input[name=\"h5plibrary\"]');\n const h5pparams = $('input[name=\"h5pparams\"]');\n const inputname = $('input[name=\"name\"]');\n const h5paction = $('input[name=\"h5paction\"]');\n\n // Cancel validation and submission of form if clicking cancel button.\n const cancelSubmitCallback = function($button) {\n return $button.is('[name=\"cancel\"]');\n };\n\n h5paction.val(\"create\");\n\n H5PEditor.init(\n mform,\n h5paction,\n editorupload,\n editorwrapper,\n editor,\n h5plibrary,\n h5pparams,\n '',\n inputname
,\n cancelSubmitCallback\n );\n document.querySelector('#' + elementId + ' iframe').setAttribute('name', 'h5p-editor');\n};\n"],"names":["elementId","editorwrapper","editor","mform","closest","editorupload","h5plibrary","h5pparams","inputname","h5paction","val","H5PEditor","init","$button","is","document","querySelector","setAttribute"],"mappings":";;;;;;;wJA+BqBA,kBACXC,eAAgB,mBAAE,IAAMD,WACxBE,QAAS,mBAAE,eACXC,MAAQD,OAAOE,QAAQ,QACvBC,cAAe,mBAAE,qBACjBC,YAAa,mBAAE,4BACfC,WAAY,mBAAE,2BACdC,WAAY,mBAAE,sBACdC,WAAY,mBAAE,2BAOpBA,UAAUC,IAAI,UAEdC,UAAUC,KACNT,MACAM,UACAJ,aACAJ,cACAC,OACAI,WACAC,UACA,GACAC,WAfyB,SAASK,gBAC3BA,QAAQC,GAAG,sBAiBtBC,SAASC,cAAc,IAAMhB,UAAY,WAAWiB,aAAa,OAAQ"}