summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/util.js17
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();
+ }
});