hgweb: infinite scroll support for gitweb style
authorTakumi IINO <trot.thunder@gmail.com>
Wed, 08 Jan 2014 00:47:43 +0900
changeset 20254 3896debf0a11
parent 20253 43cfad930d38
child 20255 b1d65cb8c759
hgweb: infinite scroll support for gitweb style
mercurial/templates/gitweb/graph.tmpl
mercurial/templates/gitweb/shortlog.tmpl
mercurial/templates/static/style-gitweb.css
--- a/mercurial/templates/gitweb/graph.tmpl	Wed Jan 08 00:35:03 2014 +0900
+++ b/mercurial/templates/gitweb/graph.tmpl	Wed Jan 08 00:47:43 2014 +0900
@@ -108,4 +108,15 @@
 | {changenav%navgraph}
 </div>
 
+<script type="text/javascript">
+    ajaxScrollInit(
+            '{url|urlescape}graph/{rev}?revcount=%next%&style={style}',
+            {revcount}+60,
+            function (htmlText, previousVal) \{ return previousVal + 60; },
+            '#wrapper',
+            '<div class="%class%" style="text-align: center;">%text%</div>',
+            'graph'
+    );
+</script>
+
 {footer}
--- a/mercurial/templates/gitweb/shortlog.tmpl	Wed Jan 08 00:35:03 2014 +0900
+++ b/mercurial/templates/gitweb/shortlog.tmpl	Wed Jan 08 00:47:43 2014 +0900
@@ -32,7 +32,7 @@
 </div>
 
 <div class="title">&nbsp;</div>
-<table cellspacing="0">
+<table class="shortlogtable" cellspacing="0">
 {entries%shortlogentry}
 </table>
 
@@ -40,4 +40,19 @@
 {changenav%navshort}
 </div>
 
+<script type="text/javascript">
+    ajaxScrollInit(
+            '{url|urlescape}shortlog/%next%{sessionvars%urlparameter}',
+            '{nextentry%"{node}"}', <!-- NEXTHASH
+            function (htmlText, previousVal) \{
+                var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
+                return m ? m[1] : null;
+            },
+            '.shortlogtable > tbody:nth-of-type(1)',
+            '<tr class="%class%">\
+            <td colspan="4" style="text-align: center;">%text%</td>\
+            </tr>'
+    );
+</script>
+
 {footer}
--- a/mercurial/templates/static/style-gitweb.css	Wed Jan 08 00:35:03 2014 +0900
+++ b/mercurial/templates/static/style-gitweb.css	Wed Jan 08 00:47:43 2014 +0900
@@ -167,3 +167,27 @@
 .block {
     border-top: 1px solid #d9d8d1;
 }
+
+.scroll-loading {
+  -webkit-animation: change_color 1s linear 0s infinite alternate;
+  -moz-animation: change_color 1s linear 0s infinite alternate;
+  -o-animation: change_color 1s linear 0s infinite alternate;
+  animation: change_color 1s linear 0s infinite alternate;
+}
+
+@-webkit-keyframes change_color {
+  from { background-color: #A0CEFF; } to {  }
+}
+@-moz-keyframes change_color {
+  from { background-color: #A0CEFF; } to {  }
+}
+@-o-keyframes change_color {
+  from { background-color: #A0CEFF; } to {  }
+}
+@keyframes change_color {
+  from { background-color: #A0CEFF; } to {  }
+}
+
+.scroll-loading-error {
+    background-color: #FFCCCC !important;
+}