If the timeline display preference "Max timeline comment length" is used
(value > 0), then display the unlimited comment as mouse-over at the
elided comment text.

This provides both: a compat timeline and a fast look at the complete
comment text, if needed.

Turned out this could be easily implemented (including a new option on
the timeline display preferences page to turn on/off this feature);
see patch below.

rolf

Index: src/setup.c
==================================================================
--- src/setup.c
+++ src/setup.c
@@ -1229,11 +1229,13 @@
 
   @ <hr />
   entry_attribute("Max timeline comment length", 6,
                   "timeline-max-comment", "tmc", "0", 0);
   @ <p>The maximum length of a comment to be displayed in a timeline.
-  @ "0" there is no length limit.</p>
+  @ "0" means there is no length limit.</p>
+  onoff_attribute("Show complete comment on mouse over", 
"timeline-show-elided", 
+                  "tse", 0, 0);
 
   @ <hr />
   @ <p><input type="submit"  name="submit" value="Apply Changes" /></p>
   @ </div></form>
   db_end_transaction(0);

Index: src/timeline.c
==================================================================
--- src/timeline.c
+++ src/timeline.c
@@ -237,17 +237,18 @@
   int pendingEndTr = 0;       /* True if a </td></tr> is needed */
   int vid = 0;                /* Current checkout version */
   int dateFormat = 0;         /* 0: HH:MM  1: HH:MM:SS
                                  2: YYYY-MM-DD HH:MM
                                  3: YYMMDD HH:MM */
-
+  int showelided = 0;         /* True if elided comment as mouse-over */ 
   if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){
     vid = db_lget_int("checkout", 0);
   }
   zPrevDate[0] = 0;
   mxWikiLen = db_get_int("timeline-max-comment", 0);
   dateFormat = db_get_int("timeline-date-format", 0);
+  showelided = db_get_boolean("timeline-show-elided", 0);
   if( tmFlags & TIMELINE_GRAPH ){
     pGraph = graph_init();
     /* style is not moved to css, because this is
     ** a technical div for the timeline graph
     */
@@ -415,11 +416,15 @@
     }else if( mxWikiLen>0 && blob_size(&comment)>mxWikiLen ){
       Blob truncated;
       blob_zero(&truncated);
       blob_append(&truncated, blob_buffer(&comment), mxWikiLen);
       blob_append(&truncated, "...", 3);
-      @ <span class="timelineComment">%w(blob_str(&truncated))</span>
+      if (showelided){
+          @ <span class="timelineComment">%w(blob_str(&truncated))</spa
+      }else{
+          @ <span class="timelineComment" 
title="%w(blob_str(&comment))">%w(blob_str(&truncated))</span>
+      }    
       blob_reset(&truncated);
     }else{
       @ <span class="timelineComment">%w(blob_str(&comment))</span>
     }
     blob_reset(&comment);




_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to