From 000cb99912e22aa6cf99cd7a8feb55331d33ca03 Mon Sep 17 00:00:00 2001 From: Paal Joergensen Date: Tue, 17 Oct 2017 16:16:46 +0200 Subject: [PATCH] Make eslint happy --- card.js | 6 +++--- memory-game.js | 12 ++++++------ popup.js | 2 +- upgrades.js | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/card.js b/card.js index 28718f7..867d405 100644 --- a/card.js +++ b/card.js @@ -20,7 +20,7 @@ EventDispatcher.call(self); var path = H5P.getPath(image.path, id); - var width, height, margin, $card, $wrapper, removedState, flippedState; + var width, height, $card, $wrapper, removedState, flippedState; alt = alt || 'Missing description'; // Default for old games @@ -91,7 +91,7 @@ /** * Remove. */ - self.remove = function (announce) { + self.remove = function () { $card.addClass('h5p-matched'); removedState = true; }; @@ -137,7 +137,7 @@ '' + '') .appendTo($container) - .on('keydown', function (event) { + .on('keydown', function (event) { switch (event.which) { case 13: // Enter case 32: // Space diff --git a/memory-game.js b/memory-game.js index 7c61076..1557e18 100644 --- a/memory-game.js +++ b/memory-game.js @@ -154,7 +154,7 @@ H5P.MemoryGame = (function (EventDispatcher, $) { * Shuffle the cards and restart the game! * @private */ - var resetGame = function () { + var resetGame = function () { // Reset cards removed = 0; @@ -197,7 +197,7 @@ H5P.MemoryGame = (function (EventDispatcher, $) { buttonElement.innerHTML = label; buttonElement.setAttribute('role', 'button'); buttonElement.tabIndex = 0; - buttonElement.addEventListener('click', function (event) { + buttonElement.addEventListener('click', function () { action.apply(buttonElement); }, false); buttonElement.addEventListener('keypress', function (event) { @@ -437,7 +437,7 @@ H5P.MemoryGame = (function (EventDispatcher, $) { $bottom = $('
', { tabindex: '-1', - appendTo: $container + appendTo: $container }); $taskComplete = $('
', { 'class': 'h5p-memory-complete h5p-memory-hidden-read', @@ -467,10 +467,10 @@ H5P.MemoryGame = (function (EventDispatcher, $) { /** * Will try to scale the game so that it fits within its container. - * Puts the cards into a grid layout to make it as square as possible –  + * Puts the cards into a grid layout to make it as square as possible – * which improves the playability on multiple devices. * - * @private + * @private */ var scaleGameSize = function () { @@ -538,7 +538,7 @@ H5P.MemoryGame = (function (EventDispatcher, $) { /** * Determine color contrast level compared to white(#fff) * - * @private + * @private * @param {string} color hex code * @return {number} From 1 to Infinity. */ diff --git a/popup.js b/popup.js index 3f07631..07c3f64 100644 --- a/popup.js +++ b/popup.js @@ -18,7 +18,7 @@ var $top = $popup.find('.h5p-memory-top'); // Hook up the close button - $popup.find('.h5p-memory-close').on('click', function () { + $popup.find('.h5p-memory-close').on('click', function () { self.close(true); }).on('keypress', function (event) { if (event.which === 13 || event.which === 32) { diff --git a/upgrades.js b/upgrades.js index 42c39bd..ce870bc 100644 --- a/upgrades.js +++ b/upgrades.js @@ -1,6 +1,6 @@ var H5PUpgrades = H5PUpgrades || {}; -H5PUpgrades['H5P.MemoryGame'] = (function ($) { +H5PUpgrades['H5P.MemoryGame'] = (function () { return { 1: { /** @@ -42,4 +42,4 @@ H5PUpgrades['H5P.MemoryGame'] = (function ($) { } } }; -})(H5P.jQuery); +})();