From 132f25e14a5be5bedd6ef6cd91df3a346580a538 Mon Sep 17 00:00:00 2001 From: Oliver Tacke Date: Fri, 23 Nov 2018 13:05:23 +0100 Subject: [PATCH 1/4] Make eslint happy --- js/h5p.js | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/js/h5p.js b/js/h5p.js index 7f63c1f..a315eb7 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -143,10 +143,9 @@ H5P.init = function (target) { '' + '') .prependTo($container) - .children() - .click(function () { - H5P.fullScreen($container, instance); - }) + .children().click(function () { + H5P.fullScreen($container, instance); + }) .keydown(function (e) { if (e.which === 32 || e.which === 13) { H5P.fullScreen($container, instance); @@ -214,7 +213,7 @@ H5P.init = function (target) { // Auto save current state if supported if (H5PIntegration.saveFreq !== false && ( - instance.getCurrentState instanceof Function || + instance.getCurrentState instanceof Function || typeof instance.getCurrentState === 'function')) { var saveTimer, save = function () { @@ -931,20 +930,15 @@ H5P.Dialog = function (name, title, content, $element) { .click(function () { self.close(); }) - .children('.h5p-inner') - .click(function () { - return false; - }) - .find('.h5p-close') - .click(function () { - self.close(); - }) - .end() - .find('a') - .click(function (e) { - e.stopPropagation(); - }) - .end() + .children('.h5p-inner').click(function () { + return false; + }) + .find('.h5p-close').click(function () { + self.close(); + }).end() + .find('a').click(function (e) { + e.stopPropagation(); + }).end() .end(); /** From 2be06b2eb915d8fdc2514240b3725ffb54f036aa Mon Sep 17 00:00:00 2001 From: Oliver Tacke Date: Fri, 23 Nov 2018 13:10:07 +0100 Subject: [PATCH 2/4] HFP-2396 Add aria-label to elements with role button --- js/h5p-action-bar.js | 2 +- js/h5p.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/h5p-action-bar.js b/js/h5p-action-bar.js index 3af1a43..c144b79 100644 --- a/js/h5p-action-bar.js +++ b/js/h5p-action-bar.js @@ -51,7 +51,7 @@ H5P.ActionBar = (function ($, EventDispatcher) { } }, appendTo: $actions - }); + }).attr('aria-label', H5P.t(type + 'Description')); hasActions = true; }; diff --git a/js/h5p.js b/js/h5p.js index a315eb7..f3a5575 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -923,7 +923,7 @@ H5P.Dialog = function (name, title, content, $element) {
\

' + title + '

\
' + content + '
\ -
\ +
\
\
') .insertAfter($element) From 48f3805f9441606586a58a9c2bff6d4adcd30ba4 Mon Sep 17 00:00:00 2001 From: Oliver Tacke Date: Fri, 23 Nov 2018 15:13:41 +0100 Subject: [PATCH 3/4] HFP-2398 Remove aria-label in action bar WAIA states it is *not* supposed to be used if there's a visible label --- js/h5p-action-bar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/h5p-action-bar.js b/js/h5p-action-bar.js index c144b79..3af1a43 100644 --- a/js/h5p-action-bar.js +++ b/js/h5p-action-bar.js @@ -51,7 +51,7 @@ H5P.ActionBar = (function ($, EventDispatcher) { } }, appendTo: $actions - }).attr('aria-label', H5P.t(type + 'Description')); + }); hasActions = true; }; From 0678126f82708598a545e330c857d6346c722f21 Mon Sep 17 00:00:00 2001 From: Oliver Tacke Date: Fri, 23 Nov 2018 16:40:18 +0100 Subject: [PATCH 4/4] HFP-2398 Add aria-label to fullscreen buttons --- js/h5p.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/h5p.js b/js/h5p.js index f3a5575..eb685c5 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -139,6 +139,7 @@ H5P.init = function (target) { '
' + '
' + '
') @@ -568,7 +569,7 @@ H5P.fullScreen = function ($element, instance, exitCallback, body, forceSemiFull } before('h5p-semi-fullscreen'); - var $disable = H5P.jQuery('
').appendTo($container.find('.h5p-content-controls')); + var $disable = H5P.jQuery('
').appendTo($container.find('.h5p-content-controls')); var keyup, disableSemiFullscreen = H5P.exitFullScreen = function () { if (prevViewportContent) { // Use content from the previous viewport tag