diff options
author | Andrew Dolgov <[email protected]> | 2008-05-15 05:21:00 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2008-05-15 05:21:00 +0100 |
commit | 61992f57718b766c5a8e345f3b3bd5b3a99e115f (patch) | |
tree | 170a323f02eeee7b41ec8f0d87a94f35920ec4cc | |
parent | 5713a439fb24e76cf677b0cc837bc4aa9b2119d3 (diff) |
experimental code for hotkey zone highlighting
-rw-r--r-- | functions.js | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/functions.js b/functions.js index 5bb559a72..4c574eaf1 100644 --- a/functions.js +++ b/functions.js @@ -2,6 +2,8 @@ var hotkeys_enabled = true; var debug_mode_enabled = false; var xmlhttp_rpc = Ajax.getTransport(); +var hotkey_zone = 0; + /* add method to remove element from array */ Array.prototype.remove = function(s) { @@ -229,6 +231,22 @@ function hotkey_handler(e) { keycode = e.which; } + if (keycode == 48) { // 0 + return setHotkeyZone(0); + } + + if (keycode == 49) { // 1 + return setHotkeyZone(1); + } + + if (keycode == 50) { // 2 + return setHotkeyZone(2); + } + + if (keycode == 51) { // 3 + return setHotkeyZone(3); + } + if (keycode == 82) { // r return scheduleFeedUpdate(true); } @@ -1789,4 +1807,59 @@ function displayHelpInfobox(topic_id) { return false; } +var _border_color_normal = "#88b0f0"; +var _border_color_highlight = "#72eda8"; +var _border_color_flash = "#f0fff0"; + +function highlightHotkeyZone(zone) { + try { + var feeds = document.getElementById("feeds-holder"); + var headlines = document.getElementById("headlines-frame"); + var content = document.getElementById("content-frame"); + + feeds.style.borderColor = _border_color_normal; + headlines.style.borderColor = _border_color_normal; + content.style.borderColor = _border_color_normal; + + if (zone == 1) { + feeds.style.borderColor = _border_color_highlight; + + new Effect.Highlight(feeds, {duration: 0.5, startcolor: + _border_color_flash, + queue: { position:'end', scope: 'EFCHL-Q', limit: 1 } } ); + } + + if (zone == 2) { + headlines.style.borderColor = _border_color_highlight; + + new Effect.Highlight(headlines, {duration: 0.5, startcolor: + _border_color_flash, + queue: { position:'end', scope: 'EFCHL-Q', limit: 1 } } ); + } + + if (zone == 3 && content) { + content.style.borderColor = _border_color_highlight; + + new Effect.Highlight(content, {duration: 0.5, startcolor: + _border_color_flash, + queue: { position:'end', scope: 'EFCHL-Q', limit: 1 } } ); + } + + } catch (e) { + exception_error("highlightHotkeyZone", e); + } +} + + +function setHotkeyZone(zone) { + try { + hotkey_zone = zone; + + highlightHotkeyZone(zone); + + + } catch (e) { + exception_error("setHotkeyZone", e); + } +} |