~ubuntu-branches/ubuntu/lucid/mercurial/lucid

« back to all changes in this revision

Viewing changes to templates/spartan/graph.tmpl

  • Committer: Bazaar Package Importer
  • Author(s): Vernon Tang
  • Date: 2009-01-18 10:39:58 UTC
  • mfrom: (8.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090118103958-4ep2fqb5nl2pyc7y
Tags: 1.1.2-2
* debian/mercurial.postinst: symlink /usr/share/doc/mercurial if dpkg didn't
  do it when upgrading (closes: #512155)
* debian/control: mercurial-common replaces all earlier versions of
  mercurial

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#header#
 
2
<title>#repo|escape#: graph</title>
 
3
<link rel="alternate" type="application/atom+xml"
 
4
   href="#url#atom-tags" title="Atom feed for #repo|escape#: tags">
 
5
<link rel="alternate" type="application/rss+xml"
 
6
   href="#url#rss-tags" title="RSS feed for #repo|escape#: tags">
 
7
<!--[if IE]><script type="text/javascript" src="#staticurl#excanvas.js"></script><![endif]-->
 
8
</head>
 
9
<body>
 
10
 
 
11
<div class="buttons">
 
12
<a href="#url#log{sessionvars%urlparameter}">changelog</a>
 
13
<a href="#url#shortlog{sessionvars%urlparameter}">shortlog</a>
 
14
<a href="#url#tags{sessionvars%urlparameter}">tags</a>
 
15
<a href="#url#file/#node|short#/{sessionvars%urlparameter}">files</a>
 
16
</div>
 
17
 
 
18
<h2>graph</h2>
 
19
 
 
20
<form action="#url#log">
 
21
{sessionvars%hiddenformentry}
 
22
<p>
 
23
<label for="search1">search:</label>
 
24
<input name="rev" id="search1" type="text" size="30">
 
25
navigate: <small class="navigate">#changenav%navgraphentry#</small>
 
26
</p>
 
27
</form>
 
28
 
 
29
<noscript>The revision graph only works with JavaScript-enabled browsers.</noscript>
 
30
 
 
31
<div id="wrapper">
 
32
<ul id="nodebgs"></ul>
 
33
<canvas id="graph" width="224" height="#canvasheight#"></canvas>
 
34
<ul id="graphnodes"></ul>
 
35
</div>
 
36
 
 
37
<script type="text/javascript" src="#staticurl#graph.js"></script>
 
38
<script type="text/javascript">
 
39
<!-- hide script content
 
40
 
 
41
var data = {jsdata|json};
 
42
var graph = new Graph();
 
43
graph.scale({bg_height});
 
44
 
 
45
graph.edge = function(x0, y0, x1, y1, color) {
 
46
        
 
47
        this.setColor(color, 0.0, 0.65);
 
48
        this.ctx.beginPath();
 
49
        this.ctx.moveTo(x0, y0);
 
50
        this.ctx.lineTo(x1, y1);
 
51
        this.ctx.stroke();
 
52
        
 
53
}
 
54
 
 
55
var revlink = '<li style="_STYLE"><span class="desc">';
 
56
revlink += '<a href="{url}rev/_NODEID{sessionvars%urlparameter}" title="_NODEID">_DESC</a>';
 
57
revlink += '</span><span class="info">_DATE ago, by _USER</span></li>';
 
58
 
 
59
graph.vertex = function(x, y, color, parity, cur) {
 
60
        
 
61
        this.ctx.beginPath();
 
62
        color = this.setColor(color, 0.25, 0.75);
 
63
        this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
 
64
        this.ctx.fill();
 
65
        
 
66
        var bg = '<li class="bg parity' + parity + '"></li>';
 
67
        var left = (this.columns + 1) * this.bg_height;
 
68
        var nstyle = 'padding-left: ' + left + 'px;';
 
69
        var item = revlink.replace(/_STYLE/, nstyle);
 
70
        item = item.replace(/_PARITY/, 'parity' + parity);
 
71
        item = item.replace(/_NODEID/, cur[0]);
 
72
        item = item.replace(/_NODEID/, cur[0]);
 
73
        item = item.replace(/_DESC/, cur[3]);
 
74
        item = item.replace(/_USER/, cur[4]);
 
75
        item = item.replace(/_DATE/, cur[5]);
 
76
        
 
77
        return [bg, item];
 
78
        
 
79
}
 
80
 
 
81
graph.render(data);
 
82
 
 
83
// stop hiding script -->
 
84
</script>
 
85
 
 
86
<form action="#url#log">
 
87
{sessionvars%hiddenformentry}
 
88
<p>
 
89
<label for="search1">search:</label>
 
90
<input name="rev" id="search1" type="text" size="30">
 
91
navigate: <small class="navigate">#changenav%navgraphentry#</small>
 
92
</p>
 
93
</form>
 
94
 
 
95
#footer#