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
@@ -0,0 +1,661 @@
|
|
1
|
+
/*!
|
2
|
+
* jQuery Color Animations v2.0pre
|
3
|
+
* http://jquery.org/
|
4
|
+
*
|
5
|
+
* Copyright 2011 John Resig
|
6
|
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
7
|
+
* http://jquery.org/license
|
8
|
+
*/
|
9
|
+
|
10
|
+
(function( jQuery, undefined ){
|
11
|
+
var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color outlineColor".split(" "),
|
12
|
+
|
13
|
+
// plusequals test for += 100 -= 100
|
14
|
+
rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
|
15
|
+
// a set of RE's that can match strings and generate color tuples.
|
16
|
+
stringParsers = [{
|
17
|
+
re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
|
18
|
+
parse: function( execResult ) {
|
19
|
+
return [
|
20
|
+
execResult[ 1 ],
|
21
|
+
execResult[ 2 ],
|
22
|
+
execResult[ 3 ],
|
23
|
+
execResult[ 4 ]
|
24
|
+
];
|
25
|
+
}
|
26
|
+
}, {
|
27
|
+
re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
|
28
|
+
parse: function( execResult ) {
|
29
|
+
return [
|
30
|
+
2.55 * execResult[1],
|
31
|
+
2.55 * execResult[2],
|
32
|
+
2.55 * execResult[3],
|
33
|
+
execResult[ 4 ]
|
34
|
+
];
|
35
|
+
}
|
36
|
+
}, {
|
37
|
+
re: /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,
|
38
|
+
parse: function( execResult ) {
|
39
|
+
return [
|
40
|
+
parseInt( execResult[ 1 ], 16 ),
|
41
|
+
parseInt( execResult[ 2 ], 16 ),
|
42
|
+
parseInt( execResult[ 3 ], 16 )
|
43
|
+
];
|
44
|
+
}
|
45
|
+
}, {
|
46
|
+
re: /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/,
|
47
|
+
parse: function( execResult ) {
|
48
|
+
return [
|
49
|
+
parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ),
|
50
|
+
parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ),
|
51
|
+
parseInt( execResult[ 3 ] + execResult[ 3 ], 16 )
|
52
|
+
];
|
53
|
+
}
|
54
|
+
}, {
|
55
|
+
re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
|
56
|
+
space: "hsla",
|
57
|
+
parse: function( execResult ) {
|
58
|
+
return [
|
59
|
+
execResult[1],
|
60
|
+
execResult[2] / 100,
|
61
|
+
execResult[3] / 100,
|
62
|
+
execResult[4]
|
63
|
+
];
|
64
|
+
}
|
65
|
+
}],
|
66
|
+
|
67
|
+
// jQuery.Color( )
|
68
|
+
color = jQuery.Color = function( color, green, blue, alpha ) {
|
69
|
+
return new jQuery.Color.fn.parse( color, green, blue, alpha );
|
70
|
+
},
|
71
|
+
spaces = {
|
72
|
+
rgba: {
|
73
|
+
cache: "_rgba",
|
74
|
+
props: {
|
75
|
+
red: {
|
76
|
+
idx: 0,
|
77
|
+
type: "byte",
|
78
|
+
empty: true
|
79
|
+
},
|
80
|
+
green: {
|
81
|
+
idx: 1,
|
82
|
+
type: "byte",
|
83
|
+
empty: true
|
84
|
+
},
|
85
|
+
blue: {
|
86
|
+
idx: 2,
|
87
|
+
type: "byte",
|
88
|
+
empty: true
|
89
|
+
},
|
90
|
+
alpha: {
|
91
|
+
idx: 3,
|
92
|
+
type: "percent",
|
93
|
+
def: 1
|
94
|
+
}
|
95
|
+
}
|
96
|
+
},
|
97
|
+
hsla: {
|
98
|
+
cache: "_hsla",
|
99
|
+
props: {
|
100
|
+
hue: {
|
101
|
+
idx: 0,
|
102
|
+
type: "degrees",
|
103
|
+
empty: true
|
104
|
+
},
|
105
|
+
saturation: {
|
106
|
+
idx: 1,
|
107
|
+
type: "percent",
|
108
|
+
empty: true
|
109
|
+
},
|
110
|
+
lightness: {
|
111
|
+
idx: 2,
|
112
|
+
type: "percent",
|
113
|
+
empty: true
|
114
|
+
}
|
115
|
+
}
|
116
|
+
}
|
117
|
+
},
|
118
|
+
propTypes = {
|
119
|
+
"byte": {
|
120
|
+
floor: true,
|
121
|
+
min: 0,
|
122
|
+
max: 255
|
123
|
+
},
|
124
|
+
"percent": {
|
125
|
+
min: 0,
|
126
|
+
max: 1
|
127
|
+
},
|
128
|
+
"degrees": {
|
129
|
+
mod: 360,
|
130
|
+
floor: true
|
131
|
+
}
|
132
|
+
},
|
133
|
+
rgbaspace = spaces.rgba.props,
|
134
|
+
support = color.support = {},
|
135
|
+
|
136
|
+
// colors = jQuery.Color.names
|
137
|
+
colors,
|
138
|
+
|
139
|
+
// local aliases of functions called often
|
140
|
+
each = jQuery.each;
|
141
|
+
|
142
|
+
spaces.hsla.props.alpha = rgbaspace.alpha;
|
143
|
+
|
144
|
+
function clamp( value, prop, alwaysAllowEmpty ) {
|
145
|
+
var type = propTypes[ prop.type ] || {},
|
146
|
+
allowEmpty = prop.empty || alwaysAllowEmpty;
|
147
|
+
|
148
|
+
if ( allowEmpty && value == null ) {
|
149
|
+
return null;
|
150
|
+
}
|
151
|
+
if ( prop.def && value == null ) {
|
152
|
+
return prop.def;
|
153
|
+
}
|
154
|
+
if ( type.floor ) {
|
155
|
+
value = ~~value;
|
156
|
+
} else {
|
157
|
+
value = parseFloat( value );
|
158
|
+
}
|
159
|
+
if ( value == null || isNaN( value ) ) {
|
160
|
+
return prop.def;
|
161
|
+
}
|
162
|
+
if ( type.mod ) {
|
163
|
+
value = value % type.mod;
|
164
|
+
// -10 -> 350
|
165
|
+
return value < 0 ? type.mod + value : value;
|
166
|
+
}
|
167
|
+
|
168
|
+
// for now all property types without mod have min and max
|
169
|
+
return type.min > value ? type.min : type.max < value ? type.max : value;
|
170
|
+
}
|
171
|
+
|
172
|
+
function stringParse( string ) {
|
173
|
+
var inst = color(),
|
174
|
+
rgba = inst._rgba = [];
|
175
|
+
|
176
|
+
string = string.toLowerCase();
|
177
|
+
|
178
|
+
each( stringParsers, function( i, parser ) {
|
179
|
+
var match = parser.re.exec( string ),
|
180
|
+
values = match && parser.parse( match ),
|
181
|
+
parsed,
|
182
|
+
spaceName = parser.space || "rgba",
|
183
|
+
cache = spaces[ spaceName ].cache;
|
184
|
+
|
185
|
+
|
186
|
+
if ( values ) {
|
187
|
+
parsed = inst[ spaceName ]( values );
|
188
|
+
|
189
|
+
// if this was an rgba parse the assignment might happen twice
|
190
|
+
// oh well....
|
191
|
+
inst[ cache ] = parsed[ cache ];
|
192
|
+
rgba = inst._rgba = parsed._rgba;
|
193
|
+
|
194
|
+
// exit each( stringParsers ) here because we matched
|
195
|
+
return false;
|
196
|
+
}
|
197
|
+
});
|
198
|
+
|
199
|
+
// Found a stringParser that handled it
|
200
|
+
if ( rgba.length !== 0 ) {
|
201
|
+
|
202
|
+
// if this came from a parsed string, force "transparent" when alpha is 0
|
203
|
+
// chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)
|
204
|
+
if ( Math.max.apply( Math, rgba ) === 0 ) {
|
205
|
+
jQuery.extend( rgba, colors.transparent );
|
206
|
+
}
|
207
|
+
return inst;
|
208
|
+
}
|
209
|
+
|
210
|
+
// named colors / default - filter back through parse function
|
211
|
+
if ( string = colors[ string ] ) {
|
212
|
+
return string;
|
213
|
+
}
|
214
|
+
}
|
215
|
+
|
216
|
+
color.fn = color.prototype = {
|
217
|
+
constructor: color,
|
218
|
+
parse: function( red, green, blue, alpha ) {
|
219
|
+
if ( red === undefined ) {
|
220
|
+
this._rgba = [ null, null, null, null ];
|
221
|
+
return this;
|
222
|
+
}
|
223
|
+
if ( red instanceof jQuery || red.nodeType ) {
|
224
|
+
red = red instanceof jQuery ? red.css( green ) : jQuery( red ).css( green );
|
225
|
+
green = undefined;
|
226
|
+
}
|
227
|
+
|
228
|
+
var inst = this,
|
229
|
+
type = jQuery.type( red ),
|
230
|
+
rgba = this._rgba = [],
|
231
|
+
source;
|
232
|
+
|
233
|
+
// more than 1 argument specified - assume ( red, green, blue, alpha )
|
234
|
+
if ( green !== undefined ) {
|
235
|
+
red = [ red, green, blue, alpha ];
|
236
|
+
type = "array";
|
237
|
+
}
|
238
|
+
|
239
|
+
if ( type === "string" ) {
|
240
|
+
return this.parse( stringParse( red ) || colors._default );
|
241
|
+
}
|
242
|
+
|
243
|
+
if ( type === "array" ) {
|
244
|
+
each( rgbaspace, function( key, prop ) {
|
245
|
+
rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );
|
246
|
+
});
|
247
|
+
return this;
|
248
|
+
}
|
249
|
+
|
250
|
+
if ( type === "object" ) {
|
251
|
+
if ( red instanceof color ) {
|
252
|
+
each( spaces, function( spaceName, space ) {
|
253
|
+
if ( red[ space.cache ] ) {
|
254
|
+
inst[ space.cache ] = red[ space.cache ].slice();
|
255
|
+
}
|
256
|
+
});
|
257
|
+
} else {
|
258
|
+
each( spaces, function( spaceName, space ) {
|
259
|
+
each( space.props, function( key, prop ) {
|
260
|
+
var cache = space.cache;
|
261
|
+
|
262
|
+
// if the cache doesn't exist, and we know how to convert
|
263
|
+
if ( !inst[ cache ] && space.to ) {
|
264
|
+
|
265
|
+
// if the value was null, we don't need to copy it
|
266
|
+
// if the key was alpha, we don't need to copy it either
|
267
|
+
if ( red[ key ] == null || key === "alpha") {
|
268
|
+
return;
|
269
|
+
}
|
270
|
+
inst[ cache ] = space.to( inst._rgba );
|
271
|
+
}
|
272
|
+
|
273
|
+
// this is the only case where we allow nulls for ALL properties.
|
274
|
+
// call clamp with alwaysAllowEmpty
|
275
|
+
inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true );
|
276
|
+
});
|
277
|
+
});
|
278
|
+
}
|
279
|
+
return this;
|
280
|
+
}
|
281
|
+
},
|
282
|
+
is: function( compare ) {
|
283
|
+
var is = color( compare ),
|
284
|
+
same = true,
|
285
|
+
myself = this;
|
286
|
+
|
287
|
+
each( spaces, function( _, space ) {
|
288
|
+
var isCache = is[ space.cache ],
|
289
|
+
localCache;
|
290
|
+
if (isCache) {
|
291
|
+
localCache = myself[ space.cache ] || space.to && space.to( myself._rgba ) || [];
|
292
|
+
each( space.props, function( _, prop ) {
|
293
|
+
if ( isCache[ prop.idx ] != null ) {
|
294
|
+
same = ( isCache[ prop.idx ] === localCache[ prop.idx ] );
|
295
|
+
return same;
|
296
|
+
}
|
297
|
+
});
|
298
|
+
}
|
299
|
+
return same;
|
300
|
+
});
|
301
|
+
return same;
|
302
|
+
},
|
303
|
+
_space: function() {
|
304
|
+
var used = [],
|
305
|
+
inst = this;
|
306
|
+
each( spaces, function( spaceName, space ) {
|
307
|
+
if ( inst[ space.cache ] ) {
|
308
|
+
used.push( spaceName );
|
309
|
+
}
|
310
|
+
});
|
311
|
+
return used.pop();
|
312
|
+
},
|
313
|
+
transition: function( other, distance ) {
|
314
|
+
var end = color( other ),
|
315
|
+
spaceName = end._space(),
|
316
|
+
space = spaces[ spaceName ],
|
317
|
+
start = this[ space.cache ] || space.to( this._rgba ),
|
318
|
+
result = start.slice();
|
319
|
+
|
320
|
+
end = end[ space.cache ];
|
321
|
+
each( space.props, function( key, prop ) {
|
322
|
+
var index = prop.idx,
|
323
|
+
startValue = start[ index ],
|
324
|
+
endValue = end[ index ],
|
325
|
+
type = propTypes[ prop.type ] || {};
|
326
|
+
|
327
|
+
// if null, don't override start value
|
328
|
+
if ( endValue === null ) {
|
329
|
+
return;
|
330
|
+
}
|
331
|
+
// if null - use end
|
332
|
+
if ( startValue === null ) {
|
333
|
+
result[ index ] = endValue;
|
334
|
+
} else {
|
335
|
+
if ( type.mod ) {
|
336
|
+
if ( endValue - startValue > type.mod / 2 ) {
|
337
|
+
startValue += type.mod;
|
338
|
+
} else if ( startValue - endValue > type.mod / 2 ) {
|
339
|
+
startValue -= type.mod;
|
340
|
+
}
|
341
|
+
}
|
342
|
+
result[ prop.idx ] = clamp( ( endValue - startValue ) * distance + startValue, prop );
|
343
|
+
}
|
344
|
+
});
|
345
|
+
return this[ spaceName ]( result );
|
346
|
+
},
|
347
|
+
blend: function( opaque ) {
|
348
|
+
// if we are already opaque - return ourself
|
349
|
+
if ( this._rgba[ 3 ] === 1 ) {
|
350
|
+
return this;
|
351
|
+
}
|
352
|
+
|
353
|
+
var rgb = this._rgba.slice(),
|
354
|
+
a = rgb.pop(),
|
355
|
+
blend = color( opaque )._rgba;
|
356
|
+
|
357
|
+
return color( jQuery.map( rgb, function( v, i ) {
|
358
|
+
return ( 1 - a ) * blend[ i ] + a * v;
|
359
|
+
}));
|
360
|
+
},
|
361
|
+
toRgbaString: function() {
|
362
|
+
var prefix = "rgba(",
|
363
|
+
rgba = jQuery.map( this._rgba, function( v, i ) {
|
364
|
+
return v == null ? ( i > 2 ? 1 : 0 ) : v;
|
365
|
+
});
|
366
|
+
|
367
|
+
if ( rgba[ 3 ] === 1 ) {
|
368
|
+
rgba.pop();
|
369
|
+
prefix = "rgb(";
|
370
|
+
}
|
371
|
+
|
372
|
+
return prefix + rgba.join(",") + ")";
|
373
|
+
},
|
374
|
+
toHslaString: function() {
|
375
|
+
var prefix = "hsla(",
|
376
|
+
hsla = jQuery.map( this.hsla(), function( v, i ) {
|
377
|
+
if ( v == null ) {
|
378
|
+
v = i > 2 ? 1 : 0;
|
379
|
+
}
|
380
|
+
|
381
|
+
// catch 1 and 2
|
382
|
+
if ( i && i < 3 ) {
|
383
|
+
v = Math.round( v * 100 ) + "%";
|
384
|
+
}
|
385
|
+
return v;
|
386
|
+
});
|
387
|
+
|
388
|
+
if ( hsla[ 3 ] === 1 ) {
|
389
|
+
hsla.pop();
|
390
|
+
prefix = "hsl(";
|
391
|
+
}
|
392
|
+
return prefix + hsla.join(",") + ")";
|
393
|
+
},
|
394
|
+
toHexString: function( includeAlpha ) {
|
395
|
+
var rgba = this._rgba.slice(),
|
396
|
+
alpha = rgba.pop();
|
397
|
+
|
398
|
+
if ( includeAlpha ) {
|
399
|
+
rgba.push( ~~( alpha * 255 ) );
|
400
|
+
}
|
401
|
+
|
402
|
+
return "#" + jQuery.map( rgba, function( v, i ) {
|
403
|
+
|
404
|
+
// default to 0 when nulls exist
|
405
|
+
v = ( v || 0 ).toString( 16 );
|
406
|
+
return v.length === 1 ? "0" + v : v;
|
407
|
+
}).join("");
|
408
|
+
},
|
409
|
+
toString: function() {
|
410
|
+
return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString();
|
411
|
+
}
|
412
|
+
};
|
413
|
+
color.fn.parse.prototype = color.fn;
|
414
|
+
|
415
|
+
// hsla conversions adapted from:
|
416
|
+
// http://www.google.com/codesearch/p#OAMlx_jo-ck/src/third_party/WebKit/Source/WebCore/inspector/front-end/Color.js&d=7&l=193
|
417
|
+
|
418
|
+
function hue2rgb( p, q, h ) {
|
419
|
+
h = ( h + 1 ) % 1;
|
420
|
+
if ( h * 6 < 1 ) {
|
421
|
+
return p + (q - p) * 6 * h;
|
422
|
+
}
|
423
|
+
if ( h * 2 < 1) {
|
424
|
+
return q;
|
425
|
+
}
|
426
|
+
if ( h * 3 < 2 ) {
|
427
|
+
return p + (q - p) * ((2/3) - h) * 6;
|
428
|
+
}
|
429
|
+
return p;
|
430
|
+
}
|
431
|
+
|
432
|
+
spaces.hsla.to = function ( rgba ) {
|
433
|
+
if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
|
434
|
+
return [ null, null, null, rgba[ 3 ] ];
|
435
|
+
}
|
436
|
+
var r = rgba[ 0 ] / 255,
|
437
|
+
g = rgba[ 1 ] / 255,
|
438
|
+
b = rgba[ 2 ] / 255,
|
439
|
+
a = rgba[ 3 ],
|
440
|
+
max = Math.max( r, g, b ),
|
441
|
+
min = Math.min( r, g, b ),
|
442
|
+
diff = max - min,
|
443
|
+
add = max + min,
|
444
|
+
l = add * 0.5,
|
445
|
+
h, s;
|
446
|
+
|
447
|
+
if ( min === max ) {
|
448
|
+
h = 0;
|
449
|
+
} else if ( r === max ) {
|
450
|
+
h = ( 60 * ( g - b ) / diff ) + 360;
|
451
|
+
} else if ( g === max ) {
|
452
|
+
h = ( 60 * ( b - r ) / diff ) + 120;
|
453
|
+
} else {
|
454
|
+
h = ( 60 * ( r - g ) / diff ) + 240;
|
455
|
+
}
|
456
|
+
|
457
|
+
if ( l === 0 || l === 1 ) {
|
458
|
+
s = l;
|
459
|
+
} else if ( l <= 0.5 ) {
|
460
|
+
s = diff / add;
|
461
|
+
} else {
|
462
|
+
s = diff / ( 2 - add );
|
463
|
+
}
|
464
|
+
return [ Math.round(h) % 360, s, l, a == null ? 1 : a ];
|
465
|
+
};
|
466
|
+
|
467
|
+
spaces.hsla.from = function ( hsla ) {
|
468
|
+
if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) {
|
469
|
+
return [ null, null, null, hsla[ 3 ] ];
|
470
|
+
}
|
471
|
+
var h = hsla[ 0 ] / 360,
|
472
|
+
s = hsla[ 1 ],
|
473
|
+
l = hsla[ 2 ],
|
474
|
+
a = hsla[ 3 ],
|
475
|
+
q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s,
|
476
|
+
p = 2 * l - q,
|
477
|
+
r, g, b;
|
478
|
+
|
479
|
+
return [
|
480
|
+
Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ),
|
481
|
+
Math.round( hue2rgb( p, q, h ) * 255 ),
|
482
|
+
Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ),
|
483
|
+
a
|
484
|
+
];
|
485
|
+
};
|
486
|
+
|
487
|
+
|
488
|
+
each( spaces, function( spaceName, space ) {
|
489
|
+
var props = space.props,
|
490
|
+
cache = space.cache,
|
491
|
+
to = space.to,
|
492
|
+
from = space.from;
|
493
|
+
|
494
|
+
// makes rgba() and hsla()
|
495
|
+
color.fn[ spaceName ] = function( value ) {
|
496
|
+
|
497
|
+
// generate a cache for this space if it doesn't exist
|
498
|
+
if ( to && !this[ cache ] ) {
|
499
|
+
this[ cache ] = to( this._rgba );
|
500
|
+
}
|
501
|
+
if ( value === undefined ) {
|
502
|
+
return this[ cache ].slice();
|
503
|
+
}
|
504
|
+
|
505
|
+
var type = jQuery.type( value ),
|
506
|
+
arr = ( type === "array" || type === "object" ) ? value : arguments,
|
507
|
+
local = this[ cache ].slice(),
|
508
|
+
ret;
|
509
|
+
|
510
|
+
each( props, function( key, prop ) {
|
511
|
+
var val = arr[ type === "object" ? key : prop.idx ];
|
512
|
+
if ( val == null ) {
|
513
|
+
val = local[ prop.idx ];
|
514
|
+
}
|
515
|
+
local[ prop.idx ] = clamp( val, prop );
|
516
|
+
});
|
517
|
+
|
518
|
+
if ( from ) {
|
519
|
+
ret = color( from( local ) );
|
520
|
+
ret[ cache ] = local;
|
521
|
+
return ret;
|
522
|
+
} else {
|
523
|
+
return color( local );
|
524
|
+
}
|
525
|
+
};
|
526
|
+
|
527
|
+
// makes red() green() blue() alpha() hue() saturation() lightness()
|
528
|
+
each( props, function( key, prop ) {
|
529
|
+
// alpha is included in more than one space
|
530
|
+
if ( color.fn[ key ] ) {
|
531
|
+
return;
|
532
|
+
}
|
533
|
+
color.fn[ key ] = function( value ) {
|
534
|
+
var vtype = jQuery.type( value ),
|
535
|
+
fn = ( key === 'alpha' ? ( this._hsla ? 'hsla' : 'rgba' ) : spaceName ),
|
536
|
+
local = this[ fn ](),
|
537
|
+
cur = local[ prop.idx ],
|
538
|
+
match;
|
539
|
+
|
540
|
+
if ( vtype === "undefined" ) {
|
541
|
+
return cur;
|
542
|
+
}
|
543
|
+
|
544
|
+
if ( vtype === "function" ) {
|
545
|
+
value = value.call( this, cur );
|
546
|
+
vtype = jQuery.type( value );
|
547
|
+
}
|
548
|
+
if ( value == null && prop.empty ) {
|
549
|
+
return this;
|
550
|
+
}
|
551
|
+
if ( vtype === "string" ) {
|
552
|
+
match = rplusequals.exec( value );
|
553
|
+
if ( match ) {
|
554
|
+
value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 );
|
555
|
+
}
|
556
|
+
}
|
557
|
+
local[ prop.idx ] = value;
|
558
|
+
return this[ fn ]( local );
|
559
|
+
};
|
560
|
+
});
|
561
|
+
});
|
562
|
+
|
563
|
+
// add .fx.step functions
|
564
|
+
each( stepHooks, function( i, hook ) {
|
565
|
+
jQuery.cssHooks[ hook ] = {
|
566
|
+
set: function( elem, value ) {
|
567
|
+
var parsed, backgroundColor, curElem;
|
568
|
+
|
569
|
+
if ( jQuery.type( value ) !== 'string' || ( parsed = stringParse( value ) ) )
|
570
|
+
{
|
571
|
+
value = color( parsed || value );
|
572
|
+
if ( !support.rgba && value._rgba[ 3 ] !== 1 ) {
|
573
|
+
curElem = hook === "backgroundColor" ? elem.parentNode : elem;
|
574
|
+
do {
|
575
|
+
backgroundColor = jQuery.curCSS( curElem, "backgroundColor" );
|
576
|
+
} while (
|
577
|
+
( backgroundColor === "" || backgroundColor === "transparent" ) &&
|
578
|
+
( curElem = curElem.parentNode ) &&
|
579
|
+
curElem.style
|
580
|
+
);
|
581
|
+
|
582
|
+
value = value.blend( backgroundColor && backgroundColor !== "transparent" ?
|
583
|
+
backgroundColor :
|
584
|
+
"_default" );
|
585
|
+
}
|
586
|
+
|
587
|
+
value = value.toRgbaString();
|
588
|
+
}
|
589
|
+
elem.style[ hook ] = value;
|
590
|
+
}
|
591
|
+
};
|
592
|
+
jQuery.fx.step[ hook ] = function( fx ) {
|
593
|
+
if ( !fx.colorInit ) {
|
594
|
+
fx.start = color( fx.elem, hook );
|
595
|
+
fx.end = color( fx.end );
|
596
|
+
fx.colorInit = true;
|
597
|
+
}
|
598
|
+
jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) );
|
599
|
+
};
|
600
|
+
});
|
601
|
+
|
602
|
+
// detect rgba support
|
603
|
+
jQuery(function() {
|
604
|
+
var div = document.createElement( "div" ),
|
605
|
+
div_style = div.style;
|
606
|
+
|
607
|
+
div_style.cssText = "background-color:rgba(1,1,1,.5)";
|
608
|
+
support.rgba = div_style.backgroundColor.indexOf( "rgba" ) > -1;
|
609
|
+
});
|
610
|
+
|
611
|
+
// Some named colors to work with
|
612
|
+
// From Interface by Stefan Petre
|
613
|
+
// http://interface.eyecon.ro/
|
614
|
+
colors = jQuery.Color.names = {
|
615
|
+
aqua: "#00ffff",
|
616
|
+
azure: "#f0ffff",
|
617
|
+
beige: "#f5f5dc",
|
618
|
+
black: "#000000",
|
619
|
+
blue: "#0000ff",
|
620
|
+
brown: "#a52a2a",
|
621
|
+
cyan: "#00ffff",
|
622
|
+
darkblue: "#00008b",
|
623
|
+
darkcyan: "#008b8b",
|
624
|
+
darkgrey: "#a9a9a9",
|
625
|
+
darkgreen: "#006400",
|
626
|
+
darkkhaki: "#bdb76b",
|
627
|
+
darkmagenta: "#8b008b",
|
628
|
+
darkolivegreen: "#556b2f",
|
629
|
+
darkorange: "#ff8c00",
|
630
|
+
darkorchid: "#9932cc",
|
631
|
+
darkred: "#8b0000",
|
632
|
+
darksalmon: "#e9967a",
|
633
|
+
darkviolet: "#9400d3",
|
634
|
+
fuchsia: "#ff00ff",
|
635
|
+
gold: "#ffd700",
|
636
|
+
green: "#008000",
|
637
|
+
indigo: "#4b0082",
|
638
|
+
khaki: "#f0e68c",
|
639
|
+
lightblue: "#add8e6",
|
640
|
+
lightcyan: "#e0ffff",
|
641
|
+
lightgreen: "#90ee90",
|
642
|
+
lightgrey: "#d3d3d3",
|
643
|
+
lightpink: "#ffb6c1",
|
644
|
+
lightyellow: "#ffffe0",
|
645
|
+
lime: "#00ff00",
|
646
|
+
magenta: "#ff00ff",
|
647
|
+
maroon: "#800000",
|
648
|
+
navy: "#000080",
|
649
|
+
olive: "#808000",
|
650
|
+
orange: "#ffa500",
|
651
|
+
pink: "#ffc0cb",
|
652
|
+
purple: "#800080",
|
653
|
+
violet: "#800080",
|
654
|
+
red: "#ff0000",
|
655
|
+
silver: "#c0c0c0",
|
656
|
+
white: "#ffffff",
|
657
|
+
yellow: "#ffff00",
|
658
|
+
transparent: [ null, null, null, 0 ],
|
659
|
+
_default: "#ffffff"
|
660
|
+
};
|
661
|
+
})( jQuery );
|