Fossil SCM
Added try/catch so that incompatible browsers (if any) do not break the whole page if updating the permissions string fails.
Commit
4c4a69ed9969620c930de4a8be99ea0bbd59d8bc
Parent
d02d620c4df6b90…
1 file changed
+2
+2
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -492,10 +492,11 @@ | ||
| 492 | 492 | @ <input type="hidden" name="pw" value="*"> |
| 493 | 493 | } |
| 494 | 494 | @ <script type='text/javascript'> |
| 495 | 495 | @ function fossilUpdatePermissionsList(){ |
| 496 | 496 | @ /* updates #currentPermissionsString with current permissions string based on checkboxes */ |
| 497 | + @ try { | |
| 497 | 498 | @ var inputs = document.getElementsByTagName('input'), i, x = 0, e, checkboxes = [], permsIds = []; |
| 498 | 499 | @ if(inputs && inputs.length){ |
| 499 | 500 | @ for( i = 0; i < inputs.length; ++i ){ |
| 500 | 501 | @ e = inputs[i]; |
| 501 | 502 | @ if(e.name && e.type && ('checkbox' === e.type.toLowerCase()) && 2===e.name.length && 'a'===e.name[0]){ |
| @@ -507,10 +508,11 @@ | ||
| 507 | 508 | @ } |
| 508 | 509 | @ } |
| 509 | 510 | @ } |
| 510 | 511 | @ permsIds.sort(); |
| 511 | 512 | @ document.getElementById('currentPermissionsString').innerHTML = permsIds.join(''); |
| 513 | + @ }catch(e){/*ignore errors*/} | |
| 512 | 514 | @ }</script> |
| 513 | 515 | @ <table> |
| 514 | 516 | @ <tr> |
| 515 | 517 | @ <td class="usetupEditLabel">User ID:</td> |
| 516 | 518 | if( uid ){ |
| 517 | 519 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -492,10 +492,11 @@ | |
| 492 | @ <input type="hidden" name="pw" value="*"> |
| 493 | } |
| 494 | @ <script type='text/javascript'> |
| 495 | @ function fossilUpdatePermissionsList(){ |
| 496 | @ /* updates #currentPermissionsString with current permissions string based on checkboxes */ |
| 497 | @ var inputs = document.getElementsByTagName('input'), i, x = 0, e, checkboxes = [], permsIds = []; |
| 498 | @ if(inputs && inputs.length){ |
| 499 | @ for( i = 0; i < inputs.length; ++i ){ |
| 500 | @ e = inputs[i]; |
| 501 | @ if(e.name && e.type && ('checkbox' === e.type.toLowerCase()) && 2===e.name.length && 'a'===e.name[0]){ |
| @@ -507,10 +508,11 @@ | |
| 507 | @ } |
| 508 | @ } |
| 509 | @ } |
| 510 | @ permsIds.sort(); |
| 511 | @ document.getElementById('currentPermissionsString').innerHTML = permsIds.join(''); |
| 512 | @ }</script> |
| 513 | @ <table> |
| 514 | @ <tr> |
| 515 | @ <td class="usetupEditLabel">User ID:</td> |
| 516 | if( uid ){ |
| 517 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -492,10 +492,11 @@ | |
| 492 | @ <input type="hidden" name="pw" value="*"> |
| 493 | } |
| 494 | @ <script type='text/javascript'> |
| 495 | @ function fossilUpdatePermissionsList(){ |
| 496 | @ /* updates #currentPermissionsString with current permissions string based on checkboxes */ |
| 497 | @ try { |
| 498 | @ var inputs = document.getElementsByTagName('input'), i, x = 0, e, checkboxes = [], permsIds = []; |
| 499 | @ if(inputs && inputs.length){ |
| 500 | @ for( i = 0; i < inputs.length; ++i ){ |
| 501 | @ e = inputs[i]; |
| 502 | @ if(e.name && e.type && ('checkbox' === e.type.toLowerCase()) && 2===e.name.length && 'a'===e.name[0]){ |
| @@ -507,10 +508,11 @@ | |
| 508 | @ } |
| 509 | @ } |
| 510 | @ } |
| 511 | @ permsIds.sort(); |
| 512 | @ document.getElementById('currentPermissionsString').innerHTML = permsIds.join(''); |
| 513 | @ }catch(e){/*ignore errors*/} |
| 514 | @ }</script> |
| 515 | @ <table> |
| 516 | @ <tr> |
| 517 | @ <td class="usetupEditLabel">User ID:</td> |
| 518 | if( uid ){ |
| 519 |