Fossil SCM

Set the 'autofocus' attribute for default input fields on the login, logout and register HTML forms. See [forum:4add4de05f | Forum post 4add4de05f] for more information.

florian 2024-09-11 07:07 trunk
Commit bc05e6cc2798049956465dd02f1046ab867f13709340c693b35ad358539c73d5
1 file changed +3 -3
+3 -3
--- src/login.c
+++ src/login.c
@@ -751,11 +751,11 @@
751751
if( anonFlag ){
752752
@ <input type="hidden" name="anon" value="1">
753753
}
754754
if( g.zLogin ){
755755
@ <p>Currently logged in as <b>%h(g.zLogin)</b>.
756
- @ <input type="submit" name="out" value="Logout"></p>
756
+ @ <input type="submit" name="out" value="Logout" autofocus></p>
757757
@ </form>
758758
}else{
759759
unsigned int uSeed = captcha_seed();
760760
if( g.zLogin==0 && (anonFlag || zGoto==0) ){
761761
zAnonPw = db_text(0, "SELECT pw FROM user"
@@ -777,11 +777,11 @@
777777
@ </span></td></tr>
778778
}
779779
@ <tr>
780780
@ <td class="form_label" id="userlabel1">User ID:</td>
781781
@ <td><input type="text" id="u" aria-labelledby="userlabel1" name="u" \
782
- @ size="30" value="%s(anonFlag?"anonymous":"")"></td>
782
+ @ size="30" value="%s(anonFlag?"anonymous":"")" autofocus></td>
783783
@ </tr>
784784
@ <tr>
785785
@ <td class="form_label" id="pswdlabel">Password:</td>
786786
@ <td><input aria-labelledby="pswdlabel" type="password" id="p" \
787787
@ name="p" value="" size="30">\
@@ -2243,11 +2243,11 @@
22432243
@ <p><input type="hidden" name="captchaseed" value="%u(uSeed)">
22442244
@ <table class="login_out">
22452245
@ <tr>
22462246
@ <td class="form_label" align="right" id="uid">User ID:</td>
22472247
@ <td><input aria-labelledby="uid" type="text" name="u" \
2248
- @ value="%h(zUserID)" size="30"></td>
2248
+ @ value="%h(zUserID)" size="30" autofocus></td>
22492249
@
22502250
if( iErrLine==1 ){
22512251
@ <tr><td><td><span class='loginError'>&uarr; %h(zErr)</span></td></tr>
22522252
}
22532253
@ <tr>
22542254
--- src/login.c
+++ src/login.c
@@ -751,11 +751,11 @@
751 if( anonFlag ){
752 @ <input type="hidden" name="anon" value="1">
753 }
754 if( g.zLogin ){
755 @ <p>Currently logged in as <b>%h(g.zLogin)</b>.
756 @ <input type="submit" name="out" value="Logout"></p>
757 @ </form>
758 }else{
759 unsigned int uSeed = captcha_seed();
760 if( g.zLogin==0 && (anonFlag || zGoto==0) ){
761 zAnonPw = db_text(0, "SELECT pw FROM user"
@@ -777,11 +777,11 @@
777 @ </span></td></tr>
778 }
779 @ <tr>
780 @ <td class="form_label" id="userlabel1">User ID:</td>
781 @ <td><input type="text" id="u" aria-labelledby="userlabel1" name="u" \
782 @ size="30" value="%s(anonFlag?"anonymous":"")"></td>
783 @ </tr>
784 @ <tr>
785 @ <td class="form_label" id="pswdlabel">Password:</td>
786 @ <td><input aria-labelledby="pswdlabel" type="password" id="p" \
787 @ name="p" value="" size="30">\
@@ -2243,11 +2243,11 @@
2243 @ <p><input type="hidden" name="captchaseed" value="%u(uSeed)">
2244 @ <table class="login_out">
2245 @ <tr>
2246 @ <td class="form_label" align="right" id="uid">User ID:</td>
2247 @ <td><input aria-labelledby="uid" type="text" name="u" \
2248 @ value="%h(zUserID)" size="30"></td>
2249 @
2250 if( iErrLine==1 ){
2251 @ <tr><td><td><span class='loginError'>&uarr; %h(zErr)</span></td></tr>
2252 }
2253 @ <tr>
2254
--- src/login.c
+++ src/login.c
@@ -751,11 +751,11 @@
751 if( anonFlag ){
752 @ <input type="hidden" name="anon" value="1">
753 }
754 if( g.zLogin ){
755 @ <p>Currently logged in as <b>%h(g.zLogin)</b>.
756 @ <input type="submit" name="out" value="Logout" autofocus></p>
757 @ </form>
758 }else{
759 unsigned int uSeed = captcha_seed();
760 if( g.zLogin==0 && (anonFlag || zGoto==0) ){
761 zAnonPw = db_text(0, "SELECT pw FROM user"
@@ -777,11 +777,11 @@
777 @ </span></td></tr>
778 }
779 @ <tr>
780 @ <td class="form_label" id="userlabel1">User ID:</td>
781 @ <td><input type="text" id="u" aria-labelledby="userlabel1" name="u" \
782 @ size="30" value="%s(anonFlag?"anonymous":"")" autofocus></td>
783 @ </tr>
784 @ <tr>
785 @ <td class="form_label" id="pswdlabel">Password:</td>
786 @ <td><input aria-labelledby="pswdlabel" type="password" id="p" \
787 @ name="p" value="" size="30">\
@@ -2243,11 +2243,11 @@
2243 @ <p><input type="hidden" name="captchaseed" value="%u(uSeed)">
2244 @ <table class="login_out">
2245 @ <tr>
2246 @ <td class="form_label" align="right" id="uid">User ID:</td>
2247 @ <td><input aria-labelledby="uid" type="text" name="u" \
2248 @ value="%h(zUserID)" size="30" autofocus></td>
2249 @
2250 if( iErrLine==1 ){
2251 @ <tr><td><td><span class='loginError'>&uarr; %h(zErr)</span></td></tr>
2252 }
2253 @ <tr>
2254

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button