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