]> git.wh0rd.org Git - tt-rss.git/commitdiff
limit number of loaded headlines
authorAndrew Dolgov <fox@bah.spb.su>
Mon, 5 Sep 2005 12:54:07 +0000 (13:54 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Mon, 5 Sep 2005 12:54:07 +0000 (13:54 +0100)
backend.php
tt-rss.js
tt-rss.php

index 88d19641ff33f73c4cda1abdda21099aac463db2..c25410d9af650f41b695b3d9ae51445671af137f 100644 (file)
                $subop = $_GET["subop"];
                $view_mode = $_GET["view"];
                $addheader = $_GET["addheader"];
+               $limit = $_GET["limit"];
 
                if (!$skip) $skip = 0;
 
 
                if (!$addheader) {
                        $limit_query_part = "LIMIT ".HEADLINES_PER_PAGE." OFFSET $skip";
+               } else {                        
+                       if ($limit != "All") {
+                               $limit_query_part = "LIMIT " . $limit;
+                       }
                }
 
                $result = pg_query("SELECT 
index 9b18b79c2a9b2c08ca1d561b838d3407a8e48f4c..b2adeb1ced75630078a6c9155dfdc216f715b314 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -229,6 +229,16 @@ function viewfeed(feed, skip, subop) {
                view_mode = "All Posts";
        }
 
+       var limitbox = document.getElementById("limitbox");
+
+       var limit;
+
+       if (limitbox) {
+               limit = limitbox.value;
+       } else {
+               limit = "All";
+       }
+
        if (skip < 0 || skip > total_feed_entries) {
                return;
        }
@@ -260,7 +270,7 @@ function viewfeed(feed, skip, subop) {
 
        var query = "backend.php?op=viewfeed&feed=" + param_escape(feed) +
                "&skip=" + param_escape(skip) + "&subop=" + param_escape(subop) +
-               "&view=" + param_escape(view_mode);
+               "&view=" + param_escape(view_mode) + "&limit=" + limit;
 
        if (search_query != "") {
                query = query + "&search=" + param_escape(search_query);
index b30c4fcced0c2f57ea7dc68d25d5e58898b87230..385ea487e3238b66a283dad96658b05b160a29f9 100644 (file)
                        <option>Starred</option>
                </select>
 
+               &nbsp;Limit:
+
+               <select id="limitbox" onchange="javascript:viewCurrentFeed(0, '')">
+                       <option>15</option>
+                       <option>30</option>
+                       <option>60</option>
+                       <option>All</option>
+               </select>
+
                &nbsp;Feed: <a class="button" 
                        href="javascript:viewCurrentFeed(0, 'ForceUpdate')">Update</a>