Fossil SCM

Click on the timeline graph once to select a node. Click on a different node to see a diff between the two nodes. Click on the selected node to unselect it.

drh 2012-11-30 15:22 trunk merge
Commit 5bff5e5cc5d10795da828b48af50cec4785fec29
+5 -3
--- src/finfo.c
+++ src/finfo.c
@@ -345,11 +345,12 @@
345345
blob_appendf(&title, "History of ");
346346
hyperlinked_path(zFilename, &title, 0);
347347
@ <h2>%b(&title)</h2>
348348
blob_reset(&title);
349349
pGraph = graph_init();
350
- @ <div id="canvas" style="position:relative;width:1px;height:1px;"></div>
350
+ @ <div id="canvas" style="position:relative;width:1px;height:1px;"
351
+ @ onclick="clickOnGraph(event)"></div>
351352
@ <table id="timelineTable" class="timelineTable">
352353
while( db_step(&q)==SQLITE_ROW ){
353354
const char *zDate = db_column_text(&q, 0);
354355
const char *zCom = db_column_text(&q, 1);
355356
const char *zUser = db_column_text(&q, 2);
@@ -370,11 +371,12 @@
370371
if( uBg ){
371372
zBgClr = hash_color(zUser);
372373
}else if( brBg || zBgClr==0 || zBgClr[0]==0 ){
373374
zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr);
374375
}
375
- gidx = graph_add_row(pGraph, frid, fpid>0 ? 1 : 0, &fpid, zBr, zBgClr, 0);
376
+ gidx = graph_add_row(pGraph, frid, fpid>0 ? 1 : 0, &fpid, zBr, zBgClr,
377
+ zUuid, 0);
376378
if( memcmp(zDate, zPrevDate, 10) ){
377379
sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate);
378380
@ <tr><td>
379381
@ <div class="divider">%s(zPrevDate)</div>
380382
@ </td><td></td><td></td></tr>
@@ -446,8 +448,8 @@
446448
@ <div id="grbtm" style="width:%d(pGraph->mxRail*20+30)px;"></div>
447449
@ </td><td></td></tr>
448450
}
449451
}
450452
@ </table>
451
- timeline_output_graph_javascript(pGraph, 0);
453
+ timeline_output_graph_javascript(pGraph, 0, 1);
452454
style_footer();
453455
}
454456
--- src/finfo.c
+++ src/finfo.c
@@ -345,11 +345,12 @@
345 blob_appendf(&title, "History of ");
346 hyperlinked_path(zFilename, &title, 0);
347 @ <h2>%b(&title)</h2>
348 blob_reset(&title);
349 pGraph = graph_init();
350 @ <div id="canvas" style="position:relative;width:1px;height:1px;"></div>
 
351 @ <table id="timelineTable" class="timelineTable">
352 while( db_step(&q)==SQLITE_ROW ){
353 const char *zDate = db_column_text(&q, 0);
354 const char *zCom = db_column_text(&q, 1);
355 const char *zUser = db_column_text(&q, 2);
@@ -370,11 +371,12 @@
370 if( uBg ){
371 zBgClr = hash_color(zUser);
372 }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){
373 zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr);
374 }
375 gidx = graph_add_row(pGraph, frid, fpid>0 ? 1 : 0, &fpid, zBr, zBgClr, 0);
 
376 if( memcmp(zDate, zPrevDate, 10) ){
377 sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate);
378 @ <tr><td>
379 @ <div class="divider">%s(zPrevDate)</div>
380 @ </td><td></td><td></td></tr>
@@ -446,8 +448,8 @@
446 @ <div id="grbtm" style="width:%d(pGraph->mxRail*20+30)px;"></div>
447 @ </td><td></td></tr>
448 }
449 }
450 @ </table>
451 timeline_output_graph_javascript(pGraph, 0);
452 style_footer();
453 }
454
--- src/finfo.c
+++ src/finfo.c
@@ -345,11 +345,12 @@
345 blob_appendf(&title, "History of ");
346 hyperlinked_path(zFilename, &title, 0);
347 @ <h2>%b(&title)</h2>
348 blob_reset(&title);
349 pGraph = graph_init();
350 @ <div id="canvas" style="position:relative;width:1px;height:1px;"
351 @ onclick="clickOnGraph(event)"></div>
352 @ <table id="timelineTable" class="timelineTable">
353 while( db_step(&q)==SQLITE_ROW ){
354 const char *zDate = db_column_text(&q, 0);
355 const char *zCom = db_column_text(&q, 1);
356 const char *zUser = db_column_text(&q, 2);
@@ -370,11 +371,12 @@
371 if( uBg ){
372 zBgClr = hash_color(zUser);
373 }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){
374 zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr);
375 }
376 gidx = graph_add_row(pGraph, frid, fpid>0 ? 1 : 0, &fpid, zBr, zBgClr,
377 zUuid, 0);
378 if( memcmp(zDate, zPrevDate, 10) ){
379 sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate);
380 @ <tr><td>
381 @ <div class="divider">%s(zPrevDate)</div>
382 @ </td><td></td><td></td></tr>
@@ -446,8 +448,8 @@
448 @ <div id="grbtm" style="width:%d(pGraph->mxRail*20+30)px;"></div>
449 @ </td><td></td></tr>
450 }
451 }
452 @ </table>
453 timeline_output_graph_javascript(pGraph, 0, 1);
454 style_footer();
455 }
456
--- src/graph.c
+++ src/graph.c
@@ -34,10 +34,11 @@
3434
int rid; /* The rid for the check-in */
3535
i8 nParent; /* Number of parents */
3636
int *aParent; /* Array of parents. 0 element is primary .*/
3737
char *zBranch; /* Branch name */
3838
char *zBgClr; /* Background Color */
39
+ char zUuid[17]; /* Check-in for file ID */
3940
4041
GraphRow *pNext; /* Next row down in the list of all rows */
4142
GraphRow *pPrev; /* Previous row */
4243
4344
int idx; /* Row index. First is 1. 0 used for "none" */
@@ -175,10 +176,11 @@
175176
int rid, /* RID for the check-in */
176177
int nParent, /* Number of parents */
177178
int *aParent, /* Array of parents */
178179
const char *zBranch, /* Branch for this check-in */
179180
const char *zBgClr, /* Background color. NULL or "" for white. */
181
+ const char *zUuid, /* SHA1 hash of the object being graphed */
180182
int isLeaf /* True if this row is a leaf */
181183
){
182184
GraphRow *pRow;
183185
int nByte;
184186
@@ -188,10 +190,12 @@
188190
pRow = (GraphRow*)safeMalloc( nByte );
189191
pRow->aParent = (int*)&pRow[1];
190192
pRow->rid = rid;
191193
pRow->nParent = nParent;
192194
pRow->zBranch = persistBranchName(p, zBranch);
195
+ if( zUuid==0 ) zUuid = "";
196
+ sqlite3_snprintf(sizeof(pRow->zUuid), pRow->zUuid, "%s", zUuid);
193197
pRow->isLeaf = isLeaf;
194198
memset(pRow->aiRiser, -1, sizeof(pRow->aiRiser));
195199
if( zBgClr==0 || zBgClr[0]==0 ) zBgClr = "white";
196200
pRow->zBgClr = persistBranchName(p, zBgClr);
197201
memcpy(pRow->aParent, aParent, sizeof(aParent[0])*nParent);
198202
--- src/graph.c
+++ src/graph.c
@@ -34,10 +34,11 @@
34 int rid; /* The rid for the check-in */
35 i8 nParent; /* Number of parents */
36 int *aParent; /* Array of parents. 0 element is primary .*/
37 char *zBranch; /* Branch name */
38 char *zBgClr; /* Background Color */
 
39
40 GraphRow *pNext; /* Next row down in the list of all rows */
41 GraphRow *pPrev; /* Previous row */
42
43 int idx; /* Row index. First is 1. 0 used for "none" */
@@ -175,10 +176,11 @@
175 int rid, /* RID for the check-in */
176 int nParent, /* Number of parents */
177 int *aParent, /* Array of parents */
178 const char *zBranch, /* Branch for this check-in */
179 const char *zBgClr, /* Background color. NULL or "" for white. */
 
180 int isLeaf /* True if this row is a leaf */
181 ){
182 GraphRow *pRow;
183 int nByte;
184
@@ -188,10 +190,12 @@
188 pRow = (GraphRow*)safeMalloc( nByte );
189 pRow->aParent = (int*)&pRow[1];
190 pRow->rid = rid;
191 pRow->nParent = nParent;
192 pRow->zBranch = persistBranchName(p, zBranch);
 
 
193 pRow->isLeaf = isLeaf;
194 memset(pRow->aiRiser, -1, sizeof(pRow->aiRiser));
195 if( zBgClr==0 || zBgClr[0]==0 ) zBgClr = "white";
196 pRow->zBgClr = persistBranchName(p, zBgClr);
197 memcpy(pRow->aParent, aParent, sizeof(aParent[0])*nParent);
198
--- src/graph.c
+++ src/graph.c
@@ -34,10 +34,11 @@
34 int rid; /* The rid for the check-in */
35 i8 nParent; /* Number of parents */
36 int *aParent; /* Array of parents. 0 element is primary .*/
37 char *zBranch; /* Branch name */
38 char *zBgClr; /* Background Color */
39 char zUuid[17]; /* Check-in for file ID */
40
41 GraphRow *pNext; /* Next row down in the list of all rows */
42 GraphRow *pPrev; /* Previous row */
43
44 int idx; /* Row index. First is 1. 0 used for "none" */
@@ -175,10 +176,11 @@
176 int rid, /* RID for the check-in */
177 int nParent, /* Number of parents */
178 int *aParent, /* Array of parents */
179 const char *zBranch, /* Branch for this check-in */
180 const char *zBgClr, /* Background color. NULL or "" for white. */
181 const char *zUuid, /* SHA1 hash of the object being graphed */
182 int isLeaf /* True if this row is a leaf */
183 ){
184 GraphRow *pRow;
185 int nByte;
186
@@ -188,10 +190,12 @@
190 pRow = (GraphRow*)safeMalloc( nByte );
191 pRow->aParent = (int*)&pRow[1];
192 pRow->rid = rid;
193 pRow->nParent = nParent;
194 pRow->zBranch = persistBranchName(p, zBranch);
195 if( zUuid==0 ) zUuid = "";
196 sqlite3_snprintf(sizeof(pRow->zUuid), pRow->zUuid, "%s", zUuid);
197 pRow->isLeaf = isLeaf;
198 memset(pRow->aiRiser, -1, sizeof(pRow->aiRiser));
199 if( zBgClr==0 || zBgClr[0]==0 ) zBgClr = "white";
200 pRow->zBgClr = persistBranchName(p, zBgClr);
201 memcpy(pRow->aParent, aParent, sizeof(aParent[0])*nParent);
202
+46 -5
--- src/timeline.c
+++ src/timeline.c
@@ -211,11 +211,12 @@
211211
if( tmFlags & TIMELINE_GRAPH ){
212212
pGraph = graph_init();
213213
/* style is not moved to css, because this is
214214
** a technical div for the timeline graph
215215
*/
216
- @ <div id="canvas" style="position:relative;width:1px;height:1px;"></div>
216
+ @ <div id="canvas" style="position:relative;width:1px;height:1px;"
217
+ @ onclick="clickOnGraph(event)"></div>
217218
}
218219
db_static_prepare(&qbranch,
219220
"SELECT value FROM tagxref WHERE tagid=%d AND tagtype>0 AND rid=:rid",
220221
TAG_BRANCH
221222
);
@@ -311,11 +312,12 @@
311312
db_bind_int(&qparent, ":rid", rid);
312313
while( db_step(&qparent)==SQLITE_ROW && nParent<32 ){
313314
aParent[nParent++] = db_column_int(&qparent, 0);
314315
}
315316
db_reset(&qparent);
316
- gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr, isLeaf);
317
+ gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr,
318
+ zUuid, isLeaf);
317319
db_reset(&qbranch);
318320
@ <div id="m%d(gidx)"></div>
319321
}
320322
@</td>
321323
if( zBgClr && zBgClr[0] ){
@@ -491,18 +493,22 @@
491493
@ </td><td></td></tr>
492494
}
493495
}
494496
@ </table>
495497
if( fchngQueryInit ) db_finalize(&fchngQuery);
496
- timeline_output_graph_javascript(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0);
498
+ timeline_output_graph_javascript(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0, 0);
497499
}
498500
499501
/*
500502
** Generate all of the necessary javascript to generate a timeline
501503
** graph.
502504
*/
503
-void timeline_output_graph_javascript(GraphContext *pGraph, int omitDescenders){
505
+void timeline_output_graph_javascript(
506
+ GraphContext *pGraph, /* The graph to be displayed */
507
+ int omitDescenders, /* True to omit descenders */
508
+ int fileDiff /* True for file diff. False for check-in diff */
509
+){
504510
if( pGraph && pGraph->nErr==0 && pGraph->nRow>0 ){
505511
GraphRow *pRow;
506512
int i;
507513
char cSep;
508514
@ <script type="text/JavaScript">
@@ -535,10 +541,11 @@
535541
** mi: "merge-in". An array of integer x-coordinates from which
536542
** merge arrows should be drawn into this node. If the value is
537543
** negative, then the x-coordinate is the absolute value of mi[]
538544
** and a thin merge-arrow descender is drawn to the bottom of
539545
** the screen.
546
+ ** h: The SHA1 hash of the object being graphed
540547
*/
541548
cgi_printf("var rowinfo = [\n");
542549
for(pRow=pGraph->pFirst; pRow; pRow=pRow->pNext){
543550
int mo = pRow->mergeOut;
544551
if( mo<0 ){
@@ -576,11 +583,11 @@
576583
cgi_printf("%c%d", cSep, mi);
577584
cSep = ',';
578585
}
579586
}
580587
if( cSep=='[' ) cgi_printf("[");
581
- cgi_printf("]}%s", pRow->pNext ? ",\n" : "];\n");
588
+ cgi_printf("],h:\"%s\"}%s", pRow->zUuid, pRow->pNext ? ",\n" : "];\n");
582589
}
583590
cgi_printf("var nrail = %d\n", pGraph->mxRail+1);
584591
graph_free(pGraph);
585592
@ var canvasDiv = gebi("canvas");
586593
#if 0
@@ -598,10 +605,11 @@
598605
@ n.style.top = y0+"px";
599606
@ n.style.width = w+"px";
600607
@ n.style.height = h+"px";
601608
@ n.style.backgroundColor = color;
602609
@ canvasDiv.appendChild(n);
610
+ @ return n;
603611
@ }
604612
@ function absoluteY(id){
605613
@ var obj = gebi(id);
606614
@ if( !obj ) return;
607615
@ var top = 0;
@@ -699,10 +707,12 @@
699707
@ }else{
700708
@ drawThinArrow(y0,mx,p.x-5);
701709
@ }
702710
@ }
703711
@ }
712
+ @ var selBox = null;
713
+ @ var selRow = null;
704714
@ function renderGraph(){
705715
@ var canvasDiv = gebi("canvas");
706716
@ while( canvasDiv.hasChildNodes() ){
707717
@ canvasDiv.removeChild(canvasDiv.firstChild);
708718
@ }
@@ -736,10 +746,41 @@
736746
@ };
737747
@ }
738748
#endif
739749
@ for(var i in rowinfo){
740750
@ drawNode(rowinfo[i], left, btm);
751
+ @ }
752
+ @ if( selRow!=null ) clickOnRow(selRow);
753
+ @ }
754
+ @ function clickOnGraph(event){
755
+ @ var x=event.clientX-absoluteX("canvas")+window.pageXOffset;
756
+ @ var y=event.clientY-absoluteY("canvas")+window.pageYOffset;
757
+ @ for(var i in rowinfo){
758
+ @ p = rowinfo[i];
759
+ @ if( p.y<y-10 ) continue;
760
+ @ if( p.y>y+10 ) break;
761
+ @ if( p.x>x-10 && p.x<x+10 ){
762
+ @ clickOnRow(p);
763
+ @ break;
764
+ @ }
765
+ @ }
766
+ @ }
767
+ @ function clickOnRow(p){
768
+ @ if( selRow==null ){
769
+ @ selBox = drawBox("red",p.x-2,p.y-2,p.x+3,p.y+3);
770
+ @ selRow = p;
771
+ @ }else if( selRow==p ){
772
+ @ var canvasDiv = gebi("canvas");
773
+ @ canvasDiv.removeChild(selBox);
774
+ @ selBox = null;
775
+ @ selRow = null;
776
+ @ }else{
777
+ if( fileDiff ){
778
+ @ location.href="%R/fdiff?v1="+selRow.h+"&v2="+p.h;
779
+ }else{
780
+ @ location.href="%R/vdiff?from="+selRow.h+"&to="+p.h;
781
+ }
741782
@ }
742783
@ }
743784
@ var lastId = "m"+rowinfo[rowinfo.length-1].id;
744785
@ var lastY = 0;
745786
@ function checkHeight(){
746787
--- src/timeline.c
+++ src/timeline.c
@@ -211,11 +211,12 @@
211 if( tmFlags & TIMELINE_GRAPH ){
212 pGraph = graph_init();
213 /* style is not moved to css, because this is
214 ** a technical div for the timeline graph
215 */
216 @ <div id="canvas" style="position:relative;width:1px;height:1px;"></div>
 
217 }
218 db_static_prepare(&qbranch,
219 "SELECT value FROM tagxref WHERE tagid=%d AND tagtype>0 AND rid=:rid",
220 TAG_BRANCH
221 );
@@ -311,11 +312,12 @@
311 db_bind_int(&qparent, ":rid", rid);
312 while( db_step(&qparent)==SQLITE_ROW && nParent<32 ){
313 aParent[nParent++] = db_column_int(&qparent, 0);
314 }
315 db_reset(&qparent);
316 gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr, isLeaf);
 
317 db_reset(&qbranch);
318 @ <div id="m%d(gidx)"></div>
319 }
320 @</td>
321 if( zBgClr && zBgClr[0] ){
@@ -491,18 +493,22 @@
491 @ </td><td></td></tr>
492 }
493 }
494 @ </table>
495 if( fchngQueryInit ) db_finalize(&fchngQuery);
496 timeline_output_graph_javascript(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0);
497 }
498
499 /*
500 ** Generate all of the necessary javascript to generate a timeline
501 ** graph.
502 */
503 void timeline_output_graph_javascript(GraphContext *pGraph, int omitDescenders){
 
 
 
 
504 if( pGraph && pGraph->nErr==0 && pGraph->nRow>0 ){
505 GraphRow *pRow;
506 int i;
507 char cSep;
508 @ <script type="text/JavaScript">
@@ -535,10 +541,11 @@
535 ** mi: "merge-in". An array of integer x-coordinates from which
536 ** merge arrows should be drawn into this node. If the value is
537 ** negative, then the x-coordinate is the absolute value of mi[]
538 ** and a thin merge-arrow descender is drawn to the bottom of
539 ** the screen.
 
540 */
541 cgi_printf("var rowinfo = [\n");
542 for(pRow=pGraph->pFirst; pRow; pRow=pRow->pNext){
543 int mo = pRow->mergeOut;
544 if( mo<0 ){
@@ -576,11 +583,11 @@
576 cgi_printf("%c%d", cSep, mi);
577 cSep = ',';
578 }
579 }
580 if( cSep=='[' ) cgi_printf("[");
581 cgi_printf("]}%s", pRow->pNext ? ",\n" : "];\n");
582 }
583 cgi_printf("var nrail = %d\n", pGraph->mxRail+1);
584 graph_free(pGraph);
585 @ var canvasDiv = gebi("canvas");
586 #if 0
@@ -598,10 +605,11 @@
598 @ n.style.top = y0+"px";
599 @ n.style.width = w+"px";
600 @ n.style.height = h+"px";
601 @ n.style.backgroundColor = color;
602 @ canvasDiv.appendChild(n);
 
603 @ }
604 @ function absoluteY(id){
605 @ var obj = gebi(id);
606 @ if( !obj ) return;
607 @ var top = 0;
@@ -699,10 +707,12 @@
699 @ }else{
700 @ drawThinArrow(y0,mx,p.x-5);
701 @ }
702 @ }
703 @ }
 
 
704 @ function renderGraph(){
705 @ var canvasDiv = gebi("canvas");
706 @ while( canvasDiv.hasChildNodes() ){
707 @ canvasDiv.removeChild(canvasDiv.firstChild);
708 @ }
@@ -736,10 +746,41 @@
736 @ };
737 @ }
738 #endif
739 @ for(var i in rowinfo){
740 @ drawNode(rowinfo[i], left, btm);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
741 @ }
742 @ }
743 @ var lastId = "m"+rowinfo[rowinfo.length-1].id;
744 @ var lastY = 0;
745 @ function checkHeight(){
746
--- src/timeline.c
+++ src/timeline.c
@@ -211,11 +211,12 @@
211 if( tmFlags & TIMELINE_GRAPH ){
212 pGraph = graph_init();
213 /* style is not moved to css, because this is
214 ** a technical div for the timeline graph
215 */
216 @ <div id="canvas" style="position:relative;width:1px;height:1px;"
217 @ onclick="clickOnGraph(event)"></div>
218 }
219 db_static_prepare(&qbranch,
220 "SELECT value FROM tagxref WHERE tagid=%d AND tagtype>0 AND rid=:rid",
221 TAG_BRANCH
222 );
@@ -311,11 +312,12 @@
312 db_bind_int(&qparent, ":rid", rid);
313 while( db_step(&qparent)==SQLITE_ROW && nParent<32 ){
314 aParent[nParent++] = db_column_int(&qparent, 0);
315 }
316 db_reset(&qparent);
317 gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr,
318 zUuid, isLeaf);
319 db_reset(&qbranch);
320 @ <div id="m%d(gidx)"></div>
321 }
322 @</td>
323 if( zBgClr && zBgClr[0] ){
@@ -491,18 +493,22 @@
493 @ </td><td></td></tr>
494 }
495 }
496 @ </table>
497 if( fchngQueryInit ) db_finalize(&fchngQuery);
498 timeline_output_graph_javascript(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0, 0);
499 }
500
501 /*
502 ** Generate all of the necessary javascript to generate a timeline
503 ** graph.
504 */
505 void timeline_output_graph_javascript(
506 GraphContext *pGraph, /* The graph to be displayed */
507 int omitDescenders, /* True to omit descenders */
508 int fileDiff /* True for file diff. False for check-in diff */
509 ){
510 if( pGraph && pGraph->nErr==0 && pGraph->nRow>0 ){
511 GraphRow *pRow;
512 int i;
513 char cSep;
514 @ <script type="text/JavaScript">
@@ -535,10 +541,11 @@
541 ** mi: "merge-in". An array of integer x-coordinates from which
542 ** merge arrows should be drawn into this node. If the value is
543 ** negative, then the x-coordinate is the absolute value of mi[]
544 ** and a thin merge-arrow descender is drawn to the bottom of
545 ** the screen.
546 ** h: The SHA1 hash of the object being graphed
547 */
548 cgi_printf("var rowinfo = [\n");
549 for(pRow=pGraph->pFirst; pRow; pRow=pRow->pNext){
550 int mo = pRow->mergeOut;
551 if( mo<0 ){
@@ -576,11 +583,11 @@
583 cgi_printf("%c%d", cSep, mi);
584 cSep = ',';
585 }
586 }
587 if( cSep=='[' ) cgi_printf("[");
588 cgi_printf("],h:\"%s\"}%s", pRow->zUuid, pRow->pNext ? ",\n" : "];\n");
589 }
590 cgi_printf("var nrail = %d\n", pGraph->mxRail+1);
591 graph_free(pGraph);
592 @ var canvasDiv = gebi("canvas");
593 #if 0
@@ -598,10 +605,11 @@
605 @ n.style.top = y0+"px";
606 @ n.style.width = w+"px";
607 @ n.style.height = h+"px";
608 @ n.style.backgroundColor = color;
609 @ canvasDiv.appendChild(n);
610 @ return n;
611 @ }
612 @ function absoluteY(id){
613 @ var obj = gebi(id);
614 @ if( !obj ) return;
615 @ var top = 0;
@@ -699,10 +707,12 @@
707 @ }else{
708 @ drawThinArrow(y0,mx,p.x-5);
709 @ }
710 @ }
711 @ }
712 @ var selBox = null;
713 @ var selRow = null;
714 @ function renderGraph(){
715 @ var canvasDiv = gebi("canvas");
716 @ while( canvasDiv.hasChildNodes() ){
717 @ canvasDiv.removeChild(canvasDiv.firstChild);
718 @ }
@@ -736,10 +746,41 @@
746 @ };
747 @ }
748 #endif
749 @ for(var i in rowinfo){
750 @ drawNode(rowinfo[i], left, btm);
751 @ }
752 @ if( selRow!=null ) clickOnRow(selRow);
753 @ }
754 @ function clickOnGraph(event){
755 @ var x=event.clientX-absoluteX("canvas")+window.pageXOffset;
756 @ var y=event.clientY-absoluteY("canvas")+window.pageYOffset;
757 @ for(var i in rowinfo){
758 @ p = rowinfo[i];
759 @ if( p.y<y-10 ) continue;
760 @ if( p.y>y+10 ) break;
761 @ if( p.x>x-10 && p.x<x+10 ){
762 @ clickOnRow(p);
763 @ break;
764 @ }
765 @ }
766 @ }
767 @ function clickOnRow(p){
768 @ if( selRow==null ){
769 @ selBox = drawBox("red",p.x-2,p.y-2,p.x+3,p.y+3);
770 @ selRow = p;
771 @ }else if( selRow==p ){
772 @ var canvasDiv = gebi("canvas");
773 @ canvasDiv.removeChild(selBox);
774 @ selBox = null;
775 @ selRow = null;
776 @ }else{
777 if( fileDiff ){
778 @ location.href="%R/fdiff?v1="+selRow.h+"&v2="+p.h;
779 }else{
780 @ location.href="%R/vdiff?from="+selRow.h+"&to="+p.h;
781 }
782 @ }
783 @ }
784 @ var lastId = "m"+rowinfo[rowinfo.length-1].id;
785 @ var lastY = 0;
786 @ function checkHeight(){
787

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button