enju_leaf 1.2.2 → 1.3.0.beta.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/config/enju_leaf_manifest.js +0 -0
- data/app/assets/stylesheets/enju.css +3 -12
- data/app/helpers/enju_leaf/application_helper.rb +125 -0
- data/app/views/devise/registrations/new.html.erb +2 -2
- data/app/views/page/_header.html.erb +0 -2
- data/lib/enju_leaf/version.rb +1 -1
- data/lib/enju_leaf.rb +0 -1
- data/lib/generators/enju_leaf/setup/setup_generator.rb +16 -13
- data/lib/tasks/enju_leaf_tasks.rake +4 -2
- data/spec/dummy/app/helpers/application_helper.rb +2 -2
- data/spec/dummy/bin/rails +1 -1
- data/spec/dummy/bin/setup +21 -12
- data/spec/dummy/bin/update +29 -0
- data/spec/dummy/bin/yarn +11 -0
- data/spec/dummy/config/application.rb +7 -16
- data/spec/dummy/config/environment.rb +4 -4
- data/spec/dummy/config/environments/development.rb +24 -11
- data/spec/dummy/config/environments/production.rb +28 -16
- data/spec/dummy/config/environments/test.rb +6 -8
- data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
- data/spec/dummy/config/initializers/assets.rb +6 -3
- data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +6 -5
- data/spec/dummy/config/initializers/mime_types.rb +0 -1
- data/spec/dummy/config/initializers/wrap_parameters.rb +5 -5
- data/spec/dummy/db/migrate/001_create_agents.rb +1 -1
- data/spec/dummy/db/migrate/002_devise_create_users.rb +1 -1
- data/spec/dummy/db/migrate/005_create_manifestations.rb +1 -1
- data/spec/dummy/db/migrate/006_create_items.rb +1 -1
- data/spec/dummy/db/migrate/012_create_owns.rb +1 -1
- data/spec/dummy/db/migrate/015_create_creates.rb +1 -1
- data/spec/dummy/db/migrate/032_create_checkins.rb +1 -1
- data/spec/dummy/db/migrate/033_create_checkouts.rb +1 -1
- data/spec/dummy/db/migrate/035_create_reserves.rb +1 -1
- data/spec/dummy/db/migrate/041_create_roles.rb +1 -1
- data/spec/dummy/db/migrate/047_create_produces.rb +1 -1
- data/spec/dummy/db/migrate/055_create_bookmarks.rb +1 -1
- data/spec/dummy/db/migrate/059_create_libraries.rb +1 -1
- data/spec/dummy/db/migrate/069_create_shelves.rb +1 -1
- data/spec/dummy/db/migrate/073_create_carrier_types.rb +1 -1
- data/spec/dummy/db/migrate/077_create_user_groups.rb +1 -1
- data/spec/dummy/db/migrate/080_create_library_groups.rb +1 -1
- data/spec/dummy/db/migrate/090_create_search_histories.rb +1 -1
- data/spec/dummy/db/migrate/112_create_frequencies.rb +1 -1
- data/spec/dummy/db/migrate/113_create_events.rb +1 -1
- data/spec/dummy/db/migrate/114_create_event_categories.rb +1 -1
- data/spec/dummy/db/migrate/117_create_form_of_works.rb +1 -1
- data/spec/dummy/db/migrate/120_create_baskets.rb +1 -1
- data/spec/dummy/db/migrate/121_create_checked_items.rb +1 -1
- data/spec/dummy/db/migrate/124_create_bookstores.rb +1 -1
- data/spec/dummy/db/migrate/125_create_donates.rb +1 -1
- data/spec/dummy/db/migrate/127_create_use_restrictions.rb +1 -1
- data/spec/dummy/db/migrate/129_create_item_has_use_restrictions.rb +1 -1
- data/spec/dummy/db/migrate/130_create_request_status_types.rb +1 -1
- data/spec/dummy/db/migrate/131_create_request_types.rb +1 -1
- data/spec/dummy/db/migrate/132_create_circulation_statuses.rb +1 -1
- data/spec/dummy/db/migrate/133_create_agent_merges.rb +1 -1
- data/spec/dummy/db/migrate/134_create_agent_merge_lists.rb +1 -1
- data/spec/dummy/db/migrate/149_create_message_templates.rb +1 -1
- data/spec/dummy/db/migrate/154_create_messages.rb +1 -1
- data/spec/dummy/db/migrate/20080819181903_create_message_requests.rb +1 -1
- data/spec/dummy/db/migrate/20080830154109_create_realizes.rb +1 -1
- data/spec/dummy/db/migrate/20080830172106_create_exemplifies.rb +1 -1
- data/spec/dummy/db/migrate/20080905191442_create_agent_types.rb +1 -1
- data/spec/dummy/db/migrate/20081006090811_create_subscriptions.rb +1 -1
- data/spec/dummy/db/migrate/20081006093246_create_subscribes.rb +1 -1
- data/spec/dummy/db/migrate/20081023092436_create_search_engines.rb +1 -1
- data/spec/dummy/db/migrate/20081025083323_create_countries.rb +1 -1
- data/spec/dummy/db/migrate/20081025083905_create_languages.rb +1 -1
- data/spec/dummy/db/migrate/20081027150907_create_picture_files.rb +1 -1
- data/spec/dummy/db/migrate/20081028083142_create_agent_import_files.rb +1 -1
- data/spec/dummy/db/migrate/20081028083208_create_resource_import_files.rb +1 -1
- data/spec/dummy/db/migrate/20081030023412_create_checkout_types.rb +1 -1
- data/spec/dummy/db/migrate/20081030023518_create_user_group_has_checkout_types.rb +1 -1
- data/spec/dummy/db/migrate/20081030023615_create_carrier_type_has_checkout_types.rb +1 -1
- data/spec/dummy/db/migrate/20081212075554_create_checkout_stat_has_manifestations.rb +1 -1
- data/spec/dummy/db/migrate/20081212080038_create_manifestation_checkout_stats.rb +1 -1
- data/spec/dummy/db/migrate/20081212151614_create_bookmark_stats.rb +1 -1
- data/spec/dummy/db/migrate/20081212151820_create_bookmark_stat_has_manifestations.rb +1 -1
- data/spec/dummy/db/migrate/20081215094302_create_user_checkout_stats.rb +1 -1
- data/spec/dummy/db/migrate/20081215094955_create_checkout_stat_has_users.rb +1 -1
- data/spec/dummy/db/migrate/20081216190517_create_reserve_stat_has_manifestations.rb +1 -1
- data/spec/dummy/db/migrate/20081216190724_create_manifestation_reserve_stats.rb +1 -1
- data/spec/dummy/db/migrate/20081220023628_create_user_reserve_stats.rb +1 -1
- data/spec/dummy/db/migrate/20081220034117_create_reserve_stat_has_users.rb +1 -1
- data/spec/dummy/db/migrate/20090321130448_add_completed_at_to_user_checkout_stat.rb +1 -1
- data/spec/dummy/db/migrate/20090705133942_add_attachments_picture_to_picture_file.rb +1 -1
- data/spec/dummy/db/migrate/20090705212043_add_attachments_attachment_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20090719201843_create_extents.rb +1 -1
- data/spec/dummy/db/migrate/20090720091106_create_medium_of_performances.rb +1 -1
- data/spec/dummy/db/migrate/20090720091429_create_content_types.rb +1 -1
- data/spec/dummy/db/migrate/20090812151902_create_agent_relationship_types.rb +1 -1
- data/spec/dummy/db/migrate/20090831220301_create_lending_policies.rb +1 -1
- data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +1 -1
- data/spec/dummy/db/migrate/20091025080447_create_licenses.rb +1 -1
- data/spec/dummy/db/migrate/20091214131723_create_series_statements.rb +1 -1
- data/spec/dummy/db/migrate/20100129142347_create_import_requests.rb +1 -1
- data/spec/dummy/db/migrate/20100211105551_add_admin_networks_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20100222124420_add_allow_bookmark_external_url_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20100223121519_rename_series_statement_title_to_original_title.rb +1 -1
- data/spec/dummy/db/migrate/20100314190054_add_opening_hour_to_library.rb +1 -1
- data/spec/dummy/db/migrate/20100321235924_add_series_statement_identifier_to_series_statement.rb +1 -1
- data/spec/dummy/db/migrate/20100525124311_create_manifestation_relationships.rb +1 -1
- data/spec/dummy/db/migrate/20100525171356_acts_as_taggable_on_migration.rb +1 -1
- data/spec/dummy/db/migrate/20100606065209_create_user_has_roles.rb +1 -1
- data/spec/dummy/db/migrate/20100606073747_create_agent_relationships.rb +1 -1
- data/spec/dummy/db/migrate/20100607044753_create_manifestation_relationship_types.rb +1 -1
- data/spec/dummy/db/migrate/20100623173800_rename_search_history_version_to_sru_version.rb +1 -1
- data/spec/dummy/db/migrate/20100814091104_add_position_to_agent_relationship.rb +1 -1
- data/spec/dummy/db/migrate/20100925043847_create_resource_import_results.rb +1 -1
- data/spec/dummy/db/migrate/20100925074559_create_agent_import_results.rb +1 -1
- data/spec/dummy/db/migrate/20101212070145_add_acquired_at_to_item.rb +1 -1
- data/spec/dummy/db/migrate/20110222073537_add_url_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20110301035123_add_pub_date_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_agent.rb +1 -1
- data/spec/dummy/db/migrate/20110301134521_add_expire_date_to_reserve.rb +1 -1
- data/spec/dummy/db/migrate/20110318183304_add_valid_period_for_new_user_to_user_group.rb +1 -1
- data/spec/dummy/db/migrate/20110328130826_add_current_checkout_count_to_user_group_has_checkout_type.rb +1 -1
- data/spec/dummy/db/migrate/20110425133109_add_issn_to_series_statement.rb +1 -1
- data/spec/dummy/db/migrate/20110603184217_add_edit_mode_to_resource_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20110618091240_add_periodical_to_series_statement.rb +1 -1
- data/spec/dummy/db/migrate/20110619064807_add_edition_string_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20110620173525_add_bookstore_id_to_item.rb +1 -1
- data/spec/dummy/db/migrate/20110621093332_remove_expire_date_from_reserve.rb +1 -1
- data/spec/dummy/db/migrate/20110627034940_create_series_statement_merge_lists.rb +1 -1
- data/spec/dummy/db/migrate/20110627035057_create_series_statement_merges.rb +1 -1
- data/spec/dummy/db/migrate/20110627122938_add_number_of_day_to_notify_overdue_to_user_group.rb +1 -1
- data/spec/dummy/db/migrate/20110820131417_create_series_has_manifestations.rb +1 -1
- data/spec/dummy/db/migrate/20110913115320_add_lft_and_rgt_to_message.rb +1 -1
- data/spec/dummy/db/migrate/20110916091020_add_volume_number_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20110916103953_add_manifestaiton_id_to_series_statement.rb +1 -1
- data/spec/dummy/db/migrate/20110918162329_add_note_to_series_statement.rb +1 -1
- data/spec/dummy/db/migrate/20111009183423_add_ndc_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20111124110059_create_create_types.rb +1 -1
- data/spec/dummy/db/migrate/20111124110319_create_realize_types.rb +1 -1
- data/spec/dummy/db/migrate/20111124110355_create_produce_types.rb +1 -1
- data/spec/dummy/db/migrate/20111124112131_add_create_type_to_create.rb +1 -1
- data/spec/dummy/db/migrate/20111129044509_add_pickup_location_to_reserve.rb +1 -1
- data/spec/dummy/db/migrate/20111217234412_add_save_checkout_history_to_user.rb +1 -1
- data/spec/dummy/db/migrate/20111218002349_add_checkout_icalendar_token_to_user.rb +1 -1
- data/spec/dummy/db/migrate/20111231145823_add_share_bookmarks_to_user.rb +1 -1
- data/spec/dummy/db/migrate/20120105074911_add_isil_to_library.rb +1 -1
- data/spec/dummy/db/migrate/20120125050502_add_depth_to_message.rb +1 -1
- data/spec/dummy/db/migrate/20120125152919_add_title_subseries_transcription_to_series_statement.rb +1 -1
- data/spec/dummy/db/migrate/20120129014038_create_budget_types.rb +1 -1
- data/spec/dummy/db/migrate/20120129020544_add_budget_type_id_to_item.rb +1 -1
- data/spec/dummy/db/migrate/20120319120638_add_content_type_id_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20120319173203_create_accepts.rb +1 -1
- data/spec/dummy/db/migrate/20120410104851_add_year_of_publication_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20120413072700_add_picture_meta_to_picture_file.rb +1 -1
- data/spec/dummy/db/migrate/20120413100352_add_fingerprint_to_picture_file.rb +1 -1
- data/spec/dummy/db/migrate/20120413161340_add_fingerprint_to_resource_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20120413161403_add_fingerprint_to_agent_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20120413170705_add_error_message_to_resource_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20120413170720_add_error_message_to_agent_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20120415164821_add_attachment_meta_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20120418081407_add_month_of_publication_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20120418121539_add_save_search_history_to_user.rb +1 -1
- data/spec/dummy/db/migrate/20120424103932_add_librarian_id_to_checked_item.rb +1 -1
- data/spec/dummy/db/migrate/20120510140958_add_closed_to_shelf.rb +1 -1
- data/spec/dummy/db/migrate/20120511072422_add_agent_identifier_to_agent.rb +1 -1
- data/spec/dummy/db/migrate/20120602141129_add_edit_mode_to_agent_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20120728204337_create_series_statement_relationships.rb +1 -1
- data/spec/dummy/db/migrate/20121116031206_add_fulltext_content_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20121116033446_add_doi_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20130221154434_add_additional_attributes_to_user.rb +1 -1
- data/spec/dummy/db/migrate/20130303124821_add_retained_at_to_reserve.rb +1 -1
- data/spec/dummy/db/migrate/20130304015019_add_postponed_at_to_reserve.rb +1 -1
- data/spec/dummy/db/migrate/20130412083556_add_latitude_and_longitude_to_library.rb +1 -1
- data/spec/dummy/db/migrate/20130416054135_add_circulation_status_id_to_item.rb +1 -1
- data/spec/dummy/db/migrate/20130421093852_add_periodical_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20130421155019_add_creator_string_to_series_statement.rb +1 -1
- data/spec/dummy/db/migrate/20130421164124_add_series_master_to_series_statement.rb +1 -1
- data/spec/dummy/db/migrate/20130429020822_add_root_manifestation_id_to_series_statement.rb +1 -1
- data/spec/dummy/db/migrate/20130506175303_create_identifier_types.rb +1 -1
- data/spec/dummy/db/migrate/20130506175834_create_identifiers.rb +1 -1
- data/spec/dummy/db/migrate/20130509185724_add_statement_of_responsibility_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20130519065638_add_lock_version_to_reserve.rb +1 -1
- data/spec/dummy/db/migrate/20130519065837_add_lock_version_to_checkin.rb +1 -1
- data/spec/dummy/db/migrate/20140110122216_create_user_import_files.rb +1 -1
- data/spec/dummy/db/migrate/20140110131010_create_user_import_results.rb +1 -1
- data/spec/dummy/db/migrate/20140122054321_create_profiles.rb +1 -1
- data/spec/dummy/db/migrate/20140518050147_create_reserve_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140518111006_create_message_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140518135713_create_message_request_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140519170214_create_resource_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140519171220_create_import_request_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140524020735_create_agent_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140524074813_create_user_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140524135607_create_bookmark_stat_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140524142813_add_taggings_count_to_tag.rb +1 -1
- data/spec/dummy/db/migrate/20140528045518_create_user_checkout_stat_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140528045539_create_user_reserve_stat_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140528045600_create_manifestation_checkout_stat_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140528045617_create_manifestation_reserve_stat_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140529014410_create_item_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140610123439_drop_email_unique_constraint_enju_leaf_rc10.rb +1 -1
- data/spec/dummy/db/migrate/20140614065404_create_resource_export_files.rb +1 -1
- data/spec/dummy/db/migrate/20140614141500_create_resource_export_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140628072217_add_user_encoding_to_user_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20140628073524_add_user_encoding_to_agent_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20140628073535_add_user_encoding_to_resource_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20140709113413_create_user_export_files.rb +1 -1
- data/spec/dummy/db/migrate/20140709113905_create_user_export_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140720140916_add_binding_item_identifier_to_item.rb +1 -1
- data/spec/dummy/db/migrate/20140720170714_add_default_library_id_to_user_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20140720170735_add_default_user_group_id_to_user_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20140721151416_add_default_shelf_id_to_resource_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20140802082007_add_manifestation_id_to_item.rb +1 -1
- data/spec/dummy/db/migrate/20140810061942_add_user_id_to_user_checkout_stat.rb +1 -1
- data/spec/dummy/db/migrate/20140810091231_add_checkout_icalendar_token_to_profile.rb +1 -1
- data/spec/dummy/db/migrate/20140810091417_add_save_checkout_history_to_profile.rb +1 -1
- data/spec/dummy/db/migrate/20140811031145_add_expired_at_to_profile.rb +1 -1
- data/spec/dummy/db/migrate/20140811132912_add_save_search_history_to_profile.rb +1 -1
- data/spec/dummy/db/migrate/20140812093836_add_share_bookmarks_to_profile.rb +1 -1
- data/spec/dummy/db/migrate/20140813182425_add_publication_place_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20140821151023_create_colors.rb +1 -1
- data/spec/dummy/db/migrate/20140822114527_add_error_message_to_resource_import_result.rb +1 -1
- data/spec/dummy/db/migrate/20140823083524_add_extent_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20140823094847_add_dimensions_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20140823095740_rename_manifestation_periodical_to_serial.rb +1 -1
- data/spec/dummy/db/migrate/20141003181336_add_full_name_transcription_to_profile.rb +1 -1
- data/spec/dummy/db/migrate/20141003182825_add_date_of_birth_to_profile.rb +1 -1
- data/spec/dummy/db/migrate/20141014065831_add_shelf_id_to_checkout.rb +1 -1
- data/spec/dummy/db/migrate/20141020120523_add_library_id_to_checkout.rb +1 -1
- data/spec/dummy/db/migrate/20150106001709_create_demands.rb +1 -1
- data/spec/dummy/db/migrate/20150117111136_add_foreign_key_to_items_referencing_manifestations.rb +1 -1
- data/spec/dummy/db/migrate/20150221063719_add_settings_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20150421023923_create_identities.rb +1 -1
- data/spec/dummy/db/migrate/20150506105356_add_error_message_to_user_import_result.rb +1 -1
- data/spec/dummy/db/migrate/20150924115059_create_withdraws.rb +1 -1
- data/spec/dummy/db/migrate/20151125004028_add_profile_id_to_agent.rb +1 -1
- data/spec/dummy/db/migrate/20151126005552_add_provider_to_identity.rb +1 -1
- data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20160610093229_add_html_snippet_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20160627232219_add_most_recent_to_user_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20160627232316_add_most_recent_to_user_export_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20160703184619_add_most_recent_to_reserve_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20160703184650_add_most_recent_to_manifestation_checkout_stat_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20160703184723_add_most_recent_to_manifestation_reserve_stat_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20160703184747_add_most_recent_to_user_checkout_stat_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20160703184805_add_most_recent_to_user_reserve_stat_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20160703185015_add_most_recent_to_message_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20160703190209_add_foreign_key_on_manifestation_id_to_reserve.rb +1 -1
- data/spec/dummy/db/migrate/20160801080612_add_most_recent_to_import_request_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20160801080619_add_most_recent_to_resource_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20160801080637_add_most_recent_to_resource_export_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20160801080643_add_most_recent_to_agent_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20160811102604_add_picture_width_to_picture_file.rb +1 -1
- data/spec/dummy/db/migrate/20160813191533_add_book_jacket_source_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20160813191647_add_max_number_of_results_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20160813191733_add_family_name_first_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20160813191820_add_screenshot_generator_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20160813192542_add_pub_year_facet_range_interval_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20160813203039_add_user_id_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20160820004638_add_attachment_attachment_to_carrier_types.rb +1 -1
- data/spec/dummy/db/migrate/20170305064014_add_csv_charset_conversion_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20171014084528_add_header_logo_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20171119051258_set_not_null_to_manifestation_id_on_items.rb +1 -1
- data/spec/dummy/db/migrate/20171126133835_rename_login_banner_to_old_login_banner.rb +1 -1
- data/spec/dummy/db/migrate/20171126135238_add_foreign_key_to_library_group_id_on_library.rb +1 -1
- data/spec/dummy/db/migrate/20180102162311_add_header_logo_meta_to_library_group.rb +1 -1
- data/spec/dummy/db/schema.rb +896 -977
- data/spec/factories/agent.rb +1 -1
- data/spec/factories/create_types.rb +3 -3
- data/spec/factories/produce_types.rb +3 -3
- data/spec/factories/profile.rb +5 -5
- data/spec/factories/realize_types.rb +3 -3
- data/spec/factories/subscribe.rb +2 -2
- data/spec/factories/user.rb +9 -9
- data/spec/factories/user_checkout_stat.rb +2 -2
- data/vendor/assets/javascripts/jquery.colorbox.js +5 -5
- data/vendor/assets/javascripts/jquery.powertip.js +461 -232
- data/vendor/assets/stylesheets/jquery.powertip.css +38 -26
- metadata +32 -22
- data/lib/enju_leaf/helper.rb +0 -129
@@ -1,20 +1,23 @@
|
|
1
1
|
/*!
|
2
|
-
PowerTip
|
3
|
-
|
4
|
-
Copyright (c)
|
2
|
+
PowerTip v1.3.1 (2018-04-15)
|
3
|
+
https://stevenbenner.github.io/jquery-powertip/
|
4
|
+
Copyright (c) 2018 Steven Benner (http://stevenbenner.com/).
|
5
5
|
Released under MIT license.
|
6
6
|
https://raw.github.com/stevenbenner/jquery-powertip/master/LICENSE.txt
|
7
7
|
*/
|
8
|
-
(function(factory) {
|
8
|
+
(function(root, factory) {
|
9
|
+
// support loading the plugin via common patterns
|
9
10
|
if (typeof define === 'function' && define.amd) {
|
10
|
-
//
|
11
|
-
define(['jquery'], factory);
|
11
|
+
// load the plugin as an amd module
|
12
|
+
define([ 'jquery' ], factory);
|
13
|
+
} else if (typeof module === 'object' && module.exports) {
|
14
|
+
// load the plugin as a commonjs module
|
15
|
+
module.exports = factory(require('jquery'));
|
12
16
|
} else {
|
13
|
-
//
|
14
|
-
factory(jQuery);
|
17
|
+
// load the plugin as a global
|
18
|
+
factory(root.jQuery);
|
15
19
|
}
|
16
|
-
}(function($) {
|
17
|
-
|
20
|
+
}(this, function($) {
|
18
21
|
// useful private variables
|
19
22
|
var $document = $(document),
|
20
23
|
$window = $(window),
|
@@ -30,13 +33,28 @@
|
|
30
33
|
DATA_POWERTIP = 'powertip',
|
31
34
|
DATA_POWERTIPJQ = 'powertipjq',
|
32
35
|
DATA_POWERTIPTARGET = 'powertiptarget',
|
33
|
-
|
36
|
+
EVENT_NAMESPACE = '.powertip',
|
37
|
+
RAD2DEG = 180 / Math.PI,
|
38
|
+
MOUSE_EVENTS = [
|
39
|
+
'click',
|
40
|
+
'dblclick',
|
41
|
+
'mousedown',
|
42
|
+
'mouseup',
|
43
|
+
'mousemove',
|
44
|
+
'mouseover',
|
45
|
+
'mouseout',
|
46
|
+
'mouseenter',
|
47
|
+
'mouseleave',
|
48
|
+
'contextmenu'
|
49
|
+
];
|
34
50
|
|
35
51
|
/**
|
36
52
|
* Session data
|
37
53
|
* Private properties global to all powerTip instances
|
38
54
|
*/
|
39
55
|
var session = {
|
56
|
+
elements: null,
|
57
|
+
tooltips: null,
|
40
58
|
isTipOpen: false,
|
41
59
|
isFixedTipOpen: false,
|
42
60
|
isClosing: false,
|
@@ -47,6 +65,7 @@
|
|
47
65
|
previousX: 0,
|
48
66
|
previousY: 0,
|
49
67
|
desyncTimeout: null,
|
68
|
+
closeDelayTimeout: null,
|
50
69
|
mouseTrackingActive: false,
|
51
70
|
delayInProgress: false,
|
52
71
|
windowWidth: 0,
|
@@ -69,47 +88,50 @@
|
|
69
88
|
|
70
89
|
/**
|
71
90
|
* Display hover tooltips on the matched elements.
|
72
|
-
* @param {(Object|string)} opts The options object to use for the plugin, or
|
91
|
+
* @param {(Object|string)=} opts The options object to use for the plugin, or
|
73
92
|
* the name of a method to invoke on the first matched element.
|
74
93
|
* @param {*=} [arg] Argument for an invoked method (optional).
|
75
94
|
* @return {jQuery} jQuery object for the matched selectors.
|
76
95
|
*/
|
77
96
|
$.fn.powerTip = function(opts, arg) {
|
97
|
+
var targetElements = this,
|
98
|
+
options,
|
99
|
+
tipController;
|
100
|
+
|
78
101
|
// don't do any work if there were no matched elements
|
79
|
-
if (!
|
80
|
-
return
|
102
|
+
if (!targetElements.length) {
|
103
|
+
return targetElements;
|
81
104
|
}
|
82
105
|
|
83
106
|
// handle api method calls on the plugin, e.g. powerTip('hide')
|
84
107
|
if ($.type(opts) === 'string' && $.powerTip[opts]) {
|
85
|
-
return $.powerTip[opts].call(
|
108
|
+
return $.powerTip[opts].call(targetElements, targetElements, arg);
|
86
109
|
}
|
87
110
|
|
88
|
-
// extend options
|
89
|
-
|
90
|
-
|
111
|
+
// extend options
|
112
|
+
options = $.extend({}, $.fn.powerTip.defaults, opts);
|
113
|
+
|
114
|
+
// handle repeated powerTip calls on the same element by destroying any
|
115
|
+
// original instance hooked to it and replacing it with this call
|
116
|
+
$.powerTip.destroy(targetElements);
|
117
|
+
|
118
|
+
// instantiate the TooltipController for this instance
|
119
|
+
tipController = new TooltipController(options);
|
91
120
|
|
92
121
|
// hook mouse and viewport dimension tracking
|
93
122
|
initTracking();
|
94
123
|
|
95
124
|
// setup the elements
|
96
|
-
|
125
|
+
targetElements.each(function elementSetup() {
|
97
126
|
var $this = $(this),
|
98
127
|
dataPowertip = $this.data(DATA_POWERTIP),
|
99
128
|
dataElem = $this.data(DATA_POWERTIPJQ),
|
100
129
|
dataTarget = $this.data(DATA_POWERTIPTARGET),
|
101
|
-
title;
|
102
|
-
|
103
|
-
// handle repeated powerTip calls on the same element by destroying the
|
104
|
-
// original instance hooked to it and replacing it with this call
|
105
|
-
if ($this.data(DATA_DISPLAYCONTROLLER)) {
|
106
|
-
$.powerTip.destroy($this);
|
107
|
-
}
|
130
|
+
title = $this.attr('title');
|
108
131
|
|
109
132
|
// attempt to use title attribute text if there is no data-powertip,
|
110
133
|
// data-powertipjq or data-powertiptarget. If we do use the title
|
111
134
|
// attribute, delete the attribute so the browser will not show it
|
112
|
-
title = $this.attr('title');
|
113
135
|
if (!dataPowertip && !dataTarget && !dataElem && title) {
|
114
136
|
$this.data(DATA_POWERTIP, title);
|
115
137
|
$this.data(DATA_ORIGINALTITLE, title);
|
@@ -123,33 +145,45 @@
|
|
123
145
|
);
|
124
146
|
});
|
125
147
|
|
126
|
-
// attach events to matched elements if the manual
|
148
|
+
// attach events to matched elements if the manual option is not enabled
|
127
149
|
if (!options.manual) {
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
}
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
}
|
140
|
-
|
150
|
+
// attach open events
|
151
|
+
$.each(options.openEvents, function(idx, evt) {
|
152
|
+
if ($.inArray(evt, options.closeEvents) > -1) {
|
153
|
+
// event is in both openEvents and closeEvents, so toggle it
|
154
|
+
targetElements.on(evt + EVENT_NAMESPACE, function elementToggle(event) {
|
155
|
+
$.powerTip.toggle(this, event);
|
156
|
+
});
|
157
|
+
} else {
|
158
|
+
targetElements.on(evt + EVENT_NAMESPACE, function elementOpen(event) {
|
159
|
+
$.powerTip.show(this, event);
|
160
|
+
});
|
161
|
+
}
|
162
|
+
});
|
163
|
+
|
164
|
+
// attach close events
|
165
|
+
$.each(options.closeEvents, function(idx, evt) {
|
166
|
+
if ($.inArray(evt, options.openEvents) < 0) {
|
167
|
+
targetElements.on(evt + EVENT_NAMESPACE, function elementClose(event) {
|
168
|
+
// set immediate to true for any event without mouse info
|
169
|
+
$.powerTip.hide(this, !isMouseEvent(event));
|
170
|
+
});
|
171
|
+
}
|
172
|
+
});
|
173
|
+
|
174
|
+
// attach escape key close event
|
175
|
+
targetElements.on('keydown' + EVENT_NAMESPACE, function elementKeyDown(event) {
|
176
|
+
// always close tooltip when the escape key is pressed
|
177
|
+
if (event.keyCode === 27) {
|
141
178
|
$.powerTip.hide(this, true);
|
142
|
-
},
|
143
|
-
'keydown.powertip': function elementKeyDown(event) {
|
144
|
-
// close tooltip when the escape key is pressed
|
145
|
-
if (event.keyCode === 27) {
|
146
|
-
$.powerTip.hide(this, true);
|
147
|
-
}
|
148
179
|
}
|
149
180
|
});
|
150
181
|
}
|
151
182
|
|
152
|
-
|
183
|
+
// remember elements that the plugin is attached to
|
184
|
+
session.elements = session.elements ? session.elements.add(targetElements) : targetElements;
|
185
|
+
|
186
|
+
return targetElements;
|
153
187
|
};
|
154
188
|
|
155
189
|
/**
|
@@ -160,6 +194,7 @@
|
|
160
194
|
fadeOutTime: 100,
|
161
195
|
followMouse: false,
|
162
196
|
popupId: 'powerTip',
|
197
|
+
popupClass: null,
|
163
198
|
intentSensitivity: 7,
|
164
199
|
intentPollInterval: 100,
|
165
200
|
closeDelay: 100,
|
@@ -167,7 +202,9 @@
|
|
167
202
|
smartPlacement: false,
|
168
203
|
offset: 10,
|
169
204
|
mouseOnToPopup: false,
|
170
|
-
manual: false
|
205
|
+
manual: false,
|
206
|
+
openEvents: [ 'mouseenter', 'focus' ],
|
207
|
+
closeEvents: [ 'mouseleave', 'blur' ]
|
171
208
|
};
|
172
209
|
|
173
210
|
/**
|
@@ -177,18 +214,18 @@
|
|
177
214
|
* do not fit.
|
178
215
|
*/
|
179
216
|
$.fn.powerTip.smartPlacementLists = {
|
180
|
-
n: ['n', 'ne', 'nw', 's'],
|
181
|
-
e: ['e', 'ne', 'se', 'w', 'nw', 'sw', 'n', 's', 'e'],
|
182
|
-
s: ['s', 'se', 'sw', 'n'],
|
183
|
-
w: ['w', 'nw', 'sw', 'e', 'ne', 'se', 'n', 's', 'w'],
|
184
|
-
nw: ['nw', 'w', 'sw', 'n', 's', 'se', 'nw'],
|
185
|
-
ne: ['ne', 'e', 'se', 'n', 's', 'sw', 'ne'],
|
186
|
-
sw: ['sw', 'w', 'nw', 's', 'n', 'ne', 'sw'],
|
187
|
-
se: ['se', 'e', 'ne', 's', 'n', 'nw', 'se'],
|
188
|
-
'nw-alt': ['nw-alt', 'n', 'ne-alt', 'sw-alt', 's', 'se-alt', 'w', 'e'],
|
189
|
-
'ne-alt': ['ne-alt', 'n', 'nw-alt', 'se-alt', 's', 'sw-alt', 'e', 'w'],
|
190
|
-
'sw-alt': ['sw-alt', 's', 'se-alt', 'nw-alt', 'n', 'ne-alt', 'w', 'e'],
|
191
|
-
'se-alt': ['se-alt', 's', 'sw-alt', 'ne-alt', 'n', 'nw-alt', 'e', 'w']
|
217
|
+
n: [ 'n', 'ne', 'nw', 's' ],
|
218
|
+
e: [ 'e', 'ne', 'se', 'w', 'nw', 'sw', 'n', 's', 'e' ],
|
219
|
+
s: [ 's', 'se', 'sw', 'n' ],
|
220
|
+
w: [ 'w', 'nw', 'sw', 'e', 'ne', 'se', 'n', 's', 'w' ],
|
221
|
+
nw: [ 'nw', 'w', 'sw', 'n', 's', 'se', 'nw' ],
|
222
|
+
ne: [ 'ne', 'e', 'se', 'n', 's', 'sw', 'ne' ],
|
223
|
+
sw: [ 'sw', 'w', 'nw', 's', 'n', 'ne', 'sw' ],
|
224
|
+
se: [ 'se', 'e', 'ne', 's', 'n', 'nw', 'se' ],
|
225
|
+
'nw-alt': [ 'nw-alt', 'n', 'ne-alt', 'sw-alt', 's', 'se-alt', 'w', 'e' ],
|
226
|
+
'ne-alt': [ 'ne-alt', 'n', 'nw-alt', 'se-alt', 's', 'sw-alt', 'e', 'w' ],
|
227
|
+
'sw-alt': [ 'sw-alt', 's', 'se-alt', 'nw-alt', 'n', 'ne-alt', 'w', 'e' ],
|
228
|
+
'se-alt': [ 'se-alt', 's', 'sw-alt', 'ne-alt', 'n', 'nw-alt', 'e', 'w' ]
|
192
229
|
};
|
193
230
|
|
194
231
|
/**
|
@@ -200,9 +237,12 @@
|
|
200
237
|
* @param {jQuery|Element} element The element to open the tooltip for.
|
201
238
|
* @param {jQuery.Event=} event jQuery event for hover intent and mouse
|
202
239
|
* tracking (optional).
|
240
|
+
* @return {jQuery|Element} The original jQuery object or DOM Element.
|
203
241
|
*/
|
204
242
|
show: function apiShowTip(element, event) {
|
205
|
-
if
|
243
|
+
// if we were given a mouse event then run the hover intent testing,
|
244
|
+
// otherwise, simply show the tooltip asap
|
245
|
+
if (isMouseEvent(event)) {
|
206
246
|
trackMouse(event);
|
207
247
|
session.previousX = event.pageX;
|
208
248
|
session.previousY = event.pageY;
|
@@ -216,6 +256,7 @@
|
|
216
256
|
/**
|
217
257
|
* Repositions the tooltip on the element.
|
218
258
|
* @param {jQuery|Element} element The element the tooltip is shown for.
|
259
|
+
* @return {jQuery|Element} The original jQuery object or DOM Element.
|
219
260
|
*/
|
220
261
|
reposition: function apiResetPosition(element) {
|
221
262
|
$(element).first().data(DATA_DISPLAYCONTROLLER).resetPosition();
|
@@ -227,24 +268,80 @@
|
|
227
268
|
* @param {(jQuery|Element)=} element The element with the tooltip that
|
228
269
|
* should be closed (optional).
|
229
270
|
* @param {boolean=} immediate Disable close delay (optional).
|
271
|
+
* @return {jQuery|Element|undefined} The original jQuery object or DOM
|
272
|
+
* Element, if one was specified.
|
230
273
|
*/
|
231
274
|
hide: function apiCloseTip(element, immediate) {
|
275
|
+
var displayController;
|
276
|
+
|
277
|
+
// set immediate to true when no element is specified
|
278
|
+
immediate = element ? immediate : true;
|
279
|
+
|
280
|
+
// find the relevant display controller
|
232
281
|
if (element) {
|
233
|
-
$(element).first().data(DATA_DISPLAYCONTROLLER)
|
282
|
+
displayController = $(element).first().data(DATA_DISPLAYCONTROLLER);
|
283
|
+
} else if (session.activeHover) {
|
284
|
+
displayController = session.activeHover.data(DATA_DISPLAYCONTROLLER);
|
285
|
+
}
|
286
|
+
|
287
|
+
// if found, hide the tip
|
288
|
+
if (displayController) {
|
289
|
+
displayController.hide(immediate);
|
290
|
+
}
|
291
|
+
|
292
|
+
return element;
|
293
|
+
},
|
294
|
+
|
295
|
+
/**
|
296
|
+
* Toggles the tooltip for the specified element. This will open a closed
|
297
|
+
* tooltip, or close an open tooltip.
|
298
|
+
* @param {jQuery|Element} element The element with the tooltip that
|
299
|
+
* should be toggled.
|
300
|
+
* @param {jQuery.Event=} event jQuery event for hover intent and mouse
|
301
|
+
* tracking (optional).
|
302
|
+
* @return {jQuery|Element} The original jQuery object or DOM Element.
|
303
|
+
*/
|
304
|
+
toggle: function apiToggle(element, event) {
|
305
|
+
if (session.activeHover && session.activeHover.is(element)) {
|
306
|
+
// tooltip for element is active, so close it
|
307
|
+
$.powerTip.hide(element, !isMouseEvent(event));
|
234
308
|
} else {
|
235
|
-
|
236
|
-
|
237
|
-
}
|
309
|
+
// tooltip for element is not active, so open it
|
310
|
+
$.powerTip.show(element, event);
|
238
311
|
}
|
239
312
|
return element;
|
240
313
|
},
|
241
314
|
|
242
315
|
/**
|
243
|
-
* Destroy and roll back any powerTip() instance on the specified
|
244
|
-
*
|
316
|
+
* Destroy and roll back any powerTip() instance on the specified elements.
|
317
|
+
* If no elements are specified then all elements that the plugin is
|
318
|
+
* currently attached to will be rolled back.
|
319
|
+
* @param {(jQuery|Element)=} element The element with the powerTip instance.
|
320
|
+
* @return {jQuery|Element|undefined} The original jQuery object or DOM
|
321
|
+
* Element, if one was specified.
|
245
322
|
*/
|
246
323
|
destroy: function apiDestroy(element) {
|
247
|
-
$
|
324
|
+
var $element = element ? $(element) : session.elements;
|
325
|
+
|
326
|
+
// if the plugin is not hooked to any elements then there is no point
|
327
|
+
// trying to destroy anything, or dealing with the possible errors
|
328
|
+
if (!session.elements || session.elements.length === 0) {
|
329
|
+
return element;
|
330
|
+
}
|
331
|
+
|
332
|
+
// if a tooltip is currently open for an element we are being asked to
|
333
|
+
// destroy then it should be forced to close
|
334
|
+
if (session.isTipOpen && !session.isClosing && $element.filter(session.activeHover).length > 0) {
|
335
|
+
// if the tooltip is waiting to close then cancel that delay timer
|
336
|
+
if (session.delayInProgress) {
|
337
|
+
session.activeHover.data(DATA_DISPLAYCONTROLLER).cancel();
|
338
|
+
}
|
339
|
+
// hide the tooltip, immediately
|
340
|
+
$.powerTip.hide(session.activeHover, true);
|
341
|
+
}
|
342
|
+
|
343
|
+
// unhook events and destroy plugin changes to each element
|
344
|
+
$element.off(EVENT_NAMESPACE).each(function destroy() {
|
248
345
|
var $this = $(this),
|
249
346
|
dataAttributes = [
|
250
347
|
DATA_ORIGINALTITLE,
|
@@ -253,13 +350,29 @@
|
|
253
350
|
DATA_FORCEDOPEN
|
254
351
|
];
|
255
352
|
|
353
|
+
// revert title attribute
|
256
354
|
if ($this.data(DATA_ORIGINALTITLE)) {
|
257
355
|
$this.attr('title', $this.data(DATA_ORIGINALTITLE));
|
258
356
|
dataAttributes.push(DATA_POWERTIP);
|
259
357
|
}
|
260
358
|
|
359
|
+
// remove data attributes
|
261
360
|
$this.removeData(dataAttributes);
|
262
361
|
});
|
362
|
+
|
363
|
+
// remove destroyed element from active elements collection
|
364
|
+
session.elements = session.elements.not($element);
|
365
|
+
|
366
|
+
// if there are no active elements left then we will unhook all of the
|
367
|
+
// events that we've bound code to and remove the tooltip elements
|
368
|
+
if (session.elements.length === 0) {
|
369
|
+
$window.off(EVENT_NAMESPACE);
|
370
|
+
$document.off(EVENT_NAMESPACE);
|
371
|
+
session.mouseTrackingActive = false;
|
372
|
+
session.tooltips.remove();
|
373
|
+
session.tooltips = null;
|
374
|
+
}
|
375
|
+
|
263
376
|
return element;
|
264
377
|
}
|
265
378
|
};
|
@@ -305,7 +418,8 @@
|
|
305
418
|
* this instance.
|
306
419
|
*/
|
307
420
|
function DisplayController(element, options, tipController) {
|
308
|
-
var hoverTimer = null
|
421
|
+
var hoverTimer = null,
|
422
|
+
myCloseDelay = null;
|
309
423
|
|
310
424
|
/**
|
311
425
|
* Begins the process of showing a tooltip.
|
@@ -330,8 +444,12 @@
|
|
330
444
|
if (forceOpen) {
|
331
445
|
element.data(DATA_FORCEDOPEN, true);
|
332
446
|
}
|
447
|
+
closeAnyDelayed();
|
333
448
|
tipController.showTip(element);
|
334
449
|
}
|
450
|
+
} else {
|
451
|
+
// cursor left and returned to this element, cancel close
|
452
|
+
cancelClose();
|
335
453
|
}
|
336
454
|
}
|
337
455
|
|
@@ -341,20 +459,29 @@
|
|
341
459
|
* @param {boolean=} disableDelay Disable close delay (optional).
|
342
460
|
*/
|
343
461
|
function closeTooltip(disableDelay) {
|
462
|
+
// if this instance already has a close delay in progress then halt it
|
463
|
+
if (myCloseDelay) {
|
464
|
+
myCloseDelay = session.closeDelayTimeout = clearTimeout(myCloseDelay);
|
465
|
+
session.delayInProgress = false;
|
466
|
+
}
|
344
467
|
cancelTimer();
|
345
468
|
session.tipOpenImminent = false;
|
346
469
|
if (element.data(DATA_HASACTIVEHOVER)) {
|
347
470
|
element.data(DATA_FORCEDOPEN, false);
|
348
471
|
if (!disableDelay) {
|
349
472
|
session.delayInProgress = true;
|
350
|
-
|
473
|
+
session.closeDelayTimeout = setTimeout(
|
351
474
|
function closeDelay() {
|
352
|
-
|
475
|
+
session.closeDelayTimeout = null;
|
353
476
|
tipController.hideTip(element);
|
354
477
|
session.delayInProgress = false;
|
478
|
+
myCloseDelay = null;
|
355
479
|
},
|
356
480
|
options.closeDelay
|
357
481
|
);
|
482
|
+
// save internal reference close delay id so we can check if the
|
483
|
+
// active close delay belongs to this instance
|
484
|
+
myCloseDelay = session.closeDelayTimeout;
|
358
485
|
} else {
|
359
486
|
tipController.hideTip(element);
|
360
487
|
}
|
@@ -374,6 +501,8 @@
|
|
374
501
|
|
375
502
|
// check if difference has passed the sensitivity threshold
|
376
503
|
if (totalDifference < options.intentSensitivity) {
|
504
|
+
cancelClose();
|
505
|
+
closeAnyDelayed();
|
377
506
|
tipController.showTip(element);
|
378
507
|
} else {
|
379
508
|
// try again
|
@@ -386,12 +515,39 @@
|
|
386
515
|
/**
|
387
516
|
* Cancels active hover timer.
|
388
517
|
* @private
|
518
|
+
* @param {boolean=} stopClose Cancel any active close delay timer.
|
389
519
|
*/
|
390
|
-
function cancelTimer() {
|
520
|
+
function cancelTimer(stopClose) {
|
391
521
|
hoverTimer = clearTimeout(hoverTimer);
|
522
|
+
// cancel the current close delay if the active close delay is for this
|
523
|
+
// element or the stopClose argument is true
|
524
|
+
if (session.closeDelayTimeout && myCloseDelay === session.closeDelayTimeout || stopClose) {
|
525
|
+
cancelClose();
|
526
|
+
}
|
527
|
+
}
|
528
|
+
|
529
|
+
/**
|
530
|
+
* Cancels any active close delay timer.
|
531
|
+
* @private
|
532
|
+
*/
|
533
|
+
function cancelClose() {
|
534
|
+
session.closeDelayTimeout = clearTimeout(session.closeDelayTimeout);
|
392
535
|
session.delayInProgress = false;
|
393
536
|
}
|
394
537
|
|
538
|
+
/**
|
539
|
+
* Asks any tooltips waiting on their close delay to close now.
|
540
|
+
* @private
|
541
|
+
*/
|
542
|
+
function closeAnyDelayed() {
|
543
|
+
// if another element is waiting for its close delay then we should ask
|
544
|
+
// it to close immediately so we can proceed without unexpected timeout
|
545
|
+
// code being run during this tooltip's lifecycle
|
546
|
+
if (session.delayInProgress && session.activeHover && !session.activeHover.is(element)) {
|
547
|
+
session.activeHover.data(DATA_DISPLAYCONTROLLER).hide(true);
|
548
|
+
}
|
549
|
+
}
|
550
|
+
|
395
551
|
/**
|
396
552
|
* Repositions the tooltip on this element.
|
397
553
|
* @private
|
@@ -437,54 +593,54 @@
|
|
437
593
|
|
438
594
|
// calculate the appropriate x and y position in the document
|
439
595
|
switch (placement) {
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
596
|
+
case 'n':
|
597
|
+
coords.set('left', position.left - (tipWidth / 2));
|
598
|
+
coords.set('bottom', session.windowHeight - position.top + offset);
|
599
|
+
break;
|
600
|
+
case 'e':
|
601
|
+
coords.set('left', position.left + offset);
|
602
|
+
coords.set('top', position.top - (tipHeight / 2));
|
603
|
+
break;
|
604
|
+
case 's':
|
605
|
+
coords.set('left', position.left - (tipWidth / 2));
|
606
|
+
coords.set('top', position.top + offset);
|
607
|
+
break;
|
608
|
+
case 'w':
|
609
|
+
coords.set('top', position.top - (tipHeight / 2));
|
610
|
+
coords.set('right', session.windowWidth - position.left + offset);
|
611
|
+
break;
|
612
|
+
case 'nw':
|
613
|
+
coords.set('bottom', session.windowHeight - position.top + offset);
|
614
|
+
coords.set('right', session.windowWidth - position.left - 20);
|
615
|
+
break;
|
616
|
+
case 'nw-alt':
|
617
|
+
coords.set('left', position.left);
|
618
|
+
coords.set('bottom', session.windowHeight - position.top + offset);
|
619
|
+
break;
|
620
|
+
case 'ne':
|
621
|
+
coords.set('left', position.left - 20);
|
622
|
+
coords.set('bottom', session.windowHeight - position.top + offset);
|
623
|
+
break;
|
624
|
+
case 'ne-alt':
|
625
|
+
coords.set('bottom', session.windowHeight - position.top + offset);
|
626
|
+
coords.set('right', session.windowWidth - position.left);
|
627
|
+
break;
|
628
|
+
case 'sw':
|
629
|
+
coords.set('top', position.top + offset);
|
630
|
+
coords.set('right', session.windowWidth - position.left - 20);
|
631
|
+
break;
|
632
|
+
case 'sw-alt':
|
633
|
+
coords.set('left', position.left);
|
634
|
+
coords.set('top', position.top + offset);
|
635
|
+
break;
|
636
|
+
case 'se':
|
637
|
+
coords.set('left', position.left - 20);
|
638
|
+
coords.set('top', position.top + offset);
|
639
|
+
break;
|
640
|
+
case 'se-alt':
|
641
|
+
coords.set('top', position.top + offset);
|
642
|
+
coords.set('right', session.windowWidth - position.left);
|
643
|
+
break;
|
488
644
|
}
|
489
645
|
|
490
646
|
return coords;
|
@@ -507,38 +663,38 @@
|
|
507
663
|
|
508
664
|
// calculate the appropriate x and y position in the document
|
509
665
|
switch (placement) {
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
666
|
+
case 'n':
|
667
|
+
left = objectOffset.left + objectWidth / 2;
|
668
|
+
top = objectOffset.top;
|
669
|
+
break;
|
670
|
+
case 'e':
|
671
|
+
left = objectOffset.left + objectWidth;
|
672
|
+
top = objectOffset.top + objectHeight / 2;
|
673
|
+
break;
|
674
|
+
case 's':
|
675
|
+
left = objectOffset.left + objectWidth / 2;
|
676
|
+
top = objectOffset.top + objectHeight;
|
677
|
+
break;
|
678
|
+
case 'w':
|
679
|
+
left = objectOffset.left;
|
680
|
+
top = objectOffset.top + objectHeight / 2;
|
681
|
+
break;
|
682
|
+
case 'nw':
|
683
|
+
left = objectOffset.left;
|
684
|
+
top = objectOffset.top;
|
685
|
+
break;
|
686
|
+
case 'ne':
|
687
|
+
left = objectOffset.left + objectWidth;
|
688
|
+
top = objectOffset.top;
|
689
|
+
break;
|
690
|
+
case 'sw':
|
691
|
+
left = objectOffset.left;
|
692
|
+
top = objectOffset.top + objectHeight;
|
693
|
+
break;
|
694
|
+
case 'se':
|
695
|
+
left = objectOffset.left + objectWidth;
|
696
|
+
top = objectOffset.top + objectHeight;
|
697
|
+
break;
|
542
698
|
}
|
543
699
|
|
544
700
|
return {
|
@@ -564,12 +720,16 @@
|
|
564
720
|
halfWidth = boundingBox.width / 2,
|
565
721
|
halfHeight = boundingBox.height / 2,
|
566
722
|
placements = [],
|
567
|
-
placementKeys = ['nw', 'n', 'ne', 'e', 'se', 's', 'sw', 'w'],
|
723
|
+
placementKeys = [ 'nw', 'n', 'ne', 'e', 'se', 's', 'sw', 'w' ],
|
568
724
|
coords,
|
569
725
|
rotation,
|
570
726
|
steps,
|
571
727
|
x;
|
572
728
|
|
729
|
+
/**
|
730
|
+
* Transform and append the current points to the placements list.
|
731
|
+
* @private
|
732
|
+
*/
|
573
733
|
function pushPlacement() {
|
574
734
|
placements.push(point.matrixTransform(matrix));
|
575
735
|
}
|
@@ -642,44 +802,20 @@
|
|
642
802
|
$body = $('body');
|
643
803
|
}
|
644
804
|
$body.append(tipElement);
|
805
|
+
// remember the tooltip elements that the plugin has created
|
806
|
+
session.tooltips = session.tooltips ? session.tooltips.add(tipElement) : tipElement;
|
645
807
|
}
|
646
808
|
|
647
809
|
// hook mousemove for cursor follow tooltips
|
648
810
|
if (options.followMouse) {
|
649
811
|
// only one positionTipOnCursor hook per tooltip element, please
|
650
812
|
if (!tipElement.data(DATA_HASMOUSEMOVE)) {
|
651
|
-
$document.on('mousemove', positionTipOnCursor);
|
652
|
-
$window.on('scroll', positionTipOnCursor);
|
813
|
+
$document.on('mousemove' + EVENT_NAMESPACE, positionTipOnCursor);
|
814
|
+
$window.on('scroll' + EVENT_NAMESPACE, positionTipOnCursor);
|
653
815
|
tipElement.data(DATA_HASMOUSEMOVE, true);
|
654
816
|
}
|
655
817
|
}
|
656
818
|
|
657
|
-
// if we want to be able to mouse onto the tooltip then we need to attach
|
658
|
-
// hover events to the tooltip that will cancel a close request on hover and
|
659
|
-
// start a new close request on mouseleave
|
660
|
-
if (options.mouseOnToPopup) {
|
661
|
-
tipElement.on({
|
662
|
-
mouseenter: function tipMouseEnter() {
|
663
|
-
// we only let the mouse stay on the tooltip if it is set to let
|
664
|
-
// users interact with it
|
665
|
-
if (tipElement.data(DATA_MOUSEONTOTIP)) {
|
666
|
-
// check activeHover in case the mouse cursor entered the
|
667
|
-
// tooltip during the fadeOut and close cycle
|
668
|
-
if (session.activeHover) {
|
669
|
-
session.activeHover.data(DATA_DISPLAYCONTROLLER).cancel();
|
670
|
-
}
|
671
|
-
}
|
672
|
-
},
|
673
|
-
mouseleave: function tipMouseLeave() {
|
674
|
-
// check activeHover in case the mouse cursor entered the
|
675
|
-
// tooltip during the fadeOut and close cycle
|
676
|
-
if (session.activeHover) {
|
677
|
-
session.activeHover.data(DATA_DISPLAYCONTROLLER).hide();
|
678
|
-
}
|
679
|
-
}
|
680
|
-
});
|
681
|
-
}
|
682
|
-
|
683
819
|
/**
|
684
820
|
* Gives the specified element the active-hover state and queues up the
|
685
821
|
* showTip function.
|
@@ -745,14 +881,60 @@
|
|
745
881
|
|
746
882
|
tipElement.data(DATA_MOUSEONTOTIP, options.mouseOnToPopup);
|
747
883
|
|
884
|
+
// add custom class to tooltip element
|
885
|
+
tipElement.addClass(options.popupClass);
|
886
|
+
|
748
887
|
// set tooltip position
|
749
|
-
|
888
|
+
// revert to static placement when the "force open" flag was set because
|
889
|
+
// that flag means that we do not have accurate mouse position info
|
890
|
+
if (!options.followMouse || element.data(DATA_FORCEDOPEN)) {
|
750
891
|
positionTipOnElement(element);
|
751
892
|
session.isFixedTipOpen = true;
|
752
893
|
} else {
|
753
894
|
positionTipOnCursor();
|
754
895
|
}
|
755
896
|
|
897
|
+
// close tooltip when clicking anywhere on the page, with the exception
|
898
|
+
// of the tooltip's trigger element and any elements that are within a
|
899
|
+
// tooltip that has 'mouseOnToPopup' option enabled
|
900
|
+
// always enable this feature when the "force open" flag is set on a
|
901
|
+
// followMouse tooltip because we reverted to static placement above
|
902
|
+
if (!element.data(DATA_FORCEDOPEN) && !options.followMouse) {
|
903
|
+
$document.on('click' + EVENT_NAMESPACE, function documentClick(event) {
|
904
|
+
var target = event.target;
|
905
|
+
if (target !== element[0]) {
|
906
|
+
if (options.mouseOnToPopup) {
|
907
|
+
if (target !== tipElement[0] && !$.contains(tipElement[0], target)) {
|
908
|
+
$.powerTip.hide();
|
909
|
+
}
|
910
|
+
} else {
|
911
|
+
$.powerTip.hide();
|
912
|
+
}
|
913
|
+
}
|
914
|
+
});
|
915
|
+
}
|
916
|
+
|
917
|
+
// if we want to be able to mouse on to the tooltip then we need to
|
918
|
+
// attach hover events to the tooltip that will cancel a close request
|
919
|
+
// on mouseenter and start a new close request on mouseleave
|
920
|
+
// only hook these listeners if we're not in manual mode
|
921
|
+
if (options.mouseOnToPopup && !options.manual) {
|
922
|
+
tipElement.on('mouseenter' + EVENT_NAMESPACE, function tipMouseEnter() {
|
923
|
+
// check activeHover in case the mouse cursor entered the
|
924
|
+
// tooltip during the fadeOut and close cycle
|
925
|
+
if (session.activeHover) {
|
926
|
+
session.activeHover.data(DATA_DISPLAYCONTROLLER).cancel();
|
927
|
+
}
|
928
|
+
});
|
929
|
+
tipElement.on('mouseleave' + EVENT_NAMESPACE, function tipMouseLeave() {
|
930
|
+
// check activeHover in case the mouse cursor left the tooltip
|
931
|
+
// during the fadeOut and close cycle
|
932
|
+
if (session.activeHover) {
|
933
|
+
session.activeHover.data(DATA_DISPLAYCONTROLLER).hide();
|
934
|
+
}
|
935
|
+
});
|
936
|
+
}
|
937
|
+
|
756
938
|
// fadein
|
757
939
|
tipElement.fadeIn(options.fadeInTime, function fadeInCallback() {
|
758
940
|
// start desync polling
|
@@ -773,7 +955,6 @@
|
|
773
955
|
function hideTip(element) {
|
774
956
|
// reset session
|
775
957
|
session.isClosing = true;
|
776
|
-
session.activeHover = null;
|
777
958
|
session.isTipOpen = false;
|
778
959
|
|
779
960
|
// stop desync polling
|
@@ -783,11 +964,18 @@
|
|
783
964
|
element.data(DATA_HASACTIVEHOVER, false);
|
784
965
|
element.data(DATA_FORCEDOPEN, false);
|
785
966
|
|
967
|
+
// remove document click handler
|
968
|
+
$document.off('click' + EVENT_NAMESPACE);
|
969
|
+
|
970
|
+
// unbind the mouseOnToPopup events if they were set
|
971
|
+
tipElement.off(EVENT_NAMESPACE);
|
972
|
+
|
786
973
|
// fade out
|
787
974
|
tipElement.fadeOut(options.fadeOutTime, function fadeOutCallback() {
|
788
975
|
var coords = new CSSCoordinates();
|
789
976
|
|
790
977
|
// reset session and tooltip element
|
978
|
+
session.activeHover = null;
|
791
979
|
session.isClosing = false;
|
792
980
|
session.isFixedTipOpen = false;
|
793
981
|
tipElement.removeClass();
|
@@ -808,6 +996,12 @@
|
|
808
996
|
* @private
|
809
997
|
*/
|
810
998
|
function positionTipOnCursor() {
|
999
|
+
var tipWidth,
|
1000
|
+
tipHeight,
|
1001
|
+
coords,
|
1002
|
+
collisions,
|
1003
|
+
collisionCount;
|
1004
|
+
|
811
1005
|
// to support having fixed tooltips on the same page as cursor tooltips,
|
812
1006
|
// where both instances are referencing the same tooltip element, we
|
813
1007
|
// need to keep track of the mouse position constantly, but we should
|
@@ -816,11 +1010,9 @@
|
|
816
1010
|
// have a mouse-follow using it.
|
817
1011
|
if (!session.isFixedTipOpen && (session.isTipOpen || (session.tipOpenImminent && tipElement.data(DATA_HASMOUSEMOVE)))) {
|
818
1012
|
// grab measurements
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
collisions,
|
823
|
-
collisionCount;
|
1013
|
+
tipWidth = tipElement.outerWidth();
|
1014
|
+
tipHeight = tipElement.outerHeight();
|
1015
|
+
coords = new CSSCoordinates();
|
824
1016
|
|
825
1017
|
// grab collisions
|
826
1018
|
coords.set('top', session.currentY + options.offset);
|
@@ -838,7 +1030,7 @@
|
|
838
1030
|
// if there is only one collision (bottom or right) then
|
839
1031
|
// simply constrain the tooltip to the view port
|
840
1032
|
if (collisions === Collision.right) {
|
841
|
-
coords.set('left', session.windowWidth - tipWidth);
|
1033
|
+
coords.set('left', session.scrollLeft + session.windowWidth - tipWidth);
|
842
1034
|
} else if (collisions === Collision.bottom) {
|
843
1035
|
coords.set('top', session.scrollTop + session.windowHeight - tipHeight);
|
844
1036
|
}
|
@@ -866,7 +1058,10 @@
|
|
866
1058
|
var priorityList,
|
867
1059
|
finalPlacement;
|
868
1060
|
|
869
|
-
|
1061
|
+
// when the followMouse option is enabled and the "force open" flag is
|
1062
|
+
// set we revert to static positioning. since the developer may not have
|
1063
|
+
// considered this scenario we should use smart placement
|
1064
|
+
if (options.smartPlacement || (options.followMouse && element.data(DATA_FORCEDOPEN))) {
|
870
1065
|
priorityList = $.fn.powerTip.smartPlacementLists[options.placement];
|
871
1066
|
|
872
1067
|
// iterate over the priority list and use the first placement option
|
@@ -884,9 +1079,7 @@
|
|
884
1079
|
finalPlacement = pos;
|
885
1080
|
|
886
1081
|
// break if there were no collisions
|
887
|
-
|
888
|
-
return false;
|
889
|
-
}
|
1082
|
+
return collisions !== Collision.none;
|
890
1083
|
});
|
891
1084
|
} else {
|
892
1085
|
// if we're not going to use the smart placement feature then just
|
@@ -896,6 +1089,7 @@
|
|
896
1089
|
}
|
897
1090
|
|
898
1091
|
// add placement as class for CSS arrows
|
1092
|
+
tipElement.removeClass('w nw sw e ne se n s w se-alt sw-alt ne-alt nw-alt');
|
899
1093
|
tipElement.addClass(finalPlacement);
|
900
1094
|
}
|
901
1095
|
|
@@ -953,18 +1147,25 @@
|
|
953
1147
|
* @private
|
954
1148
|
*/
|
955
1149
|
function closeDesyncedTip() {
|
956
|
-
var isDesynced = false
|
1150
|
+
var isDesynced = false,
|
1151
|
+
hasDesyncableCloseEvent = $.grep(
|
1152
|
+
[ 'mouseleave', 'mouseout', 'blur', 'focusout' ],
|
1153
|
+
function(eventType) {
|
1154
|
+
return $.inArray(eventType, options.closeEvents) !== -1;
|
1155
|
+
}
|
1156
|
+
).length > 0;
|
1157
|
+
|
957
1158
|
// It is possible for the mouse cursor to leave an element without
|
958
1159
|
// firing the mouseleave or blur event. This most commonly happens when
|
959
1160
|
// the element is disabled under mouse cursor. If this happens it will
|
960
1161
|
// result in a desynced tooltip because the tooltip was never asked to
|
961
1162
|
// close. So we should periodically check for a desync situation and
|
962
1163
|
// close the tip if such a situation arises.
|
963
|
-
if (session.isTipOpen && !session.isClosing && !session.delayInProgress) {
|
964
|
-
// user moused onto another tip or active hover is disabled
|
1164
|
+
if (session.isTipOpen && !session.isClosing && !session.delayInProgress && hasDesyncableCloseEvent) {
|
965
1165
|
if (session.activeHover.data(DATA_HASACTIVEHOVER) === false || session.activeHover.is(':disabled')) {
|
1166
|
+
// user moused onto another tip or active hover is disabled
|
966
1167
|
isDesynced = true;
|
967
|
-
} else {
|
1168
|
+
} else if (!isMouseOver(session.activeHover) && !session.activeHover.is(':focus') && !session.activeHover.data(DATA_FORCEDOPEN)) {
|
968
1169
|
// hanging tip - have to test if mouse position is not over the
|
969
1170
|
// active hover and not over a tooltip set to let the user
|
970
1171
|
// interact with it.
|
@@ -972,14 +1173,12 @@
|
|
972
1173
|
// not have focus.
|
973
1174
|
// for tooltips opened via the api: we need to check if it has
|
974
1175
|
// the forcedOpen flag.
|
975
|
-
if (
|
976
|
-
if (tipElement
|
977
|
-
if (!isMouseOver(tipElement)) {
|
978
|
-
isDesynced = true;
|
979
|
-
}
|
980
|
-
} else {
|
1176
|
+
if (tipElement.data(DATA_MOUSEONTOTIP)) {
|
1177
|
+
if (!isMouseOver(tipElement)) {
|
981
1178
|
isDesynced = true;
|
982
1179
|
}
|
1180
|
+
} else {
|
1181
|
+
isDesynced = true;
|
983
1182
|
}
|
984
1183
|
}
|
985
1184
|
|
@@ -1003,7 +1202,18 @@
|
|
1003
1202
|
* @return {boolean} Whether this is an SVG element
|
1004
1203
|
*/
|
1005
1204
|
function isSvgElement(element) {
|
1006
|
-
return window.SVGElement && element[0] instanceof SVGElement;
|
1205
|
+
return Boolean(window.SVGElement && element[0] instanceof SVGElement);
|
1206
|
+
}
|
1207
|
+
|
1208
|
+
/**
|
1209
|
+
* Determines if the specified jQuery.Event object has mouse data.
|
1210
|
+
* @private
|
1211
|
+
* @param {jQuery.Event=} event The jQuery.Event object to test.
|
1212
|
+
* @return {boolean} True if there is mouse data, otherwise false.
|
1213
|
+
*/
|
1214
|
+
function isMouseEvent(event) {
|
1215
|
+
return Boolean(event && $.inArray(event.type, MOUSE_EVENTS) > -1 &&
|
1216
|
+
typeof event.pageX === 'number');
|
1007
1217
|
}
|
1008
1218
|
|
1009
1219
|
/**
|
@@ -1017,35 +1227,52 @@
|
|
1017
1227
|
session.mouseTrackingActive = true;
|
1018
1228
|
|
1019
1229
|
// grab the current viewport dimensions on load
|
1020
|
-
|
1021
|
-
|
1022
|
-
session.scrollTop = $window.scrollTop();
|
1023
|
-
session.windowWidth = $window.width();
|
1024
|
-
session.windowHeight = $window.height();
|
1025
|
-
});
|
1230
|
+
getViewportDimensions();
|
1231
|
+
$(getViewportDimensions);
|
1026
1232
|
|
1027
1233
|
// hook mouse move tracking
|
1028
|
-
$document.on('mousemove', trackMouse);
|
1234
|
+
$document.on('mousemove' + EVENT_NAMESPACE, trackMouse);
|
1029
1235
|
|
1030
1236
|
// hook viewport dimensions tracking
|
1031
|
-
$window.on(
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1237
|
+
$window.on('resize' + EVENT_NAMESPACE, trackResize);
|
1238
|
+
$window.on('scroll' + EVENT_NAMESPACE, trackScroll);
|
1239
|
+
}
|
1240
|
+
}
|
1241
|
+
|
1242
|
+
/**
|
1243
|
+
* Updates the viewport dimensions cache.
|
1244
|
+
* @private
|
1245
|
+
*/
|
1246
|
+
function getViewportDimensions() {
|
1247
|
+
session.scrollLeft = $window.scrollLeft();
|
1248
|
+
session.scrollTop = $window.scrollTop();
|
1249
|
+
session.windowWidth = $window.width();
|
1250
|
+
session.windowHeight = $window.height();
|
1251
|
+
}
|
1252
|
+
|
1253
|
+
/**
|
1254
|
+
* Updates the window size info in the viewport dimensions cache.
|
1255
|
+
* @private
|
1256
|
+
*/
|
1257
|
+
function trackResize() {
|
1258
|
+
session.windowWidth = $window.width();
|
1259
|
+
session.windowHeight = $window.height();
|
1260
|
+
}
|
1261
|
+
|
1262
|
+
/**
|
1263
|
+
* Updates the scroll offset info in the viewport dimensions cache.
|
1264
|
+
* @private
|
1265
|
+
*/
|
1266
|
+
function trackScroll() {
|
1267
|
+
var x = $window.scrollLeft(),
|
1268
|
+
y = $window.scrollTop();
|
1269
|
+
if (x !== session.scrollLeft) {
|
1270
|
+
session.currentX += x - session.scrollLeft;
|
1271
|
+
session.scrollLeft = x;
|
1272
|
+
}
|
1273
|
+
if (y !== session.scrollTop) {
|
1274
|
+
session.currentY += y - session.scrollTop;
|
1275
|
+
session.scrollTop = y;
|
1049
1276
|
}
|
1050
1277
|
}
|
1051
1278
|
|
@@ -1063,7 +1290,7 @@
|
|
1063
1290
|
* Tests if the mouse is currently over the specified element.
|
1064
1291
|
* @private
|
1065
1292
|
* @param {jQuery} element The element to check for hover.
|
1066
|
-
* @return {boolean}
|
1293
|
+
* @return {boolean} True if the mouse is over the element, otherwise false.
|
1067
1294
|
*/
|
1068
1295
|
function isMouseOver(element) {
|
1069
1296
|
// use getBoundingClientRect() because jQuery's width() and height()
|
@@ -1128,7 +1355,7 @@
|
|
1128
1355
|
*/
|
1129
1356
|
function getViewportCollisions(coords, elementWidth, elementHeight) {
|
1130
1357
|
var viewportTop = session.scrollTop,
|
1131
|
-
viewportLeft =
|
1358
|
+
viewportLeft = session.scrollLeft,
|
1132
1359
|
viewportBottom = viewportTop + session.windowHeight,
|
1133
1360
|
viewportRight = viewportLeft + session.windowWidth,
|
1134
1361
|
collisions = Collision.none;
|
@@ -1163,4 +1390,6 @@
|
|
1163
1390
|
return count;
|
1164
1391
|
}
|
1165
1392
|
|
1393
|
+
// return api for commonjs and amd environments
|
1394
|
+
return $.powerTip;
|
1166
1395
|
}));
|