Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-06-05 16:51:51 +0400
committerBjörn Schießle <schiessle@owncloud.com>2013-06-05 16:51:51 +0400
commit036732c249b82f7da478cf6e54a7844ce5522824 (patch)
treea67b3efd779abb6491e362f45a3fc227470b484a /apps/files_encryption/js
parentbe324fad1ca0abfa2c791e3d054be828bc0694b4 (diff)
allow to press enter to update the password
Diffstat (limited to 'apps/files_encryption/js')
-rw-r--r--apps/files_encryption/js/settings-personal.js38
1 files changed, 23 insertions, 15 deletions
diff --git a/apps/files_encryption/js/settings-personal.js b/apps/files_encryption/js/settings-personal.js
index 46105176c29..d6535a25b70 100644
--- a/apps/files_encryption/js/settings-personal.js
+++ b/apps/files_encryption/js/settings-personal.js
@@ -4,7 +4,25 @@
* See the COPYING-README file.
*/
+function updatePrivateKeyPasswd() {
+ var oldPrivateKeyPassword = $('input:password[id="oldPrivateKeyPassword"]').val();
+ var newPrivateKeyPassword = $('input:password[id="newPrivateKeyPassword"]').val();
+ OC.msg.startSaving('#encryption .msg');
+ $.post(
+ OC.filePath( 'files_encryption', 'ajax', 'updatePrivateKeyPassword.php' )
+ , { oldPassword: oldPrivateKeyPassword, newPassword: newPrivateKeyPassword }
+ , function( data ) {
+ if (data.status === "error") {
+ OC.msg.finishedSaving('#encryption .msg', data);
+ } else {
+ OC.msg.finishedSaving('#encryption .msg', data);
+ }
+ }
+ );
+}
+
$(document).ready(function(){
+
// Trigger ajax on recoveryAdmin status change
$( 'input:radio[name="userEnableRecovery"]' ).change(
function() {
@@ -63,28 +81,18 @@ $(document).ready(function(){
$('input:password[name="changePrivateKeyPassword"]').keyup(function(event) {
var oldPrivateKeyPassword = $('input:password[id="oldPrivateKeyPassword"]').val();
var newPrivateKeyPassword = $('input:password[id="newPrivateKeyPassword"]').val();
- if (newPrivateKeyPassword != '' && oldPrivateKeyPassword != '' ) {
+ if (newPrivateKeyPassword !== '' && oldPrivateKeyPassword !== '' ) {
$('button:button[name="submitChangePrivateKeyPassword"]').removeAttr("disabled");
+ if(event.which === 13) {
+ updatePrivateKeyPasswd();
+ }
} else {
$('button:button[name="submitChangePrivateKeyPassword"]').attr("disabled", "true");
}
});
$('button:button[name="submitChangePrivateKeyPassword"]').click(function() {
- var oldPrivateKeyPassword = $('input:password[id="oldPrivateKeyPassword"]').val();
- var newPrivateKeyPassword = $('input:password[id="newPrivateKeyPassword"]').val();
- OC.msg.startSaving('#encryption .msg');
- $.post(
- OC.filePath( 'files_encryption', 'ajax', 'updatePrivateKeyPassword.php' )
- , { oldPassword: oldPrivateKeyPassword, newPassword: newPrivateKeyPassword }
- , function( data ) {
- if (data.status == "error") {
- OC.msg.finishedSaving('#encryption .msg', data);
- } else {
- OC.msg.finishedSaving('#encryption .msg', data);
- }
- }
- );
+ updatePrivateKeyPasswd();
});
}); \ No newline at end of file