Mercurial > hg
changeset 16137:8fd18eb8aab7
templates: move Graph.edge() implementation in mercurial.js
All implementation in graph.tmpl are the same. It can still be overriden if
necessary. There is no clear reason to keep it separated from mercurial.js.
author | Patrick Mezard <patrick@mezard.eu> |
---|---|
date | Fri, 17 Feb 2012 16:49:43 +0100 |
parents | 68007f0557de |
children | 6e4de55a41a4 |
files | mercurial/templates/gitweb/graph.tmpl mercurial/templates/monoblue/graph.tmpl mercurial/templates/paper/graph.tmpl mercurial/templates/spartan/graph.tmpl mercurial/templates/static/mercurial.js tests/test-hgweb-commands.t tests/test-hgweb-empty.t |
diffstat | 7 files changed, 10 insertions(+), 60 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/templates/gitweb/graph.tmpl Mon Feb 20 16:42:51 2012 -0600 +++ b/mercurial/templates/gitweb/graph.tmpl Fri Feb 17 16:49:43 2012 +0100 @@ -51,16 +51,6 @@ var graph = new Graph(); graph.scale({bg_height}); -graph.edge = function(x0, y0, x1, y1, color) \{ - - this.setColor(color, 0.0, 0.65); - this.ctx.beginPath(); - this.ctx.moveTo(x0, y0); - this.ctx.lineTo(x1, y1); - this.ctx.stroke(); - -} - var revlink = '<li style="_STYLE"><span class="desc">'; revlink += '<a class="list" href="{url}rev/_NODEID{sessionvars%urlparameter}" title="_NODEID"><b>_DESC</b></a>'; revlink += '</span> _TAGS';
--- a/mercurial/templates/monoblue/graph.tmpl Mon Feb 20 16:42:51 2012 -0600 +++ b/mercurial/templates/monoblue/graph.tmpl Fri Feb 17 16:49:43 2012 +0100 @@ -49,16 +49,6 @@ var graph = new Graph(); graph.scale({bg_height}); - graph.edge = function(x0, y0, x1, y1, color) \{ - - this.setColor(color, 0.0, 0.65); - this.ctx.beginPath(); - this.ctx.moveTo(x0, y0); - this.ctx.lineTo(x1, y1); - this.ctx.stroke(); - - } - var revlink = '<li style="_STYLE"><span class="desc">'; revlink += '<a href="{url}rev/_NODEID{sessionvars%urlparameter}" title="_NODEID">_DESC</a>'; revlink += '</span>_TAGS<span class="info">_DATE, by _USER</span></li>';
--- a/mercurial/templates/paper/graph.tmpl Mon Feb 20 16:42:51 2012 -0600 +++ b/mercurial/templates/paper/graph.tmpl Fri Feb 17 16:49:43 2012 +0100 @@ -62,16 +62,6 @@ var graph = new Graph(); graph.scale({bg_height}); -graph.edge = function(x0, y0, x1, y1, color) \{ - - this.setColor(color, 0.0, 0.65); - this.ctx.beginPath(); - this.ctx.moveTo(x0, y0); - this.ctx.lineTo(x1, y1); - this.ctx.stroke(); - -} - var revlink = '<li style="_STYLE"><span class="desc">'; revlink += '<a href="{url}rev/_NODEID{sessionvars%urlparameter}" title="_NODEID">_DESC</a>'; revlink += '</span>_TAGS<span class="info">_DATE, by _USER</span></li>';
--- a/mercurial/templates/spartan/graph.tmpl Mon Feb 20 16:42:51 2012 -0600 +++ b/mercurial/templates/spartan/graph.tmpl Fri Feb 17 16:49:43 2012 +0100 @@ -43,16 +43,6 @@ var graph = new Graph(); graph.scale({bg_height}); -graph.edge = function(x0, y0, x1, y1, color) \{ - - this.setColor(color, 0.0, 0.65); - this.ctx.beginPath(); - this.ctx.moveTo(x0, y0); - this.ctx.lineTo(x1, y1); - this.ctx.stroke(); - -} - var revlink = '<li style="_STYLE"><span class="desc">'; revlink += '<a href="{url}rev/_NODEID{sessionvars%urlparameter}" title="_NODEID">_DESC</a>'; revlink += '</span><span class="info">_DATE, by _USER</span></li>';
--- a/mercurial/templates/static/mercurial.js Mon Feb 20 16:42:51 2012 -0600 +++ b/mercurial/templates/static/mercurial.js Fri Feb 17 16:49:43 2012 +0100 @@ -83,6 +83,16 @@ } + this.edge = function(x0, y0, x1, y1, color) { + + this.setColor(color, 0.0, 0.65); + this.ctx.beginPath(); + this.ctx.moveTo(x0, y0); + this.ctx.lineTo(x1, y1); + this.ctx.stroke(); + + } + this.render = function(data) { var backgrounds = '';
--- a/tests/test-hgweb-commands.t Mon Feb 20 16:42:51 2012 -0600 +++ b/tests/test-hgweb-commands.t Fri Feb 17 16:49:43 2012 +0100 @@ -961,16 +961,6 @@ var graph = new Graph(); graph.scale(39); - graph.edge = function(x0, y0, x1, y1, color) { - - this.setColor(color, 0.0, 0.65); - this.ctx.beginPath(); - this.ctx.moveTo(x0, y0); - this.ctx.lineTo(x1, y1); - this.ctx.stroke(); - - } - var revlink = '<li style="_STYLE"><span class="desc">'; revlink += '<a class="list" href="/rev/_NODEID?style=gitweb" title="_NODEID"><b>_DESC</b></a>'; revlink += '</span> _TAGS';
--- a/tests/test-hgweb-empty.t Mon Feb 20 16:42:51 2012 -0600 +++ b/tests/test-hgweb-empty.t Fri Feb 17 16:49:43 2012 +0100 @@ -250,16 +250,6 @@ var graph = new Graph(); graph.scale(39); - graph.edge = function(x0, y0, x1, y1, color) { - - this.setColor(color, 0.0, 0.65); - this.ctx.beginPath(); - this.ctx.moveTo(x0, y0); - this.ctx.lineTo(x1, y1); - this.ctx.stroke(); - - } - var revlink = '<li style="_STYLE"><span class="desc">'; revlink += '<a href="/rev/_NODEID" title="_NODEID">_DESC</a>'; revlink += '</span>_TAGS<span class="info">_DATE, by _USER</span></li>';