Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Convert annotate page to use checkboxes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | annotation-enhancements
Files: files | file ages | folders
SHA3-256:8017bad639df6a072076994054fbe58ec54aaad325ac5f07af2d51f35410d868
User & Date: andygoth 2017-09-23 21:24:41
Context
2017-09-23
21:30
Remove unnecessary variable initializations check-in: c203ba90 user: andygoth tags: annotation-enhancements
21:24
Convert annotate page to use checkboxes check-in: 8017bad6 user: andygoth tags: annotation-enhancements
21:18
Correct operation of filevers query parameter to annotate pages check-in: 4b721600 user: andygoth tags: annotation-enhancements
Changes

Changes to src/diff.c.

2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
....
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379

2380
2381
2382
2383
2384
2385
2386
2387
2388
....
2393
2394
2395
2396
2397
2398
2399

2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418


2419
2420
2421
2422
2423
2424
2425
** Query parameters:
**
**    checkin=ID          The manifest ID at which to start the annotation
**    filename=FILENAME   The filename.
**    filevers=BOOLEAN    Show file versions rather than check-in versions
**    limit=N             Limit the search depth to N ancestors
**    log=BOOLEAN         Show a log of versions analyzed
**    w                   Ignore whitespace
**
*/
void annotation_page(void){
  int i;
  int iLimit;            /* Depth limit */
  u64 annFlags = DIFF_STRIP_EOLCR;
  int showLog = 0;       /* True to display the log */
................................................................................
  Annotator ann;
  HQuery url;
  struct AnnVers *p;
  unsigned clr1, clr2, clr;
  int bBlame = g.zPath[0]!='a';/* True for BLAME output.  False for ANNOTATE. */

  /* Gather query parameters */
  showLog = atoi(PD("log","1"));
  login_check_credentials();
  if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
  if( exclude_spiders() ) return;
  load_control();
  zFilename = P("filename");
  zRevision = PD("checkin",0);
  iLimit = atoi(PD("limit","20"));

  fileVers = PB("filevers");
  ignoreWs = P("w")!=0;
  if( ignoreWs ) annFlags |= DIFF_IGNORE_ALLWS;

  /* compute the annotation */
  annotate_file(&ann, zFilename, zRevision, iLimit, annFlags);
  zCI = ann.aVers[0].zMUuid;

  /* generate the web page */
................................................................................
    url_initialize(&url, "annotate");
  }
  url_add_parameter(&url, "checkin", P("checkin"));
  url_add_parameter(&url, "filename", zFilename);
  if( iLimit!=20 ){
    url_add_parameter(&url, "limit", sqlite3_mprintf("%d", iLimit));
  }

  url_add_parameter(&url, "log", showLog ? "1" : "0");
  if( ignoreWs ){
    url_add_parameter(&url, "w", "");
    style_submenu_element("Show Whitespace Changes", "%s",
        url_render(&url, "w", 0, 0, 0));
  }else{
    style_submenu_element("Ignore Whitespace", "%s",
        url_render(&url, "w", "", 0, 0));
  }
  if( showLog ){
    style_submenu_element("Hide Log", "%s", url_render(&url, "log", "0", 0, 0));
  }else{
    style_submenu_element("Show Log", "%s", url_render(&url, "log", "1", 0, 0));
  }
  if( fileVers ){
    style_submenu_element("Link to Check-ins", "%s", url_render(&url, "filevers", "0", 0, 0));
  }else{
    style_submenu_element("Link to Files", "%s", url_render(&url, "filevers", "1", 0, 0));
  }


  if( ann.bLimit ){
    char *z1, *z2;
    style_submenu_element("All Ancestors", "%s",
       url_render(&url, "limit", "-1", 0, 0));
    z1 = sqlite3_mprintf("%d Ancestors", iLimit+20);
    z2 = sqlite3_mprintf("%d", iLimit+20);
    style_submenu_element(z1, "%s", url_render(&url, "limit", z2, 0, 0));







|







 







<







>

|







 







>

<
|
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
>
>







2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
....
2365
2366
2367
2368
2369
2370
2371

2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
....
2393
2394
2395
2396
2397
2398
2399
2400
2401

2402



2403












2404
2405
2406
2407
2408
2409
2410
2411
2412
** Query parameters:
**
**    checkin=ID          The manifest ID at which to start the annotation
**    filename=FILENAME   The filename.
**    filevers=BOOLEAN    Show file versions rather than check-in versions
**    limit=N             Limit the search depth to N ancestors
**    log=BOOLEAN         Show a log of versions analyzed
**    w=BOOLEAN           Ignore whitespace
**
*/
void annotation_page(void){
  int i;
  int iLimit;            /* Depth limit */
  u64 annFlags = DIFF_STRIP_EOLCR;
  int showLog = 0;       /* True to display the log */
................................................................................
  Annotator ann;
  HQuery url;
  struct AnnVers *p;
  unsigned clr1, clr2, clr;
  int bBlame = g.zPath[0]!='a';/* True for BLAME output.  False for ANNOTATE. */

  /* Gather query parameters */

  login_check_credentials();
  if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
  if( exclude_spiders() ) return;
  load_control();
  zFilename = P("filename");
  zRevision = PD("checkin",0);
  iLimit = atoi(PD("limit","20"));
  showLog = PB("log");
  fileVers = PB("filevers");
  ignoreWs = PB("w");
  if( ignoreWs ) annFlags |= DIFF_IGNORE_ALLWS;

  /* compute the annotation */
  annotate_file(&ann, zFilename, zRevision, iLimit, annFlags);
  zCI = ann.aVers[0].zMUuid;

  /* generate the web page */
................................................................................
    url_initialize(&url, "annotate");
  }
  url_add_parameter(&url, "checkin", P("checkin"));
  url_add_parameter(&url, "filename", zFilename);
  if( iLimit!=20 ){
    url_add_parameter(&url, "limit", sqlite3_mprintf("%d", iLimit));
  }
  url_add_parameter(&url, "w", ignoreWs ? "1" : "0");
  url_add_parameter(&url, "log", showLog ? "1" : "0");

  url_add_parameter(&url, "filevers", fileVers ? "1" : "0");



  style_submenu_checkbox("w", "Ignore Whitespace", 0);












  style_submenu_checkbox("log", "Log", 0);
  style_submenu_checkbox("filevers", "Link to Files", 0);
  if( ann.bLimit ){
    char *z1, *z2;
    style_submenu_element("All Ancestors", "%s",
       url_render(&url, "limit", "-1", 0, 0));
    z1 = sqlite3_mprintf("%d Ancestors", iLimit+20);
    z2 = sqlite3_mprintf("%d", iLimit+20);
    style_submenu_element(z1, "%s", url_render(&url, "limit", z2, 0, 0));