]> source.dussan.org Git - nextcloud-server.git/commitdiff
make jshint happy
authorThomas Müller <thomas.mueller@tmit.eu>
Fri, 17 Apr 2015 15:59:53 +0000 (17:59 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Fri, 17 Apr 2015 15:59:53 +0000 (17:59 +0200)
apps/encryption/js/settings-admin.js
apps/encryption/js/settings-personal.js

index 36765adf3e4283245d839a1c025b661e977580e7..bb539f6a4e2a419de9cf42f078ee62d00ca86333 100644 (file)
@@ -12,17 +12,20 @@ $(document).ready(function(){
        $( 'input:radio[name="adminEnableRecovery"]' ).change(
                function() {
                        var recoveryStatus = $( this ).val();
-                       var oldStatus = (1+parseInt(recoveryStatus)) % 2;
+                       var oldStatus = (1+parseInt(recoveryStatus, 10)) % 2;
                        var recoveryPassword = $( '#encryptionRecoveryPassword' ).val();
                        var confirmPassword = $( '#repeatEncryptionRecoveryPassword' ).val();
                        OC.msg.startSaving('#encryptionSetRecoveryKey .msg');
                        $.post(
-                               OC.generateUrl('/apps/encryption/ajax/adminRecovery')
-                               , { adminEnableRecovery: recoveryStatus, recoveryPassword: recoveryPassword, confirmPassword: confirmPassword }
-                               ,  function( result ) {
+                               OC.generateUrl('/apps/encryption/ajax/adminRecovery'),
+                               { adminEnableRecovery: recoveryStatus,
+                                       recoveryPassword: recoveryPassword,
+                                       confirmPassword: confirmPassword },
+                               function( result ) {
                                        OC.msg.finishedSaving('#encryptionSetRecoveryKey .msg', result);
                                        if (result.status === "error") {
-                                               $('input:radio[name="adminEnableRecovery"][value="'+oldStatus.toString()+'"]').attr("checked", "true");
+                                               $('input:radio[name="adminEnableRecovery"][value="'+oldStatus.toString()+'"]')
+                                                       .attr("checked", "true");
                                        } else {
                                                if (recoveryStatus === "0") {
                                                        $('p[name="changeRecoveryPasswordBlock"]').addClass("hidden");
@@ -44,9 +47,9 @@ $(document).ready(function(){
                var confirmNewPassword = $('#repeatedNewEncryptionRecoveryPassword').val();
                OC.msg.startSaving('#encryptionChangeRecoveryKey .msg');
                $.post(
-                               OC.generateUrl('/apps/encryption/ajax/changeRecoveryPassword')
-                       , { oldPassword: oldRecoveryPassword, newPassword: newRecoveryPassword, confirmPassword: confirmNewPassword }
-                       ,  function( data ) {
+                               OC.generateUrl('/apps/encryption/ajax/changeRecoveryPassword'),
+                       { oldPassword: oldRecoveryPassword, newPassword: newRecoveryPassword, confirmPassword: confirmNewPassword },
+                       function( data ) {
                                        OC.msg.finishedSaving('#encryptionChangeRecoveryKey .msg', data);
                                }
                );
index dcfbba4ecde6026329fb6c73f4c9b547a3cd1417..21a7e66a96f57b92ccba2467a0ac3192278030af 100644 (file)
@@ -4,14 +4,14 @@
  * See the COPYING-README file.
  */
 
-function updatePrivateKeyPasswd() {
+function updatePrivateKeyPassword() {
        var oldPrivateKeyPassword = $('input:password[id="oldPrivateKeyPassword"]').val();
        var newPrivateKeyPassword = $('input:password[id="newPrivateKeyPassword"]').val();
        OC.msg.startSaving('#encryption .msg');
        $.post(
-       OC.generateUrl('/apps/encryption/ajax/updatePrivateKeyPassword')
-               , { oldPassword: oldPrivateKeyPassword, newPassword: newPrivateKeyPassword }
-               ,  function( data ) {
+       OC.generateUrl('/apps/encryption/ajax/updatePrivateKeyPassword'),
+               { oldPassword: oldPrivateKeyPassword, newPassword: newPrivateKeyPassword },
+               function( data ) {
                        if (data.status === "error") {
                                OC.msg.finishedSaving('#encryption .msg', data);
                        } else {
@@ -29,9 +29,9 @@ $(document).ready(function(){
                        var recoveryStatus = $( this ).val();
                        OC.msg.startAction('#userEnableRecovery .msg', 'Updating recovery keys. This can take some time...');
                        $.post(
-                                       OC.generateUrl('/apps/encryption/ajax/userSetRecovery')
-                               , { userEnableRecovery: recoveryStatus }
-                               ,  function( data ) {
+                                       OC.generateUrl('/apps/encryption/ajax/userSetRecovery'),
+                               { userEnableRecovery: recoveryStatus },
+                               function( data ) {
                                        OC.msg.finishedAction('#userEnableRecovery .msg', data);
                                }
                        );
@@ -48,7 +48,7 @@ $(document).ready(function(){
                if (newPrivateKeyPassword !== '' && oldPrivateKeyPassword !== '' ) {
                        $('button:button[name="submitChangePrivateKeyPassword"]').removeAttr("disabled");
                        if(event.which === 13) {
-                               updatePrivateKeyPasswd();
+                               updatePrivateKeyPassword();
                        }
                } else {
                        $('button:button[name="submitChangePrivateKeyPassword"]').attr("disabled", "true");
@@ -56,7 +56,7 @@ $(document).ready(function(){
        });
 
        $('button:button[name="submitChangePrivateKeyPassword"]').click(function() {
-               updatePrivateKeyPasswd();
+               updatePrivateKeyPassword();
        });
 
 });