Fossil SCM

Added try/catch so that incompatible browsers (if any) do not break the whole page if updating the permissions string fails.

stephan 2014-09-27 19:29 UTC inherit-priv-mark-sub
Commit 4c4a69ed9969620c930de4a8be99ea0bbd59d8bc
1 file changed +2
--- src/setup.c
+++ src/setup.c
@@ -492,10 +492,11 @@
492492
@ <input type="hidden" name="pw" value="*">
493493
}
494494
@ <script type='text/javascript'>
495495
@ function fossilUpdatePermissionsList(){
496496
@ /* updates #currentPermissionsString with current permissions string based on checkboxes */
497
+ @ try {
497498
@ var inputs = document.getElementsByTagName('input'), i, x = 0, e, checkboxes = [], permsIds = [];
498499
@ if(inputs && inputs.length){
499500
@ for( i = 0; i < inputs.length; ++i ){
500501
@ e = inputs[i];
501502
@ if(e.name && e.type && ('checkbox' === e.type.toLowerCase()) && 2===e.name.length && 'a'===e.name[0]){
@@ -507,10 +508,11 @@
507508
@ }
508509
@ }
509510
@ }
510511
@ permsIds.sort();
511512
@ document.getElementById('currentPermissionsString').innerHTML = permsIds.join('');
513
+ @ }catch(e){/*ignore errors*/}
512514
@ }</script>
513515
@ <table>
514516
@ <tr>
515517
@ <td class="usetupEditLabel">User ID:</td>
516518
if( uid ){
517519
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button