changeset 19743:fdd41257def8

hgweb: add appendFormatHTML javascript function This is a convenient helper function to append some formatted HTML markup to a DOM element.
author Alexander Plavin <alexander@plav.in>
date Fri, 06 Sep 2013 13:30:58 +0400
parents ac68009c31a4
children 06badf7d10dc
files mercurial/templates/static/mercurial.js
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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
@@ -341,3 +341,7 @@
     doc.documentElement.innerHTML = html;
     return doc;
 }
+
+function appendFormatHTML(element, formatStr, replacements) {
+    element.insertAdjacentHTML('beforeend', format(formatStr, replacements));
+}