This module creates, when configured, an accessibility menu which provides a selection of hotkey links such as 'skip to content'.
- Copyright:
- Copyright (C) 2005-2020 Alfresco Software Limited
- License:
- GNU Lesser General Public License, see: Open Source Licensing
- Source:
Example
{
name: "alfresco/accessibility/AccessibilityMenu",
config: {
id: "AccessibilityMenu",
titleMsgKey: "access.key.links.message",
menu: [
{url: "#accesskey-skip", key: "s", msgKey: "skip.to.content.message"},
{url: "/share/page/accessibility-help", key: "0", msgKey: "access.keys.message"},
{url: "/share/page/user/admin/dashboard", key: "1", msgKey: "home.page.message"},
{url: "/share/page/advsearch", key: "4", msgKey: "search.this.site.message"},
{url: "/share/page/site-help", key: "6", msgKey: "accessibility.help.message"},
{url: "/share/page/terms", key: "8", msgKey: "terms.and.conditions.message"},
{url: "/share", key: "9", msg: "This is just a test message"},
{url: "#accesskey-foot", key: "b", msgKey: "skip.to.foot.message"}
],
targets: [
{domid: "AccessibilityMenu", targetid: "accesskey-skip", after: false},
{domid: "AccessibilityMenu", targetid: "accesskey-foot", after: true}
]
}
}
Extends
Mixes In
- external:dojo/_TemplatedMixin
- module:alfresco/core/Core
Members
-
cssRequirements :object[]
-
An array of the CSS files to use with this widget.
Type:
- object[]
- Default Value:
- [{cssFile:"./css/AccessibilityMenu.css"}]
- Source:
-
i18nRequirements :object[]
-
An array of the i18n files to use with this widget.
Type:
- object[]
- Default Value:
- [{i18nFile: "./i18n/AccessibilityMenu.properties"}]
- Source:
-
menu :object[]
-
The urls, access keys and message identifiers used to render the accessibility links
Type:
- object[]
-
targets :object[]
-
The domid, targetid and positioning used to render the accessibility link targets
Type:
- object[]
-
templateString :String
-
The HTML template to use for the widget.
Type:
- String
-
titleMsg :String
-
The message to display as title
Type:
- String
-
titleMsgKey :String
-
The message key to display as title if no titleMsg provided
Type:
- String
-
<private, inner> _createdLinks :object[]
-
A storage array for the menu links we generate
Type:
- object[]
Methods
-
addEvents()
-
This function iterates over the generated menu links. If they contain a '#' value and the target item (by id) can be found then the link is given an onClick that sets and then unsets the tabindex of the target to take it out of regular page flow, and then focuses it.
Listens to Events:
- event:ALF_WIDGETS_READY
-
generateTargets()
-
This function generates HTML anchors from this.targets. It is called via a subscription to the ALF_WIDGETS_READY channel to make sure that the destination DOM elements have already been created.
Listens to Events:
- event:ALF_WIDGETS_READY
-
onLinkClick(item, target, evt)
-
This function iterates over the generated menu links. If they contain a '#' value and the target item (by id) can be found then the link is given an onClick that sets and then unsets the tabindex of the target to take it out of regular page flow, and then focuses it.
Parameters:
Name Type Description item
object The clicked item target
object The target configured for the clicked item evt
event The click event -
postCreate()
-
writeMenuItem(list, item)
-
This function writes a list item for the accessibility menu.
Parameters:
Name Type Description list
object The list into which menu items are added item
object The object containing details for the menu item