From 2db570c10ff3cd228e9ff3c7124fe05f6f874332 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Mon, 25 Jun 2018 18:01:46 +0200 Subject: [PATCH] Improved accessibility in mobile page menu --- com.woltlab.wcf/templates/headIncludeJavaScript.tpl | 4 +++- wcfsetup/install/files/acp/templates/header.tpl | 4 +++- .../install/files/js/WoltLabSuite/Core/Ui/Page/Menu/Main.js | 5 ++++- .../install/files/js/WoltLabSuite/Core/Ui/Page/Menu/User.js | 5 ++++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/com.woltlab.wcf/templates/headIncludeJavaScript.tpl b/com.woltlab.wcf/templates/headIncludeJavaScript.tpl index 92dc326366..d53e9cfa85 100644 --- a/com.woltlab.wcf/templates/headIncludeJavaScript.tpl +++ b/com.woltlab.wcf/templates/headIncludeJavaScript.tpl @@ -109,7 +109,9 @@ requirejs.config({ 'wcf.user.panel.markAllAsRead': '{lang}wcf.user.panel.markAllAsRead{/lang}', 'wcf.user.panel.markAsRead': '{lang}wcf.user.panel.markAsRead{/lang}', 'wcf.user.panel.settings': '{lang}wcf.user.panel.settings{/lang}', - 'wcf.user.panel.showAll': '{lang}wcf.user.panel.showAll{/lang}' + 'wcf.user.panel.showAll': '{lang}wcf.user.panel.showAll{/lang}', + 'wcf.menu.page': '{lang}wcf.menu.page{/lang}', + 'wcf.menu.user': '{lang}wcf.menu.user{/lang}' {if MODULE_LIKE} ,'wcf.like.button.like': '{lang}wcf.like.button.like{/lang}', 'wcf.like.button.dislike': '{lang}wcf.like.button.dislike{/lang}', diff --git a/wcfsetup/install/files/acp/templates/header.tpl b/wcfsetup/install/files/acp/templates/header.tpl index 96c577aed0..b97321d9d7 100644 --- a/wcfsetup/install/files/acp/templates/header.tpl +++ b/wcfsetup/install/files/acp/templates/header.tpl @@ -122,7 +122,9 @@ 'wcf.global.success.add': '{lang}wcf.global.success.add{/lang}', 'wcf.global.success.edit': '{lang}wcf.global.success.edit{/lang}', 'wcf.global.thousandsSeparator': '{capture assign=thousandsSeparator}{lang}wcf.global.thousandsSeparator{/lang}{/capture}{@$thousandsSeparator|encodeJS}', - 'wcf.page.pagePosition': '{lang __literal=true}wcf.page.pagePosition{/lang}' + 'wcf.page.pagePosition': '{lang __literal=true}wcf.page.pagePosition{/lang}', + 'wcf.menu.page': '{lang}wcf.menu.page{/lang}', + 'wcf.menu.user': '{lang}wcf.menu.user{/lang}' {event name='javascriptLanguageImport'} }); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Menu/Main.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Menu/Main.js index 19ae1f67b9..ce069ef8aa 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Menu/Main.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Menu/Main.js @@ -6,7 +6,7 @@ * @license GNU Lesser General Public License * @module WoltLabSuite/Core/Ui/Page/Menu/Main */ -define(['Core', 'Dom/Traverse', './Abstract'], function(Core, DomTraverse, UiPageMenuAbstract) { +define(['Core', 'Language', 'Dom/Traverse', './Abstract'], function(Core, Language, DomTraverse, UiPageMenuAbstract) { "use strict"; var _container = null, _hasItems = null, _list = null, _navigationList = null, _spacer = null; @@ -43,6 +43,9 @@ define(['Core', 'Dom/Traverse', './Abstract'], function(Core, DomTraverse, UiPag } }).bind(this)); } + + elAttr(this._button, 'aria-label', Language.get('wcf.menu.page')); + elAttr(this._button, 'role', 'button'); }, open: function (event) { diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Menu/User.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Menu/User.js index 2ae72d6915..42fb106f1e 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Menu/User.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Menu/User.js @@ -6,7 +6,7 @@ * @license GNU Lesser General Public License * @module WoltLabSuite/Core/Ui/Page/Menu/User */ -define(['Core', 'EventHandler', './Abstract'], function(Core, EventHandler, UiPageMenuAbstract) { +define(['Core', 'EventHandler', 'Language', './Abstract'], function(Core, EventHandler, Language, UiPageMenuAbstract) { "use strict"; /** @@ -53,6 +53,9 @@ define(['Core', 'EventHandler', './Abstract'], function(Core, EventHandler, UiPa } }).bind(this)); }).bind(this)); + + elAttr(this._button, 'aria-label', Language.get('wcf.menu.user')); + elAttr(this._button, 'role', 'button'); }, close: function (event) { -- 2.20.1