]> git.wh0rd.org - tt-rss.git/blobdiff - prefs.js
interface tweaks, add info/question/exclamation pics
[tt-rss.git] / prefs.js
index d9c10d692bf43608f0dc044d0511d9b20ec7290a..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 {   
@@ -32,17 +34,13 @@ function feedlist_callback() {
                        container.innerHTML=xmlhttp.responseText;
                        selectTab("feedConfig", true);
 
-                       if (active_feed_cat) {
-                               var row = document.getElementById("FCATR-" + active_feed_cat);
-                               if (row) {
-                                       if (!row.className.match("Selected")) {
-                                               row.className = row.className + "Selected";
-                                       }               
-                               }
-                               var checkbox = document.getElementById("FCCHK-" + active_feed_cat);
-                               if (checkbox) {
-                                       checkbox.checked = true;
-                               }
+                       if (caller_subop) {
+                               var tuple = caller_subop.split(":");
+                               if (tuple[0] == 'editFeed') {
+                                       window.setTimeout('editFeed('+tuple[1]+')', 100);
+                               }                               
+
+                               caller_subop = false;
                        }
 
                        notify("");
@@ -220,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);
@@ -1123,7 +1121,7 @@ function updatePrefsList() {
 
 }
 
-function selectTab(id, noupdate) {
+function selectTab(id, noupdate, subop) {
 
 //     alert(id);
 
@@ -1136,6 +1134,11 @@ function selectTab(id, noupdate) {
                        return
                }
 
+               try {
+                       var c = document.getElementById('prefContent'); 
+                       c.scrollTop = 0;
+               } catch (e) { };
+
                if (!noupdate) {
 
                        debug("selectTab: " + id + "(NU: " + noupdate + ")");
@@ -1248,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 {
@@ -1553,3 +1564,9 @@ function editFeedCats() {
        xmlhttp.onreadystatechange=infobox_callback;
        xmlhttp.send(null);
 }
+
+function showFeedsWithErrors() {
+       displayDlg('feedUpdateErrors');
+}
+
+