Fossil SCM

Convert annotate page to use checkboxes

andygoth 2017-09-23 21:24 UTC andygoth-annotation-enhancements
Commit 8017bad639df6a072076994054fbe58ec54aaad325ac5f07af2d51f35410d868
1 file changed +8 -21
+8 -21
--- src/diff.c
+++ src/diff.c
@@ -2347,11 +2347,11 @@
23472347
** checkin=ID The manifest ID at which to start the annotation
23482348
** filename=FILENAME The filename.
23492349
** filevers=BOOLEAN Show file versions rather than check-in versions
23502350
** limit=N Limit the search depth to N ancestors
23512351
** log=BOOLEAN Show a log of versions analyzed
2352
-** w Ignore whitespace
2352
+** w=BOOLEAN Ignore whitespace
23532353
**
23542354
*/
23552355
void annotation_page(void){
23562356
int i;
23572357
int iLimit; /* Depth limit */
@@ -2367,20 +2367,20 @@
23672367
struct AnnVers *p;
23682368
unsigned clr1, clr2, clr;
23692369
int bBlame = g.zPath[0]!='a';/* True for BLAME output. False for ANNOTATE. */
23702370
23712371
/* Gather query parameters */
2372
- showLog = atoi(PD("log","1"));
23732372
login_check_credentials();
23742373
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
23752374
if( exclude_spiders() ) return;
23762375
load_control();
23772376
zFilename = P("filename");
23782377
zRevision = PD("checkin",0);
23792378
iLimit = atoi(PD("limit","20"));
2379
+ showLog = PB("log");
23802380
fileVers = PB("filevers");
2381
- ignoreWs = P("w")!=0;
2381
+ ignoreWs = PB("w");
23822382
if( ignoreWs ) annFlags |= DIFF_IGNORE_ALLWS;
23832383
23842384
/* compute the annotation */
23852385
annotate_file(&ann, zFilename, zRevision, iLimit, annFlags);
23862386
zCI = ann.aVers[0].zMUuid;
@@ -2395,29 +2395,16 @@
23952395
url_add_parameter(&url, "checkin", P("checkin"));
23962396
url_add_parameter(&url, "filename", zFilename);
23972397
if( iLimit!=20 ){
23982398
url_add_parameter(&url, "limit", sqlite3_mprintf("%d", iLimit));
23992399
}
2400
+ url_add_parameter(&url, "w", ignoreWs ? "1" : "0");
24002401
url_add_parameter(&url, "log", showLog ? "1" : "0");
2401
- if( ignoreWs ){
2402
- url_add_parameter(&url, "w", "");
2403
- style_submenu_element("Show Whitespace Changes", "%s",
2404
- url_render(&url, "w", 0, 0, 0));
2405
- }else{
2406
- style_submenu_element("Ignore Whitespace", "%s",
2407
- url_render(&url, "w", "", 0, 0));
2408
- }
2409
- if( showLog ){
2410
- style_submenu_element("Hide Log", "%s", url_render(&url, "log", "0", 0, 0));
2411
- }else{
2412
- style_submenu_element("Show Log", "%s", url_render(&url, "log", "1", 0, 0));
2413
- }
2414
- if( fileVers ){
2415
- style_submenu_element("Link to Check-ins", "%s", url_render(&url, "filevers", "0", 0, 0));
2416
- }else{
2417
- style_submenu_element("Link to Files", "%s", url_render(&url, "filevers", "1", 0, 0));
2418
- }
2402
+ url_add_parameter(&url, "filevers", fileVers ? "1" : "0");
2403
+ style_submenu_checkbox("w", "Ignore Whitespace", 0);
2404
+ style_submenu_checkbox("log", "Log", 0);
2405
+ style_submenu_checkbox("filevers", "Link to Files", 0);
24192406
if( ann.bLimit ){
24202407
char *z1, *z2;
24212408
style_submenu_element("All Ancestors", "%s",
24222409
url_render(&url, "limit", "-1", 0, 0));
24232410
z1 = sqlite3_mprintf("%d Ancestors", iLimit+20);
24242411
--- src/diff.c
+++ src/diff.c
@@ -2347,11 +2347,11 @@
2347 ** checkin=ID The manifest ID at which to start the annotation
2348 ** filename=FILENAME The filename.
2349 ** filevers=BOOLEAN Show file versions rather than check-in versions
2350 ** limit=N Limit the search depth to N ancestors
2351 ** log=BOOLEAN Show a log of versions analyzed
2352 ** w Ignore whitespace
2353 **
2354 */
2355 void annotation_page(void){
2356 int i;
2357 int iLimit; /* Depth limit */
@@ -2367,20 +2367,20 @@
2367 struct AnnVers *p;
2368 unsigned clr1, clr2, clr;
2369 int bBlame = g.zPath[0]!='a';/* True for BLAME output. False for ANNOTATE. */
2370
2371 /* Gather query parameters */
2372 showLog = atoi(PD("log","1"));
2373 login_check_credentials();
2374 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
2375 if( exclude_spiders() ) return;
2376 load_control();
2377 zFilename = P("filename");
2378 zRevision = PD("checkin",0);
2379 iLimit = atoi(PD("limit","20"));
 
2380 fileVers = PB("filevers");
2381 ignoreWs = P("w")!=0;
2382 if( ignoreWs ) annFlags |= DIFF_IGNORE_ALLWS;
2383
2384 /* compute the annotation */
2385 annotate_file(&ann, zFilename, zRevision, iLimit, annFlags);
2386 zCI = ann.aVers[0].zMUuid;
@@ -2395,29 +2395,16 @@
2395 url_add_parameter(&url, "checkin", P("checkin"));
2396 url_add_parameter(&url, "filename", zFilename);
2397 if( iLimit!=20 ){
2398 url_add_parameter(&url, "limit", sqlite3_mprintf("%d", iLimit));
2399 }
 
2400 url_add_parameter(&url, "log", showLog ? "1" : "0");
2401 if( ignoreWs ){
2402 url_add_parameter(&url, "w", "");
2403 style_submenu_element("Show Whitespace Changes", "%s",
2404 url_render(&url, "w", 0, 0, 0));
2405 }else{
2406 style_submenu_element("Ignore Whitespace", "%s",
2407 url_render(&url, "w", "", 0, 0));
2408 }
2409 if( showLog ){
2410 style_submenu_element("Hide Log", "%s", url_render(&url, "log", "0", 0, 0));
2411 }else{
2412 style_submenu_element("Show Log", "%s", url_render(&url, "log", "1", 0, 0));
2413 }
2414 if( fileVers ){
2415 style_submenu_element("Link to Check-ins", "%s", url_render(&url, "filevers", "0", 0, 0));
2416 }else{
2417 style_submenu_element("Link to Files", "%s", url_render(&url, "filevers", "1", 0, 0));
2418 }
2419 if( ann.bLimit ){
2420 char *z1, *z2;
2421 style_submenu_element("All Ancestors", "%s",
2422 url_render(&url, "limit", "-1", 0, 0));
2423 z1 = sqlite3_mprintf("%d Ancestors", iLimit+20);
2424
--- src/diff.c
+++ src/diff.c
@@ -2347,11 +2347,11 @@
2347 ** checkin=ID The manifest ID at which to start the annotation
2348 ** filename=FILENAME The filename.
2349 ** filevers=BOOLEAN Show file versions rather than check-in versions
2350 ** limit=N Limit the search depth to N ancestors
2351 ** log=BOOLEAN Show a log of versions analyzed
2352 ** w=BOOLEAN Ignore whitespace
2353 **
2354 */
2355 void annotation_page(void){
2356 int i;
2357 int iLimit; /* Depth limit */
@@ -2367,20 +2367,20 @@
2367 struct AnnVers *p;
2368 unsigned clr1, clr2, clr;
2369 int bBlame = g.zPath[0]!='a';/* True for BLAME output. False for ANNOTATE. */
2370
2371 /* Gather query parameters */
 
2372 login_check_credentials();
2373 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
2374 if( exclude_spiders() ) return;
2375 load_control();
2376 zFilename = P("filename");
2377 zRevision = PD("checkin",0);
2378 iLimit = atoi(PD("limit","20"));
2379 showLog = PB("log");
2380 fileVers = PB("filevers");
2381 ignoreWs = PB("w");
2382 if( ignoreWs ) annFlags |= DIFF_IGNORE_ALLWS;
2383
2384 /* compute the annotation */
2385 annotate_file(&ann, zFilename, zRevision, iLimit, annFlags);
2386 zCI = ann.aVers[0].zMUuid;
@@ -2395,29 +2395,16 @@
2395 url_add_parameter(&url, "checkin", P("checkin"));
2396 url_add_parameter(&url, "filename", zFilename);
2397 if( iLimit!=20 ){
2398 url_add_parameter(&url, "limit", sqlite3_mprintf("%d", iLimit));
2399 }
2400 url_add_parameter(&url, "w", ignoreWs ? "1" : "0");
2401 url_add_parameter(&url, "log", showLog ? "1" : "0");
2402 url_add_parameter(&url, "filevers", fileVers ? "1" : "0");
2403 style_submenu_checkbox("w", "Ignore Whitespace", 0);
2404 style_submenu_checkbox("log", "Log", 0);
2405 style_submenu_checkbox("filevers", "Link to Files", 0);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2406 if( ann.bLimit ){
2407 char *z1, *z2;
2408 style_submenu_element("All Ancestors", "%s",
2409 url_render(&url, "limit", "-1", 0, 0));
2410 z1 = sqlite3_mprintf("%d Ancestors", iLimit+20);
2411

Keyboard Shortcuts

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