| | @@ -91,27 +91,29 @@ |
| 91 | 91 | |
| 92 | 92 | /* |
| 93 | 93 | ** Allowed flags for the tmFlags argument to www_print_timeline |
| 94 | 94 | */ |
| 95 | 95 | #if INTERFACE |
| 96 | | -#define TIMELINE_ARTID 0x0001 /* Show artifact IDs on non-check-in lines */ |
| 97 | | -#define TIMELINE_LEAFONLY 0x0002 /* Show "Leaf", but not "Merge", "Fork" etc */ |
| 98 | | -#define TIMELINE_BRIEF 0x0004 /* Combine adjacent elements of same object */ |
| 99 | | -#define TIMELINE_GRAPH 0x0008 /* Compute a graph */ |
| 100 | | -#define TIMELINE_DISJOINT 0x0010 /* Elements are not contiguous */ |
| 101 | | -#define TIMELINE_FCHANGES 0x0020 /* Detail file changes */ |
| 102 | | -#define TIMELINE_BRCOLOR 0x0040 /* Background color by branch name */ |
| 103 | | -#define TIMELINE_UCOLOR 0x0080 /* Background color by user */ |
| 104 | | -#define TIMELINE_FRENAMES 0x0100 /* Detail only file name changes */ |
| 105 | | -#define TIMELINE_UNHIDE 0x0200 /* Unhide check-ins with "hidden" tag */ |
| 106 | | -#define TIMELINE_SHOWRID 0x0400 /* Show RID values in addition to UUIDs */ |
| 107 | | -#define TIMELINE_BISECT 0x0800 /* Show supplimental bisect information */ |
| 108 | | -#define TIMELINE_COMPACT 0x1000 /* Use the "compact" view style */ |
| 109 | | -#define TIMELINE_VERBOSE 0x2000 /* Use the "detailed" view style */ |
| 110 | | -#define TIMELINE_MODERN 0x4000 /* Use the "modern" view style */ |
| 111 | | -#define TIMELINE_COLUMNAR 0x8000 /* Use the "columns view style */ |
| 112 | | -#define TIMELINE_VIEWS 0xf000 /* Mask for all of the view styles */ |
| 96 | +#define TIMELINE_ARTID 0x00001 /* Show artifact IDs on non-check-in lines */ |
| 97 | +#define TIMELINE_LEAFONLY 0x00002 /* Show "Leaf" but not "Merge", "Fork" etc */ |
| 98 | +#define TIMELINE_BRIEF 0x00004 /* Combine adjacent elements of same obj */ |
| 99 | +#define TIMELINE_GRAPH 0x00008 /* Compute a graph */ |
| 100 | +#define TIMELINE_DISJOINT 0x00010 /* Elements are not contiguous */ |
| 101 | +#define TIMELINE_FCHANGES 0x00020 /* Detail file changes */ |
| 102 | +#define TIMELINE_BRCOLOR 0x00040 /* Background color by branch name */ |
| 103 | +#define TIMELINE_UCOLOR 0x00080 /* Background color by user */ |
| 104 | +#define TIMELINE_FRENAMES 0x00100 /* Detail only file name changes */ |
| 105 | +#define TIMELINE_UNHIDE 0x00200 /* Unhide check-ins with "hidden" tag */ |
| 106 | +#define TIMELINE_SHOWRID 0x00400 /* Show RID values in addition to UUIDs */ |
| 107 | +#define TIMELINE_BISECT 0x00800 /* Show supplimental bisect information */ |
| 108 | +#define TIMELINE_COMPACT 0x01000 /* Use the "compact" view style */ |
| 109 | +#define TIMELINE_VERBOSE 0x02000 /* Use the "detailed" view style */ |
| 110 | +#define TIMELINE_MODERN 0x04000 /* Use the "modern" view style */ |
| 111 | +#define TIMELINE_COLUMNAR 0x08000 /* Use the "columns view style */ |
| 112 | +#define TIMELINE_VIEWS 0x0f000 /* Mask for all of the view styles */ |
| 113 | +#define TIMELINE_NOSCROLL 0x10000 /* Don't scroll to the selection */ |
| 114 | +#define TIMELINE_FILEDIFF 0x20000 /* Show File differences, not ckin diffs */ |
| 113 | 115 | #endif |
| 114 | 116 | |
| 115 | 117 | /* |
| 116 | 118 | ** Hash a string and use the hash to determine a background color. |
| 117 | 119 | */ |
| | @@ -724,12 +726,11 @@ |
| 724 | 726 | @ <tr class="timelineBottom"><td></td><td></td><td></td></tr> |
| 725 | 727 | } |
| 726 | 728 | } |
| 727 | 729 | @ </table> |
| 728 | 730 | if( fchngQueryInit ) db_finalize(&fchngQuery); |
| 729 | | - timeline_output_graph_javascript(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0, |
| 730 | | - iTableId, 0); |
| 731 | + timeline_output_graph_javascript(pGraph, tmFlags, iTableId); |
| 731 | 732 | } |
| 732 | 733 | |
| 733 | 734 | /* |
| 734 | 735 | ** Change the RGB background color given in the argument in a foreground |
| 735 | 736 | ** color with the same hue. |
| | @@ -765,13 +766,12 @@ |
| 765 | 766 | ** Generate all of the necessary javascript to generate a timeline |
| 766 | 767 | ** graph. |
| 767 | 768 | */ |
| 768 | 769 | void timeline_output_graph_javascript( |
| 769 | 770 | GraphContext *pGraph, /* The graph to be displayed */ |
| 770 | | - int omitDescenders, /* True to omit descenders */ |
| 771 | | - int iTableId, /* Which graph is this for */ |
| 772 | | - int fileDiff /* True for file diff. False for check-in diff */ |
| 771 | + int tmFlags, /* Flags that control rendering */ |
| 772 | + int iTableId /* Which graph is this for */ |
| 773 | 773 | ){ |
| 774 | 774 | if( pGraph && pGraph->nErr==0 && pGraph->nRow>0 ){ |
| 775 | 775 | GraphRow *pRow; |
| 776 | 776 | int i; |
| 777 | 777 | char cSep; |
| | @@ -778,17 +778,22 @@ |
| 778 | 778 | int iRailPitch; /* Pixels between consecutive rails */ |
| 779 | 779 | int showArrowheads; /* True to draw arrowheads. False to omit. */ |
| 780 | 780 | int circleNodes; /* True for circle nodes. False for square nodes */ |
| 781 | 781 | int colorGraph; /* Use colors for graph lines */ |
| 782 | 782 | int iTopRow; /* Index of the top row of the graph */ |
| 783 | + int fileDiff; /* True for file diff. False for check-in diff */ |
| 784 | + int omitDescenders; /* True to omit descenders */ |
| 785 | + int scrollToSelect; /* True to scroll to the selection */ |
| 783 | 786 | |
| 784 | 787 | iRailPitch = atoi(PD("railpitch","0")); |
| 785 | 788 | showArrowheads = skin_detail_boolean("timeline-arrowheads"); |
| 786 | 789 | circleNodes = skin_detail_boolean("timeline-circle-nodes"); |
| 787 | 790 | colorGraph = skin_detail_boolean("timeline-color-graph-lines"); |
| 788 | 791 | iTopRow = pGraph->pFirst ? pGraph->pFirst->idx : 0; |
| 789 | | - |
| 792 | + omitDescenders = (tmFlags & TIMELINE_DISJOINT)!=0; |
| 793 | + fileDiff = (tmFlags & TIMELINE_FILEDIFF)!=0; |
| 794 | + scrollToSelect = (tmFlags & TIMELINE_NOSCROLL)==0; |
| 790 | 795 | @ <script id='timeline-data-%d(iTableId)' type='application/json'>{ |
| 791 | 796 | @ "iTableId": %d(iTableId), |
| 792 | 797 | @ "circleNodes": %d(circleNodes), |
| 793 | 798 | @ "showArrowheads": %d(showArrowheads), |
| 794 | 799 | @ "iRailPitch": %d(iRailPitch), |
| | @@ -795,10 +800,11 @@ |
| 795 | 800 | @ "colorGraph": %d(colorGraph), |
| 796 | 801 | @ "nomo": %d(PB("nomo")), |
| 797 | 802 | @ "iTopRow": %d(iTopRow), |
| 798 | 803 | @ "omitDescenders": %d(omitDescenders), |
| 799 | 804 | @ "fileDiff": %d(fileDiff), |
| 805 | + @ "scrollToSelect": %d(scrollToSelect), |
| 800 | 806 | @ "nrail": %d(pGraph->mxRail+1), |
| 801 | 807 | @ "baseUrl": "%R", |
| 802 | 808 | @ "rowinfo": [ |
| 803 | 809 | |
| 804 | 810 | /* the rowinfo[] array contains all the information needed to generate |
| 805 | 811 | |