| | @@ -217,10 +217,13 @@ |
| 217 | 217 | const char *zThisUser, /* Suppress links to this user */ |
| 218 | 218 | const char *zThisTag, /* Suppress links to this tag */ |
| 219 | 219 | int selectedRid, /* Highlight the line with this RID value */ |
| 220 | 220 | void (*xExtra)(int) /* Routine to call on each line of display */ |
| 221 | 221 | ){ |
| 222 | + int showRailArrows; |
| 223 | + int showRailCircles; |
| 224 | + int showRailColors; |
| 222 | 225 | int mxWikiLen; |
| 223 | 226 | Blob comment; |
| 224 | 227 | int prevTagid = 0; |
| 225 | 228 | int suppressCnt = 0; |
| 226 | 229 | char zPrevDate[20]; |
| | @@ -236,10 +239,13 @@ |
| 236 | 239 | |
| 237 | 240 | if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){ |
| 238 | 241 | vid = db_lget_int("checkout", 0); |
| 239 | 242 | } |
| 240 | 243 | zPrevDate[0] = 0; |
| 244 | + showRailArrows = db_get_boolean("timeline-rail-arrows", 1); |
| 245 | + showRailCircles = db_get_boolean("timeline-rail-circles", 0); |
| 246 | + showRailColors = db_get_boolean("timeline-rail-colors", 0); |
| 241 | 247 | mxWikiLen = db_get_int("timeline-max-comment", 0); |
| 242 | 248 | dateFormat = db_get_int("timeline-date-format", 0); |
| 243 | 249 | zDateFmt = P("datefmt"); |
| 244 | 250 | if( zDateFmt ) dateFormat = atoi(zDateFmt); |
| 245 | 251 | if( tmFlags & TIMELINE_GRAPH ){ |
| | @@ -594,21 +600,25 @@ |
| 594 | 600 | @ </td><td></td></tr> |
| 595 | 601 | } |
| 596 | 602 | } |
| 597 | 603 | @ </table> |
| 598 | 604 | if( fchngQueryInit ) db_finalize(&fchngQuery); |
| 599 | | - timeline_output_graph_javascript(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0, 0); |
| 605 | + timeline_output_graph_javascript(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0, 0, |
| 606 | + showRailArrows, showRailCircles, showRailColors); |
| 600 | 607 | } |
| 601 | 608 | |
| 602 | 609 | /* |
| 603 | 610 | ** Generate all of the necessary javascript to generate a timeline |
| 604 | 611 | ** graph. |
| 605 | 612 | */ |
| 606 | 613 | void timeline_output_graph_javascript( |
| 607 | 614 | GraphContext *pGraph, /* The graph to be displayed */ |
| 608 | 615 | int omitDescenders, /* True to omit descenders */ |
| 609 | | - int fileDiff /* True for file diff. False for check-in diff */ |
| 616 | + int fileDiff, /* True for file diff. False for check-in diff */ |
| 617 | + int showRailArrows, /* True to render rail arrow heads */ |
| 618 | + int showRailCircles, /* True to render circles instead of squares */ |
| 619 | + int showRailColors /* True to color rails by the branch background */ |
| 610 | 620 | ){ |
| 611 | 621 | if( pGraph && pGraph->nErr==0 && pGraph->nRow>0 ){ |
| 612 | 622 | GraphRow *pRow; |
| 613 | 623 | int i; |
| 614 | 624 | char cSep; |
| | @@ -751,14 +761,45 @@ |
| 751 | 761 | @ do{ |
| 752 | 762 | @ left += obj.offsetLeft; |
| 753 | 763 | @ }while( obj = obj.offsetParent ); |
| 754 | 764 | @ } |
| 755 | 765 | @ return left; |
| 766 | + @ } |
| 767 | + @ function getRailColor(clr){ |
| 768 | + @ var railClr = lineClr; |
| 769 | + if( showRailColors ) { |
| 770 | + @ if ( bgClr == clr ) railClr = lineClr; |
| 771 | + @ railClr = clr||railClr; |
| 772 | + } |
| 773 | + @ return railClr; |
| 756 | 774 | @ } |
| 757 | 775 | @ function drawRail(x,y0,y1,clr){ |
| 758 | | - @ if ( bgClr == clr ) clr = lineClr; |
| 759 | | - @ drawBox(clr||lineClr,x,y0+1,x+1,y1); |
| 776 | + @ var railClr = getRailColor(clr); |
| 777 | + @ drawBox(railClr,x,y0+1,x+1,y1); |
| 778 | + @ var n = document.createElement("div"), |
| 779 | + @ l = x-2, |
| 780 | + @ t = y0; |
| 781 | + if( showRailArrows ){ |
| 782 | + @ n.style.position = "absolute"; |
| 783 | + @ n.style.left = l+"px"; |
| 784 | + @ n.style.top = t+"px"; |
| 785 | + @ n.style.width = 0; |
| 786 | + @ n.style.height = 0; |
| 787 | + @ n.style.transform = "scale(.999)"; |
| 788 | + @ n.style.borderWidth = 0; |
| 789 | + @ n.style.borderStyle = "solid"; |
| 790 | + @ n.style.borderColor = "transparent"; |
| 791 | + @ n.style.borderRightWidth = "3px"; |
| 792 | + @ n.style.borderBottomColor = railClr; |
| 793 | + @ n.style.borderLeftWidth = "3px"; |
| 794 | + @ if( y0+10>=y1 ){ |
| 795 | + @ n.style.borderBottomWidth = "5px"; |
| 796 | + @ } else { |
| 797 | + @ n.style.borderBottomWidth = "7px"; |
| 798 | + @ } |
| 799 | + @ cDiv.appendChild(n); |
| 800 | + } |
| 760 | 801 | @ } |
| 761 | 802 | @ function drawThinArrow(y,xFrom,xTo){ |
| 762 | 803 | @ var n = document.createElement("div"), |
| 763 | 804 | @ t = y-2; |
| 764 | 805 | @ n.style.position = "absolute"; |
| | @@ -788,11 +829,13 @@ |
| 788 | 829 | @ drawBox(lineClr,x0,y0,x1,y1); |
| 789 | 830 | @ } |
| 790 | 831 | @ function drawNodeBox(color,x0,y0,x1,y1){ |
| 791 | 832 | @ var n = drawBox(color,x0,y0,x1,y1); |
| 792 | 833 | @ n.style.cursor = "pointer"; |
| 793 | | - @ n.style.borderRadius = "6px"; |
| 834 | + if( showRailCircles ){ |
| 835 | + @ n.style.borderRadius = "6px"; |
| 836 | + } |
| 794 | 837 | @ } |
| 795 | 838 | @ function drawNode(p, left, btm){ |
| 796 | 839 | @ /* Current CheckIn node */ |
| 797 | 840 | @ drawNodeBox(boxColor,p.x-5,p.y-5,p.x+6,p.y+6); |
| 798 | 841 | @ drawNodeBox(p.bg||bgClr,p.x-4,p.y-4,p.x+5,p.y+5); |
| | @@ -825,11 +868,12 @@ |
| 825 | 868 | @ var x1 = p.au[i]*railPitch + left; |
| 826 | 869 | @ var x0 = x1>p.x ? p.x+7 : p.x-6; |
| 827 | 870 | @ var u = rowinfo[p.au[i+1]-1]; |
| 828 | 871 | @ if(u.id<p.id){ |
| 829 | 872 | @ /* Branch rail */ |
| 830 | | - @ drawBox(u.bg,x0,p.y,x1+1,p.y+1); |
| 873 | + @ var railClr = getRailColor(u.bg); |
| 874 | + @ drawBox(railClr,x0,p.y,x1+1,p.y+1); |
| 831 | 875 | @ drawRail(x1, u.y+6, p.y, u.bg); |
| 832 | 876 | @ }else{ |
| 833 | 877 | @ /* Timewarp rail */ |
| 834 | 878 | @ drawBox("#600000",x0,p.y,x1,p.y+1); |
| 835 | 879 | @ drawBox("#600000",x1-1,p.y,x1,u.y+1); |
| | @@ -914,12 +958,14 @@ |
| 914 | 958 | @ } |
| 915 | 959 | @ } |
| 916 | 960 | @ } |
| 917 | 961 | @ function clickOnRow(p){ |
| 918 | 962 | @ if( selRow==null ){ |
| 919 | | - @ selBox = drawBox("orange",p.x-2,p.y-2,p.x+3,p.y+3); |
| 920 | | - @ selBox.style.borderRadius="6px"; |
| 963 | + @ selBox = drawBox("red",p.x-2,p.y-2,p.x+3,p.y+3); |
| 964 | + if( showRailCircles ){ |
| 965 | + @ selBox.style.borderRadius="6px"; |
| 966 | + } |
| 921 | 967 | @ selRow = p; |
| 922 | 968 | @ }else if( selRow==p ){ |
| 923 | 969 | @ var canvasDiv = gebi("canvas"); |
| 924 | 970 | @ canvasDiv.removeChild(selBox); |
| 925 | 971 | @ selBox = null; |
| 926 | 972 | |