mediawiki.util: Fix roundtripping of tooltip in portlet links
authorTimo Tijhof <krinklemail@gmail.com>
Mon, 22 Apr 2013 09:07:08 +0000 (11:07 +0200)
committerTimo Tijhof <krinklemail@gmail.com>
Mon, 22 Apr 2013 19:57:34 +0000 (21:57 +0200)
commit54d25a7e24878938fe50bc65fb336e605a4e72ac
treece4be6db677a51f47112ead7b2f600d11bd1aafb
parente8e3b165761747a07f7d79c3c630411e3c325bd0
mediawiki.util: Fix roundtripping of tooltip in portlet links

In 558985f72a ctrl-option- for Chrome on Mac was added, but it
didn't add "option-" to the regex. Since then the tooltip in
Chrome on Mac (and later when we started referring to option
instead of alt on all Mac browsers) was never detected by this
regex, sometimes resulting in double tooltips (when adding) or
outdated tooltips (when updating).

Now we always look for an accesskey hint in the tooltip and
strip it it's there.

Also fixed a bug where an undefined error can occur if accesskey
is given but tooltip not (the method unconditinally appended
text to the tooltip varible which might be undefined causing
a tooltip like "undefined[a]").

Change-Id: I0bde1a228983c58b20cad0c09a8e5efe8225ea23
RELEASE-NOTES-1.22
resources/mediawiki/mediawiki.util.js
tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js