Page MenuHomePhabricator

safari-accesskeys-fixed.patch

Authored By
bzimport
Nov 21 2014, 10:14 PM
Size
1 KB
Referenced Files
None
Subscribers
None

safari-accesskeys-fixed.patch

--- wikibits.js 2008-06-04 03:05:19.000000000 +0200
+++ wikibits_updated.js 2008-06-04 15:21:11.000000000 +0200
@@ -3,8 +3,13 @@
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
var is_gecko = /gecko/.test( clientPC ) &&
!/khtml|spoofer|netscape\/7\.0/.test(clientPC);
-var is_safari = clientPC.indexOf('applewebkit') != -1 &&
- clientPC.indexOf('spoofer') == -1;
+var webkit_match = clientPC.match(/applewebkit\/(\d+)/);
+if (webkit_match) {
+ var is_safari = clientPC.indexOf('applewebkit') != -1 &&
+ clientPC.indexOf('spoofer') == -1;
+ var is_safari_win = is_safari && clientPC.indexOf('windows') != -1;
+ var webkit_version = parseInt(webkit_match[1]);
+}
var is_khtml = navigator.vendor == 'KDE' ||
( document.childNodes && !document.all && !navigator.taintEnabled );
// For accesskeys; note that FF3+ is included here!
@@ -201,9 +206,11 @@
var tooltipAccessKeyPrefix = 'alt-';
if (is_opera) {
tooltipAccessKeyPrefix = 'shift-esc-';
-} else if (is_safari
- || navigator.userAgent.toLowerCase().indexOf('mac') != -1
- || navigator.userAgent.toLowerCase().indexOf('konqueror') != -1 ) {
+} else if (!is_safari_win && is_safari && webkit_version > 526) {
+ tooltipAccessKeyPrefix = 'ctrl-alt-';
+} else if (!is_safari_win && (is_safari
+ || clientPC.indexOf('mac') != -1
+ || clientPC.indexOf('konqueror') != -1 )) {
tooltipAccessKeyPrefix = 'ctrl-';
} else if (is_ff2) {
tooltipAccessKeyPrefix = 'alt-shift-';

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4554
Default Alt Text
safari-accesskeys-fixed.patch (1 KB)

Event Timeline