]> git.wh0rd.org - tt-rss.git/blobdiff - prefs.js
interface tweaks, add info/question/exclamation pics
[tt-rss.git] / prefs.js
index 37b738358910182b9d82e4dd85f5b38221a68204..a072ef03c70281f6385a81f6a3d4d70b6191396d 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -12,6 +12,8 @@ var xmlhttp = Ajax.getTransport();
 
 var init_params = new Array();
 
+var caller_subop = false;
+
 function expand_feed_callback() {
        if (xmlhttp.readyState == 4) {
                try {   
@@ -31,6 +33,16 @@ function feedlist_callback() {
                        var container = document.getElementById('prefContent'); 
                        container.innerHTML=xmlhttp.responseText;
                        selectTab("feedConfig", true);
+
+                       if (caller_subop) {
+                               var tuple = caller_subop.split(":");
+                               if (tuple[0] == 'editFeed') {
+                                       window.setTimeout('editFeed('+tuple[1]+')', 100);
+                               }                               
+
+                               caller_subop = false;
+                       }
+
                        notify("");
                } catch (e) {
                        exception_error("feedlist_callback", e);
@@ -206,7 +218,7 @@ function addFeed() {
        } else {
                notify("Adding feed...");
 
-               xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=add&feed_url=" +
+               xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=add&from=tt-rss&feed_url=" +
                        param_escape(link.value), true);
                xmlhttp.onreadystatechange=feedlist_callback;
                xmlhttp.send(null);
@@ -1109,7 +1121,7 @@ function updatePrefsList() {
 
 }
 
-function selectTab(id, noupdate) {
+function selectTab(id, noupdate, subop) {
 
 //     alert(id);
 
@@ -1239,6 +1251,14 @@ function init_second_stage() {
 
                document.onkeydown = pref_hotkey_handler;
 
+               var tab = getURLParam('tab');
+               
+               caller_subop = getURLParam('subop');
+
+               if (tab) {
+                       active_tab = tab;
+               }
+
                if (navigator.userAgent.match("Opera")) {       
                        setTimeout("selectTab()", 500);
                } else {
@@ -1549,39 +1569,4 @@ function showFeedsWithErrors() {
        displayDlg('feedUpdateErrors');
 }
 
-function filterDlgCheckAction(sender) {
-
-       try {
-
-               var action = sender[sender.selectedIndex].value;
-
-               var form = document.forms["filter_add_form"];
-       
-               if (!form) {
-                       form = document.forms["filter_edit_form"];
-               }
-
-               if (!form) {
-                       debug("filterDlgCheckAction: can't find form!");
-                       return;
-               }
-
-               var action_param = form.action_param;
-
-               if (!action_param) {
-                       debug("filterDlgCheckAction: can't find action param!");
-                       return;
-               }
 
-               // if selected action supports parameters, enable params field
-               if (action == 4) {
-                       action_param.disabled = false;
-               } else {
-                       action_param.disabled = true;
-               }
-
-       } catch (e) {
-               exception_error(e, "filterDlgCheckAction");
-       }
-
-}