fat_free_crm 0.13.2 → 0.13.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fat_free_crm might be problematic. Click here for more details.
- checksums.yaml +5 -13
- data/.travis.yml +3 -3
- data/Gemfile +5 -2
- data/Gemfile.lock +137 -119
- data/MIT-LICENSE +1 -1
- data/README.md +5 -3
- data/app/assets/javascripts/admin/fields.js.coffee +31 -8
- data/app/assets/javascripts/application.js.erb +6 -10
- data/app/assets/javascripts/crm.js.coffee +426 -0
- data/app/assets/javascripts/crm_chosen.js.coffee +19 -38
- data/app/assets/javascripts/crm_classes.js.coffee +215 -0
- data/app/assets/javascripts/crm_comments.js.coffee +20 -58
- data/app/assets/javascripts/crm_loginout.js.coffee +27 -0
- data/app/assets/javascripts/crm_select2.js.coffee +29 -0
- data/app/assets/javascripts/crm_sortable.js.coffee +32 -0
- data/app/assets/javascripts/crm_tags.js.coffee +22 -0
- data/app/assets/javascripts/crm_textarea_autocomplete.js.coffee +33 -0
- data/app/assets/javascripts/datepicker.js.coffee +2 -2
- data/app/assets/javascripts/format_buttons.js.coffee +23 -24
- data/app/assets/javascripts/lists.js.coffee +45 -76
- data/app/assets/javascripts/pagination.js.coffee +16 -0
- data/app/assets/javascripts/search.js.coffee +6 -22
- data/app/assets/javascripts/timeago.js.coffee +21 -0
- data/app/assets/stylesheets/application.css.erb +0 -1
- data/app/assets/stylesheets/common.scss +36 -29
- data/app/assets/stylesheets/lists.css.scss +17 -3
- data/app/controllers/admin/groups_controller.rb +2 -1
- data/app/controllers/application_controller.rb +5 -5
- data/app/controllers/entities/accounts_controller.rb +1 -1
- data/app/controllers/entities/campaigns_controller.rb +1 -1
- data/app/controllers/entities/contacts_controller.rb +1 -1
- data/app/controllers/entities/leads_controller.rb +1 -1
- data/app/controllers/entities/opportunities_controller.rb +1 -1
- data/app/controllers/home_controller.rb +10 -7
- data/app/controllers/tasks_controller.rb +15 -0
- data/app/controllers/users_controller.rb +6 -4
- data/app/helpers/accounts_helper.rb +8 -5
- data/app/helpers/application_helper.rb +53 -39
- data/app/helpers/campaigns_helper.rb +1 -0
- data/app/helpers/leads_helper.rb +3 -3
- data/app/helpers/opportunities_helper.rb +15 -0
- data/app/helpers/remote_link_pagination_helper.rb +8 -0
- data/app/helpers/tags_helper.rb +2 -2
- data/app/helpers/tasks_helper.rb +22 -15
- data/app/helpers/users_helper.rb +3 -2
- data/app/mailers/user_mailer.rb +9 -3
- data/app/models/entities/account_contact.rb +1 -1
- data/app/models/fields/custom_field.rb +1 -1
- data/app/models/list.rb +1 -0
- data/app/models/observers/entity_observer.rb +10 -1
- data/app/models/observers/lead_observer.rb +2 -0
- data/app/models/observers/opportunity_observer.rb +2 -0
- data/app/models/observers/task_observer.rb +2 -0
- data/app/models/polymorphic/avatar.rb +2 -0
- data/app/models/polymorphic/comment.rb +0 -1
- data/app/models/polymorphic/task.rb +41 -9
- data/app/models/users/ability.rb +1 -0
- data/app/models/users/group.rb +0 -5
- data/app/models/users/user.rb +0 -7
- data/app/views/accounts/_edit.html.haml +1 -0
- data/app/views/accounts/_index_brief.html.haml +2 -2
- data/app/views/accounts/_index_long.html.haml +2 -2
- data/app/views/accounts/_new.html.haml +1 -0
- data/app/views/accounts/_sidebar_index.html.haml +1 -1
- data/app/views/accounts/_sidebar_show.html.haml +1 -1
- data/app/views/accounts/_top_section.html.haml +1 -1
- data/app/views/accounts/create.js.haml +9 -9
- data/app/views/accounts/destroy.js.haml +2 -2
- data/app/views/accounts/edit.js.haml +5 -5
- data/app/views/accounts/index.js.haml +5 -5
- data/app/views/accounts/new.js.haml +1 -1
- data/app/views/accounts/show.html.haml +1 -1
- data/app/views/accounts/show.js.haml +1 -1
- data/app/views/accounts/update.js.haml +7 -5
- data/app/views/admin/field_groups/_field_group.html.haml +4 -5
- data/app/views/admin/field_groups/confirm.js.haml +2 -2
- data/app/views/admin/field_groups/create.js.haml +6 -12
- data/app/views/admin/field_groups/destroy.js.haml +3 -3
- data/app/views/admin/field_groups/edit.js.haml +1 -1
- data/app/views/admin/field_groups/new.js.haml +1 -1
- data/app/views/admin/field_groups/update.js.haml +2 -2
- data/app/views/admin/fields/_field.html.haml +1 -1
- data/app/views/admin/fields/_sort_by.html.haml +3 -3
- data/app/views/admin/fields/create.js.haml +9 -9
- data/app/views/admin/fields/destroy.js.haml +4 -4
- data/app/views/admin/fields/edit.js.haml +2 -2
- data/app/views/admin/fields/index.html.haml +1 -8
- data/app/views/admin/fields/show.html.haml +1 -1
- data/app/views/admin/fields/update.js.haml +8 -8
- data/app/views/admin/groups/_form.html.haml +1 -3
- data/app/views/admin/groups/create.js.haml +8 -8
- data/app/views/admin/groups/destroy.js.haml +3 -3
- data/app/views/admin/groups/edit.js.haml +3 -3
- data/app/views/admin/groups/index.js.haml +2 -2
- data/app/views/admin/groups/new.js.haml +2 -2
- data/app/views/admin/groups/update.js.haml +5 -5
- data/app/views/admin/tags/confirm.js.haml +2 -2
- data/app/views/admin/tags/create.js.haml +8 -8
- data/app/views/admin/tags/destroy.js.haml +3 -3
- data/app/views/admin/tags/edit.js.haml +4 -4
- data/app/views/admin/tags/new.js.haml +1 -1
- data/app/views/admin/tags/update.js.haml +5 -5
- data/app/views/admin/users/_profile.html.haml +3 -4
- data/app/views/admin/users/confirm.js.haml +2 -2
- data/app/views/admin/users/create.js.haml +8 -8
- data/app/views/admin/users/destroy.js.haml +3 -3
- data/app/views/admin/users/edit.js.haml +4 -4
- data/app/views/admin/users/index.js.haml +2 -2
- data/app/views/admin/users/new.js.haml +2 -2
- data/app/views/admin/users/reactivate.js.haml +2 -2
- data/app/views/admin/users/suspend.js.haml +2 -2
- data/app/views/admin/users/update.js.haml +5 -5
- data/app/views/campaigns/_edit.html.haml +1 -0
- data/app/views/campaigns/_index_brief.html.haml +1 -1
- data/app/views/campaigns/_index_long.html.haml +1 -1
- data/app/views/campaigns/_new.html.haml +1 -0
- data/app/views/campaigns/_sidebar_index.html.haml +1 -1
- data/app/views/campaigns/_sidebar_show.html.haml +1 -1
- data/app/views/campaigns/_status.html.haml +1 -1
- data/app/views/campaigns/_top_section.html.haml +1 -1
- data/app/views/campaigns/create.js.haml +10 -10
- data/app/views/campaigns/destroy.js.haml +2 -2
- data/app/views/campaigns/edit.js.haml +6 -6
- data/app/views/campaigns/index.js.haml +5 -5
- data/app/views/campaigns/new.js.haml +1 -1
- data/app/views/campaigns/show.html.haml +1 -1
- data/app/views/campaigns/show.js.haml +1 -1
- data/app/views/campaigns/update.js.haml +8 -6
- data/app/views/comments/_edit.html.haml +1 -1
- data/app/views/comments/_new.html.haml +1 -1
- data/app/views/comments/create.js.haml +9 -9
- data/app/views/comments/destroy.js.haml +2 -2
- data/app/views/comments/edit.js.haml +3 -3
- data/app/views/comments/update.js.haml +5 -5
- data/app/views/contacts/_contacts.html.haml +1 -1
- data/app/views/contacts/_edit.html.haml +1 -0
- data/app/views/contacts/_index_brief.html.haml +2 -2
- data/app/views/contacts/_index_full.html.haml +2 -2
- data/app/views/contacts/_index_long.html.haml +2 -2
- data/app/views/contacts/_new.html.haml +1 -0
- data/app/views/contacts/_section_general.html.haml +4 -3
- data/app/views/contacts/_sidebar_show.html.haml +1 -1
- data/app/views/contacts/_top_section.html.haml +1 -1
- data/app/views/contacts/create.js.haml +10 -10
- data/app/views/contacts/destroy.js.haml +3 -3
- data/app/views/contacts/edit.js.haml +5 -5
- data/app/views/contacts/index.js.haml +5 -5
- data/app/views/contacts/new.js.haml +1 -1
- data/app/views/contacts/show.html.haml +1 -1
- data/app/views/contacts/show.js.haml +1 -1
- data/app/views/contacts/update.js.haml +8 -6
- data/app/views/emails/destroy.js.haml +2 -2
- data/app/views/entities/_basic_search.html.haml +15 -12
- data/app/views/entities/_permissions.html.haml +6 -11
- data/app/views/entities/attach.js.haml +3 -3
- data/app/views/entities/contacts.js.haml +2 -2
- data/app/views/entities/discard.js.haml +1 -1
- data/app/views/entities/leads.js.haml +2 -2
- data/app/views/entities/opportunities.js.haml +2 -2
- data/app/views/entities/subscription_update.js.haml +1 -1
- data/app/views/entities/versions.js.haml +2 -2
- data/app/views/fields/group.js.erb +1 -1
- data/app/views/home/_account.html.haml +2 -2
- data/app/views/home/_assets_menu.html.haml +3 -3
- data/app/views/home/_duration_menu.html.haml +3 -3
- data/app/views/home/_events_menu.html.haml +3 -3
- data/app/views/home/_opportunity.html.haml +2 -2
- data/app/views/home/_options.html.haml +0 -1
- data/app/views/home/_users_menu.html.haml +3 -3
- data/app/views/home/index.js.haml +4 -4
- data/app/views/home/options.js.haml +1 -1
- data/app/views/layouts/_about.html.haml +3 -3
- data/app/views/layouts/_footer.html.haml +1 -1
- data/app/views/layouts/_header.html.haml +1 -1
- data/app/views/layouts/_jumpbox.html.haml +23 -21
- data/app/views/layouts/_sidebar.html.haml +1 -2
- data/app/views/layouts/admin/application.html.haml +1 -1
- data/app/views/layouts/application.html.haml +3 -3
- data/app/views/leads/_convert.html.haml +1 -11
- data/app/views/leads/_convert_permissions.html.haml +4 -9
- data/app/views/leads/_edit.html.haml +1 -0
- data/app/views/leads/_index_brief.html.haml +1 -1
- data/app/views/leads/_index_long.html.haml +1 -1
- data/app/views/leads/_leads.html.haml +1 -1
- data/app/views/leads/_new.html.haml +1 -0
- data/app/views/leads/_sidebar_index.html.haml +1 -1
- data/app/views/leads/_sidebar_show.html.haml +1 -1
- data/app/views/leads/_top_section.html.haml +1 -1
- data/app/views/leads/convert.js.haml +5 -5
- data/app/views/leads/create.js.haml +9 -9
- data/app/views/leads/destroy.js.haml +2 -2
- data/app/views/leads/edit.js.haml +5 -5
- data/app/views/leads/index.js.haml +5 -5
- data/app/views/leads/new.js.haml +1 -1
- data/app/views/leads/promote.js.haml +7 -7
- data/app/views/leads/reject.js.haml +2 -2
- data/app/views/leads/show.html.haml +1 -1
- data/app/views/leads/show.js.haml +1 -1
- data/app/views/leads/update.js.haml +9 -7
- data/app/views/lists/_lists.html.haml +6 -0
- data/app/views/lists/_sidebar.html.haml +18 -17
- data/app/views/lists/create.js.haml +6 -7
- data/app/views/lists/destroy.js.haml +1 -1
- data/app/views/opportunities/_edit.html.haml +2 -1
- data/app/views/opportunities/_index_brief.html.haml +1 -1
- data/app/views/opportunities/_index_long.html.haml +1 -1
- data/app/views/opportunities/_new.html.haml +2 -1
- data/app/views/opportunities/_opportunities.html.haml +1 -1
- data/app/views/opportunities/_sidebar_index.html.haml +1 -1
- data/app/views/opportunities/_sidebar_show.html.haml +1 -1
- data/app/views/opportunities/_top_section.html.haml +2 -2
- data/app/views/opportunities/contacts.js.haml +2 -2
- data/app/views/opportunities/create.js.haml +10 -10
- data/app/views/opportunities/destroy.js.haml +3 -3
- data/app/views/opportunities/edit.js.haml +5 -5
- data/app/views/opportunities/index.html.haml +1 -1
- data/app/views/opportunities/index.js.haml +5 -5
- data/app/views/opportunities/new.js.haml +1 -1
- data/app/views/opportunities/show.html.haml +1 -1
- data/app/views/opportunities/show.js.haml +1 -1
- data/app/views/opportunities/update.js.haml +8 -6
- data/app/views/shared/_address.html.haml +1 -1
- data/app/views/shared/_inline_styles.html.haml +1 -1
- data/app/views/shared/_naming.html.haml +3 -3
- data/app/views/shared/_paginate.haml +2 -1
- data/app/views/shared/_paginate_with_per_page.html.haml +10 -12
- data/app/views/shared/_search.html.haml +7 -3
- data/app/views/shared/_select_popup.html.haml +9 -11
- data/app/views/shared/_tags.html.haml +5 -4
- data/app/views/tasks/_completed.html.haml +3 -1
- data/app/views/tasks/_selector.html.haml +1 -1
- data/app/views/tasks/_top_section.html.haml +1 -1
- data/app/views/tasks/complete.js.haml +7 -7
- data/app/views/tasks/create.js.haml +17 -17
- data/app/views/tasks/destroy.js.haml +2 -2
- data/app/views/tasks/discard.js.haml +1 -1
- data/app/views/tasks/edit.js.haml +4 -4
- data/app/views/tasks/filter.js.haml +2 -2
- data/app/views/tasks/new.js.haml +1 -1
- data/app/views/tasks/uncomplete.js.haml +12 -0
- data/app/views/tasks/update.js.haml +4 -4
- data/app/views/users/_avatar.html.haml +1 -1
- data/app/views/users/_languages.html.haml +3 -3
- data/app/views/users/_profile.html.haml +1 -1
- data/app/views/users/avatar.js.haml +1 -1
- data/app/views/users/change_password.js.haml +5 -5
- data/app/views/users/edit.js.haml +1 -1
- data/app/views/users/password.js.haml +2 -2
- data/app/views/users/show.html.haml +1 -1
- data/app/views/users/update.js.haml +5 -5
- data/app/views/users/upload_avatar.js.haml +3 -3
- data/app/views/versions/_versions.html.haml +1 -1
- data/config/application.rb +3 -0
- data/config/environments/production.rb +1 -1
- data/config/environments/staging.rb +58 -13
- data/config/initializers/locale.rb +2 -0
- data/config/locales/cz_fat_free_crm.yml +1 -0
- data/config/locales/de_fat_free_crm.yml +1 -0
- data/config/locales/en-GB_fat_free_crm.yml +1 -0
- data/config/locales/en-US_fat_free_crm.yml +2 -0
- data/config/locales/es_fat_free_crm.yml +1 -0
- data/config/locales/fr-CA_fat_free_crm.yml +1 -0
- data/config/locales/fr_fat_free_crm.yml +1 -0
- data/config/locales/it_fat_free_crm.yml +1 -0
- data/config/locales/ja_fat_free_crm.yml +1 -0
- data/config/locales/pl_fat_free_crm.yml +1 -0
- data/config/locales/pt-BR_fat_free_crm.yml +1 -0
- data/config/locales/ru_fat_free_crm.yml +444 -61
- data/config/locales/sv-SE_fat_free_crm.yml +1 -0
- data/config/locales/th_fat_free_crm.yml +1 -0
- data/config/locales/zh-CN_fat_free_crm.yml +1 -0
- data/config/routes.rb +20 -19
- data/config/settings.default.yml +11 -10
- data/fat_free_crm.gemspec +5 -4
- data/lib/{plugins/country_select/lib/country_select.rb → country_select.rb} +0 -0
- data/lib/fat_free_crm.rb +3 -1
- data/lib/fat_free_crm/engine.rb +2 -4
- data/lib/fat_free_crm/gem_dependencies.rb +1 -1
- data/lib/fat_free_crm/gem_ext.rb +0 -2
- data/lib/fat_free_crm/permissions.rb +2 -3
- data/lib/fat_free_crm/version.rb +1 -1
- data/lib/{plugins/gravatar_image_tag/lib/gravatar_image_tag.rb → gravatar_image_tag.rb} +0 -0
- data/lib/tasks/ffcrm/settings.rake +4 -16
- data/public/favicon.ico +0 -0
- data/spec/controllers/entities/accounts_controller_spec.rb +5 -5
- data/spec/controllers/entities/campaigns_controller_spec.rb +5 -5
- data/spec/controllers/entities/contacts_controller_spec.rb +42 -5
- data/spec/controllers/entities/leads_controller_spec.rb +7 -7
- data/spec/controllers/entities/opportunities_controller_spec.rb +5 -5
- data/spec/controllers/home_controller_spec.rb +3 -3
- data/spec/controllers/tasks_controller_spec.rb +29 -0
- data/spec/factories/shared_factories.rb +1 -3
- data/spec/features/support/selector_helpers.rb +4 -4
- data/spec/helpers/tasks_helper_spec.rb +10 -5
- data/spec/lib/permissions_spec.rb +10 -22
- data/spec/mailers/user_mailer_spec.rb +5 -4
- data/spec/models/observers/entity_observer_spec.rb +13 -8
- data/spec/models/polymorphic/task_spec.rb +111 -32
- data/spec/routing/accounts_routing_spec.rb +1 -1
- data/spec/routing/campaigns_routing_spec.rb +1 -1
- data/spec/routing/contacts_routing_spec.rb +1 -1
- data/spec/routing/leads_routing_spec.rb +1 -1
- data/spec/routing/opportunities_routing_spec.rb +1 -1
- data/spec/shared/controllers.rb +2 -2
- data/spec/spec_helper.rb +1 -0
- data/spec/views/accounts/create.js.haml_spec.rb +3 -3
- data/spec/views/accounts/index.js.haml_spec.rb +4 -4
- data/spec/views/accounts/update.js.haml_spec.rb +5 -5
- data/spec/views/admin/field_groups/create.js.haml_spec.rb +2 -2
- data/spec/views/admin/field_groups/edit.js.haml_spec.rb +1 -1
- data/spec/views/admin/field_groups/new.js.haml_spec.rb +1 -1
- data/spec/views/admin/field_groups/update.js.haml_spec.rb +1 -1
- data/spec/views/admin/users/create.js.haml_spec.rb +2 -2
- data/spec/views/admin/users/destroy.js.haml_spec.rb +1 -1
- data/spec/views/admin/users/edit.js.haml_spec.rb +1 -1
- data/spec/views/admin/users/index.js.haml_spec.rb +1 -1
- data/spec/views/admin/users/new.js.haml_spec.rb +1 -1
- data/spec/views/admin/users/reactivate.js.haml_spec.rb +1 -1
- data/spec/views/admin/users/suspend.js.haml_spec.rb +1 -1
- data/spec/views/admin/users/update.js.haml_spec.rb +3 -3
- data/spec/views/campaigns/create.js.haml_spec.rb +4 -4
- data/spec/views/campaigns/destroy.js.haml_spec.rb +1 -1
- data/spec/views/campaigns/edit.js.haml_spec.rb +4 -4
- data/spec/views/campaigns/index.js.haml_spec.rb +2 -2
- data/spec/views/campaigns/new.js.haml_spec.rb +1 -1
- data/spec/views/campaigns/update.js.haml_spec.rb +7 -7
- data/spec/views/contacts/create.js.haml_spec.rb +4 -4
- data/spec/views/contacts/edit.js.haml_spec.rb +4 -4
- data/spec/views/contacts/index.js.html_spec.rb +2 -2
- data/spec/views/contacts/new.js.haml_spec.rb +2 -2
- data/spec/views/contacts/update.js.haml_spec.rb +11 -11
- data/spec/views/home/index.js.haml_spec.rb +1 -1
- data/spec/views/home/options.js.haml_spec.rb +3 -3
- data/spec/views/leads/convert.js.haml_spec.rb +3 -3
- data/spec/views/leads/create.js.haml_spec.rb +5 -5
- data/spec/views/leads/destroy.js.haml_spec.rb +1 -1
- data/spec/views/leads/edit.js.haml_spec.rb +4 -4
- data/spec/views/leads/index.js.haml_spec.rb +2 -2
- data/spec/views/leads/new.js.haml_spec.rb +1 -1
- data/spec/views/leads/promote.js.haml_spec.rb +13 -13
- data/spec/views/leads/reject.js.haml_spec.rb +6 -6
- data/spec/views/leads/update.js.haml_spec.rb +11 -11
- data/spec/views/opportunities/create.js.haml_spec.rb +4 -4
- data/spec/views/opportunities/destroy.js.haml_spec.rb +1 -1
- data/spec/views/opportunities/edit.js.haml_spec.rb +4 -4
- data/spec/views/opportunities/index.js.haml_spec.rb +2 -2
- data/spec/views/opportunities/update.js.haml_spec.rb +11 -11
- data/spec/views/tasks/complete.js.haml_spec.rb +5 -5
- data/spec/views/tasks/create.js.haml_spec.rb +13 -13
- data/spec/views/tasks/destroy.js.haml_spec.rb +3 -3
- data/spec/views/tasks/edit.js.haml_spec.rb +4 -4
- data/spec/views/tasks/new.js.haml_spec.rb +2 -2
- data/spec/views/tasks/uncomplete.js.haml_spec.rb +44 -0
- data/spec/views/tasks/update.js.haml_spec.rb +17 -17
- data/spec/views/users/avatar.js.haml_spec.rb +1 -1
- data/spec/views/users/change_password.js.haml_spec.rb +4 -4
- data/spec/views/users/edit.js.haml_spec.rb +1 -1
- data/spec/views/users/password.js.haml_spec.rb +2 -2
- data/spec/views/users/update.js.haml_spec.rb +5 -5
- data/spec/views/users/upload_avatar.js.haml_spec.rb +2 -2
- data/vendor/assets/javascripts/ajax-chosen.jquery.coffee +166 -76
- data/vendor/assets/javascripts/chosen.jquery.coffee +2 -2
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-pt-BR.js +22 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/{jquery-ui-timepicker-sv.js → jquery-ui-timepicker-sv-SE.js} +0 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-th.js +19 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery.ui.datepicker-fr-CA.js +21 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery.ui.datepicker-pt.js +21 -0
- data/vendor/assets/javascripts/rating.js +2 -2
- metadata +101 -122
- data/app/assets/images/facebook-close.gif +0 -0
- data/app/assets/javascripts/crm.js +0 -495
- data/app/assets/javascripts/crm_classes.js +0 -218
- data/app/assets/javascripts/crm_fields.js +0 -34
- data/app/assets/javascripts/crm_loginout.js +0 -29
- data/app/assets/javascripts/crm_textarea_autocomplete.js +0 -32
- data/app/assets/javascripts/groups.js.coffee +0 -8
- data/app/assets/javascripts/jquery-noconflict.js +0 -6
- data/app/assets/javascripts/timeago.js +0 -17
- data/app/views/lists/_personal_sidebar.html.haml +0 -28
- data/lib/fat_free_crm/gem_ext/active_model/serializers/xml/serializer/attribute.rb +0 -17
- data/lib/fat_free_crm/gem_ext/authlogic/session/cookies.rb +0 -16
- data/lib/fat_free_crm/plugin_dependencies.rb +0 -12
- data/lib/plugins/country_select/MIT-LICENSE +0 -20
- data/lib/plugins/country_select/README +0 -14
- data/lib/plugins/country_select/init.rb +0 -1
- data/lib/plugins/country_select/install.rb +0 -2
- data/lib/plugins/country_select/uninstall.rb +0 -2
- data/lib/plugins/gravatar_image_tag/Gemfile +0 -8
- data/lib/plugins/gravatar_image_tag/README.textile +0 -108
- data/lib/plugins/gravatar_image_tag/ROADMAP.textile +0 -33
- data/lib/plugins/gravatar_image_tag/Rakefile +0 -50
- data/lib/plugins/gravatar_image_tag/VERSION +0 -1
- data/lib/plugins/gravatar_image_tag/gravatar_image_tag.gemspec +0 -45
- data/lib/plugins/gravatar_image_tag/init.rb +0 -2
- data/lib/plugins/gravatar_image_tag/spec/gravatar_image_tag_spec.rb +0 -83
- data/lib/plugins/gravatar_image_tag/spec/test_helper.rb +0 -12
- data/lib/tasks/db/migrate.rake +0 -66
- data/lib/tasks/db/schema.rake +0 -20
- data/vendor/assets/javascripts/ajax-chosen-prototype.js +0 -2
- data/vendor/assets/javascripts/ajax-chosen.proto.coffee +0 -98
- data/vendor/assets/javascripts/chosen-prototype.js +0 -3
- data/vendor/assets/javascripts/chosen.proto.coffee +0 -580
- data/vendor/assets/javascripts/event.simulate.js +0 -64
- data/vendor/assets/javascripts/facebooklist.js +0 -548
- data/vendor/assets/javascripts/facebooklist.simulate.js +0 -28
- data/vendor/assets/javascripts/modalbox.js +0 -506
- data/vendor/assets/stylesheets/facebooklist.css +0 -47
@@ -1,28 +0,0 @@
|
|
1
|
-
// Allows simulation of the 'separator' key-press.
|
2
|
-
// (Painfully difficult to do in Prototype.)
|
3
|
-
|
4
|
-
FacebookList.prototype.fireSeparatorEvent = function() {
|
5
|
-
// focus the .maininput li element. This sets the fbtaglist.current variable.
|
6
|
-
fbtaglist.focus($$('.bit-input.maininput').first());
|
7
|
-
var splitOn = this.options.get('separator').value;
|
8
|
-
if(this.options.get('newValues')) {
|
9
|
-
new_value_el = this.current.retrieveData('input');
|
10
|
-
if (!new_value_el.value.endsWith('<')) {
|
11
|
-
keep_input = "";
|
12
|
-
if (new_value_el.value.indexOf(splitOn) < (new_value_el.value.length - splitOn.length)){
|
13
|
-
separator_pos = new_value_el.value.indexOf(splitOn);
|
14
|
-
keep_input = new_value_el.value.substr(separator_pos + 1);
|
15
|
-
new_value_el.value = new_value_el.value.substr(0,separator_pos).escapeHTML().strip();
|
16
|
-
} else {
|
17
|
-
new_value_el.value = new_value_el.value.gsub(splitOn,"").escapeHTML().strip();
|
18
|
-
}
|
19
|
-
if(!this.options.get("spaceReplace").blank()) new_value_el.value.gsub(" ", this.options.get("spaceReplace"));
|
20
|
-
if(!new_value_el.value.blank()) {
|
21
|
-
this.newvalue = true;
|
22
|
-
this.current_input = keep_input.escapeHTML().strip();
|
23
|
-
this.autoAdd(new_value_el);
|
24
|
-
this.update();
|
25
|
-
}
|
26
|
-
}
|
27
|
-
};
|
28
|
-
};
|
@@ -1,506 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
ModalBox - The pop-up window thingie with AJAX, based on prototype and script.aculo.us.
|
3
|
-
|
4
|
-
Copyright Andrey Okonetchnikov (andrej.okonetschnikow@gmail.com), 2006-2007
|
5
|
-
All rights reserved.
|
6
|
-
|
7
|
-
VERSION 1.6.1
|
8
|
-
Last Modified: 01/11/2010
|
9
|
-
*/
|
10
|
-
|
11
|
-
if (Object.isUndefined(Prototype.Browser.IE6)) {
|
12
|
-
Prototype.Browser.IE6 = (navigator.appName.indexOf("Microsoft Internet Explorer") != -1 && navigator.appVersion.indexOf("MSIE 6.0") != -1 && !window.XMLHttpRequest);
|
13
|
-
}
|
14
|
-
|
15
|
-
if (!window.Modalbox)
|
16
|
-
var Modalbox = {};
|
17
|
-
|
18
|
-
Modalbox.Methods = {
|
19
|
-
overrideAlert: false, // Override standard browser alert message with ModalBox
|
20
|
-
focusableElements: [],
|
21
|
-
currFocused: 0,
|
22
|
-
initialized: false, // Modalbox is visible
|
23
|
-
active: true, // Modalbox is visible and active
|
24
|
-
options: {
|
25
|
-
title: "ModalBox Window", // Title of the ModalBox window
|
26
|
-
overlayClose: true, // Close modal box by clicking on overlay
|
27
|
-
width: 500, // Default width in px
|
28
|
-
height: 90, // Default height in px
|
29
|
-
overlayOpacity: 0.5, // Default overlay opacity
|
30
|
-
overlayDuration: 0.1, // Default overlay fade in/out duration in seconds
|
31
|
-
slideDownDuration: 0.25, // Default Modalbox appear slide down effect in seconds
|
32
|
-
slideUpDuration: 0.25, // Default Modalbox hiding slide up effect in seconds
|
33
|
-
resizeDuration: 0.1, // Default resize duration seconds
|
34
|
-
inactiveFade: true, // Fades MB window on inactive state
|
35
|
-
transitions: true, // Toggles transition effects. Transitions are enabled by default
|
36
|
-
loadingString: "Please wait. Loading...", // Default loading string message
|
37
|
-
closeString: "Close window", // Default title attribute for close window link
|
38
|
-
closeValue: "×", // Default string for close link in the header
|
39
|
-
params: {},
|
40
|
-
method: "get", // Default Ajax request method
|
41
|
-
autoFocusing: true, // Toggles auto-focusing for form elements. Disable for long text pages.
|
42
|
-
aspnet: false // Should be true when using with ASP.NET controls. When true Modalbox window will be injected into the first form element.
|
43
|
-
},
|
44
|
-
_options: {},
|
45
|
-
|
46
|
-
setOptions: function(options) {
|
47
|
-
Object.extend(this.options, options || {});
|
48
|
-
},
|
49
|
-
|
50
|
-
_init: function(options) {
|
51
|
-
// Setting up original options with default options
|
52
|
-
Object.extend(this._options, this.options);
|
53
|
-
this.setOptions(options);
|
54
|
-
|
55
|
-
// Creating the overlay
|
56
|
-
this.MBoverlay = new Element("div", {id: "MB_overlay", style: "opacity: 0"});
|
57
|
-
|
58
|
-
// Creating the modal window
|
59
|
-
this.MBwindow = new Element("div", {id: "MB_window", style: "display: none"}).update(
|
60
|
-
this.MBframe = new Element("div", {id: "MB_frame"}).update(
|
61
|
-
this.MBheader = new Element("div", {id: "MB_header"}).update(
|
62
|
-
this.MBcaption = new Element("div", {id: "MB_caption"})
|
63
|
-
)
|
64
|
-
)
|
65
|
-
);
|
66
|
-
this.MBclose = new Element("a", {id: "MB_close", title: this.options.closeString, href: "#"}).update("<span>" + this.options.closeValue + "</span>");
|
67
|
-
this.MBheader.insert({'bottom':this.MBclose});
|
68
|
-
|
69
|
-
this.MBcontent = new Element("div", {id: "MB_content"}).update(
|
70
|
-
this.MBloading = new Element("div", {id: "MB_loading"}).update(this.options.loadingString)
|
71
|
-
);
|
72
|
-
this.MBframe.insert({'bottom':this.MBcontent});
|
73
|
-
|
74
|
-
// Inserting into DOM. If parameter set and form element have been found will inject into it. Otherwise will inject into body as topmost element.
|
75
|
-
// Be sure to set padding and marging to null via CSS for both body and (in case of asp.net) form elements.
|
76
|
-
var injectToEl = this.options.aspnet ? $(document.body).down('form') : $(document.body);
|
77
|
-
injectToEl.insert({'top':this.MBwindow});
|
78
|
-
injectToEl.insert({'top':this.MBoverlay});
|
79
|
-
|
80
|
-
// Initial scrolling position of the window. To be used for remove scrolling effect during ModalBox appearing
|
81
|
-
this.initScrollX = window.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft;
|
82
|
-
this.initScrollY = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
|
83
|
-
|
84
|
-
//Adding event observers
|
85
|
-
this.hideObserver = this._hide.bindAsEventListener(this);
|
86
|
-
this.kbdObserver = this._kbdHandler.bindAsEventListener(this);
|
87
|
-
this.resizeObserver = this._setWidthAndPosition.bindAsEventListener(this);
|
88
|
-
this._initObservers();
|
89
|
-
|
90
|
-
this.initialized = true; // Mark as initialized
|
91
|
-
},
|
92
|
-
|
93
|
-
show: function(content, options) {
|
94
|
-
if (!this.initialized) this._init(options); // Check if MB is already initialized
|
95
|
-
|
96
|
-
this.content = content;
|
97
|
-
this.setOptions(options);
|
98
|
-
|
99
|
-
if (this.options.title) { // Updating title of the MB
|
100
|
-
this.MBcaption.update(this.options.title);
|
101
|
-
} else { // If title isn't given, the header will not displayed
|
102
|
-
this.MBheader.hide();
|
103
|
-
this.MBcaption.hide();
|
104
|
-
}
|
105
|
-
|
106
|
-
if (this.MBwindow.style.display == "none") { // First MB appearing
|
107
|
-
this._appear();
|
108
|
-
this.event("onShow"); // Passing onShow callback
|
109
|
-
} else { // If MB already on the screen, update it
|
110
|
-
this._update();
|
111
|
-
this.event("onUpdate"); // Passing onUpdate callback
|
112
|
-
}
|
113
|
-
},
|
114
|
-
|
115
|
-
hide: function(options) { // External hide method to use from external HTML and JS
|
116
|
-
if(this.initialized) {
|
117
|
-
// Reading for options/callbacks except if event given as a parameter
|
118
|
-
if (options && !Object.isFunction(options.element))
|
119
|
-
Object.extend(this.options, options);
|
120
|
-
this.event("beforeHide"); // Passing beforeHide callback
|
121
|
-
if (this.options.transitions) {
|
122
|
-
Effect.SlideUp(this.MBwindow, { duration: this.options.slideUpDuration, transition: Effect.Transitions.sinoidal, afterFinish: this._deinit.bind(this) });
|
123
|
-
} else {
|
124
|
-
this.MBwindow.hide();
|
125
|
-
this._deinit();
|
126
|
-
}
|
127
|
-
} else {
|
128
|
-
throw("Modalbox is not initialized.");
|
129
|
-
}
|
130
|
-
},
|
131
|
-
|
132
|
-
_hide: function(event) { // Internal hide method to use with overlay and close link
|
133
|
-
event.stop(); // Stop event propagation for link elements
|
134
|
-
// When clicked on overlay we'll check the option and in case of overlayClose == false we'll break hiding execution [Fix for #139]
|
135
|
-
if (event.element().id == 'MB_overlay' && !this.options.overlayClose) return false;
|
136
|
-
this.hide();
|
137
|
-
},
|
138
|
-
|
139
|
-
alert: function(message){
|
140
|
-
var html = '<div class="MB_alert"><p>' + message + '</p><input type="button" onclick="Modalbox.hide()" value="OK" /></div>';
|
141
|
-
Modalbox.show(html, {title: 'Alert: ' + document.title, width: 300});
|
142
|
-
},
|
143
|
-
|
144
|
-
_appear: function() { // First appearing of MB
|
145
|
-
if (Prototype.Browser.IE6) { // Preparing IE 6 for showing modalbox
|
146
|
-
window.scrollTo(0,0);
|
147
|
-
this._prepareIEHtml("100%", "hidden");
|
148
|
-
this._prepareIESelects("hidden");
|
149
|
-
}
|
150
|
-
this._setSize();
|
151
|
-
this._setPosition();
|
152
|
-
if(this.options.transitions) {
|
153
|
-
this.MBoverlay.setOpacity(0);
|
154
|
-
new Effect.Fade(this.MBoverlay, {
|
155
|
-
from: 0,
|
156
|
-
to: this.options.overlayOpacity,
|
157
|
-
duration: this.options.overlayDuration,
|
158
|
-
afterFinish: (function() {
|
159
|
-
new Effect.SlideDown(this.MBwindow, {
|
160
|
-
duration: this.options.slideDownDuration,
|
161
|
-
transition: Effect.Transitions.sinoidal,
|
162
|
-
afterFinish: (function() {
|
163
|
-
this._setPosition();
|
164
|
-
this.loadContent();
|
165
|
-
}).bind(this)
|
166
|
-
});
|
167
|
-
}).bind(this)
|
168
|
-
});
|
169
|
-
} else {
|
170
|
-
this.MBoverlay.setOpacity(this.options.overlayOpacity);
|
171
|
-
this.MBwindow.show();
|
172
|
-
this._setPosition();
|
173
|
-
this.loadContent();
|
174
|
-
}
|
175
|
-
Event.observe(window, "resize", this.resizeObserver);
|
176
|
-
},
|
177
|
-
|
178
|
-
_update: function() { // Updating MB in case of wizards
|
179
|
-
this.MBcontent.update($(this.MBloading).update(this.options.loadingString));
|
180
|
-
this.loadContent();
|
181
|
-
},
|
182
|
-
|
183
|
-
resizeTo: function(newWidth, newHeight, options) { // Change size of MB without content reloading
|
184
|
-
var o = this.MBoverlay.getDimensions();
|
185
|
-
var newStyle = {width: newWidth + "px", height: newHeight + "px", left: (o.width - newWidth)/2 + "px"};
|
186
|
-
this.options.width = newWidth;
|
187
|
-
if (options) this.setOptions(options); // Passing callbacks
|
188
|
-
if (this.options.transitions) {
|
189
|
-
new Effect.Morph(this.MBwindow, {
|
190
|
-
style: newStyle,
|
191
|
-
duration: this.options.resizeDuration,
|
192
|
-
beforeStart: function(fx){
|
193
|
-
fx.element.setStyle({overflow: "hidden"}); // Fix for MSIE 6 to resize correctly
|
194
|
-
},
|
195
|
-
afterFinish: (function(fx) {
|
196
|
-
fx.element.setStyle({overflow: "visible"});
|
197
|
-
this.event("_afterResize"); // Passing internal callback
|
198
|
-
this.event("afterResize"); // Passing callback
|
199
|
-
}).bind(this)
|
200
|
-
});
|
201
|
-
} else {
|
202
|
-
this.MBwindow.setStyle(newStyle);
|
203
|
-
(function() {
|
204
|
-
this.event("_afterResize"); // Passing internal callback
|
205
|
-
this.event("afterResize"); // Passing callback
|
206
|
-
}).bind(this).defer();
|
207
|
-
}
|
208
|
-
},
|
209
|
-
|
210
|
-
resize: function(byWidth, byHeight, options) { // Change size of MB without loading content
|
211
|
-
var w = this.MBwindow.getDimensions(), hHeight = this.MBheader.getHeight(), cHeight = this.MBcontent.getHeight();
|
212
|
-
this.resizeTo((w.width + byWidth), Math.max(hHeight + cHeight, w.height + byHeight), options);
|
213
|
-
},
|
214
|
-
|
215
|
-
resizeToContent: function(options){
|
216
|
-
// Resizes the modalbox window to the actual content height.
|
217
|
-
// This might be useful to resize modalbox after some content modifications which were changed content height.
|
218
|
-
|
219
|
-
var byHeight = this.options.height - this.MBwindow.getHeight();
|
220
|
-
if (byHeight != 0) {
|
221
|
-
this.resize(0, byHeight, options);
|
222
|
-
}
|
223
|
-
},
|
224
|
-
|
225
|
-
resizeToInclude: function(element, options){
|
226
|
-
// Resizes the modalbox window to the cumulative height of element. Calculations are using CSS properties for margins and border.
|
227
|
-
// This method might be useful to resize modalbox before including or updating content.
|
228
|
-
|
229
|
-
element = $(element);
|
230
|
-
var styles = ['margin-top','margin-bottom','border-top-width','border-bottom-width'];
|
231
|
-
var elHeight = styles.inject(element.getHeight(), function(acc, n) {
|
232
|
-
var x = parseInt(element.getStyle(n), 10);
|
233
|
-
acc += (isNaN(x) ? 0 : x);
|
234
|
-
return acc;
|
235
|
-
});
|
236
|
-
if (elHeight > 0) {
|
237
|
-
Modalbox.resize(0, elHeight, options);
|
238
|
-
}
|
239
|
-
},
|
240
|
-
|
241
|
-
loadContent: function() {
|
242
|
-
if (this.event("beforeLoad")) { // If callback returned false, skip loading of the content
|
243
|
-
if (typeof this.content == 'string') {
|
244
|
-
var htmlRegExp = new RegExp(/<\/?[^>]+>/gi), evalScript = function(script) {
|
245
|
-
return eval(script.replace("<!--", "").replace("// -->", ""));
|
246
|
-
};
|
247
|
-
if (htmlRegExp.test(this.content)) { // Plain HTML given as a parameter
|
248
|
-
this._insertContent(this.content.stripScripts(), (function() {
|
249
|
-
this.content.extractScripts().map(evalScript, window);
|
250
|
-
}).bind(this));
|
251
|
-
} else { // URL given as a parameter. We'll request it via Ajax
|
252
|
-
new Ajax.Request(this.content, {
|
253
|
-
method: this.options.method.toLowerCase(),
|
254
|
-
parameters: this.options.params,
|
255
|
-
onSuccess: (function(transport) {
|
256
|
-
var response = new String(transport.responseText);
|
257
|
-
this._insertContent(transport.responseText.stripScripts(), function(){
|
258
|
-
response.extractScripts().map(evalScript, window);
|
259
|
-
});
|
260
|
-
}).bind(this),
|
261
|
-
onException: function(instance, exception){
|
262
|
-
Modalbox.hide();
|
263
|
-
throw('Modalbox Loading Error: ' + exception);
|
264
|
-
}
|
265
|
-
});
|
266
|
-
}
|
267
|
-
} else if (typeof this.content == 'object') { // HTML Object is given
|
268
|
-
this._insertContent(this.content);
|
269
|
-
} else {
|
270
|
-
this.hide();
|
271
|
-
throw('Modalbox Parameters Error: Please specify correct URL or HTML element (plain HTML or object)');
|
272
|
-
}
|
273
|
-
}
|
274
|
-
},
|
275
|
-
|
276
|
-
_insertContent: function(content, callback) {
|
277
|
-
this.MBcontent.hide().update();
|
278
|
-
|
279
|
-
if (typeof content == 'string') { // Plain HTML is given
|
280
|
-
this.MBcontent.insert(new Element("div", { style: "display: none" }).update(content)).down().show();
|
281
|
-
} else if (typeof content == 'object') { // HTML Object is given
|
282
|
-
var _htmlObj = content.cloneNode(true); // If node already a part of DOM we'll clone it
|
283
|
-
// If cloneable element has ID attribute defined, modifying it to prevent duplicates
|
284
|
-
if (content.id) content.id = "MB_" + content.id;
|
285
|
-
// Add prefix for IDs on all elements inside the DOM node
|
286
|
-
$(content).select('*[id]').each(function(el) { el.id = "MB_" + el.id; });
|
287
|
-
this.MBcontent.insert(_htmlObj).down().show();
|
288
|
-
if (Prototype.Browser.IE6) { // Toggle back visibility for hidden selects in IE
|
289
|
-
this._prepareIESelects("", "#MB_content ");
|
290
|
-
}
|
291
|
-
}
|
292
|
-
|
293
|
-
// Prepare and resize modal box for content
|
294
|
-
if (this.options.height == this._options.height) {
|
295
|
-
this.resizeTo(this.options.width, this.MBheader.getHeight() + this.MBcontent.getHeight(), {
|
296
|
-
afterResize: (function() {
|
297
|
-
this._putContent.bind(this, callback).defer(); // MSIE fix
|
298
|
-
}).bind(this)
|
299
|
-
});
|
300
|
-
} else { // Height is defined. Creating a scrollable window
|
301
|
-
this._setSize();
|
302
|
-
this.MBcontent.setStyle({
|
303
|
-
overflow: 'auto',
|
304
|
-
height: this.options.height - this.MBheader.getHeight() - 13 + 'px'
|
305
|
-
});
|
306
|
-
this._putContent.bind(this, callback).defer(); // MSIE fix
|
307
|
-
}
|
308
|
-
},
|
309
|
-
|
310
|
-
_putContent: function(callback) {
|
311
|
-
this.MBcontent.show();
|
312
|
-
this._findFocusableElements();
|
313
|
-
this._setFocus(); // Setting focus on first 'focusable' element in content (input, select, textarea, link or button)
|
314
|
-
if (Object.isFunction(callback))
|
315
|
-
callback(); // Executing internal JS from loaded content
|
316
|
-
this.event("afterLoad"); // Passing callback
|
317
|
-
},
|
318
|
-
|
319
|
-
activate: function(options) {
|
320
|
-
this.setOptions(options);
|
321
|
-
this.active = true;
|
322
|
-
if (this.options.overlayClose)
|
323
|
-
this.MBoverlay.observe("click", this.hideObserver);
|
324
|
-
this.MBclose.observe("click", this.hideObserver).show();
|
325
|
-
if (this.options.transitions && this.options.inactiveFade)
|
326
|
-
new Effect.Appear(this.MBwindow, {duration: this.options.slideUpDuration});
|
327
|
-
},
|
328
|
-
|
329
|
-
deactivate: function(options) {
|
330
|
-
this.setOptions(options);
|
331
|
-
this.active = false;
|
332
|
-
if (this.options.overlayClose)
|
333
|
-
this.MBoverlay.stopObserving("click", this.hideObserver);
|
334
|
-
this.MBclose.stopObserving("click", this.hideObserver).hide();
|
335
|
-
if (this.options.transitions && this.options.inactiveFade)
|
336
|
-
new Effect.Fade(this.MBwindow, {duration: this.options.slideUpDuration, to: 0.75});
|
337
|
-
},
|
338
|
-
|
339
|
-
_initObservers: function() {
|
340
|
-
this.MBclose.observe("click", this.hideObserver);
|
341
|
-
if (this.options.overlayClose)
|
342
|
-
this.MBoverlay.observe("click", this.hideObserver);
|
343
|
-
// Gecko and Opera are moving focus a way too fast, all other browsers are okay with keydown
|
344
|
-
var kbdEvent = (Prototype.Browser.Gecko || Prototype.Browser.Opera) ? "keypress" : "keydown";
|
345
|
-
Event.observe(document, kbdEvent, this.kbdObserver);
|
346
|
-
},
|
347
|
-
|
348
|
-
_removeObservers: function() {
|
349
|
-
this.MBclose.stopObserving("click", this.hideObserver);
|
350
|
-
if (this.options.overlayClose)
|
351
|
-
this.MBoverlay.stopObserving("click", this.hideObserver);
|
352
|
-
var kbdEvent = (Prototype.Browser.Gecko || Prototype.Browser.Opera) ? "keypress" : "keydown";
|
353
|
-
Event.stopObserving(document, kbdEvent, this.kbdObserver);
|
354
|
-
},
|
355
|
-
|
356
|
-
_setFocus: function() {
|
357
|
-
// Setting focus to the first 'focusable' element which is one with tabindex = 1 or the first in the form loaded.
|
358
|
-
if (this.options.autoFocusing === true && this.focusableElements.length > 0) {
|
359
|
-
var firstEl = this.focusableElements.find(function (el){
|
360
|
-
return el.tabIndex == 1;
|
361
|
-
}) || this.focusableElements.first();
|
362
|
-
this.currFocused = this.focusableElements.toArray().indexOf(firstEl);
|
363
|
-
firstEl.focus(); // Focus on first focusable element except close button
|
364
|
-
} else if (this.MBclose.visible()) {
|
365
|
-
this.MBclose.focus(); // If no focusable elements exist focus on close button
|
366
|
-
}
|
367
|
-
},
|
368
|
-
|
369
|
-
_findFocusableElements: function() { // Collect form elements or links from MB content
|
370
|
-
if (this.options.autoFocusing === true) {
|
371
|
-
// TODO maybe add :enabled to select and textarea elements
|
372
|
-
this.MBcontent.select('input:not([type~=hidden]):enabled, select, textarea, button, a[href]').invoke('addClassName', 'MB_focusable');
|
373
|
-
this.focusableElements = this.MBcontent.select('.MB_focusable');
|
374
|
-
}
|
375
|
-
},
|
376
|
-
|
377
|
-
_kbdHandler: function(event) {
|
378
|
-
var node = event.element();
|
379
|
-
switch(event.keyCode) {
|
380
|
-
case Event.KEY_TAB:
|
381
|
-
event.stop();
|
382
|
-
|
383
|
-
// Switching currFocused to the element which was focused by mouse instead of TAB-key. Fix for #134
|
384
|
-
if (node != this.focusableElements[this.currFocused])
|
385
|
-
this.currFocused = this.focusableElements.indexOf(node);
|
386
|
-
|
387
|
-
if (!event.shiftKey) { // Focusing in direct order
|
388
|
-
if(this.currFocused >= this.focusableElements.length - 1) {
|
389
|
-
this.currFocused = 0;
|
390
|
-
} else {
|
391
|
-
this.currFocused++;
|
392
|
-
}
|
393
|
-
} else { // Shift key is pressed. Focusing in reverse order
|
394
|
-
if(this.currFocused <= 0) {
|
395
|
-
this.currFocused = this.focusableElements.length - 1;
|
396
|
-
} else {
|
397
|
-
this.currFocused--;
|
398
|
-
}
|
399
|
-
}
|
400
|
-
this.focusableElements[this.currFocused].focus();
|
401
|
-
break;
|
402
|
-
case Event.KEY_ESC:
|
403
|
-
if (this.active) this._hide(event);
|
404
|
-
break;
|
405
|
-
case 32:
|
406
|
-
this._preventScroll(event);
|
407
|
-
break;
|
408
|
-
case 0: // For Gecko browsers compatibility
|
409
|
-
if (event.which == 32) this._preventScroll(event);
|
410
|
-
break;
|
411
|
-
case Event.KEY_UP:
|
412
|
-
case Event.KEY_DOWN:
|
413
|
-
case Event.KEY_PAGEDOWN:
|
414
|
-
case Event.KEY_PAGEUP:
|
415
|
-
case Event.KEY_HOME:
|
416
|
-
case Event.KEY_END:
|
417
|
-
// Safari operates in slightly different way. This realization is still buggy in Safari.
|
418
|
-
if (Prototype.Browser.WebKit && !["textarea", "select"].include(node.tagName.toLowerCase()))
|
419
|
-
event.stop();
|
420
|
-
else if ((node.tagName.toLowerCase() == "input" && ["submit", "button"].include(node.type)) || (node.tagName.toLowerCase() == "a"))
|
421
|
-
event.stop();
|
422
|
-
break;
|
423
|
-
}
|
424
|
-
},
|
425
|
-
|
426
|
-
_preventScroll: function(event) { // Disabling scrolling by "space" key
|
427
|
-
if (!["input", "textarea", "select", "button"].include(event.element().tagName.toLowerCase()))
|
428
|
-
event.stop();
|
429
|
-
},
|
430
|
-
|
431
|
-
_deinit: function() {
|
432
|
-
this._removeObservers();
|
433
|
-
Event.stopObserving(window, "resize", this.resizeObserver);
|
434
|
-
if (this.options.transitions) {
|
435
|
-
Effect.toggle(this.MBoverlay, 'appear', {duration: this.options.overlayDuration, afterFinish: this._removeElements.bind(this) });
|
436
|
-
} else {
|
437
|
-
this.MBoverlay.hide();
|
438
|
-
this._removeElements();
|
439
|
-
}
|
440
|
-
this.MBcontent.setStyle({overflow: '', height: ''});
|
441
|
-
},
|
442
|
-
|
443
|
-
_removeElements: function() {
|
444
|
-
if (Prototype.Browser.Opera) { // Remove overlay after-effects in Opera
|
445
|
-
window.scrollBy(0, 0);
|
446
|
-
}
|
447
|
-
this.MBoverlay.remove();
|
448
|
-
this.MBwindow.remove();
|
449
|
-
if (Prototype.Browser.IE6) {
|
450
|
-
this._prepareIEHtml("", ""); // If set to auto MSIE will show horizontal scrolling
|
451
|
-
this._prepareIESelects("");
|
452
|
-
window.scrollTo(this.initScrollX, this.initScrollY);
|
453
|
-
}
|
454
|
-
|
455
|
-
// Replacing prefixes 'MB_' in IDs for the original content
|
456
|
-
if (typeof this.content == 'object') {
|
457
|
-
if(this.content.id && this.content.id.match(/MB_/)) {
|
458
|
-
this.content.id = this.content.id.replace(/MB_/, "");
|
459
|
-
}
|
460
|
-
this.content.select('*[id]').each(function(el) { el.id = el.id.replace(/MB_/, ""); });
|
461
|
-
}
|
462
|
-
// Initialized will be set to false
|
463
|
-
this.initialized = false;
|
464
|
-
this.event("afterHide"); // Passing afterHide callback
|
465
|
-
this.setOptions(this._options); // Settings options object into initial state
|
466
|
-
},
|
467
|
-
|
468
|
-
_setSize: function() { // Set size
|
469
|
-
this.MBwindow.setStyle({width: this.options.width + "px", height: this.options.height + "px"});
|
470
|
-
},
|
471
|
-
|
472
|
-
_setPosition: function() {
|
473
|
-
this.MBwindow.setStyle({left: ((this.MBoverlay.getWidth() - this.MBwindow.getWidth()) / 2 ) + "px"});
|
474
|
-
},
|
475
|
-
|
476
|
-
_setWidthAndPosition: function() {
|
477
|
-
this.MBwindow.setStyle({
|
478
|
-
width: this.options.width + "px",
|
479
|
-
left: ((this.MBoverlay.getWidth() - this.options.width) / 2 ) + "px"
|
480
|
-
});
|
481
|
-
},
|
482
|
-
|
483
|
-
_prepareIEHtml: function(height, overflow) { // IE requires width and height set to 100% and overflow hidden
|
484
|
-
$$('html, body').invoke('setStyle', {width: height, height: height, overflow: overflow});
|
485
|
-
},
|
486
|
-
|
487
|
-
_prepareIESelects: function(overflow, prefix) { // Toggle visibility for select elements
|
488
|
-
$$((prefix || "") + "select").invoke('setStyle', {'visibility': overflow});
|
489
|
-
},
|
490
|
-
|
491
|
-
event: function(eventName) {
|
492
|
-
var r = true;
|
493
|
-
if (this.options[eventName]) {
|
494
|
-
var returnValue = this.options[eventName](); // Executing callback
|
495
|
-
this.options[eventName] = null; // Removing callback after execution
|
496
|
-
if (!Object.isUndefined(returnValue))
|
497
|
-
r = returnValue;
|
498
|
-
}
|
499
|
-
Event.fire(document, 'Modalbox:' + eventName);
|
500
|
-
return r;
|
501
|
-
}
|
502
|
-
};
|
503
|
-
|
504
|
-
Object.extend(Modalbox, Modalbox.Methods);
|
505
|
-
|
506
|
-
if (Modalbox.overrideAlert) window.alert = Modalbox.alert;
|