From: Andrew Dolgov Date: Sun, 18 Feb 2007 07:30:16 +0000 (+0100) Subject: disable n/p down/up hotkeys for Safari - bugs X-Git-Tag: 1.2.8~2 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=583c58b86d199db8ccf13769175f64accd5bea38;p=tt-rss.git disable n/p down/up hotkeys for Safari - bugs --- diff --git a/functions.js b/functions.js index 7000c585..95dceb05 100644 --- a/functions.js +++ b/functions.js @@ -11,6 +11,14 @@ function is_opera() { return navigator.userAgent.match("Opera"); } +function is_khtml() { + return navigator.userAgent.match("KHTML"); +} + +function is_safari() { + return navigator.userAgent.match("Safari"); +} + function exception_error(location, e, silent) { var msg; @@ -214,13 +222,13 @@ function hotkey_handler(e) { if (new_feed) viewfeed(new_feed, ''); } - if (keycode == 78 || keycode == 40) { // n, down + if (!is_safari() && (keycode == 78 || keycode == 40)) { // n, down if (typeof moveToPost != 'undefined') { return moveToPost('next'); } } - if (keycode == 80 || keycode == 38) { // p, up + if (!is_safari() && (keycode == 80 || keycode == 38)) { // p, up if (typeof moveToPost != 'undefined') { return moveToPost('prev'); }