Fossil SCM
Avoid drawing two consecutive ellpses when the timeline comment has been truncated.
Commit
d1aa1e6275c21184518fb09547acdfb6a8897f17bd111504e2ef1ebc7f31ad4c
Parent
6e9748b6a8f39d7…
2 files changed
+2
-2
+22
-15
+2
-2
| --- src/finfo.c | ||
| +++ src/finfo.c | ||
| @@ -522,18 +522,18 @@ | ||
| 522 | 522 | } |
| 523 | 523 | if( bHashBeforeComment && zUuid ){ |
| 524 | 524 | hyperlink_to_uuid(zUuid); |
| 525 | 525 | } |
| 526 | 526 | @ <span class="timelineComment timelineCheckinComment" \ |
| 527 | - @ onclick='toggleEllipsis(%d(frid))'> | |
| 527 | + @ onclick='toggleDetail(%d(frid))'> | |
| 528 | 528 | @ %W(zCom)</span> |
| 529 | 529 | if( bHashAfterComment && zUuid ){ |
| 530 | 530 | hyperlink_to_uuid(zUuid); |
| 531 | 531 | } |
| 532 | 532 | if( bShowDetail ){ |
| 533 | 533 | @ <span class='timelineEllipsis anticlutter' id='ellipsis-%d(frid)' \ |
| 534 | - @ onclick='expandEllipsis(%d(frid))'>...</span> | |
| 534 | + @ onclick='toggleDetail(%d(frid))'>...</span> | |
| 535 | 535 | if( bSeparateDetail ){ |
| 536 | 536 | if( zBgClr && zBgClr[0] ){ |
| 537 | 537 | @ <td class="timelineTableCell timelineDetailCell" |
| 538 | 538 | @ style="background-color: %h(zBgClr);"> |
| 539 | 539 | }else{ |
| 540 | 540 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -522,18 +522,18 @@ | |
| 522 | } |
| 523 | if( bHashBeforeComment && zUuid ){ |
| 524 | hyperlink_to_uuid(zUuid); |
| 525 | } |
| 526 | @ <span class="timelineComment timelineCheckinComment" \ |
| 527 | @ onclick='toggleEllipsis(%d(frid))'> |
| 528 | @ %W(zCom)</span> |
| 529 | if( bHashAfterComment && zUuid ){ |
| 530 | hyperlink_to_uuid(zUuid); |
| 531 | } |
| 532 | if( bShowDetail ){ |
| 533 | @ <span class='timelineEllipsis anticlutter' id='ellipsis-%d(frid)' \ |
| 534 | @ onclick='expandEllipsis(%d(frid))'>...</span> |
| 535 | if( bSeparateDetail ){ |
| 536 | if( zBgClr && zBgClr[0] ){ |
| 537 | @ <td class="timelineTableCell timelineDetailCell" |
| 538 | @ style="background-color: %h(zBgClr);"> |
| 539 | }else{ |
| 540 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -522,18 +522,18 @@ | |
| 522 | } |
| 523 | if( bHashBeforeComment && zUuid ){ |
| 524 | hyperlink_to_uuid(zUuid); |
| 525 | } |
| 526 | @ <span class="timelineComment timelineCheckinComment" \ |
| 527 | @ onclick='toggleDetail(%d(frid))'> |
| 528 | @ %W(zCom)</span> |
| 529 | if( bHashAfterComment && zUuid ){ |
| 530 | hyperlink_to_uuid(zUuid); |
| 531 | } |
| 532 | if( bShowDetail ){ |
| 533 | @ <span class='timelineEllipsis anticlutter' id='ellipsis-%d(frid)' \ |
| 534 | @ onclick='toggleDetail(%d(frid))'>...</span> |
| 535 | if( bSeparateDetail ){ |
| 536 | if( zBgClr && zBgClr[0] ){ |
| 537 | @ <td class="timelineTableCell timelineDetailCell" |
| 538 | @ style="background-color: %h(zBgClr);"> |
| 539 | }else{ |
| 540 |
+22
-15
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -304,10 +304,11 @@ | ||
| 304 | 304 | const char *zDispUser = zUser && zUser[0] ? zUser : "anonymous"; |
| 305 | 305 | const char *zBr = 0; /* Branch */ |
| 306 | 306 | int commentColumn = 3; /* Column containing comment text */ |
| 307 | 307 | int modPending; /* Pending moderation */ |
| 308 | 308 | char *zDateLink; /* URL for the link on the timestamp */ |
| 309 | + int drawDetailEllipsis = 1; /* True to show ellipsis in place of detail */ | |
| 309 | 310 | char zTime[20]; |
| 310 | 311 | |
| 311 | 312 | if( zDate==0 ){ |
| 312 | 313 | zDate = "YYYY-MM-DD HH:MM:SS"; /* Something wrong with the repo */ |
| 313 | 314 | } |
| @@ -490,16 +491,16 @@ | ||
| 490 | 491 | } |
| 491 | 492 | db_column_blob(pQuery, commentColumn, &comment); |
| 492 | 493 | if( zType[0]!='c' ){ |
| 493 | 494 | /* Comments for anything other than a check-in are generated by |
| 494 | 495 | ** "fossil rebuild" and expect to be rendered as text/x-fossil-wiki */ |
| 495 | - @ <span class='timelineComment' onclick='toggleEllipsis(%d(rid))'> | |
| 496 | + @ <span class='timelineComment' onclick='toggleDetail(%d(rid))'> | |
| 496 | 497 | wiki_convert(&comment, 0, WIKI_INLINE); |
| 497 | 498 | @ </span> |
| 498 | 499 | }else{ |
| 499 | 500 | @ <span class='timelineComment timelineCheckinComment' \ |
| 500 | - @ onclick='toggleEllipsis(%d(rid))'> | |
| 501 | + @ onclick='toggleDetail(%d(rid))'> | |
| 501 | 502 | if( bCommentGitStyle ){ |
| 502 | 503 | /* Truncate comment at first blank line */ |
| 503 | 504 | int ii, jj; |
| 504 | 505 | int n = blob_size(&comment); |
| 505 | 506 | char *z = blob_str(&comment); |
| @@ -516,10 +517,11 @@ | ||
| 516 | 517 | blob_zero(&truncated); |
| 517 | 518 | blob_append(&truncated, blob_buffer(&comment), mxWikiLen); |
| 518 | 519 | blob_append(&truncated, "...", 3); |
| 519 | 520 | @ %W(blob_str(&truncated)) |
| 520 | 521 | blob_reset(&truncated); |
| 522 | + drawDetailEllipsis = 0; | |
| 521 | 523 | }else{ |
| 522 | 524 | cgi_printf("%W",blob_str(&comment)); |
| 523 | 525 | } |
| 524 | 526 | @ </span> |
| 525 | 527 | } |
| @@ -548,19 +550,22 @@ | ||
| 548 | 550 | @ (%d(rid)←%d(srcId)) |
| 549 | 551 | }else{ |
| 550 | 552 | @ (%d(rid)) |
| 551 | 553 | } |
| 552 | 554 | } |
| 555 | + drawDetailEllipsis = 1; | |
| 553 | 556 | } |
| 554 | 557 | |
| 555 | 558 | |
| 556 | 559 | /* Generate extra information and hyperlinks to follow the comment. |
| 557 | 560 | ** Example: "(check-in: [abcdefg], user: drh, tags: trunk)" |
| 558 | 561 | */ |
| 559 | 562 | if( bShowDetail ){ |
| 560 | - @ <span class='timelineEllipsis anticlutter' id='ellipsis-%d(rid)' \ | |
| 561 | - @ onclick='toggleEllipsis(%d(rid))'>...</span> | |
| 563 | + if( drawDetailEllipsis ){ | |
| 564 | + @ <span class='timelineEllipsis anticlutter' id='ellipsis-%d(rid)' \ | |
| 565 | + @ onclick='toggleDetail(%d(rid))'>...</span> | |
| 566 | + } | |
| 562 | 567 | if( bSeparateDetail ){ |
| 563 | 568 | if( zBgClr && zBgClr[0] && rid!=selectedRid ){ |
| 564 | 569 | @ <td class="timelineTableCell timelineDetailCell" |
| 565 | 570 | @ style="background-color: %h(zBgClr);"> |
| 566 | 571 | }else{ |
| @@ -1158,22 +1163,24 @@ | ||
| 1158 | 1163 | @ function reclutter(){ |
| 1159 | 1164 | @ changeDisplay('clutter','inline'); |
| 1160 | 1165 | @ changeDisplay('anticlutter','none'); |
| 1161 | 1166 | @ checkHeight(); |
| 1162 | 1167 | @ } |
| 1163 | - @ function toggleEllipsis(id){ | |
| 1164 | - @ var x = gebi("ellipsis-"+id); | |
| 1165 | - @ if( x.style.display=='none' ){ | |
| 1166 | - @ x.style.display='inline'; | |
| 1167 | - @ gebi("detail-"+id).style.display='none'; | |
| 1168 | - @ x = document.getElementById("links-"+id); | |
| 1169 | - @ if(x) x.style.display='none'; | |
| 1168 | + @ function changeDisplayById(id,value){ | |
| 1169 | + @ var x = document.getElementById(id); | |
| 1170 | + @ if(x) x.style.display=value; | |
| 1171 | + @ } | |
| 1172 | + @ function toggleDetail(id){ | |
| 1173 | + @ var x = gebi("detail-"+id); | |
| 1174 | + @ if( x.style.display=="inline" ){ | |
| 1175 | + @ x.style.display="none"; | |
| 1176 | + @ changeDisplayById("ellipsis-"+id,"inline"); | |
| 1177 | + @ changeDisplayById("links-"+id,"none"); | |
| 1170 | 1178 | @ }else{ |
| 1171 | - @ x.style.display='none'; | |
| 1172 | - @ gebi("detail-"+id).style.display='inline'; | |
| 1173 | - @ x = document.getElementById("links-"+id); | |
| 1174 | - @ if(x) x.style.display='inline'; | |
| 1179 | + @ x.style.display="inline"; | |
| 1180 | + @ changeDisplayById("ellipsis-"+id,"none"); | |
| 1181 | + @ changeDisplayById("links-"+id,"inline"); | |
| 1175 | 1182 | @ } |
| 1176 | 1183 | @ checkHeight(); |
| 1177 | 1184 | @ } |
| 1178 | 1185 | @ function scrollToSelected(){ |
| 1179 | 1186 | @ var x = document.getElementsByClassName('timelineSelected'); |
| 1180 | 1187 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -304,10 +304,11 @@ | |
| 304 | const char *zDispUser = zUser && zUser[0] ? zUser : "anonymous"; |
| 305 | const char *zBr = 0; /* Branch */ |
| 306 | int commentColumn = 3; /* Column containing comment text */ |
| 307 | int modPending; /* Pending moderation */ |
| 308 | char *zDateLink; /* URL for the link on the timestamp */ |
| 309 | char zTime[20]; |
| 310 | |
| 311 | if( zDate==0 ){ |
| 312 | zDate = "YYYY-MM-DD HH:MM:SS"; /* Something wrong with the repo */ |
| 313 | } |
| @@ -490,16 +491,16 @@ | |
| 490 | } |
| 491 | db_column_blob(pQuery, commentColumn, &comment); |
| 492 | if( zType[0]!='c' ){ |
| 493 | /* Comments for anything other than a check-in are generated by |
| 494 | ** "fossil rebuild" and expect to be rendered as text/x-fossil-wiki */ |
| 495 | @ <span class='timelineComment' onclick='toggleEllipsis(%d(rid))'> |
| 496 | wiki_convert(&comment, 0, WIKI_INLINE); |
| 497 | @ </span> |
| 498 | }else{ |
| 499 | @ <span class='timelineComment timelineCheckinComment' \ |
| 500 | @ onclick='toggleEllipsis(%d(rid))'> |
| 501 | if( bCommentGitStyle ){ |
| 502 | /* Truncate comment at first blank line */ |
| 503 | int ii, jj; |
| 504 | int n = blob_size(&comment); |
| 505 | char *z = blob_str(&comment); |
| @@ -516,10 +517,11 @@ | |
| 516 | blob_zero(&truncated); |
| 517 | blob_append(&truncated, blob_buffer(&comment), mxWikiLen); |
| 518 | blob_append(&truncated, "...", 3); |
| 519 | @ %W(blob_str(&truncated)) |
| 520 | blob_reset(&truncated); |
| 521 | }else{ |
| 522 | cgi_printf("%W",blob_str(&comment)); |
| 523 | } |
| 524 | @ </span> |
| 525 | } |
| @@ -548,19 +550,22 @@ | |
| 548 | @ (%d(rid)←%d(srcId)) |
| 549 | }else{ |
| 550 | @ (%d(rid)) |
| 551 | } |
| 552 | } |
| 553 | } |
| 554 | |
| 555 | |
| 556 | /* Generate extra information and hyperlinks to follow the comment. |
| 557 | ** Example: "(check-in: [abcdefg], user: drh, tags: trunk)" |
| 558 | */ |
| 559 | if( bShowDetail ){ |
| 560 | @ <span class='timelineEllipsis anticlutter' id='ellipsis-%d(rid)' \ |
| 561 | @ onclick='toggleEllipsis(%d(rid))'>...</span> |
| 562 | if( bSeparateDetail ){ |
| 563 | if( zBgClr && zBgClr[0] && rid!=selectedRid ){ |
| 564 | @ <td class="timelineTableCell timelineDetailCell" |
| 565 | @ style="background-color: %h(zBgClr);"> |
| 566 | }else{ |
| @@ -1158,22 +1163,24 @@ | |
| 1158 | @ function reclutter(){ |
| 1159 | @ changeDisplay('clutter','inline'); |
| 1160 | @ changeDisplay('anticlutter','none'); |
| 1161 | @ checkHeight(); |
| 1162 | @ } |
| 1163 | @ function toggleEllipsis(id){ |
| 1164 | @ var x = gebi("ellipsis-"+id); |
| 1165 | @ if( x.style.display=='none' ){ |
| 1166 | @ x.style.display='inline'; |
| 1167 | @ gebi("detail-"+id).style.display='none'; |
| 1168 | @ x = document.getElementById("links-"+id); |
| 1169 | @ if(x) x.style.display='none'; |
| 1170 | @ }else{ |
| 1171 | @ x.style.display='none'; |
| 1172 | @ gebi("detail-"+id).style.display='inline'; |
| 1173 | @ x = document.getElementById("links-"+id); |
| 1174 | @ if(x) x.style.display='inline'; |
| 1175 | @ } |
| 1176 | @ checkHeight(); |
| 1177 | @ } |
| 1178 | @ function scrollToSelected(){ |
| 1179 | @ var x = document.getElementsByClassName('timelineSelected'); |
| 1180 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -304,10 +304,11 @@ | |
| 304 | const char *zDispUser = zUser && zUser[0] ? zUser : "anonymous"; |
| 305 | const char *zBr = 0; /* Branch */ |
| 306 | int commentColumn = 3; /* Column containing comment text */ |
| 307 | int modPending; /* Pending moderation */ |
| 308 | char *zDateLink; /* URL for the link on the timestamp */ |
| 309 | int drawDetailEllipsis = 1; /* True to show ellipsis in place of detail */ |
| 310 | char zTime[20]; |
| 311 | |
| 312 | if( zDate==0 ){ |
| 313 | zDate = "YYYY-MM-DD HH:MM:SS"; /* Something wrong with the repo */ |
| 314 | } |
| @@ -490,16 +491,16 @@ | |
| 491 | } |
| 492 | db_column_blob(pQuery, commentColumn, &comment); |
| 493 | if( zType[0]!='c' ){ |
| 494 | /* Comments for anything other than a check-in are generated by |
| 495 | ** "fossil rebuild" and expect to be rendered as text/x-fossil-wiki */ |
| 496 | @ <span class='timelineComment' onclick='toggleDetail(%d(rid))'> |
| 497 | wiki_convert(&comment, 0, WIKI_INLINE); |
| 498 | @ </span> |
| 499 | }else{ |
| 500 | @ <span class='timelineComment timelineCheckinComment' \ |
| 501 | @ onclick='toggleDetail(%d(rid))'> |
| 502 | if( bCommentGitStyle ){ |
| 503 | /* Truncate comment at first blank line */ |
| 504 | int ii, jj; |
| 505 | int n = blob_size(&comment); |
| 506 | char *z = blob_str(&comment); |
| @@ -516,10 +517,11 @@ | |
| 517 | blob_zero(&truncated); |
| 518 | blob_append(&truncated, blob_buffer(&comment), mxWikiLen); |
| 519 | blob_append(&truncated, "...", 3); |
| 520 | @ %W(blob_str(&truncated)) |
| 521 | blob_reset(&truncated); |
| 522 | drawDetailEllipsis = 0; |
| 523 | }else{ |
| 524 | cgi_printf("%W",blob_str(&comment)); |
| 525 | } |
| 526 | @ </span> |
| 527 | } |
| @@ -548,19 +550,22 @@ | |
| 550 | @ (%d(rid)←%d(srcId)) |
| 551 | }else{ |
| 552 | @ (%d(rid)) |
| 553 | } |
| 554 | } |
| 555 | drawDetailEllipsis = 1; |
| 556 | } |
| 557 | |
| 558 | |
| 559 | /* Generate extra information and hyperlinks to follow the comment. |
| 560 | ** Example: "(check-in: [abcdefg], user: drh, tags: trunk)" |
| 561 | */ |
| 562 | if( bShowDetail ){ |
| 563 | if( drawDetailEllipsis ){ |
| 564 | @ <span class='timelineEllipsis anticlutter' id='ellipsis-%d(rid)' \ |
| 565 | @ onclick='toggleDetail(%d(rid))'>...</span> |
| 566 | } |
| 567 | if( bSeparateDetail ){ |
| 568 | if( zBgClr && zBgClr[0] && rid!=selectedRid ){ |
| 569 | @ <td class="timelineTableCell timelineDetailCell" |
| 570 | @ style="background-color: %h(zBgClr);"> |
| 571 | }else{ |
| @@ -1158,22 +1163,24 @@ | |
| 1163 | @ function reclutter(){ |
| 1164 | @ changeDisplay('clutter','inline'); |
| 1165 | @ changeDisplay('anticlutter','none'); |
| 1166 | @ checkHeight(); |
| 1167 | @ } |
| 1168 | @ function changeDisplayById(id,value){ |
| 1169 | @ var x = document.getElementById(id); |
| 1170 | @ if(x) x.style.display=value; |
| 1171 | @ } |
| 1172 | @ function toggleDetail(id){ |
| 1173 | @ var x = gebi("detail-"+id); |
| 1174 | @ if( x.style.display=="inline" ){ |
| 1175 | @ x.style.display="none"; |
| 1176 | @ changeDisplayById("ellipsis-"+id,"inline"); |
| 1177 | @ changeDisplayById("links-"+id,"none"); |
| 1178 | @ }else{ |
| 1179 | @ x.style.display="inline"; |
| 1180 | @ changeDisplayById("ellipsis-"+id,"none"); |
| 1181 | @ changeDisplayById("links-"+id,"inline"); |
| 1182 | @ } |
| 1183 | @ checkHeight(); |
| 1184 | @ } |
| 1185 | @ function scrollToSelected(){ |
| 1186 | @ var x = document.getElementsByClassName('timelineSelected'); |
| 1187 |