Fossil

Check-in [4c4a69ed]
Login

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

Overview
Comment:Added try/catch so that incompatible browsers (if any) do not break the whole page if updating the permissions string fails.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | inherit-priv-mark-sub
Files: files | file ages | folders
SHA1: 4c4a69ed9969620c930de4a8be99ea0bbd59d8bc
User & Date: stephan 2014-09-27 19:29:29
Context
2014-09-27
20:11
removed an unused JS var. check-in: 2adc0397 user: stephan tags: inherit-priv-mark-sub
19:29
Added try/catch so that incompatible browsers (if any) do not break the whole page if updating the permissions string fails. check-in: 4c4a69ed user: stephan tags: inherit-priv-mark-sub
19:26
Added JS code to generate/display the current capabilities string based on selected checkboxes (feature request from Joe M.). check-in: d02d620c user: stephan tags: inherit-priv-mark-sub
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/setup.c.

490
491
492
493
494
495
496

497
498
499
500
501
502
503
...
505
506
507
508
509
510
511

512
513
514
515
516
517
518
    @ <input type="hidden" name="login" value="%s(zLogin)">
    @ <input type="hidden" name="info" value="">
    @ <input type="hidden" name="pw" value="*">
  }
  @ <script type='text/javascript'>
  @ function fossilUpdatePermissionsList(){
  @   /* updates #currentPermissionsString with current permissions string based on checkboxes */

  @   var inputs = document.getElementsByTagName('input'),  i, x = 0, e, checkboxes = [], permsIds = [];
  @   if(inputs && inputs.length){
  @     for( i = 0; i < inputs.length; ++i ){
  @      e = inputs[i];
  @      if(e.name && e.type && ('checkbox' === e.type.toLowerCase()) && 2===e.name.length && 'a'===e.name[0]){
  @       // looks like a permissions checkbox
  @       if(e.checked){
................................................................................
  @         checkboxes[x++] = e;
  @       }
  @      }
  @     }
  @   }
  @  permsIds.sort();
  @  document.getElementById('currentPermissionsString').innerHTML = permsIds.join('');  

  @ }</script>
  @ <table>
  @ <tr>
  @   <td class="usetupEditLabel">User ID:</td>
  if( uid ){
    @   <td>%d(uid) <input type="hidden" name="id" value="%d(uid)" /></td>
  }else{







>







 







>







490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
...
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
    @ <input type="hidden" name="login" value="%s(zLogin)">
    @ <input type="hidden" name="info" value="">
    @ <input type="hidden" name="pw" value="*">
  }
  @ <script type='text/javascript'>
  @ function fossilUpdatePermissionsList(){
  @   /* updates #currentPermissionsString with current permissions string based on checkboxes */
  @ try {
  @   var inputs = document.getElementsByTagName('input'),  i, x = 0, e, checkboxes = [], permsIds = [];
  @   if(inputs && inputs.length){
  @     for( i = 0; i < inputs.length; ++i ){
  @      e = inputs[i];
  @      if(e.name && e.type && ('checkbox' === e.type.toLowerCase()) && 2===e.name.length && 'a'===e.name[0]){
  @       // looks like a permissions checkbox
  @       if(e.checked){
................................................................................
  @         checkboxes[x++] = e;
  @       }
  @      }
  @     }
  @   }
  @  permsIds.sort();
  @  document.getElementById('currentPermissionsString').innerHTML = permsIds.join('');  
  @ }catch(e){/*ignore errors*/}
  @ }</script>
  @ <table>
  @ <tr>
  @   <td class="usetupEditLabel">User ID:</td>
  if( uid ){
    @   <td>%d(uid) <input type="hidden" name="id" value="%d(uid)" /></td>
  }else{