muck-services 0.1.47 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +2 -1
- data/LICENSE +1 -1
- data/README.rdoc +32 -48
- data/Rakefile +14 -16
- data/VERSION +1 -1
- data/app/controllers/admin/muck/feeds_controller.rb +1 -1
- data/app/controllers/muck/aggregations_controller.rb +4 -6
- data/app/controllers/muck/feed_previews_controller.rb +2 -10
- data/app/controllers/muck/feeds_controller.rb +1 -1
- data/app/controllers/muck/identity_feeds_controller.rb +2 -6
- data/app/controllers/muck/topics_controller.rb +3 -3
- data/app/controllers/muck/visits_controller.rb +3 -3
- data/app/helpers/muck_services_feeds_helper.rb +3 -3
- data/app/helpers/muck_services_service_helper.rb +2 -2
- data/app/models/aggregation.rb +4 -18
- data/app/models/entry.rb +2 -2
- data/app/models/feed.rb +7 -9
- data/app/models/oai_endpoint.rb +6 -6
- data/app/models/personal_recommendation.rb +4 -5
- data/app/models/service.rb +6 -6
- data/app/models/service_category.rb +1 -1
- data/app/models/services_mailer.rb +10 -12
- data/app/views/activity_templates/{_entry_comment.html.erb → _entry_comment.erb} +0 -0
- data/app/views/activity_templates/{_entry_share.html.erb → _entry_share.erb} +0 -0
- data/app/views/admin/feeds/index.html.erb +8 -9
- data/app/views/admin/oai_endpoints/index.html.erb +4 -4
- data/app/views/aggregations/{_feeds.html.erb → _feeds.erb} +0 -0
- data/app/views/aggregations/edit.html.erb +3 -3
- data/app/views/aggregations/index.html.erb +1 -1
- data/app/views/aggregations/new.html.erb +1 -1
- data/app/views/aggregations/preview.html.erb +1 -1
- data/app/views/feed_previews/{new.html.erb → new.erb} +0 -0
- data/app/views/feed_previews/{select_feeds.html.erb → select_feeds.erb} +0 -0
- data/app/views/feeds/_feed.html.erb +1 -1
- data/app/views/feeds/_feed_row.html.erb +1 -1
- data/app/views/feeds/_form.html.erb +2 -2
- data/app/views/feeds/edit.html.erb +2 -2
- data/app/views/feeds/index.html.erb +7 -8
- data/app/views/feeds/new.html.erb +2 -2
- data/app/views/feeds/new_extended.html.erb +2 -2
- data/app/views/feeds/new_oai_rss.html.erb +2 -2
- data/app/views/identity_feeds/{_form.html.erb → _form.erb} +1 -1
- data/app/views/oai_endpoints/_form.html.erb +2 -2
- data/app/views/oai_endpoints/_oai_endpoint_row.html.erb +1 -1
- data/app/views/parts/_add_feed.html.erb +1 -1
- data/app/views/services_mailer/{notification_feed_added.text.html.erb → notification_feed_added.html.erb} +0 -0
- data/app/views/services_mailer/{notification_feed_added.text.plain.erb → notification_feed_added.text.erb} +0 -0
- data/app/views/services_mailer/{notification_oai_endpoint_added.text.html.erb → notification_oai_endpoint_added.html.erb} +0 -0
- data/app/views/services_mailer/{notification_oai_endpoint_added.text.plain.erb → notification_oai_endpoint_added.text.erb} +0 -0
- data/app/views/topics/_form.html.erb +1 -1
- data/app/views/topics/new.html.erb +1 -1
- data/app/views/visits/_toolbar.html.erb +3 -3
- data/{locales → config/locales}/ar.yml +34 -34
- data/{locales → config/locales}/bg.yml +34 -34
- data/{locales → config/locales}/ca.yml +34 -34
- data/{locales → config/locales}/cs.yml +34 -34
- data/{locales → config/locales}/da.yml +34 -34
- data/{locales → config/locales}/de.yml +34 -34
- data/{locales → config/locales}/el.yml +34 -34
- data/{locales → config/locales}/en.yml +34 -36
- data/{locales → config/locales}/es.yml +34 -34
- data/{locales → config/locales}/et.yml +34 -34
- data/{locales → config/locales}/fa.yml +34 -34
- data/{locales → config/locales}/fi.yml +34 -34
- data/{locales → config/locales}/fr.yml +34 -34
- data/{locales → config/locales}/gl.yml +34 -34
- data/{locales → config/locales}/hi.yml +34 -34
- data/{locales → config/locales}/hr.yml +34 -34
- data/{locales → config/locales}/hu.yml +34 -34
- data/{locales → config/locales}/id.yml +34 -34
- data/{locales → config/locales}/it.yml +34 -34
- data/{locales → config/locales}/iw.yml +34 -34
- data/{locales → config/locales}/ja.yml +34 -34
- data/{locales → config/locales}/ko.yml +34 -34
- data/{locales → config/locales}/lt.yml +34 -34
- data/{locales → config/locales}/lv.yml +34 -34
- data/{locales → config/locales}/mt.yml +34 -34
- data/{locales → config/locales}/nl.yml +34 -34
- data/{locales → config/locales}/no.yml +34 -34
- data/{locales → config/locales}/pl.yml +34 -34
- data/{locales → config/locales}/pt-PT.yml +34 -34
- data/{locales → config/locales}/ro.yml +34 -34
- data/{locales → config/locales}/ru.yml +34 -34
- data/{locales → config/locales}/sk.yml +34 -34
- data/{locales → config/locales}/sl.yml +34 -34
- data/{locales → config/locales}/sq.yml +34 -34
- data/{locales → config/locales}/sr.yml +34 -34
- data/{locales → config/locales}/sv.yml +34 -34
- data/{locales → config/locales}/th.yml +34 -34
- data/{locales → config/locales}/tl.yml +34 -34
- data/{locales → config/locales}/tr.yml +34 -34
- data/{locales → config/locales}/uk.yml +34 -34
- data/{locales → config/locales}/vi.yml +34 -34
- data/{locales → config/locales}/zh-CN.yml +34 -34
- data/{locales → config/locales}/zh-TW.yml +34 -34
- data/{locales → config/locales}/zh.yml +34 -34
- data/config/routes.rb +73 -0
- data/lib/muck-services.rb +24 -0
- data/lib/muck-services/config.rb +36 -0
- data/lib/muck-services/engine.rb +32 -0
- data/lib/{muck_services → muck-services}/exceptions.rb +0 -0
- data/lib/{muck_services → muck-services}/languages.rb +0 -0
- data/lib/muck-services/models/aggregation_owner.rb +17 -0
- data/lib/muck-services/models/feed_owner.rb +24 -0
- data/lib/muck-services/models/feed_parent.rb +18 -0
- data/lib/muck-services/models/recommendation.rb +14 -0
- data/lib/muck-services/models/recommendation_owner.rb +15 -0
- data/lib/muck-services/models/services_comment.rb +24 -0
- data/lib/muck-services/models/services_share.rb +18 -0
- data/lib/{muck_services → muck-services}/muck_custom_form_builder.rb +1 -3
- data/lib/{muck_services → muck-services}/services.rb +0 -0
- data/lib/tasks/muck_services.rake +101 -0
- data/muck-services.gemspec +364 -520
- data/test/{rails_root → rails_test}/app/controllers/application_controller.rb +1 -9
- data/test/{rails_root → rails_test}/app/controllers/default_controller.rb +0 -0
- data/test/{rails_root → rails_test}/app/helpers/application_helper.rb +0 -0
- data/test/{rails_root → rails_test}/app/models/activity.rb +1 -1
- data/test/{rails_root → rails_test}/app/models/comment.rb +3 -3
- data/test/rails_test/app/models/country.rb +13 -0
- data/test/rails_test/app/models/language.rb +15 -0
- data/test/{rails_root → rails_test}/app/models/share.rb +3 -3
- data/test/rails_test/app/models/state.rb +13 -0
- data/test/{rails_root → rails_test}/app/models/user.rb +8 -8
- data/test/{rails_root → rails_test}/app/models/user_session.rb +0 -0
- data/test/rails_test/config/application.rb +42 -0
- data/test/rails_test/config/boot.rb +13 -0
- data/test/rails_test/config/environment.rb +5 -0
- data/test/rails_test/config/environments/development.rb +26 -0
- data/test/rails_test/config/environments/production.rb +49 -0
- data/test/rails_test/config/environments/test.rb +35 -0
- data/test/rails_test/config/initializers/backtrace_silencers.rb +7 -0
- data/test/{rails_root → rails_test}/config/initializers/inflections.rb +2 -2
- data/test/rails_test/config/initializers/mce_options.rb +83 -0
- data/test/{rails_root → rails_test}/config/initializers/mime_types.rb +0 -0
- data/test/rails_test/config/initializers/muck.rb +66 -0
- data/test/rails_test/config/initializers/secret_token.rb +7 -0
- data/test/rails_test/config/initializers/session_store.rb +8 -0
- data/test/rails_test/config/routes.rb +12 -0
- data/test/{rails_root → rails_test}/db/migrate/20090320174818_create_muck_permissions_and_roles.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090327231918_create_users.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090402033319_add_muck_activities.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090402234137_create_languages.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090426041056_create_countries.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090426041103_create_states.rb +0 -0
- data/test/rails_test/db/migrate/20090512013727_create_profiles.rb +21 -0
- data/test/rails_test/db/migrate/20090517040220_create_uploads.rb +38 -0
- data/test/{rails_root → rails_test}/db/migrate/20090602191243_create_muck_raker.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090613173314_create_comments.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090619211125_create_tag_clouds.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090623181458_add_grain_size_to_entries.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090623193525_add_grain_size_to_tag_clouds.rb +0 -0
- data/test/rails_test/db/migrate/20090703055724_add_contents.rb +49 -0
- data/test/{rails_root → rails_test}/db/migrate/20090703175825_denormalize_entries_subjects.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090704220055_create_slugs.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090716035935_change_tag_cloud_grain_sizes.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090717173900_add_contributor_to_feeds.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090717175825_normalize_entries_subjects.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090721043213_change_services_title_to_name.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090721054927_remove_services_not_null_from_feeds.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090723050510_create_feed_parents.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090728165716_add_etag_to_feeds.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090730044139_add_comment_cache.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090730045848_add_comment_cache_to_entries.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090730154102_allow_null_user.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090803185323_create_shares.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090804184247_add_comment_count_to_shares.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090804211240_add_entry_id_to_shares.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090804231857_add_shares_uri_index.rb +0 -0
- data/test/rails_test/db/migrate/20090806230610_add_layout_to_contents.rb +9 -0
- data/test/rails_test/db/migrate/20090808175401_add_contents_comment_counter_cache.rb +9 -0
- data/test/{rails_root → rails_test}/db/migrate/20090818204527_add_activity_indexes.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090819030523_add_attachable_to_activities.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090826220530_change_services_sequence_to_sort.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090826225652_create_identity_feeds.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090827005105_add_identity_fields_to_services.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090827015308_create_service_categories.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090827221502_add_prompt_and_template_to_services.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090915041650_aggregations_to_polymorphic.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090922174200_update_oai_endpoints.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090922231552_add_dates_to_oai_endpoints.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090923150807_rename_name_in_aggregation.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090924200750_add_uri_data_template_to_services.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20091006183742_add_feed_count_to_aggregation.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20091022150615_add_uri_key_to_services.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20091115011828_add_aggregations_for_personal_recs.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20091116094447_rename_action_table.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20091118203605_add_default_feed_type_to_aggregation_feed.rb +0 -0
- data/test/rails_test/db/migrate/20091124203137_add_location_to_profiles.rb +15 -0
- data/test/rails_test/db/migrate/20091124205819_add_fields_to_profiles.rb +21 -0
- data/test/{rails_root → rails_test}/db/migrate/20100123035450_create_access_codes.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20100123233654_create_access_code_requests.rb +0 -0
- data/test/rails_test/db/migrate/20100206000906_remove_name_fields.rb +15 -0
- data/test/rails_test/db/migrate/20100903205928_add_dead_entry_fields.rb +13 -0
- data/test/{rails_root → rails_test}/features/step_definitions/common_steps.rb +0 -0
- data/test/{rails_root → rails_test}/features/step_definitions/visit_steps.rb +0 -0
- data/test/rails_test/features/step_definitions/web_steps.rb +219 -0
- data/test/{rails_root → rails_test}/features/step_definitions/webrat_steps.rb +0 -0
- data/test/rails_test/features/support/custom_env.rb +19 -0
- data/test/rails_test/features/support/env.rb +58 -0
- data/test/rails_test/features/support/paths.rb +33 -0
- data/test/rails_test/lib/daemons/amazonaws.rb +36 -0
- data/test/{rails_root → rails_test}/public/dispatch.rb +0 -0
- data/test/rails_test/spec/controllers/admin/feeds_controller_spec.rb +38 -0
- data/test/rails_test/spec/controllers/admin/oai_endpoints_controller_spec.rb +30 -0
- data/test/{rails_root/test/functional/aggregation_feeds_controller_test.rb → rails_test/spec/controllers/aggregation_feeds_controller_spec.rb} +24 -24
- data/test/rails_test/spec/controllers/aggregations_controller_spec.rb +89 -0
- data/test/rails_test/spec/controllers/feed_previews_controller_spec.rb +32 -0
- data/test/rails_test/spec/controllers/feeds_controller_spec.rb +78 -0
- data/test/{rails_root/test/functional/identity_feeds_controller_test.rb → rails_test/spec/controllers/identity_feeds_controller_spec.rb} +44 -44
- data/test/rails_test/spec/controllers/oai_endpoints_controller_spec.rb +42 -0
- data/test/rails_test/spec/controllers/topics_controller_spec.rb +50 -0
- data/test/rails_test/spec/controllers/visits_controller_spec.rb +21 -0
- data/test/{rails_root/test → rails_test/spec}/factories.rb +6 -1
- data/test/rails_test/spec/mailers/services_mailer_spec.rb +31 -0
- data/test/{rails_root/test/unit/aggregation_feed_test.rb → rails_test/spec/models/aggregation_feed_spec.rb} +6 -9
- data/test/{rails_root/test/unit/aggregation_test.rb → rails_test/spec/models/aggregation_spec.rb} +23 -23
- data/test/{rails_root/test/unit/entry_test.rb → rails_test/spec/models/entry_spec.rb} +70 -74
- data/test/{rails_root/test/unit/feed_parent_test.rb → rails_test/spec/models/feed_parent_spec.rb} +5 -5
- data/test/{rails_root/test/unit/feed_test.rb → rails_test/spec/models/feed_spec.rb} +77 -81
- data/test/{rails_root/test/unit/identity_feed_test.rb → rails_test/spec/models/identity_feed_spec.rb} +5 -5
- data/test/rails_test/spec/models/oai_endpoint_spec.rb +78 -0
- data/test/rails_test/spec/models/personal_recommendation_spec.rb +60 -0
- data/test/{rails_root/test/unit/recommendation_test.rb → rails_test/spec/models/recommendation_spec.rb} +6 -8
- data/test/rails_test/spec/models/service_category_spec.rb +19 -0
- data/test/rails_test/spec/models/service_spec.rb +383 -0
- data/test/{rails_root/test/unit/share_test.rb → rails_test/spec/models/share_spec.rb} +8 -11
- data/test/{rails_root/test/unit/tag_cloud_test.rb → rails_test/spec/models/tag_cloud_spec.rb} +4 -4
- data/test/{rails_root/test/unit/user_test.rb → rails_test/spec/models/user_spec.rb} +9 -11
- data/test/{rails_root/test/test_helper.rb → rails_test/spec/spec_helper.rb} +8 -19
- metadata +345 -470
- data/app/views/services_mailer/notification_feed_added.text.ar.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.ar.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.bg.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.bg.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.ca.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.ca.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.cs.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.cs.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.da.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.da.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.de.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.de.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.el.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.el.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.es.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.es.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.et.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.et.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.fa.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.fa.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.fi.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.fi.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.fr.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.fr.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.gl.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.gl.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.hi.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.hi.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.hr.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.hr.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.hu.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.hu.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.id.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.id.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.it.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.it.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.iw.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.iw.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.ja.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.ja.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.ko.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.ko.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.lt.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.lt.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.lv.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.lv.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.mt.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.mt.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.nl.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.nl.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.no.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.no.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.pl.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.pl.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.pt-PT.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.pt-PT.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.ro.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.ro.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.ru.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.ru.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.sk.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.sk.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.sl.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.sl.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.sq.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.sq.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.sr.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.sr.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.sv.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.sv.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.th.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.th.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.tl.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.tl.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.tr.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.tr.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.uk.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.uk.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.vi.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.vi.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.zh-CN.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.zh-CN.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.zh-TW.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.zh-TW.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.zh.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.zh.plain.erb +0 -7
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ar.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ar.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.bg.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.bg.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ca.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ca.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.cs.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.cs.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.da.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.da.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.de.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.de.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.el.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.el.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.es.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.es.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.et.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.et.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.fa.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.fa.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.fi.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.fi.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.fr.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.fr.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.gl.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.gl.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.hi.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.hi.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.hr.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.hr.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.hu.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.hu.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.id.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.id.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.it.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.it.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.iw.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.iw.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ja.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ja.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ko.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ko.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.lt.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.lt.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.lv.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.lv.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.mt.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.mt.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.nl.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.nl.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.no.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.no.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.pl.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.pl.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.pt-PT.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.pt-PT.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ro.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ro.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ru.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ru.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sk.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sk.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sl.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sl.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sq.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sq.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sr.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sr.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sv.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sv.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.th.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.th.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.tl.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.tl.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.tr.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.tr.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.uk.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.uk.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.vi.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.vi.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.zh-CN.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.zh-CN.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.zh-TW.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.zh-TW.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.zh.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.zh.plain.erb +0 -4
- data/config/muck_services_routes.rb +0 -43
- data/lib/active_record/acts/muck_aggregation_owner.rb +0 -30
- data/lib/active_record/acts/muck_feed_owner.rb +0 -36
- data/lib/active_record/acts/muck_feed_parent.rb +0 -23
- data/lib/active_record/acts/muck_recommendations.rb +0 -24
- data/lib/active_record/acts/muck_services_comment.rb +0 -40
- data/lib/active_record/acts/muck_services_share.rb +0 -32
- data/lib/muck_services.rb +0 -23
- data/lib/muck_services/initialize_routes.rb +0 -8
- data/lib/muck_services/tasks.rb +0 -117
- data/rails/init.rb +0 -18
- data/test/rails_root/config/boot.rb +0 -109
- data/test/rails_root/config/environment.rb +0 -41
- data/test/rails_root/config/environments/cucumber.rb +0 -21
- data/test/rails_root/config/environments/development.rb +0 -37
- data/test/rails_root/config/environments/production.rb +0 -1
- data/test/rails_root/config/environments/test.rb +0 -24
- data/test/rails_root/config/initializers/requires.rb +0 -13
- data/test/rails_root/config/initializers/session_store.rb +0 -8
- data/test/rails_root/config/routes.rb +0 -11
- data/test/rails_root/db/schema.rb +0 -504
- data/test/rails_root/features/support/env.rb +0 -14
- data/test/rails_root/features/support/paths.rb +0 -36
- data/test/rails_root/script/create_project.rb +0 -52
- data/test/rails_root/test/functional/admin/feeds_controller_test.rb +0 -37
- data/test/rails_root/test/functional/admin/oai_endpoints_controller_test.rb +0 -30
- data/test/rails_root/test/functional/aggregations_controller_test.rb +0 -89
- data/test/rails_root/test/functional/feed_previews_controller_test.rb +0 -32
- data/test/rails_root/test/functional/feeds_controller_test.rb +0 -78
- data/test/rails_root/test/functional/oai_endpoints_controller_test.rb +0 -42
- data/test/rails_root/test/functional/topics_controller_test.rb +0 -50
- data/test/rails_root/test/functional/visits_controller_test.rb +0 -21
- data/test/rails_root/test/unit/comment_test.rb +0 -38
- data/test/rails_root/test/unit/oai_endpoint_test.rb +0 -84
- data/test/rails_root/test/unit/personal_recommendation_test.rb +0 -78
- data/test/rails_root/test/unit/service_category_test.rb +0 -19
- data/test/rails_root/test/unit/service_test.rb +0 -386
- data/test/rails_root/test/unit/services_mailer_test.rb +0 -35
- data/test/rails_root/vendor/plugins/jrails/init.rb +0 -1
- data/test/rails_root/vendor/plugins/jrails/install.rb +0 -9
- data/test/rails_root/vendor/plugins/jrails/lib/jrails.rb +0 -421
- data/test/rails_root/vendor/plugins/jrails/rails/init.rb +0 -15
- data/test/rails_root/vendor/plugins/ssl_requirement/lib/ssl_requirement.rb +0 -62
- data/test/rails_root/vendor/plugins/ssl_requirement/test/ssl_requirement_test.rb +0 -132
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
require File.dirname(__FILE__) + '/../test_helper'
|
|
2
|
-
require 'services_mailer'
|
|
3
|
-
|
|
4
|
-
class ServicesMailerTest < ActiveSupport::TestCase
|
|
5
|
-
|
|
6
|
-
context "deliver emails" do
|
|
7
|
-
|
|
8
|
-
def setup
|
|
9
|
-
ActionMailer::Base.delivery_method = :test
|
|
10
|
-
ActionMailer::Base.perform_deliveries = true
|
|
11
|
-
ActionMailer::Base.deliveries = []
|
|
12
|
-
@expected = TMail::Mail.new
|
|
13
|
-
@expected.set_content_type "text", "plain", { "charset" => 'utf-8' }
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
should "send notification feed added email" do
|
|
17
|
-
feed = Factory(:feed)
|
|
18
|
-
response = ServicesMailer.deliver_notification_feed_added(feed)
|
|
19
|
-
assert !ActionMailer::Base.deliveries.empty?, "No email was sent"
|
|
20
|
-
email = ActionMailer::Base.deliveries.last
|
|
21
|
-
assert_equal email.to, [GlobalConfig.admin_email]
|
|
22
|
-
assert_equal email.from, [GlobalConfig.from_email]
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
should "send notification oai endpoint added email" do
|
|
26
|
-
oai_endpoint = Factory(:oai_endpoint)
|
|
27
|
-
response = ServicesMailer.deliver_notification_oai_endpoint_added(oai_endpoint)
|
|
28
|
-
assert !ActionMailer::Base.deliveries.empty?, "No email was sent"
|
|
29
|
-
email = ActionMailer::Base.deliveries.last
|
|
30
|
-
assert_equal email.to, [GlobalConfig.admin_email]
|
|
31
|
-
assert_equal email.from, [GlobalConfig.from_email]
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
end
|
|
35
|
-
end
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require 'rails/init.rb'
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# Install hook code here
|
|
2
|
-
puts "Copying files..."
|
|
3
|
-
dir = "javascripts"
|
|
4
|
-
["jquery-ui.js", "jquery.js", "jrails.js"].each do |js_file|
|
|
5
|
-
dest_file = File.join(RAILS_ROOT, "public", dir, js_file)
|
|
6
|
-
src_file = File.join(File.dirname(__FILE__) , dir, js_file)
|
|
7
|
-
FileUtils.cp_r(src_file, dest_file)
|
|
8
|
-
end
|
|
9
|
-
puts "Files copied - Installation complete!"
|
|
@@ -1,421 +0,0 @@
|
|
|
1
|
-
module ActionView
|
|
2
|
-
module Helpers
|
|
3
|
-
|
|
4
|
-
module JavaScriptHelper
|
|
5
|
-
|
|
6
|
-
# This function can be used to render rjs inline
|
|
7
|
-
#
|
|
8
|
-
# <%= javascript_function do |page|
|
|
9
|
-
# page.replace_html :list, :partial => 'list', :object => @list
|
|
10
|
-
# end %>
|
|
11
|
-
#
|
|
12
|
-
def javascript_function(*args, &block)
|
|
13
|
-
html_options = args.extract_options!
|
|
14
|
-
function = args[0] || ''
|
|
15
|
-
|
|
16
|
-
html_options.symbolize_keys!
|
|
17
|
-
function = update_page(&block) if block_given?
|
|
18
|
-
javascript_tag(function)
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def jquery_id(id)
|
|
22
|
-
id.to_s.count('#.*,>+~:[/ ') == 0 ? "##{id}" : id
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def jquery_ids(ids)
|
|
26
|
-
Array(ids).map{|id| jquery_id(id)}.join(',')
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
module PrototypeHelper
|
|
32
|
-
|
|
33
|
-
USE_PROTECTION = const_defined?(:DISABLE_JQUERY_FORGERY_PROTECTION) ? !DISABLE_JQUERY_FORGERY_PROTECTION : true
|
|
34
|
-
|
|
35
|
-
unless const_defined? :JQUERY_VAR
|
|
36
|
-
JQUERY_VAR = 'jQuery'
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
unless const_defined? :JQCALLBACKS
|
|
40
|
-
JQCALLBACKS = Set.new([ :beforeSend, :complete, :error, :success ] + (100..599).to_a)
|
|
41
|
-
#instance_eval { remove_const :AJAX_OPTIONS }
|
|
42
|
-
remove_const(:AJAX_OPTIONS) if const_defined?(:AJAX_OPTIONS)
|
|
43
|
-
AJAX_OPTIONS = Set.new([ :before, :after, :condition, :url,
|
|
44
|
-
:asynchronous, :method, :insertion, :position,
|
|
45
|
-
:form, :with, :update, :script ]).merge(JQCALLBACKS)
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
def periodically_call_remote(options = {})
|
|
49
|
-
frequency = options[:frequency] || 10 # every ten seconds by default
|
|
50
|
-
code = "setInterval(function() {#{remote_function(options)}}, #{frequency} * 1000)"
|
|
51
|
-
javascript_tag(code)
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
def remote_function(options)
|
|
55
|
-
javascript_options = options_for_ajax(options)
|
|
56
|
-
|
|
57
|
-
update = ''
|
|
58
|
-
if options[:update] && options[:update].is_a?(Hash)
|
|
59
|
-
update = []
|
|
60
|
-
update << "success:'#{options[:update][:success]}'" if options[:update][:success]
|
|
61
|
-
update << "failure:'#{options[:update][:failure]}'" if options[:update][:failure]
|
|
62
|
-
update = '{' + update.join(',') + '}'
|
|
63
|
-
elsif options[:update]
|
|
64
|
-
update << "'#{options[:update]}'"
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
function = "#{JQUERY_VAR}.ajax(#{javascript_options})"
|
|
68
|
-
|
|
69
|
-
function = "#{options[:before]}; #{function}" if options[:before]
|
|
70
|
-
function = "#{function}; #{options[:after]}" if options[:after]
|
|
71
|
-
function = "if (#{options[:condition]}) { #{function}; }" if options[:condition]
|
|
72
|
-
function = "if (confirm('#{escape_javascript(options[:confirm])}')) { #{function}; }" if options[:confirm]
|
|
73
|
-
return function
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
class JavaScriptGenerator
|
|
77
|
-
module GeneratorMethods
|
|
78
|
-
|
|
79
|
-
def insert_html(position, id, *options_for_render)
|
|
80
|
-
insertion = position.to_s.downcase
|
|
81
|
-
insertion = 'append' if insertion == 'bottom'
|
|
82
|
-
insertion = 'prepend' if insertion == 'top'
|
|
83
|
-
call "#{JQUERY_VAR}(\"#{jquery_id(id)}\").#{insertion}", render(*options_for_render)
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
def replace_html(id, *options_for_render)
|
|
87
|
-
insert_html(:html, id, *options_for_render)
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
def replace(id, *options_for_render)
|
|
91
|
-
call "#{JQUERY_VAR}(\"#{jquery_id(id)}\").replaceWith", render(*options_for_render)
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
def remove(*ids)
|
|
95
|
-
call "#{JQUERY_VAR}(\"#{jquery_ids(ids)}\").remove"
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
def show(*ids)
|
|
99
|
-
call "#{JQUERY_VAR}(\"#{jquery_ids(ids)}\").show"
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
def hide(*ids)
|
|
103
|
-
call "#{JQUERY_VAR}(\"#{jquery_ids(ids)}\").hide"
|
|
104
|
-
end
|
|
105
|
-
|
|
106
|
-
def toggle(*ids)
|
|
107
|
-
call "#{JQUERY_VAR}(\"#{jquery_ids(ids)}\").toggle"
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
def jquery_id(id)
|
|
111
|
-
id.to_s.count('#.*,>+~:[/ ') == 0 ? "##{id}" : id
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
def jquery_ids(ids)
|
|
115
|
-
Array(ids).map{|id| jquery_id(id)}.join(',')
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
end
|
|
119
|
-
end
|
|
120
|
-
|
|
121
|
-
protected
|
|
122
|
-
def options_for_ajax(options)
|
|
123
|
-
js_options = build_callbacks(options)
|
|
124
|
-
|
|
125
|
-
url_options = options[:url]
|
|
126
|
-
url_options = url_options.merge(:escape => false) if url_options.is_a?(Hash)
|
|
127
|
-
js_options['url'] = "'#{url_for(url_options)}'"
|
|
128
|
-
js_options['async'] = false if options[:type] == :synchronous
|
|
129
|
-
js_options['type'] = options[:method] ? method_option_to_s(options[:method]) : ( options[:form] ? "'post'" : nil )
|
|
130
|
-
js_options['dataType'] = options[:datatype] ? "'#{options[:datatype]}'" : (options[:update] ? nil : "'script'")
|
|
131
|
-
|
|
132
|
-
if options[:form]
|
|
133
|
-
js_options['data'] = "#{JQUERY_VAR}.param(#{JQUERY_VAR}(this).serializeArray())"
|
|
134
|
-
elsif options[:submit]
|
|
135
|
-
js_options['data'] = "#{JQUERY_VAR}(\"##{options[:submit]} :input\").serialize()"
|
|
136
|
-
elsif options[:with]
|
|
137
|
-
js_options['data'] = options[:with].gsub("Form.serialize(this.form)","#{JQUERY_VAR}.param(#{JQUERY_VAR}(this.form).serializeArray())")
|
|
138
|
-
end
|
|
139
|
-
|
|
140
|
-
js_options['type'] ||= "'post'"
|
|
141
|
-
if options[:method]
|
|
142
|
-
if method_option_to_s(options[:method]) == "'put'" || method_option_to_s(options[:method]) == "'delete'"
|
|
143
|
-
js_options['type'] = "'post'"
|
|
144
|
-
if js_options['data']
|
|
145
|
-
js_options['data'] << " + '&"
|
|
146
|
-
else
|
|
147
|
-
js_options['data'] = "'"
|
|
148
|
-
end
|
|
149
|
-
js_options['data'] << "_method=#{options[:method]}'"
|
|
150
|
-
end
|
|
151
|
-
end
|
|
152
|
-
|
|
153
|
-
if USE_PROTECTION && respond_to?('protect_against_forgery?') && protect_against_forgery?
|
|
154
|
-
if js_options['data']
|
|
155
|
-
js_options['data'] << " + '&"
|
|
156
|
-
else
|
|
157
|
-
js_options['data'] = "'"
|
|
158
|
-
end
|
|
159
|
-
js_options['data'] << "#{request_forgery_protection_token}=' + encodeURIComponent('#{escape_javascript form_authenticity_token}')"
|
|
160
|
-
end
|
|
161
|
-
js_options['data'] = "''" if js_options['type'] == "'post'" && js_options['data'].nil?
|
|
162
|
-
options_for_javascript(js_options.reject {|key, value| value.nil?})
|
|
163
|
-
end
|
|
164
|
-
|
|
165
|
-
def build_update_for_success(html_id, insertion=nil)
|
|
166
|
-
insertion = build_insertion(insertion)
|
|
167
|
-
"#{JQUERY_VAR}('#{jquery_id(html_id)}').#{insertion}(request);"
|
|
168
|
-
end
|
|
169
|
-
|
|
170
|
-
def build_update_for_error(html_id, insertion=nil)
|
|
171
|
-
insertion = build_insertion(insertion)
|
|
172
|
-
"#{JQUERY_VAR}('#{jquery_id(html_id)}').#{insertion}(request.responseText);"
|
|
173
|
-
end
|
|
174
|
-
|
|
175
|
-
def build_insertion(insertion)
|
|
176
|
-
insertion = insertion ? insertion.to_s.downcase : 'html'
|
|
177
|
-
insertion = 'append' if insertion == 'bottom'
|
|
178
|
-
insertion = 'prepend' if insertion == 'top'
|
|
179
|
-
insertion
|
|
180
|
-
end
|
|
181
|
-
|
|
182
|
-
def build_observer(klass, name, options = {})
|
|
183
|
-
if options[:with] && (options[:with] !~ /[\{=(.]/)
|
|
184
|
-
options[:with] = "'#{options[:with]}=' + value"
|
|
185
|
-
else
|
|
186
|
-
options[:with] ||= 'value' unless options[:function]
|
|
187
|
-
end
|
|
188
|
-
|
|
189
|
-
callback = options[:function] || remote_function(options)
|
|
190
|
-
javascript = "#{JQUERY_VAR}('#{jquery_id(name)}').delayedObserver("
|
|
191
|
-
javascript << "#{options[:frequency] || 0}, "
|
|
192
|
-
javascript << "function(element, value) {"
|
|
193
|
-
javascript << "#{callback}}"
|
|
194
|
-
#javascript << ", '#{options[:on]}'" if options[:on]
|
|
195
|
-
javascript << ")"
|
|
196
|
-
javascript_tag(javascript)
|
|
197
|
-
end
|
|
198
|
-
|
|
199
|
-
def build_callbacks(options)
|
|
200
|
-
callbacks = {}
|
|
201
|
-
options[:beforeSend] = '';
|
|
202
|
-
[:uninitialized,:loading].each do |key|
|
|
203
|
-
options[:beforeSend] << (options[key].last == ';' ? options.delete(key) : options.delete(key) << ';') if options[key]
|
|
204
|
-
end
|
|
205
|
-
options.delete(:beforeSend) if options[:beforeSend].blank?
|
|
206
|
-
options[:complete] = options.delete(:loaded) if options[:loaded]
|
|
207
|
-
options[:error] = options.delete(:failure) if options[:failure]
|
|
208
|
-
if options[:update]
|
|
209
|
-
if options[:update].is_a?(Hash)
|
|
210
|
-
options[:update][:error] = options[:update].delete(:failure) if options[:update][:failure]
|
|
211
|
-
if options[:update][:success]
|
|
212
|
-
options[:success] = build_update_for_success(options[:update][:success], options[:position]) << (options[:success] ? options[:success] : '')
|
|
213
|
-
end
|
|
214
|
-
if options[:update][:error]
|
|
215
|
-
options[:error] = build_update_for_error(options[:update][:error], options[:position]) << (options[:error] ? options[:error] : '')
|
|
216
|
-
end
|
|
217
|
-
else
|
|
218
|
-
options[:success] = build_update_for_success(options[:update], options[:position]) << (options[:success] ? options[:success] : '')
|
|
219
|
-
end
|
|
220
|
-
end
|
|
221
|
-
options.each do |callback, code|
|
|
222
|
-
if JQCALLBACKS.include?(callback)
|
|
223
|
-
callbacks[callback] = "function(request){#{code}}"
|
|
224
|
-
end
|
|
225
|
-
end
|
|
226
|
-
callbacks
|
|
227
|
-
end
|
|
228
|
-
|
|
229
|
-
end
|
|
230
|
-
|
|
231
|
-
class JavaScriptElementProxy < JavaScriptProxy #:nodoc:
|
|
232
|
-
|
|
233
|
-
unless const_defined? :JQUERY_VAR
|
|
234
|
-
JQUERY_VAR = PrototypeHelper::JQUERY_VAR
|
|
235
|
-
end
|
|
236
|
-
|
|
237
|
-
def initialize(generator, id)
|
|
238
|
-
id = id.to_s.count('#.*,>+~:[/ ') == 0 ? "##{id}" : id
|
|
239
|
-
@id = id
|
|
240
|
-
super(generator, "#{JQUERY_VAR}(\"#{id}\")")
|
|
241
|
-
end
|
|
242
|
-
|
|
243
|
-
def replace_html(*options_for_render)
|
|
244
|
-
call 'html', @generator.send(:render, *options_for_render)
|
|
245
|
-
end
|
|
246
|
-
|
|
247
|
-
def replace(*options_for_render)
|
|
248
|
-
call 'replaceWith', @generator.send(:render, *options_for_render)
|
|
249
|
-
end
|
|
250
|
-
|
|
251
|
-
def reload(options_for_replace={})
|
|
252
|
-
replace(options_for_replace.merge({ :partial => @id.to_s.sub(/^#/,'') }))
|
|
253
|
-
end
|
|
254
|
-
|
|
255
|
-
def value()
|
|
256
|
-
call 'val()'
|
|
257
|
-
end
|
|
258
|
-
|
|
259
|
-
def value=(value)
|
|
260
|
-
call 'val', value
|
|
261
|
-
end
|
|
262
|
-
|
|
263
|
-
end
|
|
264
|
-
|
|
265
|
-
class JavaScriptElementCollectionProxy < JavaScriptCollectionProxy #:nodoc:\
|
|
266
|
-
|
|
267
|
-
unless const_defined? :JQUERY_VAR
|
|
268
|
-
JQUERY_VAR = PrototypeHelper::JQUERY_VAR
|
|
269
|
-
end
|
|
270
|
-
|
|
271
|
-
def initialize(generator, pattern)
|
|
272
|
-
super(generator, "#{JQUERY_VAR}(#{pattern.to_json})")
|
|
273
|
-
end
|
|
274
|
-
end
|
|
275
|
-
|
|
276
|
-
module ScriptaculousHelper
|
|
277
|
-
|
|
278
|
-
unless const_defined? :JQUERY_VAR
|
|
279
|
-
JQUERY_VAR = PrototypeHelper::JQUERY_VAR
|
|
280
|
-
end
|
|
281
|
-
|
|
282
|
-
unless const_defined? :SCRIPTACULOUS_EFFECTS
|
|
283
|
-
SCRIPTACULOUS_EFFECTS = {
|
|
284
|
-
:appear => {:method => 'fadeIn'},
|
|
285
|
-
:blind_down => {:method => 'blind', :mode => 'show', :options => {:direction => 'vertical'}},
|
|
286
|
-
:blind_up => {:method => 'blind', :mode => 'hide', :options => {:direction => 'vertical'}},
|
|
287
|
-
:blind_right => {:method => 'blind', :mode => 'show', :options => {:direction => 'horizontal'}},
|
|
288
|
-
:blind_left => {:method => 'blind', :mode => 'hide', :options => {:direction => 'horizontal'}},
|
|
289
|
-
:bounce_in => {:method => 'bounce', :mode => 'show', :options => {:direction => 'up'}},
|
|
290
|
-
:bounce_out => {:method => 'bounce', :mode => 'hide', :options => {:direction => 'up'}},
|
|
291
|
-
:drop_in => {:method => 'drop', :mode => 'show', :options => {:direction => 'up'}},
|
|
292
|
-
:drop_out => {:method => 'drop', :mode => 'hide', :options => {:direction => 'down'}},
|
|
293
|
-
:fade => {:method => 'fadeOut'},
|
|
294
|
-
:fold_in => {:method => 'fold', :mode => 'hide'},
|
|
295
|
-
:fold_out => {:method => 'fold', :mode => 'show'},
|
|
296
|
-
:grow => {:method => 'scale', :mode => 'show'},
|
|
297
|
-
:shrink => {:method => 'scale', :mode => 'hide'},
|
|
298
|
-
:slide_down => {:method => 'slide', :mode => 'show', :options => {:direction => 'up'}},
|
|
299
|
-
:slide_up => {:method => 'slide', :mode => 'hide', :options => {:direction => 'up'}},
|
|
300
|
-
:slide_right => {:method => 'slide', :mode => 'show', :options => {:direction => 'left'}},
|
|
301
|
-
:slide_left => {:method => 'slide', :mode => 'hide', :options => {:direction => 'left'}},
|
|
302
|
-
:squish => {:method => 'scale', :mode => 'hide', :options => {:origin => "['top','left']"}},
|
|
303
|
-
:switch_on => {:method => 'clip', :mode => 'show', :options => {:direction => 'vertical'}},
|
|
304
|
-
:switch_off => {:method => 'clip', :mode => 'hide', :options => {:direction => 'vertical'}},
|
|
305
|
-
:toggle_appear => {:method => 'fadeToggle'},
|
|
306
|
-
:toggle_slide => {:method => 'slide', :mode => 'toggle', :options => {:direction => 'up'}},
|
|
307
|
-
:toggle_blind => {:method => 'blind', :mode => 'toggle', :options => {:direction => 'vertical'}},
|
|
308
|
-
}
|
|
309
|
-
end
|
|
310
|
-
|
|
311
|
-
def visual_effect(name, element_id = false, js_options = {})
|
|
312
|
-
element = element_id ? element_id : "this"
|
|
313
|
-
|
|
314
|
-
if SCRIPTACULOUS_EFFECTS.has_key? name.to_sym
|
|
315
|
-
effect = SCRIPTACULOUS_EFFECTS[name.to_sym]
|
|
316
|
-
name = effect[:method]
|
|
317
|
-
mode = effect[:mode]
|
|
318
|
-
js_options = js_options.merge(effect[:options]) if effect[:options]
|
|
319
|
-
end
|
|
320
|
-
|
|
321
|
-
[:color, :direction, :startcolor, :endcolor].each do |option|
|
|
322
|
-
js_options[option] = "'#{js_options[option]}'" if js_options[option]
|
|
323
|
-
end
|
|
324
|
-
|
|
325
|
-
if js_options.has_key? :duration
|
|
326
|
-
speed = js_options.delete :duration
|
|
327
|
-
speed = (speed * 1000).to_i unless speed.nil?
|
|
328
|
-
else
|
|
329
|
-
speed = js_options.delete :speed
|
|
330
|
-
end
|
|
331
|
-
|
|
332
|
-
if ['fadeIn','fadeOut','fadeToggle'].include?(name)
|
|
333
|
-
javascript = "#{JQUERY_VAR}('#{jquery_id(element_id)}').#{name}("
|
|
334
|
-
javascript << "#{speed}" unless speed.nil?
|
|
335
|
-
javascript << ");"
|
|
336
|
-
else
|
|
337
|
-
javascript = "#{JQUERY_VAR}('#{jquery_id(element_id)}').#{mode || 'effect'}('#{name}'"
|
|
338
|
-
javascript << ",#{options_for_javascript(js_options)}" unless speed.nil? && js_options.empty?
|
|
339
|
-
javascript << ",#{speed}" unless speed.nil?
|
|
340
|
-
javascript << ");"
|
|
341
|
-
end
|
|
342
|
-
|
|
343
|
-
end
|
|
344
|
-
|
|
345
|
-
def sortable_element_js(element_id, options = {}) #:nodoc:
|
|
346
|
-
#convert similar attributes
|
|
347
|
-
options[:handle] = ".#{options[:handle]}" if options[:handle]
|
|
348
|
-
if options[:tag] || options[:only]
|
|
349
|
-
options[:items] = "> "
|
|
350
|
-
options[:items] << options.delete(:tag) if options[:tag]
|
|
351
|
-
options[:items] << ".#{options.delete(:only)}" if options[:only]
|
|
352
|
-
end
|
|
353
|
-
options[:connectWith] = options.delete(:containment).map {|x| "##{x}"} if options[:containment]
|
|
354
|
-
options[:containment] = options.delete(:container) if options[:container]
|
|
355
|
-
options[:dropOnEmpty] = false unless options[:dropOnEmpty]
|
|
356
|
-
options[:helper] = "'clone'" if options[:ghosting] == true
|
|
357
|
-
options[:axis] = case options.delete(:constraint)
|
|
358
|
-
when "vertical", :vertical
|
|
359
|
-
"y"
|
|
360
|
-
when "horizontal", :horizontal
|
|
361
|
-
"x"
|
|
362
|
-
when false
|
|
363
|
-
nil
|
|
364
|
-
when nil
|
|
365
|
-
"y"
|
|
366
|
-
end
|
|
367
|
-
options.delete(:axis) if options[:axis].nil?
|
|
368
|
-
options.delete(:overlap)
|
|
369
|
-
options.delete(:ghosting)
|
|
370
|
-
|
|
371
|
-
if options[:onUpdate] || options[:url]
|
|
372
|
-
if options[:format]
|
|
373
|
-
options[:with] ||= "#{JQUERY_VAR}(this).sortable('serialize',{key:'#{element_id}[]', expression:#{options[:format]}})"
|
|
374
|
-
options.delete(:format)
|
|
375
|
-
else
|
|
376
|
-
options[:with] ||= "#{JQUERY_VAR}(this).sortable('serialize',{key:'#{element_id}[]'})"
|
|
377
|
-
end
|
|
378
|
-
|
|
379
|
-
options[:onUpdate] ||= "function(){" + remote_function(options) + "}"
|
|
380
|
-
end
|
|
381
|
-
|
|
382
|
-
options.delete_if { |key, value| PrototypeHelper::AJAX_OPTIONS.include?(key) }
|
|
383
|
-
options[:update] = options.delete(:onUpdate) if options[:onUpdate]
|
|
384
|
-
|
|
385
|
-
[:axis, :cancel, :containment, :cursor, :handle, :tolerance, :items, :placeholder].each do |option|
|
|
386
|
-
options[option] = "'#{options[option]}'" if options[option]
|
|
387
|
-
end
|
|
388
|
-
|
|
389
|
-
options[:connectWith] = array_or_string_for_javascript(options[:connectWith]) if options[:connectWith]
|
|
390
|
-
|
|
391
|
-
%(#{JQUERY_VAR}('#{jquery_id(element_id)}').sortable(#{options_for_javascript(options)});)
|
|
392
|
-
end
|
|
393
|
-
|
|
394
|
-
def draggable_element_js(element_id, options = {})
|
|
395
|
-
%(#{JQUERY_VAR}("#{jquery_id(element_id)}").draggable(#{options_for_javascript(options)});)
|
|
396
|
-
end
|
|
397
|
-
|
|
398
|
-
def drop_receiving_element_js(element_id, options = {})
|
|
399
|
-
#convert similar options
|
|
400
|
-
options[:hoverClass] = options.delete(:hoverclass) if options[:hoverclass]
|
|
401
|
-
options[:drop] = options.delete(:onDrop) if options[:onDrop]
|
|
402
|
-
|
|
403
|
-
if options[:drop] || options[:url]
|
|
404
|
-
options[:with] ||= "'id=' + encodeURIComponent(#{JQUERY_VAR}(ui.draggable).attr('id'))"
|
|
405
|
-
options[:drop] ||= "function(ev, ui){" + remote_function(options) + "}"
|
|
406
|
-
end
|
|
407
|
-
|
|
408
|
-
options.delete_if { |key, value| PrototypeHelper::AJAX_OPTIONS.include?(key) }
|
|
409
|
-
|
|
410
|
-
options[:accept] = array_or_string_for_javascript(options[:accept]) if options[:accept]
|
|
411
|
-
[:activeClass, :hoverClass, :tolerance].each do |option|
|
|
412
|
-
options[option] = "'#{options[option]}'" if options[option]
|
|
413
|
-
end
|
|
414
|
-
|
|
415
|
-
%(#{JQUERY_VAR}('#{jquery_id(element_id)}').droppable(#{options_for_javascript(options)});)
|
|
416
|
-
end
|
|
417
|
-
|
|
418
|
-
end
|
|
419
|
-
|
|
420
|
-
end
|
|
421
|
-
end
|