##// END OF EJS Templates
paper: add infinite scrolling to graph by calling ajaxScrollInit at the page
Alexander Plavin -
r19783:1c2a309b default
parent child Browse files
Show More
@@ -1,129 +1,140 b''
1 1 {header}
2 2 <title>{repo|escape}: revision graph</title>
3 3 <link rel="alternate" type="application/atom+xml"
4 4 href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}: log" />
5 5 <link rel="alternate" type="application/rss+xml"
6 6 href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}: log" />
7 7 <!--[if IE]><script type="text/javascript" src="{staticurl|urlescape}excanvas.js"></script><![endif]-->
8 8 </head>
9 9 <body>
10 10
11 11 <div class="container">
12 12 <div class="menu">
13 13 <div class="logo">
14 14 <a href="{logourl}">
15 15 <img src="{staticurl|urlescape}{logoimg}" alt="mercurial" /></a>
16 16 </div>
17 17 <ul>
18 18 <li><a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
19 19 <li class="active">graph</li>
20 20 <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
21 21 <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
22 22 <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
23 23 </ul>
24 24 <ul>
25 25 <li><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a></li>
26 26 <li><a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">browse</a></li>
27 27 </ul>
28 28 <ul>
29 29 <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
30 30 </ul>
31 31 <p>
32 32 <div class="atom-logo">
33 33 <a href="{url|urlescape}atom-log" title="subscribe to atom feed">
34 34 <img class="atom-logo" src="{staticurl|urlescape}feed-icon-14x14.png" alt="atom feed">
35 35 </a>
36 36 </div>
37 37 </div>
38 38
39 39 <div class="main">
40 40 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
41 41 <h3>graph</h3>
42 42
43 43 <form class="search" action="{url|urlescape}log">
44 44 {sessionvars%hiddenformentry}
45 45 <p><input name="rev" id="search1" type="text" size="30" /></p>
46 46 <div id="hint">find changesets by author, revision,
47 47 files, or words in the commit message</div>
48 48 </form>
49 49
50 50 <div class="navigate">
51 51 <a href="{url|urlescape}graph/{rev}{lessvars%urlparameter}">less</a>
52 52 <a href="{url|urlescape}graph/{rev}{morevars%urlparameter}">more</a>
53 53 | rev {rev}: {changenav%navgraph}
54 54 </div>
55 55
56 56 <noscript><p>The revision graph only works with JavaScript-enabled browsers.</p></noscript>
57 57
58 58 <div id="wrapper">
59 59 <ul id="nodebgs" class="stripes2"></ul>
60 60 <canvas id="graph" width="480" height="{canvasheight}"></canvas>
61 61 <ul id="graphnodes"></ul>
62 62 </div>
63 63
64 64 <script type="text/javascript">
65 65 <!-- hide script content
66 66
67 67 var data = {jsdata|json};
68 68 var graph = new Graph();
69 69 graph.scale({bg_height});
70 70
71 71 graph.vertex = function(x, y, color, parity, cur) \{
72 72
73 73 this.ctx.beginPath();
74 74 color = this.setColor(color, 0.25, 0.75);
75 75 this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
76 76 this.ctx.fill();
77 77
78 78 var bg = '<li class="bg"></li>';
79 79 var left = (this.bg_height - this.box_size) + (this.columns + 1) * this.box_size;
80 80 var nstyle = 'padding-left: ' + left + 'px;';
81 81
82 82 var tagspan = '';
83 83 if (cur[7].length || cur[8].length || (cur[6][0] != 'default' || cur[6][1])) \{
84 84 tagspan = '<span class="logtags">';
85 85 if (cur[6][1]) \{
86 86 tagspan += '<span class="branchhead" title="' + cur[6][0] + '">';
87 87 tagspan += cur[6][0] + '</span> ';
88 88 } else if (!cur[6][1] && cur[6][0] != 'default') \{
89 89 tagspan += '<span class="branchname" title="' + cur[6][0] + '">';
90 90 tagspan += cur[6][0] + '</span> ';
91 91 }
92 92 if (cur[7].length) \{
93 93 for (var t in cur[7]) \{
94 94 var tag = cur[7][t];
95 95 tagspan += '<span class="tag">' + tag + '</span> ';
96 96 }
97 97 }
98 98 if (cur[8].length) \{
99 99 for (var b in cur[8]) \{
100 100 var bookmark = cur[8][b];
101 101 tagspan += '<span class="tag">' + bookmark + '</span> ';
102 102 }
103 103 }
104 104 tagspan += '</span>';
105 105 }
106 106
107 107 var item = '<li style="' + nstyle + '"><span class="desc">';
108 108 item += '<a href="{url|urlescape}rev/' + cur[0] + '{sessionvars%urlparameter}" title="' + cur[0] + '">' + cur[3] + '</a>';
109 109 item += '</span>' + tagspan + '<span class="info">' + cur[5] + ', by ' + cur[4] + '</span></li>';
110 110
111 111 return [bg, item];
112 112
113 113 }
114 114
115 115 graph.render(data);
116 116
117 117 // stop hiding script -->
118 118 </script>
119 119
120 120 <div class="navigate">
121 121 <a href="{url|urlescape}graph/{rev}{lessvars%urlparameter}">less</a>
122 122 <a href="{url|urlescape}graph/{rev}{morevars%urlparameter}">more</a>
123 123 | rev {rev}: {changenav%navgraph}
124 124 </div>
125 125
126 <script type="text/javascript">
127 ajaxScrollInit(
128 '{url|urlescape}graph/{rev}?revcount=%next%',
129 {revcount}+60,
130 function (htmlText, previousVal) \{ return previousVal + 60; },
131 '#wrapper',
132 '<div class="%class%" style="text-align: center;">%text%</div>',
133 'graph'
134 );
135 </script>
136
126 137 </div>
127 138 </div>
128 139
129 140 {footer}
@@ -1,447 +1,458 b''
1 1 $ "$TESTDIR/hghave" serve || exit 80
2 2
3 3 Some tests for hgweb in an empty repository
4 4
5 5 $ hg init test
6 6 $ cd test
7 7 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
8 8 $ cat hg.pid >> $DAEMON_PIDS
9 9 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT 'shortlog')
10 10 200 Script output follows
11 11
12 12 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
13 13 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
14 14 <head>
15 15 <link rel="icon" href="/static/hgicon.png" type="image/png" />
16 16 <meta name="robots" content="index, nofollow" />
17 17 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
18 18 <script type="text/javascript" src="/static/mercurial.js"></script>
19 19
20 20 <title>test: log</title>
21 21 <link rel="alternate" type="application/atom+xml"
22 22 href="/atom-log" title="Atom feed for test" />
23 23 <link rel="alternate" type="application/rss+xml"
24 24 href="/rss-log" title="RSS feed for test" />
25 25 </head>
26 26 <body>
27 27
28 28 <div class="container">
29 29 <div class="menu">
30 30 <div class="logo">
31 31 <a href="http://mercurial.selenic.com/">
32 32 <img src="/static/hglogo.png" alt="mercurial" /></a>
33 33 </div>
34 34 <ul>
35 35 <li class="active">log</li>
36 36 <li><a href="/graph/000000000000">graph</a></li>
37 37 <li><a href="/tags">tags</a></li>
38 38 <li><a href="/bookmarks">bookmarks</a></li>
39 39 <li><a href="/branches">branches</a></li>
40 40 </ul>
41 41 <ul>
42 42 <li><a href="/rev/000000000000">changeset</a></li>
43 43 <li><a href="/file/000000000000">browse</a></li>
44 44 </ul>
45 45 <ul>
46 46
47 47 </ul>
48 48 <ul>
49 49 <li><a href="/help">help</a></li>
50 50 </ul>
51 51 <p>
52 52 <div class="atom-logo">
53 53 <a href="/atom-log" title="subscribe to atom feed">
54 54 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="atom feed">
55 55 </a>
56 56 </div>
57 57 </div>
58 58
59 59 <div class="main">
60 60 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
61 61 <h3>log</h3>
62 62
63 63 <form class="search" action="/log">
64 64
65 65 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
66 66 <div id="hint">find changesets by author, revision,
67 67 files, or words in the commit message</div>
68 68 </form>
69 69
70 70 <div class="navigate">
71 71 <a href="/shortlog/-1?revcount=30">less</a>
72 72 <a href="/shortlog/-1?revcount=120">more</a>
73 73 | rev -1:
74 74 </div>
75 75
76 76 <table class="bigtable">
77 77 <tr>
78 78 <th class="age">age</th>
79 79 <th class="author">author</th>
80 80 <th class="description">description</th>
81 81 </tr>
82 82 <tbody class="stripes2">
83 83
84 84 </tbody>
85 85 </table>
86 86
87 87 <div class="navigate">
88 88 <a href="/shortlog/-1?revcount=30">less</a>
89 89 <a href="/shortlog/-1?revcount=120">more</a>
90 90 | rev -1:
91 91 </div>
92 92
93 93 <script type="text/javascript">
94 94 ajaxScrollInit(
95 95 '/shortlog/%next%',
96 96 '', <!-- NEXTHASH
97 97 function (htmlText, previousVal) {
98 98 var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
99 99 return m ? m[1] : null;
100 100 },
101 101 '.bigtable > tbody:nth-of-type(2)',
102 102 '<tr class="%class%">\
103 103 <td colspan="3" style="text-align: center;">%text%</td>\
104 104 </tr>'
105 105 );
106 106 </script>
107 107
108 108 </div>
109 109 </div>
110 110
111 111 <script type="text/javascript">process_dates()</script>
112 112
113 113
114 114 </body>
115 115 </html>
116 116
117 117 $ echo babar
118 118 babar
119 119 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT 'log')
120 120 200 Script output follows
121 121
122 122 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
123 123 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
124 124 <head>
125 125 <link rel="icon" href="/static/hgicon.png" type="image/png" />
126 126 <meta name="robots" content="index, nofollow" />
127 127 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
128 128 <script type="text/javascript" src="/static/mercurial.js"></script>
129 129
130 130 <title>test: log</title>
131 131 <link rel="alternate" type="application/atom+xml"
132 132 href="/atom-log" title="Atom feed for test" />
133 133 <link rel="alternate" type="application/rss+xml"
134 134 href="/rss-log" title="RSS feed for test" />
135 135 </head>
136 136 <body>
137 137
138 138 <div class="container">
139 139 <div class="menu">
140 140 <div class="logo">
141 141 <a href="http://mercurial.selenic.com/">
142 142 <img src="/static/hglogo.png" alt="mercurial" /></a>
143 143 </div>
144 144 <ul>
145 145 <li class="active">log</li>
146 146 <li><a href="/graph/000000000000">graph</a></li>
147 147 <li><a href="/tags">tags</a></li>
148 148 <li><a href="/bookmarks">bookmarks</a></li>
149 149 <li><a href="/branches">branches</a></li>
150 150 </ul>
151 151 <ul>
152 152 <li><a href="/rev/000000000000">changeset</a></li>
153 153 <li><a href="/file/000000000000">browse</a></li>
154 154 </ul>
155 155 <ul>
156 156
157 157 </ul>
158 158 <ul>
159 159 <li><a href="/help">help</a></li>
160 160 </ul>
161 161 <p>
162 162 <div class="atom-logo">
163 163 <a href="/atom-log" title="subscribe to atom feed">
164 164 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="atom feed">
165 165 </a>
166 166 </div>
167 167 </div>
168 168
169 169 <div class="main">
170 170 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
171 171 <h3>log</h3>
172 172
173 173 <form class="search" action="/log">
174 174
175 175 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
176 176 <div id="hint">find changesets by author, revision,
177 177 files, or words in the commit message</div>
178 178 </form>
179 179
180 180 <div class="navigate">
181 181 <a href="/shortlog/-1?revcount=5">less</a>
182 182 <a href="/shortlog/-1?revcount=20">more</a>
183 183 | rev -1:
184 184 </div>
185 185
186 186 <table class="bigtable">
187 187 <tr>
188 188 <th class="age">age</th>
189 189 <th class="author">author</th>
190 190 <th class="description">description</th>
191 191 </tr>
192 192 <tbody class="stripes2">
193 193
194 194 </tbody>
195 195 </table>
196 196
197 197 <div class="navigate">
198 198 <a href="/shortlog/-1?revcount=5">less</a>
199 199 <a href="/shortlog/-1?revcount=20">more</a>
200 200 | rev -1:
201 201 </div>
202 202
203 203 <script type="text/javascript">
204 204 ajaxScrollInit(
205 205 '/shortlog/%next%',
206 206 '', <!-- NEXTHASH
207 207 function (htmlText, previousVal) {
208 208 var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
209 209 return m ? m[1] : null;
210 210 },
211 211 '.bigtable > tbody:nth-of-type(2)',
212 212 '<tr class="%class%">\
213 213 <td colspan="3" style="text-align: center;">%text%</td>\
214 214 </tr>'
215 215 );
216 216 </script>
217 217
218 218 </div>
219 219 </div>
220 220
221 221 <script type="text/javascript">process_dates()</script>
222 222
223 223
224 224 </body>
225 225 </html>
226 226
227 227 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT 'graph')
228 228 200 Script output follows
229 229
230 230 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
231 231 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
232 232 <head>
233 233 <link rel="icon" href="/static/hgicon.png" type="image/png" />
234 234 <meta name="robots" content="index, nofollow" />
235 235 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
236 236 <script type="text/javascript" src="/static/mercurial.js"></script>
237 237
238 238 <title>test: revision graph</title>
239 239 <link rel="alternate" type="application/atom+xml"
240 240 href="/atom-log" title="Atom feed for test: log" />
241 241 <link rel="alternate" type="application/rss+xml"
242 242 href="/rss-log" title="RSS feed for test: log" />
243 243 <!--[if IE]><script type="text/javascript" src="/static/excanvas.js"></script><![endif]-->
244 244 </head>
245 245 <body>
246 246
247 247 <div class="container">
248 248 <div class="menu">
249 249 <div class="logo">
250 250 <a href="http://mercurial.selenic.com/">
251 251 <img src="/static/hglogo.png" alt="mercurial" /></a>
252 252 </div>
253 253 <ul>
254 254 <li><a href="/shortlog/000000000000">log</a></li>
255 255 <li class="active">graph</li>
256 256 <li><a href="/tags">tags</a></li>
257 257 <li><a href="/bookmarks">bookmarks</a></li>
258 258 <li><a href="/branches">branches</a></li>
259 259 </ul>
260 260 <ul>
261 261 <li><a href="/rev/000000000000">changeset</a></li>
262 262 <li><a href="/file/000000000000">browse</a></li>
263 263 </ul>
264 264 <ul>
265 265 <li><a href="/help">help</a></li>
266 266 </ul>
267 267 <p>
268 268 <div class="atom-logo">
269 269 <a href="/atom-log" title="subscribe to atom feed">
270 270 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="atom feed">
271 271 </a>
272 272 </div>
273 273 </div>
274 274
275 275 <div class="main">
276 276 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
277 277 <h3>graph</h3>
278 278
279 279 <form class="search" action="/log">
280 280
281 281 <p><input name="rev" id="search1" type="text" size="30" /></p>
282 282 <div id="hint">find changesets by author, revision,
283 283 files, or words in the commit message</div>
284 284 </form>
285 285
286 286 <div class="navigate">
287 287 <a href="/graph/-1?revcount=30">less</a>
288 288 <a href="/graph/-1?revcount=120">more</a>
289 289 | rev -1:
290 290 </div>
291 291
292 292 <noscript><p>The revision graph only works with JavaScript-enabled browsers.</p></noscript>
293 293
294 294 <div id="wrapper">
295 295 <ul id="nodebgs" class="stripes2"></ul>
296 296 <canvas id="graph" width="480" height="12"></canvas>
297 297 <ul id="graphnodes"></ul>
298 298 </div>
299 299
300 300 <script type="text/javascript">
301 301 <!-- hide script content
302 302
303 303 var data = [];
304 304 var graph = new Graph();
305 305 graph.scale(39);
306 306
307 307 graph.vertex = function(x, y, color, parity, cur) {
308 308
309 309 this.ctx.beginPath();
310 310 color = this.setColor(color, 0.25, 0.75);
311 311 this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
312 312 this.ctx.fill();
313 313
314 314 var bg = '<li class="bg"></li>';
315 315 var left = (this.bg_height - this.box_size) + (this.columns + 1) * this.box_size;
316 316 var nstyle = 'padding-left: ' + left + 'px;';
317 317
318 318 var tagspan = '';
319 319 if (cur[7].length || cur[8].length || (cur[6][0] != 'default' || cur[6][1])) {
320 320 tagspan = '<span class="logtags">';
321 321 if (cur[6][1]) {
322 322 tagspan += '<span class="branchhead" title="' + cur[6][0] + '">';
323 323 tagspan += cur[6][0] + '</span> ';
324 324 } else if (!cur[6][1] && cur[6][0] != 'default') {
325 325 tagspan += '<span class="branchname" title="' + cur[6][0] + '">';
326 326 tagspan += cur[6][0] + '</span> ';
327 327 }
328 328 if (cur[7].length) {
329 329 for (var t in cur[7]) {
330 330 var tag = cur[7][t];
331 331 tagspan += '<span class="tag">' + tag + '</span> ';
332 332 }
333 333 }
334 334 if (cur[8].length) {
335 335 for (var b in cur[8]) {
336 336 var bookmark = cur[8][b];
337 337 tagspan += '<span class="tag">' + bookmark + '</span> ';
338 338 }
339 339 }
340 340 tagspan += '</span>';
341 341 }
342 342
343 343 var item = '<li style="' + nstyle + '"><span class="desc">';
344 344 item += '<a href="/rev/' + cur[0] + '" title="' + cur[0] + '">' + cur[3] + '</a>';
345 345 item += '</span>' + tagspan + '<span class="info">' + cur[5] + ', by ' + cur[4] + '</span></li>';
346 346
347 347 return [bg, item];
348 348
349 349 }
350 350
351 351 graph.render(data);
352 352
353 353 // stop hiding script -->
354 354 </script>
355 355
356 356 <div class="navigate">
357 357 <a href="/graph/-1?revcount=30">less</a>
358 358 <a href="/graph/-1?revcount=120">more</a>
359 359 | rev -1:
360 360 </div>
361 361
362 <script type="text/javascript">
363 ajaxScrollInit(
364 '/graph/-1?revcount=%next%',
365 60+60,
366 function (htmlText, previousVal) { return previousVal + 60; },
367 '#wrapper',
368 '<div class="%class%" style="text-align: center;">%text%</div>',
369 'graph'
370 );
371 </script>
372
362 373 </div>
363 374 </div>
364 375
365 376 <script type="text/javascript">process_dates()</script>
366 377
367 378
368 379 </body>
369 380 </html>
370 381
371 382 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT 'file')
372 383 200 Script output follows
373 384
374 385 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
375 386 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
376 387 <head>
377 388 <link rel="icon" href="/static/hgicon.png" type="image/png" />
378 389 <meta name="robots" content="index, nofollow" />
379 390 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
380 391 <script type="text/javascript" src="/static/mercurial.js"></script>
381 392
382 393 <title>test: 000000000000 /</title>
383 394 </head>
384 395 <body>
385 396
386 397 <div class="container">
387 398 <div class="menu">
388 399 <div class="logo">
389 400 <a href="http://mercurial.selenic.com/">
390 401 <img src="/static/hglogo.png" alt="mercurial" /></a>
391 402 </div>
392 403 <ul>
393 404 <li><a href="/shortlog/000000000000">log</a></li>
394 405 <li><a href="/graph/000000000000">graph</a></li>
395 406 <li><a href="/tags">tags</a></li>
396 407 <li><a href="/bookmarks">bookmarks</a></li>
397 408 <li><a href="/branches">branches</a></li>
398 409 </ul>
399 410 <ul>
400 411 <li><a href="/rev/000000000000">changeset</a></li>
401 412 <li class="active">browse</li>
402 413 </ul>
403 414 <ul>
404 415
405 416 </ul>
406 417 <ul>
407 418 <li><a href="/help">help</a></li>
408 419 </ul>
409 420 </div>
410 421
411 422 <div class="main">
412 423 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
413 424 <h3>directory / @ -1:000000000000 <span class="tag">tip</span> </h3>
414 425
415 426 <form class="search" action="/log">
416 427
417 428 <p><input name="rev" id="search1" type="text" size="30" /></p>
418 429 <div id="hint">find changesets by author, revision,
419 430 files, or words in the commit message</div>
420 431 </form>
421 432
422 433 <table class="bigtable">
423 434 <tr>
424 435 <th class="name">name</th>
425 436 <th class="size">size</th>
426 437 <th class="permissions">permissions</th>
427 438 </tr>
428 439 <tbody class="stripes2">
429 440 <tr class="fileline">
430 441 <td class="name"><a href="/file/000000000000/">[up]</a></td>
431 442 <td class="size"></td>
432 443 <td class="permissions">drwxr-xr-x</td>
433 444 </tr>
434 445
435 446
436 447 </tbody>
437 448 </table>
438 449 </div>
439 450 </div>
440 451 <script type="text/javascript">process_dates()</script>
441 452
442 453
443 454 </body>
444 455 </html>
445 456
446 457
447 458 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now