forked from GNUsocial/gnu-social
Added a cookie for the nickname cookie for the login page and prefill
the input field.
This commit is contained in:
parent
1f45273d53
commit
959171acac
17
js/util.js
17
js/util.js
@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user