diff --git a/xwiki-platform-core/xwiki-platform-tree/xwiki-platform-tree-macro/src/main/resources/Macros/TreeTranslations.xml b/xwiki-platform-core/xwiki-platform-tree/xwiki-platform-tree-macro/src/main/resources/Macros/TreeTranslations.xml index e94c24c00c83..bb9440f1128c 100644 --- a/xwiki-platform-core/xwiki-platform-tree/xwiki-platform-tree-macro/src/main/resources/Macros/TreeTranslations.xml +++ b/xwiki-platform-core/xwiki-platform-tree/xwiki-platform-tree-macro/src/main/resources/Macros/TreeTranslations.xml @@ -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. +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. Macros.TreeTranslations 0 diff --git a/xwiki-platform-core/xwiki-platform-tree/xwiki-platform-tree-war/src/main/webapp/templates/tree_macros.vm b/xwiki-platform-core/xwiki-platform-tree/xwiki-platform-tree-war/src/main/webapp/templates/tree_macros.vm index 862050fcfc5c..63fa543ef08f 100644 --- a/xwiki-platform-core/xwiki-platform-tree/xwiki-platform-tree-war/src/main/webapp/templates/tree_macros.vm +++ b/xwiki-platform-core/xwiki-platform-tree/xwiki-platform-tree-war/src/main/webapp/templates/tree_macros.vm @@ -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': '', @@ -37,6 +38,9 @@ #macro (tree $options)
+ + $services.localization.render('tree.macro.description') + #end #macro (treeAttributes $options $isWikiSyntax) @@ -62,7 +66,6 @@ $entry.key = "$escapedValue"## #end #end - #macro (getTreeAttributes $options $attributes) #set ($macro.options = {}) #set ($discard = $macro.options.putAll($defaultTreeOptions)) @@ -70,6 +73,7 @@ #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)