diff options
author | Florin Peter <github@florin-peter.de> | 2013-05-24 20:54:13 +0200 |
---|---|---|
committer | Florin Peter <github@florin-peter.de> | 2013-05-24 20:54:13 +0200 |
commit | 946e9ccc0ade60bb9ff34ace9e94e85cce6af96c (patch) | |
tree | 4770fb73b25d6eb50caa2149df8fb06dd8928a45 /apps/files_encryption/js/settings-personal.js | |
parent | 5076c0d392f6eb17e368a9382cf5b0abe7408889 (diff) | |
parent | ae9adcaf8cc1f2b279494cfdd30a1d62d41f5060 (diff) | |
download | nextcloud-server-946e9ccc0ade60bb9ff34ace9e94e85cce6af96c.tar.gz nextcloud-server-946e9ccc0ade60bb9ff34ace9e94e85cce6af96c.zip |
Merge branch 'master' into fix_for_2377
Diffstat (limited to 'apps/files_encryption/js/settings-personal.js')
-rw-r--r-- | apps/files_encryption/js/settings-personal.js | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/apps/files_encryption/js/settings-personal.js b/apps/files_encryption/js/settings-personal.js new file mode 100644 index 00000000000..312b672ad46 --- /dev/null +++ b/apps/files_encryption/js/settings-personal.js @@ -0,0 +1,60 @@ +/** + * Copyright (c) 2013, Sam Tuke <samtuke@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or later. + * See the COPYING-README file. + */ + +$(document).ready(function(){ + // Trigger ajax on recoveryAdmin status change + $( '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 ) { + 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 |