diff options
author | Sarven Capadisli <csarven@status.net> | 2010-02-24 16:39:16 +0100 |
---|---|---|
committer | Sarven Capadisli <csarven@status.net> | 2010-02-24 16:39:16 +0100 |
commit | 959171acac5abc3716119f7d5a7918e7497fdbfd (patch) | |
tree | 69e28c008dbbd07727ed6d960bab13b9b7f5e4eb | |
parent | 1f45273d5303e98430a02d4480278c24733a5be9 (diff) |
Added a cookie for the nickname cookie for the login page and prefill
the input field.
-rw-r--r-- | js/util.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/js/util.js b/js/util.js index 78533ab73..4b6c39a1d 100644 --- a/js/util.js +++ b/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(); + } }); |