Fossil

Check-in [d1aa1e62]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Avoid drawing two consecutive ellpses when the timeline comment has been truncated.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d1aa1e6275c21184518fb09547acdfb6a8897f17bd111504e2ef1ebc7f31ad4c
User & Date: drh 2017-11-26 23:53:59
Context
2017-11-27
00:13
The /timeline page shows check-ins only if there is no y= query parameter and if the user has read ("r") permissions on the repo. check-in: 255adb04 user: drh tags: trunk
2017-11-26
23:53
Avoid drawing two consecutive ellpses when the timeline comment has been truncated. check-in: d1aa1e62 user: drh tags: trunk
23:29
Remove a leftover "basic" query parameter on an internal /timeline line. Change the default number of entries shown for "c=" timelines to 50, as this works better with the new centering logic. check-in: 6e9748b6 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/finfo.c.

520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
    }else{
      @ <td class="timelineTableCell">
    }
    if( bHashBeforeComment && zUuid ){
      hyperlink_to_uuid(zUuid);
    }
    @ <span class="timelineComment timelineCheckinComment" \
    @  onclick='toggleEllipsis(%d(frid))'>
    @ %W(zCom)</span>
    if( bHashAfterComment && zUuid ){
      hyperlink_to_uuid(zUuid);
    }
    if( bShowDetail ){
      @ <span class='timelineEllipsis anticlutter' id='ellipsis-%d(frid)' \
      @  onclick='expandEllipsis(%d(frid))'>...</span>
      if( bSeparateDetail ){
        if( zBgClr && zBgClr[0] ){
          @ <td class="timelineTableCell timelineDetailCell"
          @  style="background-color: %h(zBgClr);">
        }else{
          @ <td class="timelineTableCell timelineDetailCell">
        }







|






|







520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
    }else{
      @ <td class="timelineTableCell">
    }
    if( bHashBeforeComment && zUuid ){
      hyperlink_to_uuid(zUuid);
    }
    @ <span class="timelineComment timelineCheckinComment" \
    @  onclick='toggleDetail(%d(frid))'>
    @ %W(zCom)</span>
    if( bHashAfterComment && zUuid ){
      hyperlink_to_uuid(zUuid);
    }
    if( bShowDetail ){
      @ <span class='timelineEllipsis anticlutter' id='ellipsis-%d(frid)' \
      @  onclick='toggleDetail(%d(frid))'>...</span>
      if( bSeparateDetail ){
        if( zBgClr && zBgClr[0] ){
          @ <td class="timelineTableCell timelineDetailCell"
          @  style="background-color: %h(zBgClr);">
        }else{
          @ <td class="timelineTableCell timelineDetailCell">
        }

Changes to src/timeline.c.

302
303
304
305
306
307
308

309
310
311
312
313
314
315
...
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
...
514
515
516
517
518
519
520

521
522
523
524
525
526
527
...
546
547
548
549
550
551
552

553
554
555
556
557
558
559

560
561

562
563
564
565
566
567
568
....
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174


1175
1176
1177
1178
1179
1180
1181
    const char *zTagList = db_column_text(pQuery, 8);
    int tagid = db_column_int(pQuery, 9);
    const char *zDispUser = zUser && zUser[0] ? zUser : "anonymous";
    const char *zBr = 0;      /* Branch */
    int commentColumn = 3;    /* Column containing comment text */
    int modPending;           /* Pending moderation */
    char *zDateLink;          /* URL for the link on the timestamp */

    char zTime[20];

    if( zDate==0 ){
      zDate = "YYYY-MM-DD HH:MM:SS";  /* Something wrong with the repo */
    }
    modPending = moderation_pending(rid);
    if( tagid ){
................................................................................
        }
      }
    }
    db_column_blob(pQuery, commentColumn, &comment);
    if( zType[0]!='c' ){
      /* Comments for anything other than a check-in are generated by
      ** "fossil rebuild" and expect to be rendered as text/x-fossil-wiki */
      @ <span class='timelineComment' onclick='toggleEllipsis(%d(rid))'>
      wiki_convert(&comment, 0, WIKI_INLINE);
      @ </span>
    }else{
      @ <span class='timelineComment timelineCheckinComment' \
      @  onclick='toggleEllipsis(%d(rid))'>
      if( bCommentGitStyle ){
        /* Truncate comment at first blank line */
        int ii, jj;
        int n = blob_size(&comment);
        char *z = blob_str(&comment);
        for(ii=0; ii<n; ii++){
          if( z[ii]=='\n' ){
................................................................................
      }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);

................................................................................
        int srcId = delta_source_rid(rid);
        if( srcId ){
          @ (%d(rid)&larr;%d(srcId))
        }else{
          @ (%d(rid))
        }
      }

    }


    /* Generate extra information and hyperlinks to follow the comment.
    ** Example:  "(check-in: [abcdefg], user: drh, tags: trunk)"
    */
    if( bShowDetail ){

      @ <span class='timelineEllipsis anticlutter' id='ellipsis-%d(rid)' \
      @  onclick='toggleEllipsis(%d(rid))'>...</span>

      if( bSeparateDetail ){
        if( zBgClr && zBgClr[0] && rid!=selectedRid ){
          @ <td class="timelineTableCell timelineDetailCell"
          @  style="background-color: %h(zBgClr);">
        }else{
          @ <td class="timelineTableCell timelineDetailCell">
        }
................................................................................
    @   checkHeight();
    @ }
    @ function reclutter(){
    @   changeDisplay('clutter','inline');
    @   changeDisplay('anticlutter','none');
    @   checkHeight();
    @ }
    @ function toggleEllipsis(id){
    @   var x = gebi("ellipsis-"+id);
    @   if( x.style.display=='none' ){
    @     x.style.display='inline';
    @     gebi("detail-"+id).style.display='none';
    @     x = document.getElementById("links-"+id);
    @     if(x) x.style.display='none';
    @   }else{
    @     x.style.display='none';
    @     gebi("detail-"+id).style.display='inline';
    @     x = document.getElementById("links-"+id);
    @     if(x) x.style.display='inline';


    @   }
    @   checkHeight();
    @ }
    @ function scrollToSelected(){
    @   var x = document.getElementsByClassName('timelineSelected');
    @   if(x[0]){
    @     var h = window.innerHeight;







>







 







|




|







 







>







 







>







>
|
|
>







 







|
|
|
|
|
|
|
|
|
|
|
|
>
>







302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
...
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
...
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
...
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
....
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
    const char *zTagList = db_column_text(pQuery, 8);
    int tagid = db_column_int(pQuery, 9);
    const char *zDispUser = zUser && zUser[0] ? zUser : "anonymous";
    const char *zBr = 0;      /* Branch */
    int commentColumn = 3;    /* Column containing comment text */
    int modPending;           /* Pending moderation */
    char *zDateLink;          /* URL for the link on the timestamp */
    int drawDetailEllipsis = 1;     /* True to show ellipsis in place of detail */
    char zTime[20];

    if( zDate==0 ){
      zDate = "YYYY-MM-DD HH:MM:SS";  /* Something wrong with the repo */
    }
    modPending = moderation_pending(rid);
    if( tagid ){
................................................................................
        }
      }
    }
    db_column_blob(pQuery, commentColumn, &comment);
    if( zType[0]!='c' ){
      /* Comments for anything other than a check-in are generated by
      ** "fossil rebuild" and expect to be rendered as text/x-fossil-wiki */
      @ <span class='timelineComment' onclick='toggleDetail(%d(rid))'>
      wiki_convert(&comment, 0, WIKI_INLINE);
      @ </span>
    }else{
      @ <span class='timelineComment timelineCheckinComment' \
      @  onclick='toggleDetail(%d(rid))'>
      if( bCommentGitStyle ){
        /* Truncate comment at first blank line */
        int ii, jj;
        int n = blob_size(&comment);
        char *z = blob_str(&comment);
        for(ii=0; ii<n; ii++){
          if( z[ii]=='\n' ){
................................................................................
      }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);
        drawDetailEllipsis = 0;
      }else{
        cgi_printf("%W",blob_str(&comment));
      }
      @ </span>
    }
    blob_reset(&comment);

................................................................................
        int srcId = delta_source_rid(rid);
        if( srcId ){
          @ (%d(rid)&larr;%d(srcId))
        }else{
          @ (%d(rid))
        }
      }
      drawDetailEllipsis = 1;
    }


    /* Generate extra information and hyperlinks to follow the comment.
    ** Example:  "(check-in: [abcdefg], user: drh, tags: trunk)"
    */
    if( bShowDetail ){
      if( drawDetailEllipsis ){
        @ <span class='timelineEllipsis anticlutter' id='ellipsis-%d(rid)' \
        @  onclick='toggleDetail(%d(rid))'>...</span>
      }
      if( bSeparateDetail ){
        if( zBgClr && zBgClr[0] && rid!=selectedRid ){
          @ <td class="timelineTableCell timelineDetailCell"
          @  style="background-color: %h(zBgClr);">
        }else{
          @ <td class="timelineTableCell timelineDetailCell">
        }
................................................................................
    @   checkHeight();
    @ }
    @ function reclutter(){
    @   changeDisplay('clutter','inline');
    @   changeDisplay('anticlutter','none');
    @   checkHeight();
    @ }
    @ function changeDisplayById(id,value){
    @   var x = document.getElementById(id);
    @   if(x) x.style.display=value;
    @ }
    @ function toggleDetail(id){
    @   var x = gebi("detail-"+id);
    @   if( x.style.display=="inline" ){
    @     x.style.display="none";
    @     changeDisplayById("ellipsis-"+id,"inline");
    @     changeDisplayById("links-"+id,"none");
    @   }else{
    @     x.style.display="inline";
    @     changeDisplayById("ellipsis-"+id,"none");
    @     changeDisplayById("links-"+id,"inline");
    @   }
    @   checkHeight();
    @ }
    @ function scrollToSelected(){
    @   var x = document.getElementsByClassName('timelineSelected');
    @   if(x[0]){
    @     var h = window.innerHeight;