[Reconnoiter-devel] [reconnoiter commit] r450 - in trunk/ui/web/htdocs: . css

svn-commit at lists.omniti.com svn-commit at lists.omniti.com
Wed Sep 24 17:26:49 EDT 2008


Author: jesus
Date: 2008-09-24 17:26:48 -0400 (Wed, 24 Sep 2008)
New Revision: 450

Modified:
   trunk/ui/web/htdocs/css/style.css
   trunk/ui/web/htdocs/search_saved_graphs.inc
   trunk/ui/web/htdocs/search_simple.inc
Log:
pagination of search results, refs #22

Modified: trunk/ui/web/htdocs/css/style.css
===================================================================
--- trunk/ui/web/htdocs/css/style.css	2008-09-24 20:45:15 UTC (rev 449)
+++ trunk/ui/web/htdocs/css/style.css	2008-09-24 21:26:48 UTC (rev 450)
@@ -197,6 +197,10 @@
 p {margin-bottom:1em;}
 .ac {font-size: 10px;font-weight:normal;text-transform:uppercase;color:#82787b;}
 
+#searchlist p.search-summary {margin-bottom: 0;}
+#searchlist p.paginate {text-align:right;}
+#searchlist span.searchselect {display:inline;padding:0 4px;border:1px solid #ccc;margin:0 4px;}
+
 /* search list */
 #searchlist {overflow:hidden; white-space:nowrap;}
 #searchlist ul a {list-style:none;}
@@ -230,6 +234,10 @@
 #browselist ul li ul li ul li ul li ul li span.text {background:url(../images/icon-data-txt.png) 60px 1px no-repeat;padding-left:75px;}
 
 /* graph list */
+#graphlist p.graph-search-summary {margin-bottom: 0;}
+#graphlist p.paginate {text-align:right;}
+#graphlist span.searchselect {display:inline;padding:0 4px;border:1px solid #ccc;margin:0 4px;}
+
 #graphlist {overflow:auto;}
 #graphlist ul {list-style:none;}
 #graphlist ul li {display:block;padding:2px 0;margin-bottom:4px;}

Modified: trunk/ui/web/htdocs/search_saved_graphs.inc
===================================================================
--- trunk/ui/web/htdocs/search_saved_graphs.inc	2008-09-24 20:45:15 UTC (rev 449)
+++ trunk/ui/web/htdocs/search_saved_graphs.inc	2008-09-24 21:26:48 UTC (rev 450)
@@ -7,10 +7,32 @@
               var summary = r.count + ' graph' + (r.count == 1 ? '' : 's' ) + ' found for \'' + htmlentities(r.query) + '\'';
               if(r.error) summary = 'Error: ' + htmlentities(r.error);
               $("#graphlist > p.graph-search-summary").html(summary).fadeIn('fast');
-              if(r.count > (r.limit + r.offset)) {
-                $("#graphlist > span.paginate").slideDown('fast');
+              var c = new Number(r.count);
+              var l = new Number(r.limit);
+              var o = new Number(r.offset);
+              var page = $("#graphlist > p.paginate");
+              page.html('');
+              if(c > l) {
+                if(o > 0) {
+                  var po = Math.max(o-l, 0);
+                  $('<a/>').html( (po+1) + ' - ' + (po+l) )
+                           .click(function() {
+                             perform_datapoint_search(string,po,r.limit);
+                             return false;
+                           }).appendTo(page);
+                }
+                page.append($('<span/>').html((o+1) + '-' + (o+l)).addClass('searchselect'));
+                if(o + l < c) {
+                  var po = o + l;
+                  $('<a/>').html( (po + 1) + '-' + (po+l) )
+                           .click(function() {
+                             perform_datapoint_search(string,po,r.limit);
+                             return false;
+                           }).appendTo(page);
+                }
+                page.slideDown('fast');
               }
-              else $("#graphlist > span.paginate").slideUp('fast');
+              else page.slideUp('fast');
               $("#graph-searchresults > li").remove();
               for(var i=0; r.results && i<r.results.length; i++) {
                 var g = r.results[i];

Modified: trunk/ui/web/htdocs/search_simple.inc
===================================================================
--- trunk/ui/web/htdocs/search_simple.inc	2008-09-24 20:45:15 UTC (rev 449)
+++ trunk/ui/web/htdocs/search_simple.inc	2008-09-24 21:26:48 UTC (rev 450)
@@ -7,10 +7,32 @@
               var summary = 'Found ' + r.count + ' data point' + (r.count == 1 ? '' : 's' ) + ' found for \'' + htmlentities(r.query) + '\'';
               if(r.error) summary = 'Error: ' + htmlentities(r.error);
               $("#searchlist > p.search-summary").html(summary).fadeIn('fast');
-              if(r.count > (r.limit + r.offset)) {
-                $("#searchlist > span.paginate").slideDown('fast');
+              var c = new Number(r.count);
+              var l = new Number(r.limit);
+              var o = new Number(r.offset);
+              var page = $("#searchlist > p.paginate");
+              page.html('');
+              if(c > l) {
+                if(o > 0) {
+                  var po = Math.max(o-l, 0);
+                  $('<a/>').html( (po+1) + ' - ' + (po+l) )
+                           .click(function() {
+                             perform_datapoint_search(string,po,r.limit);
+                             return false;
+                           }).appendTo(page);
+                }
+                page.append($('<span/>').html((o+1) + '-' + (o+l)).addClass('searchselect'));
+                if(o + l < c) {
+                  var po = o + l;
+                  $('<a/>').html( (po + 1) + '-' + (po+l) )
+                           .click(function() {
+                             perform_datapoint_search(string,po,r.limit);
+                             return false;
+                           }).appendTo(page);
+                }
+                page.slideDown('fast');
               }
-              else $("#searchlist > span.paginate").slideUp('fast');
+              else page.slideUp('fast');
               $("#searchresults > li").remove();
               for(var i=0; r.results && i<r.results.length; i++) {
                 var ds = r.results[i];
@@ -43,7 +65,6 @@
 -->
 </script>
 <h4 id="searchterms"></h4>
-<p id="searchsummary"></p>
 <div id="datapoint-searchform-container" style="margin:.5em 0 2em 0;padding-bottom:1em;border-bottom: solid 1px #e6e4e5;">
 <form id="datapoint-searchform">
   <fieldset>
@@ -53,7 +74,8 @@
 </form>
 </div>
 <div id="searchlist">
-  <p class="search-summary"></p>
+  <p class="search-summary"/>
+  <p class="paginate"/>
   <ul id="searchresults">
   </ul>
 </div>



More information about the Reconnoiter-devel mailing list