Merge branch 'MDL-79088-master' of https://github.com/marinaglancy/moodle
[moodle.git] / h5p / amd / build / editor_display.min.js
blobcdfb52b779e4bfc3378950137defaa0914ed7c7d
1 define("core_h5p/editor_display",["exports","jquery"],(function(_exports,_jquery){var obj;
2 /**
3    * This module handles the display of the H5P authoring tool.
4    *
5    * @module     core_h5p/editor_display
6    * @copyright  2020 Victor Deniz <victor@moodle.com>
7    * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
8    */Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=void 0,_jquery=(obj=_jquery)&&obj.__esModule?obj:{default:obj};_exports.init=elementId=>{const editorwrapper=(0,_jquery.default)("#"+elementId),editor=(0,_jquery.default)(".h5p-editor"),mform=editor.closest("form"),editorupload=(0,_jquery.default)("h5p-editor-upload"),h5plibrary=(0,_jquery.default)('input[name="h5plibrary"]'),h5pparams=(0,_jquery.default)('input[name="h5pparams"]'),inputname=(0,_jquery.default)('input[name="name"]'),h5paction=(0,_jquery.default)('input[name="h5paction"]');h5paction.val("create"),H5PEditor.init(mform,h5paction,editorupload,editorwrapper,editor,h5plibrary,h5pparams,"",inputname,(function($button){return $button.is('[name="cancel"]')})),document.querySelector("#"+elementId+" iframe").setAttribute("name","h5p-editor")}}));
10 //# sourceMappingURL=editor_display.min.js.map