Fossil SCM

Add "timelineCurrent" class to indicate the current checkout version when viewing the timeline page locally. (Feel free to change the default style.)

joel 2013-08-02 16:26 UTC trunk
Commit 81f9791c017cab63c28538251240b35788067ce6
2 files changed +5 +10 -2
--- src/style.c
+++ src/style.c
@@ -656,10 +656,15 @@
656656
},
657657
{ "td.timelineTableCell",
658658
"the format for the timeline data cells",
659659
@ vertical-align: top;
660660
@ 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;
661666
},
662667
{ "span.timelineLeaf",
663668
"the format for the timeline leaf marks",
664669
@ font-weight: bold;
665670
},
666671
--- 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 @@
245245
int prevWasDivider = 0; /* True if previous output row was <hr> */
246246
int fchngQueryInit = 0; /* True if fchngQuery is initialized */
247247
Stmt fchngQuery; /* Query for file changes on check-ins */
248248
static Stmt qbranch;
249249
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
+ }
251255
zPrevDate[0] = 0;
252256
mxWikiLen = db_get_int("timeline-max-comment", 0);
253257
if( tmFlags & TIMELINE_GRAPH ){
254258
pGraph = graph_init();
255259
/* style is not moved to css, because this is
@@ -318,11 +322,15 @@
318322
@ <div class="divider">%s(zPrevDate)</div>
319323
@ </td><td></td><td></td></tr>
320324
}
321325
memcpy(zTime, &zDate[11], 5);
322326
zTime[5] = 0;
323
- @ <tr>
327
+ if( rid == vid ){
328
+ @ <tr class="timelineCurrent">
329
+ }else {
330
+ @ <tr>
331
+ }
324332
@ <td class="timelineTime">%s(zTime)</td>
325333
@ <td class="timelineGraph">
326334
if( tmFlags & TIMELINE_UCOLOR ) zBgClr = zUser ? hash_color(zUser) : 0;
327335
if( zType[0]=='c'
328336
&& (pGraph || zBgClr==0 || (tmFlags & TIMELINE_BRCOLOR)!=0)
329337
--- 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

Keyboard Shortcuts

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