]> git.wh0rd.org - tt-rss.git/blobdiff - tt-rss.js
disable pref toolbars when nothing is selected
[tt-rss.git] / tt-rss.js
index 9b77aa53a4ad7292a03e31d03d845e59f81bbfee..82a52e9424eebd7f4e4f8b2d0da71fc59d7a3935 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -58,23 +58,6 @@ function dlg_frefresh_callback() {
        } 
 }
 
-function dlg_submit_callback() {
-       if (xmlhttp.readyState == 4) {
-               notify(xmlhttp.responseText);
-               closeDlg();
-       } 
-}
-
-function dlg_display_callback() {
-       if (xmlhttp.readyState == 4) {
-               var dlg = document.getElementById("userDlg");
-               var dlg_s = document.getElementById("userDlgShadow");
-
-               dlg.innerHTML = xmlhttp.responseText;
-               dlg_s.style.display = "block";
-       } 
-}
-
 function hide_unread_callback() {
        if (xmlhttp.readyState == 4) {
 
@@ -551,10 +534,15 @@ function qafAdd() {
        var link = document.getElementById("qafInput");
 
        if (link.value.length == 0) {
-               notify("Missing feed URL.");
+               alert("Error: No feed URL given.");
+       } else if (link.value.match("http://") == null && 
+                       link.value.match("https://") == null) {
+               alert("Error: Invalid feed URL.");
        } else {
                notify("Adding feed...");
-       
+
+               closeInfoBox();
+
                var cat = document.getElementById("qafCat");
                var cat_id = "";
                
@@ -578,63 +566,6 @@ function qafAdd() {
        }
 }
 
-function qaddFilter() {
-
-       if (!xmlhttp_ready(xmlhttp)) {
-               printLockingError();
-               return
-       }
-
-       var regexp = document.getElementById("fadd_regexp");
-       var match = document.getElementById("fadd_match");
-       var feed = document.getElementById("fadd_feed");
-       var action = document.getElementById("fadd_action");
-
-       if (regexp.value.length == 0) {
-               notify("Missing filter expression.");
-       } else {
-               notify("Adding filter...");
-
-               var v_match = match[match.selectedIndex].text;
-               var feed_id = feed[feed.selectedIndex].id;
-               var action_id = action[action.selectedIndex].id;
-
-               xmlhttp.open("GET", "backend.php?op=pref-filters&quiet=1&subop=add&regexp=" +
-                       param_escape(regexp.value) + "&match=" + v_match +
-                       "&fid=" + param_escape(feed_id) + "&aid=" + param_escape(action_id), true);
-                       
-               xmlhttp.onreadystatechange=dlg_submit_callback;
-               xmlhttp.send(null);
-
-               regexp.value = "";
-       }
-
-}
-
-
-function displayDlg(id, param) {
-
-       if (!xmlhttp_ready(xmlhttp)) {
-               printLockingError();
-               return
-       }
-
-       notify("");
-
-       xmlhttp.open("GET", "backend.php?op=dlg&id=" +
-               param_escape(id) + "&param=" + param_escape(param), true);
-       xmlhttp.onreadystatechange=dlg_display_callback;
-       xmlhttp.send(null);
-
-       disableHotkeys();
-}
-
-function closeDlg() {
-       var dlg = document.getElementById("userDlgShadow");
-       dlg.style.display = "none";
-       enableHotkeys();
-}
-
 function qfdDelete(feed_id) {
 
        notify("Removing feed...");
@@ -699,13 +630,6 @@ function debug(msg) {
 }
 
 function fatalError(code, message) {
-/*     if (!params) {
-               window.location = "error.php?c=" + param_escape(code);
-       } else {
-               window.location = "error.php?c=" + param_escape(code) + 
-                       "&p=" + param_escape(params);
-       } */
-
        try {   
                var fe = document.getElementById("fatal_error");
                var fc = document.getElementById("fatal_error_msg");