]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Added a cookie for the nickname cookie for the login page and prefill
authorSarven Capadisli <csarven@status.net>
Wed, 24 Feb 2010 15:39:16 +0000 (16:39 +0100)
committerSarven Capadisli <csarven@status.net>
Wed, 24 Feb 2010 15:39:16 +0000 (16:39 +0100)
the input field.

js/util.js

index 78533ab7315c54735ec833c37681b1abda80cb87..4b6c39a1dc42d613b65e83eb0bdaaa1719406035 100644 (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();
+    }
 });