]> git.wh0rd.org Git - tt-rss.git/commitdiff
select view_mode/limit toolbar params from cookie
authorAndrew Dolgov <fox@madoka.spb.ru>
Mon, 22 May 2006 08:56:52 +0000 (09:56 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Mon, 22 May 2006 08:56:52 +0000 (09:56 +0100)
feedlist.js
tt-rss.js

index f61feac607aa02cefdca15457112f788b7f93b91..65025ecac0d6fc3b870ba7f4ad506dcd86887823 100644 (file)
@@ -35,54 +35,16 @@ function viewfeed(feed, skip, subop, doc, is_cat, subop_param) {
        
                enableHotkeys();
        
-/*             var searchbox = doc.getElementById("searchbox");
-
-               var search_query = "";
-               var search_mode = "";
-
-               if (searchbox) {
-                       search_query = searchbox.value;
-               } 
-       
-               var searchmodebox = doc.getElementById("searchmodebox");
-       
-               var search_mode;
-               
-               if (searchmodebox) {
-                       search_mode = searchmodebox[searchmodebox.selectedIndex].text;
-               }
-       
-               var viewbox = doc.getElementById("viewbox");
-       
-               var view_mode;
-       
-               if (viewbox) {
-                       view_mode = viewbox[viewbox.selectedIndex].text;
-               } else {
-                       view_mode = "All Posts";
-               } 
-       
-               setCookie("ttrss_vf_vmode", view_mode, getCookie("ttrss_cltime")); 
-       
-               var limitbox = doc.getElementById("limitbox");
-       
-               var limit;
-       
-               if (limitbox) {
-                       limit = limitbox[limitbox.selectedIndex].text;
-                       setCookie("ttrss_vf_limit", limit, getCookie("ttrss_cltime"));
-               } else {
-                       limit = "All";
-               }
-       
-       //      document.getElementById("ACTFEEDID").innerHTML = feed; */
-
                var toolbar_query = parent.Form.serialize("main_toolbar_form");
+               var toolbar_form = parent.document.forms["main_toolbar_form"];
 
                if (parent.document.forms["main_toolbar_form"].query) {
-                       parent.document.forms["main_toolbar_form"].query.value = "";
+                       toolbar_form.query.value = "";
                }
 
+               setCookie("ttrss_vf_limit", toolbar_form.limit[toolbar_form.limit.selectedIndex].value);
+               setCookie("ttrss_vf_vmode", toolbar_form.view_mode[toolbar_form.view_mode.selectedIndex].value);
+
                var query = "backend.php?op=viewfeed&feed=" + feed + "&" +
                        toolbar_query + "&subop=" + param_escape(subop);
 
@@ -103,11 +65,6 @@ function viewfeed(feed, skip, subop, doc, is_cat, subop_param) {
                }
 
                setActiveFeedId(feed);
-
-/*             var query = "backend.php?op=viewfeed&feed=" + param_escape(feed) +
-                       "&skip=" + param_escape(skip) + "&subop=" + param_escape(subop) +
-                       "&view=" + param_escape(view_mode) + "&limit=" + limit + 
-                       "&smode=" + param_escape(search_mode); */
        
                if (subop == "MarkAllRead") {
 
@@ -133,11 +90,6 @@ function viewfeed(feed, skip, subop, doc, is_cat, subop_param) {
                                setActiveFeedId(next_unread_feed);
                        }
                }
-       
-//             if (search_query != "") {
-//                     query = query + "&search=" + param_escape(search_query);
-//                     searchbox.value = "";
-//             }
 
                if (cat_view_mode) {
                        query = query + "&cat=1";
@@ -165,8 +117,6 @@ function viewfeed(feed, skip, subop, doc, is_cat, subop_param) {
                parent.disableContainerChildren("headlinesToolbar", false);
                parent.Form.enable("main_toolbar_form");
 
-       
-       //      notify("");
        } catch (e) {
                exception_error("viewfeed", e);
        }               
index 765cb1e72395c24331fdc2475323c79422397225..98cb9c71244cea0589beee3d7770cda36cf26efe 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -420,12 +420,11 @@ function init_second_stage() {
        
                updateFeedList(false, false);
                document.onkeydown = hotkey_handler;
-       
-/*             var viewbox = document.getElementById("viewbox");                       
-               var limitbox = document.getElementById("limitbox");
 
-               dropboxSelect(viewbox, getCookie("ttrss_vf_vmode"));
-               dropboxSelect(limitbox, getCookie("ttrss_vf_limit")); */
+               var tb = parent.document.forms["main_toolbar_form"];
+
+               dropboxSelect(tb.view_mode, getCookie("ttrss_vf_vmode"));
+               dropboxSelect(tb.limit, getCookie("ttrss_vf_limit"));
 
                daemon_enabled = getCookie("ttrss_vf_daemon");