Added a cookie for the nickname cookie for the login page and prefill

the input field.
This commit is contained in:
Sarven Capadisli 2010-02-24 16:39:16 +01:00
parent 1f45273d53
commit 959171acac
1 changed files with 17 additions and 0 deletions

View File

@ -737,6 +737,20 @@ var SN = { // StatusNet
SN.U.NewDirectMessage();
}
},
Login: function() {
if (SN.U.StatusNetInstance.Get() !== null) {
var nickname = SN.U.StatusNetInstance.Get().Nickname;
if (nickname !== null) {
$('#form_login #nickname').val(nickname);
}
}
$('#form_login').bind('submit', function() {
SN.U.StatusNetInstance.Set({Nickname: $('#form_login #nickname').val()});
return true;
});
}
}
};
@ -751,5 +765,8 @@ $(document).ready(function(){
if ($('#content .entity_actions').length > 0) {
SN.Init.EntityActions();
}
if ($('#form_login').length > 0) {
SN.Init.Login();
}
});