# HG changeset patch # User Alexander Plavin # Date 1378459858 -14400 # Node ID fdd41257def8c71779870e5e70dec0e038b80bc8 # Parent ac68009c31a4234419333cc299a558337a130780 hgweb: add appendFormatHTML javascript function This is a convenient helper function to append some formatted HTML markup to a DOM element. diff -r ac68009c31a4 -r fdd41257def8 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)); +}