Fossil SCM

Improved default background colors for web annotations. Remove the diff hyperlinks from the annotation log.

drh 2013-05-25 01:49 UTC annotate
Commit 8987a6bbbf6b8d380c8f7069f23952a8c017208a
1 file changed +9 -7
+9 -7
--- src/diff.c
+++ src/diff.c
@@ -2375,17 +2375,17 @@
23752375
unsigned gradient_color(unsigned c1, unsigned c2, int n, int i){
23762376
unsigned c; /* Result color */
23772377
unsigned x1, x2;
23782378
x1 = (c1>>16)&0xff;
23792379
x2 = (c2>>16)&0xff;
2380
- c = (x1*i + x2*(n-i))/n<<16 & 0xff0000;
2380
+ c = (x1*(n-i) + x2*i)/n<<16 & 0xff0000;
23812381
x1 = (c1>>8)&0xff;
23822382
x2 = (c2>>8)&0xff;
2383
- c |= (x1*i + x2*(n-i))/n<<8 & 0xff00;
2383
+ c |= (x1*(n-i) + x2*i)/n<<8 & 0xff00;
23842384
x1 = c1&0xff;
23852385
x2 = c2&0xff;
2386
- c |= (x1*i + x2*(n-i))/n & 0xff;
2386
+ c |= (x1*(n-i) + x2*i)/n & 0xff;
23872387
return c;
23882388
}
23892389
23902390
/*
23912391
** WEBPAGE: annotate
@@ -2462,15 +2462,15 @@
24622462
style_submenu_element("20 Ancestors", "20 Ancestors",
24632463
url_render(&url, "limit", "20", 0, 0));
24642464
}
24652465
annotate_file(&ann, fnid, mid, iLimit, annFlags);
24662466
if( db_get_boolean("white-foreground", 0) ){
2467
- clr1 = 0x000000;
2468
- clr2 = 0x0078ff;
2467
+ clr1 = 0xa04040;
2468
+ clr2 = 0x4059a0;
24692469
}else{
2470
- clr1 = 0x007fff;
2471
- clr2 = 0xf0f7ff;
2470
+ clr1 = 0xffb5b5; /* Recent changes: red (hot) */
2471
+ clr2 = 0xb5e0ff; /* Older changes: blue (cold) */
24722472
}
24732473
for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){
24742474
clr = gradient_color(clr1, clr2, ann.nVers-1, i);
24752475
ann.aVers[i].zBgColor = mprintf("#%06x", clr);
24762476
ann.aVers[i].zUser = mprintf("%h", ann.aVers[i].zUser);
@@ -2482,10 +2482,11 @@
24822482
for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){
24832483
@ <li><span style='background-color:%s(p->zBgColor);'>%s(p->zDate)
24842484
@ check-in %z(href("%R/info/%S",p->zMUuid))%.10s(p->zMUuid)</a>
24852485
@ artifact %z(href("%R/artifact/%S",p->zFUuid))%.10s(p->zFUuid)</a>
24862486
@ </span>
2487
+#if 0
24872488
if( i>0 ){
24882489
char *zLink = xhref("target='infowindow'",
24892490
"%R/fdiff?v1=%S&v2=%S&sbs=1",
24902491
p->zFUuid,ann.aVers[0].zFUuid);
24912492
@ %z(zLink)[diff-to-top]</a>
@@ -2494,10 +2495,11 @@
24942495
"%R/fdiff?v1=%S&v2=%S&sbs=1",
24952496
p->zFUuid,p[-1].zFUuid);
24962497
@ %z(zLink)[diff-to-previous]</a>
24972498
}
24982499
}
2500
+#endif
24992501
}
25002502
@ </ol>
25012503
@ <hr>
25022504
}
25032505
if( iLimit<0 ){
25042506
--- src/diff.c
+++ src/diff.c
@@ -2375,17 +2375,17 @@
2375 unsigned gradient_color(unsigned c1, unsigned c2, int n, int i){
2376 unsigned c; /* Result color */
2377 unsigned x1, x2;
2378 x1 = (c1>>16)&0xff;
2379 x2 = (c2>>16)&0xff;
2380 c = (x1*i + x2*(n-i))/n<<16 & 0xff0000;
2381 x1 = (c1>>8)&0xff;
2382 x2 = (c2>>8)&0xff;
2383 c |= (x1*i + x2*(n-i))/n<<8 & 0xff00;
2384 x1 = c1&0xff;
2385 x2 = c2&0xff;
2386 c |= (x1*i + x2*(n-i))/n & 0xff;
2387 return c;
2388 }
2389
2390 /*
2391 ** WEBPAGE: annotate
@@ -2462,15 +2462,15 @@
2462 style_submenu_element("20 Ancestors", "20 Ancestors",
2463 url_render(&url, "limit", "20", 0, 0));
2464 }
2465 annotate_file(&ann, fnid, mid, iLimit, annFlags);
2466 if( db_get_boolean("white-foreground", 0) ){
2467 clr1 = 0x000000;
2468 clr2 = 0x0078ff;
2469 }else{
2470 clr1 = 0x007fff;
2471 clr2 = 0xf0f7ff;
2472 }
2473 for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){
2474 clr = gradient_color(clr1, clr2, ann.nVers-1, i);
2475 ann.aVers[i].zBgColor = mprintf("#%06x", clr);
2476 ann.aVers[i].zUser = mprintf("%h", ann.aVers[i].zUser);
@@ -2482,10 +2482,11 @@
2482 for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){
2483 @ <li><span style='background-color:%s(p->zBgColor);'>%s(p->zDate)
2484 @ check-in %z(href("%R/info/%S",p->zMUuid))%.10s(p->zMUuid)</a>
2485 @ artifact %z(href("%R/artifact/%S",p->zFUuid))%.10s(p->zFUuid)</a>
2486 @ </span>
 
2487 if( i>0 ){
2488 char *zLink = xhref("target='infowindow'",
2489 "%R/fdiff?v1=%S&v2=%S&sbs=1",
2490 p->zFUuid,ann.aVers[0].zFUuid);
2491 @ %z(zLink)[diff-to-top]</a>
@@ -2494,10 +2495,11 @@
2494 "%R/fdiff?v1=%S&v2=%S&sbs=1",
2495 p->zFUuid,p[-1].zFUuid);
2496 @ %z(zLink)[diff-to-previous]</a>
2497 }
2498 }
 
2499 }
2500 @ </ol>
2501 @ <hr>
2502 }
2503 if( iLimit<0 ){
2504
--- src/diff.c
+++ src/diff.c
@@ -2375,17 +2375,17 @@
2375 unsigned gradient_color(unsigned c1, unsigned c2, int n, int i){
2376 unsigned c; /* Result color */
2377 unsigned x1, x2;
2378 x1 = (c1>>16)&0xff;
2379 x2 = (c2>>16)&0xff;
2380 c = (x1*(n-i) + x2*i)/n<<16 & 0xff0000;
2381 x1 = (c1>>8)&0xff;
2382 x2 = (c2>>8)&0xff;
2383 c |= (x1*(n-i) + x2*i)/n<<8 & 0xff00;
2384 x1 = c1&0xff;
2385 x2 = c2&0xff;
2386 c |= (x1*(n-i) + x2*i)/n & 0xff;
2387 return c;
2388 }
2389
2390 /*
2391 ** WEBPAGE: annotate
@@ -2462,15 +2462,15 @@
2462 style_submenu_element("20 Ancestors", "20 Ancestors",
2463 url_render(&url, "limit", "20", 0, 0));
2464 }
2465 annotate_file(&ann, fnid, mid, iLimit, annFlags);
2466 if( db_get_boolean("white-foreground", 0) ){
2467 clr1 = 0xa04040;
2468 clr2 = 0x4059a0;
2469 }else{
2470 clr1 = 0xffb5b5; /* Recent changes: red (hot) */
2471 clr2 = 0xb5e0ff; /* Older changes: blue (cold) */
2472 }
2473 for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){
2474 clr = gradient_color(clr1, clr2, ann.nVers-1, i);
2475 ann.aVers[i].zBgColor = mprintf("#%06x", clr);
2476 ann.aVers[i].zUser = mprintf("%h", ann.aVers[i].zUser);
@@ -2482,10 +2482,11 @@
2482 for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){
2483 @ <li><span style='background-color:%s(p->zBgColor);'>%s(p->zDate)
2484 @ check-in %z(href("%R/info/%S",p->zMUuid))%.10s(p->zMUuid)</a>
2485 @ artifact %z(href("%R/artifact/%S",p->zFUuid))%.10s(p->zFUuid)</a>
2486 @ </span>
2487 #if 0
2488 if( i>0 ){
2489 char *zLink = xhref("target='infowindow'",
2490 "%R/fdiff?v1=%S&v2=%S&sbs=1",
2491 p->zFUuid,ann.aVers[0].zFUuid);
2492 @ %z(zLink)[diff-to-top]</a>
@@ -2494,10 +2495,11 @@
2495 "%R/fdiff?v1=%S&v2=%S&sbs=1",
2496 p->zFUuid,p[-1].zFUuid);
2497 @ %z(zLink)[diff-to-previous]</a>
2498 }
2499 }
2500 #endif
2501 }
2502 @ </ol>
2503 @ <hr>
2504 }
2505 if( iLimit<0 ){
2506

Keyboard Shortcuts

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