Fix code style
parent
e316eff18d
commit
82b50fc2f1
|
@ -11,7 +11,7 @@
|
||||||
* @class
|
* @class
|
||||||
* @augments H5P.EventDispatcher
|
* @augments H5P.EventDispatcher
|
||||||
*/
|
*/
|
||||||
H5P.ContentType = function (isRootLibrary, library) {
|
H5P.ContentType = function (isRootLibrary) {
|
||||||
|
|
||||||
function ContentType() {}
|
function ContentType() {}
|
||||||
|
|
||||||
|
|
|
@ -127,10 +127,10 @@ H5P.ContentUpgradeProcess = (function (Version) {
|
||||||
}, {metadata: metadata});
|
}, {metadata: metadata});
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
if (console && console.log) {
|
if (console && console.error) {
|
||||||
console.log("Error", err.stack);
|
console.error("Error", err.stack);
|
||||||
console.log("Error", err.name);
|
console.error("Error", err.name);
|
||||||
console.log("Error", err.message);
|
console.error("Error", err.message);
|
||||||
}
|
}
|
||||||
next(err);
|
next(err);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
/* global importScripts */
|
||||||
var H5P = H5P || {};
|
var H5P = H5P || {};
|
||||||
importScripts('h5p-version.js', 'h5p-content-upgrade-process.js');
|
importScripts('h5p-version.js', 'h5p-content-upgrade-process.js');
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*jshint -W083 */
|
/* global H5PAdminIntegration H5PUtils */
|
||||||
|
|
||||||
(function ($, Version) {
|
(function ($, Version) {
|
||||||
var info, $container, librariesCache = {}, scriptsCache = {};
|
var info, $container, librariesCache = {}, scriptsCache = {};
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
/* global H5PUtils */
|
||||||
var H5PDataView = (function ($) {
|
var H5PDataView = (function ($) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -198,7 +199,6 @@ var H5PDataView = (function ($) {
|
||||||
* @param number col ID of column
|
* @param number col ID of column
|
||||||
*/
|
*/
|
||||||
H5PDataView.prototype.createFacets = function (input, col) {
|
H5PDataView.prototype.createFacets = function (input, col) {
|
||||||
var self = this;
|
|
||||||
var facets = '';
|
var facets = '';
|
||||||
|
|
||||||
if (input instanceof Array) {
|
if (input instanceof Array) {
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
/* global H5PAdminIntegration H5PUtils */
|
||||||
var H5PLibraryDetails = H5PLibraryDetails || {};
|
var H5PLibraryDetails = H5PLibraryDetails || {};
|
||||||
|
|
||||||
(function ($) {
|
(function ($) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*jshint multistr: true */
|
/* global H5PAdminIntegration H5PUtils */
|
||||||
var H5PLibraryList = H5PLibraryList || {};
|
var H5PLibraryList = H5PLibraryList || {};
|
||||||
|
|
||||||
(function ($) {
|
(function ($) {
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
iframe.style.width = '100%';
|
iframe.style.width = '100%';
|
||||||
|
|
||||||
// Tell iframe that it needs to resize when our window resizes
|
// Tell iframe that it needs to resize when our window resizes
|
||||||
var resize = function (event) {
|
var resize = function () {
|
||||||
if (iframe.contentWindow) {
|
if (iframe.contentWindow) {
|
||||||
// Limit resize calls to avoid flickering
|
// Limit resize calls to avoid flickering
|
||||||
respond('resize');
|
respond('resize');
|
||||||
|
@ -64,7 +64,7 @@
|
||||||
* @param {Object} data Payload
|
* @param {Object} data Payload
|
||||||
* @param {Function} respond Send a response to the iframe
|
* @param {Function} respond Send a response to the iframe
|
||||||
*/
|
*/
|
||||||
actionHandlers.resize = function (iframe, data, respond) {
|
actionHandlers.resize = function (iframe, data) {
|
||||||
// Resize iframe so all content is visible. Use scrollHeight to make sure we get everything
|
// Resize iframe so all content is visible. Use scrollHeight to make sure we get everything
|
||||||
iframe.style.height = data.scrollHeight + 'px';
|
iframe.style.height = data.scrollHeight + 'px';
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
/* global H5PAdminIntegration*/
|
||||||
var H5PUtils = H5PUtils || {};
|
var H5PUtils = H5PUtils || {};
|
||||||
|
|
||||||
(function ($) {
|
(function ($) {
|
||||||
|
|
|
@ -256,7 +256,7 @@ H5P.XAPIEvent.prototype.getContentXAPIId = function (instance) {
|
||||||
H5P.XAPIEvent.prototype.isFromChild = function () {
|
H5P.XAPIEvent.prototype.isFromChild = function () {
|
||||||
var parentId = this.getVerifiedStatementValue(['context', 'contextActivities', 'parent', 0, 'id']);
|
var parentId = this.getVerifiedStatementValue(['context', 'contextActivities', 'parent', 0, 'id']);
|
||||||
return !parentId || parentId.indexOf('subContentId') === -1;
|
return !parentId || parentId.indexOf('subContentId') === -1;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Figure out if a property exists in the statement and return it
|
* Figure out if a property exists in the statement and return it
|
||||||
|
|
17
js/h5p.js
17
js/h5p.js
|
@ -89,7 +89,7 @@ H5P.init = function (target) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// H5Ps added in normal DIV.
|
// H5Ps added in normal DIV.
|
||||||
var $containers = H5P.jQuery('.h5p-content:not(.h5p-initialized)', target).each(function () {
|
H5P.jQuery('.h5p-content:not(.h5p-initialized)', target).each(function () {
|
||||||
var $element = H5P.jQuery(this).addClass('h5p-initialized');
|
var $element = H5P.jQuery(this).addClass('h5p-initialized');
|
||||||
var $container = H5P.jQuery('<div class="h5p-container"></div>').appendTo($element);
|
var $container = H5P.jQuery('<div class="h5p-container"></div>').appendTo($element);
|
||||||
var contentId = $element.data('content-id');
|
var contentId = $element.data('content-id');
|
||||||
|
@ -301,7 +301,7 @@ H5P.init = function (target) {
|
||||||
});
|
});
|
||||||
|
|
||||||
// When resize has been prepared tell parent window to resize
|
// When resize has been prepared tell parent window to resize
|
||||||
H5P.communicator.on('resizePrepared', function (data) {
|
H5P.communicator.on('resizePrepared', function () {
|
||||||
H5P.communicator.send('resize', {
|
H5P.communicator.send('resize', {
|
||||||
scrollHeight: document.body.scrollHeight
|
scrollHeight: document.body.scrollHeight
|
||||||
});
|
});
|
||||||
|
@ -494,7 +494,7 @@ H5P.fullScreen = function ($element, instance, exitCallback, body, forceSemiFull
|
||||||
}
|
}
|
||||||
|
|
||||||
var $container = $element;
|
var $container = $element;
|
||||||
var $classes, $iframe;
|
var $classes, $iframe, $body;
|
||||||
if (body === undefined) {
|
if (body === undefined) {
|
||||||
$body = H5P.$body;
|
$body = H5P.$body;
|
||||||
}
|
}
|
||||||
|
@ -1105,7 +1105,7 @@ H5P.findCopyrights = function (info, parameters, contentId, extras) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
H5P.buildMetadataCopyrights = function (metadata, contentTypeName) {
|
H5P.buildMetadataCopyrights = function (metadata) {
|
||||||
if (metadata && metadata.license !== undefined && metadata.license !== 'U') {
|
if (metadata && metadata.license !== undefined && metadata.license !== 'U') {
|
||||||
var dataset = {
|
var dataset = {
|
||||||
contentType: metadata.contentType,
|
contentType: metadata.contentType,
|
||||||
|
@ -1181,7 +1181,7 @@ H5P.openEmbedDialog = function ($element, embedCode, resizeCode, size) {
|
||||||
updateEmbed();
|
updateEmbed();
|
||||||
|
|
||||||
// Select text and expand textareas
|
// Select text and expand textareas
|
||||||
$dialog.find('.h5p-embed-code-container').each(function(index, value) {
|
$dialog.find('.h5p-embed-code-container').each(function () {
|
||||||
H5P.jQuery(this).css('height', this.scrollHeight + 'px').focus(function () {
|
H5P.jQuery(this).css('height', this.scrollHeight + 'px').focus(function () {
|
||||||
H5P.jQuery(this).select();
|
H5P.jQuery(this).select();
|
||||||
});
|
});
|
||||||
|
@ -1201,7 +1201,7 @@ H5P.openEmbedDialog = function ($element, embedCode, resizeCode, size) {
|
||||||
$expander.addClass('h5p-open').text(H5P.t('hideAdvanced'));
|
$expander.addClass('h5p-open').text(H5P.t('hideAdvanced'));
|
||||||
$content.show();
|
$content.show();
|
||||||
}
|
}
|
||||||
$dialog.find('.h5p-embed-code-container').each(function(index, value) {
|
$dialog.find('.h5p-embed-code-container').each(function () {
|
||||||
H5P.jQuery(this).css('height', this.scrollHeight + 'px');
|
H5P.jQuery(this).css('height', this.scrollHeight + 'px');
|
||||||
});
|
});
|
||||||
positionInner();
|
positionInner();
|
||||||
|
@ -1614,7 +1614,8 @@ H5P.Coords = function (x, y, w, h) {
|
||||||
this.y = x.y;
|
this.y = x.y;
|
||||||
this.w = x.w;
|
this.w = x.w;
|
||||||
this.h = x.h;
|
this.h = x.h;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
if (x !== undefined) {
|
if (x !== undefined) {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
}
|
}
|
||||||
|
@ -2098,7 +2099,7 @@ H5P.createTitle = function (rawTitle, maxLength) {
|
||||||
}
|
}
|
||||||
|
|
||||||
preloadedData[options.subContentId][dataId] = data;
|
preloadedData[options.subContentId][dataId] = data;
|
||||||
contentUserDataAjax(contentId, dataId, options.subContentId, function (error, data) {
|
contentUserDataAjax(contentId, dataId, options.subContentId, function (error) {
|
||||||
if (options.errorCallback && error) {
|
if (options.errorCallback && error) {
|
||||||
options.errorCallback(error);
|
options.errorCallback(error);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue