diff options
author | Sam Tuke <samtuke@owncloud.com> | 2013-05-07 16:17:38 +0200 |
---|---|---|
committer | Sam Tuke <samtuke@owncloud.com> | 2013-05-07 16:17:38 +0200 |
commit | 4b53f72d0d749cceec7a9fa7be5d8bc6bab722c6 (patch) | |
tree | 017627881e1278752b815148e8b4c5d01ec67227 /apps/files_encryption/js | |
parent | b535964006706fc2df1b3e8fb733a62a3351c585 (diff) | |
download | nextcloud-server-4b53f72d0d749cceec7a9fa7be5d8bc6bab722c6.tar.gz nextcloud-server-4b53f72d0d749cceec7a9fa7be5d8bc6bab722c6.zip |
Added facility to manually encrypt all files from personal settings
Added success/fail feedback to personal settings functions
Improved look/layout of personal settings page
Fixed misplaced plain text in ajax scripts
Diffstat (limited to 'apps/files_encryption/js')
-rw-r--r-- | apps/files_encryption/js/settings-personal.js | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/apps/files_encryption/js/settings-personal.js b/apps/files_encryption/js/settings-personal.js index e4a1b7448f4..3b9b00dc797 100644 --- a/apps/files_encryption/js/settings-personal.js +++ b/apps/files_encryption/js/settings-personal.js @@ -9,15 +9,52 @@ $(document).ready(function(){ $( 'input:radio[name="userEnableRecovery"]' ).change( function() { + // Hide feedback messages in case they're already visible + $('#recoveryEnabledSuccess').hide(); + $('#recoveryEnabledError').hide(); + var recoveryStatus = $( this ).val(); $.post( OC.filePath( 'files_encryption', 'ajax', 'userrecovery.php' ) , { userEnableRecovery: recoveryStatus } , function( data ) { - alert( data ); + if ( data.status == "success" ) { + $('#recoveryEnabledSuccess').show(); + } else { + $('#recoveryEnabledError').show(); + } + } + ); + // Ensure page is not reloaded on form submit + return false; + } + ); + + $("#encryptAll").click( + function(){ + + // Hide feedback messages in case they're already visible + $('#encryptAllSuccess').hide(); + $('#encryptAllError').hide(); + + var userPassword = $( '#userPassword' ).val(); + var encryptAll = $( '#encryptAll' ).val(); + + $.post( + OC.filePath( 'files_encryption', 'ajax', 'encryptall.php' ) + , { encryptAll: encryptAll, userPassword: userPassword } + , function( data ) { + if ( data.status == "success" ) { + $('#encryptAllSuccess').show(); + } else { + $('#encryptAllError').show(); + } } ); + // Ensure page is not reloaded on form submit + return false; } + ); })
\ No newline at end of file |