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.