hurry 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +55 -0
- data/Rakefile +69 -0
- data/app/assets/audios/twilight-hole.mp3 +0 -0
- data/app/assets/files/arvind resume (1).doc +0 -0
- data/app/assets/files/toma v 0 1.ppt +0 -0
- data/app/assets/images/0d0a413.png +0 -0
- data/app/assets/images/120.jpg +0 -0
- data/app/assets/images/51.jpg +0 -0
- data/app/assets/images/Untitled Document +97 -0
- data/app/assets/images/Untitled Document~ +97 -0
- data/app/assets/images/access.png +0 -0
- data/app/assets/images/adv.png +0 -0
- data/app/assets/images/article.png +0 -0
- data/app/assets/images/audio_icon.jpg +0 -0
- data/app/assets/images/background.gif +0 -0
- data/app/assets/images/banners/111.jpg +0 -0
- data/app/assets/images/banners/90.jpg +0 -0
- data/app/assets/images/banners/userimg.png +0 -0
- data/app/assets/images/blog.png +0 -0
- data/app/assets/images/body.png +0 -0
- data/app/assets/images/cancel.png +0 -0
- data/app/assets/images/cat.png +0 -0
- data/app/assets/images/contributions_userimg2.png +0 -0
- data/app/assets/images/delete.png +0 -0
- data/app/assets/images/edit.png +0 -0
- data/app/assets/images/excel.jpg +0 -0
- data/app/assets/images/file.gif +0 -0
- data/app/assets/images/file.jpeg +0 -0
- data/app/assets/images/folder-closed.gif +0 -0
- data/app/assets/images/folder.gif +0 -0
- data/app/assets/images/group.png +0 -0
- data/app/assets/images/header.png +0 -0
- data/app/assets/images/icons.gif +0 -0
- data/app/assets/images/loading.gif +0 -0
- data/app/assets/images/logo.png +0 -0
- data/app/assets/images/logout.png +0 -0
- data/app/assets/images/media.png +0 -0
- data/app/assets/images/minus.gif +0 -0
- data/app/assets/images/new.png +0 -0
- data/app/assets/images/page_manager.png +0 -0
- data/app/assets/images/pdf.png +0 -0
- data/app/assets/images/personal/ice glass.jpg +0 -0
- data/app/assets/images/plus.gif +0 -0
- data/app/assets/images/ppt.jpg +0 -0
- data/app/assets/images/profileimg.png +0 -0
- data/app/assets/images/rails.png +0 -0
- data/app/assets/images/setting.png +0 -0
- data/app/assets/images/status.png +0 -0
- data/app/assets/images/treeview-black-line.gif +0 -0
- data/app/assets/images/treeview-black.gif +0 -0
- data/app/assets/images/treeview-default-line.gif +0 -0
- data/app/assets/images/treeview-default.gif +0 -0
- data/app/assets/images/treeview-famfamfam-line.gif +0 -0
- data/app/assets/images/treeview-famfamfam.gif +0 -0
- data/app/assets/images/treeview-gray-line.gif +0 -0
- data/app/assets/images/treeview-gray.gif +0 -0
- data/app/assets/images/treeview-red-line.gif +0 -0
- data/app/assets/images/treeview-red.gif +0 -0
- data/app/assets/images/ui.dynatree.css +440 -0
- data/app/assets/images/user.png +0 -0
- data/app/assets/images/user1.png +0 -0
- data/app/assets/images/user_manager.png +0 -0
- data/app/assets/images/video_icon.jpg +0 -0
- data/app/assets/images/vline.gif +0 -0
- data/app/assets/images/word.png +0 -0
- data/app/assets/javascripts/application.js +9 -0
- data/app/assets/javascripts/bolt/articles.js.coffee +3 -0
- data/app/assets/javascripts/bolt/groups.js.coffee +3 -0
- data/app/assets/javascripts/bolt/user_groups.js.coffee +3 -0
- data/app/assets/javascripts/bolt/users_groups.js.coffee +3 -0
- data/app/assets/javascripts/imagebubble.js~ +68 -0
- data/app/assets/javascripts/javascript_functions.js +65 -0
- data/app/assets/javascripts/jquery.dynatree.js +3312 -0
- data/app/assets/javascripts/jquery.js +154 -0
- data/app/assets/javascripts/jquery.treeview.js +251 -0
- data/app/assets/javascripts/jquery_new.js +19 -0
- data/app/assets/javascripts/login.js +24 -0
- data/app/assets/javascripts/media.js +64 -0
- data/app/assets/javascripts/media.js.coffee +3 -0
- data/app/assets/javascripts/rails.js +132 -0
- data/app/assets/miscellaneous/1leader.flv +0 -0
- data/app/assets/miscellaneous/users_controller.1.rb +237 -0
- data/app/assets/stylesheets/application.css +8 -0
- data/app/assets/stylesheets/application.css~ +8 -0
- data/app/assets/stylesheets/bolt/articles.css.scss +3 -0
- data/app/assets/stylesheets/bolt/groups.css.scss +3 -0
- data/app/assets/stylesheets/bolt/user_groups.css.scss +3 -0
- data/app/assets/stylesheets/bolt/users_groups.css.scss +3 -0
- data/app/assets/stylesheets/bubble.css +28 -0
- data/app/assets/stylesheets/depot.css +26 -0
- data/app/assets/stylesheets/depot.css~ +34 -0
- data/app/assets/stylesheets/dropdown.css +49 -0
- data/app/assets/stylesheets/imagebubbles.css~ +32 -0
- data/app/assets/stylesheets/jquery.treeview.css +68 -0
- data/app/assets/stylesheets/media.css.scss +3 -0
- data/app/assets/stylesheets/mediamanager.css +10 -0
- data/app/assets/stylesheets/scaffolds.css +56 -0
- data/app/assets/stylesheets/scaffolds.css.scss +56 -0
- data/app/assets/stylesheets/ui.dynatree.css +440 -0
- data/app/assets/stylesheets/users_style.css +80 -0
- data/app/assets/videos/1leader.flv +0 -0
- data/app/controllers/application_controller.rb +7 -0
- data/app/controllers/application_controller.rb~ +3 -0
- data/app/controllers/articles_controller.rb~ +91 -0
- data/app/controllers/bolt/accesses_controller.rb +71 -0
- data/app/controllers/bolt/articles_categories_controller.rb +71 -0
- data/app/controllers/bolt/articles_controller.rb +97 -0
- data/app/controllers/bolt/articles_controller.rb~ +60 -0
- data/app/controllers/bolt/banners_controller.rb +58 -0
- data/app/controllers/bolt/blogs_controller.rb +82 -0
- data/app/controllers/bolt/bolt_controller.rb +234 -0
- data/app/controllers/bolt/bolt_controller.rb~ +201 -0
- data/app/controllers/bolt/categories_controller.rb +72 -0
- data/app/controllers/bolt/dashboard_controller.rb +14 -0
- data/app/controllers/bolt/dashboard_controller.rb~ +14 -0
- data/app/controllers/bolt/groups_controller.rb +100 -0
- data/app/controllers/bolt/groups_controller.rb~ +85 -0
- data/app/controllers/bolt/info_controller.rb +26 -0
- data/app/controllers/bolt/media_controller.rb +120 -0
- data/app/controllers/bolt/page_sections_controller.rb +58 -0
- data/app/controllers/bolt/pages_controller.rb +90 -0
- data/app/controllers/bolt/password_resets_controller.rb +66 -0
- data/app/controllers/bolt/settings_controller.rb +59 -0
- data/app/controllers/bolt/statuses_controller.rb +72 -0
- data/app/controllers/bolt/user_sessions_controller.rb +40 -0
- data/app/controllers/bolt/user_statuses_controller.rb +58 -0
- data/app/controllers/bolt/users_controller.rb +104 -0
- data/app/controllers/bolt/users_controller.rb~ +79 -0
- data/app/controllers/bolt/users_groups_controller.rb +99 -0
- data/app/controllers/bolt/users_groups_controller.rb~ +83 -0
- data/app/controllers/groups_controller.rb~ +83 -0
- data/app/controllers/users_groups_controller.rb~ +83 -0
- data/app/helpers/application_helper.rb +2 -0
- data/app/helpers/bolt/articles_helper.rb +2 -0
- data/app/helpers/bolt/bolt_helper.rb +208 -0
- data/app/helpers/bolt/bolt_helper.rb~ +208 -0
- data/app/helpers/bolt/config_helper.rb +46 -0
- data/app/helpers/bolt/config_helper.rb~ +46 -0
- data/app/helpers/bolt/groups_helper.rb +2 -0
- data/app/helpers/bolt/user_groups_helper.rb +2 -0
- data/app/helpers/bolt/users_groups_helper.rb +2 -0
- data/app/helpers/media_helper.rb +2 -0
- data/app/mailers/bolt/backbone_notification.rb~ +39 -0
- data/app/mailers/bolt/bolt_notification.rb +39 -0
- data/app/models/access.rb +5 -0
- data/app/models/article.rb +23 -0
- data/app/models/article.rb~ +3 -0
- data/app/models/articles_category.rb +12 -0
- data/app/models/blog.rb +5 -0
- data/app/models/bolt.rb +3 -0
- data/app/models/bolt.rb~ +5 -0
- data/app/models/bolt/group.rb~ +2 -0
- data/app/models/bolt/user.rb +56 -0
- data/app/models/bolt/user.rb~ +62 -0
- data/app/models/bolt/user_group.rb~ +3 -0
- data/app/models/bolt/user_session.rb +8 -0
- data/app/models/bolt/users_group.rb~ +2 -0
- data/app/models/category.rb +7 -0
- data/app/models/group.rb +8 -0
- data/app/models/group.rb~ +7 -0
- data/app/models/media_image.rb +19 -0
- data/app/models/media_images.rb +21 -0
- data/app/models/media_images.rb~ +21 -0
- data/app/models/medium.rb +8 -0
- data/app/models/page.rb +10 -0
- data/app/models/page_section.rb +3 -0
- data/app/models/setting.rb +3 -0
- data/app/models/status.rb +3 -0
- data/app/models/user_status.rb +3 -0
- data/app/models/users_group.rb +14 -0
- data/app/models/users_group.rb~ +6 -0
- data/app/views/bolt/accesses/_form.html.erb +13 -0
- data/app/views/bolt/accesses/_table.html.erb +17 -0
- data/app/views/bolt/accesses/_title.html.erb +9 -0
- data/app/views/bolt/accesses/index.html.erb +44 -0
- data/app/views/bolt/accesses/new.html.erb +18 -0
- data/app/views/bolt/accesses/show.html.erb +17 -0
- data/app/views/bolt/articles/_form.html.erb +113 -0
- data/app/views/bolt/articles/_form.html.erb~ +33 -0
- data/app/views/bolt/articles/_table.html.erb +29 -0
- data/app/views/bolt/articles/_table.html.erb~ +28 -0
- data/app/views/bolt/articles/_title.html.erb +9 -0
- data/app/views/bolt/articles/index.html.erb +37 -0
- data/app/views/bolt/articles/index.html.erb~ +10 -0
- data/app/views/bolt/articles/new.html.erb +16 -0
- data/app/views/bolt/articles/new.html.erb~ +18 -0
- data/app/views/bolt/articles/show.html.erb +17 -0
- data/app/views/bolt/articles/show.html.erb~ +17 -0
- data/app/views/bolt/articles_categories/_form.html.erb +13 -0
- data/app/views/bolt/articles_categories/_table.html.erb +18 -0
- data/app/views/bolt/articles_categories/index.html.erb +10 -0
- data/app/views/bolt/articles_categories/new.html.erb +18 -0
- data/app/views/bolt/articles_categories/show.html.erb +17 -0
- data/app/views/bolt/banners/_form.html.erb +13 -0
- data/app/views/bolt/banners/_table.html.erb +18 -0
- data/app/views/bolt/banners/index.html.erb +10 -0
- data/app/views/bolt/banners/new.html.erb +18 -0
- data/app/views/bolt/banners/show.html.erb +17 -0
- data/app/views/bolt/blogs/_form.html.erb +24 -0
- data/app/views/bolt/blogs/_table.html.erb +22 -0
- data/app/views/bolt/blogs/index.html.erb +33 -0
- data/app/views/bolt/blogs/new.html.erb +18 -0
- data/app/views/bolt/blogs/show.html.erb +17 -0
- data/app/views/bolt/bolt/index.html.erb +0 -0
- data/app/views/bolt/bolt/index.html.erb~ +3 -0
- data/app/views/bolt/bolt_notification/generate_new_password.erb +12 -0
- data/app/views/bolt/bolt_notification/new_user_information.erb +12 -0
- data/app/views/bolt/bolt_notification/password_reset_instructions.erb +11 -0
- data/app/views/bolt/categories/_form.html.erb +9 -0
- data/app/views/bolt/categories/_table.html.erb +17 -0
- data/app/views/bolt/categories/_title.html.erb +8 -0
- data/app/views/bolt/categories/index.html.erb +36 -0
- data/app/views/bolt/categories/new.html.erb +19 -0
- data/app/views/bolt/categories/show.html.erb +17 -0
- data/app/views/bolt/dashboard/index.html.erb +69 -0
- data/app/views/bolt/dashboard/index.html.erb~ +1 -0
- data/app/views/bolt/groups/_form.html.erb +18 -0
- data/app/views/bolt/groups/_form.html.erb~ +21 -0
- data/app/views/bolt/groups/_title.html.erb +5 -0
- data/app/views/bolt/groups/edit.html.erb +6 -0
- data/app/views/bolt/groups/index.html.erb +43 -0
- data/app/views/bolt/groups/index.html.erb~ +23 -0
- data/app/views/bolt/groups/new.html.erb +14 -0
- data/app/views/bolt/groups/new.html.erb~ +5 -0
- data/app/views/bolt/groups/show.html.erb +16 -0
- data/app/views/bolt/info/show.html.erb +43 -0
- data/app/views/bolt/info/show.html.erb~ +5 -0
- data/app/views/bolt/layouts/_left_navigation.html.erb +9 -0
- data/app/views/bolt/layouts/_left_navigation.html.erb~ +16 -0
- data/app/views/bolt/layouts/_right_navigation.html.erb +1 -0
- data/app/views/bolt/layouts/_right_navigation.html.erb~ +1 -0
- data/app/views/bolt/layouts/bolt_auth.html.erb +23 -0
- data/app/views/bolt/layouts/bolt_auth.html.erb~ +23 -0
- data/app/views/bolt/layouts/bolt_main.html.erb +86 -0
- data/app/views/bolt/layouts/bolt_main.html.erb~ +64 -0
- data/app/views/bolt/media/getfolderdatas.html.erb +31 -0
- data/app/views/bolt/media/index.html.erb +195 -0
- data/app/views/bolt/page_sections/_form.html.erb +21 -0
- data/app/views/bolt/page_sections/_table.html.erb +22 -0
- data/app/views/bolt/page_sections/index.html.erb +10 -0
- data/app/views/bolt/page_sections/new.html.erb +18 -0
- data/app/views/bolt/page_sections/show.html.erb +17 -0
- data/app/views/bolt/pages/_form.html.erb +166 -0
- data/app/views/bolt/pages/_form.html.erb~ +41 -0
- data/app/views/bolt/pages/_page_sections_form.html.erb +39 -0
- data/app/views/bolt/pages/_page_sections_form.html.erb~ +3 -0
- data/app/views/bolt/pages/_table.html.erb +29 -0
- data/app/views/bolt/pages/index.html.erb +34 -0
- data/app/views/bolt/pages/new.html.erb +18 -0
- data/app/views/bolt/pages/show.html.erb +18 -0
- data/app/views/bolt/password_resets/edit.html.erb +48 -0
- data/app/views/bolt/settings/_form.html.erb +25 -0
- data/app/views/bolt/settings/_table.html.erb +23 -0
- data/app/views/bolt/settings/index.html.erb +10 -0
- data/app/views/bolt/settings/new.html.erb +18 -0
- data/app/views/bolt/settings/show.html.erb +80 -0
- data/app/views/bolt/statuses/_form.html.erb +14 -0
- data/app/views/bolt/statuses/_table.html.erb +17 -0
- data/app/views/bolt/statuses/_title.html.erb +9 -0
- data/app/views/bolt/statuses/index.html.erb +37 -0
- data/app/views/bolt/statuses/new.html.erb +18 -0
- data/app/views/bolt/statuses/show.html.erb +17 -0
- data/app/views/bolt/user_sessions/new.html.erb +66 -0
- data/app/views/bolt/user_sessions_bk/new.html.erb +69 -0
- data/app/views/bolt/user_statuses/_form.html.erb +9 -0
- data/app/views/bolt/user_statuses/_table.html.erb +16 -0
- data/app/views/bolt/user_statuses/index.html.erb +10 -0
- data/app/views/bolt/user_statuses/new.html.erb +18 -0
- data/app/views/bolt/user_statuses/show.html.erb +17 -0
- data/app/views/bolt/users/_title.html.erb +8 -0
- data/app/views/bolt/users/index.html.erb +60 -0
- data/app/views/bolt/users/index.html.erb~ +35 -0
- data/app/views/bolt/users/new.html.erb +64 -0
- data/app/views/bolt/users/new.html.erb~ +46 -0
- data/app/views/bolt/users/response.json.builder~ +26 -0
- data/app/views/bolt/users/show.html.erb +130 -0
- data/app/views/bolt/users/show.html.erb~ +94 -0
- data/app/views/bolt/users_bk/_form.html.erb +77 -0
- data/app/views/bolt/users_bk/edit.html.erb +6 -0
- data/app/views/bolt/users_bk/index.html.erb +58 -0
- data/app/views/bolt/users_bk/index.html.erb~ +60 -0
- data/app/views/bolt/users_bk/new.html.erb +6 -0
- data/app/views/bolt/users_bk/show.html.erb +100 -0
- data/app/views/bolt/users_groups/_form.html.erb +25 -0
- data/app/views/bolt/users_groups/edit.html.erb +6 -0
- data/app/views/bolt/users_groups/index.html.erb +25 -0
- data/app/views/bolt/users_groups/new.html.erb +5 -0
- data/app/views/bolt/users_groups/show.html.erb +15 -0
- data/app/views/layouts/application.html.erb +18 -0
- data/app/views/layouts/application.html.erb~ +51 -0
- data/app/views/layouts/bolt_auth.html.erb +24 -0
- data/app/views/layouts/bolt_auth.html.erb~ +25 -0
- data/app/views/layouts/bolt_main.html.erb +142 -0
- data/app/views/layouts/bolt_main.html.erb~ +56 -0
- data/app/views/layouts/default_site.html.erb +81 -0
- data/app/views/user_groups/_form.html.erb +21 -0
- data/app/views/user_groups/edit.html.erb +6 -0
- data/app/views/user_groups/index.html.erb +32 -0
- data/app/views/user_groups/new.html.erb +5 -0
- data/app/views/user_groups/show.html.erb +10 -0
- data/config/application.rb +49 -0
- data/config/application.rb~ +48 -0
- data/config/boot.rb +6 -0
- data/config/database.yml +31 -0
- data/config/database.yml~ +25 -0
- data/config/environment.rb +5 -0
- data/config/environments/development.rb +30 -0
- data/config/environments/production.rb +60 -0
- data/config/environments/test.rb +39 -0
- data/config/initializers/backtrace_silencers.rb +7 -0
- data/config/initializers/inflections.rb +10 -0
- data/config/initializers/mime_types.rb +5 -0
- data/config/initializers/secret_token.rb +7 -0
- data/config/initializers/session_store.rb +8 -0
- data/config/initializers/wrap_parameters.rb +14 -0
- data/config/locales/en.yml +5 -0
- data/config/routes.rb +101 -0
- data/config/routes.rb~ +81 -0
- data/db/migrate/20111028162853_create_bolt_users.rb +49 -0
- data/db/migrate/20111028162853_create_bolt_users.rb~ +49 -0
- data/db/migrate/20120302083233_create_articles.rb~ +15 -0
- data/db/migrate/20120307133203_create_groups.rb +10 -0
- data/db/migrate/20120307133203_create_groups.rb~ +9 -0
- data/db/migrate/20120308113354_create_users_groups.rb +10 -0
- data/db/migrate/20120308113354_create_users_groups.rb~ +10 -0
- data/db/migrate/20120309070442_create_articles.rb +18 -0
- data/db/migrate/20120312063336_create_blogs.rb +15 -0
- data/db/migrate/20120312071401_create_categories.rb +13 -0
- data/db/migrate/20120313051136_create_accesses.rb +13 -0
- data/db/migrate/20120313051206_create_statuses.rb +13 -0
- data/db/migrate/20120313061322_create_media.rb +18 -0
- data/db/migrate/20120313061459_create_media_images.rb +10 -0
- data/db/migrate/20120313085220_create_user_statuses.rb +13 -0
- data/db/migrate/20120314060252_create_articles_categories.rb +14 -0
- data/db/migrate/20120314110540_create_pages.rb +24 -0
- data/db/migrate/20120314110540_create_pages.rb~ +24 -0
- data/db/migrate/20120314110602_create_page_sections.rb +20 -0
- data/db/migrate/20120314110602_create_page_sections.rb~ +20 -0
- data/db/migrate/20120314110922_add_ancestry_to_page.rb +9 -0
- data/db/migrate/20120315071805_change_mediaimages_column.rb +8 -0
- data/db/migrate/20120319132523_create_settings.rb +18 -0
- data/db/schema.rb +169 -0
- data/db/seeds.rb +7 -0
- data/doc/README_FOR_APP +2 -0
- data/lib/tasks/tasks.rake +31 -0
- data/public/404.html +26 -0
- data/public/422.html +26 -0
- data/public/500.html +26 -0
- data/public/bolt/images/backbone.png +0 -0
- data/public/bolt/images/header.png +0 -0
- data/public/bolt/images/icons/add.png +0 -0
- data/public/bolt/images/icons/ajax-spinner.gif +0 -0
- data/public/bolt/images/icons/delete.png +0 -0
- data/public/bolt/images/icons/icons.gif +0 -0
- data/public/bolt/images/icons/loading.gif +0 -0
- data/public/bolt/images/icons/spinner-sm.gif +0 -0
- data/public/bolt/images/icons/spinner.png +0 -0
- data/public/bolt/images/icons/table.png +0 -0
- data/public/bolt/images/icons/vline.gif +0 -0
- data/public/bolt/images/login/bottom.png +0 -0
- data/public/bolt/images/login/top.png +0 -0
- data/public/bolt/images/nav.png +0 -0
- data/public/bolt/images/rightNav.png +0 -0
- data/public/bolt/images/rightNavButton.png +0 -0
- data/public/bolt/images/visitSiteNav.png +0 -0
- data/public/bolt/imagesx/backbone.png +0 -0
- data/public/bolt/imagesx/header.png +0 -0
- data/public/bolt/imagesx/icons/add.png +0 -0
- data/public/bolt/imagesx/icons/ajax-spinner.gif +0 -0
- data/public/bolt/imagesx/icons/delete.png +0 -0
- data/public/bolt/imagesx/icons/icons.gif +0 -0
- data/public/bolt/imagesx/icons/loading.gif +0 -0
- data/public/bolt/imagesx/icons/spinner-sm.gif +0 -0
- data/public/bolt/imagesx/icons/spinner.png +0 -0
- data/public/bolt/imagesx/icons/table.png +0 -0
- data/public/bolt/imagesx/icons/vline.gif +0 -0
- data/public/bolt/imagesx/login/bottom.png +0 -0
- data/public/bolt/imagesx/login/top.png +0 -0
- data/public/bolt/imagesx/nav.png +0 -0
- data/public/bolt/imagesx/rightNav.png +0 -0
- data/public/bolt/imagesx/rightNavButton.png +0 -0
- data/public/bolt/imagesx/visitSiteNav.png +0 -0
- data/public/bolt/javascripts/backbone.js +25 -0
- data/public/bolt/javascripts/custom.js +2 -0
- data/public/bolt/javascripts/jquery.js +154 -0
- data/public/bolt/javascripts/login.js +24 -0
- data/public/bolt/javascripts/rails.js +132 -0
- data/public/bolt/stylesheets/custom.css +82 -0
- data/public/bolt/stylesheets/custom.css~ +82 -0
- data/public/bolt/stylesheets/elements.css +316 -0
- data/public/bolt/stylesheets/elements.css~ +307 -0
- data/public/bolt/stylesheets/login.css +137 -0
- data/public/bolt/stylesheets/login.css~ +137 -0
- data/public/bolt/stylesheets/screen.css +224 -0
- data/public/bolt/stylesheets/screen.css~ +224 -0
- data/public/favicon.ico +0 -0
- data/public/images/article.png +0 -0
- data/public/images/backbone.png +0 -0
- data/public/images/cancel.png +0 -0
- data/public/images/cat.png +0 -0
- data/public/images/delete.png +0 -0
- data/public/images/edit.png +0 -0
- data/public/images/file.gif +0 -0
- data/public/images/folder-closed.gif +0 -0
- data/public/images/folder.gif +0 -0
- data/public/images/header.png +0 -0
- data/public/images/icons.gif +0 -0
- data/public/images/icons/add.png +0 -0
- data/public/images/icons/ajax-spinner.gif +0 -0
- data/public/images/icons/delete.png +0 -0
- data/public/images/icons/icons.gif +0 -0
- data/public/images/icons/loading.gif +0 -0
- data/public/images/icons/spinner-sm.gif +0 -0
- data/public/images/icons/spinner.png +0 -0
- data/public/images/icons/table.png +0 -0
- data/public/images/icons/vline.gif +0 -0
- data/public/images/ii.jpg +0 -0
- data/public/images/loading.gif +0 -0
- data/public/images/login/bottom.png +0 -0
- data/public/images/login/top.png +0 -0
- data/public/images/logo.png +0 -0
- data/public/images/logout.png +0 -0
- data/public/images/media.png +0 -0
- data/public/images/minus.gif +0 -0
- data/public/images/nav.png +0 -0
- data/public/images/new.png +0 -0
- data/public/images/plus.gif +0 -0
- data/public/images/profileimg.png +0 -0
- data/public/images/rails.png +0 -0
- data/public/images/rightNav.png +0 -0
- data/public/images/rightNavButton.png +0 -0
- data/public/images/treeview-black-line.gif +0 -0
- data/public/images/treeview-black.gif +0 -0
- data/public/images/treeview-default-line.gif +0 -0
- data/public/images/treeview-default.gif +0 -0
- data/public/images/treeview-famfamfam-line.gif +0 -0
- data/public/images/treeview-famfamfam.gif +0 -0
- data/public/images/treeview-gray-line.gif +0 -0
- data/public/images/treeview-gray.gif +0 -0
- data/public/images/treeview-red-line.gif +0 -0
- data/public/images/treeview-red.gif +0 -0
- data/public/images/ui.dynatree.css +440 -0
- data/public/images/user.png +0 -0
- data/public/images/user1.png +0 -0
- data/public/images/visitSiteNav.png +0 -0
- data/public/images/vline.gif +0 -0
- data/public/javascripts/backbone.js +25 -0
- data/public/javascripts/custom.js +2 -0
- data/public/javascripts/jquery.js +154 -0
- data/public/javascripts/login.js +24 -0
- data/public/javascripts/rails.js +132 -0
- data/public/jqueryui/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/public/jqueryui/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/public/jqueryui/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/public/jqueryui/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/public/jqueryui/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/public/jqueryui/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/public/jqueryui/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/public/jqueryui/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/public/jqueryui/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/public/jqueryui/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/public/jqueryui/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/public/jqueryui/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- data/public/jqueryui/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/public/jqueryui/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/public/jqueryui/css/ui-lightness/jquery-ui-1.8.18.custom.css +336 -0
- data/public/jqueryui/development-bundle/AUTHORS.txt +30 -0
- data/public/jqueryui/development-bundle/GPL-LICENSE.txt +278 -0
- data/public/jqueryui/development-bundle/MIT-LICENSE.txt +25 -0
- data/public/jqueryui/development-bundle/demos/demos.css +334 -0
- data/public/jqueryui/development-bundle/demos/dialog/animated.html +56 -0
- data/public/jqueryui/development-bundle/demos/dialog/default.html +54 -0
- data/public/jqueryui/development-bundle/demos/dialog/index.html +23 -0
- data/public/jqueryui/development-bundle/demos/dialog/modal-confirmation.html +69 -0
- data/public/jqueryui/development-bundle/demos/dialog/modal-form.html +167 -0
- data/public/jqueryui/development-bundle/demos/dialog/modal-message.html +71 -0
- data/public/jqueryui/development-bundle/demos/dialog/modal.html +60 -0
- data/public/jqueryui/development-bundle/demos/draggable/constrain-movement.html +69 -0
- data/public/jqueryui/development-bundle/demos/draggable/cursor-style.html +49 -0
- data/public/jqueryui/development-bundle/demos/draggable/default.html +39 -0
- data/public/jqueryui/development-bundle/demos/draggable/delay-start.html +45 -0
- data/public/jqueryui/development-bundle/demos/draggable/events.html +77 -0
- data/public/jqueryui/development-bundle/demos/draggable/handle.html +50 -0
- data/public/jqueryui/development-bundle/demos/draggable/index.html +28 -0
- data/public/jqueryui/development-bundle/demos/draggable/revert.html +44 -0
- data/public/jqueryui/development-bundle/demos/draggable/scroll.html +51 -0
- data/public/jqueryui/development-bundle/demos/draggable/snap-to.html +68 -0
- data/public/jqueryui/development-bundle/demos/draggable/sortable.html +57 -0
- data/public/jqueryui/development-bundle/demos/draggable/visual-feedback.html +77 -0
- data/public/jqueryui/development-bundle/demos/droppable/accepted-elements.html +60 -0
- data/public/jqueryui/development-bundle/demos/droppable/default.html +53 -0
- data/public/jqueryui/development-bundle/demos/droppable/images/high_tatras.jpg +0 -0
- data/public/jqueryui/development-bundle/demos/droppable/images/high_tatras2.jpg +0 -0
- data/public/jqueryui/development-bundle/demos/droppable/images/high_tatras2_min.jpg +0 -0
- data/public/jqueryui/development-bundle/demos/droppable/images/high_tatras3.jpg +0 -0
- data/public/jqueryui/development-bundle/demos/droppable/images/high_tatras3_min.jpg +0 -0
- data/public/jqueryui/development-bundle/demos/droppable/images/high_tatras4.jpg +0 -0
- data/public/jqueryui/development-bundle/demos/droppable/images/high_tatras4_min.jpg +0 -0
- data/public/jqueryui/development-bundle/demos/droppable/images/high_tatras_min.jpg +0 -0
- data/public/jqueryui/development-bundle/demos/droppable/index.html +24 -0
- data/public/jqueryui/development-bundle/demos/droppable/photo-manager.html +184 -0
- data/public/jqueryui/development-bundle/demos/droppable/propagation.html +80 -0
- data/public/jqueryui/development-bundle/demos/droppable/revert.html +61 -0
- data/public/jqueryui/development-bundle/demos/droppable/shopping-cart.html +101 -0
- data/public/jqueryui/development-bundle/demos/droppable/visual-feedback.html +78 -0
- data/public/jqueryui/development-bundle/demos/images/calendar.gif +0 -0
- data/public/jqueryui/development-bundle/demos/images/demo-config-on-tile.gif +0 -0
- data/public/jqueryui/development-bundle/demos/images/demo-config-on.gif +0 -0
- data/public/jqueryui/development-bundle/demos/images/demo-spindown-closed.gif +0 -0
- data/public/jqueryui/development-bundle/demos/images/demo-spindown-open.gif +0 -0
- data/public/jqueryui/development-bundle/demos/images/icon-docs-info.gif +0 -0
- data/public/jqueryui/development-bundle/demos/images/pbar-ani.gif +0 -0
- data/public/jqueryui/development-bundle/demos/index.html +328 -0
- data/public/jqueryui/development-bundle/demos/position/cycler.html +122 -0
- data/public/jqueryui/development-bundle/demos/position/default.html +153 -0
- data/public/jqueryui/development-bundle/demos/position/images/earth.jpg +0 -0
- data/public/jqueryui/development-bundle/demos/position/images/flight.jpg +0 -0
- data/public/jqueryui/development-bundle/demos/position/images/rocket.jpg +0 -0
- data/public/jqueryui/development-bundle/demos/position/index.html +19 -0
- data/public/jqueryui/development-bundle/demos/resizable/animate.html +43 -0
- data/public/jqueryui/development-bundle/demos/resizable/aspect-ratio.html +42 -0
- data/public/jqueryui/development-bundle/demos/resizable/constrain-area.html +47 -0
- data/public/jqueryui/development-bundle/demos/resizable/default.html +40 -0
- data/public/jqueryui/development-bundle/demos/resizable/delay-start.html +52 -0
- data/public/jqueryui/development-bundle/demos/resizable/helper.html +43 -0
- data/public/jqueryui/development-bundle/demos/resizable/index.html +28 -0
- data/public/jqueryui/development-bundle/demos/resizable/max-min.html +45 -0
- data/public/jqueryui/development-bundle/demos/resizable/snap-to-grid.html +42 -0
- data/public/jqueryui/development-bundle/demos/resizable/synchronous-resize.html +49 -0
- data/public/jqueryui/development-bundle/demos/resizable/textarea.html +41 -0
- data/public/jqueryui/development-bundle/demos/resizable/visual-feedback.html +43 -0
- data/public/jqueryui/development-bundle/demos/selectable/default.html +50 -0
- data/public/jqueryui/development-bundle/demos/selectable/display-grid.html +55 -0
- data/public/jqueryui/development-bundle/demos/selectable/index.html +20 -0
- data/public/jqueryui/development-bundle/demos/selectable/serialize.html +61 -0
- data/public/jqueryui/development-bundle/demos/sortable/connect-lists-through-tabs.html +78 -0
- data/public/jqueryui/development-bundle/demos/sortable/connect-lists.html +58 -0
- data/public/jqueryui/development-bundle/demos/sortable/default.html +51 -0
- data/public/jqueryui/development-bundle/demos/sortable/delay-start.html +67 -0
- data/public/jqueryui/development-bundle/demos/sortable/display-grid.html +54 -0
- data/public/jqueryui/development-bundle/demos/sortable/empty-lists.html +69 -0
- data/public/jqueryui/development-bundle/demos/sortable/index.html +26 -0
- data/public/jqueryui/development-bundle/demos/sortable/items.html +70 -0
- data/public/jqueryui/development-bundle/demos/sortable/placeholder.html +56 -0
- data/public/jqueryui/development-bundle/demos/sortable/portlets.html +96 -0
- data/public/jqueryui/development-bundle/docs/dialog.html +1698 -0
- data/public/jqueryui/development-bundle/docs/draggable.html +1577 -0
- data/public/jqueryui/development-bundle/docs/droppable.html +829 -0
- data/public/jqueryui/development-bundle/docs/position.html +245 -0
- data/public/jqueryui/development-bundle/docs/resizable.html +1201 -0
- data/public/jqueryui/development-bundle/docs/selectable.html +848 -0
- data/public/jqueryui/development-bundle/docs/sortable.html +1953 -0
- data/public/jqueryui/development-bundle/external/jquery.bgiframe-2.1.2.js +39 -0
- data/public/jqueryui/development-bundle/external/jquery.cookie.js +89 -0
- data/public/jqueryui/development-bundle/external/jquery.metadata.js +122 -0
- data/public/jqueryui/development-bundle/external/qunit.css +225 -0
- data/public/jqueryui/development-bundle/external/qunit.js +1448 -0
- data/public/jqueryui/development-bundle/jquery-1.7.1.js +9266 -0
- data/public/jqueryui/development-bundle/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/public/jqueryui/development-bundle/themes/base/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/public/jqueryui/development-bundle/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/public/jqueryui/development-bundle/themes/base/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/public/jqueryui/development-bundle/themes/base/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/public/jqueryui/development-bundle/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/public/jqueryui/development-bundle/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/public/jqueryui/development-bundle/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/public/jqueryui/development-bundle/themes/base/images/ui-icons_222222_256x240.png +0 -0
- data/public/jqueryui/development-bundle/themes/base/images/ui-icons_2e83ff_256x240.png +0 -0
- data/public/jqueryui/development-bundle/themes/base/images/ui-icons_454545_256x240.png +0 -0
- data/public/jqueryui/development-bundle/themes/base/images/ui-icons_888888_256x240.png +0 -0
- data/public/jqueryui/development-bundle/themes/base/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/public/jqueryui/development-bundle/themes/base/jquery.ui.all.css +11 -0
- data/public/jqueryui/development-bundle/themes/base/jquery.ui.base.css +4 -0
- data/public/jqueryui/development-bundle/themes/base/jquery.ui.core.css +38 -0
- data/public/jqueryui/development-bundle/themes/base/jquery.ui.dialog.css +21 -0
- data/public/jqueryui/development-bundle/themes/base/jquery.ui.resizable.css +20 -0
- data/public/jqueryui/development-bundle/themes/base/jquery.ui.selectable.css +10 -0
- data/public/jqueryui/development-bundle/themes/base/jquery.ui.theme.css +247 -0
- data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/public/jqueryui/development-bundle/themes/ui-lightness/jquery-ui-1.8.18.custom.css +336 -0
- data/public/jqueryui/development-bundle/themes/ui-lightness/jquery.ui.all.css +11 -0
- data/public/jqueryui/development-bundle/themes/ui-lightness/jquery.ui.base.css +4 -0
- data/public/jqueryui/development-bundle/themes/ui-lightness/jquery.ui.core.css +38 -0
- data/public/jqueryui/development-bundle/themes/ui-lightness/jquery.ui.dialog.css +21 -0
- data/public/jqueryui/development-bundle/themes/ui-lightness/jquery.ui.resizable.css +20 -0
- data/public/jqueryui/development-bundle/themes/ui-lightness/jquery.ui.selectable.css +10 -0
- data/public/jqueryui/development-bundle/themes/ui-lightness/jquery.ui.theme.css +249 -0
- data/public/jqueryui/development-bundle/ui/jquery-ui-1.8.18.custom.js +5206 -0
- data/public/jqueryui/development-bundle/ui/jquery.ui.core.js +319 -0
- data/public/jqueryui/development-bundle/ui/jquery.ui.dialog.js +878 -0
- data/public/jqueryui/development-bundle/ui/jquery.ui.draggable.js +825 -0
- data/public/jqueryui/development-bundle/ui/jquery.ui.droppable.js +296 -0
- data/public/jqueryui/development-bundle/ui/jquery.ui.mouse.js +162 -0
- data/public/jqueryui/development-bundle/ui/jquery.ui.position.js +298 -0
- data/public/jqueryui/development-bundle/ui/jquery.ui.resizable.js +808 -0
- data/public/jqueryui/development-bundle/ui/jquery.ui.selectable.js +267 -0
- data/public/jqueryui/development-bundle/ui/jquery.ui.sortable.js +1081 -0
- data/public/jqueryui/development-bundle/ui/jquery.ui.widget.js +272 -0
- data/public/jqueryui/development-bundle/ui/minified/jquery.ui.core.min.js +9 -0
- data/public/jqueryui/development-bundle/ui/minified/jquery.ui.dialog.min.js +18 -0
- data/public/jqueryui/development-bundle/ui/minified/jquery.ui.draggable.min.js +14 -0
- data/public/jqueryui/development-bundle/ui/minified/jquery.ui.droppable.min.js +15 -0
- data/public/jqueryui/development-bundle/ui/minified/jquery.ui.mouse.min.js +12 -0
- data/public/jqueryui/development-bundle/ui/minified/jquery.ui.position.min.js +9 -0
- data/public/jqueryui/development-bundle/ui/minified/jquery.ui.resizable.min.js +14 -0
- data/public/jqueryui/development-bundle/ui/minified/jquery.ui.selectable.min.js +14 -0
- data/public/jqueryui/development-bundle/ui/minified/jquery.ui.sortable.min.js +14 -0
- data/public/jqueryui/development-bundle/ui/minified/jquery.ui.widget.min.js +9 -0
- data/public/jqueryui/development-bundle/version.txt +1 -0
- data/public/jqueryui/js/jquery-1.7.1.min.js +4 -0
- data/public/jqueryui/js/jquery-ui-1.8.18.custom.min.js +119 -0
- data/public/robots.txt +5 -0
- data/public/stylesheets/custom.css +91 -0
- data/public/stylesheets/custom.css~ +82 -0
- data/public/stylesheets/elements.css +315 -0
- data/public/stylesheets/elements.css~ +307 -0
- data/public/stylesheets/login.css +137 -0
- data/public/stylesheets/login.css~ +137 -0
- data/public/stylesheets/screen.css +224 -0
- data/public/stylesheets/screen.css~ +224 -0
- data/script/rails +6 -0
- data/test/fixtures/bolt/groups.yml +7 -0
- data/test/fixtures/bolt/users_groups.yml +9 -0
- data/test/fixtures/media.yml +13 -0
- data/test/fixtures/media_images.yml +9 -0
- data/test/functional/bolt/groups_controller_test.rb +49 -0
- data/test/functional/bolt/users_groups_controller_test.rb +49 -0
- data/test/functional/media_controller_test.rb +49 -0
- data/test/performance/browsing_test.rb +12 -0
- data/test/test_helper.rb +13 -0
- data/test/unit/bolt/group_test.rb +7 -0
- data/test/unit/bolt/users_group_test.rb +7 -0
- data/test/unit/helpers/bolt/groups_helper_test.rb +4 -0
- data/test/unit/helpers/bolt/users_groups_helper_test.rb +4 -0
- data/test/unit/helpers/media_helper_test.rb +4 -0
- data/test/unit/media_images_test.rb +7 -0
- data/test/unit/medium_test.rb +7 -0
- metadata +716 -0
@@ -0,0 +1,298 @@
|
|
1
|
+
/*
|
2
|
+
* jQuery UI Position 1.8.18
|
3
|
+
*
|
4
|
+
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
5
|
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
6
|
+
* http://jquery.org/license
|
7
|
+
*
|
8
|
+
* http://docs.jquery.com/UI/Position
|
9
|
+
*/
|
10
|
+
(function( $, undefined ) {
|
11
|
+
|
12
|
+
$.ui = $.ui || {};
|
13
|
+
|
14
|
+
var horizontalPositions = /left|center|right/,
|
15
|
+
verticalPositions = /top|center|bottom/,
|
16
|
+
center = "center",
|
17
|
+
support = {},
|
18
|
+
_position = $.fn.position,
|
19
|
+
_offset = $.fn.offset;
|
20
|
+
|
21
|
+
$.fn.position = function( options ) {
|
22
|
+
if ( !options || !options.of ) {
|
23
|
+
return _position.apply( this, arguments );
|
24
|
+
}
|
25
|
+
|
26
|
+
// make a copy, we don't want to modify arguments
|
27
|
+
options = $.extend( {}, options );
|
28
|
+
|
29
|
+
var target = $( options.of ),
|
30
|
+
targetElem = target[0],
|
31
|
+
collision = ( options.collision || "flip" ).split( " " ),
|
32
|
+
offset = options.offset ? options.offset.split( " " ) : [ 0, 0 ],
|
33
|
+
targetWidth,
|
34
|
+
targetHeight,
|
35
|
+
basePosition;
|
36
|
+
|
37
|
+
if ( targetElem.nodeType === 9 ) {
|
38
|
+
targetWidth = target.width();
|
39
|
+
targetHeight = target.height();
|
40
|
+
basePosition = { top: 0, left: 0 };
|
41
|
+
// TODO: use $.isWindow() in 1.9
|
42
|
+
} else if ( targetElem.setTimeout ) {
|
43
|
+
targetWidth = target.width();
|
44
|
+
targetHeight = target.height();
|
45
|
+
basePosition = { top: target.scrollTop(), left: target.scrollLeft() };
|
46
|
+
} else if ( targetElem.preventDefault ) {
|
47
|
+
// force left top to allow flipping
|
48
|
+
options.at = "left top";
|
49
|
+
targetWidth = targetHeight = 0;
|
50
|
+
basePosition = { top: options.of.pageY, left: options.of.pageX };
|
51
|
+
} else {
|
52
|
+
targetWidth = target.outerWidth();
|
53
|
+
targetHeight = target.outerHeight();
|
54
|
+
basePosition = target.offset();
|
55
|
+
}
|
56
|
+
|
57
|
+
// force my and at to have valid horizontal and veritcal positions
|
58
|
+
// if a value is missing or invalid, it will be converted to center
|
59
|
+
$.each( [ "my", "at" ], function() {
|
60
|
+
var pos = ( options[this] || "" ).split( " " );
|
61
|
+
if ( pos.length === 1) {
|
62
|
+
pos = horizontalPositions.test( pos[0] ) ?
|
63
|
+
pos.concat( [center] ) :
|
64
|
+
verticalPositions.test( pos[0] ) ?
|
65
|
+
[ center ].concat( pos ) :
|
66
|
+
[ center, center ];
|
67
|
+
}
|
68
|
+
pos[ 0 ] = horizontalPositions.test( pos[0] ) ? pos[ 0 ] : center;
|
69
|
+
pos[ 1 ] = verticalPositions.test( pos[1] ) ? pos[ 1 ] : center;
|
70
|
+
options[ this ] = pos;
|
71
|
+
});
|
72
|
+
|
73
|
+
// normalize collision option
|
74
|
+
if ( collision.length === 1 ) {
|
75
|
+
collision[ 1 ] = collision[ 0 ];
|
76
|
+
}
|
77
|
+
|
78
|
+
// normalize offset option
|
79
|
+
offset[ 0 ] = parseInt( offset[0], 10 ) || 0;
|
80
|
+
if ( offset.length === 1 ) {
|
81
|
+
offset[ 1 ] = offset[ 0 ];
|
82
|
+
}
|
83
|
+
offset[ 1 ] = parseInt( offset[1], 10 ) || 0;
|
84
|
+
|
85
|
+
if ( options.at[0] === "right" ) {
|
86
|
+
basePosition.left += targetWidth;
|
87
|
+
} else if ( options.at[0] === center ) {
|
88
|
+
basePosition.left += targetWidth / 2;
|
89
|
+
}
|
90
|
+
|
91
|
+
if ( options.at[1] === "bottom" ) {
|
92
|
+
basePosition.top += targetHeight;
|
93
|
+
} else if ( options.at[1] === center ) {
|
94
|
+
basePosition.top += targetHeight / 2;
|
95
|
+
}
|
96
|
+
|
97
|
+
basePosition.left += offset[ 0 ];
|
98
|
+
basePosition.top += offset[ 1 ];
|
99
|
+
|
100
|
+
return this.each(function() {
|
101
|
+
var elem = $( this ),
|
102
|
+
elemWidth = elem.outerWidth(),
|
103
|
+
elemHeight = elem.outerHeight(),
|
104
|
+
marginLeft = parseInt( $.curCSS( this, "marginLeft", true ) ) || 0,
|
105
|
+
marginTop = parseInt( $.curCSS( this, "marginTop", true ) ) || 0,
|
106
|
+
collisionWidth = elemWidth + marginLeft +
|
107
|
+
( parseInt( $.curCSS( this, "marginRight", true ) ) || 0 ),
|
108
|
+
collisionHeight = elemHeight + marginTop +
|
109
|
+
( parseInt( $.curCSS( this, "marginBottom", true ) ) || 0 ),
|
110
|
+
position = $.extend( {}, basePosition ),
|
111
|
+
collisionPosition;
|
112
|
+
|
113
|
+
if ( options.my[0] === "right" ) {
|
114
|
+
position.left -= elemWidth;
|
115
|
+
} else if ( options.my[0] === center ) {
|
116
|
+
position.left -= elemWidth / 2;
|
117
|
+
}
|
118
|
+
|
119
|
+
if ( options.my[1] === "bottom" ) {
|
120
|
+
position.top -= elemHeight;
|
121
|
+
} else if ( options.my[1] === center ) {
|
122
|
+
position.top -= elemHeight / 2;
|
123
|
+
}
|
124
|
+
|
125
|
+
// prevent fractions if jQuery version doesn't support them (see #5280)
|
126
|
+
if ( !support.fractions ) {
|
127
|
+
position.left = Math.round( position.left );
|
128
|
+
position.top = Math.round( position.top );
|
129
|
+
}
|
130
|
+
|
131
|
+
collisionPosition = {
|
132
|
+
left: position.left - marginLeft,
|
133
|
+
top: position.top - marginTop
|
134
|
+
};
|
135
|
+
|
136
|
+
$.each( [ "left", "top" ], function( i, dir ) {
|
137
|
+
if ( $.ui.position[ collision[i] ] ) {
|
138
|
+
$.ui.position[ collision[i] ][ dir ]( position, {
|
139
|
+
targetWidth: targetWidth,
|
140
|
+
targetHeight: targetHeight,
|
141
|
+
elemWidth: elemWidth,
|
142
|
+
elemHeight: elemHeight,
|
143
|
+
collisionPosition: collisionPosition,
|
144
|
+
collisionWidth: collisionWidth,
|
145
|
+
collisionHeight: collisionHeight,
|
146
|
+
offset: offset,
|
147
|
+
my: options.my,
|
148
|
+
at: options.at
|
149
|
+
});
|
150
|
+
}
|
151
|
+
});
|
152
|
+
|
153
|
+
if ( $.fn.bgiframe ) {
|
154
|
+
elem.bgiframe();
|
155
|
+
}
|
156
|
+
elem.offset( $.extend( position, { using: options.using } ) );
|
157
|
+
});
|
158
|
+
};
|
159
|
+
|
160
|
+
$.ui.position = {
|
161
|
+
fit: {
|
162
|
+
left: function( position, data ) {
|
163
|
+
var win = $( window ),
|
164
|
+
over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft();
|
165
|
+
position.left = over > 0 ? position.left - over : Math.max( position.left - data.collisionPosition.left, position.left );
|
166
|
+
},
|
167
|
+
top: function( position, data ) {
|
168
|
+
var win = $( window ),
|
169
|
+
over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop();
|
170
|
+
position.top = over > 0 ? position.top - over : Math.max( position.top - data.collisionPosition.top, position.top );
|
171
|
+
}
|
172
|
+
},
|
173
|
+
|
174
|
+
flip: {
|
175
|
+
left: function( position, data ) {
|
176
|
+
if ( data.at[0] === center ) {
|
177
|
+
return;
|
178
|
+
}
|
179
|
+
var win = $( window ),
|
180
|
+
over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft(),
|
181
|
+
myOffset = data.my[ 0 ] === "left" ?
|
182
|
+
-data.elemWidth :
|
183
|
+
data.my[ 0 ] === "right" ?
|
184
|
+
data.elemWidth :
|
185
|
+
0,
|
186
|
+
atOffset = data.at[ 0 ] === "left" ?
|
187
|
+
data.targetWidth :
|
188
|
+
-data.targetWidth,
|
189
|
+
offset = -2 * data.offset[ 0 ];
|
190
|
+
position.left += data.collisionPosition.left < 0 ?
|
191
|
+
myOffset + atOffset + offset :
|
192
|
+
over > 0 ?
|
193
|
+
myOffset + atOffset + offset :
|
194
|
+
0;
|
195
|
+
},
|
196
|
+
top: function( position, data ) {
|
197
|
+
if ( data.at[1] === center ) {
|
198
|
+
return;
|
199
|
+
}
|
200
|
+
var win = $( window ),
|
201
|
+
over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop(),
|
202
|
+
myOffset = data.my[ 1 ] === "top" ?
|
203
|
+
-data.elemHeight :
|
204
|
+
data.my[ 1 ] === "bottom" ?
|
205
|
+
data.elemHeight :
|
206
|
+
0,
|
207
|
+
atOffset = data.at[ 1 ] === "top" ?
|
208
|
+
data.targetHeight :
|
209
|
+
-data.targetHeight,
|
210
|
+
offset = -2 * data.offset[ 1 ];
|
211
|
+
position.top += data.collisionPosition.top < 0 ?
|
212
|
+
myOffset + atOffset + offset :
|
213
|
+
over > 0 ?
|
214
|
+
myOffset + atOffset + offset :
|
215
|
+
0;
|
216
|
+
}
|
217
|
+
}
|
218
|
+
};
|
219
|
+
|
220
|
+
// offset setter from jQuery 1.4
|
221
|
+
if ( !$.offset.setOffset ) {
|
222
|
+
$.offset.setOffset = function( elem, options ) {
|
223
|
+
// set position first, in-case top/left are set even on static elem
|
224
|
+
if ( /static/.test( $.curCSS( elem, "position" ) ) ) {
|
225
|
+
elem.style.position = "relative";
|
226
|
+
}
|
227
|
+
var curElem = $( elem ),
|
228
|
+
curOffset = curElem.offset(),
|
229
|
+
curTop = parseInt( $.curCSS( elem, "top", true ), 10 ) || 0,
|
230
|
+
curLeft = parseInt( $.curCSS( elem, "left", true ), 10) || 0,
|
231
|
+
props = {
|
232
|
+
top: (options.top - curOffset.top) + curTop,
|
233
|
+
left: (options.left - curOffset.left) + curLeft
|
234
|
+
};
|
235
|
+
|
236
|
+
if ( 'using' in options ) {
|
237
|
+
options.using.call( elem, props );
|
238
|
+
} else {
|
239
|
+
curElem.css( props );
|
240
|
+
}
|
241
|
+
};
|
242
|
+
|
243
|
+
$.fn.offset = function( options ) {
|
244
|
+
var elem = this[ 0 ];
|
245
|
+
if ( !elem || !elem.ownerDocument ) { return null; }
|
246
|
+
if ( options ) {
|
247
|
+
return this.each(function() {
|
248
|
+
$.offset.setOffset( this, options );
|
249
|
+
});
|
250
|
+
}
|
251
|
+
return _offset.call( this );
|
252
|
+
};
|
253
|
+
}
|
254
|
+
|
255
|
+
// fraction support test (older versions of jQuery don't support fractions)
|
256
|
+
(function () {
|
257
|
+
var body = document.getElementsByTagName( "body" )[ 0 ],
|
258
|
+
div = document.createElement( "div" ),
|
259
|
+
testElement, testElementParent, testElementStyle, offset, offsetTotal;
|
260
|
+
|
261
|
+
//Create a "fake body" for testing based on method used in jQuery.support
|
262
|
+
testElement = document.createElement( body ? "div" : "body" );
|
263
|
+
testElementStyle = {
|
264
|
+
visibility: "hidden",
|
265
|
+
width: 0,
|
266
|
+
height: 0,
|
267
|
+
border: 0,
|
268
|
+
margin: 0,
|
269
|
+
background: "none"
|
270
|
+
};
|
271
|
+
if ( body ) {
|
272
|
+
$.extend( testElementStyle, {
|
273
|
+
position: "absolute",
|
274
|
+
left: "-1000px",
|
275
|
+
top: "-1000px"
|
276
|
+
});
|
277
|
+
}
|
278
|
+
for ( var i in testElementStyle ) {
|
279
|
+
testElement.style[ i ] = testElementStyle[ i ];
|
280
|
+
}
|
281
|
+
testElement.appendChild( div );
|
282
|
+
testElementParent = body || document.documentElement;
|
283
|
+
testElementParent.insertBefore( testElement, testElementParent.firstChild );
|
284
|
+
|
285
|
+
div.style.cssText = "position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;";
|
286
|
+
|
287
|
+
offset = $( div ).offset( function( _, offset ) {
|
288
|
+
return offset;
|
289
|
+
}).offset();
|
290
|
+
|
291
|
+
testElement.innerHTML = "";
|
292
|
+
testElementParent.removeChild( testElement );
|
293
|
+
|
294
|
+
offsetTotal = offset.top + offset.left + ( body ? 2000 : 0 );
|
295
|
+
support.fractions = offsetTotal > 21 && offsetTotal < 22;
|
296
|
+
})();
|
297
|
+
|
298
|
+
}( jQuery ));
|
@@ -0,0 +1,808 @@
|
|
1
|
+
/*
|
2
|
+
* jQuery UI Resizable 1.8.18
|
3
|
+
*
|
4
|
+
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
5
|
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
6
|
+
* http://jquery.org/license
|
7
|
+
*
|
8
|
+
* http://docs.jquery.com/UI/Resizables
|
9
|
+
*
|
10
|
+
* Depends:
|
11
|
+
* jquery.ui.core.js
|
12
|
+
* jquery.ui.mouse.js
|
13
|
+
* jquery.ui.widget.js
|
14
|
+
*/
|
15
|
+
(function( $, undefined ) {
|
16
|
+
|
17
|
+
$.widget("ui.resizable", $.ui.mouse, {
|
18
|
+
widgetEventPrefix: "resize",
|
19
|
+
options: {
|
20
|
+
alsoResize: false,
|
21
|
+
animate: false,
|
22
|
+
animateDuration: "slow",
|
23
|
+
animateEasing: "swing",
|
24
|
+
aspectRatio: false,
|
25
|
+
autoHide: false,
|
26
|
+
containment: false,
|
27
|
+
ghost: false,
|
28
|
+
grid: false,
|
29
|
+
handles: "e,s,se",
|
30
|
+
helper: false,
|
31
|
+
maxHeight: null,
|
32
|
+
maxWidth: null,
|
33
|
+
minHeight: 10,
|
34
|
+
minWidth: 10,
|
35
|
+
zIndex: 1000
|
36
|
+
},
|
37
|
+
_create: function() {
|
38
|
+
|
39
|
+
var self = this, o = this.options;
|
40
|
+
this.element.addClass("ui-resizable");
|
41
|
+
|
42
|
+
$.extend(this, {
|
43
|
+
_aspectRatio: !!(o.aspectRatio),
|
44
|
+
aspectRatio: o.aspectRatio,
|
45
|
+
originalElement: this.element,
|
46
|
+
_proportionallyResizeElements: [],
|
47
|
+
_helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null
|
48
|
+
});
|
49
|
+
|
50
|
+
//Wrap the element if it cannot hold child nodes
|
51
|
+
if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) {
|
52
|
+
|
53
|
+
//Create a wrapper element and set the wrapper to the new current internal element
|
54
|
+
this.element.wrap(
|
55
|
+
$('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({
|
56
|
+
position: this.element.css('position'),
|
57
|
+
width: this.element.outerWidth(),
|
58
|
+
height: this.element.outerHeight(),
|
59
|
+
top: this.element.css('top'),
|
60
|
+
left: this.element.css('left')
|
61
|
+
})
|
62
|
+
);
|
63
|
+
|
64
|
+
//Overwrite the original this.element
|
65
|
+
this.element = this.element.parent().data(
|
66
|
+
"resizable", this.element.data('resizable')
|
67
|
+
);
|
68
|
+
|
69
|
+
this.elementIsWrapper = true;
|
70
|
+
|
71
|
+
//Move margins to the wrapper
|
72
|
+
this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") });
|
73
|
+
this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0});
|
74
|
+
|
75
|
+
//Prevent Safari textarea resize
|
76
|
+
this.originalResizeStyle = this.originalElement.css('resize');
|
77
|
+
this.originalElement.css('resize', 'none');
|
78
|
+
|
79
|
+
//Push the actual element to our proportionallyResize internal array
|
80
|
+
this._proportionallyResizeElements.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' }));
|
81
|
+
|
82
|
+
// avoid IE jump (hard set the margin)
|
83
|
+
this.originalElement.css({ margin: this.originalElement.css('margin') });
|
84
|
+
|
85
|
+
// fix handlers offset
|
86
|
+
this._proportionallyResize();
|
87
|
+
|
88
|
+
}
|
89
|
+
|
90
|
+
this.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' });
|
91
|
+
if(this.handles.constructor == String) {
|
92
|
+
|
93
|
+
if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw';
|
94
|
+
var n = this.handles.split(","); this.handles = {};
|
95
|
+
|
96
|
+
for(var i = 0; i < n.length; i++) {
|
97
|
+
|
98
|
+
var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle;
|
99
|
+
var axis = $('<div class="ui-resizable-handle ' + hname + '"></div>');
|
100
|
+
|
101
|
+
// increase zIndex of sw, se, ne, nw axis
|
102
|
+
//TODO : this modifies original option
|
103
|
+
if(/sw|se|ne|nw/.test(handle)) axis.css({ zIndex: ++o.zIndex });
|
104
|
+
|
105
|
+
//TODO : What's going on here?
|
106
|
+
if ('se' == handle) {
|
107
|
+
axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se');
|
108
|
+
};
|
109
|
+
|
110
|
+
//Insert into internal handles object and append to element
|
111
|
+
this.handles[handle] = '.ui-resizable-'+handle;
|
112
|
+
this.element.append(axis);
|
113
|
+
}
|
114
|
+
|
115
|
+
}
|
116
|
+
|
117
|
+
this._renderAxis = function(target) {
|
118
|
+
|
119
|
+
target = target || this.element;
|
120
|
+
|
121
|
+
for(var i in this.handles) {
|
122
|
+
|
123
|
+
if(this.handles[i].constructor == String)
|
124
|
+
this.handles[i] = $(this.handles[i], this.element).show();
|
125
|
+
|
126
|
+
//Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls)
|
127
|
+
if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) {
|
128
|
+
|
129
|
+
var axis = $(this.handles[i], this.element), padWrapper = 0;
|
130
|
+
|
131
|
+
//Checking the correct pad and border
|
132
|
+
padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
|
133
|
+
|
134
|
+
//The padding type i have to apply...
|
135
|
+
var padPos = [ 'padding',
|
136
|
+
/ne|nw|n/.test(i) ? 'Top' :
|
137
|
+
/se|sw|s/.test(i) ? 'Bottom' :
|
138
|
+
/^e$/.test(i) ? 'Right' : 'Left' ].join("");
|
139
|
+
|
140
|
+
target.css(padPos, padWrapper);
|
141
|
+
|
142
|
+
this._proportionallyResize();
|
143
|
+
|
144
|
+
}
|
145
|
+
|
146
|
+
//TODO: What's that good for? There's not anything to be executed left
|
147
|
+
if(!$(this.handles[i]).length)
|
148
|
+
continue;
|
149
|
+
|
150
|
+
}
|
151
|
+
};
|
152
|
+
|
153
|
+
//TODO: make renderAxis a prototype function
|
154
|
+
this._renderAxis(this.element);
|
155
|
+
|
156
|
+
this._handles = $('.ui-resizable-handle', this.element)
|
157
|
+
.disableSelection();
|
158
|
+
|
159
|
+
//Matching axis name
|
160
|
+
this._handles.mouseover(function() {
|
161
|
+
if (!self.resizing) {
|
162
|
+
if (this.className)
|
163
|
+
var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
|
164
|
+
//Axis, default = se
|
165
|
+
self.axis = axis && axis[1] ? axis[1] : 'se';
|
166
|
+
}
|
167
|
+
});
|
168
|
+
|
169
|
+
//If we want to auto hide the elements
|
170
|
+
if (o.autoHide) {
|
171
|
+
this._handles.hide();
|
172
|
+
$(this.element)
|
173
|
+
.addClass("ui-resizable-autohide")
|
174
|
+
.hover(function() {
|
175
|
+
if (o.disabled) return;
|
176
|
+
$(this).removeClass("ui-resizable-autohide");
|
177
|
+
self._handles.show();
|
178
|
+
},
|
179
|
+
function(){
|
180
|
+
if (o.disabled) return;
|
181
|
+
if (!self.resizing) {
|
182
|
+
$(this).addClass("ui-resizable-autohide");
|
183
|
+
self._handles.hide();
|
184
|
+
}
|
185
|
+
});
|
186
|
+
}
|
187
|
+
|
188
|
+
//Initialize the mouse interaction
|
189
|
+
this._mouseInit();
|
190
|
+
|
191
|
+
},
|
192
|
+
|
193
|
+
destroy: function() {
|
194
|
+
|
195
|
+
this._mouseDestroy();
|
196
|
+
|
197
|
+
var _destroy = function(exp) {
|
198
|
+
$(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
|
199
|
+
.removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove();
|
200
|
+
};
|
201
|
+
|
202
|
+
//TODO: Unwrap at same DOM position
|
203
|
+
if (this.elementIsWrapper) {
|
204
|
+
_destroy(this.element);
|
205
|
+
var wrapper = this.element;
|
206
|
+
wrapper.after(
|
207
|
+
this.originalElement.css({
|
208
|
+
position: wrapper.css('position'),
|
209
|
+
width: wrapper.outerWidth(),
|
210
|
+
height: wrapper.outerHeight(),
|
211
|
+
top: wrapper.css('top'),
|
212
|
+
left: wrapper.css('left')
|
213
|
+
})
|
214
|
+
).remove();
|
215
|
+
}
|
216
|
+
|
217
|
+
this.originalElement.css('resize', this.originalResizeStyle);
|
218
|
+
_destroy(this.originalElement);
|
219
|
+
|
220
|
+
return this;
|
221
|
+
},
|
222
|
+
|
223
|
+
_mouseCapture: function(event) {
|
224
|
+
var handle = false;
|
225
|
+
for (var i in this.handles) {
|
226
|
+
if ($(this.handles[i])[0] == event.target) {
|
227
|
+
handle = true;
|
228
|
+
}
|
229
|
+
}
|
230
|
+
|
231
|
+
return !this.options.disabled && handle;
|
232
|
+
},
|
233
|
+
|
234
|
+
_mouseStart: function(event) {
|
235
|
+
|
236
|
+
var o = this.options, iniPos = this.element.position(), el = this.element;
|
237
|
+
|
238
|
+
this.resizing = true;
|
239
|
+
this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() };
|
240
|
+
|
241
|
+
// bugfix for http://dev.jquery.com/ticket/1749
|
242
|
+
if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) {
|
243
|
+
el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left });
|
244
|
+
}
|
245
|
+
|
246
|
+
this._renderProxy();
|
247
|
+
|
248
|
+
var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top'));
|
249
|
+
|
250
|
+
if (o.containment) {
|
251
|
+
curleft += $(o.containment).scrollLeft() || 0;
|
252
|
+
curtop += $(o.containment).scrollTop() || 0;
|
253
|
+
}
|
254
|
+
|
255
|
+
//Store needed variables
|
256
|
+
this.offset = this.helper.offset();
|
257
|
+
this.position = { left: curleft, top: curtop };
|
258
|
+
this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
|
259
|
+
this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
|
260
|
+
this.originalPosition = { left: curleft, top: curtop };
|
261
|
+
this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() };
|
262
|
+
this.originalMousePosition = { left: event.pageX, top: event.pageY };
|
263
|
+
|
264
|
+
//Aspect Ratio
|
265
|
+
this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1);
|
266
|
+
|
267
|
+
var cursor = $('.ui-resizable-' + this.axis).css('cursor');
|
268
|
+
$('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor);
|
269
|
+
|
270
|
+
el.addClass("ui-resizable-resizing");
|
271
|
+
this._propagate("start", event);
|
272
|
+
return true;
|
273
|
+
},
|
274
|
+
|
275
|
+
_mouseDrag: function(event) {
|
276
|
+
|
277
|
+
//Increase performance, avoid regex
|
278
|
+
var el = this.helper, o = this.options, props = {},
|
279
|
+
self = this, smp = this.originalMousePosition, a = this.axis;
|
280
|
+
|
281
|
+
var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0;
|
282
|
+
var trigger = this._change[a];
|
283
|
+
if (!trigger) return false;
|
284
|
+
|
285
|
+
// Calculate the attrs that will be change
|
286
|
+
var data = trigger.apply(this, [event, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff;
|
287
|
+
|
288
|
+
// Put this in the mouseDrag handler since the user can start pressing shift while resizing
|
289
|
+
this._updateVirtualBoundaries(event.shiftKey);
|
290
|
+
if (this._aspectRatio || event.shiftKey)
|
291
|
+
data = this._updateRatio(data, event);
|
292
|
+
|
293
|
+
data = this._respectSize(data, event);
|
294
|
+
|
295
|
+
// plugins callbacks need to be called first
|
296
|
+
this._propagate("resize", event);
|
297
|
+
|
298
|
+
el.css({
|
299
|
+
top: this.position.top + "px", left: this.position.left + "px",
|
300
|
+
width: this.size.width + "px", height: this.size.height + "px"
|
301
|
+
});
|
302
|
+
|
303
|
+
if (!this._helper && this._proportionallyResizeElements.length)
|
304
|
+
this._proportionallyResize();
|
305
|
+
|
306
|
+
this._updateCache(data);
|
307
|
+
|
308
|
+
// calling the user callback at the end
|
309
|
+
this._trigger('resize', event, this.ui());
|
310
|
+
|
311
|
+
return false;
|
312
|
+
},
|
313
|
+
|
314
|
+
_mouseStop: function(event) {
|
315
|
+
|
316
|
+
this.resizing = false;
|
317
|
+
var o = this.options, self = this;
|
318
|
+
|
319
|
+
if(this._helper) {
|
320
|
+
var pr = this._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),
|
321
|
+
soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
|
322
|
+
soffsetw = ista ? 0 : self.sizeDiff.width;
|
323
|
+
|
324
|
+
var s = { width: (self.helper.width() - soffsetw), height: (self.helper.height() - soffseth) },
|
325
|
+
left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
|
326
|
+
top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;
|
327
|
+
|
328
|
+
if (!o.animate)
|
329
|
+
this.element.css($.extend(s, { top: top, left: left }));
|
330
|
+
|
331
|
+
self.helper.height(self.size.height);
|
332
|
+
self.helper.width(self.size.width);
|
333
|
+
|
334
|
+
if (this._helper && !o.animate) this._proportionallyResize();
|
335
|
+
}
|
336
|
+
|
337
|
+
$('body').css('cursor', 'auto');
|
338
|
+
|
339
|
+
this.element.removeClass("ui-resizable-resizing");
|
340
|
+
|
341
|
+
this._propagate("stop", event);
|
342
|
+
|
343
|
+
if (this._helper) this.helper.remove();
|
344
|
+
return false;
|
345
|
+
|
346
|
+
},
|
347
|
+
|
348
|
+
_updateVirtualBoundaries: function(forceAspectRatio) {
|
349
|
+
var o = this.options, pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b;
|
350
|
+
|
351
|
+
b = {
|
352
|
+
minWidth: isNumber(o.minWidth) ? o.minWidth : 0,
|
353
|
+
maxWidth: isNumber(o.maxWidth) ? o.maxWidth : Infinity,
|
354
|
+
minHeight: isNumber(o.minHeight) ? o.minHeight : 0,
|
355
|
+
maxHeight: isNumber(o.maxHeight) ? o.maxHeight : Infinity
|
356
|
+
};
|
357
|
+
|
358
|
+
if(this._aspectRatio || forceAspectRatio) {
|
359
|
+
// We want to create an enclosing box whose aspect ration is the requested one
|
360
|
+
// First, compute the "projected" size for each dimension based on the aspect ratio and other dimension
|
361
|
+
pMinWidth = b.minHeight * this.aspectRatio;
|
362
|
+
pMinHeight = b.minWidth / this.aspectRatio;
|
363
|
+
pMaxWidth = b.maxHeight * this.aspectRatio;
|
364
|
+
pMaxHeight = b.maxWidth / this.aspectRatio;
|
365
|
+
|
366
|
+
if(pMinWidth > b.minWidth) b.minWidth = pMinWidth;
|
367
|
+
if(pMinHeight > b.minHeight) b.minHeight = pMinHeight;
|
368
|
+
if(pMaxWidth < b.maxWidth) b.maxWidth = pMaxWidth;
|
369
|
+
if(pMaxHeight < b.maxHeight) b.maxHeight = pMaxHeight;
|
370
|
+
}
|
371
|
+
this._vBoundaries = b;
|
372
|
+
},
|
373
|
+
|
374
|
+
_updateCache: function(data) {
|
375
|
+
var o = this.options;
|
376
|
+
this.offset = this.helper.offset();
|
377
|
+
if (isNumber(data.left)) this.position.left = data.left;
|
378
|
+
if (isNumber(data.top)) this.position.top = data.top;
|
379
|
+
if (isNumber(data.height)) this.size.height = data.height;
|
380
|
+
if (isNumber(data.width)) this.size.width = data.width;
|
381
|
+
},
|
382
|
+
|
383
|
+
_updateRatio: function(data, event) {
|
384
|
+
|
385
|
+
var o = this.options, cpos = this.position, csize = this.size, a = this.axis;
|
386
|
+
|
387
|
+
if (isNumber(data.height)) data.width = (data.height * this.aspectRatio);
|
388
|
+
else if (isNumber(data.width)) data.height = (data.width / this.aspectRatio);
|
389
|
+
|
390
|
+
if (a == 'sw') {
|
391
|
+
data.left = cpos.left + (csize.width - data.width);
|
392
|
+
data.top = null;
|
393
|
+
}
|
394
|
+
if (a == 'nw') {
|
395
|
+
data.top = cpos.top + (csize.height - data.height);
|
396
|
+
data.left = cpos.left + (csize.width - data.width);
|
397
|
+
}
|
398
|
+
|
399
|
+
return data;
|
400
|
+
},
|
401
|
+
|
402
|
+
_respectSize: function(data, event) {
|
403
|
+
|
404
|
+
var el = this.helper, o = this._vBoundaries, pRatio = this._aspectRatio || event.shiftKey, a = this.axis,
|
405
|
+
ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
|
406
|
+
isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height);
|
407
|
+
|
408
|
+
if (isminw) data.width = o.minWidth;
|
409
|
+
if (isminh) data.height = o.minHeight;
|
410
|
+
if (ismaxw) data.width = o.maxWidth;
|
411
|
+
if (ismaxh) data.height = o.maxHeight;
|
412
|
+
|
413
|
+
var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height;
|
414
|
+
var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
|
415
|
+
|
416
|
+
if (isminw && cw) data.left = dw - o.minWidth;
|
417
|
+
if (ismaxw && cw) data.left = dw - o.maxWidth;
|
418
|
+
if (isminh && ch) data.top = dh - o.minHeight;
|
419
|
+
if (ismaxh && ch) data.top = dh - o.maxHeight;
|
420
|
+
|
421
|
+
// fixing jump error on top/left - bug #2330
|
422
|
+
var isNotwh = !data.width && !data.height;
|
423
|
+
if (isNotwh && !data.left && data.top) data.top = null;
|
424
|
+
else if (isNotwh && !data.top && data.left) data.left = null;
|
425
|
+
|
426
|
+
return data;
|
427
|
+
},
|
428
|
+
|
429
|
+
_proportionallyResize: function() {
|
430
|
+
|
431
|
+
var o = this.options;
|
432
|
+
if (!this._proportionallyResizeElements.length) return;
|
433
|
+
var element = this.helper || this.element;
|
434
|
+
|
435
|
+
for (var i=0; i < this._proportionallyResizeElements.length; i++) {
|
436
|
+
|
437
|
+
var prel = this._proportionallyResizeElements[i];
|
438
|
+
|
439
|
+
if (!this.borderDif) {
|
440
|
+
var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')],
|
441
|
+
p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')];
|
442
|
+
|
443
|
+
this.borderDif = $.map(b, function(v, i) {
|
444
|
+
var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0;
|
445
|
+
return border + padding;
|
446
|
+
});
|
447
|
+
}
|
448
|
+
|
449
|
+
if ($.browser.msie && !(!($(element).is(':hidden') || $(element).parents(':hidden').length)))
|
450
|
+
continue;
|
451
|
+
|
452
|
+
prel.css({
|
453
|
+
height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0,
|
454
|
+
width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0
|
455
|
+
});
|
456
|
+
|
457
|
+
};
|
458
|
+
|
459
|
+
},
|
460
|
+
|
461
|
+
_renderProxy: function() {
|
462
|
+
|
463
|
+
var el = this.element, o = this.options;
|
464
|
+
this.elementOffset = el.offset();
|
465
|
+
|
466
|
+
if(this._helper) {
|
467
|
+
|
468
|
+
this.helper = this.helper || $('<div style="overflow:hidden;"></div>');
|
469
|
+
|
470
|
+
// fix ie6 offset TODO: This seems broken
|
471
|
+
var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0),
|
472
|
+
pxyoffset = ( ie6 ? 2 : -1 );
|
473
|
+
|
474
|
+
this.helper.addClass(this._helper).css({
|
475
|
+
width: this.element.outerWidth() + pxyoffset,
|
476
|
+
height: this.element.outerHeight() + pxyoffset,
|
477
|
+
position: 'absolute',
|
478
|
+
left: this.elementOffset.left - ie6offset +'px',
|
479
|
+
top: this.elementOffset.top - ie6offset +'px',
|
480
|
+
zIndex: ++o.zIndex //TODO: Don't modify option
|
481
|
+
});
|
482
|
+
|
483
|
+
this.helper
|
484
|
+
.appendTo("body")
|
485
|
+
.disableSelection();
|
486
|
+
|
487
|
+
} else {
|
488
|
+
this.helper = this.element;
|
489
|
+
}
|
490
|
+
|
491
|
+
},
|
492
|
+
|
493
|
+
_change: {
|
494
|
+
e: function(event, dx, dy) {
|
495
|
+
return { width: this.originalSize.width + dx };
|
496
|
+
},
|
497
|
+
w: function(event, dx, dy) {
|
498
|
+
var o = this.options, cs = this.originalSize, sp = this.originalPosition;
|
499
|
+
return { left: sp.left + dx, width: cs.width - dx };
|
500
|
+
},
|
501
|
+
n: function(event, dx, dy) {
|
502
|
+
var o = this.options, cs = this.originalSize, sp = this.originalPosition;
|
503
|
+
return { top: sp.top + dy, height: cs.height - dy };
|
504
|
+
},
|
505
|
+
s: function(event, dx, dy) {
|
506
|
+
return { height: this.originalSize.height + dy };
|
507
|
+
},
|
508
|
+
se: function(event, dx, dy) {
|
509
|
+
return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
|
510
|
+
},
|
511
|
+
sw: function(event, dx, dy) {
|
512
|
+
return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
|
513
|
+
},
|
514
|
+
ne: function(event, dx, dy) {
|
515
|
+
return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
|
516
|
+
},
|
517
|
+
nw: function(event, dx, dy) {
|
518
|
+
return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
|
519
|
+
}
|
520
|
+
},
|
521
|
+
|
522
|
+
_propagate: function(n, event) {
|
523
|
+
$.ui.plugin.call(this, n, [event, this.ui()]);
|
524
|
+
(n != "resize" && this._trigger(n, event, this.ui()));
|
525
|
+
},
|
526
|
+
|
527
|
+
plugins: {},
|
528
|
+
|
529
|
+
ui: function() {
|
530
|
+
return {
|
531
|
+
originalElement: this.originalElement,
|
532
|
+
element: this.element,
|
533
|
+
helper: this.helper,
|
534
|
+
position: this.position,
|
535
|
+
size: this.size,
|
536
|
+
originalSize: this.originalSize,
|
537
|
+
originalPosition: this.originalPosition
|
538
|
+
};
|
539
|
+
}
|
540
|
+
|
541
|
+
});
|
542
|
+
|
543
|
+
$.extend($.ui.resizable, {
|
544
|
+
version: "1.8.18"
|
545
|
+
});
|
546
|
+
|
547
|
+
/*
|
548
|
+
* Resizable Extensions
|
549
|
+
*/
|
550
|
+
|
551
|
+
$.ui.plugin.add("resizable", "alsoResize", {
|
552
|
+
|
553
|
+
start: function (event, ui) {
|
554
|
+
var self = $(this).data("resizable"), o = self.options;
|
555
|
+
|
556
|
+
var _store = function (exp) {
|
557
|
+
$(exp).each(function() {
|
558
|
+
var el = $(this);
|
559
|
+
el.data("resizable-alsoresize", {
|
560
|
+
width: parseInt(el.width(), 10), height: parseInt(el.height(), 10),
|
561
|
+
left: parseInt(el.css('left'), 10), top: parseInt(el.css('top'), 10)
|
562
|
+
});
|
563
|
+
});
|
564
|
+
};
|
565
|
+
|
566
|
+
if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) {
|
567
|
+
if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); }
|
568
|
+
else { $.each(o.alsoResize, function (exp) { _store(exp); }); }
|
569
|
+
}else{
|
570
|
+
_store(o.alsoResize);
|
571
|
+
}
|
572
|
+
},
|
573
|
+
|
574
|
+
resize: function (event, ui) {
|
575
|
+
var self = $(this).data("resizable"), o = self.options, os = self.originalSize, op = self.originalPosition;
|
576
|
+
|
577
|
+
var delta = {
|
578
|
+
height: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0,
|
579
|
+
top: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0
|
580
|
+
},
|
581
|
+
|
582
|
+
_alsoResize = function (exp, c) {
|
583
|
+
$(exp).each(function() {
|
584
|
+
var el = $(this), start = $(this).data("resizable-alsoresize"), style = {},
|
585
|
+
css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ['width', 'height'] : ['width', 'height', 'top', 'left'];
|
586
|
+
|
587
|
+
$.each(css, function (i, prop) {
|
588
|
+
var sum = (start[prop]||0) + (delta[prop]||0);
|
589
|
+
if (sum && sum >= 0)
|
590
|
+
style[prop] = sum || null;
|
591
|
+
});
|
592
|
+
|
593
|
+
el.css(style);
|
594
|
+
});
|
595
|
+
};
|
596
|
+
|
597
|
+
if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) {
|
598
|
+
$.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); });
|
599
|
+
}else{
|
600
|
+
_alsoResize(o.alsoResize);
|
601
|
+
}
|
602
|
+
},
|
603
|
+
|
604
|
+
stop: function (event, ui) {
|
605
|
+
$(this).removeData("resizable-alsoresize");
|
606
|
+
}
|
607
|
+
});
|
608
|
+
|
609
|
+
$.ui.plugin.add("resizable", "animate", {
|
610
|
+
|
611
|
+
stop: function(event, ui) {
|
612
|
+
var self = $(this).data("resizable"), o = self.options;
|
613
|
+
|
614
|
+
var pr = self._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),
|
615
|
+
soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
|
616
|
+
soffsetw = ista ? 0 : self.sizeDiff.width;
|
617
|
+
|
618
|
+
var style = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) },
|
619
|
+
left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
|
620
|
+
top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;
|
621
|
+
|
622
|
+
self.element.animate(
|
623
|
+
$.extend(style, top && left ? { top: top, left: left } : {}), {
|
624
|
+
duration: o.animateDuration,
|
625
|
+
easing: o.animateEasing,
|
626
|
+
step: function() {
|
627
|
+
|
628
|
+
var data = {
|
629
|
+
width: parseInt(self.element.css('width'), 10),
|
630
|
+
height: parseInt(self.element.css('height'), 10),
|
631
|
+
top: parseInt(self.element.css('top'), 10),
|
632
|
+
left: parseInt(self.element.css('left'), 10)
|
633
|
+
};
|
634
|
+
|
635
|
+
if (pr && pr.length) $(pr[0]).css({ width: data.width, height: data.height });
|
636
|
+
|
637
|
+
// propagating resize, and updating values for each animation step
|
638
|
+
self._updateCache(data);
|
639
|
+
self._propagate("resize", event);
|
640
|
+
|
641
|
+
}
|
642
|
+
}
|
643
|
+
);
|
644
|
+
}
|
645
|
+
|
646
|
+
});
|
647
|
+
|
648
|
+
$.ui.plugin.add("resizable", "containment", {
|
649
|
+
|
650
|
+
start: function(event, ui) {
|
651
|
+
var self = $(this).data("resizable"), o = self.options, el = self.element;
|
652
|
+
var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc;
|
653
|
+
if (!ce) return;
|
654
|
+
|
655
|
+
self.containerElement = $(ce);
|
656
|
+
|
657
|
+
if (/document/.test(oc) || oc == document) {
|
658
|
+
self.containerOffset = { left: 0, top: 0 };
|
659
|
+
self.containerPosition = { left: 0, top: 0 };
|
660
|
+
|
661
|
+
self.parentData = {
|
662
|
+
element: $(document), left: 0, top: 0,
|
663
|
+
width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight
|
664
|
+
};
|
665
|
+
}
|
666
|
+
|
667
|
+
// i'm a node, so compute top, left, right, bottom
|
668
|
+
else {
|
669
|
+
var element = $(ce), p = [];
|
670
|
+
$([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); });
|
671
|
+
|
672
|
+
self.containerOffset = element.offset();
|
673
|
+
self.containerPosition = element.position();
|
674
|
+
self.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) };
|
675
|
+
|
676
|
+
var co = self.containerOffset, ch = self.containerSize.height, cw = self.containerSize.width,
|
677
|
+
width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch);
|
678
|
+
|
679
|
+
self.parentData = {
|
680
|
+
element: ce, left: co.left, top: co.top, width: width, height: height
|
681
|
+
};
|
682
|
+
}
|
683
|
+
},
|
684
|
+
|
685
|
+
resize: function(event, ui) {
|
686
|
+
var self = $(this).data("resizable"), o = self.options,
|
687
|
+
ps = self.containerSize, co = self.containerOffset, cs = self.size, cp = self.position,
|
688
|
+
pRatio = self._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = self.containerElement;
|
689
|
+
|
690
|
+
if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co;
|
691
|
+
|
692
|
+
if (cp.left < (self._helper ? co.left : 0)) {
|
693
|
+
self.size.width = self.size.width + (self._helper ? (self.position.left - co.left) : (self.position.left - cop.left));
|
694
|
+
if (pRatio) self.size.height = self.size.width / o.aspectRatio;
|
695
|
+
self.position.left = o.helper ? co.left : 0;
|
696
|
+
}
|
697
|
+
|
698
|
+
if (cp.top < (self._helper ? co.top : 0)) {
|
699
|
+
self.size.height = self.size.height + (self._helper ? (self.position.top - co.top) : self.position.top);
|
700
|
+
if (pRatio) self.size.width = self.size.height * o.aspectRatio;
|
701
|
+
self.position.top = self._helper ? co.top : 0;
|
702
|
+
}
|
703
|
+
|
704
|
+
self.offset.left = self.parentData.left+self.position.left;
|
705
|
+
self.offset.top = self.parentData.top+self.position.top;
|
706
|
+
|
707
|
+
var woset = Math.abs( (self._helper ? self.offset.left - cop.left : (self.offset.left - cop.left)) + self.sizeDiff.width ),
|
708
|
+
hoset = Math.abs( (self._helper ? self.offset.top - cop.top : (self.offset.top - co.top)) + self.sizeDiff.height );
|
709
|
+
|
710
|
+
var isParent = self.containerElement.get(0) == self.element.parent().get(0),
|
711
|
+
isOffsetRelative = /relative|absolute/.test(self.containerElement.css('position'));
|
712
|
+
|
713
|
+
if(isParent && isOffsetRelative) woset -= self.parentData.left;
|
714
|
+
|
715
|
+
if (woset + self.size.width >= self.parentData.width) {
|
716
|
+
self.size.width = self.parentData.width - woset;
|
717
|
+
if (pRatio) self.size.height = self.size.width / self.aspectRatio;
|
718
|
+
}
|
719
|
+
|
720
|
+
if (hoset + self.size.height >= self.parentData.height) {
|
721
|
+
self.size.height = self.parentData.height - hoset;
|
722
|
+
if (pRatio) self.size.width = self.size.height * self.aspectRatio;
|
723
|
+
}
|
724
|
+
},
|
725
|
+
|
726
|
+
stop: function(event, ui){
|
727
|
+
var self = $(this).data("resizable"), o = self.options, cp = self.position,
|
728
|
+
co = self.containerOffset, cop = self.containerPosition, ce = self.containerElement;
|
729
|
+
|
730
|
+
var helper = $(self.helper), ho = helper.offset(), w = helper.outerWidth() - self.sizeDiff.width, h = helper.outerHeight() - self.sizeDiff.height;
|
731
|
+
|
732
|
+
if (self._helper && !o.animate && (/relative/).test(ce.css('position')))
|
733
|
+
$(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
|
734
|
+
|
735
|
+
if (self._helper && !o.animate && (/static/).test(ce.css('position')))
|
736
|
+
$(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
|
737
|
+
|
738
|
+
}
|
739
|
+
});
|
740
|
+
|
741
|
+
$.ui.plugin.add("resizable", "ghost", {
|
742
|
+
|
743
|
+
start: function(event, ui) {
|
744
|
+
|
745
|
+
var self = $(this).data("resizable"), o = self.options, cs = self.size;
|
746
|
+
|
747
|
+
self.ghost = self.originalElement.clone();
|
748
|
+
self.ghost
|
749
|
+
.css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 })
|
750
|
+
.addClass('ui-resizable-ghost')
|
751
|
+
.addClass(typeof o.ghost == 'string' ? o.ghost : '');
|
752
|
+
|
753
|
+
self.ghost.appendTo(self.helper);
|
754
|
+
|
755
|
+
},
|
756
|
+
|
757
|
+
resize: function(event, ui){
|
758
|
+
var self = $(this).data("resizable"), o = self.options;
|
759
|
+
if (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width });
|
760
|
+
},
|
761
|
+
|
762
|
+
stop: function(event, ui){
|
763
|
+
var self = $(this).data("resizable"), o = self.options;
|
764
|
+
if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0));
|
765
|
+
}
|
766
|
+
|
767
|
+
});
|
768
|
+
|
769
|
+
$.ui.plugin.add("resizable", "grid", {
|
770
|
+
|
771
|
+
resize: function(event, ui) {
|
772
|
+
var self = $(this).data("resizable"), o = self.options, cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || event.shiftKey;
|
773
|
+
o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid;
|
774
|
+
var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1);
|
775
|
+
|
776
|
+
if (/^(se|s|e)$/.test(a)) {
|
777
|
+
self.size.width = os.width + ox;
|
778
|
+
self.size.height = os.height + oy;
|
779
|
+
}
|
780
|
+
else if (/^(ne)$/.test(a)) {
|
781
|
+
self.size.width = os.width + ox;
|
782
|
+
self.size.height = os.height + oy;
|
783
|
+
self.position.top = op.top - oy;
|
784
|
+
}
|
785
|
+
else if (/^(sw)$/.test(a)) {
|
786
|
+
self.size.width = os.width + ox;
|
787
|
+
self.size.height = os.height + oy;
|
788
|
+
self.position.left = op.left - ox;
|
789
|
+
}
|
790
|
+
else {
|
791
|
+
self.size.width = os.width + ox;
|
792
|
+
self.size.height = os.height + oy;
|
793
|
+
self.position.top = op.top - oy;
|
794
|
+
self.position.left = op.left - ox;
|
795
|
+
}
|
796
|
+
}
|
797
|
+
|
798
|
+
});
|
799
|
+
|
800
|
+
var num = function(v) {
|
801
|
+
return parseInt(v, 10) || 0;
|
802
|
+
};
|
803
|
+
|
804
|
+
var isNumber = function(value) {
|
805
|
+
return !isNaN(parseInt(value, 10));
|
806
|
+
};
|
807
|
+
|
808
|
+
})(jQuery);
|