paper: add infinite scrolling to graph by calling ajaxScrollInit at the page
authorAlexander Plavin <alexander@plav.in>
Sun, 22 Sep 2013 14:19:57 +0400
changeset 19783 1c2a309bba4f
parent 19782 8123f50555ff
child 19785 1d2ca307bf22
paper: add infinite scrolling to graph by calling ajaxScrollInit at the page
mercurial/templates/paper/graph.tmpl
tests/test-hgweb-empty.t
--- a/mercurial/templates/paper/graph.tmpl	Fri Sep 20 00:42:13 2013 +0400
+++ b/mercurial/templates/paper/graph.tmpl	Sun Sep 22 14:19:57 2013 +0400
@@ -123,6 +123,17 @@
 | rev {rev}: {changenav%navgraph}
 </div>
 
+<script type="text/javascript">
+    ajaxScrollInit(
+            '{url|urlescape}graph/{rev}?revcount=%next%',
+            {revcount}+60,
+            function (htmlText, previousVal) \{ return previousVal + 60; },
+            '#wrapper',
+            '<div class="%class%" style="text-align: center;">%text%</div>',
+            'graph'
+    );
+</script>
+
 </div>
 </div>
 
--- a/tests/test-hgweb-empty.t	Fri Sep 20 00:42:13 2013 +0400
+++ b/tests/test-hgweb-empty.t	Sun Sep 22 14:19:57 2013 +0400
@@ -359,6 +359,17 @@
   | rev -1: 
   </div>
   
+  <script type="text/javascript">
+      ajaxScrollInit(
+              '/graph/-1?revcount=%next%',
+              60+60,
+              function (htmlText, previousVal) { return previousVal + 60; },
+              '#wrapper',
+              '<div class="%class%" style="text-align: center;">%text%</div>',
+              'graph'
+      );
+  </script>
+  
   </div>
   </div>