From patchwork Sat Aug 17 22:35:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3,of,4,V2] hgweb: add selector argument to process_dates From: Alexander Plavin X-Patchwork-Id: 2223 Message-Id: <988392ad5f1e39a099a1.1376778919@debian-alexander.dolgopa> To: mercurial-devel@selenic.com Date: Sun, 18 Aug 2013 02:35:19 +0400 # HG changeset patch # User Alexander Plavin # Date 1374681754 -14400 # Wed Jul 24 20:02:34 2013 +0400 # Node ID 988392ad5f1e39a099a1b00c4595628420d19991 # Parent 122061a7a549d6e3faa84a0657699b5ed705f413 hgweb: add selector argument to process_dates Allow specifying elements to process with selector, useful for incremental page updates. diff -r 122061a7a549 -r 988392ad5f1e mercurial/templates/static/mercurial.js --- a/mercurial/templates/static/mercurial.js Wed Jul 24 20:13:52 2013 +0400 +++ b/mercurial/templates/static/mercurial.js Wed Jul 24 20:02:34 2013 +0400 @@ -168,7 +168,7 @@ } -function process_dates(){ +function process_dates(selector){ // derived from code from mercurial/templatefilter.py @@ -245,7 +245,11 @@ } } - var nodes = document.querySelectorAll('.age'); + if (typeof selector === 'undefined') { + selector = ''; + } + + var nodes = document.querySelectorAll(selector + ' .age'); var dateclass = new RegExp('\\bdate\\b'); for (var i=0; i