Fossil SCM

Add a configuration option to cause timeline timestamps to link to the /info page instead of to the /timeline page.

drh 2019-06-07 13:01 trunk
Commit 647424d463c9186012df2781f209c8e345a8fa8ea6032a2f2e86e6a2cabe010c
2 files changed +16 +17 -2
+16
--- src/setup.c
+++ src/setup.c
@@ -765,10 +765,26 @@
765765
@ <p>Set <strong>dwell time</strong> to "0" to disable tooltips.<br>
766766
@ Set <strong>close time</strong> to "0" to keep tooltips visible until
767767
@ the mouse is clicked elsewhere.<p>
768768
@ <p>(Properties: "timeline-dwelltime", "timeline-closetime")</p>
769769
770
+ @ <hr />
771
+ onoff_attribute("Timestamp hyperlinks to /info",
772
+ "timeline-tslink-info", "ttlti", 0, 0);
773
+ @ <p>The hyperlink on the timestamp associated with each timeline entry,
774
+ @ on the far left-hand side of the screen, normally targets another
775
+ @ /timeline page that shows the entry in context. However, if this
776
+ @ option is turned on, that hyperlink targets the /info page showing
777
+ @ the details of the entry.
778
+ @ <p>The /timeline link is the default since it is often useful to
779
+ @ see an entry in context, and because that link is not otherwise
780
+ @ accessible on the timeline. The /info link is also accessible by
781
+ @ double-clicking the timeline node or by clicking on the hash that
782
+ @ follows "check-in:" in the supplimental information section on the
783
+ @ right of the entry.
784
+ @ <p>(Properties: "timeline-tslink-info")
785
+
770786
@ <hr />
771787
@ <p><input type="submit" name="submit" value="Apply Changes" /></p>
772788
@ </div></form>
773789
db_end_transaction(0);
774790
style_footer();
775791
--- src/setup.c
+++ src/setup.c
@@ -765,10 +765,26 @@
765 @ <p>Set <strong>dwell time</strong> to "0" to disable tooltips.<br>
766 @ Set <strong>close time</strong> to "0" to keep tooltips visible until
767 @ the mouse is clicked elsewhere.<p>
768 @ <p>(Properties: "timeline-dwelltime", "timeline-closetime")</p>
769
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
770 @ <hr />
771 @ <p><input type="submit" name="submit" value="Apply Changes" /></p>
772 @ </div></form>
773 db_end_transaction(0);
774 style_footer();
775
--- src/setup.c
+++ src/setup.c
@@ -765,10 +765,26 @@
765 @ <p>Set <strong>dwell time</strong> to "0" to disable tooltips.<br>
766 @ Set <strong>close time</strong> to "0" to keep tooltips visible until
767 @ the mouse is clicked elsewhere.<p>
768 @ <p>(Properties: "timeline-dwelltime", "timeline-closetime")</p>
769
770 @ <hr />
771 onoff_attribute("Timestamp hyperlinks to /info",
772 "timeline-tslink-info", "ttlti", 0, 0);
773 @ <p>The hyperlink on the timestamp associated with each timeline entry,
774 @ on the far left-hand side of the screen, normally targets another
775 @ /timeline page that shows the entry in context. However, if this
776 @ option is turned on, that hyperlink targets the /info page showing
777 @ the details of the entry.
778 @ <p>The /timeline link is the default since it is often useful to
779 @ see an entry in context, and because that link is not otherwise
780 @ accessible on the timeline. The /info link is also accessible by
781 @ double-clicking the timeline node or by clicking on the hash that
782 @ follows "check-in:" in the supplimental information section on the
783 @ right of the entry.
784 @ <p>(Properties: "timeline-tslink-info")
785
786 @ <hr />
787 @ <p><input type="submit" name="submit" value="Apply Changes" /></p>
788 @ </div></form>
789 db_end_transaction(0);
790 style_footer();
791
+17 -2
--- src/timeline.c
+++ src/timeline.c
@@ -263,18 +263,21 @@
263263
int dateFormat = 0; /* 0: HH:MM (default) */
264264
int bCommentGitStyle = 0; /* Only show comments through first blank line */
265265
const char *zStyle; /* Sub-name for classes for the style */
266266
const char *zDateFmt;
267267
int iTableId = timeline_tableid();
268
+ int bTimestampLinksToInfo; /* True if timestamp hyperlinks go to the /info
269
+ ** page rather than the /timeline page */
268270
269271
if( cgi_is_loopback(g.zIpAddr) && db_open_local(0) ){
270272
vid = db_lget_int("checkout", 0);
271273
}
272274
zPrevDate[0] = 0;
273275
mxWikiLen = db_get_int("timeline-max-comment", 0);
274276
dateFormat = db_get_int("timeline-date-format", 0);
275277
bCommentGitStyle = db_get_int("timeline-truncate-at-blank", 0);
278
+ bTimestampLinksToInfo = db_get_boolean("timeline-tslink-info", 0);
276279
if( (tmFlags & TIMELINE_VIEWS)==0 ){
277280
tmFlags |= timeline_ss_cookie();
278281
}
279282
if( tmFlags & TIMELINE_COLUMNAR ){
280283
zStyle = "Columnar";
@@ -399,13 +402,25 @@
399402
isSelectedOrCurrent = 1;
400403
}else {
401404
@ <tr>
402405
}
403406
if( zType[0]=='e' && tagid ){
404
- zDateLink = href("%R/timeline?c=%t",zDate);
407
+ if( bTimestampLinksToInfo ){
408
+ char *zId;
409
+ zId = db_text(0, "SELECT substr(tagname, 7) FROM tag WHERE tagid=%d",
410
+ tagid);
411
+ zDateLink = href("%R/technote/%s",zId);
412
+ free(zId);
413
+ }else{
414
+ zDateLink = href("%R/timeline?c=%t",zDate);
415
+ }
405416
}else if( zUuid ){
406
- zDateLink = chref("timelineHistLink", "%R/timeline?c=%!S", zUuid);
417
+ if( bTimestampLinksToInfo ){
418
+ zDateLink = chref("timelineHistLink", "%R/info/%!S", zUuid);
419
+ }else{
420
+ zDateLink = chref("timelineHistLink", "%R/timeline?c=%!S", zUuid);
421
+ }
407422
}else{
408423
zDateLink = mprintf("<a>");
409424
}
410425
@ <td class="timelineTime">%z(zDateLink)%s(zTime)</a></td>
411426
@ <td class="timelineGraph">
412427
--- src/timeline.c
+++ src/timeline.c
@@ -263,18 +263,21 @@
263 int dateFormat = 0; /* 0: HH:MM (default) */
264 int bCommentGitStyle = 0; /* Only show comments through first blank line */
265 const char *zStyle; /* Sub-name for classes for the style */
266 const char *zDateFmt;
267 int iTableId = timeline_tableid();
 
 
268
269 if( cgi_is_loopback(g.zIpAddr) && db_open_local(0) ){
270 vid = db_lget_int("checkout", 0);
271 }
272 zPrevDate[0] = 0;
273 mxWikiLen = db_get_int("timeline-max-comment", 0);
274 dateFormat = db_get_int("timeline-date-format", 0);
275 bCommentGitStyle = db_get_int("timeline-truncate-at-blank", 0);
 
276 if( (tmFlags & TIMELINE_VIEWS)==0 ){
277 tmFlags |= timeline_ss_cookie();
278 }
279 if( tmFlags & TIMELINE_COLUMNAR ){
280 zStyle = "Columnar";
@@ -399,13 +402,25 @@
399 isSelectedOrCurrent = 1;
400 }else {
401 @ <tr>
402 }
403 if( zType[0]=='e' && tagid ){
404 zDateLink = href("%R/timeline?c=%t",zDate);
 
 
 
 
 
 
 
 
405 }else if( zUuid ){
406 zDateLink = chref("timelineHistLink", "%R/timeline?c=%!S", zUuid);
 
 
 
 
407 }else{
408 zDateLink = mprintf("<a>");
409 }
410 @ <td class="timelineTime">%z(zDateLink)%s(zTime)</a></td>
411 @ <td class="timelineGraph">
412
--- src/timeline.c
+++ src/timeline.c
@@ -263,18 +263,21 @@
263 int dateFormat = 0; /* 0: HH:MM (default) */
264 int bCommentGitStyle = 0; /* Only show comments through first blank line */
265 const char *zStyle; /* Sub-name for classes for the style */
266 const char *zDateFmt;
267 int iTableId = timeline_tableid();
268 int bTimestampLinksToInfo; /* True if timestamp hyperlinks go to the /info
269 ** page rather than the /timeline page */
270
271 if( cgi_is_loopback(g.zIpAddr) && db_open_local(0) ){
272 vid = db_lget_int("checkout", 0);
273 }
274 zPrevDate[0] = 0;
275 mxWikiLen = db_get_int("timeline-max-comment", 0);
276 dateFormat = db_get_int("timeline-date-format", 0);
277 bCommentGitStyle = db_get_int("timeline-truncate-at-blank", 0);
278 bTimestampLinksToInfo = db_get_boolean("timeline-tslink-info", 0);
279 if( (tmFlags & TIMELINE_VIEWS)==0 ){
280 tmFlags |= timeline_ss_cookie();
281 }
282 if( tmFlags & TIMELINE_COLUMNAR ){
283 zStyle = "Columnar";
@@ -399,13 +402,25 @@
402 isSelectedOrCurrent = 1;
403 }else {
404 @ <tr>
405 }
406 if( zType[0]=='e' && tagid ){
407 if( bTimestampLinksToInfo ){
408 char *zId;
409 zId = db_text(0, "SELECT substr(tagname, 7) FROM tag WHERE tagid=%d",
410 tagid);
411 zDateLink = href("%R/technote/%s",zId);
412 free(zId);
413 }else{
414 zDateLink = href("%R/timeline?c=%t",zDate);
415 }
416 }else if( zUuid ){
417 if( bTimestampLinksToInfo ){
418 zDateLink = chref("timelineHistLink", "%R/info/%!S", zUuid);
419 }else{
420 zDateLink = chref("timelineHistLink", "%R/timeline?c=%!S", zUuid);
421 }
422 }else{
423 zDateLink = mprintf("<a>");
424 }
425 @ <td class="timelineTime">%z(zDateLink)%s(zTime)</a></td>
426 @ <td class="timelineGraph">
427

Keyboard Shortcuts

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