Fossil SCM
Convert annotate page to use checkboxes
Commit
8017bad639df6a072076994054fbe58ec54aaad325ac5f07af2d51f35410d868
Parent
4b721600e7b8315…
1 file changed
+8
-21
+8
-21
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -2347,11 +2347,11 @@ | ||
| 2347 | 2347 | ** checkin=ID The manifest ID at which to start the annotation |
| 2348 | 2348 | ** filename=FILENAME The filename. |
| 2349 | 2349 | ** filevers=BOOLEAN Show file versions rather than check-in versions |
| 2350 | 2350 | ** limit=N Limit the search depth to N ancestors |
| 2351 | 2351 | ** log=BOOLEAN Show a log of versions analyzed |
| 2352 | -** w Ignore whitespace | |
| 2352 | +** w=BOOLEAN Ignore whitespace | |
| 2353 | 2353 | ** |
| 2354 | 2354 | */ |
| 2355 | 2355 | void annotation_page(void){ |
| 2356 | 2356 | int i; |
| 2357 | 2357 | int iLimit; /* Depth limit */ |
| @@ -2367,20 +2367,20 @@ | ||
| 2367 | 2367 | struct AnnVers *p; |
| 2368 | 2368 | unsigned clr1, clr2, clr; |
| 2369 | 2369 | int bBlame = g.zPath[0]!='a';/* True for BLAME output. False for ANNOTATE. */ |
| 2370 | 2370 | |
| 2371 | 2371 | /* Gather query parameters */ |
| 2372 | - showLog = atoi(PD("log","1")); | |
| 2373 | 2372 | login_check_credentials(); |
| 2374 | 2373 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 2375 | 2374 | if( exclude_spiders() ) return; |
| 2376 | 2375 | load_control(); |
| 2377 | 2376 | zFilename = P("filename"); |
| 2378 | 2377 | zRevision = PD("checkin",0); |
| 2379 | 2378 | iLimit = atoi(PD("limit","20")); |
| 2379 | + showLog = PB("log"); | |
| 2380 | 2380 | fileVers = PB("filevers"); |
| 2381 | - ignoreWs = P("w")!=0; | |
| 2381 | + ignoreWs = PB("w"); | |
| 2382 | 2382 | if( ignoreWs ) annFlags |= DIFF_IGNORE_ALLWS; |
| 2383 | 2383 | |
| 2384 | 2384 | /* compute the annotation */ |
| 2385 | 2385 | annotate_file(&ann, zFilename, zRevision, iLimit, annFlags); |
| 2386 | 2386 | zCI = ann.aVers[0].zMUuid; |
| @@ -2395,29 +2395,16 @@ | ||
| 2395 | 2395 | url_add_parameter(&url, "checkin", P("checkin")); |
| 2396 | 2396 | url_add_parameter(&url, "filename", zFilename); |
| 2397 | 2397 | if( iLimit!=20 ){ |
| 2398 | 2398 | url_add_parameter(&url, "limit", sqlite3_mprintf("%d", iLimit)); |
| 2399 | 2399 | } |
| 2400 | + url_add_parameter(&url, "w", ignoreWs ? "1" : "0"); | |
| 2400 | 2401 | 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); | |
| 2419 | 2406 | if( ann.bLimit ){ |
| 2420 | 2407 | char *z1, *z2; |
| 2421 | 2408 | style_submenu_element("All Ancestors", "%s", |
| 2422 | 2409 | url_render(&url, "limit", "-1", 0, 0)); |
| 2423 | 2410 | z1 = sqlite3_mprintf("%d Ancestors", iLimit+20); |
| 2424 | 2411 |
| --- 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 |