| | @@ -308,10 +308,21 @@ |
| 308 | 308 | if( (tmFlags & TIMELINE_INLINE)!=0 ){ |
| 309 | 309 | cgi_printf(")"); |
| 310 | 310 | } |
| 311 | 311 | } |
| 312 | 312 | |
| 313 | +/* |
| 314 | +** Clients of the www_print_timeline() routine can create an instance |
| 315 | +** of the following object to pass supplemental information into |
| 316 | +** www_print_timeline() as the last (8th) argument. |
| 317 | +*/ |
| 318 | +#if INTERFACE |
| 319 | +struct TimelineXtra { |
| 320 | + void (*xExtra)(Stmt*,int,const char*,const char*); /* generate "extra" text */ |
| 321 | +}; |
| 322 | +#endif |
| 323 | + |
| 313 | 324 | |
| 314 | 325 | /* |
| 315 | 326 | ** SETTING: timeline-truncate-at-blank boolean default=off |
| 316 | 327 | ** |
| 317 | 328 | ** If enabled, check-in comments displayed on the timeline are truncated |
| | @@ -368,11 +379,11 @@ |
| 368 | 379 | const char *zThisUser, /* Suppress links to this user */ |
| 369 | 380 | const char *zThisTag, /* Suppress links to this tag */ |
| 370 | 381 | Matcher *pLeftBranch, /* Comparison function to use for zLeftBranch */ |
| 371 | 382 | int selectedRid, /* Highlight the line with this RID value or zero */ |
| 372 | 383 | int secondRid, /* Secondary highlight (or zero) */ |
| 373 | | - void (*xExtra)(Stmt*,int,const char*,const char*) /* generate "extra" text */ |
| 384 | + TimelineXtra *pXtra /* Supplemental information */ |
| 374 | 385 | ){ |
| 375 | 386 | int mxWikiLen; |
| 376 | 387 | Blob comment; |
| 377 | 388 | int prevTagid = 0; |
| 378 | 389 | int suppressCnt = 0; |
| | @@ -390,15 +401,13 @@ |
| 390 | 401 | int iTableId = timeline_tableid(); |
| 391 | 402 | int bTimestampLinksToInfo; /* True if timestamp hyperlinks go to the /info |
| 392 | 403 | ** page rather than the /timeline page */ |
| 393 | 404 | const char *zMainBranch = db_main_branch(); |
| 394 | 405 | |
| 395 | | - |
| 396 | 406 | if( cgi_is_loopback(g.zIpAddr) && db_open_local(0) ){ |
| 397 | 407 | vid = db_lget_int("checkout", 0); |
| 398 | 408 | } |
| 399 | | - if( xExtra==0 ) xExtra = timeline_extra; |
| 400 | 409 | zPrevDate[0] = 0; |
| 401 | 410 | mxWikiLen = db_get_int("timeline-max-comment", 0); |
| 402 | 411 | dateFormat = db_get_int("timeline-date-format", 0); |
| 403 | 412 | bCommentGitStyle = db_get_int("timeline-truncate-at-blank", 0); |
| 404 | 413 | bTimestampLinksToInfo = db_get_boolean("timeline-tslink-info", 0); |
| | @@ -781,11 +790,15 @@ |
| 781 | 790 | } |
| 782 | 791 | if( tmFlags & TIMELINE_COMPACT ){ |
| 783 | 792 | cgi_printf("<span class='clutter' id='detail-%d'>",rid); |
| 784 | 793 | } |
| 785 | 794 | cgi_printf("<span class='timeline%sDetail'>", zStyle); |
| 786 | | - xExtra(pQuery, tmFlags, zThisUser, zThisTag); |
| 795 | + if( pXtra && pXtra->xExtra ){ |
| 796 | + pXtra->xExtra(pQuery, tmFlags, zThisUser, zThisTag); |
| 797 | + }else{ |
| 798 | + timeline_extra(pQuery, tmFlags, zThisUser, zThisTag); |
| 799 | + } |
| 787 | 800 | if( tmFlags & TIMELINE_COMPACT ){ |
| 788 | 801 | @ </span></span> |
| 789 | 802 | }else{ |
| 790 | 803 | @ </span> |
| 791 | 804 | } |
| 792 | 805 | |