Fossil SCM
Timeline fixes: (1) Show the artifact-id for tickets, wiki, and tags in the detail section for Verbose and Compact Mode. (2) Fix the graph.js script so that it sets ellipsis callbacks even if there are not graph elements.
Commit
0ac1895c7f067bb676a1f3d9c67580031eab7786070b53dbcb1f0fe464799c73
Parent
4962fa9e33d8946…
2 files changed
+18
-13
+3
-1
+18
-13
| --- src/graph.js | ||
| +++ src/graph.js | ||
| @@ -342,22 +342,27 @@ | ||
| 342 | 342 | var h = window.innerHeight; |
| 343 | 343 | var y = absoluteY(x[0]) - h/2; |
| 344 | 344 | if( y>0 ) window.scrollTo(0, y); |
| 345 | 345 | } |
| 346 | 346 | } |
| 347 | - var lastRow = document.getElementById("m"+tx.rowinfo[tx.rowinfo.length-1].id); | |
| 348 | - var lastY = 0; | |
| 349 | - function checkHeight(){ | |
| 350 | - var h = absoluteY(lastRow); | |
| 351 | - if( h!=lastY ){ | |
| 352 | - renderGraph(); | |
| 353 | - lastY = h; | |
| 354 | - } | |
| 355 | - setTimeout(checkHeight, 1000); | |
| 356 | - } | |
| 357 | - initGraph(); | |
| 358 | - checkHeight(); | |
| 347 | + if( tx.rowinfo ){ | |
| 348 | + var lastRow = | |
| 349 | + document.getElementById("m"+tx.rowinfo[tx.rowinfo.length-1].id); | |
| 350 | + var lastY = 0; | |
| 351 | + function checkHeight(){ | |
| 352 | + var h = absoluteY(lastRow); | |
| 353 | + if( h!=lastY ){ | |
| 354 | + renderGraph(); | |
| 355 | + lastY = h; | |
| 356 | + } | |
| 357 | + setTimeout(checkHeight, 1000); | |
| 358 | + } | |
| 359 | + initGraph(); | |
| 360 | + checkHeight(); | |
| 361 | + }else{ | |
| 362 | + function checkHeight(){} | |
| 363 | + } | |
| 359 | 364 | if( tx.scrollToSelect ){ |
| 360 | 365 | scrollToSelected(); |
| 361 | 366 | } |
| 362 | 367 | |
| 363 | 368 | /* Set the onclick= attributes for elements of the "Compact" display |
| @@ -382,8 +387,8 @@ | ||
| 382 | 387 | for(i=0; 1; i++){ |
| 383 | 388 | var dataObj = document.getElementById("timeline-data-"+i); |
| 384 | 389 | if(!dataObj) break; |
| 385 | 390 | var txJson = dataObj.textContent || dataObj.innerText; |
| 386 | 391 | var tx = JSON.parse(txJson); |
| 387 | - if(tx.rowinfo) TimelineGraph(tx); | |
| 392 | + TimelineGraph(tx); | |
| 388 | 393 | } |
| 389 | 394 | }()) |
| 390 | 395 |
| --- src/graph.js | |
| +++ src/graph.js | |
| @@ -342,22 +342,27 @@ | |
| 342 | var h = window.innerHeight; |
| 343 | var y = absoluteY(x[0]) - h/2; |
| 344 | if( y>0 ) window.scrollTo(0, y); |
| 345 | } |
| 346 | } |
| 347 | var lastRow = document.getElementById("m"+tx.rowinfo[tx.rowinfo.length-1].id); |
| 348 | var lastY = 0; |
| 349 | function checkHeight(){ |
| 350 | var h = absoluteY(lastRow); |
| 351 | if( h!=lastY ){ |
| 352 | renderGraph(); |
| 353 | lastY = h; |
| 354 | } |
| 355 | setTimeout(checkHeight, 1000); |
| 356 | } |
| 357 | initGraph(); |
| 358 | checkHeight(); |
| 359 | if( tx.scrollToSelect ){ |
| 360 | scrollToSelected(); |
| 361 | } |
| 362 | |
| 363 | /* Set the onclick= attributes for elements of the "Compact" display |
| @@ -382,8 +387,8 @@ | |
| 382 | for(i=0; 1; i++){ |
| 383 | var dataObj = document.getElementById("timeline-data-"+i); |
| 384 | if(!dataObj) break; |
| 385 | var txJson = dataObj.textContent || dataObj.innerText; |
| 386 | var tx = JSON.parse(txJson); |
| 387 | if(tx.rowinfo) TimelineGraph(tx); |
| 388 | } |
| 389 | }()) |
| 390 |
| --- src/graph.js | |
| +++ src/graph.js | |
| @@ -342,22 +342,27 @@ | |
| 342 | var h = window.innerHeight; |
| 343 | var y = absoluteY(x[0]) - h/2; |
| 344 | if( y>0 ) window.scrollTo(0, y); |
| 345 | } |
| 346 | } |
| 347 | if( tx.rowinfo ){ |
| 348 | var lastRow = |
| 349 | document.getElementById("m"+tx.rowinfo[tx.rowinfo.length-1].id); |
| 350 | var lastY = 0; |
| 351 | function checkHeight(){ |
| 352 | var h = absoluteY(lastRow); |
| 353 | if( h!=lastY ){ |
| 354 | renderGraph(); |
| 355 | lastY = h; |
| 356 | } |
| 357 | setTimeout(checkHeight, 1000); |
| 358 | } |
| 359 | initGraph(); |
| 360 | checkHeight(); |
| 361 | }else{ |
| 362 | function checkHeight(){} |
| 363 | } |
| 364 | if( tx.scrollToSelect ){ |
| 365 | scrollToSelected(); |
| 366 | } |
| 367 | |
| 368 | /* Set the onclick= attributes for elements of the "Compact" display |
| @@ -382,8 +387,8 @@ | |
| 387 | for(i=0; 1; i++){ |
| 388 | var dataObj = document.getElementById("timeline-data-"+i); |
| 389 | if(!dataObj) break; |
| 390 | var txJson = dataObj.textContent || dataObj.innerText; |
| 391 | var tx = JSON.parse(txJson); |
| 392 | TimelineGraph(tx); |
| 393 | } |
| 394 | }()) |
| 395 |
+3
-1
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -529,11 +529,11 @@ | ||
| 529 | 529 | |
| 530 | 530 | /* Generate extra information and hyperlinks to follow the comment. |
| 531 | 531 | ** Example: "(check-in: [abcdefg], user: drh, tags: trunk)" |
| 532 | 532 | */ |
| 533 | 533 | if( drawDetailEllipsis ){ |
| 534 | - @ <span class='timelineEllipsis' id='ellipsis-%d(rid)'\ | |
| 534 | + @ <span class='timelineEllipsis' id='ellipsis-%d(rid)' \ | |
| 535 | 535 | @ data-id='%d(rid)'>...</span> |
| 536 | 536 | } |
| 537 | 537 | if( tmFlags & TIMELINE_COLUMNAR ){ |
| 538 | 538 | if( !isSelectedOrCurrent ){ |
| 539 | 539 | @ <td class="timelineDetailCell" id='md%d(gidx)'> |
| @@ -565,10 +565,12 @@ | ||
| 565 | 565 | cgi_printf("technote: "); |
| 566 | 566 | hyperlink_to_event_tagid(tagid<0?-tagid:tagid); |
| 567 | 567 | }else{ |
| 568 | 568 | cgi_printf("artifact: %z%S</a> ",href("%R/info/%!S",zUuid),zUuid); |
| 569 | 569 | } |
| 570 | + }else if( zType[0]=='g' || zType[0]=='w' || zType[0]=='t' ){ | |
| 571 | + cgi_printf("artifact: %z%S</a> ",href("%R/info/%!S",zUuid),zUuid); | |
| 570 | 572 | } |
| 571 | 573 | |
| 572 | 574 | if( g.perm.Hyperlink && fossil_strcmp(zDispUser, zThisUser)!=0 ){ |
| 573 | 575 | char *zLink = mprintf("%R/timeline?u=%h&c=%t&nd&n=200", zDispUser, zDate); |
| 574 | 576 | cgi_printf("user: %z%h</a>", href("%z",zLink), zDispUser); |
| 575 | 577 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -529,11 +529,11 @@ | |
| 529 | |
| 530 | /* Generate extra information and hyperlinks to follow the comment. |
| 531 | ** Example: "(check-in: [abcdefg], user: drh, tags: trunk)" |
| 532 | */ |
| 533 | if( drawDetailEllipsis ){ |
| 534 | @ <span class='timelineEllipsis' id='ellipsis-%d(rid)'\ |
| 535 | @ data-id='%d(rid)'>...</span> |
| 536 | } |
| 537 | if( tmFlags & TIMELINE_COLUMNAR ){ |
| 538 | if( !isSelectedOrCurrent ){ |
| 539 | @ <td class="timelineDetailCell" id='md%d(gidx)'> |
| @@ -565,10 +565,12 @@ | |
| 565 | cgi_printf("technote: "); |
| 566 | hyperlink_to_event_tagid(tagid<0?-tagid:tagid); |
| 567 | }else{ |
| 568 | cgi_printf("artifact: %z%S</a> ",href("%R/info/%!S",zUuid),zUuid); |
| 569 | } |
| 570 | } |
| 571 | |
| 572 | if( g.perm.Hyperlink && fossil_strcmp(zDispUser, zThisUser)!=0 ){ |
| 573 | char *zLink = mprintf("%R/timeline?u=%h&c=%t&nd&n=200", zDispUser, zDate); |
| 574 | cgi_printf("user: %z%h</a>", href("%z",zLink), zDispUser); |
| 575 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -529,11 +529,11 @@ | |
| 529 | |
| 530 | /* Generate extra information and hyperlinks to follow the comment. |
| 531 | ** Example: "(check-in: [abcdefg], user: drh, tags: trunk)" |
| 532 | */ |
| 533 | if( drawDetailEllipsis ){ |
| 534 | @ <span class='timelineEllipsis' id='ellipsis-%d(rid)' \ |
| 535 | @ data-id='%d(rid)'>...</span> |
| 536 | } |
| 537 | if( tmFlags & TIMELINE_COLUMNAR ){ |
| 538 | if( !isSelectedOrCurrent ){ |
| 539 | @ <td class="timelineDetailCell" id='md%d(gidx)'> |
| @@ -565,10 +565,12 @@ | |
| 565 | cgi_printf("technote: "); |
| 566 | hyperlink_to_event_tagid(tagid<0?-tagid:tagid); |
| 567 | }else{ |
| 568 | cgi_printf("artifact: %z%S</a> ",href("%R/info/%!S",zUuid),zUuid); |
| 569 | } |
| 570 | }else if( zType[0]=='g' || zType[0]=='w' || zType[0]=='t' ){ |
| 571 | cgi_printf("artifact: %z%S</a> ",href("%R/info/%!S",zUuid),zUuid); |
| 572 | } |
| 573 | |
| 574 | if( g.perm.Hyperlink && fossil_strcmp(zDispUser, zThisUser)!=0 ){ |
| 575 | char *zLink = mprintf("%R/timeline?u=%h&c=%t&nd&n=200", zDispUser, zDate); |
| 576 | cgi_printf("user: %z%h</a>", href("%z",zLink), zDispUser); |
| 577 |