Fossil SCM

Avoid drawing two consecutive ellpses when the timeline comment has been truncated.

drh 2017-11-26 23:53 trunk
Commit d1aa1e6275c21184518fb09547acdfb6a8897f17bd111504e2ef1ebc7f31ad4c
2 files changed +2 -2 +22 -15
+2 -2
--- src/finfo.c
+++ src/finfo.c
@@ -522,18 +522,18 @@
522522
}
523523
if( bHashBeforeComment && zUuid ){
524524
hyperlink_to_uuid(zUuid);
525525
}
526526
@ <span class="timelineComment timelineCheckinComment" \
527
- @ onclick='toggleEllipsis(%d(frid))'>
527
+ @ onclick='toggleDetail(%d(frid))'>
528528
@ %W(zCom)</span>
529529
if( bHashAfterComment && zUuid ){
530530
hyperlink_to_uuid(zUuid);
531531
}
532532
if( bShowDetail ){
533533
@ <span class='timelineEllipsis anticlutter' id='ellipsis-%d(frid)' \
534
- @ onclick='expandEllipsis(%d(frid))'>...</span>
534
+ @ onclick='toggleDetail(%d(frid))'>...</span>
535535
if( bSeparateDetail ){
536536
if( zBgClr && zBgClr[0] ){
537537
@ <td class="timelineTableCell timelineDetailCell"
538538
@ style="background-color: %h(zBgClr);">
539539
}else{
540540
--- 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 @@
304304
const char *zDispUser = zUser && zUser[0] ? zUser : "anonymous";
305305
const char *zBr = 0; /* Branch */
306306
int commentColumn = 3; /* Column containing comment text */
307307
int modPending; /* Pending moderation */
308308
char *zDateLink; /* URL for the link on the timestamp */
309
+ int drawDetailEllipsis = 1; /* True to show ellipsis in place of detail */
309310
char zTime[20];
310311
311312
if( zDate==0 ){
312313
zDate = "YYYY-MM-DD HH:MM:SS"; /* Something wrong with the repo */
313314
}
@@ -490,16 +491,16 @@
490491
}
491492
db_column_blob(pQuery, commentColumn, &comment);
492493
if( zType[0]!='c' ){
493494
/* Comments for anything other than a check-in are generated by
494495
** "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))'>
496497
wiki_convert(&comment, 0, WIKI_INLINE);
497498
@ </span>
498499
}else{
499500
@ <span class='timelineComment timelineCheckinComment' \
500
- @ onclick='toggleEllipsis(%d(rid))'>
501
+ @ onclick='toggleDetail(%d(rid))'>
501502
if( bCommentGitStyle ){
502503
/* Truncate comment at first blank line */
503504
int ii, jj;
504505
int n = blob_size(&comment);
505506
char *z = blob_str(&comment);
@@ -516,10 +517,11 @@
516517
blob_zero(&truncated);
517518
blob_append(&truncated, blob_buffer(&comment), mxWikiLen);
518519
blob_append(&truncated, "...", 3);
519520
@ %W(blob_str(&truncated))
520521
blob_reset(&truncated);
522
+ drawDetailEllipsis = 0;
521523
}else{
522524
cgi_printf("%W",blob_str(&comment));
523525
}
524526
@ </span>
525527
}
@@ -548,19 +550,22 @@
548550
@ (%d(rid)&larr;%d(srcId))
549551
}else{
550552
@ (%d(rid))
551553
}
552554
}
555
+ drawDetailEllipsis = 1;
553556
}
554557
555558
556559
/* Generate extra information and hyperlinks to follow the comment.
557560
** Example: "(check-in: [abcdefg], user: drh, tags: trunk)"
558561
*/
559562
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
+ }
562567
if( bSeparateDetail ){
563568
if( zBgClr && zBgClr[0] && rid!=selectedRid ){
564569
@ <td class="timelineTableCell timelineDetailCell"
565570
@ style="background-color: %h(zBgClr);">
566571
}else{
@@ -1158,22 +1163,24 @@
11581163
@ function reclutter(){
11591164
@ changeDisplay('clutter','inline');
11601165
@ changeDisplay('anticlutter','none');
11611166
@ checkHeight();
11621167
@ }
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");
11701178
@ }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");
11751182
@ }
11761183
@ checkHeight();
11771184
@ }
11781185
@ function scrollToSelected(){
11791186
@ var x = document.getElementsByClassName('timelineSelected');
11801187
--- 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)&larr;%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)&larr;%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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button