[PATCH 4 of 5] hgweb: infinite scroll support for monoblue style

Takumi IINO trot.thunder at gmail.com
Tue Jan 7 15:52:17 UTC 2014


# HG changeset patch
# User Takumi IINO <trot.thunder at gmail.com>
# Date 1389109664 -32400
#      Wed Jan 08 00:47:44 2014 +0900
# Node ID 3b2950c2b851b7a06f51fc58fec410b7deb6ff80
# Parent  fa073629c74ab6ba4d5f7f19f5daa5f2a7120262
hgweb: infinite scroll support for monoblue style

diff --git a/mercurial/templates/monoblue/graph.tmpl b/mercurial/templates/monoblue/graph.tmpl
--- a/mercurial/templates/monoblue/graph.tmpl
+++ b/mercurial/templates/monoblue/graph.tmpl
@@ -102,6 +102,17 @@
         <a href="{url|urlescape}graph/{rev}{lessvars%urlparameter}">less</a>
         <a href="{url|urlescape}graph/{rev}{morevars%urlparameter}">more</a>
         | {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}
diff --git a/mercurial/templates/monoblue/shortlog.tmpl b/mercurial/templates/monoblue/shortlog.tmpl
--- a/mercurial/templates/monoblue/shortlog.tmpl
+++ b/mercurial/templates/monoblue/shortlog.tmpl
@@ -31,14 +31,29 @@
         </ul>
     </div>
 
     <h2 class="no-link no-border">shortlog</h2>
 
-    <table>
+    <table class="shortlogtable">
 {entries%shortlogentry}
     </table>
 
     <div class="page-path">
     {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}
diff --git a/mercurial/templates/spartan/header.tmpl b/mercurial/templates/spartan/header.tmpl
--- a/mercurial/templates/spartan/header.tmpl
+++ b/mercurial/templates/spartan/header.tmpl
@@ -1,6 +1,6 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head>
 <link rel="icon" href="{staticurl|urlescape}hgicon.png" type="image/png">
 <meta name="robots" content="index, nofollow" />
 <link rel="stylesheet" href="{staticurl|urlescape}style.css" type="text/css" />
diff --git a/mercurial/templates/static/style-monoblue.css b/mercurial/templates/static/style-monoblue.css
--- a/mercurial/templates/static/style-monoblue.css
+++ b/mercurial/templates/static/style-monoblue.css
@@ -526,5 +526,29 @@ ul#graphnodes li .info {
 /** end of comparison **/
 
 .breadcrumb a:hover {
     text-decoration:underline;
 }
+
+.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;
+}
+
+ at -webkit-keyframes change_color {
+  from { background-color: #A0CEFF; } to {  }
+}
+ at -moz-keyframes change_color {
+  from { background-color: #A0CEFF; } to {  }
+}
+ at -o-keyframes change_color {
+  from { background-color: #A0CEFF; } to {  }
+}
+ at keyframes change_color {
+  from { background-color: #A0CEFF; } to {  }
+}
+
+.scroll-loading-error {
+    background-color: #FFCCCC !important;
+}



More information about the Mercurial-devel mailing list