Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Add the javascript Advanced/Basic buttons to the /finfo timeline. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | declutter-via-js |
| Files: | files | file ages | folders |
| SHA3-256: |
6eaad787a8379d2a909581b9034f7dc1 |
| User & Date: | drh 2017-11-25 21:21:57.349 |
Context
|
2017-11-26
| ||
| 00:37 | For the ellipses in timelines from three bullet characters. check-in: cef3d63c54 user: drh tags: declutter-via-js | |
|
2017-11-25
| ||
| 21:21 | Add the javascript Advanced/Basic buttons to the /finfo timeline. check-in: 6eaad787a8 user: drh tags: declutter-via-js | |
| 20:43 | On the /timeline page, begin with the "basic" view. Provide an "Advanced" button to fill in details using JS. The "basic" query parameter no longer functions. check-in: 3ede2d874f user: drh tags: declutter-via-js | |
Changes
Changes to skins/black_and_white/header.txt.
| ︙ | ︙ | |||
12 13 14 15 16 17 18 |
}
</th1></div>
</div>
<div class="mainmenu">
<th1>
html "<a href='$home$index_page'>Home</a>\n"
if {[anycap jor]} {
| | | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
}
</th1></div>
</div>
<div class="mainmenu">
<th1>
html "<a href='$home$index_page'>Home</a>\n"
if {[anycap jor]} {
html "<a href='$home/timeline'>Timeline</a>\n"
}
if {[anoncap oh]} {
html "<a href='$home/tree?ci=tip'>Files</a>\n"
}
if {[anoncap o]} {
html "<a href='$home/brlist'>Branches</a>\n"
html "<a href='$home/taglist'>Tags</a>\n"
|
| ︙ | ︙ |
Changes to skins/blitz/header.txt.
| ︙ | ︙ | |||
35 36 37 38 39 40 41 |
} else {
html "<li>"
}
html "<a href='$home$url'>$name</a></li>\n"
}
menulink $index_page Home
if {[anycap jor]} {
| | | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
} else {
html "<li>"
}
html "<a href='$home$url'>$name</a></li>\n"
}
menulink $index_page Home
if {[anycap jor]} {
menulink /timeline Timeline
}
if {[hascap oh]} {
menulink /dir?ci=tip Files
}
if {[hascap o]} {
menulink /brlist Branches
menulink /taglist Tags
|
| ︙ | ︙ |
Changes to skins/blitz_no_logo/header.txt.
| ︙ | ︙ | |||
32 33 34 35 36 37 38 |
} else {
html "<li>"
}
html "<a href='$home$url'>$name</a></li>\n"
}
menulink $index_page Home
if {[anycap jor]} {
| | | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
} else {
html "<li>"
}
html "<a href='$home$url'>$name</a></li>\n"
}
menulink $index_page Home
if {[anycap jor]} {
menulink /timeline Timeline
}
if {[hascap oh]} {
menulink /dir?ci=tip Files
}
if {[hascap o]} {
menulink /brlist Branches
menulink /taglist Tags
|
| ︙ | ︙ |
Changes to skins/bootstrap/header.txt.
| ︙ | ︙ | |||
52 53 54 55 56 57 58 |
html "<li class='active'><a href='$home/wiki'>Wiki</a></li>\n"
} else {
html "<li><a href='$home/wiki'>Wiki</a></li>\n"
}
}
if {[anycap jor]} {
if {[string compare $current_page "timeline"] == 0} {
| | | | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
html "<li class='active'><a href='$home/wiki'>Wiki</a></li>\n"
} else {
html "<li><a href='$home/wiki'>Wiki</a></li>\n"
}
}
if {[anycap jor]} {
if {[string compare $current_page "timeline"] == 0} {
html "<li class='active'><a href='$home/timeline'>Timeline</a></li>\n"
} else {
html "<li><a href='$home/timeline'>Timeline</a></li>\n"
}
}
if {[hascap oh]} {
if {[string compare [string range $current_page 0 2] "dir"] == 0} {
html "<li class='active'><a href='$home/dir?ci=tip'>Files</a></li>\n"
} else {
html "<li><a href='$home/dir?ci=tip'>Files</a></li>\n"
|
| ︙ | ︙ |
Changes to skins/default/header.txt.
| ︙ | ︙ | |||
17 18 19 20 21 22 23 |
html "<a href='$home$url' class='active'>$name</a>\n"
} else {
html "<a href='$home$url'>$name</a>\n"
}
}
menulink $index_page Home
if {[anycap jor]} {
| | | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
html "<a href='$home$url' class='active'>$name</a>\n"
} else {
html "<a href='$home$url'>$name</a>\n"
}
}
menulink $index_page Home
if {[anycap jor]} {
menulink /timeline Timeline
}
if {[hascap oh]} {
menulink /dir?ci=tip Files
}
if {[hascap o]} {
menulink /brlist Branches
menulink /taglist Tags
|
| ︙ | ︙ |
Changes to skins/eagle/header.txt.
| ︙ | ︙ | |||
96 97 98 99 100 101 102 |
proc menulink {url name} {
upvar home home
html "<a href='$home$url'>$name</a>\n"
}
menulink $index_page Home
menulink /help Help
if {[anycap jor]} {
| | | 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
proc menulink {url name} {
upvar home home
html "<a href='$home$url'>$name</a>\n"
}
menulink $index_page Home
menulink /help Help
if {[anycap jor]} {
menulink /timeline Timeline
}
if {[anoncap oh]} {
menulink /dir?ci=tip Files
}
if {[anoncap o]} {
menulink /brlist Branches
menulink /taglist Tags
|
| ︙ | ︙ |
Changes to skins/enhanced1/header.txt.
| ︙ | ︙ | |||
96 97 98 99 100 101 102 |
proc menulink {url name} {
upvar home home
html "<a href='$home$url'>$name</a>\n"
}
menulink $index_page Home
menulink /help Help
if {[anycap jor]} {
| | | 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
proc menulink {url name} {
upvar home home
html "<a href='$home$url'>$name</a>\n"
}
menulink $index_page Home
menulink /help Help
if {[anycap jor]} {
menulink /timeline Timeline
}
if {[anoncap oh]} {
menulink /dir?ci=tip Files
}
if {[anoncap o]} {
menulink /brlist Branches
menulink /taglist Tags
|
| ︙ | ︙ |
Changes to skins/khaki/header.txt.
| ︙ | ︙ | |||
10 11 12 13 14 15 16 |
}
</th1></div>
</div>
<div class="mainmenu">
<th1>
html "<a href='$home$index_page'>Home</a>\n"
if {[anycap jor]} {
| | | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
}
</th1></div>
</div>
<div class="mainmenu">
<th1>
html "<a href='$home$index_page'>Home</a>\n"
if {[anycap jor]} {
html "<a href='$home/timeline'>Timeline</a>\n"
}
if {[anoncap oh]} {
html "<a href='$home/tree?ci=tip'>Files</a>\n"
}
if {[anoncap o]} {
html "<a href='$home/brlist'>Branches</a>\n"
html "<a href='$home/taglist'>Tags</a>\n"
|
| ︙ | ︙ |
Changes to skins/original/header.txt.
| ︙ | ︙ | |||
11 12 13 14 15 16 17 |
}
</th1></div>
</div>
<div class="mainmenu">
<th1>
html "<a href='$home$index_page'>Home</a>\n"
if {[anycap jor]} {
| | | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
}
</th1></div>
</div>
<div class="mainmenu">
<th1>
html "<a href='$home$index_page'>Home</a>\n"
if {[anycap jor]} {
html "<a href='$home/timeline'>Timeline</a>\n"
}
if {[anoncap oh]} {
html "<a href='$home/tree?ci=tip'>Files</a>\n"
}
if {[anoncap o]} {
html "<a href='$home/brlist'>Branches</a>\n"
html "<a href='$home/taglist'>Tags</a>\n"
|
| ︙ | ︙ |
Changes to skins/plain_gray/header.txt.
| ︙ | ︙ | |||
8 9 10 11 12 13 14 |
}
</th1></div>
</div>
<div class="mainmenu">
<th1>
html "<a href='$home$index_page'>Home</a>\n"
if {[anycap jor]} {
| | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
}
</th1></div>
</div>
<div class="mainmenu">
<th1>
html "<a href='$home$index_page'>Home</a>\n"
if {[anycap jor]} {
html "<a href='$home/timeline'>Timeline</a>\n"
}
if {[anoncap oh]} {
html "<a href='$home/tree?ci=tip'>Files</a>\n"
}
if {[anoncap o]} {
html "<a href='$home/brlist'>Branches</a>\n"
html "<a href='$home/taglist'>Tags</a>\n"
|
| ︙ | ︙ |
Changes to skins/rounded1/header.txt.
| ︙ | ︙ | |||
12 13 14 15 16 17 18 |
}
</th1></div>
</div>
<div class="mainmenu">
<th1>
html "<a href='$home$index_page'>Home</a>\n"
if {[anycap jor]} {
| | | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
}
</th1></div>
</div>
<div class="mainmenu">
<th1>
html "<a href='$home$index_page'>Home</a>\n"
if {[anycap jor]} {
html "<a href='$home/timeline'>Timeline</a>\n"
}
if {[anoncap oh]} {
html "<a href='$home/tree?ci=tip'>Files</a>\n"
}
if {[anoncap o]} {
html "<a href='$home/brlist'>Branches</a>\n"
html "<a href='$home/taglist'>Tags</a>\n"
|
| ︙ | ︙ |
Changes to skins/xekri/header.txt.
| ︙ | ︙ | |||
100 101 102 103 104 105 106 |
html "<a href='$home$url' class='active'>$name</a>\n"
} else {
html "<a href='$home$url'>$name</a>\n"
}
}
menulink $index_page Home
if {[anycap jor]} {
| | | 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
html "<a href='$home$url' class='active'>$name</a>\n"
} else {
html "<a href='$home$url'>$name</a>\n"
}
}
menulink $index_page Home
if {[anycap jor]} {
menulink /timeline Timeline
}
if {[anoncap oh]} {
menulink /dir?ci=tip Files
}
if {[anoncap o]} {
menulink /brlist Branches
menulink /taglist Tags
|
| ︙ | ︙ |
Changes to src/finfo.c.
| ︙ | ︙ | |||
285 286 287 288 289 290 291 | ** n=NUM Show the first NUM changes only ** brbg Background color by branch name ** ubg Background color by user name ** ci=UUID Ancestors of a particular check-in ** orig=UUID If both ci and orig are supplied, only show those ** changes on a direct path from orig to ci. ** showid Show RID values for debugging | < | 285 286 287 288 289 290 291 292 293 294 295 296 297 298 |
** n=NUM Show the first NUM changes only
** brbg Background color by branch name
** ubg Background color by user name
** ci=UUID Ancestors of a particular check-in
** orig=UUID If both ci and orig are supplied, only show those
** changes on a direct path from orig to ci.
** showid Show RID values for debugging
**
** DATETIME may be "now" or "YYYY-MM-DDTHH:MM:SS.SSS". If in
** year-month-day form, it may be truncated, and it may also name a
** timezone offset from UTC as "-HH:MM" (westward) or "+HH:MM"
** (eastward). Either no timezone suffix or "Z" means UTC.
*/
void finfo_page(void){
|
| ︙ | ︙ | |||
312 313 314 315 316 317 318 |
GraphContext *pGraph;
int brBg = P("brbg")!=0;
int uBg = P("ubg")!=0;
int fDebug = atoi(PD("debug","0"));
int fShowId = P("showid")!=0;
Stmt qparent;
int iTableId = timeline_tableid();
| < | | | 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 |
GraphContext *pGraph;
int brBg = P("brbg")!=0;
int uBg = P("ubg")!=0;
int fDebug = atoi(PD("debug","0"));
int fShowId = P("showid")!=0;
Stmt qparent;
int iTableId = timeline_tableid();
int bHashBeforeComment = 0; /* Show hash before the comment */
int bHashAfterComment = 0; /* Show hash after the comment */
int bHashInDetail = 0; /* Show the hash inside the detail section */
int bShowDetail; /* Show the detail section */
int bSeparateDetail; /* Detail section in a separate column */
int eCommentFormat; /* value for timeline-comment-format */
login_check_credentials();
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
style_header("File History");
login_anonymous_available();
url_initialize(&url, "finfo");
if( brBg ) url_add_parameter(&url, "brbg", 0);
if( uBg ) url_add_parameter(&url, "ubg", 0);
baseCheckin = name_to_rid_www("ci");
zPrevDate[0] = 0;
zFilename = PD("name","");
eCommentFormat = db_get_int("timeline-comment-format", 0);
bShowDetail = (eCommentFormat & 1)==0; /* Bit 0 suppresses the comment */
bSeparateDetail = (eCommentFormat & 8)!=0;
switch( (eCommentFormat>>1)&3 ){
case 1: bHashAfterComment = 1; break;
case 2: bHashInDetail = 1; break;
default: bHashBeforeComment = 1; break;
}
fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", zFilename);
if( fnid==0 ){
@ No such file: %h(zFilename)
style_footer();
return;
}
if( g.perm.Admin ){
style_submenu_element("MLink Table", "%R/mlink?name=%t", zFilename);
}
if( baseCheckin ){
if( P("orig")!=0 ){
origCheckin = name_to_typed_rid(P("orig"),"ci");
path_shortest_stored_in_ancestor_table(origCheckin, baseCheckin);
}else{
|
| ︙ | ︙ | |||
445 446 447 448 449 450 451 |
fossil_free(zUuid);
}
}else{
blob_appendf(&title, "History of ");
hyperlinked_path(zFilename, &title, 0, "tree", "");
if( fShowId ) blob_appendf(&title, " (%d)", fnid);
}
| < | < < | < < | 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 |
fossil_free(zUuid);
}
}else{
blob_appendf(&title, "History of ");
hyperlinked_path(zFilename, &title, 0, "tree", "");
if( fShowId ) blob_appendf(&title, " (%d)", fnid);
}
style_submenu_jsbutton("Advanced", STYLE_BASIC, "reclutter()");
style_submenu_jsbutton("Basic", STYLE_CLUTTER, "declutter()");
@ <h2>%b(&title)</h2>
blob_reset(&title);
pGraph = graph_init();
@ <table id="timelineTable%d(iTableId)" class="timelineTable">
if( baseCheckin ){
db_prepare(&qparent,
"SELECT DISTINCT pid FROM mlink"
|
| ︙ | ︙ | |||
531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 |
hyperlink_to_uuid(zUuid);
}
@ <span class="timelineComment timelineCheckinComment">%W(zCom)</span>
if( bHashAfterComment && zUuid ){
hyperlink_to_uuid(zUuid);
}
if( bShowDetail ){
if( bSeparateDetail ){
if( zBgClr && zBgClr[0] ){
@ <td class="timelineTableCell timelineDetailCell"
@ style="background-color: %h(zBgClr);">
}else{
@ <td class="timelineTableCell timelineDetailCell">
}
}
cgi_printf("<span class='timelineDetail timelineCheckinDetail'>(");
if( zUuid && bHashInDetail ){
@ file: %z(href("%R/artifact/%!S",zUuid))[%S(zUuid)]</a>
if( fShowId ){
int srcId = delta_source_rid(frid);
if( srcId>0 ){
@ id: %d(frid)←%d(srcId)
| > > > | 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 |
hyperlink_to_uuid(zUuid);
}
@ <span class="timelineComment timelineCheckinComment">%W(zCom)</span>
if( bHashAfterComment && zUuid ){
hyperlink_to_uuid(zUuid);
}
if( bShowDetail ){
@ <a class='anticlutter' id='ellipsis-%d(frid)' \
@ onclick='expandEllipsis(%d(frid))'>...</a>
if( bSeparateDetail ){
if( zBgClr && zBgClr[0] ){
@ <td class="timelineTableCell timelineDetailCell"
@ style="background-color: %h(zBgClr);">
}else{
@ <td class="timelineTableCell timelineDetailCell">
}
}
cgi_printf("<span class='clutter' id='detail-%d'>", frid);
cgi_printf("<span class='timelineDetail timelineCheckinDetail'>(");
if( zUuid && bHashInDetail ){
@ file: %z(href("%R/artifact/%!S",zUuid))[%S(zUuid)]</a>
if( fShowId ){
int srcId = delta_source_rid(frid);
if( srcId>0 ){
@ id: %d(frid)←%d(srcId)
|
| ︙ | ︙ | |||
587 588 589 590 591 592 593 |
@ %z(href("%R/finfo?name=%t",zNewName))%h(zNewName)</a>
fossil_free(zNewName);
}else{
@ <b>Deleted</b>
}
}
}
| | | | | | 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 |
@ %z(href("%R/finfo?name=%t",zNewName))%h(zNewName)</a>
fossil_free(zNewName);
}else{
@ <b>Deleted</b>
}
}
}
if( g.perm.Hyperlink && zUuid ){
const char *z = zFilename;
@ <span id='links-%d(frid)'><span class='timelineExtraLinks'>
@ %z(href("%R/annotate?filename=%h&checkin=%s",z,zCkin))
@ [annotate]</a>
@ %z(href("%R/blame?filename=%h&checkin=%s",z,zCkin))
@ [blame]</a>
@ %z(href("%R/timeline?n=all&uf=%!S",zUuid))[check-ins using]</a>
if( fpid>0 ){
@ %z(href("%R/fdiff?sbs=1&v1=%!S&v2=%!S",zPUuid,zUuid))[diff]</a>
}
@ </span></span>
}
if( fDebug & FINFO_DEBUG_MLINK ){
int ii;
char *zAncLink;
@ <br />fid=%d(frid) pid=%d(fpid) mid=%d(fmid)
if( nParent>0 ){
@ parents=%d(aParent[0])
for(ii=1; ii<nParent; ii++){
@ %d(aParent[ii])
}
}
zAncLink = href("%R/finfo?name=%T&ci=%!S&debug=1",zFilename,zCkin);
@ %z(zAncLink)[ancestry]</a>
}
tag_private_status(frid);
if( bShowDetail ){
@ </span></span>
}
@ </td></tr>
}
db_finalize(&q);
db_finalize(&qparent);
if( pGraph ){
graph_finish(pGraph, 1);
|
| ︙ | ︙ |
Changes to src/timeline.c.
| ︙ | ︙ | |||
505 506 507 508 509 510 511 |
for(ii=0; ii<n; ii++){
if( z[ii]=='\n' ){
for(jj=ii+1; jj<n && z[jj]!='\n' && fossil_isspace(z[jj]); jj++){}
if( z[jj]=='\n' ) break;
}
}
z[ii] = 0;
| | | | 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 |
for(ii=0; ii<n; ii++){
if( z[ii]=='\n' ){
for(jj=ii+1; jj<n && z[jj]!='\n' && fossil_isspace(z[jj]); jj++){}
if( z[jj]=='\n' ) break;
}
}
z[ii] = 0;
cgi_printf("%W",z);
}else if( mxWikiLen>0 && blob_size(&comment)>mxWikiLen ){
Blob truncated;
blob_zero(&truncated);
blob_append(&truncated, blob_buffer(&comment), mxWikiLen);
blob_append(&truncated, "...", 3);
@ %W(blob_str(&truncated))
blob_reset(&truncated);
}else{
cgi_printf("%W",blob_str(&comment));
}
@ </span>
}
blob_reset(&comment);
if( bHashAfterComment ){
if( zType[0]=='c' ){
|
| ︙ | ︙ | |||
552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 |
}
/* Generate extra information and hyperlinks to follow the comment.
** Example: "(check-in: [abcdefg], user: drh, tags: trunk)"
*/
if( bShowDetail ){
if( bSeparateDetail ){
if( zBgClr && zBgClr[0] && rid!=selectedRid ){
@ <td class="timelineTableCell timelineDetailCell"
@ style="background-color: %h(zBgClr);">
}else{
@ <td class="timelineTableCell timelineDetailCell">
}
}
| > > | | 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 |
}
/* Generate extra information and hyperlinks to follow the comment.
** Example: "(check-in: [abcdefg], user: drh, tags: trunk)"
*/
if( bShowDetail ){
@ <a class='anticlutter' id='ellipsis-%d(rid)' \
@ onclick='expandEllipsis(%d(rid))'>...</a>
if( bSeparateDetail ){
if( zBgClr && zBgClr[0] && rid!=selectedRid ){
@ <td class="timelineTableCell timelineDetailCell"
@ style="background-color: %h(zBgClr);">
}else{
@ <td class="timelineTableCell timelineDetailCell">
}
}
cgi_printf("<span class='clutter' id='detail-%d'>", rid);
if( zType[0]=='c' ){
cgi_printf("<span class='timelineDetail timelineCheckinDetail'>(");
}else{
cgi_printf("<span class='timelineDetail'>(");
}
if( bHashInDetail ){
|
| ︙ | ︙ | |||
1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 |
@ changeDisplay('anticlutter','inline');
@ checkHeight();
@ }
@ function reclutter(){
@ changeDisplay('clutter','inline');
@ changeDisplay('anticlutter','none');
@ checkHeight();
@ }
@ var lastRow = gebi("m"+rowinfo[rowinfo.length-1].id);
@ var lastY = 0;
@ function checkHeight(){
@ var h = absoluteY(lastRow);
@ if( h!=lastY ){
@ renderGraph();
| > > > > > > > | 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 |
@ changeDisplay('anticlutter','inline');
@ checkHeight();
@ }
@ function reclutter(){
@ changeDisplay('clutter','inline');
@ changeDisplay('anticlutter','none');
@ checkHeight();
@ }
@ function expandEllipsis(id){
@ gebi("ellipsis-"+id).style.display='none';
@ gebi("detail-"+id).style.display='inline';
@ var x = gebi("links-"+id);
@ if(x) x.style.display='inline';
@ checkHeight();
@ }
@ var lastRow = gebi("m"+rowinfo[rowinfo.length-1].id);
@ var lastY = 0;
@ function checkHeight(){
@ var h = absoluteY(lastRow);
@ if( h!=lastY ){
@ renderGraph();
|
| ︙ | ︙ |