From a6d26c53e1730f4a0bdb7da1ae60cffaf599f5ed Mon Sep 17 00:00:00 2001 From: mprins Date: Mon, 26 May 2014 14:53:01 +0200 Subject: [PATCH] Enhance and improve the accessibility example. Changes to improve the accessibility example: - remove the `accesskey` attributes. Use of the `accesskey` is generally not recommended as it tends to cause conflicts with AT software and user settings. - Change the scripted "Go to map" accesskey to a regular skiplink. - Use script to inject the buttons below the map, if the map were to fail for lack of javascript support the buttons should not be there either. These should be buttons (and not hyperlinks) because they provide an action not a navigation. - Update the docs. - Add an empty `alt` attribute to the logo since it is strictly decorative (this should probably be done sitewide - which IMO is out of scope for this PR) --- examples/accessible.html | 29 ++++++++++++++++++++--------- examples/accessible.js | 7 +++++++ 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/examples/accessible.html b/examples/accessible.html index a34d831082..58f1c2d030 100644 --- a/examples/accessible.html +++ b/examples/accessible.html @@ -10,8 +10,21 @@ Accessibility example @@ -20,7 +33,7 @@ @@ -29,10 +42,8 @@
@@ -42,9 +53,9 @@

Accessibility example

Example of an accessible map.

-

This page's map element has its tabindex attribute set to "0". That makes is focusable. To focus the map element you can either navigate to it using the "tab" key, or use the Access Key "1" (alt+1 or ctrl+alt+1) which provides a direct access. When the map element is focused the + and - keys can be used to zoom in and out, and the arrow keys can be used to pan.

-

When clicked the "Zoom in" and "Zoom out" links below the map zoom the map in and out, respectively. You can navigate to the links using the "tab" key, and press the "enter" key to trigger the zooming action. The Access Keys "i" and "o" can also be used, as a direct access to the actions of "Zoom in" and "Zoom out" links.

-

See the source of the page to see how this done.

+

This page's map element has its tabindex attribute set to "0", that makes it focusable. To focus the map element you can either navigate to it using the "tab" key or use the skip link. When the map element is focused the + and - keys can be used to zoom in and out and the arrow keys can be used to pan.

+

When clicked the "Zoom in" and "Zoom out" buttons below the map zoom the map in and out, respectively. You can navigate to the buttons using the "tab" key, and press the "enter" key to trigger the zooming action.

+

See the accessible.js source to see how this is done.

accessibility, tabindex
diff --git a/examples/accessible.js b/examples/accessible.js index c3c620e350..4f61352b2e 100644 --- a/examples/accessible.js +++ b/examples/accessible.js @@ -17,3 +17,10 @@ var map = new ol.Map({ zoom: 2 }) }); + +jQuery('#map').after(''); +jQuery('#map').after('');