Patch #37482 » use-html-autofocus-v2.patch
| app/views/account/login.html.erb | ||
|---|---|---|
| 5 | 5 |
<%= back_url_hidden_field_tag %> |
| 6 | 6 |
|
| 7 | 7 |
<label for="username"><%=l(:field_login)%></label> |
| 8 |
<%= text_field_tag 'username', params[:username], :tabindex => '1' %> |
|
| 8 |
<%= text_field_tag 'username', params[:username], :tabindex => '1', :autofocus => params[:username].blank? %>
|
|
| 9 | 9 |
|
| 10 | 10 |
<label for="password"> |
| 11 | 11 |
<%=l(:field_password)%> |
| 12 | 12 |
<%= link_to l(:label_password_lost), lost_password_path, :class => "lost_password" if Setting.lost_password? %> |
| 13 | 13 |
</label> |
| 14 |
<%= password_field_tag 'password', nil, :tabindex => '2' %> |
|
| 14 |
<%= password_field_tag 'password', nil, :tabindex => '2', :autofocus => params[:username].present? %>
|
|
| 15 | 15 |
|
| 16 | 16 |
<% if Setting.autologin? %> |
| 17 | 17 |
<label for="autologin"><%= check_box_tag 'autologin', 1, false, :tabindex => 4 %> <%= l(:label_stay_logged_in) %></label> |
| ... | ... | |
| 22 | 22 |
</div> |
| 23 | 23 | |
| 24 | 24 |
<%= call_hook :view_account_login_bottom %> |
| 25 | ||
| 26 |
<% if params[:username].present? %> |
|
| 27 |
<%= javascript_tag "$('#password').focus();" %>
|
|
| 28 |
<% else %> |
|
| 29 |
<%= javascript_tag "$('#username').focus();" %>
|
|
| 30 |
<% end %> |
|
| app/views/sudo_mode/new.html.erb | ||
|---|---|---|
| 8 | 8 |
<div class="box"> |
| 9 | 9 |
<p> |
| 10 | 10 |
<label for="sudo_password"><%= l :field_password %><span class="required">*</span></label> |
| 11 |
<%= password_field_tag :sudo_password, nil, size: 25 %> |
|
| 11 |
<%= password_field_tag :sudo_password, nil, size: 25, autofocus: true %>
|
|
| 12 | 12 |
</br><%= link_to l(:label_password_lost), lost_password_path, :class => "lost_password" if Setting.lost_password? %> |
| 13 | 13 |
</p> |
| 14 | 14 |
</div> |
| 15 | 15 |
<%= submit_tag l(:button_submit) %> |
| 16 | 16 |
<% end %> |
| 17 |
<%= javascript_tag "$('#sudo_password').focus();" %>
|
|
- « Previous
- 1
- 2
- Next »