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-22280: Object editor dropdowns are not keyboard accessible #3254

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
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 @@ -60,20 +60,24 @@ $xwiki.jsfx.use('js/xwiki/editors/dataeditors.js', true)##
#macro (displayProperty $field)
<div id="xproperty_${field.name}" class="xproperty #if($field.disabled)disabled#end">
<div id="xproperty_${field.name}_title" class="xproperty-title ${field.type}">
<span class="toggle-collapsable" role="presentation">$services.icon.renderHTML('caret-down')</span>
<h2>
$!escapetool.xml($doc.displayView($field.xWikiClass.get('prettyName'), "${field.name}_" , $field))
($doc.displayView($field.xWikiClass.get('name'), "${field.name}_" , $field):
<h3>
Copy link
Member

Choose a reason for hiding this comment

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

Was a mistake before to use h2?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added additional structure to the page with a H2 :
https://github.com/xwiki/xwiki-platform/pull/3254/files#diff-6188397dc36b434aca69e83161e131eb37f552008a22b918a6b8bd1bc925b22eR183-R189

This is clearly a subcategory of the propertylist, so I think a H3 here would be appropriate.

<button type="button" class="btn btn-default btn-xs">
<span class="sr-only">$escapetool.xml($services.localization.render('core.editors.class.property.toggleDisplay.tooltip'))</span>
<span class="toggle-collapsable" role="presentation">$services.icon.renderHTML('caret-down')</span>
<span class="iconHolder"></span>
$!escapetool.xml($doc.displayView($field.xWikiClass.get('prettyName'), "${field.name}_" , $field))
($doc.displayView($field.xWikiClass.get('name'), "${field.name}_" , $field):
$xwiki.metaclass.get($field.classType).prettyName)
</h2>
</button>
</h3>
<div class="tools propertyTools">
#set ($deletePropURL = $doc.getURL('propdelete', $escapetool.url({
'propname': $field.name,
'form_token': $services.csrf.token
})))
<a class="tool delete" href="$deletePropURL" title="$services.localization.render(
'core.editors.class.deleteProperty.tooltip', [$field.name])">
<span role="presentation">$services.icon.renderHTML('cross')</span>
<span role="presentation">$services.icon.renderHTML('trash')</span>
<span class="sr-only">$services.localization.render(
'core.editors.class.deleteProperty.text')</span></a>
</div>
Expand Down Expand Up @@ -176,8 +180,13 @@ $xwiki.jsfx.use('js/xwiki/editors/dataeditors.js', true)##
<div id="xwikiclassproperties">
<div id="xclass_${escapetool.xml($class.name)}" class="xclass">
<div id="xclass_${escapetool.xml($class.name)}_title" class="xclass-title">
<span class="toggle-collapsable" role="presentation">$services.icon.renderHTML('caret-down')</span>
<h2>${escapetool.xml($class.name)}</h2>
<h2>
<button type="button" class="btn btn-default">
<span class="sr-only">$escapetool.xml($services.localization.render('core.editors.class.toggleDisplay.tooltip'))</span>
<span class="toggle-collapsable" role="presentation">$services.icon.renderHTML('caret-down')</span>
${escapetool.xml($class.name)}
</button>
</h2>
</div>
#addPropertyForm()
<div id="xclass_${escapetool.xml($class.name)}_content" class="xclass-content"><div id="xclassContent">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,17 @@
<div id="xobject_${escapetool.xml($class.name)}_${obj.number}" class="xobject">
#getFieldSummary($obj $firstField $firstFieldSummary)
<div id="xobject_${escapetool.xml($class.name)}_${obj.number}_title" class="xobject-title">
<span class="toggle-collapsable" role="presentation">$services.icon.renderHTML('caret-down')</span>
<h3>#cleanClassname(${class.name}) <span class="editor-objectNumber">${obj.number}</span>#if ($firstField): $firstFieldSummary#end
<a href="$doc.getURL('objectremove', "form_token=$!{services.csrf.getToken()}&amp;classname=${escapetool.url($class.name)}&amp;classid=${obj.number}&amp;xredirect=${escapetool.url($doc.getURL('edit', 'editor=object'))}")" class="xobject-action delete" title="$services.localization.render('core.editors.object.removeObject.tooltip')">$services.icon.renderHTML('cross')</a>
#if (!$hasCustomObject)
<a href="$doc.getURL('edit', "editor=object&amp;classname=${escapetool.url($class.name)}&amp;object=${obj.number}")" class="xobject-action edit" title="$services.localization.render('core.editors.object.editSingleObject.tooltip')">$services.icon.renderHTML('pencil')</a>
#end
<h3>
<button type="button" class="btn btn-default btn-xs">
<span class="sr-only">$escapetool.xml($services.localization.render('core.editors.object.toggleDisplay.tooltip'))</span>
<span class="toggle-collapsable" role="presentation">$services.icon.renderHTML('caret-down')</span>
#cleanClassname(${class.name}) <span class="editor-objectNumber">${obj.number}</span>#if ($firstField): $firstFieldSummary#end
</button>
</h3>
<a href="$doc.getURL('objectremove', "form_token=$!{services.csrf.getToken()}&amp;classname=${escapetool.url($class.name)}&amp;classid=${obj.number}&amp;xredirect=${escapetool.url($doc.getURL('edit', 'editor=object'))}")" class="xobject-action delete" title="$escapetool.xml($services.localization.render('core.editors.object.removeObject.tooltip'))">$services.icon.renderHTML('trash')</a>
#if (!$hasCustomObject)
<a href="$doc.getURL('edit', "editor=object&amp;classname=${escapetool.url($class.name)}&amp;object=${obj.number}")" class="xobject-action edit" title="$escapetool.xml($services.localization.render('core.editors.object.editSingleObject.tooltip'))">$services.icon.renderHTML('pencil')</a>
#end
</div>
<div id="xobject_${escapetool.xml($class.name)}_${obj.number}_content" class="xobject-content">
#if ($isNew == "true")
Expand Down Expand Up @@ -89,7 +93,7 @@
</dl>
<div>
<a class="syncProperties" href='$doc.getURL("objectsync", "classname=${escapetool.url($class.name)}&amp;object=${obj.number}")'
title="$services.localization.render('core.editors.object.removeDeprecatedProperties.link.tooltip')">
title="$escapetool.xml($services.localization.render('core.editors.object.removeDeprecatedProperties.link.tooltip'))">
$services.icon.renderHTML('cross')
$services.localization.render('core.editors.object.removeDeprecatedProperties.link')
</a>
Expand Down Expand Up @@ -152,8 +156,13 @@
#set ($object = $doc.getObject($class.name, $customObject))
#if ($object)
<div id="xclass_${escapetool.xml($class.name)}_title" class="xclass-title">
<span class="toggle-collapsable" role="presentation">$services.icon.renderHTML('caret-down')</span>
<h2>${escapetool.xml($class.name)}</h2>
<h2>
<button type="button" class="btn btn-default">
<span class="sr-only">$escapetool.xml($services.localization.render('core.editors.class.toggleDisplay.tooltip'))</span>
<span class="toggle-collapsable" role="presentation">$services.icon.renderHTML('caret-down')</span>
${escapetool.xml($class.name)}
</button>
</h2>
</div>
<div id="xclass_${escapetool.xml($class.name)}_content" class="xclass-content"><div>
#displayObject($object $class $props $titleField)
Expand All @@ -173,9 +182,13 @@
#end
#set ($objectCount = $objects.size())
<div id="xclass_${escapetool.xml($class.name)}_title" class="xclass-title">
<span class="toggle-collapsable" role="presentation">$services.icon.renderHTML('caret-down')</span>
<h2>$services.localization.render('core.editors.object.objectsForClass', [${escapetool.xml($class.name)}])
<span id="xclass_${escapetool.xml($class.name)}_xobject_nb" class="xclass_xobject_nb">($objectCount)</span>
<h2>
<button type="button" class="btn btn-secondary">
<span class="sr-only">$escapetool.xml($services.localization.render('core.editors.class.toggleDisplay.tooltip'))</span>
<span class="toggle-collapsable" role="presentation">$services.icon.renderHTML('caret-down')</span>
$services.localization.render('core.editors.object.objectsForClass', [${escapetool.xml($class.name)}])
<span id="xclass_${escapetool.xml($class.name)}_xobject_nb" class="xclass_xobject_nb">($objectCount)</span>
</button>
</h2>
</div>
<div id="xclass_${escapetool.xml($class.name)}_content" class="xclass-content"><div>
Expand All @@ -195,7 +208,7 @@
#macro(displayAddObject $class)
<div id="add_xobject_${escapetool.xml($class.name)}" class="add_xobject">
<div id="add_xobject_${escapetool.xml($class.name)}_title" class="add_xobject-title">
<a href="$doc.getURL('edit', "xpage=editobject&amp;xaction=addObject&amp;form_token=$!{services.csrf.getToken()}&amp;classname=$escapetool.url(${class.name})&amp;xredirect=$escapetool.url(${doc.getURL('edit', 'editor=object')})")" class="xobject-add-control" title="$services.localization.render('core.editors.object.newObjectForClass.tooltip', ["#cleanClassname(${class.name})"])">$services.icon.renderHTML('add') $services.localization.render('core.editors.object.newObjectForClass', ["#cleanClassname(${class.name})"])</a>
<a href="$doc.getURL('edit', "xpage=editobject&amp;xaction=addObject&amp;form_token=$!{services.csrf.getToken()}&amp;classname=$escapetool.url(${class.name})&amp;xredirect=$escapetool.url(${doc.getURL('edit', 'editor=object')})")" class="xobject-add-control" title="$escapetool.xml($services.localization.render('core.editors.object.newObjectForClass.tooltip', ["#cleanClassname(${class.name})"]))">$services.icon.renderHTML('add') $services.localization.render('core.editors.object.newObjectForClass', ["#cleanClassname(${class.name})"])</a>
</div>
</div>
#end
Expand Down Expand Up @@ -247,7 +260,7 @@
#if ($mustSync)
<div class="box warningmessage deprecatedProperties">
$services.localization.render('core.editors.object.removeDeprecatedProperties.all.info')
<div><a class="syncProperties syncAllProperties" href="$doc.getURL('objectsync')" title="$services.localization.render('core.editors.object.removeDeprecatedProperties.all.link.tooltip')">$services.localization.render('core.editors.object.removeDeprecatedProperties.all.link')</a></div>
<div><a class="syncProperties syncAllProperties" href="$doc.getURL('objectsync')" title="$escapetool.xml($services.localization.render('core.editors.object.removeDeprecatedProperties.all.link.tooltip'))">$services.localization.render('core.editors.object.removeDeprecatedProperties.all.link')</a></div>
</div>
#end
#end ## checkPropertyDeprecation
Expand Down Expand Up @@ -355,7 +368,7 @@
#set ($fullEditorURL = "$doc.getURL('edit', 'editor=object')")
<div class="more-actions">
$services.icon.renderHTML('pencil')
<a href='$fullEditorURL' class='edit-all' title="$services.localization.render('core.editors.object.editAllObjects')">$services.localization.render('core.editors.object.editAllObjects')</a>
<a href='$fullEditorURL' class='edit-all' title="$escapetool.xmlI($services.localization.render('core.editors.object.editAllObjects'))">$services.localization.render('core.editors.object.editAllObjects')</a>
</div>
#end
#set ($redirect = $xwiki.relativeRequestURL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,7 @@ core.editors.object.newObjectForClass.tooltip=New {0} object
core.editors.object.editAllObjects=\u00ABEdit all the objects defined in this page
core.editors.object.editSingleObject=[Edit only this object]
core.editors.object.editSingleObject.tooltip=Edit only this object
core.editors.object.toggleDisplay.tooltip=Toggle detail displaying for the object:
core.editors.object.removeObject=[Remove this object]
core.editors.object.removeObject.tooltip=Remove this object
core.editors.object.invalidPropertyName=No such property: {0}
Expand All @@ -1321,14 +1322,16 @@ core.editors.object.removeDeprecatedProperties.failed=Failed to remove deprecate
core.editors.class.title=Editing class <a href="{1}">{0}</a>
core.editors.class.switchClass=Edit another class
core.editors.class.switchClass.confirm=Do you want to save this class before leaving the editor?
core.editors.class.toggleDisplay.tooltip=Toggle detail displaying for the class:
core.editors.class.property.toggleDisplay.tooltip=Toggle detail displaying for the property:
core.editors.class.addProperty.name.label=Add new property
core.editors.class.addProperty.type.label=Type
core.editors.class.addProperty.submit=Add
core.editors.class.addProperty.inProgress=Adding property...
core.editors.class.addProperty.done=Property added
core.editors.class.addProperty.failed=Failed:

core.editors.class.moveProperty.handle.label=Drag and drop to change the order
core.editors.class.moveProperty.handle.label=Drag and drop or use up/down arrows to change the order of this property.

core.editors.class.deleteProperty.text=delete
core.editors.class.deleteProperty.tooltip=Delete property {0}
Expand Down
Loading