Remove redundant _form_submit selectors

This commit is contained in:
Erik Michaels-Ober 2011-04-03 21:24:35 -07:00
parent 8c359b97f9
commit c7490ec32f
8 changed files with 17 additions and 15 deletions

View File

@ -2,5 +2,5 @@
<%= f.hidden_field "id" %>
<%= f.hidden_field "user_id", :value => "" %>
<%= f.hidden_field "name", :value => "" %>
<%= f.submit "Abandon this hydrant", :id => "abandon_form_submit" %>
<%= f.submit "Abandon this hydrant" %>
<% end %>

View File

@ -1,4 +1,4 @@
<%= form_for(:hydrant, :url => '/hydrant', :html => {:id => "back_form", :method => "get"}) do |f| %>
<%= f.hidden_field "id" %>
<%= f.submit "Back", :id => "back_form_submit" %>
<%= f.submit "Back" %>
<% end %>

View File

@ -2,5 +2,5 @@
<%= f.hidden_field "id" %>
<%= f.hidden_field "user_id", :value => "" %>
<%= f.hidden_field "name", :value => "" %>
<%= f.submit "Steal this hydrant", :id => "steal_form_submit" %>
<%= f.submit "Steal this hydrant" %>
<% end %>

View File

@ -4,7 +4,7 @@
<%= f.hidden_field "user_id", :value => current_user.id %>
<%= f.label "name", "Give this hydrant a name", :id => "hydrant_name_label" %>
<%= f.text_field "name", :tabindex => 1 %>
<%= f.submit "Adopt!", :tabindex => 2, :id => "adoption_form_submit" %>
<%= f.submit "Adopt!", :tabindex => 2 %>
<p>By adopting this hydrant, you agree to the <%= link_to "Terms of Service", "#", :tabindex => 3 %>.</p>
<% end %>
<%= render(:partial => 'users/edit_profile') %>

View File

@ -1,3 +1,3 @@
<%= form_for(:sign_in, :html => {:id => "sign_in_form"}) do |f| %>
<%= f.submit "Sign in", :id => "sign_in_form_submit" %>
<%= f.submit "Sign in" %>
<% end %>

View File

@ -1,3 +1,3 @@
<%= form_for(:sign_out, :html => {:id => "sign_out_form"}) do |f| %>
<%= f.submit "Sign out", :id => "sign_out_form_submit" %>
<%= f.submit "Sign out" %>
<% end %>

View File

@ -1,3 +1,3 @@
<%= form_for(:user, :url => edit_user_registration_path, :html => {:id => "edit_profile_form", :method => "get"}) do |f| %>
<%= f.submit "Edit profile", :id => "edit_profile_form_submit" %>
<%= f.submit "Edit profile" %>
<% end %>

View File

@ -386,7 +386,7 @@ $(function() {
url: '/hydrant',
data: {
'id': $('#hydrant_id').val(),
'commit': $('#adoption_form_submit').val(),
'commit': submitButton.val(),
'utf8': '✓',
'authenticity_token': $('#adoption_form input[name="authenticity_token"]').val(),
'_method': 'put',
@ -432,7 +432,7 @@ $(function() {
url: '/hydrant',
data: {
'id': $('#hydrant_id').val(),
'commit': $('#abandon_form_submit').val(),
'commit': submitButton.val(),
'utf8': '✓',
'authenticity_token': $('#abandon_form input[name="authenticity_token"]').val(),
'_method': 'put',
@ -478,7 +478,7 @@ $(function() {
url: '/hydrant',
data: {
'id': $('#hydrant_id').val(),
'commit': $('#steal_form_submit').val(),
'commit': submitButton.val(),
'utf8': '✓',
'authenticity_token': $('#steal_form input[name="authenticity_token"]').val(),
'_method': 'put',
@ -515,11 +515,13 @@ $(function() {
return false;
});
$('#edit_profile_form').live('submit', function() {
var submitButton = $("#edit_profile_form input[type='submit']");
$(submitButton).attr("disabled", true);
$.ajax({
type: 'GET',
url: '/users/edit',
data: {
'commit': $('#edit_profile_form_submit').val(),
'commit': submitButton.val(),
'utf8': '✓',
'authenticity_token': $('#edit_profile_form input[name="authenticity_token"]').val()
},
@ -579,7 +581,7 @@ $(function() {
data: {
'id': $('#id').val(),
'hydrant_id': activeHydrantId,
'commit': $('#edit_form_submit').val(),
'commit': submitButton.val(),
'utf8': '✓',
'authenticity_token': $('#edit_form input[name="authenticity_token"]').val(),
'_method': 'put',
@ -654,7 +656,7 @@ $(function() {
type: 'GET',
url: '/users/sign_out.json',
data: {
'commit': $('#sign_out_form_submit').val(),
'commit': submitButton.val(),
'utf8': '✓',
'authenticity_token': $('#sign_out_form input[name="authenticity_token"]').val()
},
@ -684,7 +686,7 @@ $(function() {
type: 'GET',
url: '/users/sign_in',
data: {
'commit': $('#sign_in_form_submit').val(),
'commit': submitButton.val(),
'utf8': '✓',
'authenticity_token': $('#sign_in_form input[name="authenticity_token"]').val(),
},
@ -705,7 +707,7 @@ $(function() {
type: 'GET',
url: '/hydrant',
data: {
'commit': $('#back_form_submit').val(),
'commit': submitButton.val(),
'utf8': '✓',
'authenticity_token': $('#back_form input[name="authenticity_token"]').val(),
'hydrant_id': activeHydrantId