Fossil

Check-in [d35b1ca0]
Login

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

Overview
Comment:Given that recovering from incorrect hiding is relatively straightforward, don't prevent access to hidden option on trunk and main-branch.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | hidden-tag
Files: files | file ages | folders
SHA1:d35b1ca05e62915cbc740ac31027201076cb99bf
User & Date: andybradford 2013-12-13 21:29:13
Context
2013-12-14
09:24
merge trunk. Fix behavior of "Branching" checkbox, and simplify javascript functions. check-in: 885d72b2 user: jan.nijtmans tags: hidden-tag
2013-12-13
21:29
Given that recovering from incorrect hiding is relatively straightforward, don't prevent access to hidden option on trunk and main-branch. check-in: d35b1ca0 user: andybradford tags: hidden-tag
09:24
merge trunk check-in: 1d0517c1 user: jan.nijtmans tags: hidden-tag
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/info.c.

2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
....
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
....
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
  const char *zNewBranch;
  const char *zCloseFlag;
  const char *zHideFlag;
  int fPropagateColor;          /* True if color propagates before edit */
  int fNewPropagateColor;       /* True if color propagates after edit */
  int fHasHidden = 0;           /* True if hidden tag already set */
  int fHasClosed = 0;           /* True if closed tag already set */
  int fMainBranch = 0;          /* True if branch is trunk or main-branch */
  const char *zChngTime = 0;     /* Value of chngtime= query param, if any */
  char *zUuid;
  Blob comment;
  char *zBranchName = 0;
  Stmt q;

  login_check_credentials();
................................................................................
  blob_zero(&comment);
  blob_append(&comment, zNewComment, -1);
  zUuid[10] = 0;
  style_header("Edit Check-in [%s]", zUuid);
  /*
  ** Javascript functions to assist in modifying hidden branch options.
  ** stcbi: sets the textContent for the given element id to val
  ** hcbxbi: hides the checkbox and unchecks for the given element id
  ** hauc: hides and unchecks the checkbox when needed
  */
  @ <script>
  @ function stcbi(id,val){
  @   if( id ) id.textContent = val;
  @ }
  @ function hcbxbi(id,toggle){
  @   if( toggle ){
  @     id.disabled = true;
  @     id.checked = false;
  @   }else{
  @     id.disabled = false;
  @   }
  @ }
  @ function hauc(cbxid,zdef,formid,toggle){
  @   if( cbxid ) hcbxbi(cbxid,toggle);
  @   hidbrid = gebi('hbranch');
  @   cidbrid = document.getElementById('cbranch');
  @   if( toggle ){
  @     stcbi(hidbrid,zdef);
  @     stcbi(cidbrid,zdef);
  @   }else{
  @     newvalue = gebi(formid).value;
................................................................................
    }
    if( isSpecialTag ){
      @ Cancel special tag <b>%h(zTagName)</b></label>
    }else{
      @ Cancel tag <b>%h(&zTagName[4])</b></label>
    }
  }
  fMainBranch = fossil_strcmp("trunk", zBranchName)==0 ||
                fossil_strcmp(db_get("main-branch", "trunk"), zBranchName)==0;
  db_finalize(&q);
  @ </td></tr>

  @ <tr><th align="right" valign="top">Branching:</th>
  @ <td valign="top">
  @ <label><input id="newbr" type="checkbox" name="newbr"%s(zNewBrFlag)
  if( !fHasHidden && zBranchName ){
    if( fMainBranch ){
      @ onclick="hauc(gebi('hidebr'),'%h(zBranchName)',
      @ 'brname',this.value)"
    }else{
      @ onclick="hauc(null,'%h(zBranchName)',
      @ 'brname',this.value)"
    }
  }
  @ />
  @ Make this check-in the start of a new branch named:</label>
  @ <input type="text" style="width:15;" id="brname" name="brname"
  @ value="%h(zNewBranch)"
  if( !fHasHidden && zBranchName ){
    @ onkeyup="f=!!this.value
    if( zBranchName ){
      @  if(f)f=this.value!='%h(zBranchName)'
    }
    @ gebi('newbr').checked=f
    if( fMainBranch ){
      @ hauc(gebi('hidebr'),'%h(zBranchName)',
      @ 'brname',!f)"
    }else{
      @ hauc(null,'%h(zBranchName)','brname',!f)"
    }
  }
  @ />
  @ </td></tr>

  if( !fHasHidden && zBranchName ){
    @ <tr><th align="right" valign="top">Branch Hiding:</th>
    @ <td valign="top">
    @ <label><input type="checkbox" id="hidebr" name="hide"%s(zHideFlag) 
    if( fMainBranch ){
      @ disabled />
    }else{
      @ />
    }
    @ Hide branch 
    @ <span style="font-weight:bold" id="hbranch">%h(zBranchName)</span>
    @ from the timeline starting from this check-in</label>
    @ </td></tr>
  }









<







 







|
<





<
<
<
<
<
<
<
<
|
<







 







<
<







<
<
|
<
<
<
<











<
<
<
<
|
<







|
<
<
<
<
<







2054
2055
2056
2057
2058
2059
2060

2061
2062
2063
2064
2065
2066
2067
....
2205
2206
2207
2208
2209
2210
2211
2212

2213
2214
2215
2216
2217








2218

2219
2220
2221
2222
2223
2224
2225
....
2344
2345
2346
2347
2348
2349
2350


2351
2352
2353
2354
2355
2356
2357


2358




2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369




2370

2371
2372
2373
2374
2375
2376
2377
2378





2379
2380
2381
2382
2383
2384
2385
  const char *zNewBranch;
  const char *zCloseFlag;
  const char *zHideFlag;
  int fPropagateColor;          /* True if color propagates before edit */
  int fNewPropagateColor;       /* True if color propagates after edit */
  int fHasHidden = 0;           /* True if hidden tag already set */
  int fHasClosed = 0;           /* True if closed tag already set */

  const char *zChngTime = 0;     /* Value of chngtime= query param, if any */
  char *zUuid;
  Blob comment;
  char *zBranchName = 0;
  Stmt q;

  login_check_credentials();
................................................................................
  blob_zero(&comment);
  blob_append(&comment, zNewComment, -1);
  zUuid[10] = 0;
  style_header("Edit Check-in [%s]", zUuid);
  /*
  ** Javascript functions to assist in modifying hidden branch options.
  ** stcbi: sets the textContent for the given element id to val
  ** usids: updates SPAN ids that contain the branch IDs

  */
  @ <script>
  @ function stcbi(id,val){
  @   if( id ) id.textContent = val;
  @ }








  @ function usids(zdef,formid,toggle){

  @   hidbrid = gebi('hbranch');
  @   cidbrid = document.getElementById('cbranch');
  @   if( toggle ){
  @     stcbi(hidbrid,zdef);
  @     stcbi(cidbrid,zdef);
  @   }else{
  @     newvalue = gebi(formid).value;
................................................................................
    }
    if( isSpecialTag ){
      @ Cancel special tag <b>%h(zTagName)</b></label>
    }else{
      @ Cancel tag <b>%h(&zTagName[4])</b></label>
    }
  }


  db_finalize(&q);
  @ </td></tr>

  @ <tr><th align="right" valign="top">Branching:</th>
  @ <td valign="top">
  @ <label><input id="newbr" type="checkbox" name="newbr"%s(zNewBrFlag)
  if( !fHasHidden && zBranchName ){


    @ onclick="usids('%h(zBranchName)','brname',this.value)"




  }
  @ />
  @ Make this check-in the start of a new branch named:</label>
  @ <input type="text" style="width:15;" id="brname" name="brname"
  @ value="%h(zNewBranch)"
  if( !fHasHidden && zBranchName ){
    @ onkeyup="f=!!this.value
    if( zBranchName ){
      @  if(f)f=this.value!='%h(zBranchName)'
    }
    @ gebi('newbr').checked=f




    @ usids('%h(zBranchName)','brname',!f)"

  }
  @ />
  @ </td></tr>

  if( !fHasHidden && zBranchName ){
    @ <tr><th align="right" valign="top">Branch Hiding:</th>
    @ <td valign="top">
    @ <label><input type="checkbox" id="hidebr" name="hide"%s(zHideFlag) />





    @ Hide branch 
    @ <span style="font-weight:bold" id="hbranch">%h(zBranchName)</span>
    @ from the timeline starting from this check-in</label>
    @ </td></tr>
  }