-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[4.0] [a11y] Add SkipTo Navigation plugin #24142
Conversation
Integration of the great accessibility plugin by PayPal Accessibility Team and University of Illinois SkipTo is a replacement for your old classic "Skipnav" link, (so please use it as such)! The SkipTo script creates a drop-down menu consisting of the links to the important places on a given web page. Once installed and configured, the menu makes it easier for keyboard and screen reader users to quickly jump to the desired location by simply choosing it from the list of options. ### How it works The SkipTo menu becomes visible the first time the user tabs into the page. Once the keyboard focus is on the menu, pressing the ENTER or the SPACEBAR key will pull down the list of high-level headings and landmarks on the current page. Use arrow keys to select your choice and press ENTER to skip to it. If you decide to reach the menu again, simply press the built-in access key (0 by default). ### Joomla options Obviously added the ability for the strings to be translated In the plugin you have the option to enable this navigation aid on Site/Administrator/Both - The default is admin ### SkipTo options By default, SkipTo menu will include the following places on the page: Heading (e.g h1, h2, h3 and h4 elements). ARIA landmarks (e.g. banner, navigation, main and search). HTML5 Section Elements (e.g. main, section[aria-label], section[aria-labelledby] The “access key” is set to 0. The menu is set not to wrap. The menu is visible on keyboard focus only The above are configurable but I have not exposed the configuration to Joomla - but can do. I just think the complicate things and the defaults are fine
plugins/system/skipto/skipto.php
Outdated
$current_section = 0; | ||
} | ||
|
||
if (!($current_section & $section)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!($current_section & $section)) | |
if (!($current_section && $section)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is a direct copy paste from the yubikey plugin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure we don't mean to do this http://www.php.net/manual/en/language.operators.bitwise.php - even if it does work. I'd change yubikey to match what @Quy is suggesting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does work. The suggestion above does not.
Co-Authored-By: brianteeman <brian@teeman.net>
administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-03-09.sql
Outdated
Show resolved
Hide resolved
administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-03-09.sql
Outdated
Show resolved
Hide resolved
Co-Authored-By: brianteeman <brian@teeman.net>
@brianteeman see brianteeman#78 for SQL fixes. |
administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-03-09.sql
Outdated
Show resolved
Hide resolved
Sorry my original post is incorrect - the default settings are h1, h2, h3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SQL please.
administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-03-09.sql
Outdated
Show resolved
Hide resolved
administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-03-09.sql
Outdated
Show resolved
Hide resolved
administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-03-09.sql
Outdated
Show resolved
Hide resolved
@SharkyKZ Why. I thought we were supposed to set the default values in the sql |
Based on #20563 (comment), no. As long as you set them in the plugin code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SQL still not fixed.
administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-03-09.sql
Outdated
Show resolved
Hide resolved
…0-2019-03-09.sql Co-Authored-By: brianteeman <brian@teeman.net>
Thanks @SharkyKZ should be fixed now |
Thanks, now the review starts 😁. |
I can't decide if we should expose the ability to allow the user to edit the following Heading (e.g h1, h2, h3 and h4 elements). |
plugins/system/skipto/skipto.php
Outdated
|
||
// TODO remove this line when bug is fixed | ||
$this->loadLanguage(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove one more tab.
appveyor failed with
|
|
||
try | ||
{ | ||
$app = $this->app; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You told me to put it in #24142 (comment)
} | ||
|
||
// TODO remove this line when bug is fixed | ||
$this->loadLanguage(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I would keep this and remove $autoloadLanguage
instead. There's no need to load language files in backend if the plugin runs only in frontend, and vice versa.
@wilsonge fwiw if was still the JS leader I wouldnt accept this skipto script to enter the project's dependencies |
are you going to say why? |
|
|
That's then the reason you're looking for. You're simply adding technical debt here which is totally unneeded. We don't care for IE < 11 we shouldn't drag scripts that patch things for dead browsers... All and all I am not against a skipto but let's do it properly, at the end of the day all there is here are some DOM manipulations nothing that even a JS noobie can't do... |
I would rather use working code (that can always be improved later) than wait for someone with JavaScript skills write a working solution. You might find JavaScript easy to write. I certainly don't or I would have fixed the password strength and switcher js which are totally not accessible. |
That's why Joomla is a mess, everything is important and needs to be implemented right now, no matter what the technical debt that it introduces. Sorry I totally disagree here...
Well, I had a PR standing there for 3 months and finally, @wilsonge said "no new custom elements". I'm not a magician, I do my best but I can't fix something if people don't merge my stupid code... |
@zwiastunsw Can you retest this please |
I have tested this item ✅ successfully on 44775ee This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24142. |
In my opinion it is not necessary. Theplugin has to do exactly what it does. Adding configuration options will only make the system operation more complicated. |
Thanks guys! |
Thanks for testing and merging. If we ever get a new admin template this will be essential for testing it |
Integration of the great accessibility plugin by PayPal Accessibility Team and University of Illinois
SkipTo is a replacement for your old classic "Skipnav" link, (so please use it as such)! The SkipTo script creates a drop-down menu consisting of the links to the important places on a given web page. Once installed and configured, the menu makes it easier for keyboard and screen reader users to quickly jump to the desired location by simply choosing it from the list of options.
How it works
The SkipTo menu becomes visible the first time the user tabs into the page.
Once the keyboard focus is on the menu, pressing the ENTER or the SPACEBAR key will pull down the list of high-level headings and landmarks on the current page.
Use arrow keys to select your choice and press ENTER to skip to it.
If you decide to reach the menu again, simply press the built-in access key (0 by default).
Joomla options
Obviously added the ability for the strings to be translated
In the plugin you have the option to enable this navigation aid on Site/Administrator/Both - The default is admin
SkipTo options
By default, SkipTo menu will include the following places on the page:
Heading (e.g h1, h2, h3 and h4 elements).
ARIA landmarks (e.g. banner, navigation, main and search).
HTML5 Section Elements (e.g. main, section[aria-label], section[aria-labelledby]
The “access key” is set to 0.
The menu is set not to wrap.
The menu is visible on keyboard focus only
The above are configurable but I have not exposed the configuration to Joomla - but can do. I just think the complicate things and the defaults are fine
Testing
Testing will require a full npm install
Thanks to @wilsonge for getting me over the final hurdles