Last modified: 2014-04-26 16:25:25 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 T50505, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 48505 - mw.util.updateTooltipAccessKeys should add accesskey to tooltip if missing
mw.util.updateTooltipAccessKeys should add accesskey to tooltip if missing
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.22.0
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-15 09:53 UTC by Michael M.
Modified: 2014-04-26 16:25 UTC (History)
4 users (show)

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


Attachments

Description Michael M. 2013-05-15 09:53:39 UTC
Currently mw.util.updateTooltipAccessKeys only updates the tooltip, if it already ends with an access key in square brackets. While mw.util.addPortletLink takes care to provide the title in this format, there are other ocassions (like <input>s created by a script), where you currently have to add the access key explicitely to the title before you can call mw.util.updateTooltipAccessKeys.

If the title doesn't end with something that looks like an access key, mw.util.updateTooltipAccessKeys should just add it, and IMHO do so even if there is no title at all.

So

$foo.append(mw.html.element('input', {id: 'myInput', accesskey: 'x', title: 'Something'}));
mw.util.updateTooltipAccessKeys($('#myInput'));

should work and update the title to "Something [alt-shift-x]" (or whatever).
Comment 1 Krinkle 2014-01-31 01:55:05 UTC
If mw.util.updateTooltipAccessKeys were a generic utility to setup accesskey tooltips, then it should do this indeed.

However at this point it was never intended to do that, so classifying this as an enhancement instead.

The method is purely to update (not create) accesskey tooltips.

Though this is not well documented right now, it is the responsibility of the creator of the element (either server-side code in Skin and Linker system or client-side code in mw.util.addPortletLink) to add a placeholder to the tooltip in form of " [x]".
Comment 2 Gerrit Notification Bot 2014-04-11 17:22:40 UTC
Change 125426 had a related patch set uploaded by Umherirrender:
Add jquery.accessKeyLabel javascript module

https://gerrit.wikimedia.org/r/125426
Comment 3 Gerrit Notification Bot 2014-04-26 12:27:20 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