summaryrefslogtreecommitdiffstats
path: root/settings/js/personal.js
diff options
context:
space:
mode:
Diffstat (limited to 'settings/js/personal.js')
-rw-r--r--settings/js/personal.js43
1 files changed, 38 insertions, 5 deletions
diff --git a/settings/js/personal.js b/settings/js/personal.js
index 2934677f256..3b876467756 100644
--- a/settings/js/personal.js
+++ b/settings/js/personal.js
@@ -1,5 +1,6 @@
/**
* Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
+ * 2013, Morris Jobke <morris.jobke@gmail.com>
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYING-README file.
*/
@@ -157,20 +158,37 @@ $(document).ready(function(){
if(typeof timeout !== 'undefined'){
clearTimeout(timeout);
}
- timeout = setTimeout('changeDisplayName()',1000);
+ timeout = setTimeout(changeDisplayName, 1000);
}
});
$('#email').keyup(function(){
if ($('#email').val() !== '' ){
+ // if this is the enter key changeEmailAddress() is already invoked
+ // so it doesn't need to be triggered again
+ if(event.keyCode === 13) {
+ return;
+ }
if(typeof timeout !== 'undefined'){
clearTimeout(timeout);
}
- timeout = setTimeout('changeEmailAddress()',1000);
+ timeout = setTimeout(changeEmailAddress, 1000);
}
});
+ $('#email').keypress(function(event){
+ // check for enter key and non empty email
+ if (event.keyCode === 13 && $('#email').val() !== '' ){
+ event.preventDefault()
+ // clear timeout of previous keyup event - prevents duplicate changeEmailAddress call
+ if(typeof timeout !== 'undefined'){
+ clearTimeout(timeout);
+ }
+ changeEmailAddress();
+ }
+ });
+
$("#languageinput").change( function(){
// Serialize the data
var post = $( "#languageinput" ).serialize();
@@ -188,6 +206,8 @@ $(document).ready(function(){
$('button:button[name="submitDecryptAll"]').click(function() {
var privateKeyPassword = $('#decryptAll input:password[id="privateKeyPassword"]').val();
+ $('#decryptAll button:button[name="submitDecryptAll"]').prop("disabled", true);
+ $('#decryptAll input:password[name="privateKeyPassword"]').prop("disabled", true);
OC.Encryption.decryptAll(privateKeyPassword);
});
@@ -196,6 +216,8 @@ $(document).ready(function(){
if (privateKeyPassword !== '' ) {
$('#decryptAll button:button[name="submitDecryptAll"]').removeAttr("disabled");
if(event.which === 13) {
+ $('#decryptAll button:button[name="submitDecryptAll"]').prop("disabled", true);
+ $('#decryptAll input:password[name="privateKeyPassword"]').prop("disabled", true);
OC.Encryption.decryptAll(privateKeyPassword);
}
} else {
@@ -243,6 +265,17 @@ $(document).ready(function(){
$('#sendcropperbutton').click(function(){
sendCropData();
});
+
+ $('#pass2').strengthify({
+ zxcvbn: OC.linkTo('3rdparty','zxcvbn/js/zxcvbn.js'),
+ titles: [
+ t('core', 'Very weak password'),
+ t('core', 'Weak password'),
+ t('core', 'So-so password'),
+ t('core', 'Good password'),
+ t('core', 'Strong password')
+ ]
+ });
} );
OC.Encryption = {
@@ -251,13 +284,13 @@ OC.Encryption = {
$.post('ajax/decryptall.php', {password:password}, function(data) {
if (data.status === "error") {
OC.Encryption.msg.finishedDecrypting('#decryptAll .msg', data);
+ $('#decryptAll input:password[name="privateKeyPassword"]').removeAttr("disabled");
} else {
OC.Encryption.msg.finishedDecrypting('#decryptAll .msg', data);
}
- }
- );
+ });
}
-}
+};
OC.Encryption.msg={
startDecrypting:function(selector){