r68599 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68598‎ | r68599 | r68600 >
Date:05:23, 26 June 2010
Author:dantman
Status:ok
Tags:
Comment:
Fix accesskeys for chrome
Modified paths:
  • /trunk/phase3/skins/common/wikibits.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/wikibits.js
@@ -9,6 +9,11 @@
1010 clientPC.indexOf('spoofer') === -1;
1111 var is_safari_win = is_safari && clientPC.indexOf('windows') !== -1;
1212 var webkit_version = parseInt(webkit_match[1]);
 13+ // Tests for chrome here, to avoid breaking old scripts safari left alone
 14+ // This is here for accesskeys
 15+ var is_chrome = clientPC.indexOf('chrome') !== -1 &&
 16+ clientPC.indexOf('spoofer') === -1;
 17+ var is_chrome_mac = is_chrome && clientPC.indexOf('mac') !== -1
1318 }
1419 // For accesskeys; note that FF3+ is included here!
1520 var is_ff2 = /firefox\/[2-9]|minefield\/3/.test( clientPC );
@@ -228,6 +233,8 @@
229234 var tooltipAccessKeyPrefix = 'alt-';
230235 if ( is_opera ) {
231236 tooltipAccessKeyPrefix = 'shift-esc-';
 237+} else if ( is_chrome ) {
 238+ tooltipAccessKeyPrefix = is_chrome_mac ? 'ctrl-option-' : 'alt-';
232239 } else if ( !is_safari_win && is_safari && webkit_version > 526 ) {
233240 tooltipAccessKeyPrefix = 'ctrl-alt-';
234241 } else if ( !is_safari_win && ( is_safari

Status & tagging log