Skip to content
Snippets Groups Projects
Unverified Commit 5c931143 authored by Stéphane Laurière's avatar Stéphane Laurière Committed by GitHub
Browse files

XWIKI-18006: Add mechanism to skip header parts and go to main content directly (#1667)

* Add a link to skip header parts and go to main content directly
* Make link visible only when it has focus or when it is active
parent 85de21b3
No related branches found
No related tags found
No related merge requests found
...@@ -90,6 +90,7 @@ ...@@ -90,6 +90,7 @@
#template("xwikivars.vm") #template("xwikivars.vm")
#template("layoutvars.vm") #template("layoutvars.vm")
#template("htmlheader.vm") #template("htmlheader.vm")
#template("skipnav.vm")
#if($displayMainMenu) #if($displayMainMenu)
<div id="menuview"> <div id="menuview">
#template("menus_view.vm") #template("menus_view.vm")
......
...@@ -362,3 +362,14 @@ already take care of padding and shadow. */ ...@@ -362,3 +362,14 @@ already take care of padding and shadow. */
border-left-color: fade((@xwiki-border-color), 80%); border-left-color: fade((@xwiki-border-color), 80%);
border-right-color: fade((@xwiki-border-color), 80%); border-right-color: fade((@xwiki-border-color), 80%);
} }
.skip-nav {
a {
position: absolute;
top: -20em;
z-index: 10;
&:focus, &:active {
top: 0;
}
}
}
## ---------------------------------------------------------------------------
## See the NOTICE file distributed with this work for additional
## information regarding copyright ownership.
##
## This is free software; you can redistribute it and/or modify it
## under the terms of the GNU Lesser General Public License as
## published by the Free Software Foundation; either version 2.1 of
## the License, or (at your option) any later version.
##
## This software is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this software; if not, write to the Free
## Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
## 02110-1301 USA, or see the FSF site: http://www.fsf.org.
## ---------------------------------------------------------------------------
## Provide a way to skip directly to the main content of page
## See: https://www.w3.org/TR/WCAG20-TECHS/G1.html
<div class="skip-nav">
#if ("$!xcontext.action" == 'view' || "$!xcontext.action" == 'preview')
## Point at #xwikicontent to skip over the navigation tools including the breadrumb
#set ($targetNav = '#xwikicontent')
#elseif (("$!xcontext.action" == 'inline' || "$!xcontext.action" == 'edit') && !$editConfirmation)
## In edit mode, point at the title field
#set ($targetNav = '#editMeta')
#else
## Point at '#mainContentArea' which is present in all pages that include "startpage.vm"
#set ($targetNav = '#mainContentArea')
#end
<a class="btn btn-default" href="$targetNav">$services.localization.render('skin.skipnav.links.content.title')</a>
</div>
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#template("xwikivars.vm") #template("xwikivars.vm")
#template("layoutvars.vm") #template("layoutvars.vm")
#template("htmlheader.vm") #template("htmlheader.vm")
#template("skipnav.vm")
#if($displayMainMenu) #if($displayMainMenu)
<div id="menuview"> <div id="menuview">
#template("menus_view.vm") #template("menus_view.vm")
......
...@@ -342,6 +342,9 @@ platform.core.editConfirmation.errors=Editing is forbidden for the reasons liste ...@@ -342,6 +342,9 @@ platform.core.editConfirmation.errors=Editing is forbidden for the reasons liste
platform.core.editConfirmation.warnings=Editing can be forced, but be aware of the warnings below. platform.core.editConfirmation.warnings=Editing can be forced, but be aware of the warnings below.
platform.core.editConfirmation.additionalWarnings=In addition to the errors listed above, the warnings below have also been identified. platform.core.editConfirmation.additionalWarnings=In addition to the errors listed above, the warnings below have also been identified.
### Skip to
skin.skipnav.links.content.title=Skip to Content
### ###
### Model ### Model
### ###
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment