mirror of
https://gh.llkk.cc/https://github.com/h5p/moodle-mod_hvp.git
synced 2026-03-04 13:36:41 +08:00
* JI-5522 disably activityheader for embed in moodle4.0+ * JI-5522 fix resizing for embedded h5ps
3 lines
No EOL
819 B
JavaScript
3 lines
No EOL
819 B
JavaScript
define("mod_hvp/communicator",[],(function(){var H5PEmbedCommunicator=function(){this._actionHandlers={},this.registerEventListeners()};return H5PEmbedCommunicator.prototype._actionHandlers={},H5PEmbedCommunicator.prototype.on=function(action,handler){this._actionHandlers[action]=handler},H5PEmbedCommunicator.prototype.send=function(action,data){void 0===data&&(data={}),data.context="h5p",data.action=action,window.parent.postMessage(data,"*")},H5PEmbedCommunicator.prototype.registerEventListeners=function(){var self=this;window.addEventListener("message",(function(event){window.parent===event.source&&"h5p"===event.data.context&&void 0!==self._actionHandlers[event.data.action]&&self._actionHandlers[event.data.action](event.data)}),!1)},new H5PEmbedCommunicator}));
|
|
|
|
//# sourceMappingURL=communicator.min.js.map
|