community_engine 2.3.2 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/.travis.yml +5 -4
- data/CHANGELOG +43 -5
- data/Gemfile +1 -16
- data/README.markdown +22 -19
- data/UPGRADING.markdown +10 -0
- data/about.yml +1 -1
- data/app/assets/javascripts/community_engine.js +187 -18
- data/app/assets/javascripts/cropper.js +86 -565
- data/app/assets/javascripts/forum.js +26 -71
- data/app/assets/javascripts/jquery.migrate.js +521 -0
- data/app/assets/stylesheets/_colors.css.scss +100 -0
- data/app/assets/stylesheets/_font.css.scss +17 -0
- data/app/assets/stylesheets/_forms.css.scss +20 -0
- data/app/assets/stylesheets/_forum.css.scss +0 -0
- data/app/assets/stylesheets/_grid.css.scss +7 -0
- data/app/assets/stylesheets/_layers.css.scss +7 -0
- data/app/assets/stylesheets/_layout.css.scss +28 -0
- data/app/assets/stylesheets/community_engine.css.scss +18 -0
- data/app/assets/stylesheets/cropper.css +6 -182
- data/app/controllers/activities_controller.rb +10 -10
- data/app/controllers/admin_controller.rb +23 -23
- data/app/controllers/ads_controller.rb +16 -5
- data/app/controllers/albums_controller.rb +11 -5
- data/app/controllers/base_controller.rb +5 -8
- data/app/controllers/categories_controller.rb +31 -31
- data/app/controllers/clippings_controller.rb +18 -12
- data/app/controllers/comments_controller.rb +17 -8
- data/app/controllers/events_controller.rb +25 -21
- data/app/controllers/favorites_controller.rb +12 -12
- data/app/controllers/forums_controller.rb +20 -9
- data/app/controllers/friendships_controller.rb +41 -48
- data/app/controllers/homepage_features_controller.rb +11 -5
- data/app/controllers/invitations_controller.rb +15 -9
- data/app/controllers/messages_controller.rb +25 -19
- data/app/controllers/metro_areas_controller.rb +9 -3
- data/app/controllers/moderators_controller.rb +1 -1
- data/app/controllers/monitorships_controller.rb +2 -2
- data/app/controllers/pages_controller.rb +16 -4
- data/app/controllers/password_resets_controller.rb +0 -1
- data/app/controllers/photos_controller.rb +32 -30
- data/app/controllers/posts_controller.rb +33 -17
- data/app/controllers/rsvps_controller.rb +8 -4
- data/app/controllers/sb_posts_controller.rb +22 -18
- data/app/controllers/sessions_controller.rb +2 -1
- data/app/controllers/sitemap_controller.rb +8 -8
- data/app/controllers/statistics_controller.rb +9 -8
- data/app/controllers/tags_controller.rb +26 -24
- data/app/controllers/topics_controller.rb +10 -6
- data/app/controllers/users_controller.rb +63 -34
- data/app/helpers/base_helper.rb +119 -29
- data/app/helpers/friendships_helper.rb +3 -3
- data/app/helpers/posts_helper.rb +5 -7
- data/app/models/acts_as_taggable_on/tag.rb +12 -13
- data/app/models/ad.rb +2 -5
- data/app/models/album.rb +0 -2
- data/app/models/category.rb +6 -7
- data/app/models/clipping.rb +2 -5
- data/app/models/clipping_image.rb +5 -5
- data/app/models/comment.rb +4 -5
- data/app/models/country.rb +2 -4
- data/app/models/event.rb +1 -2
- data/app/models/favorite.rb +5 -10
- data/app/models/forum.rb +0 -2
- data/app/models/friendship.rb +3 -5
- data/app/models/friendship_status.rb +0 -2
- data/app/models/homepage_feature.rb +4 -6
- data/app/models/invitation.rb +6 -8
- data/app/models/message.rb +25 -26
- data/app/models/message_thread.rb +1 -1
- data/app/models/metro_area.rb +0 -2
- data/app/models/page.rb +0 -2
- data/app/models/photo.rb +8 -8
- data/app/models/poll.rb +7 -9
- data/app/models/post.rb +11 -15
- data/app/models/role.rb +1 -2
- data/app/models/rsvp.rb +0 -3
- data/app/models/sb_post.rb +14 -9
- data/app/models/state.rb +0 -2
- data/app/models/topic.rb +5 -6
- data/app/models/user.rb +50 -63
- data/app/models/vote.rb +1 -1
- data/app/views/activities/_activity.html.haml +9 -9
- data/app/views/activities/destroy.js.erb +1 -0
- data/app/views/activities/index.html.haml +13 -13
- data/app/views/activities/network.html.haml +10 -13
- data/app/views/admin/comments.html.haml +48 -70
- data/app/views/admin/events.html.haml +20 -27
- data/app/views/admin/messages.html.haml +2 -3
- data/app/views/admin/update.js.erb +1 -0
- data/app/views/admin/users.html.haml +51 -66
- data/app/views/ads/_form.html.haml +21 -0
- data/app/views/ads/edit.html.haml +6 -46
- data/app/views/ads/index.html.haml +25 -39
- data/app/views/ads/new.html.haml +4 -43
- data/app/views/ads/show.html.haml +18 -35
- data/app/views/albums/_form.html.haml +17 -12
- data/app/views/albums/edit.html.haml +12 -14
- data/app/views/albums/new.html.haml +8 -13
- data/app/views/albums/show.html.haml +25 -32
- data/app/views/base/_homepage_banner_message.html.haml +5 -19
- data/app/views/base/advertise.html.haml +5 -8
- data/app/views/base/site_index.html.haml +25 -27
- data/app/views/categories/_form.html.haml +8 -0
- data/app/views/categories/_menu_item.html.haml +13 -0
- data/app/views/categories/_tips.html.haml +2 -2
- data/app/views/categories/edit.html.haml +3 -33
- data/app/views/categories/index.html.haml +18 -28
- data/app/views/categories/new.html.haml +3 -8
- data/app/views/categories/show.html.haml +33 -36
- data/app/views/clippings/_clipping.html.haml +10 -17
- data/app/views/clippings/_favorite.html.haml +14 -0
- data/app/views/clippings/_form.html.haml +15 -0
- data/app/views/clippings/_images.html.haml +1 -1
- data/app/views/clippings/_menu_item.html.haml +6 -0
- data/app/views/clippings/edit.html.haml +12 -23
- data/app/views/clippings/index.html.haml +29 -30
- data/app/views/clippings/load_images_from_uri.js.erb +1 -0
- data/app/views/clippings/new.html.haml +9 -26
- data/app/views/clippings/new_clipping.html.haml +30 -77
- data/app/views/clippings/show.html.haml +48 -53
- data/app/views/clippings/site_index.html.haml +19 -32
- data/app/views/comments/_comment.html.haml +40 -40
- data/app/views/comments/_comment_form.html.haml +22 -46
- data/app/views/comments/_edit_form.html.haml +13 -28
- data/app/views/comments/create.js.erb +25 -0
- data/app/views/comments/destroy.js.erb +3 -0
- data/app/views/comments/edit.js.erb +11 -0
- data/app/views/comments/index.html.haml +12 -22
- data/app/views/comments/update.js.erb +14 -0
- data/app/views/events/_event.html.haml +26 -24
- data/app/views/events/_form.html.haml +18 -0
- data/app/views/events/_menu_item.html.haml +6 -0
- data/app/views/events/_subscribe.html.haml +1 -1
- data/app/views/events/edit.html.haml +7 -32
- data/app/views/events/index.html.haml +11 -19
- data/app/views/events/new.html.haml +2 -31
- data/app/views/events/show.html.haml +54 -24
- data/app/views/favorites/create.js.erb +10 -0
- data/app/views/favorites/destroy.js.erb +6 -0
- data/app/views/favorites/index.html.haml +6 -8
- data/app/views/forums/_form.html.haml +10 -20
- data/app/views/forums/_menu_item.html.haml +6 -0
- data/app/views/forums/edit.html.haml +8 -10
- data/app/views/forums/index.html.haml +56 -64
- data/app/views/forums/new.html.haml +5 -8
- data/app/views/forums/show.html.haml +65 -72
- data/app/views/friendships/_friendship.html.haml +14 -16
- data/app/views/friendships/accepted.html.haml +7 -11
- data/app/views/friendships/create.js.haml +1 -0
- data/app/views/friendships/denied.html.haml +4 -8
- data/app/views/friendships/pending.html.haml +4 -6
- data/app/views/friendships/show.html.haml +10 -11
- data/app/views/homepage_features/_form.html.haml +6 -0
- data/app/views/homepage_features/edit.html.haml +5 -30
- data/app/views/homepage_features/index.html.haml +22 -28
- data/app/views/homepage_features/new.html.haml +2 -30
- data/app/views/homepage_features/show.html.haml +27 -29
- data/app/views/invitations/index.html.haml +8 -0
- data/app/views/invitations/new.html.haml +21 -30
- data/app/views/kaminari/bootstrap/_first_page.html.erb +13 -0
- data/app/views/kaminari/bootstrap/_gap.html.erb +8 -0
- data/app/views/kaminari/bootstrap/_last_page.html.erb +13 -0
- data/app/views/kaminari/bootstrap/_next_page.html.erb +13 -0
- data/app/views/kaminari/bootstrap/_page.html.erb +12 -0
- data/app/views/kaminari/bootstrap/_paginator.html.erb +25 -0
- data/app/views/kaminari/bootstrap/_prev_page.html.erb +13 -0
- data/app/views/layouts/application.html.haml +26 -37
- data/app/views/messages/_form.html.haml +6 -12
- data/app/views/messages/_inbox.html.haml +34 -39
- data/app/views/messages/_menu_item.html.haml +11 -0
- data/app/views/messages/_sent.html.haml +22 -33
- data/app/views/messages/_sidebar_nav.html.haml +12 -9
- data/app/views/messages/index.html.haml +2 -2
- data/app/views/messages/new.html.haml +2 -9
- data/app/views/messages/show.html.haml +28 -36
- data/app/views/metro_areas/_form.html.haml +6 -0
- data/app/views/metro_areas/edit.html.haml +6 -14
- data/app/views/metro_areas/index.html.haml +19 -26
- data/app/views/metro_areas/new.html.haml +4 -14
- data/app/views/metro_areas/show.html.haml +13 -21
- data/app/views/moderators/_toggle.html.haml +6 -0
- data/app/views/moderators/create.js.erb +5 -0
- data/app/views/moderators/destroy.js.erb +1 -0
- data/app/views/monitorships/create.js.erb +1 -0
- data/app/views/monitorships/destroy.js.erb +1 -0
- data/app/views/pages/_form.html.haml +16 -23
- data/app/views/pages/edit.html.haml +2 -14
- data/app/views/pages/index.html.haml +32 -32
- data/app/views/pages/new.html.haml +5 -12
- data/app/views/pages/show.html.haml +4 -8
- data/app/views/password_resets/edit.html.haml +6 -14
- data/app/views/password_resets/new.html.haml +7 -11
- data/app/views/photo_manager/index.html.haml +45 -43
- data/app/views/photos/_form.html.haml +24 -0
- data/app/views/photos/_manage_photos.html.haml +14 -6
- data/app/views/photos/_show_image_list.html.haml +2 -2
- data/app/views/photos/create.js.erb +1 -0
- data/app/views/photos/edit.html.haml +10 -38
- data/app/views/photos/index.html.haml +20 -20
- data/app/views/photos/manage_photos.js.erb +5 -0
- data/app/views/photos/new.html.haml +11 -49
- data/app/views/photos/recent.html.haml +6 -6
- data/app/views/photos/show.html.haml +48 -52
- data/app/views/polls/_edit.html.haml +6 -10
- data/app/views/polls/_excerpt.html.haml +3 -4
- data/app/views/polls/_new.html.haml +10 -9
- data/app/views/polls/_poll_ui.html.haml +30 -34
- data/app/views/posts/_author_profile.html.haml +12 -11
- data/app/views/posts/_favorited_post.html.haml +8 -10
- data/app/views/posts/_form.html.haml +40 -0
- data/app/views/posts/_menu_item.html.haml +6 -0
- data/app/views/posts/_post.html.haml +27 -24
- data/app/views/posts/_send_to_friend.html.haml +26 -0
- data/app/views/posts/edit.html.haml +11 -48
- data/app/views/posts/featured.html.haml +7 -12
- data/app/views/posts/index.html.haml +14 -18
- data/app/views/posts/manage.html.haml +44 -59
- data/app/views/posts/new.html.haml +9 -64
- data/app/views/posts/popular.html.haml +25 -30
- data/app/views/posts/preview.html.haml +27 -26
- data/app/views/posts/recent.html.haml +20 -27
- data/app/views/posts/send_to_friend.js.erb +3 -0
- data/app/views/posts/show.html.haml +67 -76
- data/app/views/rsvps/_form.html.haml +3 -0
- data/app/views/rsvps/edit.html.haml +3 -9
- data/app/views/rsvps/new.html.haml +3 -9
- data/app/views/sb_posts/_dummy_forum_post.html.haml +13 -0
- data/app/views/sb_posts/_edit.html.haml +6 -0
- data/app/views/sb_posts/_edit_script.js.erb +14 -0
- data/app/views/sb_posts/_reply_form.html.haml +14 -35
- data/app/views/sb_posts/_reply_script.js.erb +13 -0
- data/app/views/sb_posts/_sb_post.html.haml +31 -33
- data/app/views/sb_posts/create.js.erb +30 -0
- data/app/views/sb_posts/destroy.js.erb +2 -0
- data/app/views/sb_posts/edit.html.erb +4 -4
- data/app/views/sb_posts/edit.js.erb +14 -0
- data/app/views/sb_posts/index.html.haml +3 -16
- data/app/views/sb_posts/monitored.html.erb +3 -9
- data/app/views/sb_posts/update.js.erb +11 -0
- data/app/views/sessions/_menu_item.html.haml +28 -0
- data/app/views/sessions/new.html.haml +19 -24
- data/app/views/shared/_add_friend_link.html.haml +9 -0
- data/app/views/shared/_admin_nav.html.haml +6 -8
- data/app/views/shared/_contact.html.haml +1 -1
- data/app/views/shared/_end_javascript.html.haml +4 -4
- data/app/views/shared/_explore.html.haml +7 -6
- data/app/views/shared/_footer_content.html.haml +12 -10
- data/app/views/shared/_footer_links.html.haml +18 -0
- data/app/views/shared/_friend_link.html.haml +25 -0
- data/app/views/shared/_header.html.haml +22 -42
- data/app/views/shared/_jumbotron.html.haml +3 -0
- data/app/views/shared/_load_tinymce.js.erb +15 -0
- data/app/views/shared/_location_chooser.html.haml +26 -17
- data/app/views/shared/_login_sidebar.html.haml +6 -5
- data/app/views/shared/_messages.html.haml +6 -8
- data/app/views/shared/_scripts_and_styles.html.haml +1 -2
- data/app/views/shared/_sidebar.html.haml +1 -0
- data/app/views/shared/_tag_auto_complete.html.haml +19 -0
- data/app/views/shared/_widget.html.haml +3 -0
- data/app/views/sitemap/index.html.haml +15 -20
- data/app/views/statistics/index.html.haml +32 -40
- data/app/views/tags/edit.html.haml +12 -19
- data/app/views/tags/index.html.haml +16 -25
- data/app/views/tags/manage.html.haml +24 -33
- data/app/views/tags/show.html.haml +52 -58
- data/app/views/topics/_form.html.haml +23 -25
- data/app/views/topics/_recent_topics_sidebar.haml +1 -1
- data/app/views/topics/edit.html.haml +7 -9
- data/app/views/topics/new.html.haml +6 -21
- data/app/views/topics/show.html.haml +48 -106
- data/app/views/user_notifier/follow_up_comment_notice.text.erb +1 -1
- data/app/views/user_notifier/message_notification.text.erb +1 -1
- data/app/views/user_notifier/new_forum_post_notice.text.erb +1 -1
- data/app/views/users/_dashboard_nav.html.haml +36 -39
- data/app/views/users/_menu_item.html.haml +6 -0
- data/app/views/users/_omniauth_connect.html.haml +4 -4
- data/app/views/users/_profile_completeness.html.haml +3 -3
- data/app/views/users/_profile_user_info_sidebar.html.haml +40 -43
- data/app/views/users/_search_options.html.haml +9 -7
- data/app/views/users/_sidebar_user.html.haml +1 -1
- data/app/views/users/_user.html.haml +27 -28
- data/app/views/users/crop_profile_photo.html.haml +30 -37
- data/app/views/users/dashboard.html.haml +37 -41
- data/app/views/users/edit.html.haml +53 -71
- data/app/views/users/edit_account.html.haml +44 -64
- data/app/views/users/forgot_username.html.haml +6 -12
- data/app/views/users/index.html.haml +4 -14
- data/app/views/users/invite.html.haml +14 -25
- data/app/views/users/new.html.haml +27 -48
- data/app/views/users/resend_activation.html.haml +7 -12
- data/app/views/users/show.html.haml +88 -90
- data/app/views/users/signup_completed.html.haml +7 -7
- data/app/views/users/statistics.html.haml +17 -18
- data/app/views/users/update.js.erb +1 -0
- data/app/views/users/upload_profile_photo.html.haml +10 -15
- data/app/views/users/welcome_about.html.haml +54 -61
- data/app/views/users/welcome_invite.html.haml +16 -25
- data/app/views/users/welcome_photo.html.haml +18 -27
- data/app/views/votes/create.js.erb +5 -0
- data/community_engine.gemspec +49 -41
- data/config/application_config.rb +13 -16
- data/config/initializers/mce_options.rb +9 -32
- data/config/initializers/recaptcha_constants.rb +2 -2
- data/config/locales/de-DE.yml +1 -17
- data/config/locales/en.yml +18 -32
- data/config/locales/es-AR.yml +2 -14
- data/config/locales/es-ES.yml +0 -6
- data/config/locales/es-MX.yml +1 -9
- data/config/locales/fr-FR.yml +3 -17
- data/config/locales/ja-JP.yml +2 -18
- data/config/locales/ru-RU.yml +3 -21
- data/config/locales/sr-CP.yml +0 -4
- data/config/locales/sv-SE.yml +3 -20
- data/config/routes.rb +37 -42
- data/db/migrate/016_add_metro_areas.rb +2 -2
- data/db/migrate/039_create_activities_table.rb +2 -2
- data/db/migrate/056_create_roles.rb +8 -6
- data/db/migrate/069_create_pages.rb +3 -3
- data/db/migrate/081_upgrade_to_friendly_id_5x.rb +25 -0
- data/db/migrate/082_upgrade_to_acts_as_commentable_4x.rb +29 -0
- data/lib/activity_tracker.rb +3 -0
- data/{vendor/plugins/activity_tracker/lib → lib/activity_tracker}/activity.rb +6 -6
- data/{vendor/plugins/activity_tracker/lib → lib/activity_tracker}/activity_tracker.rb +0 -0
- data/{vendor/plugins/acts_as_publishable/init.rb → lib/acts_as_publishable.rb} +1 -1
- data/{vendor/plugins/acts_as_publishable/lib → lib/acts_as_publishable}/acts_as_publishable.rb +3 -3
- data/lib/community_engine.rb +31 -9
- data/lib/community_engine/engine.rb +17 -1
- data/lib/community_engine/engines_extensions.rb +1 -3
- data/lib/community_engine/version.rb +3 -3
- data/{config/initializers → lib/paperclip_processors}/cropper.rb +3 -3
- data/lib/resource_feeder.rb +3 -0
- data/{vendor/plugins/resource_feeder/lib → lib}/resource_feeder/atom.rb +0 -0
- data/{vendor/plugins/resource_feeder/lib → lib}/resource_feeder/rss.rb +0 -0
- data/{vendor/plugins/white_list/init.rb → lib/white_list.rb} +1 -1
- data/{vendor/plugins/white_list/lib → lib/white_list}/white_list_helper.rb +0 -0
- data/test/fixtures/messages.yml +2 -2
- data/test/functional/admin_controller_test.rb +11 -11
- data/test/functional/ads_controller_test.rb +11 -11
- data/test/functional/albums_controller_test.rb +4 -4
- data/test/functional/categories_controller_test.rb +4 -4
- data/test/functional/clippings_controller_test.rb +4 -4
- data/test/functional/comments_controller_test.rb +20 -16
- data/test/functional/events_controller_test.rb +6 -6
- data/test/functional/forums_controller_test.rb +8 -8
- data/test/functional/friendships_controller_test.rb +13 -18
- data/test/functional/homepage_features_controller_test.rb +5 -5
- data/test/functional/messages_controller_test.rb +6 -2
- data/test/functional/metro_areas_controller_test.rb +7 -7
- data/test/functional/moderators_controller_test.rb +1 -1
- data/test/functional/pages_controller_test.rb +2 -2
- data/test/functional/password_reset_controller_test.rb +2 -2
- data/test/functional/photos_controller_test.rb +16 -15
- data/test/functional/posts_controller_test.rb +4 -4
- data/test/functional/rsvps_controller_test.rb +6 -6
- data/test/functional/sb_posts_controller_test.rb +53 -50
- data/test/functional/sessions_controller_test.rb +4 -1
- data/test/functional/tags_controller_test.rb +1 -1
- data/test/functional/topics_controller_test.rb +10 -10
- data/test/functional/users_controller_test.rb +32 -19
- data/test/functional/votes_controller_test.rb +1 -1
- data/test/test_helper.rb +3 -1
- data/test/testapp/config/application.rb +1 -9
- data/test/testapp/config/environments/development.rb +1 -2
- data/test/testapp/config/environments/production.rb +2 -0
- data/test/testapp/config/environments/test.rb +1 -2
- data/test/testapp/config/initializers/omniauth.rb +3 -3
- data/test/testapp/config/initializers/secret_token.rb +1 -0
- data/test/testapp/db/schema.rb +143 -152
- data/test/unit/category_test.rb +2 -2
- data/test/unit/comment_test.rb +64 -53
- data/test/unit/event_test.rb +4 -4
- data/test/unit/forum_test.rb +1 -1
- data/test/unit/message_test.rb +7 -1
- data/test/unit/page_test.rb +2 -2
- data/test/unit/post_test.rb +47 -47
- data/test/unit/sb_post_test.rb +24 -20
- data/test/unit/topic_test.rb +7 -6
- data/test/unit/user_test.rb +75 -52
- data/vendor/assets/javascripts/.gitkeep +0 -0
- data/vendor/assets/javascripts/jcrop/jquery.Jcrop.js +1699 -0
- data/vendor/assets/javascripts/jcrop/jquery.color.js +661 -0
- data/vendor/assets/javascripts/tag-it/tag-it.js +597 -0
- data/vendor/assets/stylesheets/.gitkeep +0 -0
- data/vendor/assets/stylesheets/jcrop/Jcrop.gif +0 -0
- data/vendor/assets/stylesheets/jcrop/jquery.Jcrop.min.css +28 -0
- data/vendor/assets/stylesheets/tag-it/tag-it.css +69 -0
- data/vendor/assets/stylesheets/tag-it/tagit.ui-zendesk.css +107 -0
- data/vendor/{plugins → converted2.3plugins_to_lib_leftovers}/acts_as_publishable/README +0 -0
- data/vendor/{plugins → converted2.3plugins_to_lib_leftovers}/acts_as_publishable/Rakefile +0 -0
- data/vendor/{plugins → converted2.3plugins_to_lib_leftovers}/acts_as_publishable/generators/publishing/publishing_generator.rb +0 -0
- data/vendor/{plugins → converted2.3plugins_to_lib_leftovers}/acts_as_publishable/generators/publishing/templates/migration.rb +0 -0
- data/vendor/{plugins → converted2.3plugins_to_lib_leftovers}/acts_as_publishable/install.rb +0 -0
- data/vendor/{plugins → converted2.3plugins_to_lib_leftovers}/acts_as_publishable/test/acts_as_publishable_test.rb +0 -0
- data/vendor/{plugins/activity_tracker → converted2.3plugins_to_lib_leftovers/acts_as_publishable}/uninstall.rb +0 -0
- data/vendor/{plugins → converted2.3plugins_to_lib_leftovers}/resource_feeder/README +0 -0
- data/vendor/{plugins → converted2.3plugins_to_lib_leftovers}/resource_feeder/Rakefile +0 -0
- data/vendor/{plugins → converted2.3plugins_to_lib_leftovers}/resource_feeder/test/atom_feed_test.rb +0 -0
- data/vendor/{plugins → converted2.3plugins_to_lib_leftovers}/resource_feeder/test/rss_feed_test.rb +0 -0
- data/vendor/{plugins → converted2.3plugins_to_lib_leftovers}/resource_feeder/test/test_helper.rb +0 -0
- data/vendor/{plugins → converted2.3plugins_to_lib_leftovers}/white_list/README +0 -0
- data/vendor/{plugins → converted2.3plugins_to_lib_leftovers}/white_list/Rakefile +0 -0
- data/vendor/{plugins → converted2.3plugins_to_lib_leftovers}/white_list/test/white_list_test.rb +0 -0
- metadata +348 -302
- data/app/assets/images/bg_h6btn.gif +0 -0
- data/app/assets/images/bg_navbar.gif +0 -0
- data/app/assets/images/clearbits/bg_rounded.gif +0 -0
- data/app/assets/images/clearbits/comment.gif +0 -0
- data/app/assets/images/clearbits/lock.gif +0 -0
- data/app/assets/images/clearbits/smile.gif +0 -0
- data/app/assets/images/close.gif +0 -0
- data/app/assets/images/cropper/marqueeHoriz.gif +0 -0
- data/app/assets/images/cropper/marqueeVert.gif +0 -0
- data/app/assets/images/feed.png +0 -0
- data/app/assets/images/icons/31.png +0 -0
- data/app/assets/images/icons/52.png +0 -0
- data/app/assets/images/icons/accept.png +0 -0
- data/app/assets/images/icons/activity_default.png +0 -0
- data/app/assets/images/icons/add.png +0 -0
- data/app/assets/images/icons/book.png +0 -0
- data/app/assets/images/icons/bullet_arrow_down.png +0 -0
- data/app/assets/images/icons/bullet_arrow_down_50.png +0 -0
- data/app/assets/images/icons/clipping.png +0 -0
- data/app/assets/images/icons/comment.png +0 -0
- data/app/assets/images/icons/comments.png +0 -0
- data/app/assets/images/icons/date.png +0 -0
- data/app/assets/images/icons/delete.png +0 -0
- data/app/assets/images/icons/email.png +0 -0
- data/app/assets/images/icons/email_edit.png +0 -0
- data/app/assets/images/icons/email_go.png +0 -0
- data/app/assets/images/icons/email_open.png +0 -0
- data/app/assets/images/icons/group_go.png +0 -0
- data/app/assets/images/icons/heart.png +0 -0
- data/app/assets/images/icons/heart_add.png +0 -0
- data/app/assets/images/icons/heart_off.png +0 -0
- data/app/assets/images/icons/page_white.png +0 -0
- data/app/assets/images/icons/page_white_magnify.png +0 -0
- data/app/assets/images/icons/picture.png +0 -0
- data/app/assets/images/icons/poll.png +0 -0
- data/app/assets/images/icons/post.png +0 -0
- data/app/assets/images/icons/printer.png +0 -0
- data/app/assets/images/icons/rss.png +0 -0
- data/app/assets/images/icons/slides.png +0 -0
- data/app/assets/images/icons/tag_blue.png +0 -0
- data/app/assets/images/icons/user.png +0 -0
- data/app/assets/images/icons/user_add.png +0 -0
- data/app/assets/images/icons/user_edit.png +0 -0
- data/app/assets/images/icons/user_go.png +0 -0
- data/app/assets/images/icons/vote.png +0 -0
- data/app/assets/images/icons/world.png +0 -0
- data/app/assets/images/icons/wrench.png +0 -0
- data/app/assets/images/logo.gif +0 -0
- data/app/assets/images/reply_background.png +0 -0
- data/app/assets/images/search.gif +0 -0
- data/app/assets/images/thumb.gif +0 -0
- data/app/assets/javascripts/builder.js +0 -136
- data/app/assets/javascripts/calendarview.js +0 -839
- data/app/assets/javascripts/lightbox.js +0 -151
- data/app/assets/javascripts/prototip-min.js +0 -27
- data/app/assets/javascripts/rails.js +0 -202
- data/app/assets/javascripts/tinymce/plugins/curblyadvimage/css/advimage.css +0 -84
- data/app/assets/javascripts/tinymce/plugins/curblyadvimage/editor_plugin.js +0 -52
- data/app/assets/javascripts/tinymce/plugins/curblyadvimage/editor_plugin_src.js +0 -45
- data/app/assets/javascripts/tinymce/plugins/curblyadvimage/image.htm +0 -180
- data/app/assets/javascripts/tinymce/plugins/curblyadvimage/img/sample.gif +0 -0
- data/app/assets/javascripts/tinymce/plugins/curblyadvimage/js/functions.js +0 -508
- data/app/assets/javascripts/tinymce/plugins/curblyadvimage/langs/en.js +0 -3
- data/app/assets/javascripts/tinymce/plugins/curblyadvimage/langs/en_dlg.js +0 -43
- data/app/assets/javascripts/tinymce/plugins/tinyautosave/editor_plugin.js +0 -8
- data/app/assets/javascripts/tinymce/plugins/tinyautosave/editor_plugin_src.js +0 -1001
- data/app/assets/javascripts/tinymce/plugins/tinyautosave/images/progress.gif +0 -0
- data/app/assets/javascripts/tinymce/plugins/tinyautosave/images/progress10.gif +0 -0
- data/app/assets/javascripts/tinymce/plugins/tinyautosave/images/progress11.gif +0 -0
- data/app/assets/javascripts/tinymce/plugins/tinyautosave/images/progress12.gif +0 -0
- data/app/assets/javascripts/tinymce/plugins/tinyautosave/images/progress2.gif +0 -0
- data/app/assets/javascripts/tinymce/plugins/tinyautosave/images/progress3.gif +0 -0
- data/app/assets/javascripts/tinymce/plugins/tinyautosave/images/progress4.gif +0 -0
- data/app/assets/javascripts/tinymce/plugins/tinyautosave/images/progress5.gif +0 -0
- data/app/assets/javascripts/tinymce/plugins/tinyautosave/images/progress6.gif +0 -0
- data/app/assets/javascripts/tinymce/plugins/tinyautosave/images/progress7.gif +0 -0
- data/app/assets/javascripts/tinymce/plugins/tinyautosave/images/progress8.gif +0 -0
- data/app/assets/javascripts/tinymce/plugins/tinyautosave/images/progress9.gif +0 -0
- data/app/assets/javascripts/tinymce/plugins/tinyautosave/images/restore.gif +0 -0
- data/app/assets/javascripts/tinymce/plugins/tinyautosave/images/restore.png +0 -0
- data/app/assets/javascripts/tinymce/plugins/tinyautosave/langs/da.js +0 -5
- data/app/assets/javascripts/tinymce/plugins/tinyautosave/langs/en.js +0 -5
- data/app/assets/stylesheets/community_engine.css +0 -6
- data/app/assets/stylesheets/forum.css +0 -605
- data/app/assets/stylesheets/prototip.css +0 -73
- data/app/assets/stylesheets/reset-fonts-grids.css +0 -8
- data/app/assets/stylesheets/screen.css +0 -977
- data/app/helpers/monitorships_helper.rb +0 -2
- data/app/views/activities/_icon.html.haml +0 -14
- data/app/views/activities/destroy.js.rjs +0 -1
- data/app/views/clippings/_meta.html.haml +0 -26
- data/app/views/clippings/load_images_from_uri.js.rjs +0 -1
- data/app/views/comments/create.js.rjs +0 -20
- data/app/views/comments/edit.js.rjs +0 -7
- data/app/views/comments/update.js.rjs +0 -9
- data/app/views/favorites/create.js.rjs +0 -17
- data/app/views/favorites/destroy.js.rjs +0 -14
- data/app/views/favorites/show.html.haml +0 -13
- data/app/views/friendships/_friendships.html.erb +0 -14
- data/app/views/friendships/index.html.erb +0 -3
- data/app/views/friendships/index.xml.builder +0 -29
- data/app/views/invitations/index.html.erb +0 -16
- data/app/views/moderators/_toggle.html.erb +0 -14
- data/app/views/moderators/create.js.rjs +0 -5
- data/app/views/moderators/destroy.js.rjs +0 -1
- data/app/views/monitorships/create.js.rjs +0 -4
- data/app/views/monitorships/destroy.js.rjs +0 -4
- data/app/views/photos/manage_photos.js.rjs +0 -5
- data/app/views/polls/_polls_sidebar.html.haml +0 -8
- data/app/views/posts/_send_to_friend.html.erb +0 -29
- data/app/views/sb_posts/_dummy_forum_post.html.erb +0 -13
- data/app/views/sb_posts/_edit.html.erb +0 -31
- data/app/views/sb_posts/create.js.rjs +0 -16
- data/app/views/sb_posts/edit.js.rjs +0 -6
- data/app/views/sb_posts/update.js.rjs +0 -5
- data/app/views/shared/_user_menu.html.haml +0 -21
- data/app/views/votes/create.js.rjs +0 -6
- data/db/migrate/090_add_comment_role.rb +0 -15
- data/vendor/plugins/activity_tracker/README +0 -4
- data/vendor/plugins/activity_tracker/Rakefile +0 -22
- data/vendor/plugins/activity_tracker/generators/activity_migration/USAGE +0 -13
- data/vendor/plugins/activity_tracker/generators/activity_migration/activity_migration_generator.rb +0 -11
- data/vendor/plugins/activity_tracker/generators/activity_migration/templates/migration.rb +0 -17
- data/vendor/plugins/activity_tracker/init.rb +0 -1
- data/vendor/plugins/activity_tracker/install.rb +0 -1
- data/vendor/plugins/activity_tracker/tasks/activity_tracker_tasks.rake +0 -4
- data/vendor/plugins/activity_tracker/test/abstract_unit.rb +0 -47
- data/vendor/plugins/activity_tracker/test/activity_tracker_test.rb +0 -48
- data/vendor/plugins/activity_tracker/test/database.yml +0 -18
- data/vendor/plugins/activity_tracker/test/debug.log +0 -3329
- data/vendor/plugins/activity_tracker/test/fixtures/test_post.rb +0 -5
- data/vendor/plugins/activity_tracker/test/fixtures/test_posts.yml +0 -3
- data/vendor/plugins/activity_tracker/test/fixtures/test_user.rb +0 -4
- data/vendor/plugins/activity_tracker/test/fixtures/test_users.yml +0 -6
- data/vendor/plugins/activity_tracker/test/schema.rb +0 -21
- data/vendor/plugins/acts_as_list/README +0 -23
- data/vendor/plugins/acts_as_list/init.rb +0 -3
- data/vendor/plugins/acts_as_list/lib/active_record/acts/list.rb +0 -256
- data/vendor/plugins/acts_as_list/test/list_test.rb +0 -332
- data/vendor/plugins/acts_as_publishable/uninstall.rb +0 -1
- data/vendor/plugins/auto_complete/README +0 -23
- data/vendor/plugins/auto_complete/Rakefile +0 -22
- data/vendor/plugins/auto_complete/init.rb +0 -2
- data/vendor/plugins/auto_complete/lib/auto_complete.rb +0 -47
- data/vendor/plugins/auto_complete/lib/auto_complete_macros_helper.rb +0 -143
- data/vendor/plugins/auto_complete/test/auto_complete_test.rb +0 -67
- data/vendor/plugins/enumerations_mixin/.gitignore +0 -1
- data/vendor/plugins/enumerations_mixin/Gemfile +0 -1
- data/vendor/plugins/enumerations_mixin/LICENSE +0 -20
- data/vendor/plugins/enumerations_mixin/README.md +0 -120
- data/vendor/plugins/enumerations_mixin/README_ENUMERATIONS +0 -163
- data/vendor/plugins/enumerations_mixin/Rakefile +0 -14
- data/vendor/plugins/enumerations_mixin/VERSION +0 -1
- data/vendor/plugins/enumerations_mixin/enumerations_mixin.gemspec +0 -44
- data/vendor/plugins/enumerations_mixin/examples/virtual_enumerations_sample.rb +0 -76
- data/vendor/plugins/enumerations_mixin/init.rb +0 -21
- data/vendor/plugins/enumerations_mixin/lib/active_record/acts/enumerated.rb +0 -180
- data/vendor/plugins/enumerations_mixin/lib/active_record/aggregations/has_enumerated.rb +0 -60
- data/vendor/plugins/enumerations_mixin/lib/active_record/virtual_enumerations.rb +0 -68
- data/vendor/plugins/enumerations_mixin/lib/enumerations_mixin.rb +0 -12
- data/vendor/plugins/enumerations_mixin/virtual_enumerations_sample.rb +0 -76
- data/vendor/plugins/prototype_legacy_helper/README.markdown +0 -13
- data/vendor/plugins/prototype_legacy_helper/init.rb +0 -1
- data/vendor/plugins/prototype_legacy_helper/lib/prototype_legacy_helper.rb +0 -432
- data/vendor/plugins/prototype_legacy_helper/test/test_prototype_helper.rb +0 -297
- data/vendor/plugins/resource_feeder/init.rb +0 -2
- data/vendor/plugins/resource_feeder/lib/resource_feeder.rb +0 -2
- data/vendor/plugins/respond_to_parent/MIT-LICENSE +0 -20
- data/vendor/plugins/respond_to_parent/README +0 -47
- data/vendor/plugins/respond_to_parent/Rakefile +0 -22
- data/vendor/plugins/respond_to_parent/init.rb +0 -1
- data/vendor/plugins/respond_to_parent/install.rb +0 -1
- data/vendor/plugins/respond_to_parent/lib/responds_to_parent.rb +0 -70
- data/vendor/plugins/respond_to_parent/test/responds_to_parent_test.rb +0 -10
- data/vendor/plugins/respond_to_parent/test/test_helper.rb +0 -6
- data/vendor/plugins/respond_to_parent/uninstall.rb +0 -1
@@ -1,566 +1,87 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
1
|
+
// the following required file can be found at vendor/assets/javascripts/jcrop/jquery.Jcrop.min.js
|
2
|
+
//= require jcrop/jquery.Jcrop
|
3
|
+
|
4
|
+
function cropInit() {
|
5
|
+
croppable_name = '#' + croppable_id;
|
6
|
+
preview_name = '#' + preview_id;
|
7
|
+
|
8
|
+
// Copy the image, and insert it in an offscreen DIV
|
9
|
+
aimgcopy = $(croppable_name).clone();
|
10
|
+
$('body').append('<div id="store"></div>')
|
11
|
+
$('#store').append(aimgcopy);
|
12
|
+
|
13
|
+
// Remove the height and width attributes
|
14
|
+
aimgcopy.removeAttr('height');
|
15
|
+
aimgcopy.removeAttr('width');
|
16
|
+
|
17
|
+
croppableWidth = aimgcopy.width();
|
18
|
+
croppableHeight = aimgcopy.height();
|
19
|
+
|
20
|
+
aspectRatio = minWidth/minHeight;
|
21
|
+
cropStartRatio = minWidth/croppableWidth;
|
22
|
+
cropToPreviewRatio = cropStartRatio / previewRatio;
|
23
|
+
|
24
|
+
cropStartWidth = croppableWidth * cropStartRatio;
|
25
|
+
cropStartHeight = cropStartWidth/aspectRatio;
|
26
|
+
|
27
|
+
cropStartX1 = (croppableWidth - cropStartWidth)/2;
|
28
|
+
cropStartY1 = (croppableHeight - cropStartHeight)/2;
|
29
|
+
|
30
|
+
cropStartX2 = cropStartX1 + cropStartWidth;
|
31
|
+
cropStartY2 = cropStartY1 + cropStartHeight;
|
32
|
+
|
33
|
+
previewSrc = $(croppable_name).attr('src');
|
34
|
+
|
35
|
+
previewWidth = croppableWidth * previewRatio;
|
36
|
+
previewHeight = croppableHeight * previewRatio;
|
37
|
+
|
38
|
+
$(preview_name).css('backgroundImage', 'url('+ previewSrc +')');
|
39
|
+
$(preview_name).css('backgroundRepeat', 'no-repeat');
|
40
|
+
$(preview_name).css('margin', 'auto');
|
41
|
+
$(preview_name).css('width', previewWidth + 'px');
|
42
|
+
$(preview_name).css('height', previewHeight + 'px');
|
43
|
+
|
44
|
+
jcrop_api = $.Jcrop(croppable_name);
|
45
|
+
jcrop_api.animateTo([ cropStartX1, cropStartY1, cropStartX2, cropStartY2 ]);
|
46
|
+
|
47
|
+
$(croppable_name).Jcrop({
|
48
|
+
onSelect: setCoords,
|
49
|
+
onChange: setCoords,
|
50
|
+
onRelease: setCoords,
|
51
|
+
bgColor: bgColor,
|
52
|
+
bgOpacity: bgOpacity,
|
53
|
+
minSize: [ minWidth, minHeight],
|
54
|
+
setSelect: [0, 0, 0, 0],
|
55
|
+
aspectRatio: aspectRatio
|
56
|
+
});
|
57
|
+
}
|
58
|
+
|
59
|
+
function setCoords(c) {
|
60
|
+
// variables can be accessed here as
|
61
|
+
// c.x, c.y, c.x2, c.y2, c.w, c.h
|
62
|
+
$('#crop_x').val(c.x);
|
63
|
+
$('#crop_y').val(c.y);
|
64
|
+
$('#crop_w').val(c.w);
|
65
|
+
$('#crop_h').val(c.h);
|
66
|
+
showPreview(c);
|
67
|
+
}
|
68
|
+
|
69
|
+
function showPreview(c) {
|
70
|
+
currentRatioWidth = croppableWidth / c.w;
|
71
|
+
currentRatioHeight = croppableHeight / c.h;
|
72
|
+
|
73
|
+
currentCropRatioX = c.w/croppableWidth;
|
74
|
+
currentCropToPreviewRatioX = currentCropRatioX / previewRatio;
|
75
|
+
|
76
|
+
currentCropRatioY = c.h/croppableHeight;
|
77
|
+
currentCropToPreviewRatioY = currentCropRatioY / previewRatio;
|
78
|
+
|
79
|
+
previewSizeWidth = previewWidth * currentRatioWidth;
|
80
|
+
previewSizeHeight = previewHeight * currentRatioHeight;
|
81
|
+
|
82
|
+
previewPositionX = -(c.x/currentCropToPreviewRatioX);
|
83
|
+
previewPositionY = -(c.y/currentCropToPreviewRatioY);
|
84
|
+
|
85
|
+
$('#preview').css('backgroundSize', previewSizeWidth + 'px ' + previewSizeHeight + 'px');
|
86
|
+
$('#preview').css('backgroundPosition', previewPositionX + 'px ' + previewPositionY + 'px');
|
57
87
|
}
|
58
|
-
$A(document.getElementsByTagName("script")).each(function(s){
|
59
|
-
if(s.src.match(/cropper\.js/)){
|
60
|
-
var _a=s.src.replace(/cropper\.js(.*)?/,"");
|
61
|
-
var _b=document.createElement("link");
|
62
|
-
_b.rel="stylesheet";
|
63
|
-
_b.type="text/css";
|
64
|
-
_b.href=_a+"cropper.css";
|
65
|
-
_b.media="screen";
|
66
|
-
document.getElementsByTagName("head")[0].appendChild(_b);
|
67
|
-
}
|
68
|
-
});
|
69
|
-
if(this.options.ratioDim.x>0&&this.options.ratioDim.y>0){
|
70
|
-
var _c=this.getGCD(this.options.ratioDim.x,this.options.ratioDim.y);
|
71
|
-
this.ratioX=this.options.ratioDim.x/_c;
|
72
|
-
this.ratioY=this.options.ratioDim.y/_c;
|
73
|
-
}
|
74
|
-
this.subInitialize();
|
75
|
-
if(this.img.complete||this.isWebKit){
|
76
|
-
this.onLoad();
|
77
|
-
}else{
|
78
|
-
Event.observe(this.img,"load",this.onLoad.bindAsEventListener(this));
|
79
|
-
}
|
80
|
-
},getGCD:function(a,b){
|
81
|
-
if(b==0){
|
82
|
-
return a;
|
83
|
-
}
|
84
|
-
return this.getGCD(b,a%b);
|
85
|
-
},onLoad:function(){
|
86
|
-
var _f="imgCrop_";
|
87
|
-
var _10=this.img.parentNode;
|
88
|
-
var _11="";
|
89
|
-
if(this.isOpera8){
|
90
|
-
_11=" opera8";
|
91
|
-
}
|
92
|
-
this.imgWrap=Builder.node("div",{"class":_f+"wrap"+_11});
|
93
|
-
this.north=Builder.node("div",{"class":_f+"overlay "+_f+"north"},[Builder.node("span")]);
|
94
|
-
this.east=Builder.node("div",{"class":_f+"overlay "+_f+"east"},[Builder.node("span")]);
|
95
|
-
this.south=Builder.node("div",{"class":_f+"overlay "+_f+"south"},[Builder.node("span")]);
|
96
|
-
this.west=Builder.node("div",{"class":_f+"overlay "+_f+"west"},[Builder.node("span")]);
|
97
|
-
var _12=[this.north,this.east,this.south,this.west];
|
98
|
-
this.dragArea=Builder.node("div",{"class":_f+"dragArea"},_12);
|
99
|
-
this.handleN=Builder.node("div",{"class":_f+"handle "+_f+"handleN"});
|
100
|
-
this.handleNE=Builder.node("div",{"class":_f+"handle "+_f+"handleNE"});
|
101
|
-
this.handleE=Builder.node("div",{"class":_f+"handle "+_f+"handleE"});
|
102
|
-
this.handleSE=Builder.node("div",{"class":_f+"handle "+_f+"handleSE"});
|
103
|
-
this.handleS=Builder.node("div",{"class":_f+"handle "+_f+"handleS"});
|
104
|
-
this.handleSW=Builder.node("div",{"class":_f+"handle "+_f+"handleSW"});
|
105
|
-
this.handleW=Builder.node("div",{"class":_f+"handle "+_f+"handleW"});
|
106
|
-
this.handleNW=Builder.node("div",{"class":_f+"handle "+_f+"handleNW"});
|
107
|
-
this.selArea=Builder.node("div",{"class":_f+"selArea"},[Builder.node("div",{"class":_f+"marqueeHoriz "+_f+"marqueeNorth"},[Builder.node("span")]),Builder.node("div",{"class":_f+"marqueeVert "+_f+"marqueeEast"},[Builder.node("span")]),Builder.node("div",{"class":_f+"marqueeHoriz "+_f+"marqueeSouth"},[Builder.node("span")]),Builder.node("div",{"class":_f+"marqueeVert "+_f+"marqueeWest"},[Builder.node("span")]),this.handleN,this.handleNE,this.handleE,this.handleSE,this.handleS,this.handleSW,this.handleW,this.handleNW,Builder.node("div",{"class":_f+"clickArea"})]);
|
108
|
-
this.imgWrap.appendChild(this.img);
|
109
|
-
this.imgWrap.appendChild(this.dragArea);
|
110
|
-
this.dragArea.appendChild(this.selArea);
|
111
|
-
this.dragArea.appendChild(Builder.node("div",{"class":_f+"clickArea"}));
|
112
|
-
_10.appendChild(this.imgWrap);
|
113
|
-
this.startDragBind=this.startDrag.bindAsEventListener(this);
|
114
|
-
Event.observe(this.dragArea,"mousedown",this.startDragBind);
|
115
|
-
this.onDragBind=this.onDrag.bindAsEventListener(this);
|
116
|
-
Event.observe(document,"mousemove",this.onDragBind);
|
117
|
-
this.endCropBind=this.endCrop.bindAsEventListener(this);
|
118
|
-
Event.observe(document,"mouseup",this.endCropBind);
|
119
|
-
this.resizeBind=this.startResize.bindAsEventListener(this);
|
120
|
-
this.handles=[this.handleN,this.handleNE,this.handleE,this.handleSE,this.handleS,this.handleSW,this.handleW,this.handleNW];
|
121
|
-
this.registerHandles(true);
|
122
|
-
if(this.options.captureKeys){
|
123
|
-
this.keysBind=this.handleKeys.bindAsEventListener(this);
|
124
|
-
Event.observe(document,"keypress",this.keysBind);
|
125
|
-
}
|
126
|
-
new CropDraggable(this.selArea,{drawMethod:this.moveArea.bindAsEventListener(this)});
|
127
|
-
this.setParams();
|
128
|
-
},registerHandles:function(_13){
|
129
|
-
for(var i=0;i<this.handles.length;i++){
|
130
|
-
var _15=$(this.handles[i]);
|
131
|
-
if(_13){
|
132
|
-
var _16=false;
|
133
|
-
if(this.fixedWidth&&this.fixedHeight){
|
134
|
-
_16=true;
|
135
|
-
}else{
|
136
|
-
if(this.fixedWidth||this.fixedHeight){
|
137
|
-
var _17=_15.className.match(/([S|N][E|W])$/);
|
138
|
-
var _18=_15.className.match(/(E|W)$/);
|
139
|
-
var _19=_15.className.match(/(N|S)$/);
|
140
|
-
if(_17){
|
141
|
-
_16=true;
|
142
|
-
}else{
|
143
|
-
if(this.fixedWidth&&_18){
|
144
|
-
_16=true;
|
145
|
-
}else{
|
146
|
-
if(this.fixedHeight&&_19){
|
147
|
-
_16=true;
|
148
|
-
}
|
149
|
-
}
|
150
|
-
}
|
151
|
-
}
|
152
|
-
}
|
153
|
-
if(_16){
|
154
|
-
_15.hide();
|
155
|
-
}else{
|
156
|
-
Event.observe(_15,"mousedown",this.resizeBind);
|
157
|
-
}
|
158
|
-
}else{
|
159
|
-
_15.show();
|
160
|
-
Event.stopObserving(_15,"mousedown",this.resizeBind);
|
161
|
-
}
|
162
|
-
}
|
163
|
-
},setParams:function(){
|
164
|
-
this.imgW=this.img.width;
|
165
|
-
this.imgH=this.img.height;
|
166
|
-
$(this.north).setStyle({height:0});
|
167
|
-
$(this.east).setStyle({width:0,height:0});
|
168
|
-
$(this.south).setStyle({height:0});
|
169
|
-
$(this.west).setStyle({width:0,height:0});
|
170
|
-
$(this.imgWrap).setStyle({"width":this.imgW+"px","height":this.imgH+"px"});
|
171
|
-
$(this.selArea).hide();
|
172
|
-
var _1a={x1:0,y1:0,x2:0,y2:0};
|
173
|
-
var _1b=false;
|
174
|
-
if(this.options.onloadCoords!=null){
|
175
|
-
_1a=this.cloneCoords(this.options.onloadCoords);
|
176
|
-
_1b=true;
|
177
|
-
}else{
|
178
|
-
if(this.options.ratioDim.x>0&&this.options.ratioDim.y>0){
|
179
|
-
_1a.x1=Math.ceil((this.imgW-this.options.ratioDim.x)/2);
|
180
|
-
_1a.y1=Math.ceil((this.imgH-this.options.ratioDim.y)/2);
|
181
|
-
_1a.x2=_1a.x1+this.options.ratioDim.x;
|
182
|
-
_1a.y2=_1a.y1+this.options.ratioDim.y;
|
183
|
-
_1b=true;
|
184
|
-
}
|
185
|
-
}
|
186
|
-
this.setAreaCoords(_1a,false,false,1);
|
187
|
-
if(this.options.displayOnInit&&_1b){
|
188
|
-
this.selArea.show();
|
189
|
-
this.drawArea();
|
190
|
-
this.endCrop();
|
191
|
-
}
|
192
|
-
this.attached=true;
|
193
|
-
},remove:function(){
|
194
|
-
if(this.attached){
|
195
|
-
this.attached=false;
|
196
|
-
this.imgWrap.parentNode.insertBefore(this.img,this.imgWrap);
|
197
|
-
this.imgWrap.parentNode.removeChild(this.imgWrap);
|
198
|
-
Event.stopObserving(this.dragArea,"mousedown",this.startDragBind);
|
199
|
-
Event.stopObserving(document,"mousemove",this.onDragBind);
|
200
|
-
Event.stopObserving(document,"mouseup",this.endCropBind);
|
201
|
-
this.registerHandles(false);
|
202
|
-
if(this.options.captureKeys){
|
203
|
-
Event.stopObserving(document,"keypress",this.keysBind);
|
204
|
-
}
|
205
|
-
}
|
206
|
-
},reset:function(){
|
207
|
-
if(!this.attached){
|
208
|
-
this.onLoad();
|
209
|
-
}else{
|
210
|
-
this.setParams();
|
211
|
-
}
|
212
|
-
this.endCrop();
|
213
|
-
},handleKeys:function(e){
|
214
|
-
var dir={x:0,y:0};
|
215
|
-
if(!this.dragging){
|
216
|
-
switch(e.keyCode){
|
217
|
-
case (37):
|
218
|
-
dir.x=-1;
|
219
|
-
break;
|
220
|
-
case (38):
|
221
|
-
dir.y=-1;
|
222
|
-
break;
|
223
|
-
case (39):
|
224
|
-
dir.x=1;
|
225
|
-
break;
|
226
|
-
case (40):
|
227
|
-
dir.y=1;
|
228
|
-
break;
|
229
|
-
}
|
230
|
-
if(dir.x!=0||dir.y!=0){
|
231
|
-
if(e.shiftKey){
|
232
|
-
dir.x*=10;
|
233
|
-
dir.y*=10;
|
234
|
-
}
|
235
|
-
this.moveArea([this.areaCoords.x1+dir.x,this.areaCoords.y1+dir.y]);
|
236
|
-
Event.stop(e);
|
237
|
-
}
|
238
|
-
}
|
239
|
-
},calcW:function(){
|
240
|
-
return (this.areaCoords.x2-this.areaCoords.x1);
|
241
|
-
},calcH:function(){
|
242
|
-
return (this.areaCoords.y2-this.areaCoords.y1);
|
243
|
-
},moveArea:function(_1e){
|
244
|
-
this.setAreaCoords({x1:_1e[0],y1:_1e[1],x2:_1e[0]+this.calcW(),y2:_1e[1]+this.calcH()},true,false);
|
245
|
-
this.drawArea();
|
246
|
-
},cloneCoords:function(_1f){
|
247
|
-
return {x1:_1f.x1,y1:_1f.y1,x2:_1f.x2,y2:_1f.y2};
|
248
|
-
},setAreaCoords:function(_20,_21,_22,_23,_24){
|
249
|
-
if(_21){
|
250
|
-
var _25=_20.x2-_20.x1;
|
251
|
-
var _26=_20.y2-_20.y1;
|
252
|
-
if(_20.x1<0){
|
253
|
-
_20.x1=0;
|
254
|
-
_20.x2=_25;
|
255
|
-
}
|
256
|
-
if(_20.y1<0){
|
257
|
-
_20.y1=0;
|
258
|
-
_20.y2=_26;
|
259
|
-
}
|
260
|
-
if(_20.x2>this.imgW){
|
261
|
-
_20.x2=this.imgW;
|
262
|
-
_20.x1=this.imgW-_25;
|
263
|
-
}
|
264
|
-
if(_20.y2>this.imgH){
|
265
|
-
_20.y2=this.imgH;
|
266
|
-
_20.y1=this.imgH-_26;
|
267
|
-
}
|
268
|
-
}else{
|
269
|
-
if(_20.x1<0){
|
270
|
-
_20.x1=0;
|
271
|
-
}
|
272
|
-
if(_20.y1<0){
|
273
|
-
_20.y1=0;
|
274
|
-
}
|
275
|
-
if(_20.x2>this.imgW){
|
276
|
-
_20.x2=this.imgW;
|
277
|
-
}
|
278
|
-
if(_20.y2>this.imgH){
|
279
|
-
_20.y2=this.imgH;
|
280
|
-
}
|
281
|
-
if(_23!=null){
|
282
|
-
if(this.ratioX>0){
|
283
|
-
this.applyRatio(_20,{x:this.ratioX,y:this.ratioY},_23,_24);
|
284
|
-
}else{
|
285
|
-
if(_22){
|
286
|
-
this.applyRatio(_20,{x:1,y:1},_23,_24);
|
287
|
-
}
|
288
|
-
}
|
289
|
-
var _27=[this.options.minWidth,this.options.minHeight];
|
290
|
-
var _28=[this.options.maxWidth,this.options.maxHeight];
|
291
|
-
if(_27[0]>0||_27[1]>0||_28[0]>0||_28[1]>0){
|
292
|
-
var _29={a1:_20.x1,a2:_20.x2};
|
293
|
-
var _2a={a1:_20.y1,a2:_20.y2};
|
294
|
-
var _2b={min:0,max:this.imgW};
|
295
|
-
var _2c={min:0,max:this.imgH};
|
296
|
-
if((_27[0]!=0||_27[1]!=0)&&_22){
|
297
|
-
if(_27[0]>0){
|
298
|
-
_27[1]=_27[0];
|
299
|
-
}else{
|
300
|
-
if(_27[1]>0){
|
301
|
-
_27[0]=_27[1];
|
302
|
-
}
|
303
|
-
}
|
304
|
-
}
|
305
|
-
if((_28[0]!=0||_28[0]!=0)&&_22){
|
306
|
-
if(_28[0]>0&&_28[0]<=_28[1]){
|
307
|
-
_28[1]=_28[0];
|
308
|
-
}else{
|
309
|
-
if(_28[1]>0&&_28[1]<=_28[0]){
|
310
|
-
_28[0]=_28[1];
|
311
|
-
}
|
312
|
-
}
|
313
|
-
}
|
314
|
-
if(_27[0]>0){
|
315
|
-
this.applyDimRestriction(_29,_27[0],_23.x,_2b,"min");
|
316
|
-
}
|
317
|
-
if(_27[1]>1){
|
318
|
-
this.applyDimRestriction(_2a,_27[1],_23.y,_2c,"min");
|
319
|
-
}
|
320
|
-
if(_28[0]>0){
|
321
|
-
this.applyDimRestriction(_29,_28[0],_23.x,_2b,"max");
|
322
|
-
}
|
323
|
-
if(_28[1]>1){
|
324
|
-
this.applyDimRestriction(_2a,_28[1],_23.y,_2c,"max");
|
325
|
-
}
|
326
|
-
_20={x1:_29.a1,y1:_2a.a1,x2:_29.a2,y2:_2a.a2};
|
327
|
-
}
|
328
|
-
}
|
329
|
-
}
|
330
|
-
this.areaCoords=_20;
|
331
|
-
},applyDimRestriction:function(_2d,val,_2f,_30,_31){
|
332
|
-
var _32;
|
333
|
-
if(_31=="min"){
|
334
|
-
_32=((_2d.a2-_2d.a1)<val);
|
335
|
-
}else{
|
336
|
-
_32=((_2d.a2-_2d.a1)>val);
|
337
|
-
}
|
338
|
-
if(_32){
|
339
|
-
if(_2f==1){
|
340
|
-
_2d.a2=_2d.a1+val;
|
341
|
-
}else{
|
342
|
-
_2d.a1=_2d.a2-val;
|
343
|
-
}
|
344
|
-
if(_2d.a1<_30.min){
|
345
|
-
_2d.a1=_30.min;
|
346
|
-
_2d.a2=val;
|
347
|
-
}else{
|
348
|
-
if(_2d.a2>_30.max){
|
349
|
-
_2d.a1=_30.max-val;
|
350
|
-
_2d.a2=_30.max;
|
351
|
-
}
|
352
|
-
}
|
353
|
-
}
|
354
|
-
},applyRatio:function(_33,_34,_35,_36){
|
355
|
-
var _37;
|
356
|
-
if(_36=="N"||_36=="S"){
|
357
|
-
_37=this.applyRatioToAxis({a1:_33.y1,b1:_33.x1,a2:_33.y2,b2:_33.x2},{a:_34.y,b:_34.x},{a:_35.y,b:_35.x},{min:0,max:this.imgW});
|
358
|
-
_33.x1=_37.b1;
|
359
|
-
_33.y1=_37.a1;
|
360
|
-
_33.x2=_37.b2;
|
361
|
-
_33.y2=_37.a2;
|
362
|
-
}else{
|
363
|
-
_37=this.applyRatioToAxis({a1:_33.x1,b1:_33.y1,a2:_33.x2,b2:_33.y2},{a:_34.x,b:_34.y},{a:_35.x,b:_35.y},{min:0,max:this.imgH});
|
364
|
-
_33.x1=_37.a1;
|
365
|
-
_33.y1=_37.b1;
|
366
|
-
_33.x2=_37.a2;
|
367
|
-
_33.y2=_37.b2;
|
368
|
-
}
|
369
|
-
},applyRatioToAxis:function(_38,_39,_3a,_3b){
|
370
|
-
var _3c=Object.extend(_38,{});
|
371
|
-
var _3d=_3c.a2-_3c.a1;
|
372
|
-
var _3e=Math.floor(_3d*_39.b/_39.a);
|
373
|
-
var _3f;
|
374
|
-
var _40;
|
375
|
-
var _41=null;
|
376
|
-
if(_3a.b==1){
|
377
|
-
_3f=_3c.b1+_3e;
|
378
|
-
if(_3f>_3b.max){
|
379
|
-
_3f=_3b.max;
|
380
|
-
_41=_3f-_3c.b1;
|
381
|
-
}
|
382
|
-
_3c.b2=_3f;
|
383
|
-
}else{
|
384
|
-
_3f=_3c.b2-_3e;
|
385
|
-
if(_3f<_3b.min){
|
386
|
-
_3f=_3b.min;
|
387
|
-
_41=_3f+_3c.b2;
|
388
|
-
}
|
389
|
-
_3c.b1=_3f;
|
390
|
-
}
|
391
|
-
if(_41!=null){
|
392
|
-
_40=Math.floor(_41*_39.a/_39.b);
|
393
|
-
if(_3a.a==1){
|
394
|
-
_3c.a2=_3c.a1+_40;
|
395
|
-
}else{
|
396
|
-
_3c.a1=_3c.a1=_3c.a2-_40;
|
397
|
-
}
|
398
|
-
}
|
399
|
-
return _3c;
|
400
|
-
},drawArea:function(){
|
401
|
-
var _42=this.calcW();
|
402
|
-
var _43=this.calcH();
|
403
|
-
var px="px";
|
404
|
-
var _45=[this.areaCoords.x1+px,this.areaCoords.y1+px,_42+px,_43+px,this.areaCoords.x2+px,this.areaCoords.y2+px,(this.img.width-this.areaCoords.x2)+px,(this.img.height-this.areaCoords.y2)+px];
|
405
|
-
var _46=this.selArea.style;
|
406
|
-
_46.left=_45[0];
|
407
|
-
_46.top=_45[1];
|
408
|
-
_46.width=_45[2];
|
409
|
-
_46.height=_45[3];
|
410
|
-
var _47=Math.ceil((_42-6)/2)+px;
|
411
|
-
var _48=Math.ceil((_43-6)/2)+px;
|
412
|
-
this.handleN.style.left=_47;
|
413
|
-
this.handleE.style.top=_48;
|
414
|
-
this.handleS.style.left=_47;
|
415
|
-
this.handleW.style.top=_48;
|
416
|
-
this.north.style.height=_45[1];
|
417
|
-
var _49=this.east.style;
|
418
|
-
_49.top=_45[1];
|
419
|
-
_49.height=_45[3];
|
420
|
-
_49.left=_45[4];
|
421
|
-
_49.width=_45[6];
|
422
|
-
var _4a=this.south.style;
|
423
|
-
_4a.top=_45[5];
|
424
|
-
_4a.height=_45[7];
|
425
|
-
var _4b=this.west.style;
|
426
|
-
_4b.top=_45[1];
|
427
|
-
_4b.height=_45[3];
|
428
|
-
_4b.width=_45[0];
|
429
|
-
this.subDrawArea();
|
430
|
-
this.forceReRender();
|
431
|
-
},forceReRender:function(){
|
432
|
-
if(this.isIE||this.isWebKit){
|
433
|
-
var n=document.createTextNode(" ");
|
434
|
-
var d,el,fixEL,i;
|
435
|
-
if(this.isIE){
|
436
|
-
fixEl=this.selArea;
|
437
|
-
}else{
|
438
|
-
if(this.isWebKit){
|
439
|
-
fixEl=document.getElementsByClassName("imgCrop_marqueeSouth",this.imgWrap)[0];
|
440
|
-
d=Builder.node("div","");
|
441
|
-
d.style.visibility="hidden";
|
442
|
-
var _4e=["SE","S","SW"];
|
443
|
-
for(i=0;i<_4e.length;i++){
|
444
|
-
el=document.getElementsByClassName("imgCrop_handle"+_4e[i],this.selArea)[0];
|
445
|
-
if(el.childNodes.length){
|
446
|
-
el.removeChild(el.childNodes[0]);
|
447
|
-
}
|
448
|
-
el.appendChild(d);
|
449
|
-
}
|
450
|
-
}
|
451
|
-
}
|
452
|
-
fixEl.appendChild(n);
|
453
|
-
fixEl.removeChild(n);
|
454
|
-
}
|
455
|
-
},startResize:function(e){
|
456
|
-
this.startCoords=this.cloneCoords(this.areaCoords);
|
457
|
-
this.resizing=true;
|
458
|
-
this.resizeHandle=Event.element(e).classNames().toString().replace(/([^N|NE|E|SE|S|SW|W|NW])+/,"");
|
459
|
-
Event.stop(e);
|
460
|
-
},startDrag:function(e){
|
461
|
-
this.selArea.show();
|
462
|
-
this.clickCoords=this.getCurPos(e);
|
463
|
-
this.setAreaCoords({x1:this.clickCoords.x,y1:this.clickCoords.y,x2:this.clickCoords.x,y2:this.clickCoords.y},false,false,null);
|
464
|
-
this.dragging=true;
|
465
|
-
this.onDrag(e);
|
466
|
-
Event.stop(e);
|
467
|
-
},getCurPos:function(e){
|
468
|
-
var el=this.imgWrap,wrapOffsets=Position.cumulativeOffset(el);
|
469
|
-
while(el.nodeName!="BODY"){
|
470
|
-
wrapOffsets[1]-=el.scrollTop||0;
|
471
|
-
wrapOffsets[0]-=el.scrollLeft||0;
|
472
|
-
el=el.parentNode;
|
473
|
-
}
|
474
|
-
return curPos={x:Event.pointerX(e)-wrapOffsets[0],y:Event.pointerY(e)-wrapOffsets[1]};
|
475
|
-
},onDrag:function(e){
|
476
|
-
if(this.dragging||this.resizing){
|
477
|
-
var _54=null;
|
478
|
-
var _55=this.getCurPos(e);
|
479
|
-
var _56=this.cloneCoords(this.areaCoords);
|
480
|
-
var _57={x:1,y:1};
|
481
|
-
if(this.dragging){
|
482
|
-
if(_55.x<this.clickCoords.x){
|
483
|
-
_57.x=-1;
|
484
|
-
}
|
485
|
-
if(_55.y<this.clickCoords.y){
|
486
|
-
_57.y=-1;
|
487
|
-
}
|
488
|
-
this.transformCoords(_55.x,this.clickCoords.x,_56,"x");
|
489
|
-
this.transformCoords(_55.y,this.clickCoords.y,_56,"y");
|
490
|
-
}else{
|
491
|
-
if(this.resizing){
|
492
|
-
_54=this.resizeHandle;
|
493
|
-
if(_54.match(/E/)){
|
494
|
-
this.transformCoords(_55.x,this.startCoords.x1,_56,"x");
|
495
|
-
if(_55.x<this.startCoords.x1){
|
496
|
-
_57.x=-1;
|
497
|
-
}
|
498
|
-
}else{
|
499
|
-
if(_54.match(/W/)){
|
500
|
-
this.transformCoords(_55.x,this.startCoords.x2,_56,"x");
|
501
|
-
if(_55.x<this.startCoords.x2){
|
502
|
-
_57.x=-1;
|
503
|
-
}
|
504
|
-
}
|
505
|
-
}
|
506
|
-
if(_54.match(/N/)){
|
507
|
-
this.transformCoords(_55.y,this.startCoords.y2,_56,"y");
|
508
|
-
if(_55.y<this.startCoords.y2){
|
509
|
-
_57.y=-1;
|
510
|
-
}
|
511
|
-
}else{
|
512
|
-
if(_54.match(/S/)){
|
513
|
-
this.transformCoords(_55.y,this.startCoords.y1,_56,"y");
|
514
|
-
if(_55.y<this.startCoords.y1){
|
515
|
-
_57.y=-1;
|
516
|
-
}
|
517
|
-
}
|
518
|
-
}
|
519
|
-
}
|
520
|
-
}
|
521
|
-
this.setAreaCoords(_56,false,e.shiftKey,_57,_54);
|
522
|
-
this.drawArea();
|
523
|
-
Event.stop(e);
|
524
|
-
}
|
525
|
-
},transformCoords:function(_58,_59,_5a,_5b){
|
526
|
-
var _5c=[_58,_59];
|
527
|
-
if(_58>_59){
|
528
|
-
_5c.reverse();
|
529
|
-
}
|
530
|
-
_5a[_5b+"1"]=_5c[0];
|
531
|
-
_5a[_5b+"2"]=_5c[1];
|
532
|
-
},endCrop:function(){
|
533
|
-
this.dragging=false;
|
534
|
-
this.resizing=false;
|
535
|
-
this.options.onEndCrop(this.areaCoords,{width:this.calcW(),height:this.calcH()});
|
536
|
-
},subInitialize:function(){
|
537
|
-
},subDrawArea:function(){
|
538
|
-
}};
|
539
|
-
Cropper.ImgWithPreview=Class.create();
|
540
|
-
Object.extend(Object.extend(Cropper.ImgWithPreview.prototype,Cropper.Img.prototype),{subInitialize:function(){
|
541
|
-
this.hasPreviewImg=false;
|
542
|
-
if(typeof (this.options.previewWrap)!="undefined"&&this.options.minWidth>0&&this.options.minHeight>0){
|
543
|
-
this.previewWrap=$(this.options.previewWrap);
|
544
|
-
this.previewImg=this.img.cloneNode(false);
|
545
|
-
this.previewImg.id="imgCrop_"+this.previewImg.id;
|
546
|
-
this.options.displayOnInit=true;
|
547
|
-
this.hasPreviewImg=true;
|
548
|
-
this.previewWrap.addClassName("imgCrop_previewWrap");
|
549
|
-
this.previewWrap.setStyle({width:this.options.minWidth+"px",height:this.options.minHeight+"px"});
|
550
|
-
this.previewWrap.appendChild(this.previewImg);
|
551
|
-
}
|
552
|
-
},subDrawArea:function(){
|
553
|
-
if(this.hasPreviewImg){
|
554
|
-
var _5d=this.calcW();
|
555
|
-
var _5e=this.calcH();
|
556
|
-
var _5f={x:this.imgW/_5d,y:this.imgH/_5e};
|
557
|
-
var _60={x:_5d/this.options.minWidth,y:_5e/this.options.minHeight};
|
558
|
-
var _61={w:Math.ceil(this.options.minWidth*_5f.x)+"px",h:Math.ceil(this.options.minHeight*_5f.y)+"px",x:"-"+Math.ceil(this.areaCoords.x1/_60.x)+"px",y:"-"+Math.ceil(this.areaCoords.y1/_60.y)+"px"};
|
559
|
-
var _62=this.previewImg.style;
|
560
|
-
_62.width=_61.w;
|
561
|
-
_62.height=_61.h;
|
562
|
-
_62.left=_61.x;
|
563
|
-
_62.top=_61.y;
|
564
|
-
}
|
565
|
-
}});
|
566
|
-
|