Fossil SCM

Restore background colors and clickable nodes for the Leaves web page.

florian 2018-12-24 06:40 UTC fix-timeline-view
Commit d28f9e99a06ac3264a462765d63cf09b928fdf5a8ec95ea6805bf919ac1b9c85
2 files changed +2 -1 +27 -16
--- src/descendants.c
+++ src/descendants.c
@@ -507,11 +507,12 @@
507507
}else if( !showAll ){
508508
blob_append_sql(&sql," AND NOT %z", leaf_is_closed_sql("blob.rid"));
509509
}
510510
db_prepare(&q, "%s ORDER BY event.mtime DESC", blob_sql_text(&sql));
511511
blob_reset(&sql);
512
- www_print_timeline(&q, TIMELINE_LEAFONLY, 0, 0, 0, 0);
512
+ www_print_timeline(
513
+ &q, TIMELINE_LEAFONLY|TIMELINE_GRAPH|TIMELINE_NOSCROLL, 0, 0, 0, 0);
513514
db_finalize(&q);
514515
@ <br />
515516
style_footer();
516517
}
517518
518519
--- src/descendants.c
+++ src/descendants.c
@@ -507,11 +507,12 @@
507 }else if( !showAll ){
508 blob_append_sql(&sql," AND NOT %z", leaf_is_closed_sql("blob.rid"));
509 }
510 db_prepare(&q, "%s ORDER BY event.mtime DESC", blob_sql_text(&sql));
511 blob_reset(&sql);
512 www_print_timeline(&q, TIMELINE_LEAFONLY, 0, 0, 0, 0);
 
513 db_finalize(&q);
514 @ <br />
515 style_footer();
516 }
517
518
--- src/descendants.c
+++ src/descendants.c
@@ -507,11 +507,12 @@
507 }else if( !showAll ){
508 blob_append_sql(&sql," AND NOT %z", leaf_is_closed_sql("blob.rid"));
509 }
510 db_prepare(&q, "%s ORDER BY event.mtime DESC", blob_sql_text(&sql));
511 blob_reset(&sql);
512 www_print_timeline(
513 &q, TIMELINE_LEAFONLY|TIMELINE_GRAPH|TIMELINE_NOSCROLL, 0, 0, 0, 0);
514 db_finalize(&q);
515 @ <br />
516 style_footer();
517 }
518
519
+27 -16
--- src/timeline.c
+++ src/timeline.c
@@ -286,10 +286,15 @@
286286
zDateFmt = P("datefmt");
287287
if( zDateFmt ) dateFormat = atoi(zDateFmt);
288288
if( tmFlags & TIMELINE_GRAPH ){
289289
pGraph = graph_init();
290290
}
291
+ /* Always combine TIMELINE_LEAFONLY with TIMELINE_DISJOINT, or graph_finish()
292
+ ** may fail because of too many descenders to (off-screen) parents. */
293
+ if( tmFlags & TIMELINE_LEAFONLY ){
294
+ tmFlags |= TIMELINE_DISJOINT;
295
+ }
291296
db_static_prepare(&qbranch,
292297
"SELECT value FROM tagxref WHERE tagid=%d AND tagtype>0 AND rid=:rid",
293298
TAG_BRANCH
294299
);
295300
@@ -422,26 +427,32 @@
422427
zBgClr = hash_color(zBr);
423428
}
424429
}
425430
}
426431
if( zType[0]=='c' && pGraph ){
427
- int nParent = 0;
428
- int aParent[GR_MAX_RAIL];
429
- static Stmt qparent;
430
- db_static_prepare(&qparent,
431
- "SELECT pid FROM plink"
432
- " WHERE cid=:rid AND pid NOT IN phantom"
433
- " ORDER BY isprim DESC /*sort*/"
434
- );
435
- db_bind_int(&qparent, ":rid", rid);
436
- while( db_step(&qparent)==SQLITE_ROW && nParent<count(aParent) ){
437
- aParent[nParent++] = db_column_int(&qparent, 0);
438
- }
439
- db_reset(&qparent);
440
- gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr,
441
- zUuid, isLeaf);
442
- db_reset(&qbranch);
432
+ if( (tmFlags & TIMELINE_LEAFONLY)==0 ){
433
+ int nParent = 0;
434
+ int aParent[GR_MAX_RAIL];
435
+ static Stmt qparent;
436
+ db_static_prepare(&qparent,
437
+ "SELECT pid FROM plink"
438
+ " WHERE cid=:rid AND pid NOT IN phantom"
439
+ " ORDER BY isprim DESC /*sort*/"
440
+ );
441
+ db_bind_int(&qparent, ":rid", rid);
442
+ while( db_step(&qparent)==SQLITE_ROW && nParent<count(aParent) ){
443
+ aParent[nParent++] = db_column_int(&qparent, 0);
444
+ }
445
+ db_reset(&qparent);
446
+ gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr,
447
+ zUuid, isLeaf);
448
+ db_reset(&qbranch);
449
+ }else{
450
+ /* Omit parents if TIMELINE_LEAFONLY is set. */
451
+ gidx = graph_add_row(pGraph, rid, 0, 0, zBr, zBgClr,
452
+ zUuid, isLeaf);
453
+ }
443454
@ <div id="m%d(gidx)" class="tl-nodemark"></div>
444455
}else if( zType[0]=='e' && pGraph && zBgClr && zBgClr[0] ){
445456
/* For technotes, make a graph node with nParent==(-1). This will
446457
** not actually draw anything on the graph, but it will set the
447458
** background color of the timeline entry */
448459
--- src/timeline.c
+++ src/timeline.c
@@ -286,10 +286,15 @@
286 zDateFmt = P("datefmt");
287 if( zDateFmt ) dateFormat = atoi(zDateFmt);
288 if( tmFlags & TIMELINE_GRAPH ){
289 pGraph = graph_init();
290 }
 
 
 
 
 
291 db_static_prepare(&qbranch,
292 "SELECT value FROM tagxref WHERE tagid=%d AND tagtype>0 AND rid=:rid",
293 TAG_BRANCH
294 );
295
@@ -422,26 +427,32 @@
422 zBgClr = hash_color(zBr);
423 }
424 }
425 }
426 if( zType[0]=='c' && pGraph ){
427 int nParent = 0;
428 int aParent[GR_MAX_RAIL];
429 static Stmt qparent;
430 db_static_prepare(&qparent,
431 "SELECT pid FROM plink"
432 " WHERE cid=:rid AND pid NOT IN phantom"
433 " ORDER BY isprim DESC /*sort*/"
434 );
435 db_bind_int(&qparent, ":rid", rid);
436 while( db_step(&qparent)==SQLITE_ROW && nParent<count(aParent) ){
437 aParent[nParent++] = db_column_int(&qparent, 0);
438 }
439 db_reset(&qparent);
440 gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr,
441 zUuid, isLeaf);
442 db_reset(&qbranch);
 
 
 
 
 
 
443 @ <div id="m%d(gidx)" class="tl-nodemark"></div>
444 }else if( zType[0]=='e' && pGraph && zBgClr && zBgClr[0] ){
445 /* For technotes, make a graph node with nParent==(-1). This will
446 ** not actually draw anything on the graph, but it will set the
447 ** background color of the timeline entry */
448
--- src/timeline.c
+++ src/timeline.c
@@ -286,10 +286,15 @@
286 zDateFmt = P("datefmt");
287 if( zDateFmt ) dateFormat = atoi(zDateFmt);
288 if( tmFlags & TIMELINE_GRAPH ){
289 pGraph = graph_init();
290 }
291 /* Always combine TIMELINE_LEAFONLY with TIMELINE_DISJOINT, or graph_finish()
292 ** may fail because of too many descenders to (off-screen) parents. */
293 if( tmFlags & TIMELINE_LEAFONLY ){
294 tmFlags |= TIMELINE_DISJOINT;
295 }
296 db_static_prepare(&qbranch,
297 "SELECT value FROM tagxref WHERE tagid=%d AND tagtype>0 AND rid=:rid",
298 TAG_BRANCH
299 );
300
@@ -422,26 +427,32 @@
427 zBgClr = hash_color(zBr);
428 }
429 }
430 }
431 if( zType[0]=='c' && pGraph ){
432 if( (tmFlags & TIMELINE_LEAFONLY)==0 ){
433 int nParent = 0;
434 int aParent[GR_MAX_RAIL];
435 static Stmt qparent;
436 db_static_prepare(&qparent,
437 "SELECT pid FROM plink"
438 " WHERE cid=:rid AND pid NOT IN phantom"
439 " ORDER BY isprim DESC /*sort*/"
440 );
441 db_bind_int(&qparent, ":rid", rid);
442 while( db_step(&qparent)==SQLITE_ROW && nParent<count(aParent) ){
443 aParent[nParent++] = db_column_int(&qparent, 0);
444 }
445 db_reset(&qparent);
446 gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr,
447 zUuid, isLeaf);
448 db_reset(&qbranch);
449 }else{
450 /* Omit parents if TIMELINE_LEAFONLY is set. */
451 gidx = graph_add_row(pGraph, rid, 0, 0, zBr, zBgClr,
452 zUuid, isLeaf);
453 }
454 @ <div id="m%d(gidx)" class="tl-nodemark"></div>
455 }else if( zType[0]=='e' && pGraph && zBgClr && zBgClr[0] ){
456 /* For technotes, make a graph node with nParent==(-1). This will
457 ** not actually draw anything on the graph, but it will set the
458 ** background color of the timeline entry */
459

Keyboard Shortcuts

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