Skip to content

Commit

Permalink
fix for version in path of library
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakeii committed May 10, 2018
1 parent c4229f4 commit 67a1991
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 27 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# h5p-standalone 1.3.3
# h5p-standalone 1.3.4
Display H5P content with plain old HTML

## Usage
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "h5p-standalone",
"version": "1.3.3",
"version": "1.3.4",
"homepage": "https://github.com/tunapanda/h5p-standalone",
"authors": [
"Jake Lee Kennedy <[email protected]>"
Expand Down
5 changes: 4 additions & 1 deletion dist/js/h5p-standalone-frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -12612,6 +12612,9 @@ H5P.createTitle = function (rawTitle, maxLength) {
})(H5P.jQuery);

H5P.getLibraryPath = function (library) {
if (H5PIntegration.pathIncludesVersion) {
return H5PIntegration.url + '/' + library;
}
return H5PIntegration.url + '/' + library.split('-')[0];
};

Expand Down Expand Up @@ -12641,4 +12644,4 @@ H5P.getPath = function (path, contentId) {
// }

return prefix + '/' + path;
};
};
2 changes: 1 addition & 1 deletion dist/js/h5p-standalone-frame.min.js

Large diffs are not rendered by default.

17 changes: 6 additions & 11 deletions dist/js/h5p-standalone-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10025,6 +10025,7 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [
};

var getLibrary = checklibraryPath.then(function (h5p) {
H5PIntegration.pathIncludesVersion = h5p.pathIncludesVersion;
var mainLibrary = h5p.preloadedDependencies.find(function (dep) {
return dep.machineName === h5p.mainLibrary;
});
Expand Down Expand Up @@ -10116,16 +10117,7 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [

H5PIntegration.core = {
styles: [frameCss],
scripts: [frameJs
// 'bower_components/jquery/dist/jquery.js',
// 'lib/js/h5p-jquery.js',
// 'bower_components/h5p-php-library/js/h5p-content-type.js',
// 'bower_components/h5p-php-library/js/h5p-event-dispatcher.js',
// 'bower_components/h5p-php-library/js/h5p-x-api-event.js',
// 'bower_components/h5p-php-library/js/h5p-x-api.js',
// 'bower_components/h5p-php-library/js/h5p.js',
// 'lib/js/h5p-overwrite.js'
]
scripts: [frameJs]
};

H5PIntegration.init(id, h5pContent, displayOptions);
Expand Down Expand Up @@ -13044,6 +13036,9 @@ H5P.createTitle = function (rawTitle, maxLength) {
})(H5P.jQuery);

H5P.getLibraryPath = function (library) {
if (H5PIntegration.pathIncludesVersion) {
return H5PIntegration.url + '/' + library;
}
return H5PIntegration.url + '/' + library.split('-')[0];
};

Expand Down Expand Up @@ -13073,4 +13068,4 @@ H5P.getPath = function (path, contentId) {
// }

return prefix + '/' + path;
};
};
2 changes: 1 addition & 1 deletion dist/js/h5p-standalone-main.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "h5p-standalone",
"version": "1.3.3",
"version": "1.3.4",
"description": "Display H5P content as standalone frontend code, no server needed.",
"main": "dist/js/h5p-standalone-main.min.js",
"dependencies": {
Expand Down
3 changes: 3 additions & 0 deletions src/js/h5p-overwrite.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
H5P.getLibraryPath = function (library) {
if (H5PIntegration.pathIncludesVersion) {
return H5PIntegration.url + '/' + library;
}
return H5PIntegration.url + '/' + library.split('-')[0];
};

Expand Down
1 change: 1 addition & 0 deletions src/js/h5pintegration.es6
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
}

let getLibrary = checklibraryPath.then(function (h5p) {
H5PIntegration.pathIncludesVersion = h5p.pathIncludesVersion;
let mainLibrary = h5p.preloadedDependencies.find(dep => dep.machineName === h5p.mainLibrary);
let mainLibraryPath = h5p.mainLibrary + (h5p.pathIncludesVersion ? "-" + mainLibrary.majorVersion + "." + mainLibrary.minorVersion : '');
return getJSONPromise(`${pathToContent}/${mainLibraryPath}/library.json`);
Expand Down
12 changes: 2 additions & 10 deletions src/js/h5pintegration.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [
};

var getLibrary = checklibraryPath.then(function (h5p) {
H5PIntegration.pathIncludesVersion = h5p.pathIncludesVersion;
var mainLibrary = h5p.preloadedDependencies.find(function (dep) {
return dep.machineName === h5p.mainLibrary;
});
Expand Down Expand Up @@ -234,16 +235,7 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [

H5PIntegration.core = {
styles: [frameCss],
scripts: [frameJs
// 'bower_components/jquery/dist/jquery.js',
// 'lib/js/h5p-jquery.js',
// 'bower_components/h5p-php-library/js/h5p-content-type.js',
// 'bower_components/h5p-php-library/js/h5p-event-dispatcher.js',
// 'bower_components/h5p-php-library/js/h5p-x-api-event.js',
// 'bower_components/h5p-php-library/js/h5p-x-api.js',
// 'bower_components/h5p-php-library/js/h5p.js',
// 'lib/js/h5p-overwrite.js'
]
scripts: [frameJs]
};

H5PIntegration.init(id, h5pContent, displayOptions);
Expand Down

0 comments on commit 67a1991

Please sign in to comment.