diff options
author | Arun Persaud <arun@nubati.net> | 2011-11-24 21:24:36 -0800 |
---|---|---|
committer | Arun Persaud <apersaud@lbl.gov> | 2011-11-24 21:39:56 -0800 |
commit | 4849d7271c75cace9faffc1353c22101b84c49bb (patch) | |
tree | 4fa9f9c3decd3991be63078b3e8b753ebce60f32 /index.php | |
parent | 9d77827195a8057746842bfa307d550d04ed02f9 (diff) | |
download | photo-tags-4849d7271c75cace9faffc1353c22101b84c49bb.tar.gz photo-tags-4849d7271c75cace9faffc1353c22101b84c49bb.tar.bz2 photo-tags-4849d7271c75cace9faffc1353c22101b84c49bb.zip |
add a basic index of all pages...
need to restrict this still to not show all, e.g. add first and last button to next and prev and only show a few page links
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -30,7 +30,7 @@ else <button class="next" onclick="right()">next </button> <div class="permalink"></div> - +<div class="index"></div> <div class="pics"> </div> <footer> @@ -49,6 +49,15 @@ var N=<?php echo $N ?>; var count=0; function myreload(a) { + d3.json("<?php echo $webbase?>/getjson.php?T=1", function(json) { + s="page "; + n = json[0].total/N; + for(i=1;i<=n+1;i++) + { + s+=" <a href=\"<?php echo $webbase?>/page/"+i+"\">"+i+"</a>"; + } + d3.select(".index").html(s); + }); d3.json("<?php echo $webbase?>/getjson.php?P="+a, function(json) { count=0; pics.selectAll("li").remove(); @@ -72,7 +81,7 @@ function myreload(a) { permalink="<?php echo $webbase ?>/page/"+page; d3.select(".permalink").html("Permalink: <a href=\""+permalink+"\">"+permalink+"</a>"); - d3.select(".debug").text("P, count= "+a+" "+count); + d3.select(".debug").text("P,N ="+a+" "+N); } function left() { |