From 71f147058d684de05c90fde148ffb993fc4cbe84 Mon Sep 17 00:00:00 2001 From: Svein-Tore Griff With Date: Mon, 20 Jul 2015 13:40:59 +0200 Subject: [PATCH] Rename isStandalone to isRoot and use ned libraryInfo instead of the so called ubername --- js/h5p-content-type.js | 9 ++++----- js/h5p.js | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/js/h5p-content-type.js b/js/h5p-content-type.js index 3a56c72..afe4136 100644 --- a/js/h5p-content-type.js +++ b/js/h5p-content-type.js @@ -4,7 +4,7 @@ * Functions here may be overridable by the libraries. In special cases, * it is also possible to override H5P.ContentType on a global level. * */ -H5P.ContentType = function (standalone, library) { +H5P.ContentType = function (isRootLibrary, library) { function ContentType() {}; @@ -18,8 +18,8 @@ H5P.ContentType = function (standalone, library) { * @method isStandalone * @return {Boolean} */ - ContentType.prototype.isStandalone = function () { - return standalone; + ContentType.prototype.isRoot = function () { + return isRootLibrary; }; /** @@ -29,8 +29,7 @@ H5P.ContentType = function (standalone, library) { * @return {string} The full path to the file */ ContentType.prototype.getLibraryFilePath = function (filePath) { - var libraryObject = H5P.libraryFromString(library.library); - return H5P.getLibraryPath(libraryObject.machineName + '-' + libraryObject.majorVersion + '.' + libraryObject.minorVersion) + '/' + filePath; + return H5P.getLibraryPath(this.libraryInfo.versionedNameNoSpaces) + '/' + filePath; }; return ContentType; diff --git a/js/h5p.js b/js/h5p.js index ea48c4e..d87d63c 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -727,7 +727,7 @@ H5P.newRunnable = function (library, contentId, $attachTo, skipResize, extras) { // Makes all H5P libraries extend H5P.ContentType: var standalone = extras.standalone || false; // This order makes it possible for an H5P library to override H5P.ContentType functions! - constructor.prototype = H5P.jQuery.extend({}, H5P.ContentType(standalone, library).prototype, constructor.prototype); + constructor.prototype = H5P.jQuery.extend({}, H5P.ContentType(standalone).prototype, constructor.prototype); var instance; // Some old library versions have their own custom third parameter.