Did some jshint cleanup and removal of empty spaces.
parent
53ceb6156b
commit
1479138abb
|
@ -1,3 +1,4 @@
|
||||||
|
/*jshint -W083 */
|
||||||
var H5PUpgrades = H5PUpgrades || {};
|
var H5PUpgrades = H5PUpgrades || {};
|
||||||
|
|
||||||
(function ($) {
|
(function ($) {
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
/*jshint multistr: true */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -130,8 +132,8 @@ var H5P = H5P || (function () {
|
||||||
if (document.documentElement.requestFullScreen) {
|
if (document.documentElement.requestFullScreen) {
|
||||||
fullScreenBrowserPrefix = '';
|
fullScreenBrowserPrefix = '';
|
||||||
}
|
}
|
||||||
else if (document.documentElement.webkitRequestFullScreen
|
else if (document.documentElement.webkitRequestFullScreen &&
|
||||||
&& navigator.userAgent.indexOf('Android') === -1 // Skip Android
|
navigator.userAgent.indexOf('Android') === -1 // Skip Android
|
||||||
) {
|
) {
|
||||||
safariBrowser = navigator.userAgent.match(/Version\/(\d)/);
|
safariBrowser = navigator.userAgent.match(/Version\/(\d)/);
|
||||||
safariBrowser = (safariBrowser === null ? 0 : parseInt(safariBrowser[1]));
|
safariBrowser = (safariBrowser === null ? 0 : parseInt(safariBrowser[1]));
|
||||||
|
|
|
@ -257,7 +257,7 @@ var H5PLibraryDetails= H5PLibraryDetails || {};
|
||||||
H5PLibraryDetails.updatePager();
|
H5PLibraryDetails.updatePager();
|
||||||
};
|
};
|
||||||
|
|
||||||
var inputTimer = undefined;
|
var inputTimer;
|
||||||
$('input', H5PLibraryDetails.$search).on('change keypress paste input', function () {
|
$('input', H5PLibraryDetails.$search).on('change keypress paste input', function () {
|
||||||
// Here we start the filtering
|
// Here we start the filtering
|
||||||
// We wait at least 500 ms after last input to perform search
|
// We wait at least 500 ms after last input to perform search
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
/*jshint multistr: true */
|
||||||
var H5PLibraryList= H5PLibraryList || {};
|
var H5PLibraryList= H5PLibraryList || {};
|
||||||
|
|
||||||
(function ($) {
|
(function ($) {
|
||||||
|
|
21
js/h5p.js
21
js/h5p.js
|
@ -1,3 +1,4 @@
|
||||||
|
/*jshint multistr: true */
|
||||||
// TODO: Should we split up the generic parts needed by the editor(and others), and the parts needed to "run" H5Ps?
|
// TODO: Should we split up the generic parts needed by the editor(and others), and the parts needed to "run" H5Ps?
|
||||||
var H5P = H5P || {};
|
var H5P = H5P || {};
|
||||||
|
|
||||||
|
@ -11,8 +12,8 @@ H5P.$window = H5P.jQuery(window);
|
||||||
if (document.documentElement.requestFullScreen) {
|
if (document.documentElement.requestFullScreen) {
|
||||||
H5P.fullScreenBrowserPrefix = '';
|
H5P.fullScreenBrowserPrefix = '';
|
||||||
}
|
}
|
||||||
else if (document.documentElement.webkitRequestFullScreen
|
else if (document.documentElement.webkitRequestFullScreen &&
|
||||||
&& navigator.userAgent.indexOf('Android') === -1 // Skip Android
|
navigator.userAgent.indexOf('Android') === -1 // Skip Android
|
||||||
) {
|
) {
|
||||||
H5P.safariBrowser = navigator.userAgent.match(/Version\/(\d)/);
|
H5P.safariBrowser = navigator.userAgent.match(/Version\/(\d)/);
|
||||||
H5P.safariBrowser = (H5P.safariBrowser === null ? 0 : parseInt(H5P.safariBrowser[1]));
|
H5P.safariBrowser = (H5P.safariBrowser === null ? 0 : parseInt(H5P.safariBrowser[1]));
|
||||||
|
@ -62,7 +63,7 @@ H5P.init = function () {
|
||||||
H5P.jQuery('<div class="h5p-content-controls"><div role="button" tabindex="1" class="h5p-enable-fullscreen" title="' + H5P.t('fullscreen') + '"></div></div>').prependTo($container).children().click(function () {
|
H5P.jQuery('<div class="h5p-content-controls"><div role="button" tabindex="1" class="h5p-enable-fullscreen" title="' + H5P.t('fullscreen') + '"></div></div>').prependTo($container).children().click(function () {
|
||||||
H5P.fullScreen($container, instance);
|
H5P.fullScreen($container, instance);
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
var $actions = H5P.jQuery('<ul class="h5p-actions"></ul>');
|
var $actions = H5P.jQuery('<ul class="h5p-actions"></ul>');
|
||||||
if (contentData.exportUrl !== '') {
|
if (contentData.exportUrl !== '') {
|
||||||
|
@ -290,7 +291,7 @@ H5P.getPath = function (path, contentId) {
|
||||||
if (contentId !== undefined) {
|
if (contentId !== undefined) {
|
||||||
prefix = H5PIntegration.getContentPath(contentId);
|
prefix = H5PIntegration.getContentPath(contentId);
|
||||||
}
|
}
|
||||||
else if (window['H5PEditor'] !== undefined) {
|
else if (window.H5PEditor !== undefined) {
|
||||||
prefix = H5PEditor.filesPath;
|
prefix = H5PEditor.filesPath;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -344,9 +345,10 @@ H5P.classFromName = function (name) {
|
||||||
* @return {Object} Instance.
|
* @return {Object} Instance.
|
||||||
*/
|
*/
|
||||||
H5P.newRunnable = function (library, contentId, $attachTo, skipResize) {
|
H5P.newRunnable = function (library, contentId, $attachTo, skipResize) {
|
||||||
|
var nameSplit, versionSplit;
|
||||||
try {
|
try {
|
||||||
var nameSplit = library.library.split(' ', 2);
|
nameSplit = library.library.split(' ', 2);
|
||||||
var versionSplit = nameSplit[1].split('.', 2);
|
versionSplit = nameSplit[1].split('.', 2);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
return H5P.error('Invalid library string: ' + library.library);
|
return H5P.error('Invalid library string: ' + library.library);
|
||||||
|
@ -358,12 +360,13 @@ H5P.newRunnable = function (library, contentId, $attachTo, skipResize) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find constructor function
|
// Find constructor function
|
||||||
|
var constructor;
|
||||||
try {
|
try {
|
||||||
nameSplit = nameSplit[0].split('.');
|
nameSplit = nameSplit[0].split('.');
|
||||||
var constructor = window;
|
constructor = window;
|
||||||
for (var i = 0; i < nameSplit.length; i++) {
|
for (var i = 0; i < nameSplit.length; i++) {
|
||||||
constructor = constructor[nameSplit[i]];
|
constructor = constructor[nameSplit[i]];
|
||||||
};
|
}
|
||||||
if (typeof constructor !== 'function') {
|
if (typeof constructor !== 'function') {
|
||||||
throw null;
|
throw null;
|
||||||
}
|
}
|
||||||
|
@ -565,7 +568,7 @@ H5P.ContentCopyrights = function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add sub content rights
|
// Add sub content rights
|
||||||
for (var i = 0; i < content.length; i++) {
|
for (i = 0; i < content.length; i++) {
|
||||||
html += content[i];
|
html += content[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue