Mercurial > hg
changeset 19783:1c2a309bba4f
paper: add infinite scrolling to graph by calling ajaxScrollInit at the page
author | Alexander Plavin <alexander@plav.in> |
---|---|
date | Sun, 22 Sep 2013 14:19:57 +0400 |
parents | 8123f50555ff |
children | 1d2ca307bf22 |
files | mercurial/templates/paper/graph.tmpl tests/test-hgweb-empty.t |
diffstat | 2 files changed, 22 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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>