Mercurial > hg-stable
view mercurial/templates/spartan/graph.tmpl @ 35264:ad0de63e1d6a
hgweb: move common vertex code to Graph.prototype
Just to give some context to the return values: vertex() needs to return two
HTML elements as strings, <li> to be used as a background and a <li> to be
shown in foreground. The latter was made obsolete recently when changesets
started to be rendered server-side, but background elements are still useful
for now.
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Wed, 06 Dec 2017 12:10:16 +0800 |
parents | 66c11a66ad1a |
children | 27ab3150cd50 |
line wrap: on
line source
{header} <title>{repo|escape}: graph</title> <link rel="alternate" type="application/atom+xml" href="{url|urlescape}atom-tags" title="Atom feed for {repo|escape}: tags"> <link rel="alternate" type="application/rss+xml" href="{url|urlescape}rss-tags" title="RSS feed for {repo|escape}: tags"> <!--[if IE]><script type="text/javascript" src="{staticurl|urlescape}excanvas.js"></script><![endif]--> </head> <body> <div class="buttons"> <a href="{url|urlescape}log/{symrev}{sessionvars%urlparameter}">changelog</a> <a href="{url|urlescape}shortlog/{symrev}{sessionvars%urlparameter}">shortlog</a> <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> <a href="{url|urlescape}file/{symrev}/{sessionvars%urlparameter}">files</a> <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a> </div> <h2><a href="/">Mercurial</a> {pathdef%breadcrumb} / graph</h2> <form action="{url|urlescape}log"> {sessionvars%hiddenformentry} <p> <label for="search1">search:</label> <input name="rev" id="search1" type="text" size="30"> navigate: <small class="navigate">{changenav%navgraph}</small> </p> </form> <noscript>The revision graph only works with JavaScript-enabled browsers.</noscript> <div id="wrapper"> <ul id="nodebgs"></ul> <canvas id="graph" width="{canvaswidth}" height="{canvasheight}"></canvas> <ul id="graphnodes">{nodes%graphentry}</ul> </div> <script type="text/javascript"{if(nonce, ' nonce="{nonce}"')}> <!-- hide script content var data = {jsdata|json}; var graph = new Graph(); graph.scale({bg_height}); graph.vertex = function(x, y, radius, color, parity, cur) \{ Graph.prototype.vertex.apply(this, arguments); return ['<li class="bg parity' + parity + '"></li>', '']; } graph.render(data); // stop hiding script --> </script> <form action="{url|urlescape}log"> {sessionvars%hiddenformentry} <p> <label for="search1">search:</label> <input name="rev" id="search1" type="text" size="30"> navigate: <small class="navigate">{changenav%navgraph}</small> </p> </form> {footer}