Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XWIKI-19723: Navigation panel not accessible using a screen reader #3789

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ rendering.macro.tree.parameter.finder.description=Show a text input that can be
rendering.macro.tree.parameter.limit.name=Limit
rendering.macro.tree.parameter.limit.description=The maximum number of child nodes to display when expanding a parent node for the first time. The rest of the child nodes are accessible through a "more ..." link. This parameter is basically used to paginate the child nodes and thus helps the tree scale when the number of child nodes is large. The tree passes this parameter to the tree source so it works only with dynamic trees whose source implements child count limit.
rendering.macro.tree.content.description=You can use nested HTML unordered lists to describe the tree structure. See http://www.jstree.com/docs/html/ for more information.
tree.macro.editModeWarning=This tree can't be displayed in edit mode.</content>
tree.macro.editModeWarning=This tree can't be displayed in edit mode.
tree.macro.description=Expand and collapse this tree nodes respectively with the right and left arrow keys. Navigate between the nodes with the up and down arrow keys.</content>
<object>
<name>Macros.TreeTranslations</name>
<number>0</number>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
'exclusions': $collectiontool.set,
'finder': false,
'icons': true,
'id': "xtree-${datetool.date.time}-${mathtool.random(100, 1000)}",
'limit': 15,
'links': false,
'openTo': '',
Expand All @@ -37,6 +38,9 @@

#macro (tree $options)
<div #treeAttributes($options)></div>
<span id="$!{attributes.id}-description" class="sr-only">
$services.localization.render('tree.macro.description')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$services.localization.render('tree.macro.description')
$escapetool.xml($services.localization.render('tree.macro.description'))

</span>
#end

#macro (treeAttributes $options $isWikiSyntax)
Expand All @@ -62,14 +66,14 @@
$entry.key = "$escapedValue"##
#end
#end

#macro (getTreeAttributes $options $attributes)
#set ($macro.options = {})
#set ($discard = $macro.options.putAll($defaultTreeOptions))
#set ($discard = $macro.options.putAll($options))
#if ($macro.options.id)
#set ($discard = $attributes.put('id', $macro.options.id))
#end
#set ($discard = $attributes.put('aria-describedby', "$!{macro.options.id}-description"))
#set ($classes = ["$!macro.options.get('class')"])
#set ($noLinks = $macro.options.links != 'true')
#if ($noLinks)
Expand Down