Fossil SCM

Expose timeline circles, arrowheads, and branch rail colors as settings

jmoger 2015-03-19 23:57 differentiate-timeline
Commit fb9b3707b854c2a59e2fd6650bd1b8b58c526047
--- skins/xekri/css.txt
+++ skins/xekri/css.txt
@@ -649,14 +649,14 @@
649649
/**************************************
650650
* Timeline
651651
*/
652652
653653
#canvas {
654
- color: darkGray;
655
- border-color: black;
656
- outline-color: white;
657
- background-color: #0a0;
654
+ color: darkGray; /* default rail/line color */
655
+ border-color: black; /* default branch node/box color */
656
+ outline-color: white; /* leaf indicator color */
657
+ background-color: #0a0; /* node/box border color */
658658
}
659659
660660
div.divider {
661661
color: #ee0;
662662
font-size: 1.2rem;
663663
--- skins/xekri/css.txt
+++ skins/xekri/css.txt
@@ -649,14 +649,14 @@
649 /**************************************
650 * Timeline
651 */
652
653 #canvas {
654 color: darkGray;
655 border-color: black;
656 outline-color: white;
657 background-color: #0a0;
658 }
659
660 div.divider {
661 color: #ee0;
662 font-size: 1.2rem;
663
--- skins/xekri/css.txt
+++ skins/xekri/css.txt
@@ -649,14 +649,14 @@
649 /**************************************
650 * Timeline
651 */
652
653 #canvas {
654 color: darkGray; /* default rail/line color */
655 border-color: black; /* default branch node/box color */
656 outline-color: white; /* leaf indicator color */
657 background-color: #0a0; /* node/box border color */
658 }
659
660 div.divider {
661 color: #ee0;
662 font-size: 1.2rem;
663
--- src/configure.c
+++ src/configure.c
@@ -93,10 +93,13 @@
9393
{ "background-mimetype", CONFIGSET_SKIN },
9494
{ "background-image", CONFIGSET_SKIN },
9595
{ "timeline-block-markup", CONFIGSET_SKIN },
9696
{ "timeline-max-comment", CONFIGSET_SKIN },
9797
{ "timeline-plaintext", CONFIGSET_SKIN },
98
+ { "timeline-rail-arrows", CONFIGSET_SKIN },
99
+ { "timeline-rail-circles", CONFIGSET_SKIN },
100
+ { "timeline-rail-colors", CONFIGSET_SKIN },
98101
{ "adunit", CONFIGSET_SKIN },
99102
{ "adunit-omit-if-admin", CONFIGSET_SKIN },
100103
{ "adunit-omit-if-user", CONFIGSET_SKIN },
101104
{ "white-foreground", CONFIGSET_SKIN },
102105
#ifdef FOSSIL_ENABLE_TH1_DOCS
103106
--- src/configure.c
+++ src/configure.c
@@ -93,10 +93,13 @@
93 { "background-mimetype", CONFIGSET_SKIN },
94 { "background-image", CONFIGSET_SKIN },
95 { "timeline-block-markup", CONFIGSET_SKIN },
96 { "timeline-max-comment", CONFIGSET_SKIN },
97 { "timeline-plaintext", CONFIGSET_SKIN },
 
 
 
98 { "adunit", CONFIGSET_SKIN },
99 { "adunit-omit-if-admin", CONFIGSET_SKIN },
100 { "adunit-omit-if-user", CONFIGSET_SKIN },
101 { "white-foreground", CONFIGSET_SKIN },
102 #ifdef FOSSIL_ENABLE_TH1_DOCS
103
--- src/configure.c
+++ src/configure.c
@@ -93,10 +93,13 @@
93 { "background-mimetype", CONFIGSET_SKIN },
94 { "background-image", CONFIGSET_SKIN },
95 { "timeline-block-markup", CONFIGSET_SKIN },
96 { "timeline-max-comment", CONFIGSET_SKIN },
97 { "timeline-plaintext", CONFIGSET_SKIN },
98 { "timeline-rail-arrows", CONFIGSET_SKIN },
99 { "timeline-rail-circles", CONFIGSET_SKIN },
100 { "timeline-rail-colors", CONFIGSET_SKIN },
101 { "adunit", CONFIGSET_SKIN },
102 { "adunit-omit-if-admin", CONFIGSET_SKIN },
103 { "adunit-omit-if-user", CONFIGSET_SKIN },
104 { "white-foreground", CONFIGSET_SKIN },
105 #ifdef FOSSIL_ENABLE_TH1_DOCS
106
+5 -1
--- src/finfo.c
+++ src/finfo.c
@@ -307,10 +307,13 @@
307307
GraphContext *pGraph;
308308
int brBg = P("brbg")!=0;
309309
int uBg = P("ubg")!=0;
310310
int fDebug = atoi(PD("debug","0"));
311311
int fShowId = P("showid")!=0;
312
+ int showRailArrows = db_get_boolean("timeline-rail-arrows", 1);
313
+ int showRailCircles = db_get_boolean("timeline-rail-circles", 0);
314
+ int showRailColors = db_get_boolean("timeline-rail-colors", 0);
312315
313316
login_check_credentials();
314317
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
315318
style_header("File History");
316319
login_anonymous_available();
@@ -542,8 +545,9 @@
542545
@ <div id="grbtm" style="width:%d(w)px;"></div>
543546
@ </td><td></td></tr>
544547
}
545548
}
546549
@ </table>
547
- timeline_output_graph_javascript(pGraph, 0, 1);
550
+ timeline_output_graph_javascript(pGraph, 0, 1, showRailArrows,
551
+ showRailCircles, showRailColors);
548552
style_footer();
549553
}
550554
--- src/finfo.c
+++ src/finfo.c
@@ -307,10 +307,13 @@
307 GraphContext *pGraph;
308 int brBg = P("brbg")!=0;
309 int uBg = P("ubg")!=0;
310 int fDebug = atoi(PD("debug","0"));
311 int fShowId = P("showid")!=0;
 
 
 
312
313 login_check_credentials();
314 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
315 style_header("File History");
316 login_anonymous_available();
@@ -542,8 +545,9 @@
542 @ <div id="grbtm" style="width:%d(w)px;"></div>
543 @ </td><td></td></tr>
544 }
545 }
546 @ </table>
547 timeline_output_graph_javascript(pGraph, 0, 1);
 
548 style_footer();
549 }
550
--- src/finfo.c
+++ src/finfo.c
@@ -307,10 +307,13 @@
307 GraphContext *pGraph;
308 int brBg = P("brbg")!=0;
309 int uBg = P("ubg")!=0;
310 int fDebug = atoi(PD("debug","0"));
311 int fShowId = P("showid")!=0;
312 int showRailArrows = db_get_boolean("timeline-rail-arrows", 1);
313 int showRailCircles = db_get_boolean("timeline-rail-circles", 0);
314 int showRailColors = db_get_boolean("timeline-rail-colors", 0);
315
316 login_check_credentials();
317 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
318 style_header("File History");
319 login_anonymous_available();
@@ -542,8 +545,9 @@
545 @ <div id="grbtm" style="width:%d(w)px;"></div>
546 @ </td><td></td></tr>
547 }
548 }
549 @ </table>
550 timeline_output_graph_javascript(pGraph, 0, 1, showRailArrows,
551 showRailCircles, showRailColors);
552 style_footer();
553 }
554
--- src/json_config.c
+++ src/json_config.c
@@ -63,10 +63,13 @@
6363
{ "background-mimetype", CONFIGSET_SKIN },
6464
{ "background-image", CONFIGSET_SKIN },
6565
{ "timeline-block-markup", CONFIGSET_SKIN },
6666
{ "timeline-max-comment", CONFIGSET_SKIN },
6767
{ "timeline-plaintext", CONFIGSET_SKIN },
68
+{ "timeline-rail-arrows", CONFIGSET_SKIN },
69
+{ "timeline-rail-circles", CONFIGSET_SKIN },
70
+{ "timeline-rail-colors", CONFIGSET_SKIN },
6871
{ "adunit", CONFIGSET_SKIN },
6972
{ "adunit-omit-if-admin", CONFIGSET_SKIN },
7073
{ "adunit-omit-if-user", CONFIGSET_SKIN },
7174
{ "white-foreground", CONFIGSET_SKIN },
7275
7376
--- src/json_config.c
+++ src/json_config.c
@@ -63,10 +63,13 @@
63 { "background-mimetype", CONFIGSET_SKIN },
64 { "background-image", CONFIGSET_SKIN },
65 { "timeline-block-markup", CONFIGSET_SKIN },
66 { "timeline-max-comment", CONFIGSET_SKIN },
67 { "timeline-plaintext", CONFIGSET_SKIN },
 
 
 
68 { "adunit", CONFIGSET_SKIN },
69 { "adunit-omit-if-admin", CONFIGSET_SKIN },
70 { "adunit-omit-if-user", CONFIGSET_SKIN },
71 { "white-foreground", CONFIGSET_SKIN },
72
73
--- src/json_config.c
+++ src/json_config.c
@@ -63,10 +63,13 @@
63 { "background-mimetype", CONFIGSET_SKIN },
64 { "background-image", CONFIGSET_SKIN },
65 { "timeline-block-markup", CONFIGSET_SKIN },
66 { "timeline-max-comment", CONFIGSET_SKIN },
67 { "timeline-plaintext", CONFIGSET_SKIN },
68 { "timeline-rail-arrows", CONFIGSET_SKIN },
69 { "timeline-rail-circles", CONFIGSET_SKIN },
70 { "timeline-rail-colors", CONFIGSET_SKIN },
71 { "adunit", CONFIGSET_SKIN },
72 { "adunit-omit-if-admin", CONFIGSET_SKIN },
73 { "adunit-omit-if-user", CONFIGSET_SKIN },
74 { "white-foreground", CONFIGSET_SKIN },
75
76
+19
--- src/setup.c
+++ src/setup.c
@@ -1339,10 +1339,29 @@
13391339
"timeline-plaintext", "tpt", 0, 0);
13401340
@ <p>In timeline displays, check-in comments are displayed literally,
13411341
@ without any wiki or HTML interpretation. (Note: Use CSS to change
13421342
@ display formatting features such as fonts and line-wrapping behavior.)</p>
13431343
1344
+ @ <hr />
1345
+ onoff_attribute("Show branch rail arrowheads",
1346
+ "timeline-rail-arrows", "tra", 1, 0);
1347
+ @ <p>The rail (line) that connects check-ins may optionally display an
1348
+ @ arrowhead indicating the linear progression of changes.</p>
1349
+
1350
+ @ <hr />
1351
+ onoff_attribute("Show check-in timeline nodes as circles",
1352
+ "timeline-rail-circles", "trc", 0, 0);
1353
+ @ <p>By default, Fossil will display check-nodes as squares. Alternatively you
1354
+ @ may prefer to display them as circles.</p>
1355
+
1356
+ @ <hr />
1357
+ onoff_attribute("Use branch background color for branch rails",
1358
+ "timeline-rail-colors", "trl", 0, 0);
1359
+ @ <p>Fossil will display your branch rails using the color defined for the
1360
+ @ branch background. (Note: Branch background colors may not have enough
1361
+ @ contrast to be easily distinguishable from the timeline background.</p>
1362
+
13441363
@ <hr />
13451364
onoff_attribute("Use Universal Coordinated Time (UTC)",
13461365
"timeline-utc", "utc", 1, 0);
13471366
@ <p>Show times as UTC (also sometimes called Greenwich Mean Time (GMT) or
13481367
@ Zulu) instead of in local time. On this server, local time is currently
13491368
--- src/setup.c
+++ src/setup.c
@@ -1339,10 +1339,29 @@
1339 "timeline-plaintext", "tpt", 0, 0);
1340 @ <p>In timeline displays, check-in comments are displayed literally,
1341 @ without any wiki or HTML interpretation. (Note: Use CSS to change
1342 @ display formatting features such as fonts and line-wrapping behavior.)</p>
1343
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1344 @ <hr />
1345 onoff_attribute("Use Universal Coordinated Time (UTC)",
1346 "timeline-utc", "utc", 1, 0);
1347 @ <p>Show times as UTC (also sometimes called Greenwich Mean Time (GMT) or
1348 @ Zulu) instead of in local time. On this server, local time is currently
1349
--- src/setup.c
+++ src/setup.c
@@ -1339,10 +1339,29 @@
1339 "timeline-plaintext", "tpt", 0, 0);
1340 @ <p>In timeline displays, check-in comments are displayed literally,
1341 @ without any wiki or HTML interpretation. (Note: Use CSS to change
1342 @ display formatting features such as fonts and line-wrapping behavior.)</p>
1343
1344 @ <hr />
1345 onoff_attribute("Show branch rail arrowheads",
1346 "timeline-rail-arrows", "tra", 1, 0);
1347 @ <p>The rail (line) that connects check-ins may optionally display an
1348 @ arrowhead indicating the linear progression of changes.</p>
1349
1350 @ <hr />
1351 onoff_attribute("Show check-in timeline nodes as circles",
1352 "timeline-rail-circles", "trc", 0, 0);
1353 @ <p>By default, Fossil will display check-nodes as squares. Alternatively you
1354 @ may prefer to display them as circles.</p>
1355
1356 @ <hr />
1357 onoff_attribute("Use branch background color for branch rails",
1358 "timeline-rail-colors", "trl", 0, 0);
1359 @ <p>Fossil will display your branch rails using the color defined for the
1360 @ branch background. (Note: Branch background colors may not have enough
1361 @ contrast to be easily distinguishable from the timeline background.</p>
1362
1363 @ <hr />
1364 onoff_attribute("Use Universal Coordinated Time (UTC)",
1365 "timeline-utc", "utc", 1, 0);
1366 @ <p>Show times as UTC (also sometimes called Greenwich Mean Time (GMT) or
1367 @ Zulu) instead of in local time. On this server, local time is currently
1368
+4 -2
--- src/style.c
+++ src/style.c
@@ -1227,12 +1227,14 @@
12271227
{ "#usetupEditCapability",
12281228
"format for capabilities string, mentioned on the user edit page",
12291229
@ font-weight: bold;
12301230
},
12311231
{ "#canvas", "timeline graph node colors",
1232
- @ color: black;
1233
- @ background-color: white;
1232
+ @ color: black; /* default rail/line color */
1233
+ @ background-color: white; /* default branch node/box color */
1234
+ @ border-color: black; /* leaf indicator color */
1235
+ @ outline-color: black; /* node/box border color */
12341236
},
12351237
{ "table.adminLogTable",
12361238
"Class for the /admin_log table",
12371239
@ text-align: left;
12381240
},
12391241
--- src/style.c
+++ src/style.c
@@ -1227,12 +1227,14 @@
1227 { "#usetupEditCapability",
1228 "format for capabilities string, mentioned on the user edit page",
1229 @ font-weight: bold;
1230 },
1231 { "#canvas", "timeline graph node colors",
1232 @ color: black;
1233 @ background-color: white;
 
 
1234 },
1235 { "table.adminLogTable",
1236 "Class for the /admin_log table",
1237 @ text-align: left;
1238 },
1239
--- src/style.c
+++ src/style.c
@@ -1227,12 +1227,14 @@
1227 { "#usetupEditCapability",
1228 "format for capabilities string, mentioned on the user edit page",
1229 @ font-weight: bold;
1230 },
1231 { "#canvas", "timeline graph node colors",
1232 @ color: black; /* default rail/line color */
1233 @ background-color: white; /* default branch node/box color */
1234 @ border-color: black; /* leaf indicator color */
1235 @ outline-color: black; /* node/box border color */
1236 },
1237 { "table.adminLogTable",
1238 "Class for the /admin_log table",
1239 @ text-align: left;
1240 },
1241
+54 -8
--- src/timeline.c
+++ src/timeline.c
@@ -217,10 +217,13 @@
217217
const char *zThisUser, /* Suppress links to this user */
218218
const char *zThisTag, /* Suppress links to this tag */
219219
int selectedRid, /* Highlight the line with this RID value */
220220
void (*xExtra)(int) /* Routine to call on each line of display */
221221
){
222
+ int showRailArrows;
223
+ int showRailCircles;
224
+ int showRailColors;
222225
int mxWikiLen;
223226
Blob comment;
224227
int prevTagid = 0;
225228
int suppressCnt = 0;
226229
char zPrevDate[20];
@@ -236,10 +239,13 @@
236239
237240
if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){
238241
vid = db_lget_int("checkout", 0);
239242
}
240243
zPrevDate[0] = 0;
244
+ showRailArrows = db_get_boolean("timeline-rail-arrows", 1);
245
+ showRailCircles = db_get_boolean("timeline-rail-circles", 0);
246
+ showRailColors = db_get_boolean("timeline-rail-colors", 0);
241247
mxWikiLen = db_get_int("timeline-max-comment", 0);
242248
dateFormat = db_get_int("timeline-date-format", 0);
243249
zDateFmt = P("datefmt");
244250
if( zDateFmt ) dateFormat = atoi(zDateFmt);
245251
if( tmFlags & TIMELINE_GRAPH ){
@@ -594,21 +600,25 @@
594600
@ </td><td></td></tr>
595601
}
596602
}
597603
@ </table>
598604
if( fchngQueryInit ) db_finalize(&fchngQuery);
599
- timeline_output_graph_javascript(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0, 0);
605
+ timeline_output_graph_javascript(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0, 0,
606
+ showRailArrows, showRailCircles, showRailColors);
600607
}
601608
602609
/*
603610
** Generate all of the necessary javascript to generate a timeline
604611
** graph.
605612
*/
606613
void timeline_output_graph_javascript(
607614
GraphContext *pGraph, /* The graph to be displayed */
608615
int omitDescenders, /* True to omit descenders */
609
- int fileDiff /* True for file diff. False for check-in diff */
616
+ int fileDiff, /* True for file diff. False for check-in diff */
617
+ int showRailArrows, /* True to render rail arrow heads */
618
+ int showRailCircles, /* True to render circles instead of squares */
619
+ int showRailColors /* True to color rails by the branch background */
610620
){
611621
if( pGraph && pGraph->nErr==0 && pGraph->nRow>0 ){
612622
GraphRow *pRow;
613623
int i;
614624
char cSep;
@@ -751,14 +761,45 @@
751761
@ do{
752762
@ left += obj.offsetLeft;
753763
@ }while( obj = obj.offsetParent );
754764
@ }
755765
@ return left;
766
+ @ }
767
+ @ function getRailColor(clr){
768
+ @ var railClr = lineClr;
769
+ if( showRailColors ) {
770
+ @ if ( bgClr == clr ) railClr = lineClr;
771
+ @ railClr = clr||railClr;
772
+ }
773
+ @ return railClr;
756774
@ }
757775
@ function drawRail(x,y0,y1,clr){
758
- @ if ( bgClr == clr ) clr = lineClr;
759
- @ drawBox(clr||lineClr,x,y0+1,x+1,y1);
776
+ @ var railClr = getRailColor(clr);
777
+ @ drawBox(railClr,x,y0+1,x+1,y1);
778
+ @ var n = document.createElement("div"),
779
+ @ l = x-2,
780
+ @ t = y0;
781
+ if( showRailArrows ){
782
+ @ n.style.position = "absolute";
783
+ @ n.style.left = l+"px";
784
+ @ n.style.top = t+"px";
785
+ @ n.style.width = 0;
786
+ @ n.style.height = 0;
787
+ @ n.style.transform = "scale(.999)";
788
+ @ n.style.borderWidth = 0;
789
+ @ n.style.borderStyle = "solid";
790
+ @ n.style.borderColor = "transparent";
791
+ @ n.style.borderRightWidth = "3px";
792
+ @ n.style.borderBottomColor = railClr;
793
+ @ n.style.borderLeftWidth = "3px";
794
+ @ if( y0+10>=y1 ){
795
+ @ n.style.borderBottomWidth = "5px";
796
+ @ } else {
797
+ @ n.style.borderBottomWidth = "7px";
798
+ @ }
799
+ @ cDiv.appendChild(n);
800
+ }
760801
@ }
761802
@ function drawThinArrow(y,xFrom,xTo){
762803
@ var n = document.createElement("div"),
763804
@ t = y-2;
764805
@ n.style.position = "absolute";
@@ -788,11 +829,13 @@
788829
@ drawBox(lineClr,x0,y0,x1,y1);
789830
@ }
790831
@ function drawNodeBox(color,x0,y0,x1,y1){
791832
@ var n = drawBox(color,x0,y0,x1,y1);
792833
@ n.style.cursor = "pointer";
793
- @ n.style.borderRadius = "6px";
834
+ if( showRailCircles ){
835
+ @ n.style.borderRadius = "6px";
836
+ }
794837
@ }
795838
@ function drawNode(p, left, btm){
796839
@ /* Current CheckIn node */
797840
@ drawNodeBox(boxColor,p.x-5,p.y-5,p.x+6,p.y+6);
798841
@ drawNodeBox(p.bg||bgClr,p.x-4,p.y-4,p.x+5,p.y+5);
@@ -825,11 +868,12 @@
825868
@ var x1 = p.au[i]*railPitch + left;
826869
@ var x0 = x1>p.x ? p.x+7 : p.x-6;
827870
@ var u = rowinfo[p.au[i+1]-1];
828871
@ if(u.id<p.id){
829872
@ /* Branch rail */
830
- @ drawBox(u.bg,x0,p.y,x1+1,p.y+1);
873
+ @ var railClr = getRailColor(u.bg);
874
+ @ drawBox(railClr,x0,p.y,x1+1,p.y+1);
831875
@ drawRail(x1, u.y+6, p.y, u.bg);
832876
@ }else{
833877
@ /* Timewarp rail */
834878
@ drawBox("#600000",x0,p.y,x1,p.y+1);
835879
@ drawBox("#600000",x1-1,p.y,x1,u.y+1);
@@ -914,12 +958,14 @@
914958
@ }
915959
@ }
916960
@ }
917961
@ function clickOnRow(p){
918962
@ if( selRow==null ){
919
- @ selBox = drawBox("orange",p.x-2,p.y-2,p.x+3,p.y+3);
920
- @ selBox.style.borderRadius="6px";
963
+ @ selBox = drawBox("red",p.x-2,p.y-2,p.x+3,p.y+3);
964
+ if( showRailCircles ){
965
+ @ selBox.style.borderRadius="6px";
966
+ }
921967
@ selRow = p;
922968
@ }else if( selRow==p ){
923969
@ var canvasDiv = gebi("canvas");
924970
@ canvasDiv.removeChild(selBox);
925971
@ selBox = null;
926972
--- src/timeline.c
+++ src/timeline.c
@@ -217,10 +217,13 @@
217 const char *zThisUser, /* Suppress links to this user */
218 const char *zThisTag, /* Suppress links to this tag */
219 int selectedRid, /* Highlight the line with this RID value */
220 void (*xExtra)(int) /* Routine to call on each line of display */
221 ){
 
 
 
222 int mxWikiLen;
223 Blob comment;
224 int prevTagid = 0;
225 int suppressCnt = 0;
226 char zPrevDate[20];
@@ -236,10 +239,13 @@
236
237 if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){
238 vid = db_lget_int("checkout", 0);
239 }
240 zPrevDate[0] = 0;
 
 
 
241 mxWikiLen = db_get_int("timeline-max-comment", 0);
242 dateFormat = db_get_int("timeline-date-format", 0);
243 zDateFmt = P("datefmt");
244 if( zDateFmt ) dateFormat = atoi(zDateFmt);
245 if( tmFlags & TIMELINE_GRAPH ){
@@ -594,21 +600,25 @@
594 @ </td><td></td></tr>
595 }
596 }
597 @ </table>
598 if( fchngQueryInit ) db_finalize(&fchngQuery);
599 timeline_output_graph_javascript(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0, 0);
 
600 }
601
602 /*
603 ** Generate all of the necessary javascript to generate a timeline
604 ** graph.
605 */
606 void timeline_output_graph_javascript(
607 GraphContext *pGraph, /* The graph to be displayed */
608 int omitDescenders, /* True to omit descenders */
609 int fileDiff /* True for file diff. False for check-in diff */
 
 
 
610 ){
611 if( pGraph && pGraph->nErr==0 && pGraph->nRow>0 ){
612 GraphRow *pRow;
613 int i;
614 char cSep;
@@ -751,14 +761,45 @@
751 @ do{
752 @ left += obj.offsetLeft;
753 @ }while( obj = obj.offsetParent );
754 @ }
755 @ return left;
 
 
 
 
 
 
 
 
756 @ }
757 @ function drawRail(x,y0,y1,clr){
758 @ if ( bgClr == clr ) clr = lineClr;
759 @ drawBox(clr||lineClr,x,y0+1,x+1,y1);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
760 @ }
761 @ function drawThinArrow(y,xFrom,xTo){
762 @ var n = document.createElement("div"),
763 @ t = y-2;
764 @ n.style.position = "absolute";
@@ -788,11 +829,13 @@
788 @ drawBox(lineClr,x0,y0,x1,y1);
789 @ }
790 @ function drawNodeBox(color,x0,y0,x1,y1){
791 @ var n = drawBox(color,x0,y0,x1,y1);
792 @ n.style.cursor = "pointer";
793 @ n.style.borderRadius = "6px";
 
 
794 @ }
795 @ function drawNode(p, left, btm){
796 @ /* Current CheckIn node */
797 @ drawNodeBox(boxColor,p.x-5,p.y-5,p.x+6,p.y+6);
798 @ drawNodeBox(p.bg||bgClr,p.x-4,p.y-4,p.x+5,p.y+5);
@@ -825,11 +868,12 @@
825 @ var x1 = p.au[i]*railPitch + left;
826 @ var x0 = x1>p.x ? p.x+7 : p.x-6;
827 @ var u = rowinfo[p.au[i+1]-1];
828 @ if(u.id<p.id){
829 @ /* Branch rail */
830 @ drawBox(u.bg,x0,p.y,x1+1,p.y+1);
 
831 @ drawRail(x1, u.y+6, p.y, u.bg);
832 @ }else{
833 @ /* Timewarp rail */
834 @ drawBox("#600000",x0,p.y,x1,p.y+1);
835 @ drawBox("#600000",x1-1,p.y,x1,u.y+1);
@@ -914,12 +958,14 @@
914 @ }
915 @ }
916 @ }
917 @ function clickOnRow(p){
918 @ if( selRow==null ){
919 @ selBox = drawBox("orange",p.x-2,p.y-2,p.x+3,p.y+3);
920 @ selBox.style.borderRadius="6px";
 
 
921 @ selRow = p;
922 @ }else if( selRow==p ){
923 @ var canvasDiv = gebi("canvas");
924 @ canvasDiv.removeChild(selBox);
925 @ selBox = null;
926
--- src/timeline.c
+++ src/timeline.c
@@ -217,10 +217,13 @@
217 const char *zThisUser, /* Suppress links to this user */
218 const char *zThisTag, /* Suppress links to this tag */
219 int selectedRid, /* Highlight the line with this RID value */
220 void (*xExtra)(int) /* Routine to call on each line of display */
221 ){
222 int showRailArrows;
223 int showRailCircles;
224 int showRailColors;
225 int mxWikiLen;
226 Blob comment;
227 int prevTagid = 0;
228 int suppressCnt = 0;
229 char zPrevDate[20];
@@ -236,10 +239,13 @@
239
240 if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){
241 vid = db_lget_int("checkout", 0);
242 }
243 zPrevDate[0] = 0;
244 showRailArrows = db_get_boolean("timeline-rail-arrows", 1);
245 showRailCircles = db_get_boolean("timeline-rail-circles", 0);
246 showRailColors = db_get_boolean("timeline-rail-colors", 0);
247 mxWikiLen = db_get_int("timeline-max-comment", 0);
248 dateFormat = db_get_int("timeline-date-format", 0);
249 zDateFmt = P("datefmt");
250 if( zDateFmt ) dateFormat = atoi(zDateFmt);
251 if( tmFlags & TIMELINE_GRAPH ){
@@ -594,21 +600,25 @@
600 @ </td><td></td></tr>
601 }
602 }
603 @ </table>
604 if( fchngQueryInit ) db_finalize(&fchngQuery);
605 timeline_output_graph_javascript(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0, 0,
606 showRailArrows, showRailCircles, showRailColors);
607 }
608
609 /*
610 ** Generate all of the necessary javascript to generate a timeline
611 ** graph.
612 */
613 void timeline_output_graph_javascript(
614 GraphContext *pGraph, /* The graph to be displayed */
615 int omitDescenders, /* True to omit descenders */
616 int fileDiff, /* True for file diff. False for check-in diff */
617 int showRailArrows, /* True to render rail arrow heads */
618 int showRailCircles, /* True to render circles instead of squares */
619 int showRailColors /* True to color rails by the branch background */
620 ){
621 if( pGraph && pGraph->nErr==0 && pGraph->nRow>0 ){
622 GraphRow *pRow;
623 int i;
624 char cSep;
@@ -751,14 +761,45 @@
761 @ do{
762 @ left += obj.offsetLeft;
763 @ }while( obj = obj.offsetParent );
764 @ }
765 @ return left;
766 @ }
767 @ function getRailColor(clr){
768 @ var railClr = lineClr;
769 if( showRailColors ) {
770 @ if ( bgClr == clr ) railClr = lineClr;
771 @ railClr = clr||railClr;
772 }
773 @ return railClr;
774 @ }
775 @ function drawRail(x,y0,y1,clr){
776 @ var railClr = getRailColor(clr);
777 @ drawBox(railClr,x,y0+1,x+1,y1);
778 @ var n = document.createElement("div"),
779 @ l = x-2,
780 @ t = y0;
781 if( showRailArrows ){
782 @ n.style.position = "absolute";
783 @ n.style.left = l+"px";
784 @ n.style.top = t+"px";
785 @ n.style.width = 0;
786 @ n.style.height = 0;
787 @ n.style.transform = "scale(.999)";
788 @ n.style.borderWidth = 0;
789 @ n.style.borderStyle = "solid";
790 @ n.style.borderColor = "transparent";
791 @ n.style.borderRightWidth = "3px";
792 @ n.style.borderBottomColor = railClr;
793 @ n.style.borderLeftWidth = "3px";
794 @ if( y0+10>=y1 ){
795 @ n.style.borderBottomWidth = "5px";
796 @ } else {
797 @ n.style.borderBottomWidth = "7px";
798 @ }
799 @ cDiv.appendChild(n);
800 }
801 @ }
802 @ function drawThinArrow(y,xFrom,xTo){
803 @ var n = document.createElement("div"),
804 @ t = y-2;
805 @ n.style.position = "absolute";
@@ -788,11 +829,13 @@
829 @ drawBox(lineClr,x0,y0,x1,y1);
830 @ }
831 @ function drawNodeBox(color,x0,y0,x1,y1){
832 @ var n = drawBox(color,x0,y0,x1,y1);
833 @ n.style.cursor = "pointer";
834 if( showRailCircles ){
835 @ n.style.borderRadius = "6px";
836 }
837 @ }
838 @ function drawNode(p, left, btm){
839 @ /* Current CheckIn node */
840 @ drawNodeBox(boxColor,p.x-5,p.y-5,p.x+6,p.y+6);
841 @ drawNodeBox(p.bg||bgClr,p.x-4,p.y-4,p.x+5,p.y+5);
@@ -825,11 +868,12 @@
868 @ var x1 = p.au[i]*railPitch + left;
869 @ var x0 = x1>p.x ? p.x+7 : p.x-6;
870 @ var u = rowinfo[p.au[i+1]-1];
871 @ if(u.id<p.id){
872 @ /* Branch rail */
873 @ var railClr = getRailColor(u.bg);
874 @ drawBox(railClr,x0,p.y,x1+1,p.y+1);
875 @ drawRail(x1, u.y+6, p.y, u.bg);
876 @ }else{
877 @ /* Timewarp rail */
878 @ drawBox("#600000",x0,p.y,x1,p.y+1);
879 @ drawBox("#600000",x1-1,p.y,x1,u.y+1);
@@ -914,12 +958,14 @@
958 @ }
959 @ }
960 @ }
961 @ function clickOnRow(p){
962 @ if( selRow==null ){
963 @ selBox = drawBox("red",p.x-2,p.y-2,p.x+3,p.y+3);
964 if( showRailCircles ){
965 @ selBox.style.borderRadius="6px";
966 }
967 @ selRow = p;
968 @ }else if( selRow==p ){
969 @ var canvasDiv = gebi("canvas");
970 @ canvasDiv.removeChild(selBox);
971 @ selBox = null;
972

Keyboard Shortcuts

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