annotate templates/monoblue/graph.tmpl @ 7220:60826e071ce2

inotify: avoid passing potentially stale stat to update
author Matt Mackall <mpm@selenic.com>
date Wed, 22 Oct 2008 19:40:32 -0500
parents 91b0ada2d94b
children f031a12dfc31
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7111
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
1 #header#
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
2 <title>#repo|escape#: graph</title>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
3 <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for #repo|escape#"/>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
4 <link rel="alternate" type="application/rss+xml" href="{url}rss-log" title="RSS feed for #repo|escape#"/>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
5 <!--[if IE]><script type="text/javascript" src="#staticurl#excanvas.js"></script><![endif]-->
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
6 </head>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
7
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
8 <body>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
9 <div id="container">
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
10 <div class="page-header">
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
11 <h1><a href="{url}summary{sessionvars%urlparameter}">#repo|escape#</a> / graph</h1>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
12
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
13 <form action="{url}log">
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
14 {sessionvars%hiddenformentry}
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
15 <dl class="search">
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
16 <dt><label>Search: </label></dt>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
17 <dd><input type="text" name="rev" /></dd>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
18 </dl>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
19 </form>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
20
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
21 <ul class="page-nav">
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
22 <li><a href="{url}summary{sessionvars%urlparameter}">summary</a></li>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
23 <li><a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a></li>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
24 <li><a href="{url}changelog{sessionvars%urlparameter}">changelog</a></li>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
25 <li class="current">graph</li>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
26 <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
27 <li><a href="{url}file/#node|short#{sessionvars%urlparameter}">files</a></li>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
28 </ul>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
29 </div>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
30
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
31 <h2 class="no-link no-border">graph</h2>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
32
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
33 <div id="noscript">The revision graph only works with JavaScript-enabled browsers.</div>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
34 <div id="wrapper">
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
35 <ul id="nodebgs"></ul>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
36 <canvas id="graph" width="224" height="#canvasheight#"></canvas>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
37 <ul id="graphnodes"></ul>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
38 </div>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
39
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
40 <script type="text/javascript" src="#staticurl#graph.js"></script>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
41 <script>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
42 <!-- hide script content
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
43
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
44 document.getElementById('noscript').style.display = 'none';
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
45
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
46 var data = {jsdata|json};
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
47 var graph = new Graph();
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
48 graph.scale({bg_height});
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
49
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
50 graph.edge = function(x0, y0, x1, y1, color) {
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
51
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
52 this.setColor(color, 0.0, 0.65);
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
53 this.ctx.beginPath();
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
54 this.ctx.moveTo(x0, y0);
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
55 this.ctx.lineTo(x1, y1);
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
56 this.ctx.stroke();
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
57
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
58 }
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
59
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
60 var revlink = '<li style="_STYLE"><span class="desc">';
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
61 revlink += '<a href="{url}rev/_NODEID{sessionvars%urlparameter}" title="_NODEID">_DESC</a>';
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
62 revlink += '</span><span class="info">_DATE ago, by _USER</span></li>';
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
63
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
64 graph.vertex = function(x, y, color, parity, cur) {
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
65
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
66 this.ctx.beginPath();
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
67 color = this.setColor(color, 0.25, 0.75);
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
68 this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
69 this.ctx.fill();
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
70
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
71 var bg = '<li class="bg parity' + parity + '"></li>';
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
72 var left = (this.columns + 1) * this.bg_height;
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
73 var nstyle = 'padding-left: ' + left + 'px;';
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
74 var item = revlink.replace(/_STYLE/, nstyle);
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
75 item = item.replace(/_PARITY/, 'parity' + parity);
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
76 item = item.replace(/_NODEID/, cur[0]);
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
77 item = item.replace(/_NODEID/, cur[0]);
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
78 item = item.replace(/_DESC/, cur[3]);
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
79 item = item.replace(/_USER/, cur[4]);
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
80 item = item.replace(/_DATE/, cur[5]);
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
81
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
82 return [bg, item];
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
83
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
84 }
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
85
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
86 graph.render(data);
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
87
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
88 // stop hiding script -->
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
89 </script>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
90
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
91 <div class="page-path">
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
92 #changenav%navgraphentry#
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
93 </div>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
94
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
95 #footer#