r35961 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r35960‎ | r35961 | r35962 >
Date:01:48, 6 June 2008
Author:brion
Status:old
Tags:
Comment:
* (bug 14401) Fix Safari access key tooltips for Windows and >3.1 Mac versions

Now shows 'alt' for Safari on Windows, 'ctrl+alt' for Webkit >= 526 on Mac, and 'ctrl' for older WebKit/Safari on Mac (confirmed w/ 3.1 and WebKit nightlies)
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/skins/common/wikibits.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/wikibits.js
@@ -3,8 +3,13 @@
44 var clientPC = navigator.userAgent.toLowerCase(); // Get client info
55 var is_gecko = /gecko/.test( clientPC ) &&
66 !/khtml|spoofer|netscape\/7\.0/.test(clientPC);
7 -var is_safari = clientPC.indexOf('applewebkit') != -1 &&
8 - clientPC.indexOf('spoofer') == -1;
 7+var webkit_match = clientPC.match(/applewebkit\/(\d+)/);
 8+if (webkit_match) {
 9+ var is_safari = clientPC.indexOf('applewebkit') != -1 &&
 10+ clientPC.indexOf('spoofer') == -1;
 11+ var is_safari_win = is_safari && clientPC.indexOf('windows') != -1;
 12+ var webkit_version = parseInt(webkit_match[1]);
 13+}
914 var is_khtml = navigator.vendor == 'KDE' ||
1015 ( document.childNodes && !document.all && !navigator.taintEnabled );
1116 // For accesskeys; note that FF3+ is included here!
@@ -201,9 +206,11 @@
202207 var tooltipAccessKeyPrefix = 'alt-';
203208 if (is_opera) {
204209 tooltipAccessKeyPrefix = 'shift-esc-';
205 -} else if (is_safari
206 - || navigator.userAgent.toLowerCase().indexOf('mac') != -1
207 - || navigator.userAgent.toLowerCase().indexOf('konqueror') != -1 ) {
 210+} else if (!is_safari_win && is_safari && webkit_version > 526) {
 211+ tooltipAccessKeyPrefix = 'ctrl-alt-';
 212+} else if (!is_safari_win && (is_safari
 213+ || clientPC.indexOf('mac') != -1
 214+ || clientPC.indexOf('konqueror') != -1 )) {
208215 tooltipAccessKeyPrefix = 'ctrl-';
209216 } else if (is_ff2) {
210217 tooltipAccessKeyPrefix = 'alt-shift-';
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1339,7 +1339,7 @@
13401340 * to ensure that client-side caches don't keep obsolete copies of global
13411341 * styles.
13421342 */
1343 -$wgStyleVersion = '153';
 1343+$wgStyleVersion = '154';
13441344
13451345
13461346 # Server-side caching:
Index: trunk/phase3/RELEASE-NOTES
@@ -342,7 +342,9 @@
343343 $wgGroupPermissions[]['noratelimit'].
344344 * (Bug 13828) Split parameter $1 of MediaWiki:Missingarticle into $1 (=title)
345345 and $2 (=revision numbers)
 346+* (bug 14401) Fix Safari access key tooltips for Windows and >3.1 Mac versions
346347
 348+
347349 === API changes in 1.13 ===
348350
349351 * Fixing main page display in meta=siteinfo

Status & tagging log