Last modified: 2014-04-26 16:25:42 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T39239, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 37239 - mediawiki.util: Use accessKeyLabel property when available
mediawiki.util: Use accessKeyLabel property when available
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.17.x
All All
: Lowest enhancement (vote)
: Future release
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-31 09:34 UTC by Michael M.
Modified: 2014-04-26 16:25 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Michael M. 2012-05-31 09:34:16 UTC
mw.util uses much code and browser sniffing to display the access key in the tooltip. With HTML5 there is a property to simplify this, see [1].

Using it when available has the advantage that you don't have to figure out the correct prefix yourself, additionally it will be localized.

In Firefox 10 it works as expected:

>>> $('#n-mainpage-description a').prop('accessKeyLabel')
"Alt+Umschalt+z"

The only drawback is that you still must provide a fallback for browsers not supporting this (including IE 9).

[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#dfnReturnLink-0
Comment 1 Krinkle 2012-05-31 09:56:58 UTC
Very interesting. Thanks a lot for this.

Do we know what the browser support for this is (should we keep all the current fallbacks?)
Comment 2 Michael M. 2012-06-01 08:08:10 UTC
(In reply to comment #1)
> Very interesting. Thanks a lot for this.

I found this property more or less by accident when inspecting the DOM using Firebug.

> Do we know what the browser support for this is (should we keep all the current
> fallbacks?)

https://developer.mozilla.org/en/DOM/HTMLElement#Browser_compatibility only lists Firefox 8+. As I wrote, IE 9 doesn't support it. I didn't test other browsers. So the fallbacks have to be kept.
Comment 3 Bartosz Dziewoński 2013-09-15 16:46:00 UTC
This could be a little annoying to implement (Firefox and friends, still the only browsers supporting it, seem to use a different format than MediaWiki – Alt+Shift+X instead of alt-shift-x) and not really worth it (because, again, no other browsers support this). 

But if anybody feels like doing it, go ahead :)
Comment 5 Gerrit Notification Bot 2014-04-11 17:22:34 UTC
Change 125426 had a related patch set uploaded by Umherirrender:
Add jquery.accessKeyLabel javascript module

https://gerrit.wikimedia.org/r/125426
Comment 6 Gerrit Notification Bot 2014-04-26 12:27:23 UTC
Change 125426 merged by jenkins-bot:
Add jquery.accessKeyLabel javascript module

https://gerrit.wikimedia.org/r/125426

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links