mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 08:22:07 +02:00
MDL-68578 contenttype_h5p: Add name attribute to editor iframe
The switch_to_class_iframe step needs a name attribute for the iframe. H5P third party library does not add that name attribute, so we add it.
This commit is contained in:
parent
3149defec1
commit
6219740b8e
2
h5p/amd/build/editor_display.min.js
vendored
2
h5p/amd/build/editor_display.min.js
vendored
@ -1,2 +1,2 @@
|
||||
define ("core_h5p/editor_display",["exports","jquery"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);var c=function(a){var c=(0,b.default)("#"+a),d=(0,b.default)(".h5p-editor"),e=d.closest("form"),f=(0,b.default)("h5p-editor-upload"),g=(0,b.default)("input[name=\"h5plibrary\"]"),h=(0,b.default)("input[name=\"h5pparams\"]"),i=(0,b.default)("input[name=\"name\"]"),j=(0,b.default)("input[name=\"h5paction\"]");j.val("create");H5PEditor.init(e,j,f,c,d,g,h,"",i,function cancelSubmitCallback(a){return a.is("[name=\"cancel\"]")})};a.init=c});
|
||||
define ("core_h5p/editor_display",["exports","jquery"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);var c=function(a){var c=(0,b.default)("#"+a),d=(0,b.default)(".h5p-editor"),e=d.closest("form"),f=(0,b.default)("h5p-editor-upload"),g=(0,b.default)("input[name=\"h5plibrary\"]"),h=(0,b.default)("input[name=\"h5pparams\"]"),i=(0,b.default)("input[name=\"name\"]"),j=(0,b.default)("input[name=\"h5paction\"]");j.val("create");H5PEditor.init(e,j,f,c,d,g,h,"",i,function cancelSubmitCallback(a){return a.is("[name=\"cancel\"]")});document.querySelector("#"+a+" iframe").setAttribute("name","h5p-editor")};a.init=c});
|
||||
//# sourceMappingURL=editor_display.min.js.map
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"sources":["../src/editor_display.js"],"names":["init","elementId","editorwrapper","editor","mform","closest","editorupload","h5plibrary","h5pparams","inputname","h5paction","val","H5PEditor","cancelSubmitCallback","$button","is"],"mappings":"iJAwBA,uDAQO,GAAMA,CAAAA,CAAI,CAAG,SAACC,CAAD,CAAe,IACzBC,CAAAA,CAAa,CAAG,cAAE,IAAMD,CAAR,CADS,CAEzBE,CAAM,CAAG,cAAE,aAAF,CAFgB,CAGzBC,CAAK,CAAGD,CAAM,CAACE,OAAP,CAAe,MAAf,CAHiB,CAIzBC,CAAY,CAAG,cAAE,mBAAF,CAJU,CAKzBC,CAAU,CAAG,cAAE,4BAAF,CALY,CAMzBC,CAAS,CAAG,cAAE,2BAAF,CANa,CAOzBC,CAAS,CAAG,cAAE,sBAAF,CAPa,CAQzBC,CAAS,CAAG,cAAE,2BAAF,CARa,CAe/BA,CAAS,CAACC,GAAV,CAAc,QAAd,EAEAC,SAAS,CAACZ,IAAV,CACII,CADJ,CAEIM,CAFJ,CAGIJ,CAHJ,CAIIJ,CAJJ,CAKIC,CALJ,CAMII,CANJ,CAOIC,CAPJ,CAQI,EARJ,CASIC,CATJ,CAN6B,QAAvBI,CAAAA,oBAAuB,CAASC,CAAT,CAAkB,CAC3C,MAAOA,CAAAA,CAAO,CAACC,EAAR,CAAW,mBAAX,CACV,CAID,CAYH,CA7BM,C","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 * @package core_h5p\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};\n"],"file":"editor_display.min.js"}
|
||||
{"version":3,"sources":["../src/editor_display.js"],"names":["init","elementId","editorwrapper","editor","mform","closest","editorupload","h5plibrary","h5pparams","inputname","h5paction","val","H5PEditor","cancelSubmitCallback","$button","is","document","querySelector","setAttribute"],"mappings":"iJAwBA,uDAQO,GAAMA,CAAAA,CAAI,CAAG,SAACC,CAAD,CAAe,IACzBC,CAAAA,CAAa,CAAG,cAAE,IAAMD,CAAR,CADS,CAEzBE,CAAM,CAAG,cAAE,aAAF,CAFgB,CAGzBC,CAAK,CAAGD,CAAM,CAACE,OAAP,CAAe,MAAf,CAHiB,CAIzBC,CAAY,CAAG,cAAE,mBAAF,CAJU,CAKzBC,CAAU,CAAG,cAAE,4BAAF,CALY,CAMzBC,CAAS,CAAG,cAAE,2BAAF,CANa,CAOzBC,CAAS,CAAG,cAAE,sBAAF,CAPa,CAQzBC,CAAS,CAAG,cAAE,2BAAF,CARa,CAe/BA,CAAS,CAACC,GAAV,CAAc,QAAd,EAEAC,SAAS,CAACZ,IAAV,CACII,CADJ,CAEIM,CAFJ,CAGIJ,CAHJ,CAIIJ,CAJJ,CAKIC,CALJ,CAMII,CANJ,CAOIC,CAPJ,CAQI,EARJ,CASIC,CATJ,CAN6B,QAAvBI,CAAAA,oBAAuB,CAASC,CAAT,CAAkB,CAC3C,MAAOA,CAAAA,CAAO,CAACC,EAAR,CAAW,mBAAX,CACV,CAID,EAYAC,QAAQ,CAACC,aAAT,CAAuB,IAAMhB,CAAN,CAAkB,SAAzC,EAAoDiB,YAApD,CAAiE,MAAjE,CAAyE,YAAzE,CACH,CA9BM,C","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 * @package core_h5p\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"],"file":"editor_display.min.js"}
|
@ -59,4 +59,5 @@ export const init = (elementId) => {
|
||||
inputname,
|
||||
cancelSubmitCallback
|
||||
);
|
||||
document.querySelector('#' + elementId + ' iframe').setAttribute('name', 'h5p-editor');
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user