diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-04-19 14:47:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-19 14:47:17 +0200 |
commit | 0bae516c66efe9004d0a8ff504e0deb0069fc9d9 (patch) | |
tree | 386c7cd07dd0063800716ca2531343258d01ddd7 /core | |
parent | 4d71e12a43a0d9f0d51fc95f199e217692e7ca41 (diff) | |
parent | 0f9ba852bc7e8bafecbd0bcd73099892645ac79e (diff) | |
download | nextcloud-server-0bae516c66efe9004d0a8ff504e0deb0069fc9d9.tar.gz nextcloud-server-0bae516c66efe9004d0a8ff504e0deb0069fc9d9.zip |
Merge pull request #9224 from nextcloud/accessibility-improvements
Add labels for Contacts menu and Settings, thanks to @MarcoZehe
Diffstat (limited to 'core')
-rw-r--r-- | core/css/variables.scss | 5 | ||||
-rw-r--r-- | core/js/js.js | 7 | ||||
-rw-r--r-- | core/templates/layout.base.php | 2 | ||||
-rw-r--r-- | core/templates/layout.guest.php | 6 | ||||
-rw-r--r-- | core/templates/layout.public.php | 2 | ||||
-rw-r--r-- | core/templates/layout.user.php | 37 | ||||
-rw-r--r-- | core/templates/login.php | 2 |
7 files changed, 43 insertions, 18 deletions
diff --git a/core/css/variables.scss b/core/css/variables.scss index 2e4e9028b30..a60460a3088 100644 --- a/core/css/variables.scss +++ b/core/css/variables.scss @@ -7,6 +7,11 @@ $color-warning: #ffcc44; $color-success: #46ba61; $color-primary-element: $color-primary; +// rgb(118, 118, 118) / #767676 +// min. color contrast for normal text on white background according to WCAG AA +// (Works as well: color: #000; opacity: 0.57;) +$color-text-details: #767676; + @function nc-darken($color, $value) { @return darken($color, $value); } diff --git a/core/js/js.js b/core/js/js.js index 3d5f489895d..d7975804f4b 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -702,6 +702,9 @@ var OCP = {}, $menuEl.parent().addClass('openedMenu'); } + // Set menu to expanded + $toggle.attr('aria-expanded', true); + $menuEl.slideToggle(OC.menuSpeed, toggle); OC._currentMenu = $menuEl; OC._currentMenuToggle = $toggle; @@ -736,6 +739,10 @@ var OCP = {}, } }); } + + // Set menu to closed + $('.menutoggle').attr('aria-expanded', false); + $('.openedMenu').removeClass('openedMenu'); OC._currentMenu = null; OC._currentMenuToggle = null; diff --git a/core/templates/layout.base.php b/core/templates/layout.base.php index 043ac32fbc6..0529521bcdd 100644 --- a/core/templates/layout.base.php +++ b/core/templates/layout.base.php @@ -7,7 +7,7 @@ </title> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="referrer" content="no-referrer"> - <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0"> + <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0"> <meta name="theme-color" content="<?php p($theme->getColorPrimary()); ?>"> <link rel="icon" href="<?php print_unescaped(image_path('', 'favicon.ico')); /* IE11+ supports png */ ?>"> <link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path('', 'favicon-touch.png')); ?>"> diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php index 21bd72fc88b..a53cd82fcfd 100644 --- a/core/templates/layout.guest.php +++ b/core/templates/layout.guest.php @@ -7,7 +7,7 @@ </title> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="referrer" content="no-referrer"> - <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0"> + <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0"> <meta name="apple-itunes-app" content="app-id=<?php p($theme->getiTunesAppId()); ?>"> <meta name="theme-color" content="<?php p($theme->getColorPrimary()); ?>"> <link rel="icon" href="<?php print_unescaped(image_path('', 'favicon.ico')); /* IE11+ supports png */ ?>"> @@ -37,7 +37,9 @@ </div> </header> <?php endif; ?> - <?php print_unescaped($_['content']); ?> + <main> + <?php print_unescaped($_['content']); ?> + </main> </div> </div> <footer role="contentinfo"> diff --git a/core/templates/layout.public.php b/core/templates/layout.public.php index 2317a7b36ef..abd7e942c04 100644 --- a/core/templates/layout.public.php +++ b/core/templates/layout.public.php @@ -10,7 +10,7 @@ </title> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="referrer" content="never"> - <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0"> + <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0"> <meta name="apple-itunes-app" content="app-id=<?php p($theme->getiTunesAppId()); ?>"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index e11620a3111..1a3a7091c5e 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -10,7 +10,7 @@ </title> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="referrer" content="no-referrer"> - <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0"> + <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0"> <meta name="apple-itunes-app" content="app-id=<?php p($theme->getiTunesAppId()); ?>"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> @@ -45,8 +45,9 @@ <?php foreach ($_['navigation'] as $entry): ?> <li data-id="<?php p($entry['id']); ?>" class="hidden"> <a href="<?php print_unescaped($entry['href']); ?>" - <?php if ($entry['active']): ?> class="active"<?php endif; ?>> - <svg width="20" height="20" viewBox="0 0 20 20"> + <?php if ($entry['active']): ?> class="active"<?php endif; ?> + aria-label="<?php p($entry['name']); ?>"> + <svg width="20" height="20" viewBox="0 0 20 20" alt=""> <?php if ($_['themingInvertMenu']) { ?> <defs><filter id="invertMenuMain-<?php p($entry['id']); ?>"><feColorMatrix in="SourceGraphic" type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" /></filter></defs> <?php } ?> @@ -60,8 +61,9 @@ </span> </li> <?php endforeach; ?> - <li id="more-apps" class="menutoggle"> - <a href="#"> + <li id="more-apps" class="menutoggle" + aria-haspopup="true" aria-controls="navigation" aria-expanded="false"> + <a href="#" aria-label="<?php p($l->t('More apps')); ?>"> <div class="icon-more-white"></div> <span><?php p($l->t('More apps')); ?></span> </a> @@ -69,14 +71,15 @@ </ul> <nav role="navigation"> - <div id="navigation" style="display: none;"> + <div id="navigation" style="display: none;" aria-label="<?php p($l->t('More apps menu')); ?>"> <div id="apps"> <ul> <?php foreach($_['navigation'] as $entry): ?> <li data-id="<?php p($entry['id']); ?>"> <a href="<?php print_unescaped($entry['href']); ?>" - <?php if( $entry['active'] ): ?> class="active"<?php endif; ?>> - <svg width="16" height="16" viewBox="0 0 16 16"> + <?php if( $entry['active'] ): ?> class="active"<?php endif; ?> + aria-label="<?php p($entry['name']); ?>"> + <svg width="16" height="16" viewBox="0 0 16 16" alt=""> <defs><filter id="invertMenuMore-<?php p($entry['id']); ?>"><feColorMatrix in="SourceGraphic" type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"></feColorMatrix></filter></defs> <image x="0" y="0" width="16" height="16" preserveAspectRatio="xMinYMin meet" filter="url(#invertMenuMore-<?php p($entry['id']); ?>)" xlink:href="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>" class="app-icon"></image> </svg> @@ -103,11 +106,17 @@ <button class="icon-close-white" type="reset"><span class="hidden-visually"><?php p($l->t('Reset search'));?></span></button> </form> <div id="contactsmenu"> - <div class="icon-contacts menutoggle" tabindex="0" role="link"></div> - <div class="menu"></div> + <div class="icon-contacts menutoggle" tabindex="0" role="button" + aria-haspopup="true" aria-controls="contactsmenu-menu" aria-expanded="false"> + <span class="hidden-visually"><?php p($l->t('Contacts'));?> + </div> + <div id="contactsmenu-menu" class="menu" + aria-label="<?php p($l->t('Contacts menu'));?>"></div> </div> <div id="settings"> - <div id="expand" tabindex="0" role="link" class="menutoggle"> + <div id="expand" tabindex="0" role="button" class="menutoggle" + aria-label="<?php p($l->t('Settings'));?>" + aria-haspopup="true" aria-controls="expanddiv" aria-expanded="false"> <div class="avatardiv<?php if ($_['userAvatarSet']) { print_unescaped(' avatardiv-shown'); } else { print_unescaped('" style="display: none'); } ?>"> <?php if ($_['userAvatarSet']): ?> <img alt="" width="32" height="32" @@ -118,7 +127,8 @@ </div> <div id="expandDisplayName" class="icon-settings-white"></div> </div> - <div id="expanddiv" style="display:none;"> + <nav id="expanddiv" style="display:none;" + aria-label="<?php p($l->t('Settings menu'));?>"> <ul> <?php foreach($_['settingsnavigation'] as $entry):?> <li> @@ -130,8 +140,7 @@ </li> <?php endforeach; ?> </ul> - - </div> + </nav> </div> </div> </div></header> diff --git a/core/templates/login.php b/core/templates/login.php index ee1ce6a6870..8fc68edb92d 100644 --- a/core/templates/login.php +++ b/core/templates/login.php @@ -37,6 +37,7 @@ script('core', 'merged-login'); <p class="grouptop<?php if (!empty($_['invalidpassword'])) { ?> shake<?php } ?>"> <input type="text" name="user" id="user" placeholder="<?php p($l->t('Username or email')); ?>" + aria-label="<?php p($l->t('Username or email')); ?>" value="<?php p($_['loginName']); ?>" <?php p($_['user_autofocus'] ? 'autofocus' : ''); ?> autocomplete="on" autocapitalize="none" autocorrect="off" required> @@ -46,6 +47,7 @@ script('core', 'merged-login'); <p class="groupbottom<?php if (!empty($_['invalidpassword'])) { ?> shake<?php } ?>"> <input type="password" name="password" id="password" value="" placeholder="<?php p($l->t('Password')); ?>" + aria-label="<?php p($l->t('Password')); ?>" <?php p($_['user_autofocus'] ? '' : 'autofocus'); ?> autocomplete="on" autocapitalize="off" autocorrect="none" required> <label for="password" class="infield"><?php p($l->t('Password')); ?></label> |