diff --git a/local/kaltura/yui/build/moodle-local_kaltura-ltipanel/moodle-local_kaltura-ltipanel-debug.js b/local/kaltura/yui/build/moodle-local_kaltura-ltipanel/moodle-local_kaltura-ltipanel-debug.js index 63b6efd2..5a7c876a 100644 --- a/local/kaltura/yui/build/moodle-local_kaltura-ltipanel/moodle-local_kaltura-ltipanel-debug.js +++ b/local/kaltura/yui/build/moodle-local_kaltura-ltipanel/moodle-local_kaltura-ltipanel-debug.js @@ -91,11 +91,27 @@ Y.extend(LTIPANEL, Y.Base, { } document.body.bsePopup = bsePopup; - var entrySelectedEvent = new Event('entrySelected'); - document.body.myEvent = entrySelectedEvent; + var entrySelectedEvent = this.createEntrySelectedEvent(); + document.body.entrySelectedEvent = entrySelectedEvent; document.body.addEventListener('entrySelected', this.close_popup_callback.bind(this), false); }, + createEntrySelectedEvent: function() { + var entrySelectedEvent; + if(typeof window.CustomEvent === 'function') { + entrySelectedEvent = new CustomEvent('entrySelected'); + } + else { + // ie >= 9 + entrySelectedEvent = document.createEvent('CustomEvent'); + entrySelectedEvent.initCustomEvent('entrySelected', false, false, {}); + } + + return entrySelectedEvent; + }, + + + /** * Event handler callback for when a simulated click event is triggered on a specifc element. */ @@ -197,9 +213,23 @@ Y.extend(LTIPANELMEDIAASSIGNMENT, Y.Base, { } document.body.bsePopup = bsePopup; - var entrySelectedEvent = new Event('entrySelected'); - document.body.myEvent = entrySelectedEvent; - document.body.addEventListener('entrySelected', this.close_popup_callback.bind(this)); + var entrySelectedEvent = this.createEntrySelectedEvent(); + document.body.entrySelectedEvent = entrySelectedEvent; + document.body.addEventListener('entrySelected', this.close_popup_callback.bind(this), false); + }, + + createEntrySelectedEvent: function() { + var entrySelectedEvent; + if(typeof window.CustomEvent === 'function') { + entrySelectedEvent = new CustomEvent('entrySelected'); + } + else { + // ie >= 9 + entrySelectedEvent = document.createEvent('CustomEvent'); + entrySelectedEvent.initCustomEvent('entrySelected', false, false, {}); + } + + return entrySelectedEvent; }, close_popup_callback: function() { diff --git a/local/kaltura/yui/build/moodle-local_kaltura-ltipanel/moodle-local_kaltura-ltipanel-min.js b/local/kaltura/yui/build/moodle-local_kaltura-ltipanel/moodle-local_kaltura-ltipanel-min.js index 0b130567..7f62e64c 100644 --- a/local/kaltura/yui/build/moodle-local_kaltura-ltipanel/moodle-local_kaltura-ltipanel-min.js +++ b/local/kaltura/yui/build/moodle-local_kaltura-ltipanel/moodle-local_kaltura-ltipanel-min.js @@ -1 +1 @@ -YUI.add("moodle-local_kaltura-ltipanel",function(e,t){var i=function(){i.superclass.constructor.apply(this,arguments)};e.extend(i,e.Base,{modulename:null,addvidbtnid:null,init:function(t){if("0"===t.addvidbtnid||"0"===t.ltilaunchurl||0===t.courseid||0===t.height||0===t.width)return void alert("Some parameters were not initialized.");this.modulename=t.modulename,this.addvidbtnid=t.addvidbtnid;var i=e.one("#"+t.addvidbtnid);i.on("click",this.open_bse_popup_callback,this,t.ltilaunchurl,t.height,t.width)},open_bse_popup_callback:function(e,t,i,n){var d=1200,a=700,o=void 0!=window.screenLeft?window.screenLeft:screen.left,l=void 0!=window.screenTop?window.screenTop:screen.top,n=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,i=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,u=n/2-d/2+o,s=i/2-a/2+l,c=window.open(t,M.util.get_string("browse_and_embed","local_kaltura"),"scrollbars=yes, width="+d+", height="+a+", top="+s+", left="+u);window.focus&&c.focus(),document.body.bsePopup=c;var r=new Event("entrySelected");document.body.myEvent=r,document.body.addEventListener("entrySelected",this.close_popup_callback.bind(this),!1)},close_popup_callback:function(){var t=e.one("img[id=video_thumbnail]");t.setStyle("display","none");var i=e.one("iframe[id=contentframe]");i.setAttribute("width",e.one("input[id=width]").getAttribute("value")),i.setAttribute("height",e.one("input[id=height]").getAttribute("value")),i.setStyle("display","inline");var n=e.one("input[name=modulename]");void 0===n||"kalvidres"!==this.modulename&&"kalvidpres"!==this.modulename||this.lti_panel_change_add_media_button_caption(),document.body.bsePopup.close()},lti_panel_change_add_media_button_caption:function(){var t=M.util.get_string("replace_video",this.modulename);t!==e.one("#"+this.addvidbtnid).getAttribute("value")&&e.one("#"+this.addvidbtnid).setAttribute("value",t)}},{NAME:"moodle-local_kaltura-ltipanel",ATTRS:{addvidbtnid:{value:"0"},ltilaunchurl:{value:"0"},height:{value:0},width:{value:0},modulename:{value:""}}});var n=function(){n.superclass.constructor.apply(this,arguments)};e.extend(n,e.Base,{init:function(t){if("0"!==t.addvidbtnid&&"0"!==t.ltilaunchurl&&0!==t.courseid&&0!==t.height&&0!==t.width){var i=e.one("#"+t.addvidbtnid);i.on("click",this.open_bse_popup_callback,this,t.ltilaunchurl,t.height,t.width)}},open_bse_popup_callback:function(e,t,i,n){var d=1200,a=700,o=void 0!=window.screenLeft?window.screenLeft:screen.left,l=void 0!=window.screenTop?window.screenTop:screen.top,n=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,i=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,u=n/2-d/2+o,s=i/2-a/2+l,c=window.open(t,M.util.get_string("browse_and_embed","local_kaltura"),"scrollbars=no, width="+d+", height="+a+", top="+s+", left="+u);window.focus&&c.focus(),document.body.bsePopup=c;var r=new Event("entrySelected");document.body.myEvent=r,document.body.addEventListener("entrySelected",this.close_popup_callback.bind(this))},close_popup_callback:function(){e.one("input[id=submit_video]").removeAttribute("disabled");var t=e.one("img[id=video_thumbnail]");t.setStyle("display","none");var i=e.one("iframe[id=contentframe]");i.setAttribute("width",e.one("input[id=width]").getAttribute("value")),i.setAttribute("height",e.one("input[id=height]").getAttribute("value")),i.setStyle("display","inline"),e.one("#id_add_video").set("value",M.util.get_string("replacevideo","kalvidassign")),document.body.bsePopup.close()}},{NAME:"moodle-local_kaltura-ltipanel",ATTRS:{addvidbtnid:{value:"0"},ltilaunchurl:{value:"0"},height:{value:0},width:{value:0}}});var d=function(){d.superclass.constructor.apply(this,arguments)};e.extend(d,e.Base,{ltimediaassignment:null,init:function(t){this.ltimediaassignment=t,e.one("form[id=fastgrade]").delegate("click",this.review_submission,"a[name=submission_source]",this)},review_submission:function(e){e.preventDefault();var t,i,n;e.target.test("a")?(t=e.target.getAttribute("href"),i=e.target.ancestor("div[name=media_submission]").get("childNodes").filter("input[name=height]").get("value"),n=e.target.ancestor("div[name=media_submission]").get("childNodes").filter("input[name=width]").get("value")):(t=e.target.ancestor("a[name=submission_source]").getAttribute("href"),i=e.target.ancestor("div[name=media_submission]").get("childNodes").filter("input[name=height]").get("value"),n=e.target.ancestor("div[name=media_submission]").get("childNodes").filter("input[name=width]").get("value")),this.ltimediaassignment.open_bse_popup_callback(null,t,i,n)}},{NAME:"moodle-local_kaltura-ltipanel"}),M.local_kaltura=M.local_kaltura||{},M.local_kaltura.init=function(e){return new i(e)},M.local_kaltura.initmediaassignment=function(e){return new n(e)},M.local_kaltura.initreviewsubmission=function(){var e={addvidbtnid:"0",ltilaunchurl:"0",courseid:0,height:0,width:0},t=new n(e);return new d(t)}},"@VERSION@",{requires:["base","node","panel","node-event-simulate"]}); \ No newline at end of file +YUI.add("moodle-local_kaltura-ltipanel",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.extend(n,e.Base,{modulename:null,addvidbtnid:null,init:function(t){if("0"===t.addvidbtnid||"0"===t.ltilaunchurl||0===t.courseid||0===t.height||0===t.width)return void alert("Some parameters were not initialized.");this.modulename=t.modulename,this.addvidbtnid=t.addvidbtnid;var n=e.one("#"+t.addvidbtnid);n.on("click",this.open_bse_popup_callback,this,t.ltilaunchurl,t.height,t.width)},open_bse_popup_callback:function(e,t,n,i){var d=1200,o=700,a=void 0!=window.screenLeft?window.screenLeft:screen.left,l=void 0!=window.screenTop?window.screenTop:screen.top,i=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,n=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,u=i/2-d/2+a,s=n/2-o/2+l,c=window.open(t,M.util.get_string("browse_and_embed","local_kaltura"),"scrollbars=yes, width="+d+", height="+o+", top="+s+", left="+u);window.focus&&c.focus(),document.body.bsePopup=c;var r=this.createEntrySelectedEvent();document.body.entrySelectedEvent=r,document.body.addEventListener("entrySelected",this.close_popup_callback.bind(this),!1)},createEntrySelectedEvent:function(){var e;return"function"==typeof window.CustomEvent?e=new CustomEvent("entrySelected"):(e=document.createEvent("CustomEvent"),e.initCustomEvent("entrySelected",!1,!1,{})),e},close_popup_callback:function(){var t=e.one("img[id=video_thumbnail]");t.setStyle("display","none");var n=e.one("iframe[id=contentframe]");n.setAttribute("width",e.one("input[id=width]").getAttribute("value")),n.setAttribute("height",e.one("input[id=height]").getAttribute("value")),n.setStyle("display","inline");var i=e.one("input[name=modulename]");void 0===i||"kalvidres"!==this.modulename&&"kalvidpres"!==this.modulename||this.lti_panel_change_add_media_button_caption(),document.body.bsePopup.close()},lti_panel_change_add_media_button_caption:function(){var t=M.util.get_string("replace_video",this.modulename);t!==e.one("#"+this.addvidbtnid).getAttribute("value")&&e.one("#"+this.addvidbtnid).setAttribute("value",t)}},{NAME:"moodle-local_kaltura-ltipanel",ATTRS:{addvidbtnid:{value:"0"},ltilaunchurl:{value:"0"},height:{value:0},width:{value:0},modulename:{value:""}}});var i=function(){i.superclass.constructor.apply(this,arguments)};e.extend(i,e.Base,{init:function(t){if("0"!==t.addvidbtnid&&"0"!==t.ltilaunchurl&&0!==t.courseid&&0!==t.height&&0!==t.width){var n=e.one("#"+t.addvidbtnid);n.on("click",this.open_bse_popup_callback,this,t.ltilaunchurl,t.height,t.width)}},open_bse_popup_callback:function(e,t,n,i){var d=1200,o=700,a=void 0!=window.screenLeft?window.screenLeft:screen.left,l=void 0!=window.screenTop?window.screenTop:screen.top,i=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,n=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,u=i/2-d/2+a,s=n/2-o/2+l,c=window.open(t,M.util.get_string("browse_and_embed","local_kaltura"),"scrollbars=no, width="+d+", height="+o+", top="+s+", left="+u);window.focus&&c.focus(),document.body.bsePopup=c;var r=this.createEntrySelectedEvent();document.body.entrySelectedEvent=r,document.body.addEventListener("entrySelected",this.close_popup_callback.bind(this),!1)},createEntrySelectedEvent:function(){var e;return"function"==typeof window.CustomEvent?e=new CustomEvent("entrySelected"):(e=document.createEvent("CustomEvent"),e.initCustomEvent("entrySelected",!1,!1,{})),e},close_popup_callback:function(){e.one("input[id=submit_video]").removeAttribute("disabled");var t=e.one("img[id=video_thumbnail]");t.setStyle("display","none");var n=e.one("iframe[id=contentframe]");n.setAttribute("width",e.one("input[id=width]").getAttribute("value")),n.setAttribute("height",e.one("input[id=height]").getAttribute("value")),n.setStyle("display","inline"),e.one("#id_add_video").set("value",M.util.get_string("replacevideo","kalvidassign")),document.body.bsePopup.close()}},{NAME:"moodle-local_kaltura-ltipanel",ATTRS:{addvidbtnid:{value:"0"},ltilaunchurl:{value:"0"},height:{value:0},width:{value:0}}});var d=function(){d.superclass.constructor.apply(this,arguments)};e.extend(d,e.Base,{ltimediaassignment:null,init:function(t){this.ltimediaassignment=t,e.one("form[id=fastgrade]").delegate("click",this.review_submission,"a[name=submission_source]",this)},review_submission:function(e){e.preventDefault();var t,n,i;e.target.test("a")?(t=e.target.getAttribute("href"),n=e.target.ancestor("div[name=media_submission]").get("childNodes").filter("input[name=height]").get("value"),i=e.target.ancestor("div[name=media_submission]").get("childNodes").filter("input[name=width]").get("value")):(t=e.target.ancestor("a[name=submission_source]").getAttribute("href"),n=e.target.ancestor("div[name=media_submission]").get("childNodes").filter("input[name=height]").get("value"),i=e.target.ancestor("div[name=media_submission]").get("childNodes").filter("input[name=width]").get("value")),this.ltimediaassignment.open_bse_popup_callback(null,t,n,i)}},{NAME:"moodle-local_kaltura-ltipanel"}),M.local_kaltura=M.local_kaltura||{},M.local_kaltura.init=function(e){return new n(e)},M.local_kaltura.initmediaassignment=function(e){return new i(e)},M.local_kaltura.initreviewsubmission=function(){var e={addvidbtnid:"0",ltilaunchurl:"0",courseid:0,height:0,width:0},t=new i(e);return new d(t)}},"@VERSION@",{requires:["base","node","panel","node-event-simulate"]}); \ No newline at end of file diff --git a/local/kaltura/yui/build/moodle-local_kaltura-ltipanel/moodle-local_kaltura-ltipanel.js b/local/kaltura/yui/build/moodle-local_kaltura-ltipanel/moodle-local_kaltura-ltipanel.js index 63b6efd2..5a7c876a 100644 --- a/local/kaltura/yui/build/moodle-local_kaltura-ltipanel/moodle-local_kaltura-ltipanel.js +++ b/local/kaltura/yui/build/moodle-local_kaltura-ltipanel/moodle-local_kaltura-ltipanel.js @@ -91,11 +91,27 @@ Y.extend(LTIPANEL, Y.Base, { } document.body.bsePopup = bsePopup; - var entrySelectedEvent = new Event('entrySelected'); - document.body.myEvent = entrySelectedEvent; + var entrySelectedEvent = this.createEntrySelectedEvent(); + document.body.entrySelectedEvent = entrySelectedEvent; document.body.addEventListener('entrySelected', this.close_popup_callback.bind(this), false); }, + createEntrySelectedEvent: function() { + var entrySelectedEvent; + if(typeof window.CustomEvent === 'function') { + entrySelectedEvent = new CustomEvent('entrySelected'); + } + else { + // ie >= 9 + entrySelectedEvent = document.createEvent('CustomEvent'); + entrySelectedEvent.initCustomEvent('entrySelected', false, false, {}); + } + + return entrySelectedEvent; + }, + + + /** * Event handler callback for when a simulated click event is triggered on a specifc element. */ @@ -197,9 +213,23 @@ Y.extend(LTIPANELMEDIAASSIGNMENT, Y.Base, { } document.body.bsePopup = bsePopup; - var entrySelectedEvent = new Event('entrySelected'); - document.body.myEvent = entrySelectedEvent; - document.body.addEventListener('entrySelected', this.close_popup_callback.bind(this)); + var entrySelectedEvent = this.createEntrySelectedEvent(); + document.body.entrySelectedEvent = entrySelectedEvent; + document.body.addEventListener('entrySelected', this.close_popup_callback.bind(this), false); + }, + + createEntrySelectedEvent: function() { + var entrySelectedEvent; + if(typeof window.CustomEvent === 'function') { + entrySelectedEvent = new CustomEvent('entrySelected'); + } + else { + // ie >= 9 + entrySelectedEvent = document.createEvent('CustomEvent'); + entrySelectedEvent.initCustomEvent('entrySelected', false, false, {}); + } + + return entrySelectedEvent; }, close_popup_callback: function() { diff --git a/local/kaltura/yui/build/moodle-local_kaltura-ltiservice/moodle-local_kaltura-ltiservice-debug.js b/local/kaltura/yui/build/moodle-local_kaltura-ltiservice/moodle-local_kaltura-ltiservice-debug.js index 2f37f020..3b457805 100644 --- a/local/kaltura/yui/build/moodle-local_kaltura-ltiservice/moodle-local_kaltura-ltiservice-debug.js +++ b/local/kaltura/yui/build/moodle-local_kaltura-ltiservice/moodle-local_kaltura-ltiservice-debug.js @@ -39,6 +39,9 @@ Y.extend(LTISERVICE, Y.Base, { * @type {Object} */ init : function(params) { + +debugger; + var documentElement = window.opener ? window.opener.parent.document : window.parent.document; if (documentElement.getElementById('video_title')) { Y.one(documentElement.getElementById('video_title')).setAttribute('value', params.title); @@ -83,7 +86,7 @@ Y.extend(LTISERVICE, Y.Base, { Y.one(documentElement.getElementById('closeltipanel')).simulate('click'); } - documentElement.body.dispatchEvent(documentElement.body.myEvent); + documentElement.body.dispatchEvent(documentElement.body.entrySelectedEvent); } }, { diff --git a/local/kaltura/yui/build/moodle-local_kaltura-ltiservice/moodle-local_kaltura-ltiservice-min.js b/local/kaltura/yui/build/moodle-local_kaltura-ltiservice/moodle-local_kaltura-ltiservice-min.js index 7ea40ce5..7de72c43 100644 --- a/local/kaltura/yui/build/moodle-local_kaltura-ltiservice/moodle-local_kaltura-ltiservice-min.js +++ b/local/kaltura/yui/build/moodle-local_kaltura-ltiservice/moodle-local_kaltura-ltiservice-min.js @@ -1 +1 @@ -YUI.add("moodle-local_kaltura-ltiservice",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.extend(n,e.Base,{init:function(t){var n=window.opener?window.opener.parent.document:window.parent.document;n.getElementById("video_title")&&e.one(n.getElementById("video_title")).setAttribute("value",t.title),n.getElementById("entry_id")&&e.one(n.getElementById("entry_id")).setAttribute("value",t.entryid),n.getElementById("height")&&e.one(n.getElementById("height")).setAttribute("value",t.height),n.getElementById("width")&&e.one(n.getElementById("width")).setAttribute("value",t.width),n.getElementById("uiconf_id")&&e.one(n.getElementById("uiconf_id")).setAttribute("value","1"),n.getElementById("widescreen")&&e.one(n.getElementById("widescreen")).setAttribute("value","1"),n.getElementById("video_preview_frame")?e.one(n.getElementById("video_preview_frame")).setAttribute("src",t.previewltilauncher):n.getElementById("contentframe")&&(e.one(n.getElementById("contentframe")).setAttribute("src",decodeURIComponent(t.iframeurl)),e.one(n.getElementById("contentframe")).setStyle("width",t.width+"px"),e.one(n.getElementById("contentframe")).setStyle("height",t.height+"px")),e.one(n.getElementById("source")).setAttribute("value",decodeURIComponent(t.iframeurl)),n.getElementById("metadata")&&e.one(n.getElementById("metadata")).setAttribute("value",t.metadata),n.getElementById("closeltipanel")&&e.one(n.getElementById("closeltipanel")).simulate("click"),n.body.dispatchEvent(n.body.myEvent)}},{NAME:"moodle-local_kaltura-ltiservice",ATTRS:{iframeurl:{value:""},width:{value:""},height:{value:""},entryid:{value:""},title:{value:""},metadata:{value:""}}}),M.local_kaltura=M.local_kaltura||{},M.local_kaltura.init=function(e){return new n(e)}},"@VERSION@",{requires:["base","node","node-event-simulate"]}); \ No newline at end of file +YUI.add("moodle-local_kaltura-ltiservice",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.extend(n,e.Base,{init:function(t){var n=window.opener?window.opener.parent.document:window.parent.document;n.getElementById("video_title")&&e.one(n.getElementById("video_title")).setAttribute("value",t.title),n.getElementById("entry_id")&&e.one(n.getElementById("entry_id")).setAttribute("value",t.entryid),n.getElementById("height")&&e.one(n.getElementById("height")).setAttribute("value",t.height),n.getElementById("width")&&e.one(n.getElementById("width")).setAttribute("value",t.width),n.getElementById("uiconf_id")&&e.one(n.getElementById("uiconf_id")).setAttribute("value","1"),n.getElementById("widescreen")&&e.one(n.getElementById("widescreen")).setAttribute("value","1"),n.getElementById("video_preview_frame")?e.one(n.getElementById("video_preview_frame")).setAttribute("src",t.previewltilauncher):n.getElementById("contentframe")&&(e.one(n.getElementById("contentframe")).setAttribute("src",decodeURIComponent(t.iframeurl)),e.one(n.getElementById("contentframe")).setStyle("width",t.width+"px"),e.one(n.getElementById("contentframe")).setStyle("height",t.height+"px")),e.one(n.getElementById("source")).setAttribute("value",decodeURIComponent(t.iframeurl)),n.getElementById("metadata")&&e.one(n.getElementById("metadata")).setAttribute("value",t.metadata),n.getElementById("closeltipanel")&&e.one(n.getElementById("closeltipanel")).simulate("click"),n.body.dispatchEvent(n.body.entrySelectedEvent)}},{NAME:"moodle-local_kaltura-ltiservice",ATTRS:{iframeurl:{value:""},width:{value:""},height:{value:""},entryid:{value:""},title:{value:""},metadata:{value:""}}}),M.local_kaltura=M.local_kaltura||{},M.local_kaltura.init=function(e){return new n(e)}},"@VERSION@",{requires:["base","node","node-event-simulate"]}); \ No newline at end of file diff --git a/local/kaltura/yui/build/moodle-local_kaltura-ltiservice/moodle-local_kaltura-ltiservice.js b/local/kaltura/yui/build/moodle-local_kaltura-ltiservice/moodle-local_kaltura-ltiservice.js index 2f37f020..c0a22b6b 100644 --- a/local/kaltura/yui/build/moodle-local_kaltura-ltiservice/moodle-local_kaltura-ltiservice.js +++ b/local/kaltura/yui/build/moodle-local_kaltura-ltiservice/moodle-local_kaltura-ltiservice.js @@ -83,7 +83,7 @@ Y.extend(LTISERVICE, Y.Base, { Y.one(documentElement.getElementById('closeltipanel')).simulate('click'); } - documentElement.body.dispatchEvent(documentElement.body.myEvent); + documentElement.body.dispatchEvent(documentElement.body.entrySelectedEvent); } }, {