Merge pull request #2953 from jerrac/emailsavetimeout

Modified how the #lostpassword or #email fields save email addresses on ...
This commit is contained in:
Bernhard Posselt 2013-04-16 13:56:14 -07:00
commit 7049436058
1 changed files with 22 additions and 12 deletions

View File

@ -4,6 +4,22 @@
* See the COPYING-README file.
*/
/**
* Post the email address change to the server.
*/
function changeEmailAddress(){
emailInfo = $('#email');
if (emailInfo.val() === emailInfo.defaultValue){
return;
}
emailInfo.defaultValue = emailInfo.val();
OC.msg.startSaving('#lostpassword .msg');
var post = $( "#lostpassword" ).serialize();
$.post( 'ajax/lostpassword.php', post, function(data){
OC.msg.finishedSaving('#lostpassword .msg', data);
});
}
$(document).ready(function(){
$("#passwordbutton").click( function(){
if ($('#pass1').val() != '' && $('#pass2').val() != '') {
@ -62,18 +78,12 @@ $(document).ready(function(){
});
$('#lostpassword #email').blur(function(event){
if ($(this).val() == this.defaultValue){
return;
}
event.preventDefault();
this.defaultValue = $(this).val();
OC.msg.startSaving('#lostpassword .msg');
var post = $( "#lostpassword" ).serialize();
$.post( 'ajax/lostpassword.php', post, function(data){
OC.msg.finishedSaving('#lostpassword .msg', data);
});
});
$('#email').keyup(function(){
if(typeof timeout !== 'undefined'){
clearTimeout(timeout);
}
timeout = setTimeout('changeEmailAddress()',1000);
});
$("#languageinput").chosen();