Replaced nbsp.
parent
1298643ab1
commit
d8d7fdabdd
|
@ -1,7 +1,7 @@
|
|||
/*jshint -W083 */
|
||||
var H5PUpgrades = H5PUpgrades || {};
|
||||
|
||||
H5P.ContentUpgradeProcess = (function (Version) {
|
||||
H5P.ContentUpgradeProcess = (function (Version) {
|
||||
|
||||
/**
|
||||
* @class
|
||||
|
@ -25,7 +25,7 @@ H5P.ContentUpgradeProcess = (function (Version) {
|
|||
}
|
||||
|
||||
self.loadLibrary = loadLibrary;
|
||||
self.upgrade(name, oldVersion, newVersion, params, function (err, result) {
|
||||
self.upgrade(name, oldVersion, newVersion, params, function (err, result) {
|
||||
if (err) {
|
||||
return done(err);
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ H5P.ContentUpgradeProcess = (function (Version) {
|
|||
}
|
||||
next(err);
|
||||
});
|
||||
|
||||
|
||||
}, function (err) {
|
||||
done(err, params);
|
||||
});
|
||||
|
|
|
@ -7,9 +7,9 @@ var libraryLoadedCallback;
|
|||
* Register message handlers
|
||||
*/
|
||||
var messageHandlers = {
|
||||
newJob: function (job) {
|
||||
newJob: function (job) {
|
||||
// Start new job
|
||||
new H5P.ContentUpgradeProcess(job.name, new H5P.Version(job.oldVersion), new H5P.Version(job.newVersion), job.params, job.id, function loadLibrary(name, version, next) {
|
||||
new H5P.ContentUpgradeProcess(job.name, new H5P.Version(job.oldVersion), new H5P.Version(job.newVersion), job.params, job.id, function loadLibrary(name, version, next) {
|
||||
// TODO: Cache?
|
||||
postMessage({
|
||||
action: 'loadLibrary',
|
||||
|
|
|
@ -115,7 +115,7 @@
|
|||
|
||||
// Register message handlers
|
||||
var messageHandlers = {
|
||||
done: function (result) {
|
||||
done: function (result) {
|
||||
self.workDone(result.id, result.params, this);
|
||||
},
|
||||
error: function (error) {
|
||||
|
@ -124,7 +124,7 @@
|
|||
// Stop everything
|
||||
self.terminate();
|
||||
},
|
||||
loadLibrary: function (details) {
|
||||
loadLibrary: function (details) {
|
||||
var worker = this;
|
||||
self.loadLibrary(details.name, new Version(details.version), function (err, library) {
|
||||
if (err) {
|
||||
|
@ -258,8 +258,8 @@
|
|||
});
|
||||
}
|
||||
else {
|
||||
new H5P.ContentUpgradeProcess(info.library.name, new Version(info.library.version), self.version, self.parameters[id], id, function loadLibrary(name, version, next) {
|
||||
self.loadLibrary(name, version, function (err, library) {
|
||||
new H5P.ContentUpgradeProcess(info.library.name, new Version(info.library.version), self.version, self.parameters[id], id, function loadLibrary(name, version, next) {
|
||||
self.loadLibrary(name, version, function (err, library) {
|
||||
if (library.upgradesScript) {
|
||||
self.loadScript(library.upgradesScript, function (err) {
|
||||
if (err) {
|
||||
|
|
|
@ -7,7 +7,7 @@ var H5P = H5P || {};
|
|||
* @param {string} type
|
||||
* @param {*} data
|
||||
* @param {Object} [extras]
|
||||
* @param {boolean} [extras.bubbles]
|
||||
* @param {boolean} [extras.bubbles]
|
||||
* @param {boolean} [extras.external]
|
||||
*/
|
||||
H5P.Event = function(type, data, extras) {
|
||||
|
@ -194,7 +194,7 @@ H5P.EventDispatcher = (function () {
|
|||
* @private
|
||||
* @param {string} Event type
|
||||
*/
|
||||
var call = function (type, event) {
|
||||
var call = function (type, event) {
|
||||
if (triggers[type] === undefined) {
|
||||
return;
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ H5P.EventDispatcher = (function () {
|
|||
* Custom event data(used when event type as string is used as first
|
||||
* argument).
|
||||
* @param {Object} [extras]
|
||||
* @param {boolean} [extras.bubbles]
|
||||
* @param {boolean} [extras.bubbles]
|
||||
* @param {boolean} [extras.external]
|
||||
*/
|
||||
this.trigger = function (event, eventData, extras) {
|
||||
|
|
|
@ -74,11 +74,11 @@
|
|||
};
|
||||
|
||||
/**
|
||||
* Keyup event handler. Exits full screen on escape.
|
||||
*
|
||||
* Keyup event handler. Exits full screen on escape.asdasd a
|
||||
*
|
||||
* @param {Event} event
|
||||
*/
|
||||
var escape = function (event) {
|
||||
var escape = function (event) {
|
||||
if (event.keyCode === 27) {
|
||||
exitFullScreen();
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
H5P.Version = (function () {
|
||||
H5P.Version = (function () {
|
||||
/**
|
||||
* Make it easy to keep track of version details.
|
||||
*
|
||||
|
|
20
js/h5p.js
20
js/h5p.js
|
@ -111,7 +111,7 @@ H5P.init = function (target) {
|
|||
params: JSON.parse(contentData.jsonContent)
|
||||
};
|
||||
|
||||
H5P.getUserData(contentId, 'state', function (err, previousState) {
|
||||
H5P.getUserData(contentId, 'state', function (err, previousState) {
|
||||
if (previousState) {
|
||||
library.userDatas = {
|
||||
state: previousState
|
||||
|
@ -206,7 +206,7 @@ H5P.init = function (target) {
|
|||
instance.getCurrentState instanceof Function ||
|
||||
typeof instance.getCurrentState === 'function')) {
|
||||
|
||||
var saveTimer, save = function () {
|
||||
var saveTimer, save = function () {
|
||||
var state = instance.getCurrentState();
|
||||
if (state !== undefined) {
|
||||
H5P.setUserData(contentId, 'state', state, {deleteOnChange: true});
|
||||
|
@ -381,7 +381,7 @@ H5P.getHeadTags = function (contentId) {
|
|||
*
|
||||
* @type {Communicator}
|
||||
*/
|
||||
H5P.communicator = (function () {
|
||||
H5P.communicator = (function () {
|
||||
/**
|
||||
* @class
|
||||
* @private
|
||||
|
@ -420,7 +420,7 @@ H5P.communicator = (function () {
|
|||
* @param {string} action
|
||||
* @param {Object} [data] payload
|
||||
*/
|
||||
self.send = function (action, data) {
|
||||
self.send = function (action, data) {
|
||||
if (data === undefined) {
|
||||
data = {};
|
||||
}
|
||||
|
@ -893,7 +893,7 @@ H5P.Dialog = function (name, title, content, $element) {
|
|||
* Identifies the H5P content
|
||||
* @returns {string} Copyright information.
|
||||
*/
|
||||
H5P.getCopyrights = function (instance, parameters, contentId) {
|
||||
H5P.getCopyrights = function (instance, parameters, contentId) {
|
||||
var copyrights;
|
||||
|
||||
if (instance.getCopyrights !== undefined) {
|
||||
|
@ -1010,7 +1010,7 @@ H5P.openEmbedDialog = function ($element, embedCode, resizeCode, size) {
|
|||
}
|
||||
return Math.ceil(num);
|
||||
};
|
||||
var updateEmbed = function () {
|
||||
var updateEmbed = function () {
|
||||
$dialog.find('.h5p-embed-code-container:first').val(fullEmbedCode.replace(':w', getNum($w, size.width)).replace(':h', getNum($h, size.height)));
|
||||
};
|
||||
|
||||
|
@ -1028,7 +1028,7 @@ H5P.openEmbedDialog = function ($element, embedCode, resizeCode, size) {
|
|||
positionInner();
|
||||
|
||||
// Expand advanced embed
|
||||
var expand = function () {
|
||||
var expand = function () {
|
||||
var $expander = H5P.jQuery(this);
|
||||
var $content = $expander.next();
|
||||
if ($content.is(':visible')) {
|
||||
|
@ -1729,7 +1729,7 @@ H5P.createTitle = function (rawTitle, maxLength) {
|
|||
options.type = 'GET';
|
||||
}
|
||||
if (done !== undefined) {
|
||||
options.error = function (xhr, error) {
|
||||
options.error = function (xhr, error) {
|
||||
done(error);
|
||||
};
|
||||
options.success = function (response) {
|
||||
|
@ -1782,7 +1782,7 @@ H5P.createTitle = function (rawTitle, maxLength) {
|
|||
}
|
||||
}
|
||||
else {
|
||||
contentUserDataAjax(contentId, dataId, subContentId, function (err, data) {
|
||||
contentUserDataAjax(contentId, dataId, subContentId, function (err, data) {
|
||||
if (err || data === undefined) {
|
||||
done(err, data);
|
||||
return; // Error or no data
|
||||
|
@ -1934,7 +1934,7 @@ H5P.createTitle = function (rawTitle, maxLength) {
|
|||
|
||||
// Relay events to top window.
|
||||
if (H5P.isFramed && H5P.externalEmbed === false) {
|
||||
H5P.externalDispatcher.on('*', function (event) {
|
||||
H5P.externalDispatcher.on('*', function (event) {
|
||||
window.top.H5P.externalDispatcher.trigger.call(this, event);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue