[PATCH 2 of 3] hgweb: show loading indicator while an ajax request is in process

Alexander Plavin alexander at plav.in
Thu Sep 19 07:37:39 CDT 2013


# HG changeset patch
# User Alexander Plavin <alexander at plav.in>
# Date 1378459858 -14400
#      Fri Sep 06 13:30:58 2013 +0400
# Node ID 83b62633254130572dcbe48b094645b67aa5ca20
# Parent  c3f4ef9336173e7c11ec62358ccc1910c76dc590
hgweb: show loading indicator while an ajax request is in process

diff -r c3f4ef933617 -r 83b626332541 mercurial/templates/static/mercurial.js
--- a/mercurial/templates/static/mercurial.js	Fri Sep 06 13:30:58 2013 +0400
+++ b/mercurial/templates/static/mercurial.js	Fri Sep 06 13:30:58 2013 +0400
@@ -380,6 +380,11 @@
                 format(urlFormat, {hash: nextHash}),
                 'GET',
                 function onstart() {
+                    var message = {
+                        class: 'scroll-loading',
+                        text: 'Loading...'
+                    };
+                    appendFormatHTML(container, messageFormat, message);
                 },
                 function onsuccess(htmlText) {
                     var m = htmlText.match(nextHashRegex);
@@ -397,6 +402,7 @@
                 function onerror(errorText) {
                 },
                 function oncomplete() {
+                    removeByClassName('scroll-loading');
                     updateInitiated = false;
                     scrollHandler();
                 }


More information about the Mercurial-devel mailing list