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

login
register
mail settings
Submitter Alexander Plavin
Date Aug. 17, 2013, 10:33 p.m.
Message ID <a646de4ac36ab29a648e.1376778788@debian-alexander.dolgopa>
Download mbox | patch
Permalink /patch/2213/
State Superseded
Commit fdd41257def8c71779870e5e70dec0e038b80bc8
Headers show

Comments

Alexander Plavin - Aug. 17, 2013, 10:33 p.m.
# HG changeset patch
# User Alexander Plavin <alexander@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.

Patch

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,