Patchwork [6,of,9,V2] hgweb: show message when an error occured during ajax loading

login
register
mail settings
Submitter Alexander Plavin
Date Aug. 17, 2013, 10:33 p.m.
Message ID <42fb641c0308be5eb27f.1376778791@debian-alexander.dolgopa>
Download mbox | patch
Permalink /patch/2216/
State Superseded
Commit 54981b8994066c90e6500f4b34e33b30fc455cae
Headers show

Comments

Alexander Plavin - Aug. 17, 2013, 10:33 p.m.
# HG changeset patch
# User Alexander Plavin <alexander@plav.in>
# Date 1376765419 -14400
#      Sat Aug 17 22:50:19 2013 +0400
# Node ID 42fb641c0308be5eb27f298619e787a9d0ac20f8
# Parent  8bea23e0f3b00c7ca8582c6f2970adabc6dab2d1
hgweb: show message when an error occured during ajax loading

Patch

diff -r 8bea23e0f3b0 -r 42fb641c0308 mercurial/templates/static/mercurial.js
--- a/mercurial/templates/static/mercurial.js	Sat Aug 17 22:44:31 2013 +0400
+++ b/mercurial/templates/static/mercurial.js	Sat Aug 17 22:50:19 2013 +0400
@@ -367,6 +367,7 @@ 
         if (scrollHeight - (scrollTop + clientHeight) < 50) {
             updateInitiated = true;
             container.lastElementChild.classList.add('scroll-separator');
+            removeByClassName('scroll-loading-error');
 
             if (!nextHash) {
                 var message = {
@@ -399,6 +400,11 @@ 
                     process_dates();
                 },
                 function onerror(errorText) {
+                    var message = {
+                        class: 'scroll-loading-error',
+                        text: 'Error: ' + errorText
+                    };
+                    appendFormatHTML(container, messageFormat, message);
                 },
                 function oncomplete() {
                     removeByClassName('scroll-loading');