]> git.wh0rd.org - tt-rss.git/commitdiff
remove incomplete code for hotkey zones
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 17 May 2008 03:22:38 +0000 (04:22 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 17 May 2008 03:22:38 +0000 (04:22 +0100)
functions.js
help/4.php
prefs.js

index f46bc60f0a7f6a87c41d543b6a9675bfa32f8b3e..0a31e796996a94054adcbba0c9eb67928474e320 100644 (file)
@@ -1,7 +1,6 @@
 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 */
 
@@ -1632,59 +1631,13 @@ 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) {
+function focus_element(id) {
        try {
-               hotkey_zone = zone;
-
-               highlightHotkeyZone(zone);
-
-
+               var e = document.getElementById(id);
+               if (e) e.focus();
        } catch (e) {
-               exception_error("setHotkeyZone", e);
+               exception_error(e, "focus_element");
        }
+       return false;
 }
 
index d452183f5e28499a597e21cc5ac0e1b7cb602d24..fbf6c8f0aa5e66cbeddc279d6168e9f40af2c8d2 100644 (file)
@@ -30,6 +30,7 @@
        <h2><?php echo __("Other actions") ?></h2>
 
        <table>
+               <tr><td class='n'>/</td><td><?php echo __("Focus search (if present)") ?></td></tr>
                <tr><td class='n'>?</td><td><?php echo __("Display this help dialog") ?></td></tr>
        </table>
 
index 1e84d7a2e3f0f80ae5f99dc751056cddd6143d14..d1f3fc075b06a1d584d19fc6516eacf2e9eab55d 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -1756,6 +1756,18 @@ function pref_hotkey_handler(e) {
                                return;
                        }
 
+                       if (keycode == 191) { // /
+                               var search_boxes = new Array("label_search", 
+                                       "feed_search", "filter_search", "user_search");
+
+                               for (var i = 0; i < search_boxes.length; i++) {
+                                       var elem = document.getElementById(search_boxes[i]);
+                                       if (elem) {
+                                               return focus_element(search_boxes[i]);
+                                       }
+                               }
+
+                       }
                }
 
                /* Prefix c */