Fossil SCM
Shorten source lines to 80 characters or less in timeline.c.
Commit
0738dcc6b07090696130d7d498b0eae0e82f252b
Parent
d539f65cc2d2a09…
1 file changed
+23
-23
+23
-23
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -666,16 +666,16 @@ | ||
| 666 | 666 | if( cSep=='[' ) cgi_printf("["); |
| 667 | 667 | cgi_printf("],h:\"%s\"}%s", pRow->zUuid, pRow->pNext ? ",\n" : "];\n"); |
| 668 | 668 | } |
| 669 | 669 | cgi_printf("var nrail = %d\n", pGraph->mxRail+1); |
| 670 | 670 | graph_free(pGraph); |
| 671 | - @ var canvasDiv = gebi("canvas"); | |
| 672 | - @ var canvasStyle = window.getComputedStyle && window.getComputedStyle(canvasDiv,null); | |
| 673 | - @ var lineColor = (canvasStyle && canvasStyle.getPropertyValue('color')) || 'black'; | |
| 674 | - @ var bgColor = (canvasStyle && canvasStyle.getPropertyValue('background-color')) || 'white'; | |
| 675 | - @ if( bgColor=='transparent' ) bgColor = 'white'; | |
| 676 | - @ var boxColor = lineColor; | |
| 671 | + @ var cDiv = gebi("canvas"); | |
| 672 | + @ var csty = window.getComputedStyle && window.getComputedStyle(cDiv,null); | |
| 673 | + @ var lineClr = (csty && csty.getPropertyValue('color')) || 'black'; | |
| 674 | + @ var bgClr = (csty && csty.getPropertyValue('background-color')) ||'white'; | |
| 675 | + @ if( bgClr=='transparent' ) bgClr = 'white'; | |
| 676 | + @ var boxColor = lineClr; | |
| 677 | 677 | @ function drawBox(color,x0,y0,x1,y1){ |
| 678 | 678 | @ var n = document.createElement("div"); |
| 679 | 679 | @ if( x0>x1 ){ var t=x0; x0=x1; x1=t; } |
| 680 | 680 | @ if( y0>y1 ){ var t=y0; y0=y1; y1=t; } |
| 681 | 681 | @ var w = x1-x0+1; |
| @@ -685,11 +685,11 @@ | ||
| 685 | 685 | @ n.style.left = x0+"px"; |
| 686 | 686 | @ n.style.top = y0+"px"; |
| 687 | 687 | @ n.style.width = w+"px"; |
| 688 | 688 | @ n.style.height = h+"px"; |
| 689 | 689 | @ n.style.backgroundColor = color; |
| 690 | - @ canvasDiv.appendChild(n); | |
| 690 | + @ cDiv.appendChild(n); | |
| 691 | 691 | @ return n; |
| 692 | 692 | @ } |
| 693 | 693 | @ function absoluteY(id){ |
| 694 | 694 | @ var obj = gebi(id); |
| 695 | 695 | @ if( !obj ) return; |
| @@ -711,39 +711,39 @@ | ||
| 711 | 711 | @ }while( obj = obj.offsetParent ); |
| 712 | 712 | @ } |
| 713 | 713 | @ return left; |
| 714 | 714 | @ } |
| 715 | 715 | @ function drawUpArrow(x,y0,y1){ |
| 716 | - @ drawBox(lineColor,x,y0,x+1,y1); | |
| 716 | + @ drawBox(lineClr,x,y0,x+1,y1); | |
| 717 | 717 | @ if( y0+10>=y1 ){ |
| 718 | - @ drawBox(lineColor,x-1,y0+1,x+2,y0+2); | |
| 719 | - @ drawBox(lineColor,x-2,y0+3,x+3,y0+4); | |
| 718 | + @ drawBox(lineClr,x-1,y0+1,x+2,y0+2); | |
| 719 | + @ drawBox(lineClr,x-2,y0+3,x+3,y0+4); | |
| 720 | 720 | @ }else{ |
| 721 | - @ drawBox(lineColor,x-1,y0+2,x+2,y0+4); | |
| 722 | - @ drawBox(lineColor,x-2,y0+5,x+3,y0+7); | |
| 721 | + @ drawBox(lineClr,x-1,y0+2,x+2,y0+4); | |
| 722 | + @ drawBox(lineClr,x-2,y0+5,x+3,y0+7); | |
| 723 | 723 | @ } |
| 724 | 724 | @ } |
| 725 | 725 | @ function drawThinArrow(y,xFrom,xTo){ |
| 726 | 726 | @ if( xFrom<xTo ){ |
| 727 | - @ drawBox(lineColor,xFrom,y,xTo,y); | |
| 728 | - @ drawBox(lineColor,xTo-3,y-1,xTo-2,y+1); | |
| 729 | - @ drawBox(lineColor,xTo-4,y-2,xTo-4,y+2); | |
| 727 | + @ drawBox(lineClr,xFrom,y,xTo,y); | |
| 728 | + @ drawBox(lineClr,xTo-3,y-1,xTo-2,y+1); | |
| 729 | + @ drawBox(lineClr,xTo-4,y-2,xTo-4,y+2); | |
| 730 | 730 | @ }else{ |
| 731 | - @ drawBox(lineColor,xTo,y,xFrom,y); | |
| 732 | - @ drawBox(lineColor,xTo+2,y-1,xTo+3,y+1); | |
| 733 | - @ drawBox(lineColor,xTo+4,y-2,xTo+4,y+2); | |
| 731 | + @ drawBox(lineClr,xTo,y,xFrom,y); | |
| 732 | + @ drawBox(lineClr,xTo+2,y-1,xTo+3,y+1); | |
| 733 | + @ drawBox(lineClr,xTo+4,y-2,xTo+4,y+2); | |
| 734 | 734 | @ } |
| 735 | 735 | @ } |
| 736 | 736 | @ function drawThinLine(x0,y0,x1,y1){ |
| 737 | - @ drawBox(lineColor,x0,y0,x1,y1); | |
| 737 | + @ drawBox(lineClr,x0,y0,x1,y1); | |
| 738 | 738 | @ } |
| 739 | 739 | @ function drawNodeBox(color,x0,y0,x1,y1){ |
| 740 | 740 | @ drawBox(color,x0,y0,x1,y1).style.cursor = "pointer"; |
| 741 | 741 | @ } |
| 742 | 742 | @ function drawNode(p, left, btm){ |
| 743 | 743 | @ drawNodeBox(boxColor,p.x-5,p.y-5,p.x+6,p.y+6); |
| 744 | - @ drawNodeBox(p.bg||bgColor,p.x-4,p.y-4,p.x+5,p.y+5); | |
| 744 | + @ drawNodeBox(p.bg||bgClr,p.x-4,p.y-4,p.x+5,p.y+5); | |
| 745 | 745 | @ if( p.u>0 ) drawUpArrow(p.x, rowinfo[p.u-1].y+6, p.y-5); |
| 746 | 746 | @ if( p.f&1 ) drawNodeBox(boxColor,p.x-1,p.y-1,p.x+2,p.y+2); |
| 747 | 747 | if( !omitDescenders ){ |
| 748 | 748 | @ if( p.u==0 ) drawUpArrow(p.x, 0, p.y-5); |
| 749 | 749 | @ if( p.d ) drawUpArrow(p.x, p.y+6, btm); |
| @@ -765,11 +765,11 @@ | ||
| 765 | 765 | @ for(var i=0; i<n; i+=2){ |
| 766 | 766 | @ var x1 = p.au[i]*railPitch + left; |
| 767 | 767 | @ var x0 = x1>p.x ? p.x+7 : p.x-6; |
| 768 | 768 | @ var u = rowinfo[p.au[i+1]-1]; |
| 769 | 769 | @ if(u.id<p.id){ |
| 770 | - @ drawBox(lineColor,x0,p.y,x1,p.y+1); | |
| 770 | + @ drawBox(lineClr,x0,p.y,x1,p.y+1); | |
| 771 | 771 | @ drawUpArrow(x1, u.y+6, p.y); |
| 772 | 772 | @ }else{ |
| 773 | 773 | @ drawBox("#600000",x0,p.y,x1,p.y+1); |
| 774 | 774 | @ drawBox("#600000",x1-1,p.y,x1,u.y+1); |
| 775 | 775 | @ drawBox("#600000",x1,u.y,u.x-6,u.y+1); |
| @@ -1106,11 +1106,11 @@ | ||
| 1106 | 1106 | const char *zTagName = P("t"); /* Show events with this tag */ |
| 1107 | 1107 | const char *zBrName = P("r"); /* Show events related to this tag */ |
| 1108 | 1108 | const char *zSearch = P("s"); /* Search string */ |
| 1109 | 1109 | const char *zUses = P("uf"); /* Only show checkins hold this file */ |
| 1110 | 1110 | const char *zYearMonth = P("ym"); /* Show checkins for the given YYYY-MM */ |
| 1111 | - const char *zYearWeek = P("yw"); /* Show checkins for the given YYYY-WW (week-of-year)*/ | |
| 1111 | + const char *zYearWeek = P("yw"); /* Checkins for YYYY-WW (week-of-year) */ | |
| 1112 | 1112 | int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */ |
| 1113 | 1113 | int renameOnly = P("namechng")!=0; /* Show only checkins that rename files */ |
| 1114 | 1114 | int tagid; /* Tag ID */ |
| 1115 | 1115 | int tmFlags = 0; /* Timeline flags */ |
| 1116 | 1116 | const char *zThisTag = 0; /* Suppress links to this tag */ |
| @@ -2051,10 +2051,10 @@ | ||
| 2051 | 2051 | " AND blob.rid=c.cid" |
| 2052 | 2052 | ); |
| 2053 | 2053 | while( db_step(&q)==SQLITE_ROW ){ |
| 2054 | 2054 | const char *zUuid = db_column_text(&q, 0); |
| 2055 | 2055 | @ <li> |
| 2056 | - @ <a href="%s(g.zTop)/timeline?p=%s(zUuid)&d=%s(zUuid)&unhide">%S(zUuid)</a> | |
| 2056 | + @ <a href="%s(g.zTop)/timeline?dp=%s(zUuid)&unhide">%S(zUuid)</a> | |
| 2057 | 2057 | } |
| 2058 | 2058 | db_finalize(&q); |
| 2059 | 2059 | style_footer(); |
| 2060 | 2060 | } |
| 2061 | 2061 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -666,16 +666,16 @@ | |
| 666 | if( cSep=='[' ) cgi_printf("["); |
| 667 | cgi_printf("],h:\"%s\"}%s", pRow->zUuid, pRow->pNext ? ",\n" : "];\n"); |
| 668 | } |
| 669 | cgi_printf("var nrail = %d\n", pGraph->mxRail+1); |
| 670 | graph_free(pGraph); |
| 671 | @ var canvasDiv = gebi("canvas"); |
| 672 | @ var canvasStyle = window.getComputedStyle && window.getComputedStyle(canvasDiv,null); |
| 673 | @ var lineColor = (canvasStyle && canvasStyle.getPropertyValue('color')) || 'black'; |
| 674 | @ var bgColor = (canvasStyle && canvasStyle.getPropertyValue('background-color')) || 'white'; |
| 675 | @ if( bgColor=='transparent' ) bgColor = 'white'; |
| 676 | @ var boxColor = lineColor; |
| 677 | @ function drawBox(color,x0,y0,x1,y1){ |
| 678 | @ var n = document.createElement("div"); |
| 679 | @ if( x0>x1 ){ var t=x0; x0=x1; x1=t; } |
| 680 | @ if( y0>y1 ){ var t=y0; y0=y1; y1=t; } |
| 681 | @ var w = x1-x0+1; |
| @@ -685,11 +685,11 @@ | |
| 685 | @ n.style.left = x0+"px"; |
| 686 | @ n.style.top = y0+"px"; |
| 687 | @ n.style.width = w+"px"; |
| 688 | @ n.style.height = h+"px"; |
| 689 | @ n.style.backgroundColor = color; |
| 690 | @ canvasDiv.appendChild(n); |
| 691 | @ return n; |
| 692 | @ } |
| 693 | @ function absoluteY(id){ |
| 694 | @ var obj = gebi(id); |
| 695 | @ if( !obj ) return; |
| @@ -711,39 +711,39 @@ | |
| 711 | @ }while( obj = obj.offsetParent ); |
| 712 | @ } |
| 713 | @ return left; |
| 714 | @ } |
| 715 | @ function drawUpArrow(x,y0,y1){ |
| 716 | @ drawBox(lineColor,x,y0,x+1,y1); |
| 717 | @ if( y0+10>=y1 ){ |
| 718 | @ drawBox(lineColor,x-1,y0+1,x+2,y0+2); |
| 719 | @ drawBox(lineColor,x-2,y0+3,x+3,y0+4); |
| 720 | @ }else{ |
| 721 | @ drawBox(lineColor,x-1,y0+2,x+2,y0+4); |
| 722 | @ drawBox(lineColor,x-2,y0+5,x+3,y0+7); |
| 723 | @ } |
| 724 | @ } |
| 725 | @ function drawThinArrow(y,xFrom,xTo){ |
| 726 | @ if( xFrom<xTo ){ |
| 727 | @ drawBox(lineColor,xFrom,y,xTo,y); |
| 728 | @ drawBox(lineColor,xTo-3,y-1,xTo-2,y+1); |
| 729 | @ drawBox(lineColor,xTo-4,y-2,xTo-4,y+2); |
| 730 | @ }else{ |
| 731 | @ drawBox(lineColor,xTo,y,xFrom,y); |
| 732 | @ drawBox(lineColor,xTo+2,y-1,xTo+3,y+1); |
| 733 | @ drawBox(lineColor,xTo+4,y-2,xTo+4,y+2); |
| 734 | @ } |
| 735 | @ } |
| 736 | @ function drawThinLine(x0,y0,x1,y1){ |
| 737 | @ drawBox(lineColor,x0,y0,x1,y1); |
| 738 | @ } |
| 739 | @ function drawNodeBox(color,x0,y0,x1,y1){ |
| 740 | @ drawBox(color,x0,y0,x1,y1).style.cursor = "pointer"; |
| 741 | @ } |
| 742 | @ function drawNode(p, left, btm){ |
| 743 | @ drawNodeBox(boxColor,p.x-5,p.y-5,p.x+6,p.y+6); |
| 744 | @ drawNodeBox(p.bg||bgColor,p.x-4,p.y-4,p.x+5,p.y+5); |
| 745 | @ if( p.u>0 ) drawUpArrow(p.x, rowinfo[p.u-1].y+6, p.y-5); |
| 746 | @ if( p.f&1 ) drawNodeBox(boxColor,p.x-1,p.y-1,p.x+2,p.y+2); |
| 747 | if( !omitDescenders ){ |
| 748 | @ if( p.u==0 ) drawUpArrow(p.x, 0, p.y-5); |
| 749 | @ if( p.d ) drawUpArrow(p.x, p.y+6, btm); |
| @@ -765,11 +765,11 @@ | |
| 765 | @ for(var i=0; i<n; i+=2){ |
| 766 | @ var x1 = p.au[i]*railPitch + left; |
| 767 | @ var x0 = x1>p.x ? p.x+7 : p.x-6; |
| 768 | @ var u = rowinfo[p.au[i+1]-1]; |
| 769 | @ if(u.id<p.id){ |
| 770 | @ drawBox(lineColor,x0,p.y,x1,p.y+1); |
| 771 | @ drawUpArrow(x1, u.y+6, p.y); |
| 772 | @ }else{ |
| 773 | @ drawBox("#600000",x0,p.y,x1,p.y+1); |
| 774 | @ drawBox("#600000",x1-1,p.y,x1,u.y+1); |
| 775 | @ drawBox("#600000",x1,u.y,u.x-6,u.y+1); |
| @@ -1106,11 +1106,11 @@ | |
| 1106 | const char *zTagName = P("t"); /* Show events with this tag */ |
| 1107 | const char *zBrName = P("r"); /* Show events related to this tag */ |
| 1108 | const char *zSearch = P("s"); /* Search string */ |
| 1109 | const char *zUses = P("uf"); /* Only show checkins hold this file */ |
| 1110 | const char *zYearMonth = P("ym"); /* Show checkins for the given YYYY-MM */ |
| 1111 | const char *zYearWeek = P("yw"); /* Show checkins for the given YYYY-WW (week-of-year)*/ |
| 1112 | int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */ |
| 1113 | int renameOnly = P("namechng")!=0; /* Show only checkins that rename files */ |
| 1114 | int tagid; /* Tag ID */ |
| 1115 | int tmFlags = 0; /* Timeline flags */ |
| 1116 | const char *zThisTag = 0; /* Suppress links to this tag */ |
| @@ -2051,10 +2051,10 @@ | |
| 2051 | " AND blob.rid=c.cid" |
| 2052 | ); |
| 2053 | while( db_step(&q)==SQLITE_ROW ){ |
| 2054 | const char *zUuid = db_column_text(&q, 0); |
| 2055 | @ <li> |
| 2056 | @ <a href="%s(g.zTop)/timeline?p=%s(zUuid)&d=%s(zUuid)&unhide">%S(zUuid)</a> |
| 2057 | } |
| 2058 | db_finalize(&q); |
| 2059 | style_footer(); |
| 2060 | } |
| 2061 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -666,16 +666,16 @@ | |
| 666 | if( cSep=='[' ) cgi_printf("["); |
| 667 | cgi_printf("],h:\"%s\"}%s", pRow->zUuid, pRow->pNext ? ",\n" : "];\n"); |
| 668 | } |
| 669 | cgi_printf("var nrail = %d\n", pGraph->mxRail+1); |
| 670 | graph_free(pGraph); |
| 671 | @ var cDiv = gebi("canvas"); |
| 672 | @ var csty = window.getComputedStyle && window.getComputedStyle(cDiv,null); |
| 673 | @ var lineClr = (csty && csty.getPropertyValue('color')) || 'black'; |
| 674 | @ var bgClr = (csty && csty.getPropertyValue('background-color')) ||'white'; |
| 675 | @ if( bgClr=='transparent' ) bgClr = 'white'; |
| 676 | @ var boxColor = lineClr; |
| 677 | @ function drawBox(color,x0,y0,x1,y1){ |
| 678 | @ var n = document.createElement("div"); |
| 679 | @ if( x0>x1 ){ var t=x0; x0=x1; x1=t; } |
| 680 | @ if( y0>y1 ){ var t=y0; y0=y1; y1=t; } |
| 681 | @ var w = x1-x0+1; |
| @@ -685,11 +685,11 @@ | |
| 685 | @ n.style.left = x0+"px"; |
| 686 | @ n.style.top = y0+"px"; |
| 687 | @ n.style.width = w+"px"; |
| 688 | @ n.style.height = h+"px"; |
| 689 | @ n.style.backgroundColor = color; |
| 690 | @ cDiv.appendChild(n); |
| 691 | @ return n; |
| 692 | @ } |
| 693 | @ function absoluteY(id){ |
| 694 | @ var obj = gebi(id); |
| 695 | @ if( !obj ) return; |
| @@ -711,39 +711,39 @@ | |
| 711 | @ }while( obj = obj.offsetParent ); |
| 712 | @ } |
| 713 | @ return left; |
| 714 | @ } |
| 715 | @ function drawUpArrow(x,y0,y1){ |
| 716 | @ drawBox(lineClr,x,y0,x+1,y1); |
| 717 | @ if( y0+10>=y1 ){ |
| 718 | @ drawBox(lineClr,x-1,y0+1,x+2,y0+2); |
| 719 | @ drawBox(lineClr,x-2,y0+3,x+3,y0+4); |
| 720 | @ }else{ |
| 721 | @ drawBox(lineClr,x-1,y0+2,x+2,y0+4); |
| 722 | @ drawBox(lineClr,x-2,y0+5,x+3,y0+7); |
| 723 | @ } |
| 724 | @ } |
| 725 | @ function drawThinArrow(y,xFrom,xTo){ |
| 726 | @ if( xFrom<xTo ){ |
| 727 | @ drawBox(lineClr,xFrom,y,xTo,y); |
| 728 | @ drawBox(lineClr,xTo-3,y-1,xTo-2,y+1); |
| 729 | @ drawBox(lineClr,xTo-4,y-2,xTo-4,y+2); |
| 730 | @ }else{ |
| 731 | @ drawBox(lineClr,xTo,y,xFrom,y); |
| 732 | @ drawBox(lineClr,xTo+2,y-1,xTo+3,y+1); |
| 733 | @ drawBox(lineClr,xTo+4,y-2,xTo+4,y+2); |
| 734 | @ } |
| 735 | @ } |
| 736 | @ function drawThinLine(x0,y0,x1,y1){ |
| 737 | @ drawBox(lineClr,x0,y0,x1,y1); |
| 738 | @ } |
| 739 | @ function drawNodeBox(color,x0,y0,x1,y1){ |
| 740 | @ drawBox(color,x0,y0,x1,y1).style.cursor = "pointer"; |
| 741 | @ } |
| 742 | @ function drawNode(p, left, btm){ |
| 743 | @ drawNodeBox(boxColor,p.x-5,p.y-5,p.x+6,p.y+6); |
| 744 | @ drawNodeBox(p.bg||bgClr,p.x-4,p.y-4,p.x+5,p.y+5); |
| 745 | @ if( p.u>0 ) drawUpArrow(p.x, rowinfo[p.u-1].y+6, p.y-5); |
| 746 | @ if( p.f&1 ) drawNodeBox(boxColor,p.x-1,p.y-1,p.x+2,p.y+2); |
| 747 | if( !omitDescenders ){ |
| 748 | @ if( p.u==0 ) drawUpArrow(p.x, 0, p.y-5); |
| 749 | @ if( p.d ) drawUpArrow(p.x, p.y+6, btm); |
| @@ -765,11 +765,11 @@ | |
| 765 | @ for(var i=0; i<n; i+=2){ |
| 766 | @ var x1 = p.au[i]*railPitch + left; |
| 767 | @ var x0 = x1>p.x ? p.x+7 : p.x-6; |
| 768 | @ var u = rowinfo[p.au[i+1]-1]; |
| 769 | @ if(u.id<p.id){ |
| 770 | @ drawBox(lineClr,x0,p.y,x1,p.y+1); |
| 771 | @ drawUpArrow(x1, u.y+6, p.y); |
| 772 | @ }else{ |
| 773 | @ drawBox("#600000",x0,p.y,x1,p.y+1); |
| 774 | @ drawBox("#600000",x1-1,p.y,x1,u.y+1); |
| 775 | @ drawBox("#600000",x1,u.y,u.x-6,u.y+1); |
| @@ -1106,11 +1106,11 @@ | |
| 1106 | const char *zTagName = P("t"); /* Show events with this tag */ |
| 1107 | const char *zBrName = P("r"); /* Show events related to this tag */ |
| 1108 | const char *zSearch = P("s"); /* Search string */ |
| 1109 | const char *zUses = P("uf"); /* Only show checkins hold this file */ |
| 1110 | const char *zYearMonth = P("ym"); /* Show checkins for the given YYYY-MM */ |
| 1111 | const char *zYearWeek = P("yw"); /* Checkins for YYYY-WW (week-of-year) */ |
| 1112 | int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */ |
| 1113 | int renameOnly = P("namechng")!=0; /* Show only checkins that rename files */ |
| 1114 | int tagid; /* Tag ID */ |
| 1115 | int tmFlags = 0; /* Timeline flags */ |
| 1116 | const char *zThisTag = 0; /* Suppress links to this tag */ |
| @@ -2051,10 +2051,10 @@ | |
| 2051 | " AND blob.rid=c.cid" |
| 2052 | ); |
| 2053 | while( db_step(&q)==SQLITE_ROW ){ |
| 2054 | const char *zUuid = db_column_text(&q, 0); |
| 2055 | @ <li> |
| 2056 | @ <a href="%s(g.zTop)/timeline?dp=%s(zUuid)&unhide">%S(zUuid)</a> |
| 2057 | } |
| 2058 | db_finalize(&q); |
| 2059 | style_footer(); |
| 2060 | } |
| 2061 |