[PATCH 3 of 9 V2] hgweb: add appendFormatHTML javascript function

Alexander Plavin alexander at plav.in
Sat Aug 17 17:33:08 CDT 2013


# HG changeset patch
# User Alexander Plavin <alexander at plav.in>
# Date 1376764994 -14400
#      Sat Aug 17 22:43:14 2013 +0400
# Node ID a646de4ac36ab29a648e26b9b302821da91955e6
# Parent  1617b8aa1c4aaf41305a2f73251085b1d469f03a
hgweb: add appendFormatHTML javascript function

This is a convenient helper function to append some formatted HTML markup to a
DOM element.

diff -r 1617b8aa1c4a -r a646de4ac36a mercurial/templates/static/mercurial.js
--- a/mercurial/templates/static/mercurial.js	Fri Aug 09 16:51:53 2013 +0400
+++ b/mercurial/templates/static/mercurial.js	Sat Aug 17 22:43:14 2013 +0400
@@ -342,6 +342,10 @@
     return doc;
 }
 
+function appendFormatHTML(element, formatStr, replacements) {
+    element.insertAdjacentHTML('beforeend', format(formatStr, replacements));
+}
+
 function ajaxScrollInit(urlFormat,
                         nextHash,
                         nextHashRegex,


More information about the Mercurial-devel mailing list