Fossil SCM
Add "timelineCurrent" class to indicate the current checkout version when viewing the timeline page locally. (Feel free to change the default style.)
Commit
81f9791c017cab63c28538251240b35788067ce6
Parent
8c5b5c3820e1ebc…
2 files changed
+5
+10
-2
+5
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -656,10 +656,15 @@ | ||
| 656 | 656 | }, |
| 657 | 657 | { "td.timelineTableCell", |
| 658 | 658 | "the format for the timeline data cells", |
| 659 | 659 | @ vertical-align: top; |
| 660 | 660 | @ text-align: left; |
| 661 | + }, | |
| 662 | + { "tr.timelineCurrent td.timelineTableCell", | |
| 663 | + "the format for the timeline data cell of the current checkout", | |
| 664 | + @ padding: .1em .2em; | |
| 665 | + @ border: 1px dashed #446979; | |
| 661 | 666 | }, |
| 662 | 667 | { "span.timelineLeaf", |
| 663 | 668 | "the format for the timeline leaf marks", |
| 664 | 669 | @ font-weight: bold; |
| 665 | 670 | }, |
| 666 | 671 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -656,10 +656,15 @@ | |
| 656 | }, |
| 657 | { "td.timelineTableCell", |
| 658 | "the format for the timeline data cells", |
| 659 | @ vertical-align: top; |
| 660 | @ text-align: left; |
| 661 | }, |
| 662 | { "span.timelineLeaf", |
| 663 | "the format for the timeline leaf marks", |
| 664 | @ font-weight: bold; |
| 665 | }, |
| 666 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -656,10 +656,15 @@ | |
| 656 | }, |
| 657 | { "td.timelineTableCell", |
| 658 | "the format for the timeline data cells", |
| 659 | @ vertical-align: top; |
| 660 | @ text-align: left; |
| 661 | }, |
| 662 | { "tr.timelineCurrent td.timelineTableCell", |
| 663 | "the format for the timeline data cell of the current checkout", |
| 664 | @ padding: .1em .2em; |
| 665 | @ border: 1px dashed #446979; |
| 666 | }, |
| 667 | { "span.timelineLeaf", |
| 668 | "the format for the timeline leaf marks", |
| 669 | @ font-weight: bold; |
| 670 | }, |
| 671 |
+10
-2
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -245,11 +245,15 @@ | ||
| 245 | 245 | int prevWasDivider = 0; /* True if previous output row was <hr> */ |
| 246 | 246 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| 247 | 247 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| 248 | 248 | static Stmt qbranch; |
| 249 | 249 | int pendingEndTr = 0; /* True if a </td></tr> is needed */ |
| 250 | - | |
| 250 | + int vid = 0; /* Current checkout version */ | |
| 251 | + | |
| 252 | + if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){ | |
| 253 | + vid = db_lget_int("checkout", 0); | |
| 254 | + } | |
| 251 | 255 | zPrevDate[0] = 0; |
| 252 | 256 | mxWikiLen = db_get_int("timeline-max-comment", 0); |
| 253 | 257 | if( tmFlags & TIMELINE_GRAPH ){ |
| 254 | 258 | pGraph = graph_init(); |
| 255 | 259 | /* style is not moved to css, because this is |
| @@ -318,11 +322,15 @@ | ||
| 318 | 322 | @ <div class="divider">%s(zPrevDate)</div> |
| 319 | 323 | @ </td><td></td><td></td></tr> |
| 320 | 324 | } |
| 321 | 325 | memcpy(zTime, &zDate[11], 5); |
| 322 | 326 | zTime[5] = 0; |
| 323 | - @ <tr> | |
| 327 | + if( rid == vid ){ | |
| 328 | + @ <tr class="timelineCurrent"> | |
| 329 | + }else { | |
| 330 | + @ <tr> | |
| 331 | + } | |
| 324 | 332 | @ <td class="timelineTime">%s(zTime)</td> |
| 325 | 333 | @ <td class="timelineGraph"> |
| 326 | 334 | if( tmFlags & TIMELINE_UCOLOR ) zBgClr = zUser ? hash_color(zUser) : 0; |
| 327 | 335 | if( zType[0]=='c' |
| 328 | 336 | && (pGraph || zBgClr==0 || (tmFlags & TIMELINE_BRCOLOR)!=0) |
| 329 | 337 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -245,11 +245,15 @@ | |
| 245 | int prevWasDivider = 0; /* True if previous output row was <hr> */ |
| 246 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| 247 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| 248 | static Stmt qbranch; |
| 249 | int pendingEndTr = 0; /* True if a </td></tr> is needed */ |
| 250 | |
| 251 | zPrevDate[0] = 0; |
| 252 | mxWikiLen = db_get_int("timeline-max-comment", 0); |
| 253 | if( tmFlags & TIMELINE_GRAPH ){ |
| 254 | pGraph = graph_init(); |
| 255 | /* style is not moved to css, because this is |
| @@ -318,11 +322,15 @@ | |
| 318 | @ <div class="divider">%s(zPrevDate)</div> |
| 319 | @ </td><td></td><td></td></tr> |
| 320 | } |
| 321 | memcpy(zTime, &zDate[11], 5); |
| 322 | zTime[5] = 0; |
| 323 | @ <tr> |
| 324 | @ <td class="timelineTime">%s(zTime)</td> |
| 325 | @ <td class="timelineGraph"> |
| 326 | if( tmFlags & TIMELINE_UCOLOR ) zBgClr = zUser ? hash_color(zUser) : 0; |
| 327 | if( zType[0]=='c' |
| 328 | && (pGraph || zBgClr==0 || (tmFlags & TIMELINE_BRCOLOR)!=0) |
| 329 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -245,11 +245,15 @@ | |
| 245 | int prevWasDivider = 0; /* True if previous output row was <hr> */ |
| 246 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| 247 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| 248 | static Stmt qbranch; |
| 249 | int pendingEndTr = 0; /* True if a </td></tr> is needed */ |
| 250 | int vid = 0; /* Current checkout version */ |
| 251 | |
| 252 | if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){ |
| 253 | vid = db_lget_int("checkout", 0); |
| 254 | } |
| 255 | zPrevDate[0] = 0; |
| 256 | mxWikiLen = db_get_int("timeline-max-comment", 0); |
| 257 | if( tmFlags & TIMELINE_GRAPH ){ |
| 258 | pGraph = graph_init(); |
| 259 | /* style is not moved to css, because this is |
| @@ -318,11 +322,15 @@ | |
| 322 | @ <div class="divider">%s(zPrevDate)</div> |
| 323 | @ </td><td></td><td></td></tr> |
| 324 | } |
| 325 | memcpy(zTime, &zDate[11], 5); |
| 326 | zTime[5] = 0; |
| 327 | if( rid == vid ){ |
| 328 | @ <tr class="timelineCurrent"> |
| 329 | }else { |
| 330 | @ <tr> |
| 331 | } |
| 332 | @ <td class="timelineTime">%s(zTime)</td> |
| 333 | @ <td class="timelineGraph"> |
| 334 | if( tmFlags & TIMELINE_UCOLOR ) zBgClr = zUser ? hash_color(zUser) : 0; |
| 335 | if( zType[0]=='c' |
| 336 | && (pGraph || zBgClr==0 || (tmFlags & TIMELINE_BRCOLOR)!=0) |
| 337 |