##// END OF EJS Templates
hgweb: update canvas.width before dynamically redrawing graph (issue2683)...
hgweb: update canvas.width before dynamically redrawing graph (issue2683) After 91ac8cb79125 graph canvas width is decided once on the initial rendering. However, after graph page gets scrolled down to load more, it might need more horizontal space to draw, so it needs to resize the canvas dynamically. The exact problem that this patch solves can be seen using: hg init testfork cd testfork echo 0 > foo hg ci -Am0 echo 1 > foo hg ci -m1 hg up 0 echo 2 > foo hg ci -m2 hg gl -T '{rev}\n' @ 2 | | o 1 |/ o 0 hg serve And then by navigating to http://127.0.0.1:8000/graph/tip?revcount=1 "revcount=1" makes sure the initial graph contains only revision 2. And because the initial canvas width takes only that one revision into count, after the (immediate) AJAX update revision 1 will be cut off from the graph. We can safely set canvas width to the new value we get from the AJAX request because every time graph is updated, it is completely redrawn using all the requested nodes (in the case above it will use /graph/2?revcount=61), so the value is guaranteed not to decrease. P.S.: Sorry for parsing HTML with regexes, but I didn't start it.

File last commit:

r25605:dd893046 default
r27934:1779ff74 stable
Show More
filelog.tmpl
44 lines | 1.7 KiB | application/x-cheetah | CheetahLexer
Dan Villiom Podlaski Christiansen
setup: install translation files as package data...
r9999 {header}
<title>{repo|escape}: File revisions</title>
<link rel="alternate" type="application/atom+xml"
Thomas Arendsen Hein
hgweb: urlescape all urls, HTML escape repo/tag/branch/... names...
r18526 href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
Dan Villiom Podlaski Christiansen
setup: install translation files as package data...
r9999 <link rel="alternate" type="application/rss+xml"
Thomas Arendsen Hein
hgweb: urlescape all urls, HTML escape repo/tag/branch/... names...
r18526 href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
Dan Villiom Podlaski Christiansen
setup: install translation files as package data...
r9999 </head>
<body>
<div class="page_header">
Angel Ezquerra <angel.ezquerra at gmail.com>
hgweb: add a "URL breadcrumb" to the index and repository pages...
r18258 <a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
<a href="/">Mercurial</a> {pathdef%breadcrumb} / file revisions
Dan Villiom Podlaski Christiansen
setup: install translation files as package data...
r9999 </div>
<div class="page_nav">
Thomas Arendsen Hein
hgweb: urlescape all urls, HTML escape repo/tag/branch/... names...
r18526 <a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a> |
<a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a> |
<a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a> |
<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a> |
<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
<a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
av6
hgweb: don't dereference symbolic revision in gitweb style...
r25605 <a href="{url|urlescape}file/{symrev}/{file|urlescape}{sessionvars%urlparameter}">file</a> |
Dan Villiom Podlaski Christiansen
setup: install translation files as package data...
r9999 revisions |
av6
hgweb: don't dereference symbolic revision in gitweb style...
r25605 <a href="{url|urlescape}annotate/{symrev}/{file|urlescape}{sessionvars%urlparameter}">annotate</a> |
<a href="{url|urlescape}diff/{symrev}/{file|urlescape}{sessionvars%urlparameter}">diff</a> |
<a href="{url|urlescape}comparison/{symrev}/{file|urlescape}{sessionvars%urlparameter}">comparison</a> |
Thomas Arendsen Hein
hgweb: urlescape all urls, HTML escape repo/tag/branch/... names...
r18526 <a href="{url|urlescape}rss-log/tip/{file|urlescape}">rss</a> |
<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
Dan Villiom Podlaski Christiansen
setup: install translation files as package data...
r9999 <br/>
Nicolas Dumazet
hgweb: changenav: separate pages before and after the current position...
r10254 {nav%filenav}
Dan Villiom Podlaski Christiansen
setup: install translation files as package data...
r9999 </div>
<div class="title" >{file|urlescape}</div>
<table>
{entries%filelogentry}
</table>
<div class="page_nav">
Nicolas Dumazet
hgweb: changenav: separate pages before and after the current position...
r10254 {nav%filenav}
Dan Villiom Podlaski Christiansen
setup: install translation files as package data...
r9999 </div>
{footer}