Mercurial > hg
annotate templates/coal/graph.tmpl @ 7124:63579aa36c8e
graph: replace the blinking no javascript message
author | Benoit Allard <benoit@aeteurope.nl> |
---|---|
date | Sat, 18 Oct 2008 16:09:07 +0200 |
parents | 248e54a9456e |
children | 288dda59233c |
rev | line source |
---|---|
6691 | 1 {header} |
2 <title>{repo|escape}: revision graph</title> | |
3 <link rel="alternate" type="application/atom+xml" | |
4 href="{url}atom-log" title="Atom feed for {repo|escape}: log"> | |
5 <link rel="alternate" type="application/rss+xml" | |
6 href="{url}rss-log" title="RSS feed for {repo|escape}: log"> | |
7 <!--[if IE]><script type="text/javascript" src="{staticurl}excanvas.js"></script><![endif]--> | |
8 </head> | |
9 <body> | |
10 | |
11 <div class="container"> | |
12 <div class="menu"> | |
13 <div class="logo"> | |
14 <a href="http://www.selenic.com/mercurial/"> | |
15 <img src="{staticurl}hglogo.png" width=75 height=90 border=0 alt="mercurial"></a> | |
16 </div> | |
17 <ul> | |
6775
54ccf41761c9
coal: include current node in log, graph menu links
Brendan Cully <brendan@kublai.com>
parents:
6733
diff
changeset
|
18 <li><a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li> |
6691 | 19 <li class="active">graph</li> |
20 <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li> | |
21 </ul> | |
22 <ul> | |
23 <li><a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a></li> | |
24 <li><a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">browse</a></li> | |
25 </ul> | |
26 </div> | |
27 | |
28 <div class="main"> | |
29 <h2>{repo|escape}</h2> | |
30 <h3>graph</h3> | |
31 | |
32 <form class="search" action="{url}log"> | |
33 {sessionvars%hiddenformentry} | |
34 <p><input name="rev" id="search1" type="text" size="30"></p> | |
35 </form> | |
36 | |
37 <div class="navigate"> | |
38 <a href="{url}graph/{uprev}{sessionvars%urlparameter}?revcount={revcountless}">less</a> | |
39 <a href="{url}graph/{uprev}{sessionvars%urlparameter}?revcount={revcountmore}">more</a> | |
6701
bf72e756c98b
templates: fix navigation links for graph entries
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6691
diff
changeset
|
40 | {changenav%navgraphentry} |
6691 | 41 </div> |
42 | |
7124
63579aa36c8e
graph: replace the blinking no javascript message
Benoit Allard <benoit@aeteurope.nl>
parents:
6905
diff
changeset
|
43 <noscript>The revision graph only works with JavaScript-enabled browsers.</noscript> |
6691 | 44 |
45 <div id="wrapper"> | |
46 <ul id="nodebgs"></ul> | |
47 <canvas id="graph" width="224" height="{canvasheight}"></canvas> | |
48 <ul id="graphnodes"></ul> | |
49 </div> | |
50 | |
51 <script type="text/javascript" src="{staticurl}graph.js"></script> | |
6905
248e54a9456e
coal/paper: make output well-formed and fix css syntax error breaking rendering
Rocco Rutte <pdmef@gmx.net>
parents:
6775
diff
changeset
|
52 <script type="text/javascript"> |
6729
855851eae70f
graph: improve script hiding tricks
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6728
diff
changeset
|
53 <!-- hide script content |
6691 | 54 |
6733
936a9073bb73
graph: fix JavaScript issues to make it work on IE
Benoit Allard <benoit@aeteurope.nl>
parents:
6729
diff
changeset
|
55 var data = {jsdata|json}; |
936a9073bb73
graph: fix JavaScript issues to make it work on IE
Benoit Allard <benoit@aeteurope.nl>
parents:
6729
diff
changeset
|
56 var graph = new Graph(); |
6691 | 57 graph.scale({bg_height}); |
58 | |
59 graph.edge = function(x0, y0, x1, y1, color) { | |
60 | |
61 this.setColor(color, 0.0, 0.65); | |
62 this.ctx.beginPath(); | |
63 this.ctx.moveTo(x0, y0); | |
64 this.ctx.lineTo(x1, y1); | |
65 this.ctx.stroke(); | |
66 | |
67 } | |
68 | |
69 var revlink = '<li style="_STYLE"><span class="desc">'; | |
70 revlink += '<a href="{url}rev/_NODEID{sessionvars%urlparameter}" title="_NODEID">_DESC</a>'; | |
71 revlink += '</span><span class="tag">_TAGS</span>'; | |
72 revlink += '<span class="info">_DATE ago, by _USER</span></li>'; | |
73 | |
74 graph.vertex = function(x, y, color, parity, cur) { | |
75 | |
76 this.ctx.beginPath(); | |
77 color = this.setColor(color, 0.25, 0.75); | |
78 this.ctx.arc(x, y, radius, 0, Math.PI * 2, true); | |
79 this.ctx.fill(); | |
80 | |
81 var bg = '<li class="bg parity' + parity + '"></li>'; | |
82 var left = (this.columns + 1) * this.bg_height; | |
83 var nstyle = 'padding-left: ' + left + 'px;'; | |
84 var item = revlink.replace(/_STYLE/, nstyle); | |
85 item = item.replace(/_PARITY/, 'parity' + parity); | |
86 item = item.replace(/_NODEID/, cur[0]); | |
87 item = item.replace(/_NODEID/, cur[0]); | |
88 item = item.replace(/_DESC/, cur[3]); | |
89 item = item.replace(/_USER/, cur[4]); | |
90 item = item.replace(/_DATE/, cur[5]); | |
6720
084c9f1ef2bd
graph: display branch name alongside tags
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6701
diff
changeset
|
91 item = item.replace(/_TAGS/, cur[7].join(' ')); |
6728
84294e3710b8
graph: optimize rendering by appending all nodes at once
Augie Fackler <durin42@gmail.com>
parents:
6720
diff
changeset
|
92 |
84294e3710b8
graph: optimize rendering by appending all nodes at once
Augie Fackler <durin42@gmail.com>
parents:
6720
diff
changeset
|
93 return [bg, item]; |
6691 | 94 |
95 } | |
96 | |
97 graph.render(data); | |
6729
855851eae70f
graph: improve script hiding tricks
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6728
diff
changeset
|
98 |
855851eae70f
graph: improve script hiding tricks
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6728
diff
changeset
|
99 // stop hiding script --> |
6691 | 100 </script> |
101 | |
102 <div class="navigate"> | |
103 <a href="{url}graph/{uprev}{sessionvars%urlparameter}?revcount={revcountless}">less</a> | |
104 <a href="{url}graph/{uprev}{sessionvars%urlparameter}?revcount={revcountmore}">more</a> | |
6701
bf72e756c98b
templates: fix navigation links for graph entries
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6691
diff
changeset
|
105 | {changenav%navgraphentry} |
6691 | 106 </div> |
107 | |
108 </div> | |
109 </div> | |
110 | |
111 {footer} |