[PATCH 6 of 6 V2] hgweb: add actual processing of ajax-received next page content

Alexander Plavin alexander at plav.in
Sat Aug 17 17:29:01 CDT 2013


# HG changeset patch
# User Alexander Plavin <alexander at plav.in>
# Date 1376754538 -14400
#      Sat Aug 17 19:48:58 2013 +0400
# Node ID 12fcadea359e8df4d5c53cc0807acac00be38d02
# Parent  4b97b9c7034ef5d561021ce6f1f34a2f89764e7c
hgweb: add actual processing of ajax-received next page content

This code adds the received entries to the page.

diff -r 4b97b9c7034e -r 12fcadea359e mercurial/templates/static/mercurial.js
--- a/mercurial/templates/static/mercurial.js	Sat Aug 17 15:35:40 2013 +0400
+++ b/mercurial/templates/static/mercurial.js	Sat Aug 17 19:48:58 2013 +0400
@@ -362,6 +362,14 @@
                 function onstart() {
                 },
                 function onsuccess(htmlText) {
+                    var m = htmlText.match(nextHashRegex);
+                    nextHash = m ? m[1] : null;
+
+                    var doc = docFromHTML(htmlText);
+                    var nodes = doc.querySelector(containerSelector).children;
+                    while (nodes.length) {
+                        container.appendChild(nodes[0]);
+                    }
                 },
                 function onerror(errorText) {
                 },


More information about the Mercurial-devel mailing list