From c7b2a070764ccfc333db41c28c346be38649f36e 2011-12-14 00:13:34
From: Stefan van der Walt <stefan@sun.ac.za>
Date: 2011-12-14 00:13:34
Subject: [PATCH] On the login page, focus on the password field.

---

diff --git a/IPython/frontend/html/notebook/templates/login.html b/IPython/frontend/html/notebook/templates/login.html
index 08b71a6..c2877ee 100644
--- a/IPython/frontend/html/notebook/templates/login.html
+++ b/IPython/frontend/html/notebook/templates/login.html
@@ -2,7 +2,16 @@
 
 {% block content_panel %}
     <form action="/login?next={{url_escape(next)}}" method="post">
-        Password: <input type="password" name="password">
+        Password: <input type="password" name="password" id="focus">
         <input type="submit" value="Sign in" id="signin">
     </form>
 {% end %}
+
+{% block script %}
+<script type="text/javascript">
+  $(document).ready(function() {
+    IPython.login_widget = new IPython.LoginWidget('span#login_widget');
+    $('#focus').focus();
+  });
+</script>
+{% end %}
diff --git a/IPython/frontend/html/notebook/templates/logout.html b/IPython/frontend/html/notebook/templates/logout.html
index 9513dac..62ea4d8 100644
--- a/IPython/frontend/html/notebook/templates/logout.html
+++ b/IPython/frontend/html/notebook/templates/logout.html
@@ -7,3 +7,11 @@
     Proceed to the <a href="/login">login page</a>.
   {% end %}
 {% end %}
+
+{% block script %}
+<script type="text/javascript">
+  $(document).ready(function() {
+    IPython.login_widget = new IPython.LoginWidget('span#login_widget');
+  });
+</script>
+{% end %}