Patchwork [5,of,5] hgweb: add appendFormatHTML javascript function

login
register
mail settings
Submitter Alexander Plavin
Date Sept. 18, 2013, 6:33 p.m.
Message ID <e8d739dbcf00190f5ee9.1379529199@debian-alexander.dolgopa>
Download mbox | patch
Permalink /patch/2521/
State Accepted
Commit fdd41257def8c71779870e5e70dec0e038b80bc8
Headers show

Comments

Alexander Plavin - Sept. 18, 2013, 6:33 p.m.
# HG changeset patch
# User Alexander Plavin <alexander@plav.in>
# Date 1378459858 -14400
#      Fri Sep 06 13:30:58 2013 +0400
# Node ID e8d739dbcf00190f5ee92cd18c1b015e2c2fc52f
# Parent  631f431af5acdd4c405e15b68b6360c3667ca40b
hgweb: add appendFormatHTML javascript function

This is a convenient helper function to append some formatted HTML markup to a
DOM element.
Matt Mackall - Sept. 18, 2013, 6:38 p.m.
On Wed, 2013-09-18 at 22:33 +0400, Alexander Plavin wrote:
> # HG changeset patch
> # User Alexander Plavin <alexander@plav.in>
> # Date 1378459858 -14400
> #      Fri Sep 06 13:30:58 2013 +0400
> # Node ID e8d739dbcf00190f5ee92cd18c1b015e2c2fc52f
> # Parent  631f431af5acdd4c405e15b68b6360c3667ca40b
> hgweb: add appendFormatHTML javascript function

These are queued for default, thanks.

Patch

diff -r 631f431af5ac -r e8d739dbcf00 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));
+}