From 022695ac74578c55d555d3c71f920a717355e6c5 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Thu, 3 May 2018 10:27:06 +0200 Subject: [PATCH 1/4] JI-575 Add support for file aggregation --- js/h5p-content-upgrade-worker.js | 2 +- js/h5p-event-dispatcher.js | 2 +- js/h5p-x-api-event.js | 2 +- js/h5p-x-api.js | 2 +- js/h5p.js | 2 +- js/jquery.js | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/js/h5p-content-upgrade-worker.js b/js/h5p-content-upgrade-worker.js index 26ad038..44b6949 100644 --- a/js/h5p-content-upgrade-worker.js +++ b/js/h5p-content-upgrade-worker.js @@ -1,4 +1,4 @@ -var H5P = H5P || {}; +var H5P = window.H5P = window.H5P || {}; importScripts('h5p-version.js', 'h5p-content-upgrade-process.js'); var libraryLoadedCallback; diff --git a/js/h5p-event-dispatcher.js b/js/h5p-event-dispatcher.js index 592e8cf..a6707b4 100644 --- a/js/h5p-event-dispatcher.js +++ b/js/h5p-event-dispatcher.js @@ -1,4 +1,4 @@ -var H5P = H5P || {}; +var H5P = window.H5P = window.H5P || {}; /** * The Event class for the EventDispatcher. diff --git a/js/h5p-x-api-event.js b/js/h5p-x-api-event.js index e5d6368..c1d6c66 100644 --- a/js/h5p-x-api-event.js +++ b/js/h5p-x-api-event.js @@ -1,4 +1,4 @@ -var H5P = H5P || {}; +var H5P = window.H5P = window.H5P || {}; /** * Used for xAPI events. diff --git a/js/h5p-x-api.js b/js/h5p-x-api.js index 1cf8b74..8a27eb9 100644 --- a/js/h5p-x-api.js +++ b/js/h5p-x-api.js @@ -1,4 +1,4 @@ -var H5P = H5P || {}; +var H5P = window.H5P = window.H5P || {}; /** * The external event dispatcher. Others, outside of H5P may register and diff --git a/js/h5p.js b/js/h5p.js index dd74a79..1b899d3 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -2,7 +2,7 @@ // TODO: Should we split up the generic parts needed by the editor(and others), and the parts needed to "run" H5Ps? /** @namespace */ -var H5P = H5P || {}; +var H5P = window.H5P = window.H5P || {}; /** * Tells us if we're inside of an iframe. diff --git a/js/jquery.js b/js/jquery.js index d821060..90a3b83 100644 --- a/js/jquery.js +++ b/js/jquery.js @@ -5,7 +5,7 @@ return(!i||i!==r&&!b.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,a // Snap this specific version of jQuery into H5P. jQuery.noConflict will // revert the globals to what they were before this file was loaded. -var H5P = H5P || {}; +var H5P = window.H5P = window.H5P || {}; /** * jQuery v1.9.1 From d99ab7eda2c4e81092d4babf1eca6a593c6e9a46 Mon Sep 17 00:00:00 2001 From: Paal Joergensen Date: Tue, 8 May 2018 11:30:54 +0200 Subject: [PATCH 2/4] HFP-1994 Bump core minor version --- h5p.classes.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/h5p.classes.php b/h5p.classes.php index d8ed62e..310de97 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -1770,10 +1770,10 @@ abstract class H5PHubEndpoints { * Functions and storage shared by the other H5P classes */ class H5PCore { - + public static $coreApi = array( 'majorVersion' => 1, - 'minorVersion' => 14 + 'minorVersion' => 15 ); public static $styles = array( 'styles/h5p.css', From 942a083afa46e37f872a35b06890de3414237dcd Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Thu, 3 May 2018 13:50:40 +0200 Subject: [PATCH 3/4] JI-575 Fix content upgrade script --- js/h5p-content-upgrade-worker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/h5p-content-upgrade-worker.js b/js/h5p-content-upgrade-worker.js index 44b6949..26ad038 100644 --- a/js/h5p-content-upgrade-worker.js +++ b/js/h5p-content-upgrade-worker.js @@ -1,4 +1,4 @@ -var H5P = window.H5P = window.H5P || {}; +var H5P = H5P || {}; importScripts('h5p-version.js', 'h5p-content-upgrade-process.js'); var libraryLoadedCallback; From 3ce0adf418a57d68ca00e5c40ea6ddebe888b217 Mon Sep 17 00:00:00 2001 From: thomasmars Date: Fri, 1 Jun 2018 11:09:45 +0200 Subject: [PATCH 4/4] HFP-1942 Add crossorigin api call. Update minor version of core since interface changes --- h5p.classes.php | 2 +- js/h5p.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/h5p.classes.php b/h5p.classes.php index 310de97..2efebbd 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -1773,7 +1773,7 @@ class H5PCore { public static $coreApi = array( 'majorVersion' => 1, - 'minorVersion' => 15 + 'minorVersion' => 16 ); public static $styles = array( 'styles/h5p.css', diff --git a/js/h5p.js b/js/h5p.js index 1b899d3..ef56834 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -1938,6 +1938,16 @@ H5P.createTitle = function (rawTitle, maxLength) { } }; + /** + * Get crossorigin option that is set for site. Usefull for setting crossorigin policy for elements. + * + * @returns {string|null} Returns the string that should be set as crossorigin policy for elements or null if + * no policy is set. + */ + H5P.getCrossOrigin = function () { + return H5PIntegration.crossorigin ? H5PIntegration.crossorigin : null; + }; + /** * Async error handling. *