From 9954c55906795f20ddc42d975eb6310ea240dcc7 Mon Sep 17 00:00:00 2001 From: Max Goodman Date: Fri, 7 Oct 2011 11:57:05 -0700 Subject: [PATCH] Specify tabindex on login inputs for mouse-free usage. --- r2/r2/templates/captcha.html | 8 ++++++-- r2/r2/templates/login.html | 13 +++++++------ r2/r2/templates/loginformwide.html | 6 +++--- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/r2/r2/templates/captcha.html b/r2/r2/templates/captcha.html index df00f6f50..d175180e3 100644 --- a/r2/r2/templates/captcha.html +++ b/r2/r2/templates/captcha.html @@ -53,7 +53,7 @@ ${rounded_captcha()} -<%def name="captchagen(iden, error='', tabulate=False, tabular = True, size=60, label=True, show_error = True)"> +<%def name="captchagen(iden, error='', tabulate=False, tabular = True, size=60, label=True, show_error = True, tabindex = None)"> %if tabulate: %endif @@ -80,7 +80,11 @@ ${rounded_captcha()} %endif + placeholder="type the letters from the image above" + %if tabindex: + tabindex="${tabindex}" + %endif + /> %if tabular:
diff --git a/r2/r2/templates/login.html b/r2/r2/templates/login.html index c8eb83098..e416b9700 100644 --- a/r2/r2/templates/login.html +++ b/r2/r2/templates/login.html @@ -47,6 +47,7 @@ <% op = "reg" if register else "login" base = g.https_endpoint if not c.cname else '' + tabindex = 3 if register else 2 %>
+ type="text" maxlength="20" tabindex="${tabindex}"/> %if register: ${error_field("BAD_USERNAME", "user", kind="span")} ${error_field("USERNAME_TAKEN", "user", kind="span")} @@ -77,7 +78,7 @@ ${_('email')}:  (${_('optional')}) + type="text" maxlength="50" tabindex="${tabindex}"/> %if register: ${error_field("BAD_EMAILS", "email", kind="span")} %endif @@ -86,7 +87,7 @@
  • + maxlength="20" tabindex="${tabindex}"/> %if register: ${error_field("BAD_PASSWORD", "passwd", kind="span")} %else: @@ -97,13 +98,13 @@
  • + type="password" maxlength="20" tabindex="${tabindex}"/> ${error_field("BAD_PASSWORD_MATCH", "passwd2", kind="span")}
  • %if not g.disable_captcha: <% iden = hasattr(thing, "captcha") and thing.captcha.iden or '' %> - ${captchagen(iden, tabulate=True, label=False, size=30)} + ${captchagen(iden, tabulate=True, label=False, size=30, tabindex=tabindex)} %endif ${error_field("RATELIMIT", "ratelimit")} ${error_field("RATELIMIT", "vdelay")} @@ -124,7 +125,7 @@ %endif

    - diff --git a/r2/r2/templates/loginformwide.html b/r2/r2/templates/loginformwide.html index 16997234b..149eb225f 100644 --- a/r2/r2/templates/loginformwide.html +++ b/r2/r2/templates/loginformwide.html @@ -41,19 +41,19 @@ %endif - +

    - + ${_("reset password")}
    - +