Fossil SCM

Simplify the interface to www_print_timeline() by shifting parameters into the TimelineXtra structure. Use "timelineCurrent" highlighting for the focus of context graphs and for the "/ckout" context graph. Adjust CSS to make timelineCurrent highlighting a little more visible.

drh 2026-05-06 14:18 UTC enhanced-checkin-edit
Commit 5c274a8790043f89b3f86448e84f82c1cfd17b3eddf45105b0c2a089930f639f
+2 -4
--- src/backlink.c
+++ src/backlink.c
@@ -62,12 +62,11 @@
6262
blob_zero(&sql);
6363
blob_append(&sql, timeline_query_for_www(), -1);
6464
blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
6565
db_prepare(&q, "%s", blob_sql_text(&sql));
6666
www_print_timeline(&q,
67
- TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL|TIMELINE_REFS,
68
- 0, 0, 0, 0, 0, 0);
67
+ TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL|TIMELINE_REFS, 0);
6968
db_finalize(&q);
7069
if( needEndPanel ){
7170
cgi_printf("</div>\n");
7271
}
7372
}
@@ -99,12 +98,11 @@
9998
);
10099
blob_zero(&sql);
101100
blob_append(&sql, timeline_query_for_www(), -1);
102101
blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
103102
db_prepare(&q, "%s", blob_sql_text(&sql));
104
- www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
105
- 0, 0, 0, 0, 0, 0);
103
+ www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,0);
106104
db_finalize(&q);
107105
style_finish_page();
108106
}
109107
110108
/*
111109
--- src/backlink.c
+++ src/backlink.c
@@ -62,12 +62,11 @@
62 blob_zero(&sql);
63 blob_append(&sql, timeline_query_for_www(), -1);
64 blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
65 db_prepare(&q, "%s", blob_sql_text(&sql));
66 www_print_timeline(&q,
67 TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL|TIMELINE_REFS,
68 0, 0, 0, 0, 0, 0);
69 db_finalize(&q);
70 if( needEndPanel ){
71 cgi_printf("</div>\n");
72 }
73 }
@@ -99,12 +98,11 @@
99 );
100 blob_zero(&sql);
101 blob_append(&sql, timeline_query_for_www(), -1);
102 blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
103 db_prepare(&q, "%s", blob_sql_text(&sql));
104 www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
105 0, 0, 0, 0, 0, 0);
106 db_finalize(&q);
107 style_finish_page();
108 }
109
110 /*
111
--- src/backlink.c
+++ src/backlink.c
@@ -62,12 +62,11 @@
62 blob_zero(&sql);
63 blob_append(&sql, timeline_query_for_www(), -1);
64 blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
65 db_prepare(&q, "%s", blob_sql_text(&sql));
66 www_print_timeline(&q,
67 TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL|TIMELINE_REFS, 0);
 
68 db_finalize(&q);
69 if( needEndPanel ){
70 cgi_printf("</div>\n");
71 }
72 }
@@ -99,12 +98,11 @@
98 );
99 blob_zero(&sql);
100 blob_append(&sql, timeline_query_for_www(), -1);
101 blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
102 db_prepare(&q, "%s", blob_sql_text(&sql));
103 www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,0);
 
104 db_finalize(&q);
105 style_finish_page();
106 }
107
108 /*
109
+1 -1
--- src/branch.c
+++ src/branch.c
@@ -1112,11 +1112,11 @@
11121112
}else{
11131113
tmFlags |= TIMELINE_BRCOLOR;
11141114
}
11151115
memset(&xtra, 0, sizeof(xtra));
11161116
xtra.xExtra = brtimeline_extra;
1117
- www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, &xtra);
1117
+ www_print_timeline(&q, tmFlags, &xtra);
11181118
db_finalize(&q);
11191119
style_finish_page();
11201120
}
11211121
11221122
/*
11231123
--- src/branch.c
+++ src/branch.c
@@ -1112,11 +1112,11 @@
1112 }else{
1113 tmFlags |= TIMELINE_BRCOLOR;
1114 }
1115 memset(&xtra, 0, sizeof(xtra));
1116 xtra.xExtra = brtimeline_extra;
1117 www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, &xtra);
1118 db_finalize(&q);
1119 style_finish_page();
1120 }
1121
1122 /*
1123
--- src/branch.c
+++ src/branch.c
@@ -1112,11 +1112,11 @@
1112 }else{
1113 tmFlags |= TIMELINE_BRCOLOR;
1114 }
1115 memset(&xtra, 0, sizeof(xtra));
1116 xtra.xExtra = brtimeline_extra;
1117 www_print_timeline(&q, tmFlags, &xtra);
1118 db_finalize(&q);
1119 style_finish_page();
1120 }
1121
1122 /*
1123
+1 -1
--- src/default.css
+++ src/default.css
@@ -35,11 +35,11 @@
3535
font-size: small;
3636
}
3737
tr.timelineCurrent {
3838
padding: .1em .2em;
3939
border: 1px dashed #446979;
40
- box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
40
+ box-shadow: 1px 1px 4px 1px rgba(0, 0, 0, 0.5);
4141
}
4242
.timelineSelected {
4343
padding: .1em .2em;
4444
border: 2px solid lightgray;
4545
background-color: #ffc;
4646
--- src/default.css
+++ src/default.css
@@ -35,11 +35,11 @@
35 font-size: small;
36 }
37 tr.timelineCurrent {
38 padding: .1em .2em;
39 border: 1px dashed #446979;
40 box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
41 }
42 .timelineSelected {
43 padding: .1em .2em;
44 border: 2px solid lightgray;
45 background-color: #ffc;
46
--- src/default.css
+++ src/default.css
@@ -35,11 +35,11 @@
35 font-size: small;
36 }
37 tr.timelineCurrent {
38 padding: .1em .2em;
39 border: 1px dashed #446979;
40 box-shadow: 1px 1px 4px 1px rgba(0, 0, 0, 0.5);
41 }
42 .timelineSelected {
43 padding: .1em .2em;
44 border: 2px solid lightgray;
45 background-color: #ffc;
46
--- src/descendants.c
+++ src/descendants.c
@@ -640,11 +640,11 @@
640640
** many descenders to (off-screen) parents. */
641641
tmFlags = TIMELINE_LEAFONLY | TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
642642
if( fNg==0 ) tmFlags |= TIMELINE_GRAPH;
643643
if( fBrBg ) tmFlags |= TIMELINE_BRCOLOR;
644644
if( fUBg ) tmFlags |= TIMELINE_UCOLOR;
645
- www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, 0);
645
+ www_print_timeline(&q, tmFlags, 0);
646646
db_finalize(&q);
647647
@ <br>
648648
style_finish_page();
649649
}
650650
651651
--- src/descendants.c
+++ src/descendants.c
@@ -640,11 +640,11 @@
640 ** many descenders to (off-screen) parents. */
641 tmFlags = TIMELINE_LEAFONLY | TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
642 if( fNg==0 ) tmFlags |= TIMELINE_GRAPH;
643 if( fBrBg ) tmFlags |= TIMELINE_BRCOLOR;
644 if( fUBg ) tmFlags |= TIMELINE_UCOLOR;
645 www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, 0);
646 db_finalize(&q);
647 @ <br>
648 style_finish_page();
649 }
650
651
--- src/descendants.c
+++ src/descendants.c
@@ -640,11 +640,11 @@
640 ** many descenders to (off-screen) parents. */
641 tmFlags = TIMELINE_LEAFONLY | TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
642 if( fNg==0 ) tmFlags |= TIMELINE_GRAPH;
643 if( fBrBg ) tmFlags |= TIMELINE_BRCOLOR;
644 if( fUBg ) tmFlags |= TIMELINE_UCOLOR;
645 www_print_timeline(&q, tmFlags, 0);
646 db_finalize(&q);
647 @ <br>
648 style_finish_page();
649 }
650
651
+18 -14
--- src/info.c
+++ src/info.c
@@ -276,17 +276,19 @@
276276
** check-in rid and rid2. rid2 might be zero, in which case only
277277
** show the context for rid1.
278278
*/
279279
void render_checkin_context(
280280
int rid, int rid2, /* One or two checkins for which to show context */
281
- int mRCCFlags, /* Flags. 1: parents only. 2: no-highlight */
281
+ int mRCCFlags, /* Flags. 1: parents only, 2: shadow-select rid */
282282
int mFlags /* Graph flags */
283283
){
284284
Blob sql;
285285
Stmt q;
286286
int rx[2];
287287
int i, n;
288
+ TimelineXtra xtra;
289
+
288290
rx[0] = rid;
289291
rx[1] = rid2;
290292
n = rid2 ? 2 : 1;
291293
blob_zero(&sql);
292294
blob_append(&sql, timeline_query_for_www(), -1);
@@ -318,21 +320,20 @@
318320
}
319321
}
320322
}
321323
blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
322324
db_prepare(&q, "%s", blob_sql_text(&sql));
325
+ memset(&xtra, 0, sizeof(xtra));
323326
if( mRCCFlags & 0x02 ){
324
- rid = rid2 = 0;
325
- }
326
- www_print_timeline(&q,
327
- mFlags
328
- |TIMELINE_GRAPH
329
- |TIMELINE_FILLGAPS
330
- |TIMELINE_NOSCROLL
331
- |TIMELINE_XMERGE
332
- |TIMELINE_CHPICK,
333
- 0, 0, 0, rid, rid2, 0);
327
+ xtra.currentRid = rid;
328
+ }else{
329
+ xtra.selectedRid = rid;
330
+ xtra.secondRid = rid2;
331
+ }
332
+ mFlags |= TIMELINE_GRAPH|TIMELINE_FILLGAPS|TIMELINE_NOSCROLL|
333
+ TIMELINE_XMERGE|TIMELINE_CHPICK;
334
+ www_print_timeline(&q, mFlags, &xtra);
334335
db_finalize(&q);
335336
blob_reset(&sql);
336337
}
337338
338339
@@ -516,10 +517,11 @@
516517
int rid;
517518
Stmt q;
518519
int cnt = 0;
519520
Blob sql;
520521
char const *zType;
522
+ TimelineXtra xtra;
521523
522524
login_check_credentials();
523525
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
524526
rid = name_to_rid_www("name");
525527
if( rid==0 ){
@@ -615,12 +617,14 @@
615617
#endif
616618
blob_zero(&sql);
617619
blob_append(&sql, timeline_query_for_www(), -1);
618620
blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
619621
db_prepare(&q, "%s", blob_sql_text(&sql));
622
+ memset(&xtra, 0, sizeof(xtra));
623
+ xtra.selectedRid = rid;
620624
www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
621
- 0, 0, 0, rid, 0, 0);
625
+ &xtra);
622626
db_finalize(&q);
623627
style_finish_page();
624628
}
625629
626630
/*
@@ -884,11 +888,11 @@
884888
if( zHostname ){
885889
style_header("Checkout Status: %h on %h", zCwd, zHostname);
886890
}else{
887891
style_header("Checkout Status: %h", zCwd);
888892
}
889
- render_checkin_context(vid, 0, 0, 0);
893
+ render_checkin_context(vid, 0, 2, 0);
890894
@ <hr>
891895
zExBase = P("exbase");
892896
if( zExBase && zExBase[0] ){
893897
char *zPath = decode16_dup(zExBase);
894898
char *zCBase = file_canonical_name_dup(zPath?zPath:zExBase);
@@ -1191,11 +1195,11 @@
11911195
wiki_render_associated("checkin", zUuid, 0);
11921196
}
11931197
render_backlink_graph(zUuid,
11941198
"<div class=\"section accordion\">References</div>\n");
11951199
@ <div class="section accordion">Context</div><div class="accordion_panel">
1196
- render_checkin_context(rid, 0, 0, 0);
1200
+ render_checkin_context(rid, 0, 2, 0);
11971201
@ </div><div class="section accordion" id="changes_section">Changes</div>
11981202
@ <div class="accordion_panel">
11991203
@ <div class="sectionmenu info-changes-menu">
12001204
/* ^^^ .info-changes-menu is used by diff scroll sync */
12011205
pCfg = construct_diff_flags(diffType, &DCfg);
12021206
--- src/info.c
+++ src/info.c
@@ -276,17 +276,19 @@
276 ** check-in rid and rid2. rid2 might be zero, in which case only
277 ** show the context for rid1.
278 */
279 void render_checkin_context(
280 int rid, int rid2, /* One or two checkins for which to show context */
281 int mRCCFlags, /* Flags. 1: parents only. 2: no-highlight */
282 int mFlags /* Graph flags */
283 ){
284 Blob sql;
285 Stmt q;
286 int rx[2];
287 int i, n;
 
 
288 rx[0] = rid;
289 rx[1] = rid2;
290 n = rid2 ? 2 : 1;
291 blob_zero(&sql);
292 blob_append(&sql, timeline_query_for_www(), -1);
@@ -318,21 +320,20 @@
318 }
319 }
320 }
321 blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
322 db_prepare(&q, "%s", blob_sql_text(&sql));
 
323 if( mRCCFlags & 0x02 ){
324 rid = rid2 = 0;
325 }
326 www_print_timeline(&q,
327 mFlags
328 |TIMELINE_GRAPH
329 |TIMELINE_FILLGAPS
330 |TIMELINE_NOSCROLL
331 |TIMELINE_XMERGE
332 |TIMELINE_CHPICK,
333 0, 0, 0, rid, rid2, 0);
334 db_finalize(&q);
335 blob_reset(&sql);
336 }
337
338
@@ -516,10 +517,11 @@
516 int rid;
517 Stmt q;
518 int cnt = 0;
519 Blob sql;
520 char const *zType;
 
521
522 login_check_credentials();
523 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
524 rid = name_to_rid_www("name");
525 if( rid==0 ){
@@ -615,12 +617,14 @@
615 #endif
616 blob_zero(&sql);
617 blob_append(&sql, timeline_query_for_www(), -1);
618 blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
619 db_prepare(&q, "%s", blob_sql_text(&sql));
 
 
620 www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
621 0, 0, 0, rid, 0, 0);
622 db_finalize(&q);
623 style_finish_page();
624 }
625
626 /*
@@ -884,11 +888,11 @@
884 if( zHostname ){
885 style_header("Checkout Status: %h on %h", zCwd, zHostname);
886 }else{
887 style_header("Checkout Status: %h", zCwd);
888 }
889 render_checkin_context(vid, 0, 0, 0);
890 @ <hr>
891 zExBase = P("exbase");
892 if( zExBase && zExBase[0] ){
893 char *zPath = decode16_dup(zExBase);
894 char *zCBase = file_canonical_name_dup(zPath?zPath:zExBase);
@@ -1191,11 +1195,11 @@
1191 wiki_render_associated("checkin", zUuid, 0);
1192 }
1193 render_backlink_graph(zUuid,
1194 "<div class=\"section accordion\">References</div>\n");
1195 @ <div class="section accordion">Context</div><div class="accordion_panel">
1196 render_checkin_context(rid, 0, 0, 0);
1197 @ </div><div class="section accordion" id="changes_section">Changes</div>
1198 @ <div class="accordion_panel">
1199 @ <div class="sectionmenu info-changes-menu">
1200 /* ^^^ .info-changes-menu is used by diff scroll sync */
1201 pCfg = construct_diff_flags(diffType, &DCfg);
1202
--- src/info.c
+++ src/info.c
@@ -276,17 +276,19 @@
276 ** check-in rid and rid2. rid2 might be zero, in which case only
277 ** show the context for rid1.
278 */
279 void render_checkin_context(
280 int rid, int rid2, /* One or two checkins for which to show context */
281 int mRCCFlags, /* Flags. 1: parents only, 2: shadow-select rid */
282 int mFlags /* Graph flags */
283 ){
284 Blob sql;
285 Stmt q;
286 int rx[2];
287 int i, n;
288 TimelineXtra xtra;
289
290 rx[0] = rid;
291 rx[1] = rid2;
292 n = rid2 ? 2 : 1;
293 blob_zero(&sql);
294 blob_append(&sql, timeline_query_for_www(), -1);
@@ -318,21 +320,20 @@
320 }
321 }
322 }
323 blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
324 db_prepare(&q, "%s", blob_sql_text(&sql));
325 memset(&xtra, 0, sizeof(xtra));
326 if( mRCCFlags & 0x02 ){
327 xtra.currentRid = rid;
328 }else{
329 xtra.selectedRid = rid;
330 xtra.secondRid = rid2;
331 }
332 mFlags |= TIMELINE_GRAPH|TIMELINE_FILLGAPS|TIMELINE_NOSCROLL|
333 TIMELINE_XMERGE|TIMELINE_CHPICK;
334 www_print_timeline(&q, mFlags, &xtra);
 
 
335 db_finalize(&q);
336 blob_reset(&sql);
337 }
338
339
@@ -516,10 +517,11 @@
517 int rid;
518 Stmt q;
519 int cnt = 0;
520 Blob sql;
521 char const *zType;
522 TimelineXtra xtra;
523
524 login_check_credentials();
525 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
526 rid = name_to_rid_www("name");
527 if( rid==0 ){
@@ -615,12 +617,14 @@
617 #endif
618 blob_zero(&sql);
619 blob_append(&sql, timeline_query_for_www(), -1);
620 blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
621 db_prepare(&q, "%s", blob_sql_text(&sql));
622 memset(&xtra, 0, sizeof(xtra));
623 xtra.selectedRid = rid;
624 www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
625 &xtra);
626 db_finalize(&q);
627 style_finish_page();
628 }
629
630 /*
@@ -884,11 +888,11 @@
888 if( zHostname ){
889 style_header("Checkout Status: %h on %h", zCwd, zHostname);
890 }else{
891 style_header("Checkout Status: %h", zCwd);
892 }
893 render_checkin_context(vid, 0, 2, 0);
894 @ <hr>
895 zExBase = P("exbase");
896 if( zExBase && zExBase[0] ){
897 char *zPath = decode16_dup(zExBase);
898 char *zCBase = file_canonical_name_dup(zPath?zPath:zExBase);
@@ -1191,11 +1195,11 @@
1195 wiki_render_associated("checkin", zUuid, 0);
1196 }
1197 render_backlink_graph(zUuid,
1198 "<div class=\"section accordion\">References</div>\n");
1199 @ <div class="section accordion">Context</div><div class="accordion_panel">
1200 render_checkin_context(rid, 0, 2, 0);
1201 @ </div><div class="section accordion" id="changes_section">Changes</div>
1202 @ <div class="accordion_panel">
1203 @ <div class="sectionmenu info-changes-menu">
1204 /* ^^^ .info-changes-menu is used by diff scroll sync */
1205 pCfg = construct_diff_flags(diffType, &DCfg);
1206
+1 -1
--- src/moderate.c
+++ src/moderate.c
@@ -186,11 +186,11 @@
186186
blob_append_sql(&sql,
187187
" AND event.objid IN (SELECT objid FROM modreq)"
188188
" ORDER BY event.mtime DESC"
189189
);
190190
db_prepare(&q, "%s", blob_sql_text(&sql));
191
- www_print_timeline(&q, 0, 0, 0, 0, 0, 0, 0);
191
+ www_print_timeline(&q, 0, 0);
192192
db_finalize(&q);
193193
}
194194
style_finish_page();
195195
}
196196
197197
--- src/moderate.c
+++ src/moderate.c
@@ -186,11 +186,11 @@
186 blob_append_sql(&sql,
187 " AND event.objid IN (SELECT objid FROM modreq)"
188 " ORDER BY event.mtime DESC"
189 );
190 db_prepare(&q, "%s", blob_sql_text(&sql));
191 www_print_timeline(&q, 0, 0, 0, 0, 0, 0, 0);
192 db_finalize(&q);
193 }
194 style_finish_page();
195 }
196
197
--- src/moderate.c
+++ src/moderate.c
@@ -186,11 +186,11 @@
186 blob_append_sql(&sql,
187 " AND event.objid IN (SELECT objid FROM modreq)"
188 " ORDER BY event.mtime DESC"
189 );
190 db_prepare(&q, "%s", blob_sql_text(&sql));
191 www_print_timeline(&q, 0, 0);
192 db_finalize(&q);
193 }
194 style_finish_page();
195 }
196
197
+1 -1
--- src/tag.c
+++ src/tag.c
@@ -938,11 +938,11 @@
938938
** many descenders to (off-screen) parents. */
939939
tmFlags = TIMELINE_XMERGE | TIMELINE_FILLGAPS | TIMELINE_NOSCROLL;
940940
if( PB("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
941941
if( PB("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
942942
if( PB("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
943
- www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, 0);
943
+ www_print_timeline(&q, tmFlags, 0);
944944
db_finalize(&q);
945945
@ <br>
946946
style_finish_page();
947947
}
948948
949949
--- src/tag.c
+++ src/tag.c
@@ -938,11 +938,11 @@
938 ** many descenders to (off-screen) parents. */
939 tmFlags = TIMELINE_XMERGE | TIMELINE_FILLGAPS | TIMELINE_NOSCROLL;
940 if( PB("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
941 if( PB("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
942 if( PB("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
943 www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, 0);
944 db_finalize(&q);
945 @ <br>
946 style_finish_page();
947 }
948
949
--- src/tag.c
+++ src/tag.c
@@ -938,11 +938,11 @@
938 ** many descenders to (off-screen) parents. */
939 tmFlags = TIMELINE_XMERGE | TIMELINE_FILLGAPS | TIMELINE_NOSCROLL;
940 if( PB("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
941 if( PB("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
942 if( PB("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
943 www_print_timeline(&q, tmFlags, 0);
944 db_finalize(&q);
945 @ <br>
946 style_finish_page();
947 }
948
949
+1 -1
--- src/tar.c
+++ src/tar.c
@@ -1264,11 +1264,11 @@
12641264
12651265
tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL | TIMELINE_COLUMNAR
12661266
| TIMELINE_BRCOLOR;
12671267
memset(&xtra, 0, sizeof(xtra));
12681268
xtra.xExtra = download_extra;
1269
- www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, &xtra);
1269
+ www_print_timeline(&q, tmFlags, &xtra);
12701270
db_finalize(&q);
12711271
}
12721272
if( g.perm.Clone ){
12731273
char *zNm = fossil_strdup(db_get("project-name","clone"));
12741274
sanitize_name(zNm);
12751275
--- src/tar.c
+++ src/tar.c
@@ -1264,11 +1264,11 @@
1264
1265 tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL | TIMELINE_COLUMNAR
1266 | TIMELINE_BRCOLOR;
1267 memset(&xtra, 0, sizeof(xtra));
1268 xtra.xExtra = download_extra;
1269 www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, &xtra);
1270 db_finalize(&q);
1271 }
1272 if( g.perm.Clone ){
1273 char *zNm = fossil_strdup(db_get("project-name","clone"));
1274 sanitize_name(zNm);
1275
--- src/tar.c
+++ src/tar.c
@@ -1264,11 +1264,11 @@
1264
1265 tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL | TIMELINE_COLUMNAR
1266 | TIMELINE_BRCOLOR;
1267 memset(&xtra, 0, sizeof(xtra));
1268 xtra.xExtra = download_extra;
1269 www_print_timeline(&q, tmFlags, &xtra);
1270 db_finalize(&q);
1271 }
1272 if( g.perm.Clone ){
1273 char *zNm = fossil_strdup(db_get("project-name","clone"));
1274 sanitize_name(zNm);
1275
+31 -20
--- src/timeline.c
+++ src/timeline.c
@@ -316,10 +316,16 @@
316316
** www_print_timeline() as the last (8th) argument.
317317
*/
318318
#if INTERFACE
319319
struct TimelineXtra {
320320
void (*xExtra)(Stmt*,int,const char*,const char*); /* generate "extra" text */
321
+ const char *zThisUser; /* Suppress links to this user */
322
+ const char *zThisTag; /* Suppress links to this tag */
323
+ Matcher *pLeftBranch; /* Comparison function to use for zLeftBranch */
324
+ int selectedRid; /* CSS: timelineSelected */
325
+ int secondRid; /* CSS: timelineSelected timelineSecondary */
326
+ int currentRid; /* CSS: timelineCurrent */
321327
};
322328
#endif
323329
324330
325331
/*
@@ -374,15 +380,10 @@
374380
** 10. Short comment to user for repeated tickets and wiki
375381
*/
376382
void www_print_timeline(
377383
Stmt *pQuery, /* Query to implement the timeline */
378384
int tmFlags, /* Flags controlling display behavior */
379
- const char *zThisUser, /* Suppress links to this user */
380
- const char *zThisTag, /* Suppress links to this tag */
381
- Matcher *pLeftBranch, /* Comparison function to use for zLeftBranch */
382
- int selectedRid, /* Highlight the line with this RID value or zero */
383
- int secondRid, /* Secondary highlight (or zero) */
384385
TimelineXtra *pXtra /* Supplemental information */
385386
){
386387
int mxWikiLen;
387388
Blob comment;
388389
int prevTagid = 0;
@@ -400,12 +401,19 @@
400401
const char *zDateFmt;
401402
int iTableId = timeline_tableid();
402403
int bTimestampLinksToInfo; /* True if timestamp hyperlinks go to the /info
403404
** page rather than the /timeline page */
404405
const char *zMainBranch = db_main_branch();
406
+ TimelineXtra zeroXtra; /* Substitute for pXtra==NULL */
405407
406
- if( cgi_is_loopback(g.zIpAddr) && db_open_local(0) ){
408
+ if( pXtra==0 ){
409
+ memset(&zeroXtra, 0, sizeof(zeroXtra));
410
+ pXtra = &zeroXtra;
411
+ }
412
+ if( pXtra->currentRid ){
413
+ vid = pXtra->currentRid;
414
+ }else if( cgi_is_loopback(g.zIpAddr) && db_open_local(0) ){
407415
vid = db_lget_int("checkout", 0);
408416
}
409417
zPrevDate[0] = 0;
410418
mxWikiLen = db_get_int("timeline-max-comment", 0);
411419
dateFormat = db_get_int("timeline-date-format", 0);
@@ -522,19 +530,18 @@
522530
zTime[pos++] = 0;
523531
}else{
524532
zTime[0] = 0;
525533
}
526534
pendingEndTr = 1;
527
- if( rid==selectedRid ){
535
+ if( rid==pXtra->selectedRid ){
528536
@ <tr class="timelineSelected">
529537
isSelectedOrCurrent = 1;
530
- }else if( rid==secondRid ){
538
+ }else if( rid==pXtra->secondRid ){
531539
@ <tr class="timelineSelected timelineSecondary">
532540
isSelectedOrCurrent = 1;
533541
}else if( rid==vid ){
534542
@ <tr class="timelineCurrent">
535
- isSelectedOrCurrent = 1;
536543
}else {
537544
@ <tr>
538545
}
539546
if( zType[0]=='t' && tagid && (tmFlags & TIMELINE_NOTKT)==0 ){
540547
char *zTktid = db_text(0, "SELECT substr(tagname,5) FROM tag"
@@ -790,14 +797,14 @@
790797
}
791798
if( tmFlags & TIMELINE_COMPACT ){
792799
cgi_printf("<span class='clutter' id='detail-%d'>",rid);
793800
}
794801
cgi_printf("<span class='timeline%sDetail'>", zStyle);
795
- if( pXtra && pXtra->xExtra ){
796
- pXtra->xExtra(pQuery, tmFlags, zThisUser, zThisTag);
802
+ if( pXtra->xExtra ){
803
+ pXtra->xExtra(pQuery, tmFlags, pXtra->zThisUser, pXtra->zThisTag);
797804
}else{
798
- timeline_extra(pQuery, tmFlags, zThisUser, zThisTag);
805
+ timeline_extra(pQuery, tmFlags, pXtra->zThisUser, pXtra->zThisTag);
799806
}
800807
if( tmFlags & TIMELINE_COMPACT ){
801808
@ </span></span>
802809
}else{
803810
@ </span>
@@ -917,11 +924,11 @@
917924
}
918925
if( pendingEndTr ){
919926
@ </td></tr>
920927
}
921928
if( pGraph ){
922
- graph_finish(pGraph, pLeftBranch, tmFlags);
929
+ graph_finish(pGraph, pXtra->pLeftBranch, tmFlags);
923930
if( pGraph->nErr ){
924931
graph_free(pGraph);
925932
pGraph = 0;
926933
}else{
927934
@ <tr class="timelineBottom" id="btm-%d(iTableId)">\
@@ -3269,26 +3276,30 @@
32693276
@ %z(chref("button","%s",zNewerButton))%h(zNewerButtonLabel)\
32703277
@ &nbsp;&uarr;</a>
32713278
}
32723279
cgi_check_for_malice();
32733280
{
3274
- Matcher *pLeftBranch;
3281
+ TimelineXtra xtra;
32753282
const char *zPattern = P("sl");
3283
+ memset(&xtra, 0, sizeof(xtra));
32763284
if( zPattern!=0 ){
32773285
MatchStyle ms;
32783286
if( zMatchStyle!=0 ){
32793287
ms = matchStyle;
32803288
}else{
32813289
ms = strpbrk(zPattern,"*[?")!=0 ? MS_GLOB : MS_BRLIST;
32823290
}
3283
- pLeftBranch = match_create(ms,zPattern);
3291
+ xtra.pLeftBranch = match_create(ms,zPattern);
32843292
}else{
3285
- pLeftBranch = match_create(matchStyle, zBrName?zBrName:zTagName);
3293
+ xtra.pLeftBranch = match_create(matchStyle, zBrName?zBrName:zTagName);
32863294
}
3287
- www_print_timeline(&q, tmFlags, zThisUser, zThisTag, pLeftBranch,
3288
- selectedRid, secondaryRid, 0);
3289
- match_free(pLeftBranch);
3295
+ xtra.zThisUser = zThisUser;
3296
+ xtra.zThisTag = zThisTag;
3297
+ xtra.selectedRid = selectedRid;
3298
+ xtra.secondRid = secondaryRid;
3299
+ www_print_timeline(&q, tmFlags, &xtra);
3300
+ match_free(xtra.pLeftBranch);
32903301
}
32913302
db_finalize(&q);
32923303
if( zOlderButton ){
32933304
@ %z(chref("button","%s",zOlderButton))%h(zOlderButtonLabel)\
32943305
@ &nbsp;&darr;</a>
@@ -4090,11 +4101,11 @@
40904101
zId = db_text(0, "SELECT timestamp FROM timeline"
40914102
" ORDER BY sortby DESC LIMIT 1");
40924103
@ <h2>%d(iAgo) Year%s(iAgo>1?"s":"") Ago
40934104
@ <small>%z(href("%R/timeline?c=%t",zId))(more context)</a>\
40944105
@ </small></h2>
4095
- www_print_timeline(&q, TIMELINE_GRAPH, 0, 0, 0, 0, 0, 0);
4106
+ www_print_timeline(&q, TIMELINE_GRAPH, 0);
40964107
}
40974108
db_finalize(&q);
40984109
style_finish_page();
40994110
}
41004111
41014112
--- src/timeline.c
+++ src/timeline.c
@@ -316,10 +316,16 @@
316 ** www_print_timeline() as the last (8th) argument.
317 */
318 #if INTERFACE
319 struct TimelineXtra {
320 void (*xExtra)(Stmt*,int,const char*,const char*); /* generate "extra" text */
 
 
 
 
 
 
321 };
322 #endif
323
324
325 /*
@@ -374,15 +380,10 @@
374 ** 10. Short comment to user for repeated tickets and wiki
375 */
376 void www_print_timeline(
377 Stmt *pQuery, /* Query to implement the timeline */
378 int tmFlags, /* Flags controlling display behavior */
379 const char *zThisUser, /* Suppress links to this user */
380 const char *zThisTag, /* Suppress links to this tag */
381 Matcher *pLeftBranch, /* Comparison function to use for zLeftBranch */
382 int selectedRid, /* Highlight the line with this RID value or zero */
383 int secondRid, /* Secondary highlight (or zero) */
384 TimelineXtra *pXtra /* Supplemental information */
385 ){
386 int mxWikiLen;
387 Blob comment;
388 int prevTagid = 0;
@@ -400,12 +401,19 @@
400 const char *zDateFmt;
401 int iTableId = timeline_tableid();
402 int bTimestampLinksToInfo; /* True if timestamp hyperlinks go to the /info
403 ** page rather than the /timeline page */
404 const char *zMainBranch = db_main_branch();
 
405
406 if( cgi_is_loopback(g.zIpAddr) && db_open_local(0) ){
 
 
 
 
 
 
407 vid = db_lget_int("checkout", 0);
408 }
409 zPrevDate[0] = 0;
410 mxWikiLen = db_get_int("timeline-max-comment", 0);
411 dateFormat = db_get_int("timeline-date-format", 0);
@@ -522,19 +530,18 @@
522 zTime[pos++] = 0;
523 }else{
524 zTime[0] = 0;
525 }
526 pendingEndTr = 1;
527 if( rid==selectedRid ){
528 @ <tr class="timelineSelected">
529 isSelectedOrCurrent = 1;
530 }else if( rid==secondRid ){
531 @ <tr class="timelineSelected timelineSecondary">
532 isSelectedOrCurrent = 1;
533 }else if( rid==vid ){
534 @ <tr class="timelineCurrent">
535 isSelectedOrCurrent = 1;
536 }else {
537 @ <tr>
538 }
539 if( zType[0]=='t' && tagid && (tmFlags & TIMELINE_NOTKT)==0 ){
540 char *zTktid = db_text(0, "SELECT substr(tagname,5) FROM tag"
@@ -790,14 +797,14 @@
790 }
791 if( tmFlags & TIMELINE_COMPACT ){
792 cgi_printf("<span class='clutter' id='detail-%d'>",rid);
793 }
794 cgi_printf("<span class='timeline%sDetail'>", zStyle);
795 if( pXtra && pXtra->xExtra ){
796 pXtra->xExtra(pQuery, tmFlags, zThisUser, zThisTag);
797 }else{
798 timeline_extra(pQuery, tmFlags, zThisUser, zThisTag);
799 }
800 if( tmFlags & TIMELINE_COMPACT ){
801 @ </span></span>
802 }else{
803 @ </span>
@@ -917,11 +924,11 @@
917 }
918 if( pendingEndTr ){
919 @ </td></tr>
920 }
921 if( pGraph ){
922 graph_finish(pGraph, pLeftBranch, tmFlags);
923 if( pGraph->nErr ){
924 graph_free(pGraph);
925 pGraph = 0;
926 }else{
927 @ <tr class="timelineBottom" id="btm-%d(iTableId)">\
@@ -3269,26 +3276,30 @@
3269 @ %z(chref("button","%s",zNewerButton))%h(zNewerButtonLabel)\
3270 @ &nbsp;&uarr;</a>
3271 }
3272 cgi_check_for_malice();
3273 {
3274 Matcher *pLeftBranch;
3275 const char *zPattern = P("sl");
 
3276 if( zPattern!=0 ){
3277 MatchStyle ms;
3278 if( zMatchStyle!=0 ){
3279 ms = matchStyle;
3280 }else{
3281 ms = strpbrk(zPattern,"*[?")!=0 ? MS_GLOB : MS_BRLIST;
3282 }
3283 pLeftBranch = match_create(ms,zPattern);
3284 }else{
3285 pLeftBranch = match_create(matchStyle, zBrName?zBrName:zTagName);
3286 }
3287 www_print_timeline(&q, tmFlags, zThisUser, zThisTag, pLeftBranch,
3288 selectedRid, secondaryRid, 0);
3289 match_free(pLeftBranch);
 
 
 
3290 }
3291 db_finalize(&q);
3292 if( zOlderButton ){
3293 @ %z(chref("button","%s",zOlderButton))%h(zOlderButtonLabel)\
3294 @ &nbsp;&darr;</a>
@@ -4090,11 +4101,11 @@
4090 zId = db_text(0, "SELECT timestamp FROM timeline"
4091 " ORDER BY sortby DESC LIMIT 1");
4092 @ <h2>%d(iAgo) Year%s(iAgo>1?"s":"") Ago
4093 @ <small>%z(href("%R/timeline?c=%t",zId))(more context)</a>\
4094 @ </small></h2>
4095 www_print_timeline(&q, TIMELINE_GRAPH, 0, 0, 0, 0, 0, 0);
4096 }
4097 db_finalize(&q);
4098 style_finish_page();
4099 }
4100
4101
--- src/timeline.c
+++ src/timeline.c
@@ -316,10 +316,16 @@
316 ** www_print_timeline() as the last (8th) argument.
317 */
318 #if INTERFACE
319 struct TimelineXtra {
320 void (*xExtra)(Stmt*,int,const char*,const char*); /* generate "extra" text */
321 const char *zThisUser; /* Suppress links to this user */
322 const char *zThisTag; /* Suppress links to this tag */
323 Matcher *pLeftBranch; /* Comparison function to use for zLeftBranch */
324 int selectedRid; /* CSS: timelineSelected */
325 int secondRid; /* CSS: timelineSelected timelineSecondary */
326 int currentRid; /* CSS: timelineCurrent */
327 };
328 #endif
329
330
331 /*
@@ -374,15 +380,10 @@
380 ** 10. Short comment to user for repeated tickets and wiki
381 */
382 void www_print_timeline(
383 Stmt *pQuery, /* Query to implement the timeline */
384 int tmFlags, /* Flags controlling display behavior */
 
 
 
 
 
385 TimelineXtra *pXtra /* Supplemental information */
386 ){
387 int mxWikiLen;
388 Blob comment;
389 int prevTagid = 0;
@@ -400,12 +401,19 @@
401 const char *zDateFmt;
402 int iTableId = timeline_tableid();
403 int bTimestampLinksToInfo; /* True if timestamp hyperlinks go to the /info
404 ** page rather than the /timeline page */
405 const char *zMainBranch = db_main_branch();
406 TimelineXtra zeroXtra; /* Substitute for pXtra==NULL */
407
408 if( pXtra==0 ){
409 memset(&zeroXtra, 0, sizeof(zeroXtra));
410 pXtra = &zeroXtra;
411 }
412 if( pXtra->currentRid ){
413 vid = pXtra->currentRid;
414 }else if( cgi_is_loopback(g.zIpAddr) && db_open_local(0) ){
415 vid = db_lget_int("checkout", 0);
416 }
417 zPrevDate[0] = 0;
418 mxWikiLen = db_get_int("timeline-max-comment", 0);
419 dateFormat = db_get_int("timeline-date-format", 0);
@@ -522,19 +530,18 @@
530 zTime[pos++] = 0;
531 }else{
532 zTime[0] = 0;
533 }
534 pendingEndTr = 1;
535 if( rid==pXtra->selectedRid ){
536 @ <tr class="timelineSelected">
537 isSelectedOrCurrent = 1;
538 }else if( rid==pXtra->secondRid ){
539 @ <tr class="timelineSelected timelineSecondary">
540 isSelectedOrCurrent = 1;
541 }else if( rid==vid ){
542 @ <tr class="timelineCurrent">
 
543 }else {
544 @ <tr>
545 }
546 if( zType[0]=='t' && tagid && (tmFlags & TIMELINE_NOTKT)==0 ){
547 char *zTktid = db_text(0, "SELECT substr(tagname,5) FROM tag"
@@ -790,14 +797,14 @@
797 }
798 if( tmFlags & TIMELINE_COMPACT ){
799 cgi_printf("<span class='clutter' id='detail-%d'>",rid);
800 }
801 cgi_printf("<span class='timeline%sDetail'>", zStyle);
802 if( pXtra->xExtra ){
803 pXtra->xExtra(pQuery, tmFlags, pXtra->zThisUser, pXtra->zThisTag);
804 }else{
805 timeline_extra(pQuery, tmFlags, pXtra->zThisUser, pXtra->zThisTag);
806 }
807 if( tmFlags & TIMELINE_COMPACT ){
808 @ </span></span>
809 }else{
810 @ </span>
@@ -917,11 +924,11 @@
924 }
925 if( pendingEndTr ){
926 @ </td></tr>
927 }
928 if( pGraph ){
929 graph_finish(pGraph, pXtra->pLeftBranch, tmFlags);
930 if( pGraph->nErr ){
931 graph_free(pGraph);
932 pGraph = 0;
933 }else{
934 @ <tr class="timelineBottom" id="btm-%d(iTableId)">\
@@ -3269,26 +3276,30 @@
3276 @ %z(chref("button","%s",zNewerButton))%h(zNewerButtonLabel)\
3277 @ &nbsp;&uarr;</a>
3278 }
3279 cgi_check_for_malice();
3280 {
3281 TimelineXtra xtra;
3282 const char *zPattern = P("sl");
3283 memset(&xtra, 0, sizeof(xtra));
3284 if( zPattern!=0 ){
3285 MatchStyle ms;
3286 if( zMatchStyle!=0 ){
3287 ms = matchStyle;
3288 }else{
3289 ms = strpbrk(zPattern,"*[?")!=0 ? MS_GLOB : MS_BRLIST;
3290 }
3291 xtra.pLeftBranch = match_create(ms,zPattern);
3292 }else{
3293 xtra.pLeftBranch = match_create(matchStyle, zBrName?zBrName:zTagName);
3294 }
3295 xtra.zThisUser = zThisUser;
3296 xtra.zThisTag = zThisTag;
3297 xtra.selectedRid = selectedRid;
3298 xtra.secondRid = secondaryRid;
3299 www_print_timeline(&q, tmFlags, &xtra);
3300 match_free(xtra.pLeftBranch);
3301 }
3302 db_finalize(&q);
3303 if( zOlderButton ){
3304 @ %z(chref("button","%s",zOlderButton))%h(zOlderButtonLabel)\
3305 @ &nbsp;&darr;</a>
@@ -4090,11 +4101,11 @@
4101 zId = db_text(0, "SELECT timestamp FROM timeline"
4102 " ORDER BY sortby DESC LIMIT 1");
4103 @ <h2>%d(iAgo) Year%s(iAgo>1?"s":"") Ago
4104 @ <small>%z(href("%R/timeline?c=%t",zId))(more context)</a>\
4105 @ </small></h2>
4106 www_print_timeline(&q, TIMELINE_GRAPH, 0);
4107 }
4108 db_finalize(&q);
4109 style_finish_page();
4110 }
4111
4112
+1 -1
--- src/tkt.c
+++ src/tkt.c
@@ -1218,11 +1218,11 @@
12181218
}
12191219
db_prepare(&q, "%z", zSQL/*safe-for-%s*/);
12201220
www_print_timeline(&q,
12211221
TIMELINE_ARTID | TIMELINE_DISJOINT | TIMELINE_GRAPH | TIMELINE_NOTKT |
12221222
TIMELINE_REFS,
1223
- 0, 0, 0, 0, 0, 0);
1223
+ 0);
12241224
db_finalize(&q);
12251225
fossil_free(zFullUuid);
12261226
}
12271227
12281228
/*
12291229
--- src/tkt.c
+++ src/tkt.c
@@ -1218,11 +1218,11 @@
1218 }
1219 db_prepare(&q, "%z", zSQL/*safe-for-%s*/);
1220 www_print_timeline(&q,
1221 TIMELINE_ARTID | TIMELINE_DISJOINT | TIMELINE_GRAPH | TIMELINE_NOTKT |
1222 TIMELINE_REFS,
1223 0, 0, 0, 0, 0, 0);
1224 db_finalize(&q);
1225 fossil_free(zFullUuid);
1226 }
1227
1228 /*
1229
--- src/tkt.c
+++ src/tkt.c
@@ -1218,11 +1218,11 @@
1218 }
1219 db_prepare(&q, "%z", zSQL/*safe-for-%s*/);
1220 www_print_timeline(&q,
1221 TIMELINE_ARTID | TIMELINE_DISJOINT | TIMELINE_GRAPH | TIMELINE_NOTKT |
1222 TIMELINE_REFS,
1223 0);
1224 db_finalize(&q);
1225 fossil_free(zFullUuid);
1226 }
1227
1228 /*
1229

Keyboard Shortcuts

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