hgweb: add appendFormatHTML javascript function
authorAlexander Plavin <alexander@plav.in>
Fri, 06 Sep 2013 13:30:58 +0400
changeset 19743 fdd41257def8
parent 19742 ac68009c31a4
child 19744 06badf7d10dc
hgweb: add appendFormatHTML javascript function This is a convenient helper function to append some formatted HTML markup to a DOM element.
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
@@ -341,3 +341,7 @@
     doc.documentElement.innerHTML = html;
     return doc;
 }
+
+function appendFormatHTML(element, formatStr, replacements) {
+    element.insertAdjacentHTML('beforeend', format(formatStr, replacements));
+}