You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
926 B
40 lines
926 B
H5P.Version = (function () {
|
|
/**
|
|
* Make it easy to keep track of version details.
|
|
*
|
|
* @class
|
|
* @namespace H5P
|
|
* @param {String} version
|
|
*/
|
|
function Version(version) {
|
|
|
|
if (typeof version === 'string') {
|
|
// Name version string (used by content upgrade)
|
|
var versionSplit = version.split('.', 3);
|
|
this.major =+ versionSplit[0];
|
|
this.minor =+ versionSplit[1];
|
|
}
|
|
else {
|
|
// Library objects (used by editor)
|
|
if (version.localMajorVersion !== undefined) {
|
|
this.major =+ version.localMajorVersion;
|
|
this.minor =+ version.localMinorVersion;
|
|
}
|
|
else {
|
|
this.major =+ version.majorVersion;
|
|
this.minor =+ version.minorVersion;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Public. Custom string for this object.
|
|
*
|
|
* @returns {String}
|
|
*/
|
|
this.toString = function () {
|
|
return version;
|
|
};
|
|
}
|
|
|
|
return Version;
|
|
})();
|
|
|