[PATCH 3 of 3] hgweb: show message when an error occured during ajax loading

Alexander Plavin alexander at plav.in
Thu Sep 19 07:37:40 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 3f23cc5f52e790d0a02fda11b0db2998a6ecdf65
# Parent  83b62633254130572dcbe48b094645b67aa5ca20
hgweb: show message when an error occured during ajax loading

diff -r 83b626332541 -r 3f23cc5f52e7 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
@@ -366,6 +366,7 @@
 
         if (scrollHeight - (scrollTop + clientHeight) < 50) {
             updateInitiated = true;
+            removeByClassName('scroll-loading-error');
 
             if (!nextHash) {
                 var message = {
@@ -400,6 +401,11 @@
                     process_dates();
                 },
                 function onerror(errorText) {
+                    var message = {
+                        class: 'scroll-loading-error',
+                        text: 'Error: ' + errorText
+                    };
+                    appendFormatHTML(container, messageFormat, message);
                 },
                 function oncomplete() {
                     removeByClassName('scroll-loading');


More information about the Mercurial-devel mailing list