[PATCH 3 of 4] hgweb: add parentSelector argument to process_dates

Alexander Plavin alexander at plav.in
Tue Sep 24 14:39:16 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 cf5221a1d0e097358788350b9b0b75f0b63575c7
# Parent  26747ba40308c83c5efbc4906c9096cda20de5cc
hgweb: add parentSelector argument to process_dates

Allow specifying parent selector of elements to process, useful for
incremental page updates.

diff -r 26747ba40308 -r cf5221a1d0e0 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
@@ -176,7 +176,7 @@
 }
 
 
-function process_dates(){
+function process_dates(parentSelector){
 
 	// derived from code from mercurial/templatefilter.py
 
@@ -253,7 +253,7 @@
 		}
 	}
 
-    var nodes = document.querySelectorAll('.age');
+    var nodes = document.querySelectorAll((parentSelector || '') + ' .age');
     var dateclass = new RegExp('\\bdate\\b');
     for (var i=0; i<nodes.length; ++i){
         var node = nodes[i];


More information about the Mercurial-devel mailing list