Fossil

Changes On Branch declutter-via-js
Login

Changes On Branch declutter-via-js

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

Changes In Branch declutter-via-js Excluding Merge-Ins

This is equivalent to a diff from e72444ea to 7b9cfa99

2017-11-26
01:37
The javascript Advanced/Basic toggles on the timelines is working well enough now to merge to trunk. ... (check-in: e91d2672 user: drh tags: trunk)
01:34
Replace the three bullets with a midline ellipsis character in the timelines. ... (Closed-Leaf check-in: 7b9cfa99 user: drh tags: declutter-via-js)
01:29
Fix a javascript error in toggleEllipsis() in the /timeline. ... (check-in: 4d6fda6d user: drh tags: declutter-via-js)
2017-11-25
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: 3ede2d87 user: drh tags: declutter-via-js)
12:26
Change the names of the "Basic" and "Advanced" buttons to "Declutter" and "Details". (These names are subject to further refinement.) Add a [checkins-using] link to the artifact view for content artifacts. ... (check-in: e72444ea user: drh tags: trunk)
02:15
Add a "Basic" button to the submenu for /timeline pages that do not already have the "basic" query parameter. ... (check-in: 227c8e57 user: drh tags: trunk)

Changes to skins/black_and_white/header.txt.

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?basic'>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"







|







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
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?basic Timeline
}
if {[hascap oh]} {
  menulink /dir?ci=tip Files
}
if {[hascap o]} {
  menulink  /brlist Branches
  menulink  /taglist Tags







|







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
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?basic Timeline
}
if {[hascap oh]} {
  menulink /dir?ci=tip Files
}
if {[hascap o]} {
  menulink  /brlist Branches
  menulink  /taglist Tags







|







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
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?basic'>Timeline</a></li>\n"
                  } else {
                    html "<li><a href='$home/timeline?basic'>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"







|

|







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
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?basic Timeline
}
if {[hascap oh]} {
  menulink /dir?ci=tip Files
}
if {[hascap o]} {
  menulink  /brlist Branches
  menulink  /taglist Tags







|







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
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?basic Timeline
}
if {[anoncap oh]} {
  menulink /dir?ci=tip Files
}
if {[anoncap o]} {
  menulink /brlist Branches
  menulink /taglist Tags







|







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
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?basic Timeline
}
if {[anoncap oh]} {
  menulink /dir?ci=tip Files
}
if {[anoncap o]} {
  menulink /brlist Branches
  menulink /taglist Tags







|







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
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?basic'>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"







|







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
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?basic'>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"







|







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
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?basic'>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"







|







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
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?basic'>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"







|







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
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?basic Timeline
}
if {[anoncap oh]} {
  menulink /dir?ci=tip Files
}
if {[anoncap o]} {
  menulink  /brlist Branches
  menulink  /taglist Tags







|







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
292
293
294
295
296
297
298
299
**    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
**    basic      Minimize clutter and complication
**
** 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){







<







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
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
357
358
  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 bBasic = PB("basic");
  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 = bBasic ? 5 : 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 && !bBasic ){
    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{







<

















|













|







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
452
453
454
455
456
457
458
459
460
461
462
463
464
465
      fossil_free(zUuid);
    }
  }else{
    blob_appendf(&title, "History of ");
    hyperlinked_path(zFilename, &title, 0, "tree", "");
    if( fShowId ) blob_appendf(&title, " (%d)", fnid);
  }
  if( bBasic ){
    style_submenu_element("Details", "%s",
            url_render(&url, "basic", 0, 0, 0));
  }else{
    style_submenu_element("Declutter", "%s",
            url_render(&url, "basic", "1", 0, 0));
  }
  @ <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"







<
|
<
<
|
<
<







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"
526
527
528
529
530
531
532
533


534
535
536
537


538
539
540
541
542
543
544
545

546
547
548
549
550
551
552
      @ <td class="timelineTableCell" style="background-color: %h(zBgClr);">
    }else{
      @ <td class="timelineTableCell">
    }
    if( bHashBeforeComment && zUuid ){
      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)&larr;%d(srcId)







|
>
>




>
>








>







519
520
521
522
523
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
549
550
      @ <td class="timelineTableCell" style="background-color: %h(zBgClr);">
    }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))'>&#x22ef;</span>
      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)&larr;%d(srcId)
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
626
627
628
629
          @ %z(href("%R/finfo?name=%t",zNewName))%h(zNewName)</a>
          fossil_free(zNewName);
        }else{
          @ <b>Deleted</b>
        }
      }
    }
    if( g.perm.Hyperlink && zUuid && !bBasic ){
      const char *z = zFilename;
      @ <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&nbsp;using]</a>
      if( fpid>0 ){
        @ %z(href("%R/fdiff?sbs=1&v1=%!S&v2=%!S",zPUuid,zUuid))[diff]</a>
      }
      @ </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>
    }
    @ </td></tr>
  }
  db_finalize(&q);
  db_finalize(&qparent);
  if( pGraph ){
    graph_finish(pGraph, 1);







|

|








|
















|







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
626
627
          @ %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&nbsp;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/style.c.

45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62








63
64
65
66
67
68
69
  const char *zLink;         /* Jump to this link when button is pressed */
} aSubmenu[30];
static int nSubmenu = 0;     /* Number of buttons */
static struct SubmenuCtrl {
  const char *zName;           /* Form query parameter */
  const char *zLabel;          /* Label.  Might be NULL for FF_MULTI */
  unsigned char eType;         /* FF_ENTRY, FF_MULTI, FF_BINARY */
  unsigned char isDisabled;    /* True if this control is grayed out */
  short int iSize;             /* Width for FF_ENTRY.  Count for FF_MULTI */
  const char *const *azChoice; /* value/display pairs for FF_MULTI */
  const char *zFalse;          /* FF_BINARY label when false */
  const char *zJS;             /* Javascript to run on toggle */
} aSubmenuCtrl[20];
static int nSubmenuCtrl = 0;
#define FF_ENTRY    1
#define FF_MULTI    2
#define FF_BINARY   3
#define FF_CHECKBOX 4









/*
** Remember that the header has been generated.  The footer is omitted
** if an error occurs before the header.
*/
static int headerHasBeenGenerated = 0;








|






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







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
  const char *zLink;         /* Jump to this link when button is pressed */
} aSubmenu[30];
static int nSubmenu = 0;     /* Number of buttons */
static struct SubmenuCtrl {
  const char *zName;           /* Form query parameter */
  const char *zLabel;          /* Label.  Might be NULL for FF_MULTI */
  unsigned char eType;         /* FF_ENTRY, FF_MULTI, FF_BINARY */
  unsigned char eVisible;      /* STYLE_NORMAL, STYLE_VISIBLE, .... */
  short int iSize;             /* Width for FF_ENTRY.  Count for FF_MULTI */
  const char *const *azChoice; /* value/display pairs for FF_MULTI */
  const char *zFalse;          /* FF_BINARY label when false */
  const char *zJS;             /* Javascript to run on toggle */
} aSubmenuCtrl[20];
static int nSubmenuCtrl = 0;
#define FF_ENTRY    1          /* Text entry box */
#define FF_MULTI    2          /* Combobox.  Multiple choices. */
#define FF_BINARY   3          /* Control binary query parameter */
#define FF_CHECKBOX 4          /* Check-box with JS */
#define FF_JSBUTTON 5          /* Run JS when clicked */

#if INTERFACE
#define STYLE_NORMAL   0       /* Normal display of control */
#define STYLE_DISABLED 1       /* Control is disabled */
#define STYLE_CLUTTER  2       /* Only visible in "Advanced" display */
#define STYLE_BASIC    4       /* Only visible in "Basic" display */
#endif /* INTERFACE */

/*
** Remember that the header has been generated.  The footer is omitted
** if an error occurs before the header.
*/
static int headerHasBeenGenerated = 0;

246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275












276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
  va_end(ap);
  nSubmenu++;
}
void style_submenu_entry(
  const char *zName,       /* Query parameter name */
  const char *zLabel,      /* Label before the entry box */
  int iSize,               /* Size of the entry box */
  int isDisabled           /* True if disabled */
){
  assert( nSubmenuCtrl < count(aSubmenuCtrl) );
  aSubmenuCtrl[nSubmenuCtrl].zName = zName;
  aSubmenuCtrl[nSubmenuCtrl].zLabel = zLabel;
  aSubmenuCtrl[nSubmenuCtrl].iSize = iSize;
  aSubmenuCtrl[nSubmenuCtrl].isDisabled = isDisabled;
  aSubmenuCtrl[nSubmenuCtrl].eType = FF_ENTRY;
  nSubmenuCtrl++;
}
void style_submenu_checkbox(
  const char *zName,       /* Query parameter name */
  const char *zLabel,      /* Label to display after the checkbox */
  int isDisabled,          /* True if disabled */
  const char *zJS          /* Optional javascript to run on toggle */
){
  assert( nSubmenuCtrl < count(aSubmenuCtrl) );
  aSubmenuCtrl[nSubmenuCtrl].zName = zName;
  aSubmenuCtrl[nSubmenuCtrl].zLabel = zLabel;
  aSubmenuCtrl[nSubmenuCtrl].isDisabled = isDisabled;
  aSubmenuCtrl[nSubmenuCtrl].zJS = zJS;
  aSubmenuCtrl[nSubmenuCtrl].eType = FF_CHECKBOX;
  nSubmenuCtrl++;












}
void style_submenu_binary(
  const char *zName,       /* Query parameter name */
  const char *zTrue,       /* Label to show when parameter is true */
  const char *zFalse,      /* Label to show when the parameter is false */
  int isDisabled           /* True if this control is disabled */
){
  assert( nSubmenuCtrl < count(aSubmenuCtrl) );
  aSubmenuCtrl[nSubmenuCtrl].zName = zName;
  aSubmenuCtrl[nSubmenuCtrl].zLabel = zTrue;
  aSubmenuCtrl[nSubmenuCtrl].zFalse = zFalse;
  aSubmenuCtrl[nSubmenuCtrl].isDisabled = isDisabled;
  aSubmenuCtrl[nSubmenuCtrl].eType = FF_BINARY;
  nSubmenuCtrl++;
}
void style_submenu_multichoice(
  const char *zName,       /* Query parameter name */
  int nChoice,             /* Number of options */
  const char *const *azChoice,/* value/display pairs.  2*nChoice entries */
  int isDisabled           /* True if this control is disabled */
){
  assert( nSubmenuCtrl < count(aSubmenuCtrl) );
  aSubmenuCtrl[nSubmenuCtrl].zName = zName;
  aSubmenuCtrl[nSubmenuCtrl].iSize = nChoice;
  aSubmenuCtrl[nSubmenuCtrl].azChoice = azChoice;
  aSubmenuCtrl[nSubmenuCtrl].isDisabled = isDisabled;
  aSubmenuCtrl[nSubmenuCtrl].eType = FF_MULTI;
  nSubmenuCtrl++;
}
void style_submenu_sql(
  const char *zName,       /* Query parameter name */
  const char *zLabel,      /* Label on the control */
  const char *zFormat,     /* Format string for SQL command for choices */







|





|






|





|



>
>
>
>
>
>
>
>
>
>
>
>





|





|




|
|
|
|





|







254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
  va_end(ap);
  nSubmenu++;
}
void style_submenu_entry(
  const char *zName,       /* Query parameter name */
  const char *zLabel,      /* Label before the entry box */
  int iSize,               /* Size of the entry box */
  int eVisible             /* Visible or disabled */
){
  assert( nSubmenuCtrl < count(aSubmenuCtrl) );
  aSubmenuCtrl[nSubmenuCtrl].zName = zName;
  aSubmenuCtrl[nSubmenuCtrl].zLabel = zLabel;
  aSubmenuCtrl[nSubmenuCtrl].iSize = iSize;
  aSubmenuCtrl[nSubmenuCtrl].eVisible = eVisible;
  aSubmenuCtrl[nSubmenuCtrl].eType = FF_ENTRY;
  nSubmenuCtrl++;
}
void style_submenu_checkbox(
  const char *zName,       /* Query parameter name */
  const char *zLabel,      /* Label to display after the checkbox */
  int eVisible,            /* Visible or disabled */
  const char *zJS          /* Optional javascript to run on toggle */
){
  assert( nSubmenuCtrl < count(aSubmenuCtrl) );
  aSubmenuCtrl[nSubmenuCtrl].zName = zName;
  aSubmenuCtrl[nSubmenuCtrl].zLabel = zLabel;
  aSubmenuCtrl[nSubmenuCtrl].eVisible = eVisible;
  aSubmenuCtrl[nSubmenuCtrl].zJS = zJS;
  aSubmenuCtrl[nSubmenuCtrl].eType = FF_CHECKBOX;
  nSubmenuCtrl++;
}
void style_submenu_jsbutton(
  const char *zLabel,      /* Label to display on the submenu */
  int eVisible,            /* Visible or disabled */
  const char *zJS          /* Javascript to run when clicked */
){
  assert( nSubmenuCtrl < count(aSubmenuCtrl) );
  aSubmenuCtrl[nSubmenuCtrl].zLabel = zLabel;
  aSubmenuCtrl[nSubmenuCtrl].eVisible = eVisible;
  aSubmenuCtrl[nSubmenuCtrl].zJS = zJS;
  aSubmenuCtrl[nSubmenuCtrl].eType = FF_JSBUTTON;
  nSubmenuCtrl++;
}
void style_submenu_binary(
  const char *zName,       /* Query parameter name */
  const char *zTrue,       /* Label to show when parameter is true */
  const char *zFalse,      /* Label to show when the parameter is false */
  int eVisible             /* Visible or disabled */
){
  assert( nSubmenuCtrl < count(aSubmenuCtrl) );
  aSubmenuCtrl[nSubmenuCtrl].zName = zName;
  aSubmenuCtrl[nSubmenuCtrl].zLabel = zTrue;
  aSubmenuCtrl[nSubmenuCtrl].zFalse = zFalse;
  aSubmenuCtrl[nSubmenuCtrl].eVisible = eVisible;
  aSubmenuCtrl[nSubmenuCtrl].eType = FF_BINARY;
  nSubmenuCtrl++;
}
void style_submenu_multichoice(
  const char *zName,           /* Query parameter name */
  int nChoice,                 /* Number of options */
  const char *const *azChoice, /* value/display pairs.  2*nChoice entries */
  int eVisible                 /* Visible or disabled */
){
  assert( nSubmenuCtrl < count(aSubmenuCtrl) );
  aSubmenuCtrl[nSubmenuCtrl].zName = zName;
  aSubmenuCtrl[nSubmenuCtrl].iSize = nChoice;
  aSubmenuCtrl[nSubmenuCtrl].azChoice = azChoice;
  aSubmenuCtrl[nSubmenuCtrl].eVisible = eVisible;
  aSubmenuCtrl[nSubmenuCtrl].eType = FF_MULTI;
  nSubmenuCtrl++;
}
void style_submenu_sql(
  const char *zName,       /* Query parameter name */
  const char *zLabel,      /* Label on the control */
  const char *zFormat,     /* Format string for SQL command for choices */
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
  }
  db_finalize(&q);
  if( n>0 ){
    aSubmenuCtrl[nSubmenuCtrl].zName = zName;
    aSubmenuCtrl[nSubmenuCtrl].zLabel = zLabel;
    aSubmenuCtrl[nSubmenuCtrl].iSize = n/2;
    aSubmenuCtrl[nSubmenuCtrl].azChoice = (const char *const *)az;
    aSubmenuCtrl[nSubmenuCtrl].isDisabled = 0;
    aSubmenuCtrl[nSubmenuCtrl].eType = FF_MULTI;
    nSubmenuCtrl++;
  }
}


/*







|







347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
  }
  db_finalize(&q);
  if( n>0 ){
    aSubmenuCtrl[nSubmenuCtrl].zName = zName;
    aSubmenuCtrl[nSubmenuCtrl].zLabel = zLabel;
    aSubmenuCtrl[nSubmenuCtrl].iSize = n/2;
    aSubmenuCtrl[nSubmenuCtrl].azChoice = (const char *const *)az;
    aSubmenuCtrl[nSubmenuCtrl].eVisible = STYLE_NORMAL;
    aSubmenuCtrl[nSubmenuCtrl].eType = FF_MULTI;
    nSubmenuCtrl++;
  }
}


/*
561
562
563
564
565
566
567
568

569
570

571






572
573
574
575
576
577
578
579
580
581
582
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
626
627
628
629
630
631
632
633
634






635
636
637
638
639
640
641
        }else{
          @ <a class="label" href="%h(p->zLink)">%h(p->zLabel)</a>
        }
      }
    }
    for(i=0; i<nSubmenuCtrl; i++){
      const char *zQPN = aSubmenuCtrl[i].zName;
      const char *zDisabled = " disabled";

      if( !aSubmenuCtrl[i].isDisabled ){
        zDisabled = "";

        cgi_tag_query_parameter(zQPN);






      }
      switch( aSubmenuCtrl[i].eType ){
        case FF_ENTRY:
          @ <span class='submenuctrl'>\
          @ &nbsp;%h(aSubmenuCtrl[i].zLabel)\
          @ <input type='text' name='%s(zQPN)' value='%h(PD(zQPN, ""))' \
          if( aSubmenuCtrl[i].iSize<0 ){
            @ size='%d(-aSubmenuCtrl[i].iSize)' \
          }else if( aSubmenuCtrl[i].iSize>0 ){
            @ size='%d(aSubmenuCtrl[i].iSize)' \
            @ maxlength='%d(aSubmenuCtrl[i].iSize)' \
          }
          @ onchange='gebi("f01").submit();'%s(zDisabled)></span>
          break;
        case FF_MULTI: {
          int j;
          const char *zVal = P(zQPN);



          if( aSubmenuCtrl[i].zLabel ){
            @ &nbsp;%h(aSubmenuCtrl[i].zLabel)\
          }
          @ <select class='submenuctrl' size='1' name='%s(zQPN)' \
          @ onchange='gebi("f01").submit();'%s(zDisabled)>
          for(j=0; j<aSubmenuCtrl[i].iSize*2; j+=2){
            const char *zQPV = aSubmenuCtrl[i].azChoice[j];
            @ <option value='%h(zQPV)'\
            if( fossil_strcmp(zVal, zQPV)==0 ){
              @  selected\
            }
            @ >%h(aSubmenuCtrl[i].azChoice[j+1])</option>
          }
          @ </select>



          break;
        }
        case FF_BINARY: {
          int isTrue = PB(zQPN);
          @ <select class='submenuctrl' size='1' name='%s(zQPN)' \
          @ onchange='gebi("f01").submit();'%s(zDisabled)>
          @ <option value='1'\
          if( isTrue ){
            @  selected\
          }
          @ >%h(aSubmenuCtrl[i].zLabel)</option>
          @ <option value='0'\
          if( !isTrue ){
            @  selected\
          }
          @ >%h(aSubmenuCtrl[i].zFalse)</option>
          @ </select>
          break;
        }
        case FF_CHECKBOX: {
          @ <label class='submenuctrl submenuckbox'>\
          @ <input type='checkbox' name='%s(zQPN)' \
          if( PB(zQPN) ){
            @ checked \
          }
          if( aSubmenuCtrl[i].zJS ){
            @ onchange='%s(aSubmenuCtrl[i].zJS)'%s(zDisabled)>\
          }else{
            @ onchange='gebi("f01").submit();'%s(zDisabled)>\
          }
          @ %h(aSubmenuCtrl[i].zLabel)</label>
          break;






        }
      }
    }
    @ </div>
    if( nSubmenuCtrl ){
      cgi_query_parameters_to_hidden();
      cgi_tag_query_parameter(0);







|
>
|
|
>

>
>
>
>
>
>



|













>
>
>














>
>
>




|















|











>
>
>
>
>
>







581
582
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
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
        }else{
          @ <a class="label" href="%h(p->zLink)">%h(p->zLabel)</a>
        }
      }
    }
    for(i=0; i<nSubmenuCtrl; i++){
      const char *zQPN = aSubmenuCtrl[i].zName;
      const char *zDisabled = "";
      const char *zXtraClass = "";
      if( aSubmenuCtrl[i].eVisible & STYLE_DISABLED ){
        zDisabled = " disabled";
      }else if( zQPN ){
        cgi_tag_query_parameter(zQPN);
      }
      if( aSubmenuCtrl[i].eVisible & STYLE_CLUTTER ){
        zXtraClass = " clutter";
      }
      if( aSubmenuCtrl[i].eVisible & STYLE_BASIC ){
        zXtraClass = " anticlutter";
      }
      switch( aSubmenuCtrl[i].eType ){
        case FF_ENTRY:
          @ <span class='submenuctrl%s(zXtraClass)'>\
          @ &nbsp;%h(aSubmenuCtrl[i].zLabel)\
          @ <input type='text' name='%s(zQPN)' value='%h(PD(zQPN, ""))' \
          if( aSubmenuCtrl[i].iSize<0 ){
            @ size='%d(-aSubmenuCtrl[i].iSize)' \
          }else if( aSubmenuCtrl[i].iSize>0 ){
            @ size='%d(aSubmenuCtrl[i].iSize)' \
            @ maxlength='%d(aSubmenuCtrl[i].iSize)' \
          }
          @ onchange='gebi("f01").submit();'%s(zDisabled)></span>
          break;
        case FF_MULTI: {
          int j;
          const char *zVal = P(zQPN);
          if( zXtraClass[0] ){
            @ <span class='%s(zXtraClass+1)'>
          }
          if( aSubmenuCtrl[i].zLabel ){
            @ &nbsp;%h(aSubmenuCtrl[i].zLabel)\
          }
          @ <select class='submenuctrl' size='1' name='%s(zQPN)' \
          @ onchange='gebi("f01").submit();'%s(zDisabled)>
          for(j=0; j<aSubmenuCtrl[i].iSize*2; j+=2){
            const char *zQPV = aSubmenuCtrl[i].azChoice[j];
            @ <option value='%h(zQPV)'\
            if( fossil_strcmp(zVal, zQPV)==0 ){
              @  selected\
            }
            @ >%h(aSubmenuCtrl[i].azChoice[j+1])</option>
          }
          @ </select>
          if( zXtraClass[0] ){
            @ </span>
          }
          break;
        }
        case FF_BINARY: {
          int isTrue = PB(zQPN);
          @ <select class='submenuctrl%s(zXtraClass)' size='1' name='%s(zQPN)' \
          @ onchange='gebi("f01").submit();'%s(zDisabled)>
          @ <option value='1'\
          if( isTrue ){
            @  selected\
          }
          @ >%h(aSubmenuCtrl[i].zLabel)</option>
          @ <option value='0'\
          if( !isTrue ){
            @  selected\
          }
          @ >%h(aSubmenuCtrl[i].zFalse)</option>
          @ </select>
          break;
        }
        case FF_CHECKBOX: {
          @ <label class='submenuctrl submenuckbox%s(zXtraClass)'>\
          @ <input type='checkbox' name='%s(zQPN)' \
          if( PB(zQPN) ){
            @ checked \
          }
          if( aSubmenuCtrl[i].zJS ){
            @ onchange='%s(aSubmenuCtrl[i].zJS)'%s(zDisabled)>\
          }else{
            @ onchange='gebi("f01").submit();'%s(zDisabled)>\
          }
          @ %h(aSubmenuCtrl[i].zLabel)</label>
          break;
        }
        case FF_JSBUTTON: {
          @ <a class="label%s(zXtraClass)" \
          @  onclick='%s(aSubmenuCtrl[i].zJS)'%s(zDisabled)>\
          @ %s(aSubmenuCtrl[i].zLabel)</a>
          break;
        }
      }
    }
    @ </div>
    if( nSubmenuCtrl ){
      cgi_query_parameters_to_hidden();
      cgi_tag_query_parameter(0);
1490
1491
1492
1493
1494
1495
1496




1497
1498
1499
1500
1501
1502
1503
    "Container for the search terms entry box",
    @ text-align: center;
  },
  { "p.searchEmpty",
    "Message explaining that there are no search results",
    @ font-style: italic;
  },




  { 0,
    0,
    0
  }
};

/*







>
>
>
>







1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
    "Container for the search terms entry box",
    @ text-align: center;
  },
  { "p.searchEmpty",
    "Message explaining that there are no search results",
    @ font-style: italic;
  },
  { ".clutter",
    "Detail screen objects",
    @ display: none;
  },
  { 0,
    0,
    0
  }
};

/*

Changes to src/timeline.c.

101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#define TIMELINE_FCHANGES 0x0020  /* Detail file changes */
#define TIMELINE_BRCOLOR  0x0040  /* Background color by branch name */
#define TIMELINE_UCOLOR   0x0080  /* Background color by user */
#define TIMELINE_FRENAMES 0x0100  /* Detail only file name changes */
#define TIMELINE_UNHIDE   0x0200  /* Unhide check-ins with "hidden" tag */
#define TIMELINE_SHOWRID  0x0400  /* Show RID values in addition to UUIDs */
#define TIMELINE_BISECT   0x0800  /* Show supplimental bisect information */
#define TIMELINE_BASIC    0x1000  /* Minimize clutter and distraction */
#endif

/*
** Hash a string and use the hash to determine a background color.
*/
char *hash_color(const char *z){
  int i;                       /* Loop counter */







<







101
102
103
104
105
106
107

108
109
110
111
112
113
114
#define TIMELINE_FCHANGES 0x0020  /* Detail file changes */
#define TIMELINE_BRCOLOR  0x0040  /* Background color by branch name */
#define TIMELINE_UCOLOR   0x0080  /* Background color by user */
#define TIMELINE_FRENAMES 0x0100  /* Detail only file name changes */
#define TIMELINE_UNHIDE   0x0200  /* Unhide check-ins with "hidden" tag */
#define TIMELINE_SHOWRID  0x0400  /* Show RID values in addition to UUIDs */
#define TIMELINE_BISECT   0x0800  /* Show supplimental bisect information */

#endif

/*
** Hash a string and use the hash to determine a background color.
*/
char *hash_color(const char *z){
  int i;                       /* Loop counter */
263
264
265
266
267
268
269
270
271
272

273
274
275
276
277
278
279
280
281
282
283
284
285
  if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){
    vid = db_lget_int("checkout", 0);
  }
  zPrevDate[0] = 0;
  mxWikiLen = db_get_int("timeline-max-comment", 0);
  dateFormat = db_get_int("timeline-date-format", 0);
  bCommentGitStyle = db_get_int("timeline-truncate-at-blank", 0);
  if( tmFlags & TIMELINE_BASIC ){
    eCommentFormat = 5;  /* Comment only */
  }else{

    /* Undocumented query parameter commentformat=N takes a numeric parameter to
    ** adjust the comment-format for testing purposes. */
    const char *z = P("commentformat");
    eCommentFormat = z ? atoi(z) : db_get_int("timeline-comment-format", 0);
  }
   bShowDetail = (eCommentFormat & 1)==0;      /* Bit 0 suppresses the comment */
  bSeparateDetail = (eCommentFormat & 8)!=0;  /* Bit 3 turns on the detail column */ 
  switch( (eCommentFormat>>1)&3 ){
    case 1:  bHashAfterComment = 1;  break;
    case 2:  bHashInDetail = 1;      break;
    default: bHashBeforeComment = 1; break;
  }
  zDateFmt = P("datefmt");







<
<
<
>





|







262
263
264
265
266
267
268



269
270
271
272
273
274
275
276
277
278
279
280
281
282
  if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){
    vid = db_lget_int("checkout", 0);
  }
  zPrevDate[0] = 0;
  mxWikiLen = db_get_int("timeline-max-comment", 0);
  dateFormat = db_get_int("timeline-date-format", 0);
  bCommentGitStyle = db_get_int("timeline-truncate-at-blank", 0);



  {
    /* Undocumented query parameter commentformat=N takes a numeric parameter to
    ** adjust the comment-format for testing purposes. */
    const char *z = P("commentformat");
    eCommentFormat = z ? atoi(z) : db_get_int("timeline-comment-format", 0);
  }
  bShowDetail = (eCommentFormat & 1)==0;      /* Bit 0 suppresses the comment */
  bSeparateDetail = (eCommentFormat & 8)!=0;  /* Bit 3 turns on the detail column */ 
  switch( (eCommentFormat>>1)&3 ){
    case 1:  bHashAfterComment = 1;  break;
    case 2:  bHashInDetail = 1;      break;
    default: bHashBeforeComment = 1; break;
  }
  zDateFmt = P("datefmt");
491
492
493
494
495
496
497
498
499
500
501
502

503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
        }
      }
    }
    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'>
      wiki_convert(&comment, 0, WIKI_INLINE);
      @ </span>
    }else{
      @ <span class='timelineComment timelineCheckinComment'>

      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' ){
            for(jj=ii+1; jj<n && z[jj]!='\n' && fossil_isspace(z[jj]); jj++){}
            if( z[jj]=='\n' ) break;
          }
        }
        z[ii] = 0;
        @ %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{
        @ %W(blob_str(&comment))
      }
      @ </span>
    }
    blob_reset(&comment);

    if( bHashAfterComment ){
      if( zType[0]=='c' ){







|



|
>












|








|







488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
        }
      }
    }
    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' ){
            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' ){
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 ){


      if( bSeparateDetail ){
        if( zBgClr && zBgClr[0] && rid!=selectedRid ){
          @ <td class="timelineTableCell timelineDetailCell"
          @  style="background-color: %h(zBgClr);">
        }else{
          @ <td class="timelineTableCell timelineDetailCell">
        }
      }

      if( zType[0]=='c' ){
        cgi_printf("<span class='timelineDetail timelineCheckinDetail'>(");
      }else{
        cgi_printf("<span class='timelineDetail'>(");
      }
  
      if( bHashInDetail ){







>
>








>







553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
    }


    /* 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='expandEllipsis(%d(rid))'>&#x22ef;</span>
      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 ){
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
        int srcId = delta_source_rid(rid);
        if( srcId ){
          cgi_printf(" id: %d&larr;%d", rid, srcId);
        }else{
          cgi_printf(" id: %d", rid);
        }
      }
      cgi_printf(")</span>\n");  /* End of the details section */
    }
  
    tag_private_status(rid);

    /* Generate extra hyperlinks at the end of the comment */
    if( xExtra ){
      xExtra(rid);







|







637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
        int srcId = delta_source_rid(rid);
        if( srcId ){
          cgi_printf(" id: %d&larr;%d", rid, srcId);
        }else{
          cgi_printf(" id: %d", rid);
        }
      }
      cgi_printf(")</span></span>\n");  /* End of the details section */
    }
  
    tag_private_status(rid);

    /* Generate extra hyperlinks at the end of the comment */
    if( xExtra ){
      xExtra(rid);
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
    int iTopRow;         /* Index of the top row of the graph */

    iRailPitch = atoi(PD("railpitch","0"));
    showArrowheads = skin_detail_boolean("timeline-arrowheads");
    circleNodes = skin_detail_boolean("timeline-circle-nodes");
    colorGraph = skin_detail_boolean("timeline-color-graph-lines");

    @ <script>(function(){
    @ "use strict";
    @ var css = "";
    if( circleNodes ){
      @ css += ".tl-node, .tl-node:after { border-radius: 50%%; }";
    }
    if( !showArrowheads ){
      @ css += ".tl-arrow.u { display: none; }";







|







813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
    int iTopRow;         /* Index of the top row of the graph */

    iRailPitch = atoi(PD("railpitch","0"));
    showArrowheads = skin_detail_boolean("timeline-arrowheads");
    circleNodes = skin_detail_boolean("timeline-circle-nodes");
    colorGraph = skin_detail_boolean("timeline-color-graph-lines");

    @ <script>
    @ "use strict";
    @ var css = "";
    if( circleNodes ){
      @ css += ".tl-node, .tl-node:after { border-radius: 50%%; }";
    }
    if( !showArrowheads ){
      @ css += ".tl-arrow.u { display: none; }";
1139
1140
1141
1142
1143
1144
1145






























1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
      if( db_get_boolean("show-version-diffs", 0)==0 ){
        @     location.href="%R/vdiff?from="+selRow.h+"&to="+p.h+"&sbs=0";
      }else{
        @     location.href="%R/vdiff?from="+selRow.h+"&to="+p.h+"&sbs=1";
      }
    }
    @   }






























    @ }
    @ var lastRow = gebi("m"+rowinfo[rowinfo.length-1].id);
    @ var lastY = 0;
    @ function checkHeight(){
    @   var h = absoluteY(lastRow);
    @   if( h!=lastY ){
    @     renderGraph();
    @     lastY = h;
    @   }
    @   setTimeout(checkHeight, 1000);
    @ }
    @ initGraph();
    @ checkHeight();
    @ }())</script>
  }
}

/*
** Create a temporary table suitable for storing timeline data.
*/
static void timeline_temp_table(void){







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>













|







1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
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
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
      if( db_get_boolean("show-version-diffs", 0)==0 ){
        @     location.href="%R/vdiff?from="+selRow.h+"&to="+p.h+"&sbs=0";
      }else{
        @     location.href="%R/vdiff?from="+selRow.h+"&to="+p.h+"&sbs=1";
      }
    }
    @   }
    @ }
    @ function changeDisplay(selector,value){
    @   var x = document.getElementsByClassName(selector);
    @   var n = x.length;
    @   for(var i=0; i<n; i++) {x[i].style.display = value;}
    @ }
    @ function declutter(){
    @   changeDisplay('clutter','none');
    @   changeDisplay('anticlutter','inline');
    @   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();
    @ }
    @ var lastRow = gebi("m"+rowinfo[rowinfo.length-1].id);
    @ var lastY = 0;
    @ function checkHeight(){
    @   var h = absoluteY(lastRow);
    @   if( h!=lastY ){
    @     renderGraph();
    @     lastY = h;
    @   }
    @   setTimeout(checkHeight, 1000);
    @ }
    @ initGraph();
    @ checkHeight();
    @ </script>
  }
}

/*
** Create a temporary table suitable for storing timeline data.
*/
static void timeline_temp_table(void){
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
    if( g.perm.RdWiki ){
      az[i++] = "w";
      az[i++] = "Wiki";
    }
    assert( i<=count(az) );
  }
  if( i>2 ){
    style_submenu_multichoice("y", i/2, az, isDisabled);
  }
}

/*
** If the zChng string is not NULL, then it should be a comma-separated
** list of glob patterns for filenames.  Add an term to the WHERE clause
** for the SQL statement under construction that excludes any check-in that







|







1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
    if( g.perm.RdWiki ){
      az[i++] = "w";
      az[i++] = "Wiki";
    }
    assert( i<=count(az) );
  }
  if( i>2 ){
    style_submenu_multichoice("y", i/2, az, isDisabled|STYLE_CLUTTER);
  }
}

/*
** If the zChng string is not NULL, then it should be a comma-separated
** list of glob patterns for filenames.  Add an term to the WHERE clause
** for the SQL statement under construction that excludes any check-in that
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
}

/*
** WEBPAGE: timeline
**
** Query parameters:
**
**    basic          Minimum clutter and distraction
**    a=TIMEORTAG    After this event
**    b=TIMEORTAG    Before this event
**    c=TIMEORTAG    "Circa" this event
**    m=TIMEORTAG    Mark this event
**    n=COUNT        Suggested number of events in output
**    p=CHECKIN      Parents and ancestors of CHECKIN
**    d=CHECKIN      Descendants of CHECIN







<







1603
1604
1605
1606
1607
1608
1609

1610
1611
1612
1613
1614
1615
1616
}

/*
** WEBPAGE: timeline
**
** Query parameters:
**

**    a=TIMEORTAG    After this event
**    b=TIMEORTAG    Before this event
**    c=TIMEORTAG    "Circa" this event
**    m=TIMEORTAG    Mark this event
**    n=COUNT        Suggested number of events in output
**    p=CHECKIN      Parents and ancestors of CHECKIN
**    d=CHECKIN      Descendants of CHECIN
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
  Blob sql;                          /* text of SQL used to generate timeline */
  Blob desc;                         /* Description of the timeline */
  int nEntry;                        /* Max number of entries on timeline */
  int p_rid = name_to_typed_rid(P("p"),"ci");  /* artifact p and its parents */
  int d_rid = name_to_typed_rid(P("d"),"ci");  /* artifact d and descendants */
  int f_rid = name_to_typed_rid(P("f"),"ci");  /* artifact f and close family */
  const char *zUser = P("u");        /* All entries by this user if not NULL */
  int bBasic = PB("basic");          /* Minimize clutter and distraction */
  const char *zType = PD("y",bBasic?"ci":"all"); /* Type of events.  All if NULL */
  const char *zAfter = P("a");       /* Events after this time */
  const char *zBefore = P("b");      /* Events before this time */
  const char *zCirca = P("c");       /* Events near this time */
  const char *zMark = P("m");        /* Mark this event or an event this time */
  const char *zTagName = P("t");     /* Show events with this tag */
  const char *zBrName = P("r");      /* Equivalent to t=TAG&rel */
  int related = PB("rel");           /* Show events related to zTagName */







<
|







1654
1655
1656
1657
1658
1659
1660

1661
1662
1663
1664
1665
1666
1667
1668
  Blob sql;                          /* text of SQL used to generate timeline */
  Blob desc;                         /* Description of the timeline */
  int nEntry;                        /* Max number of entries on timeline */
  int p_rid = name_to_typed_rid(P("p"),"ci");  /* artifact p and its parents */
  int d_rid = name_to_typed_rid(P("d"),"ci");  /* artifact d and descendants */
  int f_rid = name_to_typed_rid(P("f"),"ci");  /* artifact f and close family */
  const char *zUser = P("u");        /* All entries by this user if not NULL */

  const char *zType = PD("y","all"); /* Type of events.  All if NULL */
  const char *zAfter = P("a");       /* Events after this time */
  const char *zBefore = P("b");      /* Events before this time */
  const char *zCirca = P("c");       /* Events near this time */
  const char *zMark = P("m");        /* Mark this event or an event this time */
  const char *zTagName = P("t");     /* Show events with this tag */
  const char *zBrName = P("r");      /* Equivalent to t=TAG&rel */
  int related = PB("rel");           /* Show events related to zTagName */
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
      matchStyle = MS_REGEXP;
    }else{
      /* For exact maching, inhibit links to the selected tag. */
      zThisTag = zTagName;
    }

    /* Display a checkbox to enable/disable display of related check-ins. */
    if( !bBasic ) style_submenu_checkbox("rel", "Related", 0, 0);

    /* Construct the tag match expression. */
    zTagSql = tagMatchExpression(matchStyle, zTagName, &zMatchDesc, &zError);
  }

  if( zMark && zMark[0]==0 ){
    if( zAfter ) zMark = zAfter;







|







1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
      matchStyle = MS_REGEXP;
    }else{
      /* For exact maching, inhibit links to the selected tag. */
      zThisTag = zTagName;
    }

    /* Display a checkbox to enable/disable display of related check-ins. */
    style_submenu_checkbox("rel", "Related", STYLE_CLUTTER, 0);

    /* Construct the tag match expression. */
    zTagSql = tagMatchExpression(matchStyle, zTagName, &zMatchDesc, &zError);
  }

  if( zMark && zMark[0]==0 ){
    if( zAfter ) zMark = zAfter;
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
      p = p->u.pTo;
    }
    blob_append(&sql, ")", -1);
    path_reset();
    addFileGlobExclusion(zChng, &sql);
    tmFlags |= TIMELINE_DISJOINT;
    db_multi_exec("%s", blob_sql_text(&sql));
    if( !bBasic ){
      style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c', 0);
    }
    blob_appendf(&desc, "%d check-ins going from ",
                 db_int(0, "SELECT count(*) FROM timeline"));
    blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h", zFrom), zFrom);
    blob_append(&desc, " to ", -1);
    blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h",zTo), zTo);
    addFileGlobDescription(zChng, &desc);
  }else if( (p_rid || d_rid) && g.perm.Read ){







<
|
<







1891
1892
1893
1894
1895
1896
1897

1898

1899
1900
1901
1902
1903
1904
1905
      p = p->u.pTo;
    }
    blob_append(&sql, ")", -1);
    path_reset();
    addFileGlobExclusion(zChng, &sql);
    tmFlags |= TIMELINE_DISJOINT;
    db_multi_exec("%s", blob_sql_text(&sql));

    style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c')|STYLE_CLUTTER,0);

    blob_appendf(&desc, "%d check-ins going from ",
                 db_int(0, "SELECT count(*) FROM timeline"));
    blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h", zFrom), zFrom);
    blob_append(&desc, " to ", -1);
    blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h",zTo), zTo);
    addFileGlobDescription(zChng, &desc);
  }else if( (p_rid || d_rid) && g.perm.Read ){
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
                   href("%R/info/%!S", zUuid), zUuid);
    if( d_rid ){
      if( p_rid ){
        /* If both p= and d= are set, we don't have the uuid of d yet. */
        zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid);
      }
    }
    if( !bBasic ){
      style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c', 0);
      style_submenu_entry("n","Max:",4,0);
      timeline_y_submenu(1);
    }
  }else if( f_rid && g.perm.Read ){
    /* If f= is present, ignore all other parameters other than n= */
    char *zUuid;
    db_multi_exec(
       "CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY);"
       "INSERT INTO ok VALUES(%d);"
       "INSERT OR IGNORE INTO ok SELECT pid FROM plink WHERE cid=%d;"
       "INSERT OR IGNORE INTO ok SELECT cid FROM plink WHERE pid=%d;",
       f_rid, f_rid, f_rid
    );
    blob_append_sql(&sql, " AND event.objid IN ok");
    db_multi_exec("%s", blob_sql_text(&sql));
    if( useDividers ) selectedRid = f_rid;
    blob_appendf(&desc, "Parents and children of check-in ");
    zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid);
    blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%!S", zUuid), zUuid);
    tmFlags |= TIMELINE_DISJOINT;
    if( !bBasic ){
      style_submenu_checkbox("unhide", "Unhide", 0, 0);
      style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c', 0);
    }
  }else{
    /* Otherwise, a timeline based on a span of time */
    int n;
    const char *zEType = "timeline item";
    char *zDate;
    Blob cond;
    blob_zero(&cond);







<
|
|
|
<

















<
|
|
<







1941
1942
1943
1944
1945
1946
1947

1948
1949
1950

1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967

1968
1969

1970
1971
1972
1973
1974
1975
1976
                   href("%R/info/%!S", zUuid), zUuid);
    if( d_rid ){
      if( p_rid ){
        /* If both p= and d= are set, we don't have the uuid of d yet. */
        zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid);
      }
    }

    style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c')|STYLE_CLUTTER, 0);
    style_submenu_entry("n","Max:",4,STYLE_CLUTTER);
    timeline_y_submenu(1);

  }else if( f_rid && g.perm.Read ){
    /* If f= is present, ignore all other parameters other than n= */
    char *zUuid;
    db_multi_exec(
       "CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY);"
       "INSERT INTO ok VALUES(%d);"
       "INSERT OR IGNORE INTO ok SELECT pid FROM plink WHERE cid=%d;"
       "INSERT OR IGNORE INTO ok SELECT cid FROM plink WHERE pid=%d;",
       f_rid, f_rid, f_rid
    );
    blob_append_sql(&sql, " AND event.objid IN ok");
    db_multi_exec("%s", blob_sql_text(&sql));
    if( useDividers ) selectedRid = f_rid;
    blob_appendf(&desc, "Parents and children of check-in ");
    zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid);
    blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%!S", zUuid), zUuid);
    tmFlags |= TIMELINE_DISJOINT;

    style_submenu_checkbox("unhide", "Unhide", STYLE_CLUTTER, 0);
    style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c')|STYLE_CLUTTER, 0);

  }else{
    /* Otherwise, a timeline based on a span of time */
    int n;
    const char *zEType = "timeline item";
    char *zDate;
    Blob cond;
    blob_zero(&cond);
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253


2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
            rDate+ONE_SECOND, blob_sql_text(&cond))
        ){
          /* timeline_submenu(&url, "Newer", "a", zDate, "b"); */
          zNewerButton = fossil_strdup(url_render(&url, "a", zDate, "b", 0));
        }
        free(zDate);
      }
      if( !bBasic ){
        if( zType[0]=='a' || zType[0]=='c' ){
          style_submenu_checkbox("unhide", "Unhide", 0, 0);
        }
        style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c', 0);
        style_submenu_entry("n","Max:",4,0);
        timeline_y_submenu(disableY);
        style_submenu_entry("t", "Tag Filter:", -8, 0);
        style_submenu_multichoice("ms", count(azMatchStyles)/2, azMatchStyles, 0);
      }
    }
    blob_zero(&cond);
  }
  if( bBasic ){
    timeline_submenu(&url, "Details", "basic", 0, 0);
  }else{
    timeline_submenu(&url, "Declutter", "basic", "1", 0);
  }
  if( PB("showsql") ){
    @ <pre>%h(blob_sql_text(&sql))</pre>
  }
  if( search_restrict(SRCH_CKIN)!=0 ){
    style_submenu_element("Search", "%R/search?y=c");
  }


  if( PB("showid") ) tmFlags |= TIMELINE_SHOWRID;
  if( useDividers && zMark && zMark[0] ){
    double r = symbolic_name_to_mtime(zMark);
    if( r>0.0 ) selectedRid = timeline_add_divider(r);
  }
  blob_zero(&sql);
  db_prepare(&q, "SELECT * FROM timeline ORDER BY sortby DESC /*scan*/");
  @ <h2>%b(&desc)</h2>
  blob_reset(&desc);

  /* Report any errors. */
  if( zError ){
    @ <p class="generalError">%h(zError)</p>
  }
  if( bBasic ) tmFlags |= TIMELINE_BASIC;

  if( zNewerButton ){
    @ %z(xhref("class='button'","%z",zNewerButton))More&nbsp;&uarr;</a>
  }
  www_print_timeline(&q, tmFlags, zThisUser, zThisTag, selectedRid, 0);
  db_finalize(&q);
  if( zOlderButton ){







<
|
|
|
|
|
|
|
|
|
<

<
<
<
<
<







>
>














<







2246
2247
2248
2249
2250
2251
2252

2253
2254
2255
2256
2257
2258
2259
2260
2261

2262





2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285

2286
2287
2288
2289
2290
2291
2292
            rDate+ONE_SECOND, blob_sql_text(&cond))
        ){
          /* timeline_submenu(&url, "Newer", "a", zDate, "b"); */
          zNewerButton = fossil_strdup(url_render(&url, "a", zDate, "b", 0));
        }
        free(zDate);
      }

      if( zType[0]=='a' || zType[0]=='c' ){
        style_submenu_checkbox("unhide", "Unhide", STYLE_CLUTTER, 0);
      }
      style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c')|STYLE_CLUTTER,0);
      style_submenu_entry("n","Max:",4,STYLE_CLUTTER);
      timeline_y_submenu(disableY);
      style_submenu_entry("t", "Tag Filter:", -8, STYLE_CLUTTER);
      style_submenu_multichoice("ms", count(azMatchStyles)/2, azMatchStyles, STYLE_CLUTTER);
    }

    blob_zero(&cond);





  }
  if( PB("showsql") ){
    @ <pre>%h(blob_sql_text(&sql))</pre>
  }
  if( search_restrict(SRCH_CKIN)!=0 ){
    style_submenu_element("Search", "%R/search?y=c");
  }
  style_submenu_jsbutton("Advanced", STYLE_BASIC, "reclutter()");
  style_submenu_jsbutton("Basic", STYLE_CLUTTER, "declutter()");
  if( PB("showid") ) tmFlags |= TIMELINE_SHOWRID;
  if( useDividers && zMark && zMark[0] ){
    double r = symbolic_name_to_mtime(zMark);
    if( r>0.0 ) selectedRid = timeline_add_divider(r);
  }
  blob_zero(&sql);
  db_prepare(&q, "SELECT * FROM timeline ORDER BY sortby DESC /*scan*/");
  @ <h2>%b(&desc)</h2>
  blob_reset(&desc);

  /* Report any errors. */
  if( zError ){
    @ <p class="generalError">%h(zError)</p>
  }


  if( zNewerButton ){
    @ %z(xhref("class='button'","%z",zNewerButton))More&nbsp;&uarr;</a>
  }
  www_print_timeline(&q, tmFlags, zThisUser, zThisTag, selectedRid, 0);
  db_finalize(&q);
  if( zOlderButton ){