Patchwork [4,of,4,graph-inf-scroll] paper: add infinite scrolling to graph by calling ajaxScrollInit at the page

login
register
mail settings
Submitter Alexander Plavin
Date Sept. 22, 2013, 10:30 a.m.
Message ID <a6a394e65ff2dc487b38.1379845802@debian-alexander.dolgopa>
Download mbox | patch
Permalink /patch/2596/
State Accepted
Commit 1c2a309bba4fa87db37f91e42e387108ee5b2f45
Headers show

Comments

Alexander Plavin - Sept. 22, 2013, 10:30 a.m.
# HG changeset patch
# User Alexander Plavin <alexander@plav.in>
# Date 1379845197 -14400
#      Sun Sep 22 14:19:57 2013 +0400
# Node ID a6a394e65ff2dc487b38506e25953585e55c1ad3
# Parent  d1f9b450414949269ff98ad2597ad44848f119df
paper: add infinite scrolling to graph by calling ajaxScrollInit at the page
Matt Mackall - Sept. 23, 2013, 8:03 p.m.
On Sun, 2013-09-22 at 14:30 +0400, Alexander Plavin wrote:
> # HG changeset patch
> # User Alexander Plavin <alexander@plav.in>
> # Date 1379845197 -14400
> #      Sun Sep 22 14:19:57 2013 +0400
> # Node ID a6a394e65ff2dc487b38506e25953585e55c1ad3
> # Parent  d1f9b450414949269ff98ad2597ad44848f119df
> paper: add infinite scrolling to graph by calling ajaxScrollInit at the page

These are queued for default, thanks.

Patch

diff -r d1f9b4504149 -r a6a394e65ff2 mercurial/templates/paper/graph.tmpl
--- 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
@@ -122,6 +122,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>
 
diff -r d1f9b4504149 -r a6a394e65ff2 tests/test-hgweb-empty.t
--- 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>