clean up stray hidden input tags by passing the data directly into the js where possible and placing them under an existing form tag elsewhere

This commit is contained in:
MrZYX 2011-03-30 17:07:15 +02:00
parent 699264e7a3
commit 53bdb2cade
5 changed files with 5 additions and 8 deletions

View file

@ -2,8 +2,6 @@
-# licensed under the Affero General Public License version 3 or later. See -# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file. -# the COPYRIGHT file.
= hidden_field_tag :contact_json, @selected_contacts.map{|contact| contact.person}.to_json
%h4 %h4
.right .right
= link_to t('contacts', :count => @contact_count), manage_aspects_path, :title => t('aspects.manage.manage_aspects') = link_to t('contacts', :count => @contact_count), manage_aspects_path, :title => t('aspects.manage.manage_aspects')

View file

@ -4,7 +4,7 @@
:javascript :javascript
$(document).ready(function () { $(document).ready(function () {
var data = $.parseJSON( $('#contact_json').val() ), var data = $.parseJSON( '#{@all_contacts_and_ids.to_json}' ),
autocompleteInput = $("#contact_autocomplete"); autocompleteInput = $("#contact_autocomplete");
autocompleteInput.autoSuggest(data, { autocompleteInput.autoSuggest(data, {
@ -23,7 +23,6 @@
autocompleteInput.focus(); autocompleteInput.focus();
}); });
= hidden_field_tag :contact_json, @all_contacts_and_ids.to_json
#new_message_pane #new_message_pane
.span-12.last .span-12.last

View file

@ -7,7 +7,7 @@
:javascript :javascript
$(document).ready(function () { $(document).ready(function () {
var data = $.parseJSON( $('#tags_json').val() ), var data = $.parseJSON( '#{@tags_array.to_json}' ),
autocompleteInput = $("#profile_tag_string"); autocompleteInput = $("#profile_tag_string");
@ -22,7 +22,7 @@
minChars: 2, minChars: 2,
keyDelay: 0, keyDelay: 0,
startText: "#{t('profiles.edit.your_tags_placeholder')}", startText: "#{t('profiles.edit.your_tags_placeholder')}",
emptyText: '#{t('no_results')}', emptyText: "#{t('no_results')}",
preFill: data preFill: data
}); });
@ -36,7 +36,6 @@
}); });
= hidden_field_tag :tags_json, @tags_array.to_json
%h3 %h3
= t('profiles.edit.your_public_profile') = t('profiles.edit.your_public_profile')

View file

@ -20,6 +20,8 @@
.content_creation .content_creation
= form_for(StatusMessage.new, :remote => true, :html => {"data-type" => "json"}) do |status| = form_for(StatusMessage.new, :remote => true, :html => {"data-type" => "json"}) do |status|
- if @selected_contacts
= hidden_field_tag :contact_json, @selected_contacts.map{|contact| contact.person}.to_json
= status.error_messages = status.error_messages
#file-upload #file-upload
= image_tag 'icons/photos.png' = image_tag 'icons/photos.png'

View file

@ -31,7 +31,6 @@
}); });
#new_status_message_pane #new_status_message_pane
= hidden_field_tag :contact_json, @selected_contacts.map{|contact| contact.person}.to_json
.span-15.last .span-15.last
#facebox_header #facebox_header
%h4 %h4