your_platform 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +39 -11
- data/Rakefile +15 -1
- data/app/assets/images/file.png +0 -0
- data/app/assets/images/img/excel2013_file_128.png +0 -0
- data/app/assets/images/img/excel2013_file_bw_107.png +0 -0
- data/app/assets/images/img/excel2013_file_bw_semitransparent_107.png +0 -0
- data/app/assets/images/img/glyphicons-halflings-white.png +0 -0
- data/app/assets/images/img/glyphicons-halflings.png +0 -0
- data/app/assets/images/img/gmaps_yellow_marker.png +0 -0
- data/app/assets/images/img/gmaps_yellow_marker_38.png +0 -0
- data/app/assets/images/markdown_help.png +0 -0
- data/app/assets/images/your_platform/breadcrumb-sep.png +0 -0
- data/app/assets/javascripts/app-ng.js.coffee +5 -0
- data/app/assets/javascripts/attachments.js +2 -0
- data/app/assets/javascripts/controllers-ng/bookmark_list_controller.js.coffee +30 -0
- data/app/assets/javascripts/controllers-ng/box_controller.js.coffee +37 -0
- data/app/assets/javascripts/controllers-ng/profile_angular.js.coffee +151 -0
- data/app/assets/javascripts/directives-ng/box_directive.js.coffee +91 -0
- data/app/assets/javascripts/directives-ng/star_tool_directive.js.coffee +111 -0
- data/app/assets/javascripts/filters-ng/some_filter.js.coffee +0 -0
- data/app/assets/javascripts/jquery.appear-1.1.1.js +138 -0
- data/app/assets/javascripts/make-js-more-like-ruby.js.coffee +32 -0
- data/app/assets/javascripts/mercury.js +456 -0
- data/app/assets/javascripts/models-ng/bookmark.js.coffee +28 -0
- data/app/assets/javascripts/services-ng/current_user_bookmarks.js.coffee +39 -0
- data/app/assets/javascripts/your_platform.js +27 -0
- data/app/assets/javascripts/your_platform/address_labels.js.coffee +40 -0
- data/app/assets/javascripts/your_platform/attachments.js.coffee +61 -0
- data/app/assets/javascripts/your_platform/auto-completion.js.coffee +90 -0
- data/app/assets/javascripts/your_platform/best_in_place.js.coffee +8 -0
- data/app/assets/javascripts/your_platform/best_in_place_hyperlinks.js.coffee +25 -0
- data/app/assets/javascripts/your_platform/best_in_place_tab_key.js.coffee +28 -0
- data/app/assets/javascripts/your_platform/boxes.js.coffee +11 -0
- data/app/assets/javascripts/your_platform/change_password.js.coffee +22 -0
- data/app/assets/javascripts/your_platform/close_dropdowns.js.coffee +18 -0
- data/app/assets/javascripts/your_platform/copy_to_clipboard.js.coffee +6 -0
- data/app/assets/javascripts/your_platform/datatables.coffee +112 -0
- data/app/assets/javascripts/your_platform/datepicker_settings.js.coffee +16 -0
- data/app/assets/javascripts/your_platform/edit_tools.js.coffee +19 -0
- data/app/assets/javascripts/your_platform/editable_dbl_click.js.coffee +42 -0
- data/app/assets/javascripts/your_platform/events.js.coffee +126 -0
- data/app/assets/javascripts/your_platform/fix_textarea.js.coffee +11 -0
- data/app/assets/javascripts/your_platform/galleria.js.coffee +112 -0
- data/app/assets/javascripts/your_platform/groups.js.coffee +36 -0
- data/app/assets/javascripts/your_platform/hidden.js.coffee +5 -0
- data/app/assets/javascripts/your_platform/links_to_external_sites.js.coffee +12 -0
- data/app/assets/javascripts/your_platform/maps.js.coffee +13 -0
- data/app/assets/javascripts/your_platform/may_need_review.js.coffee +10 -0
- data/app/assets/javascripts/your_platform/navable_title_rename.js.coffee +17 -0
- data/app/assets/javascripts/your_platform/officers.js.coffee +35 -0
- data/app/assets/javascripts/your_platform/popovers.js.coffee +38 -0
- data/app/assets/javascripts/your_platform/posts.js.coffee +58 -0
- data/app/assets/javascripts/your_platform/profile_fields.js.coffee +61 -0
- data/app/assets/javascripts/your_platform/search.js.coffee +26 -0
- data/app/assets/javascripts/your_platform/tooltips.js.coffee +10 -0
- data/app/assets/javascripts/your_platform/turbolinks_loading_spinner.js.coffee +83 -0
- data/app/assets/javascripts/your_platform/user_avatars.js.coffee +33 -0
- data/app/assets/javascripts/your_platform/user_group_memberships.js.coffee +11 -0
- data/app/assets/javascripts/your_platform/user_settings.js.coffee +18 -0
- data/app/assets/javascripts/your_platform/users_new.js.coffee +54 -0
- data/app/assets/stylesheets/bootstrap_layout.css.sass +3 -0
- data/app/assets/stylesheets/bootstrap_layout/attachments.css.sass +3 -0
- data/app/assets/stylesheets/bootstrap_layout/boxes.css.sass +11 -0
- data/app/assets/stylesheets/bootstrap_layout/breadcrumb.css.sass +25 -0
- data/app/assets/stylesheets/bootstrap_layout/category_indicator.css.sass +5 -0
- data/app/assets/stylesheets/bootstrap_layout/footer.css.sass +14 -0
- data/app/assets/stylesheets/bootstrap_layout/galleria.css.sass +8 -0
- data/app/assets/stylesheets/bootstrap_layout/header_bar.css.sass +11 -0
- data/app/assets/stylesheets/bootstrap_layout/headings.css.sass +10 -0
- data/app/assets/stylesheets/bootstrap_layout/logged_in_bar.css.sass +40 -0
- data/app/assets/stylesheets/bootstrap_layout/logo.css.sass +2 -0
- data/app/assets/stylesheets/bootstrap_layout/modal_fix.css.sass +8 -0
- data/app/assets/stylesheets/bootstrap_layout/profiles.css.sass +10 -0
- data/app/assets/stylesheets/bootstrap_layout/session_bar.css.sass +60 -0
- data/app/assets/stylesheets/bootstrap_layout/stars.css.sass +4 -0
- data/app/assets/stylesheets/bootstrap_layout/turbolinks_progress_bar.css.sass +3 -0
- data/app/assets/stylesheets/bootstrap_layout/vertical_menu.css.sass +15 -0
- data/app/assets/stylesheets/bootstrap_setup.css.sass +4 -0
- data/app/assets/stylesheets/your_platform.css.sass +11 -0
- data/app/assets/stylesheets/your_platform/address_labels_modal.css.sass +8 -0
- data/app/assets/stylesheets/your_platform/attachments.css.sass +75 -0
- data/app/assets/stylesheets/your_platform/authorization_info.css.sass +16 -0
- data/app/assets/stylesheets/your_platform/auto-completion.css.sass +3 -0
- data/app/assets/stylesheets/your_platform/center.css.sass +14 -0
- data/app/assets/stylesheets/your_platform/change_password.css.sass +13 -0
- data/app/assets/stylesheets/your_platform/corporate_vita.css.sass +2 -0
- data/app/assets/stylesheets/your_platform/datatables.css.sass +23 -0
- data/app/assets/stylesheets/your_platform/datepicker.css.sass +2 -0
- data/app/assets/stylesheets/your_platform/dropdowns.css.sass +8 -0
- data/app/assets/stylesheets/your_platform/events.css.sass +68 -0
- data/app/assets/stylesheets/your_platform/forms.css.sass +25 -0
- data/app/assets/stylesheets/your_platform/galleria.css.sass +12 -0
- data/app/assets/stylesheets/your_platform/groups.css.sass +8 -0
- data/app/assets/stylesheets/your_platform/groups_table.css.sass +8 -0
- data/app/assets/stylesheets/your_platform/hidden.css.sass +3 -0
- data/app/assets/stylesheets/your_platform/images.css.sass +50 -0
- data/app/assets/stylesheets/your_platform/last_activities.css.sass +17 -0
- data/app/assets/stylesheets/your_platform/latest_members.css.sass +7 -0
- data/app/assets/stylesheets/your_platform/login.css.sass +4 -0
- data/app/assets/stylesheets/your_platform/maps.css.sass +22 -0
- data/app/assets/stylesheets/your_platform/markdown_help.css.sass +5 -0
- data/app/assets/stylesheets/your_platform/may_need_review.css.sass +3 -0
- data/app/assets/stylesheets/your_platform/pages.css.sass +12 -0
- data/app/assets/stylesheets/your_platform/password_strength.css.sass +73 -0
- data/app/assets/stylesheets/your_platform/picture_attachments.css.sass +7 -0
- data/app/assets/stylesheets/your_platform/popovers.css.sass +13 -0
- data/app/assets/stylesheets/your_platform/posts.css.sass +32 -0
- data/app/assets/stylesheets/your_platform/profiles.css.sass +153 -0
- data/app/assets/stylesheets/your_platform/search_preview.css.sass +4 -0
- data/app/assets/stylesheets/your_platform/star_tool.css.sass +2 -0
- data/app/assets/stylesheets/your_platform/tooltips.css.sass +7 -0
- data/app/assets/stylesheets/your_platform/turbolinks_loading_spinner.css.sass +3 -0
- data/app/assets/stylesheets/your_platform/user_avatars.css.sass +8 -0
- data/app/assets/stylesheets/your_platform/user_group_memberships.css.sass +4 -0
- data/app/assets/stylesheets/your_platform/vertical_nav.css.sass +7 -0
- data/app/controllers/activities_controller.rb +6 -0
- data/app/controllers/application_controller.rb +236 -0
- data/app/controllers/attachments_controller.rb +97 -0
- data/app/controllers/blog_posts_controller.rb +50 -0
- data/app/controllers/bookmarks_controller.rb +33 -0
- data/app/controllers/corporations_controller.rb +22 -0
- data/app/controllers/errors_controller.rb +27 -0
- data/app/controllers/events_controller.rb +262 -0
- data/app/controllers/groups_controller.rb +257 -0
- data/app/controllers/officers_controller.rb +28 -0
- data/app/controllers/pages_controller.rb +67 -0
- data/app/controllers/posts_controller.rb +81 -0
- data/app/controllers/profile_fields_controller.rb +132 -0
- data/app/controllers/root_controller.rb +35 -0
- data/app/controllers/search_controller.rb +149 -0
- data/app/controllers/sessions_controller.rb +21 -0
- data/app/controllers/setup_controller.rb +80 -0
- data/app/controllers/statistics_controller.rb +38 -0
- data/app/controllers/status_group_memberships_controller.rb +28 -0
- data/app/controllers/terms_of_use_controller.rb +35 -0
- data/app/controllers/user_accounts_controller.rb +55 -0
- data/app/controllers/user_group_memberships_controller.rb +75 -0
- data/app/controllers/user_settings_controller.rb +57 -0
- data/app/controllers/users_controller.rb +125 -0
- data/app/controllers/workflows_controller.rb +19 -0
- data/app/helpers/application_helper.rb +25 -0
- data/app/helpers/attachments_helper.rb +2 -0
- data/app/helpers/auto_completion_helper.rb +33 -0
- data/app/helpers/avatar_helper.rb +70 -0
- data/app/helpers/bookmarks_helper.rb +22 -0
- data/app/helpers/box_helper.rb +56 -0
- data/app/helpers/breadcrumbs_helper.rb +62 -0
- data/app/helpers/corporate_vita_helper.rb +34 -0
- data/app/helpers/events_helper.rb +28 -0
- data/app/helpers/flash_helper.rb +60 -0
- data/app/helpers/footer_helper.rb +13 -0
- data/app/helpers/galleria_helper.rb +13 -0
- data/app/helpers/groups_helper.rb +66 -0
- data/app/helpers/horizontal_nav_helper.rb +11 -0
- data/app/helpers/i18n_helper.rb +10 -0
- data/app/helpers/icon_helper.rb +35 -0
- data/app/helpers/mailer_helper.rb +7 -0
- data/app/helpers/map_helper.rb +26 -0
- data/app/helpers/markdown_helper.rb +22 -0
- data/app/helpers/markup_helper.rb +25 -0
- data/app/helpers/officers_helper.rb +13 -0
- data/app/helpers/password_helper.rb +23 -0
- data/app/helpers/profile_field_helper.rb +40 -0
- data/app/helpers/profile_helper.rb +69 -0
- data/app/helpers/quick_link_helper.rb +53 -0
- data/app/helpers/special_pages_helper.rb +9 -0
- data/app/helpers/structureable_helper.rb +11 -0
- data/app/helpers/sublime_helper.rb +16 -0
- data/app/helpers/title_helper.rb +52 -0
- data/app/helpers/tool_buttons_helper.rb +74 -0
- data/app/helpers/unicode_helper.rb +9 -0
- data/app/helpers/users_helper.rb +13 -0
- data/app/helpers/vertical_nav_helper.rb +84 -0
- data/app/helpers/workflows_helper.rb +37 -0
- data/app/mailers/event_mailer.rb +13 -0
- data/app/mailers/post_mailer.rb +11 -0
- data/app/mailers/user_account_mailer.rb +17 -0
- data/app/models/ability.rb +321 -0
- data/app/models/active_record_associations_patches.rb +26 -0
- data/app/models/active_record_cache_extension.rb +152 -0
- data/app/models/active_record_find_by_extension.rb +20 -0
- data/app/models/active_record_json_url_extension.rb +51 -0
- data/app/models/active_record_metric_events_extension.rb +22 -0
- data/app/models/active_record_read_only_extension.rb +35 -0
- data/app/models/active_record_update_attributes_bip_extension.rb +24 -0
- data/app/models/address_label.rb +50 -0
- data/app/models/app_version.rb +49 -0
- data/app/models/array.rb +15 -0
- data/app/models/attachment.rb +76 -0
- data/app/models/bashpass_password.rb +32 -0
- data/app/models/blog_post.rb +2 -0
- data/app/models/bookmark.rb +67 -0
- data/app/models/cache_additions.rb +15 -0
- data/app/models/cache_store_extension.rb +78 -0
- data/app/models/concerns/user_avatar.rb +16 -0
- data/app/models/concerns/user_corporations.rb +44 -0
- data/app/models/concerns/user_date_of_birth.rb +74 -0
- data/app/models/concerns/user_profile.rb +102 -0
- data/app/models/corporation.rb +80 -0
- data/app/models/dag_link.rb +29 -0
- data/app/models/event.rb +235 -0
- data/app/models/flag.rb +18 -0
- data/app/models/flagable.rb +62 -0
- data/app/models/geo_location.rb +92 -0
- data/app/models/group.rb +224 -0
- data/app/models/group_mixins/corporations.rb +141 -0
- data/app/models/group_mixins/developers.rb +41 -0
- data/app/models/group_mixins/everyone.rb +72 -0
- data/app/models/group_mixins/guests.rb +61 -0
- data/app/models/group_mixins/hidden_users.rb +43 -0
- data/app/models/group_mixins/import.rb +321 -0
- data/app/models/group_mixins/memberships.rb +207 -0
- data/app/models/group_mixins/officers.rb +47 -0
- data/app/models/group_mixins/roles.rb +41 -0
- data/app/models/horizontal_nav.rb +32 -0
- data/app/models/last_seen_activity.rb +10 -0
- data/app/models/list_export.rb +359 -0
- data/app/models/may_need_review.rb +54 -0
- data/app/models/metric_logger.rb +83 -0
- data/app/models/nav_node.rb +169 -0
- data/app/models/navable.rb +46 -0
- data/app/models/object_to_b_extension.rb +12 -0
- data/app/models/page.rb +212 -0
- data/app/models/password.rb +28 -0
- data/app/models/post.rb +199 -0
- data/app/models/profile.rb +36 -0
- data/app/models/profile_field.rb +196 -0
- data/app/models/profile_field_mixins/has_child_profile_fields.rb +114 -0
- data/app/models/profile_field_types/about.rb +9 -0
- data/app/models/profile_field_types/academic_degree.rb +10 -0
- data/app/models/profile_field_types/address.rb +88 -0
- data/app/models/profile_field_types/bank_account.rb +12 -0
- data/app/models/profile_field_types/competence.rb +7 -0
- data/app/models/profile_field_types/custom.rb +12 -0
- data/app/models/profile_field_types/date.rb +14 -0
- data/app/models/profile_field_types/description.rb +15 -0
- data/app/models/profile_field_types/email.rb +20 -0
- data/app/models/profile_field_types/employment.rb +24 -0
- data/app/models/profile_field_types/general.rb +9 -0
- data/app/models/profile_field_types/homepage.rb +19 -0
- data/app/models/profile_field_types/name_surrounding.rb +11 -0
- data/app/models/profile_field_types/organization.rb +24 -0
- data/app/models/profile_field_types/phone.rb +37 -0
- data/app/models/profile_field_types/professional_category.rb +8 -0
- data/app/models/profile_field_types/study.rb +18 -0
- data/app/models/profile_section.rb +49 -0
- data/app/models/profileable.rb +58 -0
- data/app/models/profileable_mixins/address.rb +118 -0
- data/app/models/relationship.rb +78 -0
- data/app/models/role.rb +164 -0
- data/app/models/setting.rb +9 -0
- data/app/models/status_group.rb +28 -0
- data/app/models/status_group_membership.rb +189 -0
- data/app/models/status_group_membership_info.rb +54 -0
- data/app/models/structureable.rb +164 -0
- data/app/models/structureable_mixins/has_special_groups.rb +127 -0
- data/app/models/structureable_mixins/roles.rb +275 -0
- data/app/models/user.rb +878 -0
- data/app/models/user_account.rb +162 -0
- data/app/models/user_alias.rb +112 -0
- data/app/models/user_group_membership.rb +300 -0
- data/app/models/user_group_membership_mixins/validity_range.rb +206 -0
- data/app/models/user_group_membership_mixins/validity_range_for_indirect_memberships.rb +160 -0
- data/app/models/user_mixins/identification.rb +36 -0
- data/app/models/user_mixins/memberships.rb +75 -0
- data/app/models/workflow.rb +40 -0
- data/app/models/workflow_kit/add_to_group_brick.rb +21 -0
- data/app/models/workflow_kit/destroy_account_and_end_memberships_if_needed_brick.rb +19 -0
- data/app/models/workflow_kit/last_membership_needs_review_brick.rb +19 -0
- data/app/models/workflow_kit/mark_as_deceased_brick.rb +17 -0
- data/app/models/workflow_kit/remove_from_group_brick.rb +27 -0
- data/app/models/workflow_kit/test_brick.rb +13 -0
- data/app/pdfs/address_labels_pdf.rb +157 -0
- data/app/presenters/base_presenter.rb +52 -0
- data/app/presenters/horizontal_nav_presenter.rb +106 -0
- data/app/uploaders/attachment_uploader.rb +148 -0
- data/app/views/activities/index.html.haml +25 -0
- data/app/views/attachments/_attachment.html.haml +20 -0
- data/app/views/attachments/_description.html.haml +11 -0
- data/app/views/attachments/_documents.html.haml +17 -0
- data/app/views/attachments/_drop_field.html.haml +46 -0
- data/app/views/attachments/_picture.html.haml +2 -0
- data/app/views/attachments/_pictures.html.haml +10 -0
- data/app/views/attachments/_video.html.haml +8 -0
- data/app/views/attachments/create.js.erb +1 -0
- data/app/views/attachments/destroy.js.erb +1 -0
- data/app/views/blog_posts/create.js.erb +17 -0
- data/app/views/bookmarks/_list.html.haml +7 -0
- data/app/views/bookmarks/update.js.erb +4 -0
- data/app/views/devise/mailer/reset_password_instructions.html.haml +8 -0
- data/app/views/devise/passwords/edit.html.haml +1 -0
- data/app/views/devise/passwords/new.html.haml +12 -0
- data/app/views/devise/registrations/edit.html.haml +1 -0
- data/app/views/devise/sessions/new.html.haml +14 -0
- data/app/views/devise/shared/_links.haml +26 -0
- data/app/views/errors/show.html.haml +5 -0
- data/app/views/errors/unauthorized.html.haml +7 -0
- data/app/views/event_mailer/invitation_email.html.erb +63 -0
- data/app/views/events/_event_details.html.haml +54 -0
- data/app/views/events/_events_lis.html.haml +29 -0
- data/app/views/events/_invitation_text.html.erb +8 -0
- data/app/views/events/_pictures.html.haml +5 -0
- data/app/views/events/_public_index.html.haml +16 -0
- data/app/views/events/index.html.haml +24 -0
- data/app/views/events/show.html.haml +50 -0
- data/app/views/groups/_address_labels_modal.html.haml +27 -0
- data/app/views/groups/_export_button.html.haml +66 -0
- data/app/views/groups/_group_list.html.haml +25 -0
- data/app/views/groups/_member_avatars.html.haml +4 -0
- data/app/views/groups/_member_list.html.haml +15 -0
- data/app/views/groups/index.html.erb +11 -0
- data/app/views/groups/index_mine.html.haml +7 -0
- data/app/views/groups/show.html.haml +79 -0
- data/app/views/last_seen_activities/_index.html.haml +19 -0
- data/app/views/layouts/_add_structureable_additions.html.haml +15 -0
- data/app/views/layouts/_box.html.haml +16 -0
- data/app/views/layouts/_help_button.html.haml +1 -0
- data/app/views/layouts/_role_preview_switcher.html.haml +20 -0
- data/app/views/layouts/_session_bar_avatar.html.haml +1 -0
- data/app/views/layouts/_vertical_nav.html.haml +5 -0
- data/app/views/layouts/bootstrap.html.haml +146 -0
- data/app/views/layouts/mercury.html.erb +23 -0
- data/app/views/officers/_history_notice.html.haml +4 -0
- data/app/views/officers/_officers_box.html.haml +33 -0
- data/app/views/officers/_officers_group_entry.html.haml +45 -0
- data/app/views/pages/_attachments.html.haml +21 -0
- data/app/views/pages/_page.html.haml +28 -0
- data/app/views/pages/_pictures.html.haml +2 -0
- data/app/views/pages/_videos.html.erb +8 -0
- data/app/views/pages/show.html.haml +39 -0
- data/app/views/post_mailer/post_email.html.erb +17 -0
- data/app/views/posts/_new_post_template_text.html.haml +6 -0
- data/app/views/posts/_post.html.haml +13 -0
- data/app/views/posts/_post_quote.html.haml +18 -0
- data/app/views/posts/_posts.html.haml +6 -0
- data/app/views/posts/index.html.haml +9 -0
- data/app/views/posts/new.html.haml +42 -0
- data/app/views/posts/show.html.haml +8 -0
- data/app/views/profile_fields/_postal_address_flag_switch.html.haml +21 -0
- data/app/views/profile_fields/_profile_field.html.haml +41 -0
- data/app/views/profile_fields/create.js.erb +26 -0
- data/app/views/profile_fields/destroy.js.erb +3 -0
- data/app/views/profiles/_add_profile_field_button.html.haml +15 -0
- data/app/views/profiles/_profile_section_ul.html.haml +8 -0
- data/app/views/profiles/_section.html.haml +28 -0
- data/app/views/profiles/_send_group_message_button.html.haml +4 -0
- data/app/views/root/_latest_members_box.html.haml +19 -0
- data/app/views/root/_start_page_elements.html.haml +0 -0
- data/app/views/root/_what_is_new.html.haml +21 -0
- data/app/views/search/_preview_blog_post.html.haml +1 -0
- data/app/views/search/_preview_corporation.html.haml +5 -0
- data/app/views/search/_preview_group.html.haml +4 -0
- data/app/views/search/_preview_page.html.haml +11 -0
- data/app/views/search/_preview_user.html.haml +14 -0
- data/app/views/search/index.html.haml +42 -0
- data/app/views/setup/index.html.haml +56 -0
- data/app/views/shared/_add_structureable.html.haml +22 -0
- data/app/views/shared/_authorization_info.html.haml +22 -0
- data/app/views/shared/_flags.html.haml +5 -0
- data/app/views/shared/_markdown_help.html.haml +4 -0
- data/app/views/shared/_search_box.html.haml +2 -0
- data/app/views/shared/_upcoming_events.html.haml +33 -0
- data/app/views/statistics/index.html.haml +16 -0
- data/app/views/statistics/show.html.haml +13 -0
- data/app/views/terms_of_use/_checkbox.html.haml +1 -0
- data/app/views/terms_of_use/_terms.html.haml +1 -0
- data/app/views/terms_of_use/index.html.haml +19 -0
- data/app/views/user_account_mailer/welcome_email.html.erb +32 -0
- data/app/views/user_accounts/_change_password.html.haml +149 -0
- data/app/views/user_accounts/_user_account.html.haml +39 -0
- data/app/views/user_group_memberships/_list_item.html.haml +9 -0
- data/app/views/user_group_memberships/_memberships_table.html.haml +56 -0
- data/app/views/user_group_memberships/_new.html.haml +18 -0
- data/app/views/user_group_memberships/create.js.erb +9 -0
- data/app/views/user_group_memberships/index.html.haml +5 -0
- data/app/views/user_settings/show.html.haml +36 -0
- data/app/views/users/_avatar.html.haml +16 -0
- data/app/views/users/_communication_box.html.haml +8 -0
- data/app/views/users/_corporate_vita.html.haml +23 -0
- data/app/views/users/_dead_badge.html.haml +3 -0
- data/app/views/users/_deceased_modal.html.haml +24 -0
- data/app/views/users/_hidden_badge.html.haml +4 -0
- data/app/views/users/_hidden_flag_switch.html.haml +20 -0
- data/app/views/users/_special_general_info_fields.html.haml +10 -0
- data/app/views/users/_user_corporation_attribute.html.haml +6 -0
- data/app/views/users/_user_name_attribute.html.haml +4 -0
- data/app/views/users/_user_title.html.haml +5 -0
- data/app/views/users/_workflow_triggers.html.haml +23 -0
- data/app/views/users/new.html.haml +55 -0
- data/app/views/users/show.html.haml +79 -0
- data/config/environment.rb +5 -0
- data/config/initializers/active_record_cache_extension.rb +1 -0
- data/config/initializers/active_record_find_by_extension.rb +1 -0
- data/config/initializers/active_record_flagable_extension.rb +2 -0
- data/config/initializers/active_record_json_url_extension.rb +1 -0
- data/config/initializers/active_record_may_need_review_extension.rb +2 -0
- data/config/initializers/active_record_metric_events_extension.rb +1 -0
- data/config/initializers/active_record_navable_extension.rb +6 -0
- data/config/initializers/active_record_profileable_extension.rb +4 -0
- data/config/initializers/active_record_read_only_extension.rb +1 -0
- data/config/initializers/active_record_structureable_extension.rb +3 -0
- data/config/initializers/active_record_update_attributes_bip_extension.rb +1 -0
- data/config/initializers/array_extension.rb +1 -0
- data/config/initializers/best_in_place_display_definitions.rb +31 -0
- data/config/initializers/cache_store_extension.rb +1 -0
- data/config/initializers/devise.rb +240 -0
- data/config/initializers/fnordmetric.rb +14 -0
- data/config/initializers/formtastic.rb +76 -0
- data/config/initializers/group_type_column_patches.rb +11 -0
- data/config/initializers/mime_types.rb +1 -0
- data/config/initializers/mini_profiler.rb +32 -0
- data/config/initializers/object_to_b_extension.rb +1 -0
- data/config/initializers/refile.rb +22 -0
- data/config/initializers/sidekiq.rb +12 -0
- data/config/locales/attachments/de.yml +33 -0
- data/config/locales/bookmarks/de.yml +3 -0
- data/config/locales/bookmarks/en.yml +3 -0
- data/config/locales/common_expressions/de.yml +5 -0
- data/config/locales/common_expressions/en.yml +5 -0
- data/config/locales/companies/de.yml +4 -0
- data/config/locales/companies/en.yml +4 -0
- data/config/locales/de.yml +30 -0
- data/config/locales/devise/de.yml +60 -0
- data/config/locales/devise/en.yml +62 -0
- data/config/locales/en.yml +25 -0
- data/config/locales/events/de.yml +34 -0
- data/config/locales/events/en.yml +34 -0
- data/config/locales/forms/de.yml +3 -0
- data/config/locales/groups/de.yml +56 -0
- data/config/locales/groups/en.yml +47 -0
- data/config/locales/officers/de.yml +10 -0
- data/config/locales/pages/de.yml +15 -0
- data/config/locales/pages/en.yml +14 -0
- data/config/locales/pagination/de.yml +6 -0
- data/config/locales/pagination/en.yml +5 -0
- data/config/locales/password_strength/de.yml +9 -0
- data/config/locales/password_strength/en.yml +9 -0
- data/config/locales/posts/de.yml +9 -0
- data/config/locales/profile_fields/de.yml +78 -0
- data/config/locales/profile_fields/en.yml +22 -0
- data/config/locales/profiles/de.yml +47 -0
- data/config/locales/profiles/en.yml +44 -0
- data/config/locales/roles/de.yml +9 -0
- data/config/locales/root/de.yml +3 -0
- data/config/locales/root/en.yml +3 -0
- data/config/locales/search/de.yml +11 -0
- data/config/locales/search/en.yml +11 -0
- data/config/locales/sessions/de.yml +37 -0
- data/config/locales/sessions/en.yml +37 -0
- data/config/locales/setup/de.yml +26 -0
- data/config/locales/setup/en.yml +26 -0
- data/config/locales/statistics/de.yml +6 -0
- data/config/locales/terms_of_use/de.yml +6 -0
- data/config/locales/tools/de.yml +9 -0
- data/config/locales/tools/en.yml +9 -0
- data/config/locales/user_accounts/de.yml +16 -0
- data/config/locales/user_accounts/en.yml +13 -0
- data/config/locales/user_settings/de.yml +9 -0
- data/config/locales/users/de.yml +82 -0
- data/config/locales/users/en.yml +51 -0
- data/config/locales/workflows/de.yml +4 -0
- data/config/locales/workflows/en.yml +4 -0
- data/config/routes.rb +104 -0
- data/db/migrate/20120403002734_create_users.rb +12 -0
- data/db/migrate/20120403011601_create_profile_fields.rb +11 -0
- data/db/migrate/20120403161549_remove_user_email_column.rb +5 -0
- data/db/migrate/20120405222050_encrypt_password.rb +8 -0
- data/db/migrate/20120425161138_create_dag_links.rb +14 -0
- data/db/migrate/20120425162644_create_pages.rb +10 -0
- data/db/migrate/20120426023322_create_groups.rb +9 -0
- data/db/migrate/20120426090436_create_nav_nodes.rb +18 -0
- data/db/migrate/20120427021934_create_user_accounts.rb +12 -0
- data/db/migrate/20120427044338_add_foreign_key_to_user_accounts.rb +7 -0
- data/db/migrate/20120427150156_add_group_token.rb +8 -0
- data/db/migrate/20120507165551_make_profile_fields_polymorphic.rb +11 -0
- data/db/migrate/20120508130729_add_profile_field_acts_as_tree.rb +9 -0
- data/db/migrate/20120508152233_change_profile_field_value_to_text.rb +9 -0
- data/db/migrate/20120508201550_add_group_internal_token.rb +11 -0
- data/db/migrate/20120511090234_create_workflows.rb +9 -0
- data/db/migrate/20120701115059_add_password_digest_to_user_accounts.rb +5 -0
- data/db/migrate/20120710193308_remove_salt_from_user_accounts.rb +5 -0
- data/db/migrate/20120713102445_add_deleted_at_to_dag_links.rb +5 -0
- data/db/migrate/20120722005022_create_workflow_kit_workflows.workflow_kit.rb +11 -0
- data/db/migrate/20120722005023_create_workflow_kit_steps.workflow_kit.rb +12 -0
- data/db/migrate/20120722005024_create_workflow_kit_parameters.workflow_kit.rb +12 -0
- data/db/migrate/20120723165226_add_female_to_users.rb +5 -0
- data/db/migrate/20120811140509_create_flags.rb +11 -0
- data/db/migrate/20120814100529_create_attachments.rb +13 -0
- data/db/migrate/20120815205610_add_content_type_and_file_size_to_attachments.rb +6 -0
- data/db/migrate/20130118220014_add_relationships_table_without_dag.rb +10 -0
- data/db/migrate/20130207214331_create_events.rb +12 -0
- data/db/migrate/20130208215253_create_status_group_membership_infos.rb +11 -0
- data/db/migrate/20130220184943_create_stars.rb +11 -0
- data/db/migrate/20130309193623_add_devise_to_user_accounts.rb +72 -0
- data/db/migrate/20130310003840_rename_stars_to_bookmarks.rb +9 -0
- data/db/migrate/20130310004622_fix_column_names_for_bookmarks.rb +6 -0
- data/db/migrate/20130313211414_create_geo_infos.rb +13 -0
- data/db/migrate/20130313234131_create_geo_locations.rb +16 -0
- data/db/migrate/20130314011638_drop_geo_infos.rb +5 -0
- data/db/migrate/20130315072759_add_invalid_to_geo_location.rb +5 -0
- data/db/migrate/20130315073149_exchange_invalid_for_queried_at_in_geo_location.rb +8 -0
- data/db/migrate/20130320003051_add_redirect_to_to_page.rb +5 -0
- data/db/migrate/20130329231657_create_posts.rb +15 -0
- data/db/migrate/20130404223735_add_entire_message_to_posts.rb +5 -0
- data/db/migrate/20130409192959_add_author_to_page.rb +5 -0
- data/db/migrate/20130908011215_add_type_to_pages.rb +5 -0
- data/db/migrate/20131115114715_validity_range_for_dag_links.rb +16 -0
- data/db/migrate/20140611170430_create_activities.rb +23 -0
- data/db/migrate/20140808223512_create_last_seen_activities.rb +12 -0
- data/db/migrate/20141008101744_add_location_to_events.rb +5 -0
- data/db/migrate/20141010130344_add_publish_on_website_to_events.rb +6 -0
- data/db/migrate/20141010134227_add_auth_token_to_user_accounts.rb +5 -0
- data/db/migrate/20141018143323_add_accepted_terms_to_users.rb +6 -0
- data/db/migrate/20141018221659_add_author_to_attachments.rb +5 -0
- data/db/migrate/20141102223954_add_body_to_groups.rb +5 -0
- data/db/migrate/20141110193830_create_settings.rb +17 -0
- data/db/migrate/20141202140522_add_indices.rb +6 -0
- data/db/migrate/20141209161946_add_keys.rb +20 -0
- data/db/migrate/20150127013809_add_incognito_to_users.rb +5 -0
- data/db/migrate/20150129194501_add_indices_for_polymorphic_references.rb +13 -0
- data/db/migrate/20150304192448_add_type_to_groups.rb +5 -0
- data/db/migrate/20150313221004_add_avatar_id_to_users.rb +5 -0
- data/lib/best_in_place/controller_extensions.rb +25 -0
- data/lib/best_in_place/helper.rb +127 -0
- data/lib/tasks/db_bootstrap.rake +37 -0
- data/lib/tasks/your_platform_tasks.rake +4 -0
- data/lib/templates/erb/scaffold/_form.html.erb +11 -0
- data/lib/your_platform.rb +6 -2
- data/lib/your_platform/engine.rb +127 -0
- data/lib/your_platform/version.rb +1 -1
- data/spec/factories/attachment.rb +12 -0
- data/spec/factories/blog_post.rb +10 -0
- data/spec/factories/company.rb +7 -0
- data/spec/factories/corporation.rb +20 -0
- data/spec/factories/event.rb +13 -0
- data/spec/factories/group.rb +36 -0
- data/spec/factories/html_email.eml +1059 -0
- data/spec/factories/mail_message.rb +30 -0
- data/spec/factories/page.rb +10 -0
- data/spec/factories/relationship.rb +13 -0
- data/spec/factories/status_group_membership.rb +21 -0
- data/spec/factories/user.rb +97 -0
- data/spec/factories/workflow.rb +44 -0
- data/spec/features/blog_post_spec.rb +46 -0
- data/spec/features/corporate_vita_events_spec.rb +114 -0
- data/spec/features/corporate_vita_spec.rb +258 -0
- data/spec/features/edit_mode_after_clicking_a_link_spec.rb +20 -0
- data/spec/features/events_spec.rb +356 -0
- data/spec/features/group_export_spec.rb +19 -0
- data/spec/features/group_post_spec.rb +89 -0
- data/spec/features/groups_of_groups_page_spec.rb +67 -0
- data/spec/features/groups_page_spec.rb +66 -0
- data/spec/features/groups_table_spec.rb +32 -0
- data/spec/features/help_page_spec.rb +22 -0
- data/spec/features/intranet_root_page_spec.rb +18 -0
- data/spec/features/locales_spec.rb +36 -0
- data/spec/features/maps_spec.rb +53 -0
- data/spec/features/mini_profiler_spec.rb +37 -0
- data/spec/features/officers_spec.rb +61 -0
- data/spec/features/page_redirects_spec.rb +23 -0
- data/spec/features/page_spec.rb +20 -0
- data/spec/features/postal_address_flag_spec.rb +46 -0
- data/spec/features/relationships_on_user_page_spec.rb +78 -0
- data/spec/features/review_membership_spec.rb +44 -0
- data/spec/features/search_field_spec.rb +121 -0
- data/spec/features/setup_spec.rb +63 -0
- data/spec/features/user_change_date_of_birth_spec.rb +26 -0
- data/spec/features/vertical_nav_spec.rb +27 -0
- data/spec/features/what_is_new_box_spec.rb +33 -0
- data/spec/helpers/attachments_helper_spec.rb +15 -0
- data/spec/models/ability_spec.rb +93 -0
- data/spec/models/active_record_cache_extension_spec.rb +177 -0
- data/spec/models/active_record_find_by_extension_spec.rb +26 -0
- data/spec/models/active_record_json_url_extension_spec.rb +79 -0
- data/spec/models/address_label_spec.rb +144 -0
- data/spec/models/app_version_spec.rb +38 -0
- data/spec/models/attachment_spec.rb +5 -0
- data/spec/models/bookmark_spec.rb +70 -0
- data/spec/models/concerns/user_corporations_spec.rb +71 -0
- data/spec/models/corporation_spec.rb +128 -0
- data/spec/models/dag_link_spec.rb +48 -0
- data/spec/models/event_spec.rb +267 -0
- data/spec/models/flag_spec.rb +20 -0
- data/spec/models/flagable_spec.rb +55 -0
- data/spec/models/geo_location_spec.rb +126 -0
- data/spec/models/group_mixins/corporations_spec.rb +95 -0
- data/spec/models/group_mixins/everyone_spec.rb +64 -0
- data/spec/models/group_mixins/guests_spec.rb +75 -0
- data/spec/models/group_mixins/hidden_users_spec.rb +21 -0
- data/spec/models/group_mixins/import_spec.rb +93 -0
- data/spec/models/group_mixins/memberships_spec.rb +303 -0
- data/spec/models/group_mixins/officers_spec.rb +63 -0
- data/spec/models/group_mixins/roles_spec.rb +46 -0
- data/spec/models/group_spec.rb +341 -0
- data/spec/models/list_export_spec.rb +155 -0
- data/spec/models/may_need_review_spec.rb +114 -0
- data/spec/models/nav_node_spec.rb +277 -0
- data/spec/models/navable_spec.rb +54 -0
- data/spec/models/page_spec.rb +185 -0
- data/spec/models/post_spec.rb +271 -0
- data/spec/models/profile_field_mixins/has_child_profile_fields_spec.rb +73 -0
- data/spec/models/profile_field_spec.rb +482 -0
- data/spec/models/profile_section_spec.rb +89 -0
- data/spec/models/profile_spec.rb +74 -0
- data/spec/models/profileable_mixins/adress_spec.rb +93 -0
- data/spec/models/profileable_spec.rb +152 -0
- data/spec/models/relationship_spec.rb +113 -0
- data/spec/models/status_group_membership_spec.rb +350 -0
- data/spec/models/status_group_spec.rb +103 -0
- data/spec/models/structureable_mixins/has_special_groups_spec.rb +479 -0
- data/spec/models/structureable_mixins/roles_spec.rb +517 -0
- data/spec/models/structureable_spec.rb +128 -0
- data/spec/models/user_account_spec.rb +142 -0
- data/spec/models/user_alias_spec.rb +57 -0
- data/spec/models/user_group_membership_mixins/validity_range_for_indirect_memberships_spec.rb +291 -0
- data/spec/models/user_group_membership_mixins/validity_range_spec.rb +293 -0
- data/spec/models/user_group_membership_spec.rb +428 -0
- data/spec/models/user_mixins/identification_spec.rb +27 -0
- data/spec/models/user_mixins/memberships_spec.rb +138 -0
- data/spec/models/user_spec.rb +1794 -0
- data/spec/old_yp_spec_helper.rb +46 -0
- data/spec/spec_helper.rb +350 -0
- data/spec/support/auto_complete.rb +22 -0
- data/spec/support/capybara/flash_helpers.rb +37 -0
- data/spec/support/capybara/profile_steps.rb +73 -0
- data/spec/support/capybara/session_steps.rb +53 -0
- data/spec/support/capybara/user_account_helpers.rb +15 -0
- data/spec/support/debug.rb +8 -0
- data/spec/support/devise-controller_macros.rb +15 -0
- data/spec/support/geocoder/stubs.rb +60 -0
- data/spec/support/press_enter.rb +15 -0
- data/spec/support/time_travel.rb +9 -0
- data/spec/support/uploads/image-upload.png +0 -0
- data/spec/support/uploads/pdf-upload.pdf +0 -0
- data/spec/support/wait_for_ajax.rb +39 -0
- data/spec/support/wait_for_cache.rb +7 -0
- data/spec/uploaders/attachment_uploader_spec.rb +47 -0
- data/vendor/assets/images/flags.png +0 -0
- data/vendor/assets/images/galleria/classic-loader.gif +0 -0
- data/vendor/assets/images/galleria/classic-map.png +0 -0
- data/vendor/assets/javascripts/best_in_place_datetime.js.coffee +45 -0
- data/vendor/assets/javascripts/galleria-classic.js +100 -0
- data/vendor/assets/javascripts/galleria.js +6919 -0
- data/vendor/assets/javascripts/gmaps4rails.js +2 -0
- data/vendor/assets/javascripts/gmaps4rails/all.js +1 -0
- data/vendor/assets/javascripts/gmaps4rails/base.coffee +1 -0
- data/vendor/assets/javascripts/gmaps4rails/base/common.coffee +43 -0
- data/vendor/assets/javascripts/gmaps4rails/base/configuration.coffee +7 -0
- data/vendor/assets/javascripts/gmaps4rails/base/gmaps.coffee +13 -0
- data/vendor/assets/javascripts/gmaps4rails/base/interfaces/basic_interface.coffee +15 -0
- data/vendor/assets/javascripts/gmaps4rails/base/interfaces/controller_interface.coffee +15 -0
- data/vendor/assets/javascripts/gmaps4rails/base/interfaces/map_interface.coffee +27 -0
- data/vendor/assets/javascripts/gmaps4rails/base/interfaces/marker_interface.coffee +15 -0
- data/vendor/assets/javascripts/gmaps4rails/base/main.coffee +124 -0
- data/vendor/assets/javascripts/gmaps4rails/base/main_controller_extensions/circle_controller.coffee +29 -0
- data/vendor/assets/javascripts/gmaps4rails/base/main_controller_extensions/kml_controller.coffee +5 -0
- data/vendor/assets/javascripts/gmaps4rails/base/main_controller_extensions/marker_controller.coffee +76 -0
- data/vendor/assets/javascripts/gmaps4rails/base/main_controller_extensions/polygon_controller.coffee +29 -0
- data/vendor/assets/javascripts/gmaps4rails/base/main_controller_extensions/polyline_controller.coffee +29 -0
- data/vendor/assets/javascripts/gmaps4rails/base/objects/circle.coffee +12 -0
- data/vendor/assets/javascripts/gmaps4rails/base/objects/kml.coffee +8 -0
- data/vendor/assets/javascripts/gmaps4rails/base/objects/map.coffee +62 -0
- data/vendor/assets/javascripts/gmaps4rails/base/objects/marker.coffee +24 -0
- data/vendor/assets/javascripts/gmaps4rails/base/objects/polygon.coffee +11 -0
- data/vendor/assets/javascripts/gmaps4rails/base/objects/polyline.coffee +11 -0
- data/vendor/assets/javascripts/gmaps4rails/bing.coffee +1 -0
- data/vendor/assets/javascripts/gmaps4rails/bing/main.coffee +29 -0
- data/vendor/assets/javascripts/gmaps4rails/bing/objects/map.coffee +63 -0
- data/vendor/assets/javascripts/gmaps4rails/bing/objects/marker.coffee +78 -0
- data/vendor/assets/javascripts/gmaps4rails/bing/shared.coffee +20 -0
- data/vendor/assets/javascripts/gmaps4rails/google.coffee +1 -0
- data/vendor/assets/javascripts/gmaps4rails/google/main.coffee +47 -0
- data/vendor/assets/javascripts/gmaps4rails/google/objects/circle.coffee +38 -0
- data/vendor/assets/javascripts/gmaps4rails/google/objects/kml.coffee +16 -0
- data/vendor/assets/javascripts/gmaps4rails/google/objects/map.coffee +71 -0
- data/vendor/assets/javascripts/gmaps4rails/google/objects/marker.coffee +114 -0
- data/vendor/assets/javascripts/gmaps4rails/google/objects/polygon.coffee +38 -0
- data/vendor/assets/javascripts/gmaps4rails/google/objects/polyline.coffee +49 -0
- data/vendor/assets/javascripts/gmaps4rails/google/shared.coffee +27 -0
- data/vendor/assets/javascripts/gmaps4rails/openlayers.coffee +1 -0
- data/vendor/assets/javascripts/gmaps4rails/openlayers/main.coffee +138 -0
- data/vendor/assets/javascripts/gmaps4rails/openlayers/objects/map.coffee +49 -0
- data/vendor/assets/javascripts/gmaps4rails/openlayers/objects/marker.coffee +68 -0
- data/vendor/assets/javascripts/gmaps4rails/openlayers/objects/polyline.coffee +39 -0
- data/vendor/assets/javascripts/gmaps4rails/openlayers/shared.coffee +19 -0
- data/vendor/assets/javascripts/jquery-ui-timepicker-addon.js +2223 -0
- data/vendor/assets/javascripts/jquery-ui-timepicker-de.js +26 -0
- data/vendor/assets/javascripts/jquery.ui.datepicker-de.js +23 -0
- data/vendor/assets/javascripts/password_strength.js +149 -0
- data/vendor/assets/javascripts/zxcvbn.js +43 -0
- data/vendor/assets/stylesheets/flags.css.scss +259 -0
- data/vendor/assets/stylesheets/galleria-classic.css.scss +239 -0
- data/vendor/assets/stylesheets/gmaps4rails.css +24 -0
- data/vendor/assets/stylesheets/mercury.css +24 -0
- data/vendor/scripts/bashpass/README.md +29 -0
- data/vendor/scripts/bashpass/bashpass +124 -0
- data/vendor/scripts/bashpass/bashpass-APACHE-LICENSE +201 -0
- data/vendor/scripts/bashpass/german.dic +40794 -0
- metadata +1540 -16
- data/.gitignore +0 -17
- data/Gemfile +0 -4
- data/LICENSE.txt +0 -4
- data/your_platform.gemspec +0 -19
File without changes
|
@@ -0,0 +1,138 @@
|
|
1
|
+
/*
|
2
|
+
* jQuery.appear
|
3
|
+
* http://code.google.com/p/jquery-appear/
|
4
|
+
*
|
5
|
+
* Copyright (c) 2009 Michael Hixson
|
6
|
+
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
7
|
+
*/
|
8
|
+
(function($) {
|
9
|
+
|
10
|
+
$.fn.appear = function(fn, options) {
|
11
|
+
|
12
|
+
var settings = $.extend({
|
13
|
+
|
14
|
+
//arbitrary data to pass to fn
|
15
|
+
data: undefined,
|
16
|
+
|
17
|
+
//call fn only on the first appear?
|
18
|
+
one: true
|
19
|
+
|
20
|
+
}, options);
|
21
|
+
|
22
|
+
return this.each(function() {
|
23
|
+
|
24
|
+
var t = $(this);
|
25
|
+
|
26
|
+
//whether the element is currently visible
|
27
|
+
t.appeared = false;
|
28
|
+
|
29
|
+
if (!fn) {
|
30
|
+
|
31
|
+
//trigger the custom event
|
32
|
+
t.trigger('appear', settings.data);
|
33
|
+
return;
|
34
|
+
}
|
35
|
+
|
36
|
+
var w = $(window);
|
37
|
+
|
38
|
+
//fires the appear event when appropriate
|
39
|
+
var check = function() {
|
40
|
+
|
41
|
+
//is the element hidden?
|
42
|
+
if (!t.is(':visible')) {
|
43
|
+
|
44
|
+
//it became hidden
|
45
|
+
t.appeared = false;
|
46
|
+
return;
|
47
|
+
}
|
48
|
+
|
49
|
+
//is the element inside the visible window?
|
50
|
+
var a = w.scrollLeft();
|
51
|
+
var b = w.scrollTop();
|
52
|
+
var o = t.offset();
|
53
|
+
var x = o.left;
|
54
|
+
var y = o.top;
|
55
|
+
|
56
|
+
if (y + t.height() >= b &&
|
57
|
+
y <= b + w.height() &&
|
58
|
+
x + t.width() >= a &&
|
59
|
+
x <= a + w.width()) {
|
60
|
+
|
61
|
+
//trigger the custom event
|
62
|
+
if (!t.appeared) t.trigger('appear', settings.data);
|
63
|
+
|
64
|
+
} else {
|
65
|
+
|
66
|
+
//it scrolled out of view
|
67
|
+
t.appeared = false;
|
68
|
+
}
|
69
|
+
};
|
70
|
+
|
71
|
+
//create a modified fn with some additional logic
|
72
|
+
var modifiedFn = function() {
|
73
|
+
|
74
|
+
//mark the element as visible
|
75
|
+
t.appeared = true;
|
76
|
+
|
77
|
+
//is this supposed to happen only once?
|
78
|
+
if (settings.one) {
|
79
|
+
|
80
|
+
//remove the check
|
81
|
+
w.unbind('scroll', check);
|
82
|
+
var i = $.inArray(check, $.fn.appear.checks);
|
83
|
+
if (i >= 0) $.fn.appear.checks.splice(i, 1);
|
84
|
+
}
|
85
|
+
|
86
|
+
//trigger the original fn
|
87
|
+
fn.apply(this, arguments);
|
88
|
+
};
|
89
|
+
|
90
|
+
//bind the modified fn to the element
|
91
|
+
if (settings.one) t.one('appear', settings.data, modifiedFn);
|
92
|
+
else t.bind('appear', settings.data, modifiedFn);
|
93
|
+
|
94
|
+
//check whenever the window scrolls
|
95
|
+
w.scroll(check);
|
96
|
+
|
97
|
+
//check whenever the dom changes
|
98
|
+
$.fn.appear.checks.push(check);
|
99
|
+
|
100
|
+
//check now
|
101
|
+
(check)();
|
102
|
+
});
|
103
|
+
};
|
104
|
+
|
105
|
+
//keep a queue of appearance checks
|
106
|
+
$.extend($.fn.appear, {
|
107
|
+
|
108
|
+
checks: [],
|
109
|
+
timeout: null,
|
110
|
+
|
111
|
+
//process the queue
|
112
|
+
checkAll: function() {
|
113
|
+
var length = $.fn.appear.checks.length;
|
114
|
+
if (length > 0) while (length--) ($.fn.appear.checks[length])();
|
115
|
+
},
|
116
|
+
|
117
|
+
//check the queue asynchronously
|
118
|
+
run: function() {
|
119
|
+
if ($.fn.appear.timeout) clearTimeout($.fn.appear.timeout);
|
120
|
+
$.fn.appear.timeout = setTimeout($.fn.appear.checkAll, 20);
|
121
|
+
}
|
122
|
+
});
|
123
|
+
|
124
|
+
//run checks when these methods are called
|
125
|
+
$.each(['append', 'prepend', 'after', 'before', 'attr',
|
126
|
+
'removeAttr', 'addClass', 'removeClass', 'toggleClass',
|
127
|
+
'remove', 'css', 'show', 'hide'], function(i, n) {
|
128
|
+
var old = $.fn[n];
|
129
|
+
if (old) {
|
130
|
+
$.fn[n] = function() {
|
131
|
+
var r = old.apply(this, arguments);
|
132
|
+
$.fn.appear.run();
|
133
|
+
return r;
|
134
|
+
}
|
135
|
+
}
|
136
|
+
});
|
137
|
+
|
138
|
+
})(jQuery);
|
@@ -0,0 +1,32 @@
|
|
1
|
+
#
|
2
|
+
# In desperation, I write this series of patches to make javascript more like ruby.
|
3
|
+
# I know, it's my fault not to appreciate javascript as it is.
|
4
|
+
# But, let's make the world how I would like it to be ...
|
5
|
+
#
|
6
|
+
# We could also have a look at:
|
7
|
+
#
|
8
|
+
# * https://github.com/sagivo/Ruby-Javascript/blob/master/rjs.js
|
9
|
+
# * https://github.com/rubyjs/core-lib
|
10
|
+
#
|
11
|
+
# SF 2013-03-08
|
12
|
+
#
|
13
|
+
|
14
|
+
# Array
|
15
|
+
# ==========================================================================================
|
16
|
+
|
17
|
+
Array.prototype.removeItem = (itemToRemoveFromArray)->
|
18
|
+
this.splice( this.indexOf( itemToRemoveFromArray ), 1 )
|
19
|
+
|
20
|
+
Array.prototype.delete = (itemToRemoveFromArray)->
|
21
|
+
this.removeItem( itemToRemoveFromArray )
|
22
|
+
|
23
|
+
Array.prototype.includes = (itemToCheckIfItIsIncluded)->
|
24
|
+
return ( $.inArray( itemToCheckIfItIsIncluded, this ) != -1 )
|
25
|
+
|
26
|
+
Array.prototype.clear = ->
|
27
|
+
this.length = 0
|
28
|
+
|
29
|
+
Array.prototype.pushArray = (arrayOfItemsToAppend)->
|
30
|
+
this.push.apply( this, arrayOfItemsToAppend )
|
31
|
+
# see: http://stackoverflow.com/questions/4156101/
|
32
|
+
|
@@ -0,0 +1,456 @@
|
|
1
|
+
/*!
|
2
|
+
* Mercury Editor is a CoffeeScript and jQuery based WYSIWYG editor. Documentation and other useful information can be
|
3
|
+
* found at https://github.com/jejacks0n/mercury
|
4
|
+
*
|
5
|
+
* Minimum jQuery requirements are 1.7
|
6
|
+
*= require_self
|
7
|
+
*
|
8
|
+
* You can include the Rails jQuery ujs script here to get some nicer behaviors in modals, panels and lightviews when
|
9
|
+
* using :remote => true within the contents rendered in them.
|
10
|
+
* require jquery_ujs
|
11
|
+
*
|
12
|
+
* Add any requires for the support libraries that integrate nicely with Mercury Editor.
|
13
|
+
* require mercury/support/history
|
14
|
+
*
|
15
|
+
* Require Mercury Editor itself.
|
16
|
+
*= require mercury/mercury
|
17
|
+
*
|
18
|
+
* Require any localizations you wish to support
|
19
|
+
* Example: es.locale, or fr.locale -- regional dialects are in each language file so never en_US for instance.
|
20
|
+
* Make sure you enable the localization feature in the configuration.
|
21
|
+
* require mercury/locales/swedish_chef.locale
|
22
|
+
*
|
23
|
+
* Add all requires for plugins that extend or change the behavior of Mercury Editor.
|
24
|
+
* require mercury/plugins/save_as_xml/plugin.js
|
25
|
+
*
|
26
|
+
* Require any files you want to use that either extend, or change the default Mercury behavior.
|
27
|
+
* require mercury_overrides
|
28
|
+
*/
|
29
|
+
window.Mercury = {
|
30
|
+
|
31
|
+
// # Mercury Configuration
|
32
|
+
config: {
|
33
|
+
// ## Toolbars
|
34
|
+
//
|
35
|
+
// This is where you can customize the toolbars by adding or removing buttons, or changing them and their
|
36
|
+
// behaviors. Any top level object put here will create a new toolbar. Buttons are simply nested inside the
|
37
|
+
// toolbars, along with button groups.
|
38
|
+
//
|
39
|
+
// Some toolbars are custom (the snippets toolbar for instance), and to denote that use _custom: true. You can then
|
40
|
+
// build the toolbar yourself with it's own behavior.
|
41
|
+
//
|
42
|
+
// Buttons can be grouped, and a button group is simply a way to wrap buttons for styling -- they can also handle
|
43
|
+
// enabling or disabling all the buttons within it by using a context. The table button group is a good example of
|
44
|
+
// this.
|
45
|
+
//
|
46
|
+
// It's important to note that each of the button names (keys), in each toolbar object must be unique, regardless of
|
47
|
+
// if it's in a button group, or nested, etc. This is because styling is applied to them by name, and because their
|
48
|
+
// name is used in the event that's fired when you click on them.
|
49
|
+
//
|
50
|
+
// Button format: `[label, description, {type: action, type: action, etc}]`
|
51
|
+
//
|
52
|
+
// ### The available button types are:
|
53
|
+
//
|
54
|
+
// - toggle: toggles on or off when clicked, otherwise behaves like a button
|
55
|
+
// - modal: opens a modal window, expects the action to be one of:
|
56
|
+
// 1. a string url
|
57
|
+
// 2. a function that returns a string url
|
58
|
+
// - lightview: opens a lightview window (like modal, but different UI), expects the action to be one of:
|
59
|
+
// 1. a string url
|
60
|
+
// 2. a function that returns a string url
|
61
|
+
// - panel: opens a panel dialog, expects the action to be one of:
|
62
|
+
// 1. a string url
|
63
|
+
// 2. a function that returns a string url
|
64
|
+
// - palette: opens a palette window, expects the action to be one of:
|
65
|
+
// 1. a string url
|
66
|
+
// 2. a function that returns a string url
|
67
|
+
// - select: opens a pulldown style window, expects the action to be one of:
|
68
|
+
// 1. a string url
|
69
|
+
// 2. a function that returns a string url
|
70
|
+
// - context: calls a callback function, expects the action to be:
|
71
|
+
// 1. a function that returns a boolean to highlight the button
|
72
|
+
// note: if a function isn't provided, the key will be passed to the contextHandler, in which case a default
|
73
|
+
// context will be used (for more info read the Contexts section below)
|
74
|
+
// - mode: toggle a given mode in the editor, expects the action to be:
|
75
|
+
// 1. a string, denoting the name of the mode
|
76
|
+
// note: it's assumed that when a specific mode is turned on, all other modes will be turned off, which happens
|
77
|
+
// automatically, thus putting the editor into a specific "state"
|
78
|
+
// - regions: allows buttons to be enabled/disabled based on what region type has focus, expects:
|
79
|
+
// 1. an array of region types (eg. ['full', 'markdown'])
|
80
|
+
// - preload: allows some dialog views to be loaded when the button is created instead of on first open, expects:
|
81
|
+
// 1. a boolean true / false
|
82
|
+
// note: this is only used by panels, selects, and palettes
|
83
|
+
//
|
84
|
+
// Separators are any "button" that's not an array, and are expected to be a string. You can use two different
|
85
|
+
// separator styles: line ('-'), and spacer (' ').
|
86
|
+
//
|
87
|
+
// ### Adding Contexts
|
88
|
+
//
|
89
|
+
// Contexts are used callback functions used for highlighting and disabling/enabling buttons and buttongroups. When
|
90
|
+
// the cursor enters an element within an html region for instance we want to disable or highlight buttons based on
|
91
|
+
// the properties of the given node. You can see examples of contexts in, and add your own to:
|
92
|
+
// `Mercury.Toolbar.Button.contexts` and `Mercury.Toolbar.ButtonGroup.contexts`
|
93
|
+
toolbars: {
|
94
|
+
primary: {
|
95
|
+
save: ['Save', 'Save this page'],
|
96
|
+
preview: ['Preview', 'Preview this page', { toggle: true, mode: true }],
|
97
|
+
sep1: ' ',
|
98
|
+
undoredo: {
|
99
|
+
undo: ['Undo', 'Undo your last action'],
|
100
|
+
redo: ['Redo', 'Redo your last action'],
|
101
|
+
sep: ' '
|
102
|
+
},
|
103
|
+
insertLink: ['Link', 'Insert Link', { modal: '/mercury/modals/link.html', regions: ['full', 'markdown'] }],
|
104
|
+
// insertMedia: ['Media', 'Insert Media (images and videos)', { modal: '/mercury/modals/media.html', regions: ['full', 'markdown'] }],
|
105
|
+
insertTable: ['Table', 'Insert Table', { modal: '/mercury/modals/table.html', regions: ['full', 'markdown'] }],
|
106
|
+
insertCharacter: ['Character', 'Special Characters', { modal: '/mercury/modals/character.html', regions: ['full', 'markdown'] }],
|
107
|
+
// snippetPanel: ['Snippet', 'Snippet Panel', { panel: '/mercury/panels/snippets.html' }],
|
108
|
+
// sep2: ' ',
|
109
|
+
// historyPanel: ['History', 'Page Version History', { panel: '/mercury/panels/history.html' }],
|
110
|
+
// sep3: ' ',
|
111
|
+
// notesPanel: ['Notes', 'Page Notes', { panel: '/mercury/panels/notes.html' }]
|
112
|
+
},
|
113
|
+
|
114
|
+
editable: {
|
115
|
+
_regions: ['full', 'markdown'],
|
116
|
+
predefined: {
|
117
|
+
style: ['Style', null, { select: '/mercury/selects/style.html', preload: true }],
|
118
|
+
sep1: ' ',
|
119
|
+
formatblock: ['Block Format', null, { select: '/mercury/selects/formatblock.html', preload: true }],
|
120
|
+
sep2: '-'
|
121
|
+
},
|
122
|
+
colors: {
|
123
|
+
backColor: ['Background Color', null, { palette: '/mercury/palettes/backcolor.html', context: true, preload: true, regions: ['full'] }],
|
124
|
+
sep1: ' ',
|
125
|
+
foreColor: ['Text Color', null, { palette: '/mercury/palettes/forecolor.html', context: true, preload: true, regions: ['full'] }],
|
126
|
+
sep2: '-'
|
127
|
+
},
|
128
|
+
decoration: {
|
129
|
+
bold: ['Bold', null, { context: true }],
|
130
|
+
italic: ['Italicize', null, { context: true }],
|
131
|
+
overline: ['Overline', null, { context: true, regions: ['full'] }],
|
132
|
+
strikethrough: ['Strikethrough', null, { context: true, regions: ['full'] }],
|
133
|
+
underline: ['Underline', null, { context: true, regions: ['full'] }],
|
134
|
+
sep: '-'
|
135
|
+
},
|
136
|
+
script: {
|
137
|
+
subscript: ['Subscript', null, { context: true }],
|
138
|
+
superscript: ['Superscript', null, { context: true }],
|
139
|
+
sep: '-'
|
140
|
+
},
|
141
|
+
justify: {
|
142
|
+
justifyLeft: ['Align Left', null, { context: true, regions: ['full'] }],
|
143
|
+
justifyCenter: ['Center', null, { context: true, regions: ['full'] }],
|
144
|
+
justifyRight: ['Align Right', null, { context: true, regions: ['full'] }],
|
145
|
+
justifyFull: ['Justify Full', null, { context: true, regions: ['full'] }],
|
146
|
+
sep: '-'
|
147
|
+
},
|
148
|
+
list: {
|
149
|
+
insertUnorderedList: ['Unordered List', null, { context: true }],
|
150
|
+
insertOrderedList: ['Numbered List', null, { context: true }],
|
151
|
+
sep: '-'
|
152
|
+
},
|
153
|
+
indent: {
|
154
|
+
outdent: ['Decrease Indentation'],
|
155
|
+
indent: ['Increase Indentation'],
|
156
|
+
sep: '-'
|
157
|
+
},
|
158
|
+
table: {
|
159
|
+
_context: true,
|
160
|
+
insertRowBefore: ['Insert Table Row', 'Insert a table row before the cursor', { regions: ['full'] }],
|
161
|
+
insertRowAfter: ['Insert Table Row', 'Insert a table row after the cursor', { regions: ['full'] }],
|
162
|
+
deleteRow: ['Delete Table Row', 'Delete this table row', { regions: ['full'] }],
|
163
|
+
insertColumnBefore: ['Insert Table Column', 'Insert a table column before the cursor', { regions: ['full'] }],
|
164
|
+
insertColumnAfter: ['Insert Table Column', 'Insert a table column after the cursor', { regions: ['full'] }],
|
165
|
+
deleteColumn: ['Delete Table Column', 'Delete this table column', { regions: ['full'] }],
|
166
|
+
sep1: ' ',
|
167
|
+
increaseColspan: ['Increase Cell Columns', 'Increase the cells colspan'],
|
168
|
+
decreaseColspan: ['Decrease Cell Columns', 'Decrease the cells colspan and add a new cell'],
|
169
|
+
increaseRowspan: ['Increase Cell Rows', 'Increase the cells rowspan'],
|
170
|
+
decreaseRowspan: ['Decrease Cell Rows', 'Decrease the cells rowspan and add a new cell'],
|
171
|
+
sep2: '-'
|
172
|
+
},
|
173
|
+
rules: {
|
174
|
+
horizontalRule: ['Horizontal Rule', 'Insert a horizontal rule'],
|
175
|
+
sep1: '-'
|
176
|
+
},
|
177
|
+
formatting: {
|
178
|
+
removeFormatting: ['Remove Formatting', 'Remove formatting for the selection', { regions: ['full'] }],
|
179
|
+
sep2: ' '
|
180
|
+
},
|
181
|
+
editors: {
|
182
|
+
htmlEditor: ['Edit HTML', 'Edit the HTML content', { regions: ['full'] }]
|
183
|
+
}
|
184
|
+
},
|
185
|
+
|
186
|
+
snippets: {
|
187
|
+
_custom: true,
|
188
|
+
actions: {
|
189
|
+
editSnippet: ['Edit Snippet Settings'],
|
190
|
+
sep1: ' ',
|
191
|
+
removeSnippet: ['Remove Snippet']
|
192
|
+
}
|
193
|
+
}
|
194
|
+
},
|
195
|
+
|
196
|
+
|
197
|
+
// ## Region Options
|
198
|
+
//
|
199
|
+
// You can customize some aspects of how regions are found, identified, and saved.
|
200
|
+
//
|
201
|
+
// attribute: Mercury identifies editable regions by a data-mercury attribute. This attribute has to be added in
|
202
|
+
// your HTML in advance, and is the only real code/naming exposed in the implementation of Mercury. To allow this
|
203
|
+
// to be as configurable as possible, you can set the name of this attribute. If you change this, you should adjust
|
204
|
+
// the injected styles as well.
|
205
|
+
//
|
206
|
+
// identifier: This is used as a unique identifier for any given region (and thus should be unique to the page).
|
207
|
+
// By default this is the id attribute but can be changed to a data attribute should you want to use something
|
208
|
+
// custom instead.
|
209
|
+
//
|
210
|
+
// dataAttributes: The dataAttributes is an array of data attributes that will be serialized and returned to the
|
211
|
+
// server upon saving. These attributes, when applied to a Mercury region element, will be automatically serialized
|
212
|
+
// and submitted with the AJAX request sent when a page is saved. These are expected to be HTML5 data attributes,
|
213
|
+
// and 'data-' will automatically be prepended to each item in this directive. (ex. ['scope', 'version'])
|
214
|
+
//
|
215
|
+
// determineType: This function is called after checking the data-type attribute for the correct field type. Use
|
216
|
+
// it if you want to dynamically set the type based on inspection of the region.
|
217
|
+
regions: {
|
218
|
+
attribute: 'data-mercury',
|
219
|
+
identifier: 'id',
|
220
|
+
dataAttributes: []
|
221
|
+
// determineType: function(region){},
|
222
|
+
},
|
223
|
+
|
224
|
+
|
225
|
+
// ## Snippet Options / Preview
|
226
|
+
//
|
227
|
+
// When a user drags a snippet onto the page they'll be prompted to enter options for the given snippet. The server
|
228
|
+
// is expected to respond with a form. Once the user submits this form, an Ajax request is sent to the server with
|
229
|
+
// the options provided; this preview request is expected to respond with the rendered markup for the snippet.
|
230
|
+
//
|
231
|
+
// method: The HTTP method used when submitting both the options and the preview. We use POST by default because a
|
232
|
+
// snippet options form may contain large text inputs and we don't want that to be truncated when sent to the
|
233
|
+
// server.
|
234
|
+
//
|
235
|
+
// optionsUrl: The url that the options form will be loaded from.
|
236
|
+
//
|
237
|
+
// previewUrl: The url that the options will be submitted to, and will return the rendered snippet markup.
|
238
|
+
//
|
239
|
+
// **Note:** `:name` will be replaced with the snippet name in the urls (eg. /mercury/snippets/example/options.html)
|
240
|
+
snippets: {
|
241
|
+
method: 'POST',
|
242
|
+
optionsUrl: '/mercury/snippets/:name/options.html',
|
243
|
+
previewUrl: '/mercury/snippets/:name/preview.html'
|
244
|
+
},
|
245
|
+
|
246
|
+
|
247
|
+
// ## Image Uploading
|
248
|
+
//
|
249
|
+
// If you drag images from your desktop into regions that support it, it will be uploaded to the server and inserted
|
250
|
+
// into the region. You can disable or enable this feature, the accepted mime-types, file size restrictions, and
|
251
|
+
// other things related to uploading.
|
252
|
+
//
|
253
|
+
// **Note:** Image uploading is only supported in some region types, and some browsers.
|
254
|
+
//
|
255
|
+
// enabled: You can set this to true, or false if you want to disable the feature entirely.
|
256
|
+
//
|
257
|
+
// allowedMimeTypes: You can restrict the types of files that can be uploaded by providing a list of allowed mime
|
258
|
+
// types.
|
259
|
+
//
|
260
|
+
// maxFileSize: You can restrict large files by setting the maxFileSize (in bytes).
|
261
|
+
//
|
262
|
+
// inputName: When uploading, a form is generated and submitted to the server via Ajax. If your server would prefer
|
263
|
+
// a different name for how the image comes through, you can change the inputName.
|
264
|
+
//
|
265
|
+
// url: The url that the image upload will be submitted to.
|
266
|
+
//
|
267
|
+
// handler: You can use false to let Mercury handle it for you, or you can provide a handler function that can
|
268
|
+
// modify the response from the server. This can be useful if your server doesn't respond the way Mercury expects.
|
269
|
+
// The handler function should take the response from the server and return an object that matches:
|
270
|
+
// `{image: {url: '[your provided url]'}`
|
271
|
+
uploading: {
|
272
|
+
enabled: true,
|
273
|
+
allowedMimeTypes: ['image/jpeg', 'image/gif', 'image/png'],
|
274
|
+
maxFileSize: 1235242880,
|
275
|
+
inputName: 'image[image]',
|
276
|
+
url: '/mercury/images',
|
277
|
+
handler: false
|
278
|
+
},
|
279
|
+
|
280
|
+
|
281
|
+
// ## Localization / I18n
|
282
|
+
//
|
283
|
+
// Include the .locale files you want to support when loading Mercury. The files are always named by the language,
|
284
|
+
// and not the regional dialect (eg. en.locale.js) because the regional dialects are nested within the primary
|
285
|
+
// locale files.
|
286
|
+
//
|
287
|
+
// The client locale will be used first, and if no proper locale file is found for their language then the fallback
|
288
|
+
// preferredLocale configuration will be used. If one isn't provided, and the client locale isn't included, the
|
289
|
+
// strings will remain untranslated.
|
290
|
+
//
|
291
|
+
// enabled: Set to false to disable, true to enable.
|
292
|
+
//
|
293
|
+
// preferredLocale: If a client doesn't support the locales you've included, this is used as a fallback.
|
294
|
+
localization: {
|
295
|
+
enabled: false,
|
296
|
+
preferredLocale: 'swedish_chef-BORK'
|
297
|
+
},
|
298
|
+
|
299
|
+
|
300
|
+
// ## Behaviors
|
301
|
+
//
|
302
|
+
// Behaviors are used to change the default behaviors of a given region type when a given button is clicked. For
|
303
|
+
// example, you may prefer to add HR tags using an HR wrapped within a div with a classname (for styling). You
|
304
|
+
// can add your own complex behaviors here and they'll be shared across all regions.
|
305
|
+
//
|
306
|
+
// If you want to add behaviors to specific region types, you can mix them into the actions property of any region
|
307
|
+
// type.
|
308
|
+
//
|
309
|
+
// Mercury.Regions.Full.actions.htmlEditor = function() {}
|
310
|
+
//
|
311
|
+
// You can see how the behavior matches up directly with the button names. It's also important to note that the
|
312
|
+
// callback functions are executed within the scope of the given region, so you have access to all it's methods.
|
313
|
+
behaviors: {
|
314
|
+
//foreColor: function(selection, options) { selection.wrap('<span style="color:' + options.value.toHex() + '">', true) },
|
315
|
+
htmlEditor: function() { Mercury.modal('/mercury/modals/htmleditor.html', { title: 'HTML Editor', fullHeight: true, handler: 'htmlEditor' }); }
|
316
|
+
},
|
317
|
+
|
318
|
+
|
319
|
+
// ## Global Behaviors
|
320
|
+
//
|
321
|
+
// Global behaviors are much like behaviors, but are more "global". Things like save, exit, etc. can be included
|
322
|
+
// here. They'll only be called once, and execute within the scope of whatever editor is instantiated (eg.
|
323
|
+
// PageEditor).
|
324
|
+
//
|
325
|
+
// An example of changing how saving works:
|
326
|
+
//
|
327
|
+
// save: function() {
|
328
|
+
// var data = top.JSON.stringify(this.serialize(), null, ' ');
|
329
|
+
// var content = '<textarea style="width:500px;height:200px" wrap="off">' + data + '</textarea>';
|
330
|
+
// Mercury.modal(null, {title: 'Saving', closeButton: true, content: content})
|
331
|
+
// }
|
332
|
+
//
|
333
|
+
// This is a nice way to add functionality, when the behaviors aren't region specific. These can be triggered by a
|
334
|
+
// button, or manually with `Mercury.trigger('action', {action: 'barrelRoll'})`
|
335
|
+
globalBehaviors: {
|
336
|
+
exit: function() { window.location.href = this.iframeSrc() },
|
337
|
+
barrelRoll: function() { $('body').css({webkitTransform: 'rotate(360deg)'}) }
|
338
|
+
},
|
339
|
+
|
340
|
+
|
341
|
+
// ## Ajax and CSRF Headers
|
342
|
+
//
|
343
|
+
// Some server frameworks require that you provide a specific header for Ajax requests. The values for these CSRF
|
344
|
+
// tokens are typically stored in the rendered DOM. By default, Mercury will look for the Rails specific meta tag,
|
345
|
+
// and provide the X-CSRF-Token header on Ajax requests, but you can modify this configuration if the system you're
|
346
|
+
// using doesn't follow the same standard.
|
347
|
+
csrfSelector: 'meta[name="csrf-token"]',
|
348
|
+
csrfHeader: 'X-CSRF-Token',
|
349
|
+
|
350
|
+
|
351
|
+
// ## Editor URLs
|
352
|
+
//
|
353
|
+
// When loading a given page, you may want to tweak this regex. It's to allow the url to differ from the page
|
354
|
+
// you're editing, and the url at which you access it.
|
355
|
+
editorUrlRegEx: /([http|https]:\/\/.[^\/]*)\/editor\/?(.*)/i,
|
356
|
+
|
357
|
+
|
358
|
+
// ## Hijacking Links & Forms
|
359
|
+
//
|
360
|
+
// Mercury will hijack links and forms that don't have a target set, or the target is set to _self and will set it
|
361
|
+
// to _parent. This is because the target must be set properly for Mercury to not get in the way of some
|
362
|
+
// functionality, like proper page loads on form submissions etc. Mercury doesn't do this to links or forms that
|
363
|
+
// are within editable regions because it doesn't want to impact the html that's saved. With that being explained,
|
364
|
+
// you can add classes to links or forms that you don't want this behavior added to. Let's say you have links that
|
365
|
+
// open a lightbox style window, and you don't want the targets of these to be set to _parent. You can add classes
|
366
|
+
// to this array, and they will be ignored when the hijacking is applied.
|
367
|
+
nonHijackableClasses: [],
|
368
|
+
|
369
|
+
|
370
|
+
// ## Pasting & Sanitizing
|
371
|
+
//
|
372
|
+
// When pasting content into Mercury it may sometimes contain HTML tags and attributes. This markup is used to
|
373
|
+
// style the content and makes the pasted content look (and behave) the same as the original content. This can be a
|
374
|
+
// desired feature or an annoyance, so you can enable various sanitizing methods to clean the content when it's
|
375
|
+
// pasted.
|
376
|
+
//
|
377
|
+
// sanitize: Can be any of the following:
|
378
|
+
// - false: no sanitizing is done, the content is pasted the exact same as it was copied by the user
|
379
|
+
// - 'whitelist': content is cleaned using the settings specified in the tag white list (described below)
|
380
|
+
// - 'text': all html is stripped before pasting, leaving only the raw text
|
381
|
+
//
|
382
|
+
// whitelist: The white list allows you to specify tags and attributes that are allowed when pasting content. Each
|
383
|
+
// item in this object should contain the allowed tag, and an array of attributes that are allowed on that tag. If
|
384
|
+
// the allowed attributes array is empty, all attributes will be removed. If a tag is not present in this list, it
|
385
|
+
// will be removed, but without removing any of the text or tags inside it.
|
386
|
+
//
|
387
|
+
// **Note:** Content is *always* sanitized if looks like it's from MS Word or similar editors regardless of this
|
388
|
+
// configuration.
|
389
|
+
pasting: {
|
390
|
+
sanitize: 'whitelist',
|
391
|
+
whitelist: {
|
392
|
+
h1: [],
|
393
|
+
h2: [],
|
394
|
+
h3: [],
|
395
|
+
h4: [],
|
396
|
+
h5: [],
|
397
|
+
h6: [],
|
398
|
+
table: [],
|
399
|
+
thead: [],
|
400
|
+
tbody: [],
|
401
|
+
tfoot: [],
|
402
|
+
tr: [],
|
403
|
+
th: ['colspan', 'rowspan'],
|
404
|
+
td: ['colspan', 'rowspan'],
|
405
|
+
div: ['class'],
|
406
|
+
span: ['class'],
|
407
|
+
ul: [],
|
408
|
+
ol: [],
|
409
|
+
li: [],
|
410
|
+
b: [],
|
411
|
+
strong: [],
|
412
|
+
i: [],
|
413
|
+
em: [],
|
414
|
+
u: [],
|
415
|
+
strike: [],
|
416
|
+
br: [],
|
417
|
+
p: [],
|
418
|
+
hr: [],
|
419
|
+
a: ['href', 'target', 'title', 'name'],
|
420
|
+
img: ['src', 'title', 'alt']
|
421
|
+
}
|
422
|
+
},
|
423
|
+
|
424
|
+
|
425
|
+
// ## Injected Styles
|
426
|
+
//
|
427
|
+
// Mercury tries to stay as much out of your code as possible, but because regions appear within your document we
|
428
|
+
// need to include a few styles to indicate regions, as well as the different states of them (eg. focused). These
|
429
|
+
// styles are injected into your document, and as simple as they might be, you may want to change them.
|
430
|
+
injectedStyles: '' +
|
431
|
+
'[data-mercury] { min-height: 10px; outline: 1px dotted #09F } ' +
|
432
|
+
'[data-mercury]:focus { outline: none; -webkit-box-shadow: 0 0 10px #09F, 0 0 1px #045; box-shadow: 0 0 10px #09F, 0 0 1px #045 }' +
|
433
|
+
'[data-mercury].focus { outline: none; -webkit-box-shadow: 0 0 10px #09F, 0 0 1px #045; box-shadow: 0 0 10px #09F, 0 0 1px #045 }' +
|
434
|
+
'[data-mercury]:after { content: "."; display: block; visibility: hidden; clear: both; height: 0; overflow: hidden; }' +
|
435
|
+
'[data-mercury] table { border: 1px dotted red; min-width: 6px; }' +
|
436
|
+
'[data-mercury] th { border: 1px dotted red; min-width: 6px; }' +
|
437
|
+
'[data-mercury] td { border: 1px dotted red; min-width: 6px; }' +
|
438
|
+
'[data-mercury] .mercury-textarea { border: 0; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; resize: none; }' +
|
439
|
+
'[data-mercury] .mercury-textarea:focus { outline: none; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; }'
|
440
|
+
},
|
441
|
+
|
442
|
+
// ## Silent Mode
|
443
|
+
//
|
444
|
+
// Turning silent mode on will disable asking about unsaved changes before leaving the page.
|
445
|
+
silent: false,
|
446
|
+
|
447
|
+
// ## Debug Mode
|
448
|
+
//
|
449
|
+
// Turning debug mode on will log events and other various things (using console.debug if available).
|
450
|
+
debug: false
|
451
|
+
|
452
|
+
};
|
453
|
+
|
454
|
+
$(window).bind('mercury:saved', function() {
|
455
|
+
Mercury.trigger('action', {action: 'exit'});
|
456
|
+
});
|