Fix code style

set-minimum-height-for-dialogs
Paal Joergensen 2018-10-23 11:25:46 +02:00
parent e316eff18d
commit 82b50fc2f1
14 changed files with 56 additions and 52 deletions

View File

@ -11,7 +11,7 @@
* @class
* @augments H5P.EventDispatcher
*/
H5P.ContentType = function (isRootLibrary, library) {
H5P.ContentType = function (isRootLibrary) {
function ContentType() {}

View File

@ -127,10 +127,10 @@ H5P.ContentUpgradeProcess = (function (Version) {
}, {metadata: metadata});
}
catch (err) {
if (console && console.log) {
console.log("Error", err.stack);
console.log("Error", err.name);
console.log("Error", err.message);
if (console && console.error) {
console.error("Error", err.stack);
console.error("Error", err.name);
console.error("Error", err.message);
}
next(err);
}

View File

@ -1,3 +1,4 @@
/* global importScripts */
var H5P = H5P || {};
importScripts('h5p-version.js', 'h5p-content-upgrade-process.js');

View File

@ -1,4 +1,4 @@
/*jshint -W083 */
/* global H5PAdminIntegration H5PUtils */
(function ($, Version) {
var info, $container, librariesCache = {}, scriptsCache = {};

View File

@ -1,3 +1,4 @@
/* global H5PUtils */
var H5PDataView = (function ($) {
/**
@ -198,7 +199,6 @@ var H5PDataView = (function ($) {
* @param number col ID of column
*/
H5PDataView.prototype.createFacets = function (input, col) {
var self = this;
var facets = '';
if (input instanceof Array) {

View File

@ -1,3 +1,4 @@
/* global H5PAdminIntegration H5PUtils */
var H5PLibraryDetails = H5PLibraryDetails || {};
(function ($) {

View File

@ -1,4 +1,4 @@
/*jshint multistr: true */
/* global H5PAdminIntegration H5PUtils */
var H5PLibraryList = H5PLibraryList || {};
(function ($) {

View File

@ -21,7 +21,7 @@
iframe.style.width = '100%';
// Tell iframe that it needs to resize when our window resizes
var resize = function (event) {
var resize = function () {
if (iframe.contentWindow) {
// Limit resize calls to avoid flickering
respond('resize');
@ -64,7 +64,7 @@
* @param {Object} data Payload
* @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
iframe.style.height = data.scrollHeight + 'px';
};

View File

@ -1,3 +1,4 @@
/* global H5PAdminIntegration*/
var H5PUtils = H5PUtils || {};
(function ($) {

View File

@ -256,7 +256,7 @@ H5P.XAPIEvent.prototype.getContentXAPIId = function (instance) {
H5P.XAPIEvent.prototype.isFromChild = function () {
var parentId = this.getVerifiedStatementValue(['context', 'contextActivities', 'parent', 0, 'id']);
return !parentId || parentId.indexOf('subContentId') === -1;
}
};
/**
* Figure out if a property exists in the statement and return it

View File

@ -89,7 +89,7 @@ H5P.init = function (target) {
}
// 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 $container = H5P.jQuery('<div class="h5p-container"></div>').appendTo($element);
var contentId = $element.data('content-id');
@ -301,7 +301,7 @@ H5P.init = function (target) {
});
// 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', {
scrollHeight: document.body.scrollHeight
});
@ -494,7 +494,7 @@ H5P.fullScreen = function ($element, instance, exitCallback, body, forceSemiFull
}
var $container = $element;
var $classes, $iframe;
var $classes, $iframe, $body;
if (body === undefined) {
$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') {
var dataset = {
contentType: metadata.contentType,
@ -1181,7 +1181,7 @@ H5P.openEmbedDialog = function ($element, embedCode, resizeCode, size) {
updateEmbed();
// 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).select();
});
@ -1201,7 +1201,7 @@ H5P.openEmbedDialog = function ($element, embedCode, resizeCode, size) {
$expander.addClass('h5p-open').text(H5P.t('hideAdvanced'));
$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');
});
positionInner();
@ -1614,7 +1614,8 @@ H5P.Coords = function (x, y, w, h) {
this.y = x.y;
this.w = x.w;
this.h = x.h;
} else {
}
else {
if (x !== undefined) {
this.x = x;
}
@ -2098,7 +2099,7 @@ H5P.createTitle = function (rawTitle, maxLength) {
}
preloadedData[options.subContentId][dataId] = data;
contentUserDataAjax(contentId, dataId, options.subContentId, function (error, data) {
contentUserDataAjax(contentId, dataId, options.subContentId, function (error) {
if (options.errorCallback && error) {
options.errorCallback(error);
}