Module: alfresco/accessibility/AccessibilityMenu

alfresco/accessibility/AccessibilityMenu

This module creates, when configured, an accessibility menu which provides a selection of hotkey links such as 'skip to content'.
Author:
  • Richard Smith
License:
Source:

Example

Sample configuration

{
   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}
      ]
   }
}

Mixes In

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:
The urls, access keys and message identifiers used to render the accessibility links
Type:
  • object[]
Source:

targets :object[]

The domid, targetid and positioning used to render the accessibility link targets
Type:
  • object[]
Source:

templateString :String

The HTML template to use for the widget.
Type:
  • String
Source:

titleMsg :String

The message to display as title
Type:
  • String
Source:

titleMsgKey :String

The message key to display as title if no titleMsg provided
Type:
  • String
Source:
A storage array for the menu links we generate
Type:
  • object[]
Source:

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.
Source:
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.
Source:
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
Source:

postCreate()

Source:

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
Source: