]> git.wh0rd.org - tt-rss.git/blobdiff - tt-rss.js
make 'v' hotkey work in CDM mode
[tt-rss.git] / tt-rss.js
index b46c859acccfd3b1f30ab0a84000d1107bc2295b..1a4590522c744fca748c53e2bd66aa26e33ff01b 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -21,26 +21,28 @@ var xmlhttp_ctr = Ajax.getTransport();
 
 var init_params = new Object();
 
-var op_history = new Array();
-
 function tagsAreDisplayed() {
        return display_tags;
 }
 
-function toggleTags() {
-       display_tags = !display_tags;
+function toggleTags(show_all) {
 
        var p = document.getElementById("dispSwitchPrompt");
 
-       if (display_tags) {
+       if (!show_all && !display_tags) {
+               displayDlg("printTagCloud");
+       } else if (show_all) {
+               closeInfoBox();
+               display_tags = true;
                p.innerHTML = __("display feeds");
-       } else {
-               p.innerHTML = __("display tags");
+               notify_progress("Loading, please wait...", true);
+               updateFeedList();
+       } else if (display_tags) {
+               display_tags = false;
+               p.innerHTML = __("tag cloud");
+               notify_progress("Loading, please wait...", true);
+               updateFeedList();
        }
-       
-       notify_progress("Loading, please wait...");
-
-       updateFeedList();
 }
 
 function dlg_frefresh_callback() {
@@ -50,7 +52,7 @@ function dlg_frefresh_callback() {
                if (getActiveFeedId() == _qfd_deleted_feed) {
                        var h = document.getElementById("headlines-frame");
                        if (h) {
-                               h.innerHTML = "<div class='whiteBox'>No feed selected.</div>";
+                               h.innerHTML = "<div class='whiteBox'>" + __('No feed selected.') + "</div>";
                        }
                }
 
@@ -183,6 +185,9 @@ function scheduleFeedUpdate(force) {
        if (!xmlhttp_ready(xmlhttp_ctr) && last_refetch < date.getTime() / 1000 - 60) {
                debug("<b>xmlhttp seems to be stuck, aborting</b>");
                xmlhttp_ctr.abort();
+               if (is_safari()) {
+                       xmlhttp_ctr = Ajax.getTransport();
+               }
        }
 
        debug("REFETCH query: " + query_str);
@@ -514,6 +519,7 @@ function quickMenuGo(opid) {
                if (opid == "qmcAddFilter") {
                        displayDlg("quickAddFilter", getActiveFeedId());
                }
+
        } catch (e) {
                exception_error("quickMenuGo", e);
        }
@@ -598,8 +604,20 @@ function parse_runtime_info(elem) {
                        }
                }
 
+               var error_flag;
+
                if (k == "daemon_is_running" && v != 1) {
-                       notify_error("<span onclick=\"javascript:explainError(1)\">Update daemon is not runing.</span>");
+                       notify_error("<span onclick=\"javascript:explainError(1)\">Update daemon is not running.</span>", true);
+                       error_flag = true;
+               }
+
+               if (k == "daemon_stamp_ok" && v != 1) {
+                       notify_error("<span onclick=\"javascript:explainError(3)\">Update daemon is not updating feeds.</span>", true);
+                       error_flag = true;
+               }
+
+               if (!error_flag) {
+                       notify('');
                }
 
 /*             var w = document.getElementById("noDaemonWarning");
@@ -697,83 +715,4 @@ function feedEditSave() {
        } 
 }
 
-function localHotkeyHandler(e) {
-
-       var keycode;
-
-       if (window.event) {
-               keycode = window.event.keyCode;
-       } else if (e) {
-               keycode = e.which;
-       }
-
-       var shift_key = false;
-
-       try {
-               shift_key = e.shiftKey;
-       } catch (e) { }
-
-       if (keycode == 66 && shift_key) { // shift-B
-
-               var op = history_pop();
-
-               if (op) {
-                       var op_s = op.split(":");
-
-                       var i;
-                       for (i = 0; i < op_s.length; i++) {
-                               if (op_s[i] == 'undefined') {
-                                       op_s[i] = undefined;
-                               }
-
-                               if (op_s[i] == 'false') {
-                                       op_s[i] = false;
-                               }
-
-                               if (op_s[i] == 'true') {
-                                       op_s[i] = true;
-                               }
-                               
-                       }
-
-                       debug("history split: " + op_s);
-
-                       if (op_s[0] == "ARTICLE") {
-                               debug("history: reverting to article " + op_s[1] + "/" + op_s[2]);
-                               view(op_s[1], op_s[2], true);
-                       }
-
-                       if (op_s[0] == "FEED") {
-                               viewfeed(op_s[1], op_s[2], op_s[3], op_s[4], true);
-                       }
-
-               } else {
-                       notify_error("No operation to undo");
-               }
-
-               return false;
-
-       }       
-
-       debug("LKP=" + keycode);
-}
-
-function history_push(op) {
-       debug("history_push: " + op);
-       op_history.push(op);
 
-       while (op_history.length > 30) {
-               op_history.shift();
-       }
-}
-
-function history_pop() {
-       var op = op_history.pop();
-       debug("history_pop: " + op);
-       return op;
-}
-
-function history_clear() {
-       debug("history_clear");
-       op_history.clear();
-}