Patchwork [15,of,20] hgweb: add ajaxy loaded entries to the DOM tree

login
register
mail settings
Submitter Alexander Plavin
Date Aug. 9, 2013, 6:57 p.m.
Message ID <749f5ba8c323d89b3f85.1376074660@debian-alexander.dolgopa>
Download mbox | patch
Permalink /patch/2121/
State Changes Requested
Headers show

Comments

Alexander Plavin - Aug. 9, 2013, 6:57 p.m.
# HG changeset patch
# User Alexander Plavin <alexander@plav.in>
# Date 1376061334 -14400
#      Fri Aug 09 19:15:34 2013 +0400
# Node ID 749f5ba8c323d89b3f856f7b8812653e18f41907
# Parent  f28ca736646cf582ef71b518b995a1d63c40849a
hgweb: add ajaxy loaded entries to the DOM tree

Now the loaded entries (if response is successful) are added to the DOM tree,
i.e. actually displayed.

Patch

diff -r f28ca736646c -r 749f5ba8c323 mercurial/templates/static/mercurial.js
--- a/mercurial/templates/static/mercurial.js	Fri Aug 09 19:15:08 2013 +0400
+++ b/mercurial/templates/static/mercurial.js	Fri Aug 09 19:15:34 2013 +0400
@@ -387,6 +387,11 @@ 
                 function onstart() {
                 },
                 function onsuccess(xml) {
+                    var html = xml.getElementsByTagName('html')[0];
+                    html = html.firstChild.nodeValue;
+                    appendHTML(container, html);
+
+                    lastHash = xml.getElementsByTagName('lasthash')[0].firstChild.nodeValue;
                 },
                 function onerror(errorText) {
                 },