omf_web 1.2.4 → 1.2.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/omf-web/content/content_proxy.rb +18 -18
- data/lib/omf-web/content/file_repository.rb +6 -2
- data/lib/omf-web/content/git_repository.rb +4 -0
- data/lib/omf-web/content/repository.rb +11 -0
- data/lib/omf-web/data_source_proxy.rb +0 -13
- data/lib/omf-web/session_store.rb +8 -3
- data/lib/omf-web/theme/abstract_page.rb +2 -10
- data/{example → lib/omf-web/theme}/web_rtc/web_rtc.yaml +0 -0
- data/{example → lib/omf-web/theme}/web_rtc/webrtc-exp_1381786573.sq3 +0 -0
- data/lib/omf-web/version.rb +1 -1
- data/lib/omf-web/widget/data_widget.rb +2 -37
- data/lib/omf-web/widget/layout/one_column_layout.rb +4 -4
- data/lib/omf-web/widget/layout/stacked_layout.rb +6 -14
- data/lib/omf-web/widget/text/maruku/output/to_html.rb +4 -2
- data/lib/omf-web/widget/text/maruku.rb +1 -1
- data/lib/omf_web.rb +15 -15
- data/share/htdocs/graph/js/abstract_nv_chart.js +2 -2
- data/share/htdocs/graph/js/histogram2.js +5 -1
- data/share/htdocs/js/data_source3.js +2 -1
- data/share/htdocs/vendor/jquery-1.8.3/jquery.js +9472 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/css/smoothness/images/animated-overlay.gif +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/css/smoothness/jquery-ui-1.10.4.custom.css +558 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/css/smoothness/jquery-ui-1.10.4.custom.min.css +7 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/AUTHORS.txt +260 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/Gruntfile.js +240 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/MIT-LICENSE.txt +26 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/README.md +96 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/addClass/default.html +45 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/addClass/index.html +14 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/animate/default.html +55 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/animate/index.html +14 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/demos.css +19 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/draggable/constrain-movement.html +58 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/draggable/cursor-style.html +42 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/draggable/default.html +32 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/draggable/delay-start.html +38 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/draggable/events.html +70 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/draggable/handle.html +41 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/draggable/index.html +24 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/draggable/revert.html +37 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/draggable/scroll.html +44 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/draggable/snap-to.html +61 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/draggable/sortable.html +50 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/draggable/visual-feedback.html +70 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/droppable/accepted-elements.html +53 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/droppable/default.html +46 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/droppable/images/high_tatras.jpg +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/droppable/images/high_tatras2.jpg +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/droppable/images/high_tatras2_min.jpg +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/droppable/images/high_tatras3.jpg +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/droppable/images/high_tatras3_min.jpg +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/droppable/images/high_tatras4.jpg +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/droppable/images/high_tatras4_min.jpg +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/droppable/images/high_tatras_min.jpg +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/droppable/index.html +20 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/droppable/photo-manager.html +182 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/droppable/propagation.html +73 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/droppable/revert.html +54 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/droppable/shopping-cart.html +94 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/droppable/visual-feedback.html +72 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/effect/default.html +102 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/effect/easing.html +102 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/effect/index.html +15 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/hide/default.html +95 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/hide/index.html +14 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/images/calendar.gif +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/images/demo-config-on-tile.gif +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/images/demo-config-on.gif +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/images/demo-spindown-closed.gif +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/images/demo-spindown-open.gif +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/images/icon-docs-info.gif +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/images/pbar-ani.gif +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/index.html +29 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/position/cycler.html +107 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/position/default.html +137 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/position/images/earth.jpg +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/position/images/flight.jpg +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/position/images/rocket.jpg +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/position/index.html +15 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/removeClass/default.html +45 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/removeClass/index.html +14 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/resizable/animate.html +36 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/resizable/aspect-ratio.html +35 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/resizable/constrain-area.html +40 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/resizable/default.html +33 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/resizable/delay-start.html +45 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/resizable/helper.html +36 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/resizable/index.html +24 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/resizable/max-min.html +38 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/resizable/snap-to-grid.html +35 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/resizable/synchronous-resize.html +42 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/resizable/textarea.html +34 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/resizable/visual-feedback.html +36 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/selectable/default.html +43 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/selectable/display-grid.html +48 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/selectable/index.html +16 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/selectable/serialize.html +54 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/show/default.html +97 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/show/index.html +14 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/sortable/connect-lists-through-tabs.html +72 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/sortable/connect-lists.html +52 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/sortable/default.html +45 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/sortable/delay-start.html +61 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/sortable/display-grid.html +48 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/sortable/empty-lists.html +63 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/sortable/index.html +22 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/sortable/items.html +64 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/sortable/placeholder.html +50 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/sortable/portlets.html +115 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/switchClass/default.html +40 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/switchClass/index.html +14 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/toggle/default.html +103 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/toggle/index.html +14 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/toggleClass/default.html +39 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/toggleClass/index.html +14 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/widget/default.html +178 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/demos/widget/index.html +14 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/docs/blind-effect.html +58 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/docs/bounce-effect.html +61 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/docs/clip-effect.html +55 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/docs/draggable.html +741 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/docs/drop-effect.html +55 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/docs/droppable.html +548 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/docs/explode-effect.html +52 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/docs/fade-effect.html +43 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/docs/fold-effect.html +61 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/docs/highlight-effect.html +52 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/docs/jQuery.widget.html +611 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/docs/mouse.html +216 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/docs/position.html +116 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/docs/puff-effect.html +52 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/docs/pulsate-effect.html +52 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/docs/resizable.html +685 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/docs/scale-effect.html +82 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/docs/selectable.html +498 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/docs/shake-effect.html +66 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/docs/size-effect.html +65 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/docs/slide-effect.html +59 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/docs/sortable.html +1450 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/docs/transfer-effect.html +61 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/external/globalize.culture.de-DE.js +81 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/external/globalize.culture.ja-JP.js +100 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/external/globalize.js +1585 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/external/jquery.mousewheel.js +101 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/external/jshint.js +4835 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/external/qunit.css +244 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/external/qunit.js +2152 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/jquery-1.10.2.js +9789 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/package.json +73 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/images/animated-overlay.gif +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/images/ui-icons_222222_256x240.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/images/ui-icons_2e83ff_256x240.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/images/ui-icons_454545_256x240.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/images/ui-icons_888888_256x240.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/jquery-ui.css +557 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/jquery.ui.all.css +12 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/jquery.ui.base.css +25 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/jquery.ui.core.css +93 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/jquery.ui.resizable.css +76 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/jquery.ui.selectable.css +13 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/jquery.ui.theme.css +410 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/minified/images/animated-overlay.gif +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/minified/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/minified/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/minified/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/minified/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/minified/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/minified/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/minified/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/minified/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/minified/images/ui-icons_222222_256x240.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/minified/images/ui-icons_2e83ff_256x240.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/minified/images/ui-icons_454545_256x240.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/minified/images/ui-icons_888888_256x240.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/minified/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/minified/jquery-ui.min.css +7 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/minified/jquery.ui.core.min.css +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/minified/jquery.ui.resizable.min.css +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/minified/jquery.ui.selectable.min.css +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/base/minified/jquery.ui.theme.min.css +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/images/animated-overlay.gif +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/jquery-ui.css +558 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/jquery.ui.all.css +12 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/jquery.ui.base.css +25 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/jquery.ui.core.css +93 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/jquery.ui.resizable.css +76 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/jquery.ui.selectable.css +13 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/jquery.ui.theme.css +410 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/minified/images/animated-overlay.gif +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/minified/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/minified/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/minified/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/minified/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/minified/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/minified/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/minified/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/minified/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/minified/images/ui-icons_222222_256x240.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/minified/images/ui-icons_2e83ff_256x240.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/minified/images/ui-icons_454545_256x240.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/minified/images/ui-icons_888888_256x240.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/minified/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/minified/jquery-ui.min.css +7 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/minified/jquery.ui.core.min.css +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/minified/jquery.ui.resizable.min.css +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/minified/jquery.ui.selectable.min.css +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/themes/smoothness/minified/jquery.ui.theme.min.css +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/jquery-ui.custom.js +7544 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/jquery.ui.core.js +320 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/jquery.ui.draggable.js +958 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/jquery.ui.droppable.js +389 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/jquery.ui.effect-blind.js +82 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/jquery.ui.effect-bounce.js +113 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/jquery.ui.effect-clip.js +67 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/jquery.ui.effect-drop.js +65 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/jquery.ui.effect-explode.js +97 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/jquery.ui.effect-fade.js +30 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/jquery.ui.effect-fold.js +76 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/jquery.ui.effect-highlight.js +50 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/jquery.ui.effect-pulsate.js +63 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/jquery.ui.effect-scale.js +318 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/jquery.ui.effect-shake.js +74 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/jquery.ui.effect-slide.js +64 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/jquery.ui.effect-transfer.js +47 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/jquery.ui.effect.js +1289 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/jquery.ui.mouse.js +169 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/jquery.ui.position.js +501 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/jquery.ui.resizable.js +978 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/jquery.ui.selectable.js +277 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/jquery.ui.sortable.js +1289 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/jquery.ui.widget.js +521 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/minified/jquery-ui.custom.min.js +6 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/minified/jquery.ui.core.min.js +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/minified/jquery.ui.draggable.min.js +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/minified/jquery.ui.droppable.min.js +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/minified/jquery.ui.effect-blind.min.js +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/minified/jquery.ui.effect-bounce.min.js +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/minified/jquery.ui.effect-clip.min.js +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/minified/jquery.ui.effect-drop.min.js +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/minified/jquery.ui.effect-explode.min.js +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/minified/jquery.ui.effect-fade.min.js +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/minified/jquery.ui.effect-fold.min.js +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/minified/jquery.ui.effect-highlight.min.js +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/minified/jquery.ui.effect-pulsate.min.js +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/minified/jquery.ui.effect-scale.min.js +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/minified/jquery.ui.effect-shake.min.js +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/minified/jquery.ui.effect-slide.min.js +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/minified/jquery.ui.effect-transfer.min.js +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/minified/jquery.ui.effect.min.js +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/minified/jquery.ui.mouse.min.js +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/minified/jquery.ui.position.min.js +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/minified/jquery.ui.resizable.min.js +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/minified/jquery.ui.selectable.min.js +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/minified/jquery.ui.sortable.min.js +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui/minified/jquery.ui.widget.min.js +5 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui.core.jquery.json +61 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui.draggable.jquery.json +66 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui.droppable.jquery.json +67 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui.effect-blind.jquery.json +65 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui.effect-bounce.jquery.json +65 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui.effect-clip.jquery.json +65 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui.effect-drop.jquery.json +65 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui.effect-explode.jquery.json +65 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui.effect-fade.jquery.json +65 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui.effect-fold.jquery.json +65 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui.effect-highlight.jquery.json +65 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui.effect-pulsate.jquery.json +65 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui.effect-scale.jquery.json +65 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui.effect-shake.jquery.json +65 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui.effect-slide.jquery.json +65 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui.effect-transfer.jquery.json +63 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui.effect.jquery.json +68 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui.mouse.jquery.json +64 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui.position.jquery.json +66 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui.resizable.jquery.json +65 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui.selectable.jquery.json +65 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui.sortable.jquery.json +66 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/development-bundle/ui.widget.jquery.json +64 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/index.html +301 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/js/jquery-1.10.2.js +9789 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/js/jquery-ui-1.10.4.custom.js +7544 -0
- data/share/htdocs/vendor/jquery-ui-1.10.4/js/jquery-ui-1.10.4.custom.min.js +6 -0
- metadata +302 -4
@@ -0,0 +1,1289 @@
|
|
1
|
+
/*!
|
2
|
+
* jQuery UI Sortable 1.10.4
|
3
|
+
* http://jqueryui.com
|
4
|
+
*
|
5
|
+
* Copyright 2014 jQuery Foundation and other contributors
|
6
|
+
* Released under the MIT license.
|
7
|
+
* http://jquery.org/license
|
8
|
+
*
|
9
|
+
* http://api.jqueryui.com/sortable/
|
10
|
+
*
|
11
|
+
* Depends:
|
12
|
+
* jquery.ui.core.js
|
13
|
+
* jquery.ui.mouse.js
|
14
|
+
* jquery.ui.widget.js
|
15
|
+
*/
|
16
|
+
(function( $, undefined ) {
|
17
|
+
|
18
|
+
function isOverAxis( x, reference, size ) {
|
19
|
+
return ( x > reference ) && ( x < ( reference + size ) );
|
20
|
+
}
|
21
|
+
|
22
|
+
function isFloating(item) {
|
23
|
+
return (/left|right/).test(item.css("float")) || (/inline|table-cell/).test(item.css("display"));
|
24
|
+
}
|
25
|
+
|
26
|
+
$.widget("ui.sortable", $.ui.mouse, {
|
27
|
+
version: "1.10.4",
|
28
|
+
widgetEventPrefix: "sort",
|
29
|
+
ready: false,
|
30
|
+
options: {
|
31
|
+
appendTo: "parent",
|
32
|
+
axis: false,
|
33
|
+
connectWith: false,
|
34
|
+
containment: false,
|
35
|
+
cursor: "auto",
|
36
|
+
cursorAt: false,
|
37
|
+
dropOnEmpty: true,
|
38
|
+
forcePlaceholderSize: false,
|
39
|
+
forceHelperSize: false,
|
40
|
+
grid: false,
|
41
|
+
handle: false,
|
42
|
+
helper: "original",
|
43
|
+
items: "> *",
|
44
|
+
opacity: false,
|
45
|
+
placeholder: false,
|
46
|
+
revert: false,
|
47
|
+
scroll: true,
|
48
|
+
scrollSensitivity: 20,
|
49
|
+
scrollSpeed: 20,
|
50
|
+
scope: "default",
|
51
|
+
tolerance: "intersect",
|
52
|
+
zIndex: 1000,
|
53
|
+
|
54
|
+
// callbacks
|
55
|
+
activate: null,
|
56
|
+
beforeStop: null,
|
57
|
+
change: null,
|
58
|
+
deactivate: null,
|
59
|
+
out: null,
|
60
|
+
over: null,
|
61
|
+
receive: null,
|
62
|
+
remove: null,
|
63
|
+
sort: null,
|
64
|
+
start: null,
|
65
|
+
stop: null,
|
66
|
+
update: null
|
67
|
+
},
|
68
|
+
_create: function() {
|
69
|
+
|
70
|
+
var o = this.options;
|
71
|
+
this.containerCache = {};
|
72
|
+
this.element.addClass("ui-sortable");
|
73
|
+
|
74
|
+
//Get the items
|
75
|
+
this.refresh();
|
76
|
+
|
77
|
+
//Let's determine if the items are being displayed horizontally
|
78
|
+
this.floating = this.items.length ? o.axis === "x" || isFloating(this.items[0].item) : false;
|
79
|
+
|
80
|
+
//Let's determine the parent's offset
|
81
|
+
this.offset = this.element.offset();
|
82
|
+
|
83
|
+
//Initialize mouse events for interaction
|
84
|
+
this._mouseInit();
|
85
|
+
|
86
|
+
//We're ready to go
|
87
|
+
this.ready = true;
|
88
|
+
|
89
|
+
},
|
90
|
+
|
91
|
+
_destroy: function() {
|
92
|
+
this.element
|
93
|
+
.removeClass("ui-sortable ui-sortable-disabled");
|
94
|
+
this._mouseDestroy();
|
95
|
+
|
96
|
+
for ( var i = this.items.length - 1; i >= 0; i-- ) {
|
97
|
+
this.items[i].item.removeData(this.widgetName + "-item");
|
98
|
+
}
|
99
|
+
|
100
|
+
return this;
|
101
|
+
},
|
102
|
+
|
103
|
+
_setOption: function(key, value){
|
104
|
+
if ( key === "disabled" ) {
|
105
|
+
this.options[ key ] = value;
|
106
|
+
|
107
|
+
this.widget().toggleClass( "ui-sortable-disabled", !!value );
|
108
|
+
} else {
|
109
|
+
// Don't call widget base _setOption for disable as it adds ui-state-disabled class
|
110
|
+
$.Widget.prototype._setOption.apply(this, arguments);
|
111
|
+
}
|
112
|
+
},
|
113
|
+
|
114
|
+
_mouseCapture: function(event, overrideHandle) {
|
115
|
+
var currentItem = null,
|
116
|
+
validHandle = false,
|
117
|
+
that = this;
|
118
|
+
|
119
|
+
if (this.reverting) {
|
120
|
+
return false;
|
121
|
+
}
|
122
|
+
|
123
|
+
if(this.options.disabled || this.options.type === "static") {
|
124
|
+
return false;
|
125
|
+
}
|
126
|
+
|
127
|
+
//We have to refresh the items data once first
|
128
|
+
this._refreshItems(event);
|
129
|
+
|
130
|
+
//Find out if the clicked node (or one of its parents) is a actual item in this.items
|
131
|
+
$(event.target).parents().each(function() {
|
132
|
+
if($.data(this, that.widgetName + "-item") === that) {
|
133
|
+
currentItem = $(this);
|
134
|
+
return false;
|
135
|
+
}
|
136
|
+
});
|
137
|
+
if($.data(event.target, that.widgetName + "-item") === that) {
|
138
|
+
currentItem = $(event.target);
|
139
|
+
}
|
140
|
+
|
141
|
+
if(!currentItem) {
|
142
|
+
return false;
|
143
|
+
}
|
144
|
+
if(this.options.handle && !overrideHandle) {
|
145
|
+
$(this.options.handle, currentItem).find("*").addBack().each(function() {
|
146
|
+
if(this === event.target) {
|
147
|
+
validHandle = true;
|
148
|
+
}
|
149
|
+
});
|
150
|
+
if(!validHandle) {
|
151
|
+
return false;
|
152
|
+
}
|
153
|
+
}
|
154
|
+
|
155
|
+
this.currentItem = currentItem;
|
156
|
+
this._removeCurrentsFromItems();
|
157
|
+
return true;
|
158
|
+
|
159
|
+
},
|
160
|
+
|
161
|
+
_mouseStart: function(event, overrideHandle, noActivation) {
|
162
|
+
|
163
|
+
var i, body,
|
164
|
+
o = this.options;
|
165
|
+
|
166
|
+
this.currentContainer = this;
|
167
|
+
|
168
|
+
//We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture
|
169
|
+
this.refreshPositions();
|
170
|
+
|
171
|
+
//Create and append the visible helper
|
172
|
+
this.helper = this._createHelper(event);
|
173
|
+
|
174
|
+
//Cache the helper size
|
175
|
+
this._cacheHelperProportions();
|
176
|
+
|
177
|
+
/*
|
178
|
+
* - Position generation -
|
179
|
+
* This block generates everything position related - it's the core of draggables.
|
180
|
+
*/
|
181
|
+
|
182
|
+
//Cache the margins of the original element
|
183
|
+
this._cacheMargins();
|
184
|
+
|
185
|
+
//Get the next scrolling parent
|
186
|
+
this.scrollParent = this.helper.scrollParent();
|
187
|
+
|
188
|
+
//The element's absolute position on the page minus margins
|
189
|
+
this.offset = this.currentItem.offset();
|
190
|
+
this.offset = {
|
191
|
+
top: this.offset.top - this.margins.top,
|
192
|
+
left: this.offset.left - this.margins.left
|
193
|
+
};
|
194
|
+
|
195
|
+
$.extend(this.offset, {
|
196
|
+
click: { //Where the click happened, relative to the element
|
197
|
+
left: event.pageX - this.offset.left,
|
198
|
+
top: event.pageY - this.offset.top
|
199
|
+
},
|
200
|
+
parent: this._getParentOffset(),
|
201
|
+
relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
|
202
|
+
});
|
203
|
+
|
204
|
+
// Only after we got the offset, we can change the helper's position to absolute
|
205
|
+
// TODO: Still need to figure out a way to make relative sorting possible
|
206
|
+
this.helper.css("position", "absolute");
|
207
|
+
this.cssPosition = this.helper.css("position");
|
208
|
+
|
209
|
+
//Generate the original position
|
210
|
+
this.originalPosition = this._generatePosition(event);
|
211
|
+
this.originalPageX = event.pageX;
|
212
|
+
this.originalPageY = event.pageY;
|
213
|
+
|
214
|
+
//Adjust the mouse offset relative to the helper if "cursorAt" is supplied
|
215
|
+
(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
|
216
|
+
|
217
|
+
//Cache the former DOM position
|
218
|
+
this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };
|
219
|
+
|
220
|
+
//If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way
|
221
|
+
if(this.helper[0] !== this.currentItem[0]) {
|
222
|
+
this.currentItem.hide();
|
223
|
+
}
|
224
|
+
|
225
|
+
//Create the placeholder
|
226
|
+
this._createPlaceholder();
|
227
|
+
|
228
|
+
//Set a containment if given in the options
|
229
|
+
if(o.containment) {
|
230
|
+
this._setContainment();
|
231
|
+
}
|
232
|
+
|
233
|
+
if( o.cursor && o.cursor !== "auto" ) { // cursor option
|
234
|
+
body = this.document.find( "body" );
|
235
|
+
|
236
|
+
// support: IE
|
237
|
+
this.storedCursor = body.css( "cursor" );
|
238
|
+
body.css( "cursor", o.cursor );
|
239
|
+
|
240
|
+
this.storedStylesheet = $( "<style>*{ cursor: "+o.cursor+" !important; }</style>" ).appendTo( body );
|
241
|
+
}
|
242
|
+
|
243
|
+
if(o.opacity) { // opacity option
|
244
|
+
if (this.helper.css("opacity")) {
|
245
|
+
this._storedOpacity = this.helper.css("opacity");
|
246
|
+
}
|
247
|
+
this.helper.css("opacity", o.opacity);
|
248
|
+
}
|
249
|
+
|
250
|
+
if(o.zIndex) { // zIndex option
|
251
|
+
if (this.helper.css("zIndex")) {
|
252
|
+
this._storedZIndex = this.helper.css("zIndex");
|
253
|
+
}
|
254
|
+
this.helper.css("zIndex", o.zIndex);
|
255
|
+
}
|
256
|
+
|
257
|
+
//Prepare scrolling
|
258
|
+
if(this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") {
|
259
|
+
this.overflowOffset = this.scrollParent.offset();
|
260
|
+
}
|
261
|
+
|
262
|
+
//Call callbacks
|
263
|
+
this._trigger("start", event, this._uiHash());
|
264
|
+
|
265
|
+
//Recache the helper size
|
266
|
+
if(!this._preserveHelperProportions) {
|
267
|
+
this._cacheHelperProportions();
|
268
|
+
}
|
269
|
+
|
270
|
+
|
271
|
+
//Post "activate" events to possible containers
|
272
|
+
if( !noActivation ) {
|
273
|
+
for ( i = this.containers.length - 1; i >= 0; i-- ) {
|
274
|
+
this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) );
|
275
|
+
}
|
276
|
+
}
|
277
|
+
|
278
|
+
//Prepare possible droppables
|
279
|
+
if($.ui.ddmanager) {
|
280
|
+
$.ui.ddmanager.current = this;
|
281
|
+
}
|
282
|
+
|
283
|
+
if ($.ui.ddmanager && !o.dropBehaviour) {
|
284
|
+
$.ui.ddmanager.prepareOffsets(this, event);
|
285
|
+
}
|
286
|
+
|
287
|
+
this.dragging = true;
|
288
|
+
|
289
|
+
this.helper.addClass("ui-sortable-helper");
|
290
|
+
this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position
|
291
|
+
return true;
|
292
|
+
|
293
|
+
},
|
294
|
+
|
295
|
+
_mouseDrag: function(event) {
|
296
|
+
var i, item, itemElement, intersection,
|
297
|
+
o = this.options,
|
298
|
+
scrolled = false;
|
299
|
+
|
300
|
+
//Compute the helpers position
|
301
|
+
this.position = this._generatePosition(event);
|
302
|
+
this.positionAbs = this._convertPositionTo("absolute");
|
303
|
+
|
304
|
+
if (!this.lastPositionAbs) {
|
305
|
+
this.lastPositionAbs = this.positionAbs;
|
306
|
+
}
|
307
|
+
|
308
|
+
//Do scrolling
|
309
|
+
if(this.options.scroll) {
|
310
|
+
if(this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") {
|
311
|
+
|
312
|
+
if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) {
|
313
|
+
this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
|
314
|
+
} else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) {
|
315
|
+
this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
|
316
|
+
}
|
317
|
+
|
318
|
+
if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) {
|
319
|
+
this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
|
320
|
+
} else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) {
|
321
|
+
this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
|
322
|
+
}
|
323
|
+
|
324
|
+
} else {
|
325
|
+
|
326
|
+
if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
|
327
|
+
scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
|
328
|
+
} else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {
|
329
|
+
scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
|
330
|
+
}
|
331
|
+
|
332
|
+
if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
|
333
|
+
scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
|
334
|
+
} else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {
|
335
|
+
scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
|
336
|
+
}
|
337
|
+
|
338
|
+
}
|
339
|
+
|
340
|
+
if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
|
341
|
+
$.ui.ddmanager.prepareOffsets(this, event);
|
342
|
+
}
|
343
|
+
}
|
344
|
+
|
345
|
+
//Regenerate the absolute position used for position checks
|
346
|
+
this.positionAbs = this._convertPositionTo("absolute");
|
347
|
+
|
348
|
+
//Set the helper position
|
349
|
+
if(!this.options.axis || this.options.axis !== "y") {
|
350
|
+
this.helper[0].style.left = this.position.left+"px";
|
351
|
+
}
|
352
|
+
if(!this.options.axis || this.options.axis !== "x") {
|
353
|
+
this.helper[0].style.top = this.position.top+"px";
|
354
|
+
}
|
355
|
+
|
356
|
+
//Rearrange
|
357
|
+
for (i = this.items.length - 1; i >= 0; i--) {
|
358
|
+
|
359
|
+
//Cache variables and intersection, continue if no intersection
|
360
|
+
item = this.items[i];
|
361
|
+
itemElement = item.item[0];
|
362
|
+
intersection = this._intersectsWithPointer(item);
|
363
|
+
if (!intersection) {
|
364
|
+
continue;
|
365
|
+
}
|
366
|
+
|
367
|
+
// Only put the placeholder inside the current Container, skip all
|
368
|
+
// items from other containers. This works because when moving
|
369
|
+
// an item from one container to another the
|
370
|
+
// currentContainer is switched before the placeholder is moved.
|
371
|
+
//
|
372
|
+
// Without this, moving items in "sub-sortables" can cause
|
373
|
+
// the placeholder to jitter beetween the outer and inner container.
|
374
|
+
if (item.instance !== this.currentContainer) {
|
375
|
+
continue;
|
376
|
+
}
|
377
|
+
|
378
|
+
// cannot intersect with itself
|
379
|
+
// no useless actions that have been done before
|
380
|
+
// no action if the item moved is the parent of the item checked
|
381
|
+
if (itemElement !== this.currentItem[0] &&
|
382
|
+
this.placeholder[intersection === 1 ? "next" : "prev"]()[0] !== itemElement &&
|
383
|
+
!$.contains(this.placeholder[0], itemElement) &&
|
384
|
+
(this.options.type === "semi-dynamic" ? !$.contains(this.element[0], itemElement) : true)
|
385
|
+
) {
|
386
|
+
|
387
|
+
this.direction = intersection === 1 ? "down" : "up";
|
388
|
+
|
389
|
+
if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) {
|
390
|
+
this._rearrange(event, item);
|
391
|
+
} else {
|
392
|
+
break;
|
393
|
+
}
|
394
|
+
|
395
|
+
this._trigger("change", event, this._uiHash());
|
396
|
+
break;
|
397
|
+
}
|
398
|
+
}
|
399
|
+
|
400
|
+
//Post events to containers
|
401
|
+
this._contactContainers(event);
|
402
|
+
|
403
|
+
//Interconnect with droppables
|
404
|
+
if($.ui.ddmanager) {
|
405
|
+
$.ui.ddmanager.drag(this, event);
|
406
|
+
}
|
407
|
+
|
408
|
+
//Call callbacks
|
409
|
+
this._trigger("sort", event, this._uiHash());
|
410
|
+
|
411
|
+
this.lastPositionAbs = this.positionAbs;
|
412
|
+
return false;
|
413
|
+
|
414
|
+
},
|
415
|
+
|
416
|
+
_mouseStop: function(event, noPropagation) {
|
417
|
+
|
418
|
+
if(!event) {
|
419
|
+
return;
|
420
|
+
}
|
421
|
+
|
422
|
+
//If we are using droppables, inform the manager about the drop
|
423
|
+
if ($.ui.ddmanager && !this.options.dropBehaviour) {
|
424
|
+
$.ui.ddmanager.drop(this, event);
|
425
|
+
}
|
426
|
+
|
427
|
+
if(this.options.revert) {
|
428
|
+
var that = this,
|
429
|
+
cur = this.placeholder.offset(),
|
430
|
+
axis = this.options.axis,
|
431
|
+
animation = {};
|
432
|
+
|
433
|
+
if ( !axis || axis === "x" ) {
|
434
|
+
animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollLeft);
|
435
|
+
}
|
436
|
+
if ( !axis || axis === "y" ) {
|
437
|
+
animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollTop);
|
438
|
+
}
|
439
|
+
this.reverting = true;
|
440
|
+
$(this.helper).animate( animation, parseInt(this.options.revert, 10) || 500, function() {
|
441
|
+
that._clear(event);
|
442
|
+
});
|
443
|
+
} else {
|
444
|
+
this._clear(event, noPropagation);
|
445
|
+
}
|
446
|
+
|
447
|
+
return false;
|
448
|
+
|
449
|
+
},
|
450
|
+
|
451
|
+
cancel: function() {
|
452
|
+
|
453
|
+
if(this.dragging) {
|
454
|
+
|
455
|
+
this._mouseUp({ target: null });
|
456
|
+
|
457
|
+
if(this.options.helper === "original") {
|
458
|
+
this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
|
459
|
+
} else {
|
460
|
+
this.currentItem.show();
|
461
|
+
}
|
462
|
+
|
463
|
+
//Post deactivating events to containers
|
464
|
+
for (var i = this.containers.length - 1; i >= 0; i--){
|
465
|
+
this.containers[i]._trigger("deactivate", null, this._uiHash(this));
|
466
|
+
if(this.containers[i].containerCache.over) {
|
467
|
+
this.containers[i]._trigger("out", null, this._uiHash(this));
|
468
|
+
this.containers[i].containerCache.over = 0;
|
469
|
+
}
|
470
|
+
}
|
471
|
+
|
472
|
+
}
|
473
|
+
|
474
|
+
if (this.placeholder) {
|
475
|
+
//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
|
476
|
+
if(this.placeholder[0].parentNode) {
|
477
|
+
this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
|
478
|
+
}
|
479
|
+
if(this.options.helper !== "original" && this.helper && this.helper[0].parentNode) {
|
480
|
+
this.helper.remove();
|
481
|
+
}
|
482
|
+
|
483
|
+
$.extend(this, {
|
484
|
+
helper: null,
|
485
|
+
dragging: false,
|
486
|
+
reverting: false,
|
487
|
+
_noFinalSort: null
|
488
|
+
});
|
489
|
+
|
490
|
+
if(this.domPosition.prev) {
|
491
|
+
$(this.domPosition.prev).after(this.currentItem);
|
492
|
+
} else {
|
493
|
+
$(this.domPosition.parent).prepend(this.currentItem);
|
494
|
+
}
|
495
|
+
}
|
496
|
+
|
497
|
+
return this;
|
498
|
+
|
499
|
+
},
|
500
|
+
|
501
|
+
serialize: function(o) {
|
502
|
+
|
503
|
+
var items = this._getItemsAsjQuery(o && o.connected),
|
504
|
+
str = [];
|
505
|
+
o = o || {};
|
506
|
+
|
507
|
+
$(items).each(function() {
|
508
|
+
var res = ($(o.item || this).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[\-=_](.+)/));
|
509
|
+
if (res) {
|
510
|
+
str.push((o.key || res[1]+"[]")+"="+(o.key && o.expression ? res[1] : res[2]));
|
511
|
+
}
|
512
|
+
});
|
513
|
+
|
514
|
+
if(!str.length && o.key) {
|
515
|
+
str.push(o.key + "=");
|
516
|
+
}
|
517
|
+
|
518
|
+
return str.join("&");
|
519
|
+
|
520
|
+
},
|
521
|
+
|
522
|
+
toArray: function(o) {
|
523
|
+
|
524
|
+
var items = this._getItemsAsjQuery(o && o.connected),
|
525
|
+
ret = [];
|
526
|
+
|
527
|
+
o = o || {};
|
528
|
+
|
529
|
+
items.each(function() { ret.push($(o.item || this).attr(o.attribute || "id") || ""); });
|
530
|
+
return ret;
|
531
|
+
|
532
|
+
},
|
533
|
+
|
534
|
+
/* Be careful with the following core functions */
|
535
|
+
_intersectsWith: function(item) {
|
536
|
+
|
537
|
+
var x1 = this.positionAbs.left,
|
538
|
+
x2 = x1 + this.helperProportions.width,
|
539
|
+
y1 = this.positionAbs.top,
|
540
|
+
y2 = y1 + this.helperProportions.height,
|
541
|
+
l = item.left,
|
542
|
+
r = l + item.width,
|
543
|
+
t = item.top,
|
544
|
+
b = t + item.height,
|
545
|
+
dyClick = this.offset.click.top,
|
546
|
+
dxClick = this.offset.click.left,
|
547
|
+
isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && ( y1 + dyClick ) < b ),
|
548
|
+
isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && ( x1 + dxClick ) < r ),
|
549
|
+
isOverElement = isOverElementHeight && isOverElementWidth;
|
550
|
+
|
551
|
+
if ( this.options.tolerance === "pointer" ||
|
552
|
+
this.options.forcePointerForContainers ||
|
553
|
+
(this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > item[this.floating ? "width" : "height"])
|
554
|
+
) {
|
555
|
+
return isOverElement;
|
556
|
+
} else {
|
557
|
+
|
558
|
+
return (l < x1 + (this.helperProportions.width / 2) && // Right Half
|
559
|
+
x2 - (this.helperProportions.width / 2) < r && // Left Half
|
560
|
+
t < y1 + (this.helperProportions.height / 2) && // Bottom Half
|
561
|
+
y2 - (this.helperProportions.height / 2) < b ); // Top Half
|
562
|
+
|
563
|
+
}
|
564
|
+
},
|
565
|
+
|
566
|
+
_intersectsWithPointer: function(item) {
|
567
|
+
|
568
|
+
var isOverElementHeight = (this.options.axis === "x") || isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
|
569
|
+
isOverElementWidth = (this.options.axis === "y") || isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
|
570
|
+
isOverElement = isOverElementHeight && isOverElementWidth,
|
571
|
+
verticalDirection = this._getDragVerticalDirection(),
|
572
|
+
horizontalDirection = this._getDragHorizontalDirection();
|
573
|
+
|
574
|
+
if (!isOverElement) {
|
575
|
+
return false;
|
576
|
+
}
|
577
|
+
|
578
|
+
return this.floating ?
|
579
|
+
( ((horizontalDirection && horizontalDirection === "right") || verticalDirection === "down") ? 2 : 1 )
|
580
|
+
: ( verticalDirection && (verticalDirection === "down" ? 2 : 1) );
|
581
|
+
|
582
|
+
},
|
583
|
+
|
584
|
+
_intersectsWithSides: function(item) {
|
585
|
+
|
586
|
+
var isOverBottomHalf = isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
|
587
|
+
isOverRightHalf = isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
|
588
|
+
verticalDirection = this._getDragVerticalDirection(),
|
589
|
+
horizontalDirection = this._getDragHorizontalDirection();
|
590
|
+
|
591
|
+
if (this.floating && horizontalDirection) {
|
592
|
+
return ((horizontalDirection === "right" && isOverRightHalf) || (horizontalDirection === "left" && !isOverRightHalf));
|
593
|
+
} else {
|
594
|
+
return verticalDirection && ((verticalDirection === "down" && isOverBottomHalf) || (verticalDirection === "up" && !isOverBottomHalf));
|
595
|
+
}
|
596
|
+
|
597
|
+
},
|
598
|
+
|
599
|
+
_getDragVerticalDirection: function() {
|
600
|
+
var delta = this.positionAbs.top - this.lastPositionAbs.top;
|
601
|
+
return delta !== 0 && (delta > 0 ? "down" : "up");
|
602
|
+
},
|
603
|
+
|
604
|
+
_getDragHorizontalDirection: function() {
|
605
|
+
var delta = this.positionAbs.left - this.lastPositionAbs.left;
|
606
|
+
return delta !== 0 && (delta > 0 ? "right" : "left");
|
607
|
+
},
|
608
|
+
|
609
|
+
refresh: function(event) {
|
610
|
+
this._refreshItems(event);
|
611
|
+
this.refreshPositions();
|
612
|
+
return this;
|
613
|
+
},
|
614
|
+
|
615
|
+
_connectWith: function() {
|
616
|
+
var options = this.options;
|
617
|
+
return options.connectWith.constructor === String ? [options.connectWith] : options.connectWith;
|
618
|
+
},
|
619
|
+
|
620
|
+
_getItemsAsjQuery: function(connected) {
|
621
|
+
|
622
|
+
var i, j, cur, inst,
|
623
|
+
items = [],
|
624
|
+
queries = [],
|
625
|
+
connectWith = this._connectWith();
|
626
|
+
|
627
|
+
if(connectWith && connected) {
|
628
|
+
for (i = connectWith.length - 1; i >= 0; i--){
|
629
|
+
cur = $(connectWith[i]);
|
630
|
+
for ( j = cur.length - 1; j >= 0; j--){
|
631
|
+
inst = $.data(cur[j], this.widgetFullName);
|
632
|
+
if(inst && inst !== this && !inst.options.disabled) {
|
633
|
+
queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), inst]);
|
634
|
+
}
|
635
|
+
}
|
636
|
+
}
|
637
|
+
}
|
638
|
+
|
639
|
+
queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]);
|
640
|
+
|
641
|
+
function addItems() {
|
642
|
+
items.push( this );
|
643
|
+
}
|
644
|
+
for (i = queries.length - 1; i >= 0; i--){
|
645
|
+
queries[i][0].each( addItems );
|
646
|
+
}
|
647
|
+
|
648
|
+
return $(items);
|
649
|
+
|
650
|
+
},
|
651
|
+
|
652
|
+
_removeCurrentsFromItems: function() {
|
653
|
+
|
654
|
+
var list = this.currentItem.find(":data(" + this.widgetName + "-item)");
|
655
|
+
|
656
|
+
this.items = $.grep(this.items, function (item) {
|
657
|
+
for (var j=0; j < list.length; j++) {
|
658
|
+
if(list[j] === item.item[0]) {
|
659
|
+
return false;
|
660
|
+
}
|
661
|
+
}
|
662
|
+
return true;
|
663
|
+
});
|
664
|
+
|
665
|
+
},
|
666
|
+
|
667
|
+
_refreshItems: function(event) {
|
668
|
+
|
669
|
+
this.items = [];
|
670
|
+
this.containers = [this];
|
671
|
+
|
672
|
+
var i, j, cur, inst, targetData, _queries, item, queriesLength,
|
673
|
+
items = this.items,
|
674
|
+
queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]],
|
675
|
+
connectWith = this._connectWith();
|
676
|
+
|
677
|
+
if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down
|
678
|
+
for (i = connectWith.length - 1; i >= 0; i--){
|
679
|
+
cur = $(connectWith[i]);
|
680
|
+
for (j = cur.length - 1; j >= 0; j--){
|
681
|
+
inst = $.data(cur[j], this.widgetFullName);
|
682
|
+
if(inst && inst !== this && !inst.options.disabled) {
|
683
|
+
queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);
|
684
|
+
this.containers.push(inst);
|
685
|
+
}
|
686
|
+
}
|
687
|
+
}
|
688
|
+
}
|
689
|
+
|
690
|
+
for (i = queries.length - 1; i >= 0; i--) {
|
691
|
+
targetData = queries[i][1];
|
692
|
+
_queries = queries[i][0];
|
693
|
+
|
694
|
+
for (j=0, queriesLength = _queries.length; j < queriesLength; j++) {
|
695
|
+
item = $(_queries[j]);
|
696
|
+
|
697
|
+
item.data(this.widgetName + "-item", targetData); // Data for target checking (mouse manager)
|
698
|
+
|
699
|
+
items.push({
|
700
|
+
item: item,
|
701
|
+
instance: targetData,
|
702
|
+
width: 0, height: 0,
|
703
|
+
left: 0, top: 0
|
704
|
+
});
|
705
|
+
}
|
706
|
+
}
|
707
|
+
|
708
|
+
},
|
709
|
+
|
710
|
+
refreshPositions: function(fast) {
|
711
|
+
|
712
|
+
//This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change
|
713
|
+
if(this.offsetParent && this.helper) {
|
714
|
+
this.offset.parent = this._getParentOffset();
|
715
|
+
}
|
716
|
+
|
717
|
+
var i, item, t, p;
|
718
|
+
|
719
|
+
for (i = this.items.length - 1; i >= 0; i--){
|
720
|
+
item = this.items[i];
|
721
|
+
|
722
|
+
//We ignore calculating positions of all connected containers when we're not over them
|
723
|
+
if(item.instance !== this.currentContainer && this.currentContainer && item.item[0] !== this.currentItem[0]) {
|
724
|
+
continue;
|
725
|
+
}
|
726
|
+
|
727
|
+
t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;
|
728
|
+
|
729
|
+
if (!fast) {
|
730
|
+
item.width = t.outerWidth();
|
731
|
+
item.height = t.outerHeight();
|
732
|
+
}
|
733
|
+
|
734
|
+
p = t.offset();
|
735
|
+
item.left = p.left;
|
736
|
+
item.top = p.top;
|
737
|
+
}
|
738
|
+
|
739
|
+
if(this.options.custom && this.options.custom.refreshContainers) {
|
740
|
+
this.options.custom.refreshContainers.call(this);
|
741
|
+
} else {
|
742
|
+
for (i = this.containers.length - 1; i >= 0; i--){
|
743
|
+
p = this.containers[i].element.offset();
|
744
|
+
this.containers[i].containerCache.left = p.left;
|
745
|
+
this.containers[i].containerCache.top = p.top;
|
746
|
+
this.containers[i].containerCache.width = this.containers[i].element.outerWidth();
|
747
|
+
this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
|
748
|
+
}
|
749
|
+
}
|
750
|
+
|
751
|
+
return this;
|
752
|
+
},
|
753
|
+
|
754
|
+
_createPlaceholder: function(that) {
|
755
|
+
that = that || this;
|
756
|
+
var className,
|
757
|
+
o = that.options;
|
758
|
+
|
759
|
+
if(!o.placeholder || o.placeholder.constructor === String) {
|
760
|
+
className = o.placeholder;
|
761
|
+
o.placeholder = {
|
762
|
+
element: function() {
|
763
|
+
|
764
|
+
var nodeName = that.currentItem[0].nodeName.toLowerCase(),
|
765
|
+
element = $( "<" + nodeName + ">", that.document[0] )
|
766
|
+
.addClass(className || that.currentItem[0].className+" ui-sortable-placeholder")
|
767
|
+
.removeClass("ui-sortable-helper");
|
768
|
+
|
769
|
+
if ( nodeName === "tr" ) {
|
770
|
+
that.currentItem.children().each(function() {
|
771
|
+
$( "<td> </td>", that.document[0] )
|
772
|
+
.attr( "colspan", $( this ).attr( "colspan" ) || 1 )
|
773
|
+
.appendTo( element );
|
774
|
+
});
|
775
|
+
} else if ( nodeName === "img" ) {
|
776
|
+
element.attr( "src", that.currentItem.attr( "src" ) );
|
777
|
+
}
|
778
|
+
|
779
|
+
if ( !className ) {
|
780
|
+
element.css( "visibility", "hidden" );
|
781
|
+
}
|
782
|
+
|
783
|
+
return element;
|
784
|
+
},
|
785
|
+
update: function(container, p) {
|
786
|
+
|
787
|
+
// 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that
|
788
|
+
// 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified
|
789
|
+
if(className && !o.forcePlaceholderSize) {
|
790
|
+
return;
|
791
|
+
}
|
792
|
+
|
793
|
+
//If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item
|
794
|
+
if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css("paddingTop")||0, 10) - parseInt(that.currentItem.css("paddingBottom")||0, 10)); }
|
795
|
+
if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css("paddingLeft")||0, 10) - parseInt(that.currentItem.css("paddingRight")||0, 10)); }
|
796
|
+
}
|
797
|
+
};
|
798
|
+
}
|
799
|
+
|
800
|
+
//Create the placeholder
|
801
|
+
that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem));
|
802
|
+
|
803
|
+
//Append it after the actual current item
|
804
|
+
that.currentItem.after(that.placeholder);
|
805
|
+
|
806
|
+
//Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
|
807
|
+
o.placeholder.update(that, that.placeholder);
|
808
|
+
|
809
|
+
},
|
810
|
+
|
811
|
+
_contactContainers: function(event) {
|
812
|
+
var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, base, cur, nearBottom, floating,
|
813
|
+
innermostContainer = null,
|
814
|
+
innermostIndex = null;
|
815
|
+
|
816
|
+
// get innermost container that intersects with item
|
817
|
+
for (i = this.containers.length - 1; i >= 0; i--) {
|
818
|
+
|
819
|
+
// never consider a container that's located within the item itself
|
820
|
+
if($.contains(this.currentItem[0], this.containers[i].element[0])) {
|
821
|
+
continue;
|
822
|
+
}
|
823
|
+
|
824
|
+
if(this._intersectsWith(this.containers[i].containerCache)) {
|
825
|
+
|
826
|
+
// if we've already found a container and it's more "inner" than this, then continue
|
827
|
+
if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) {
|
828
|
+
continue;
|
829
|
+
}
|
830
|
+
|
831
|
+
innermostContainer = this.containers[i];
|
832
|
+
innermostIndex = i;
|
833
|
+
|
834
|
+
} else {
|
835
|
+
// container doesn't intersect. trigger "out" event if necessary
|
836
|
+
if(this.containers[i].containerCache.over) {
|
837
|
+
this.containers[i]._trigger("out", event, this._uiHash(this));
|
838
|
+
this.containers[i].containerCache.over = 0;
|
839
|
+
}
|
840
|
+
}
|
841
|
+
|
842
|
+
}
|
843
|
+
|
844
|
+
// if no intersecting containers found, return
|
845
|
+
if(!innermostContainer) {
|
846
|
+
return;
|
847
|
+
}
|
848
|
+
|
849
|
+
// move the item into the container if it's not there already
|
850
|
+
if(this.containers.length === 1) {
|
851
|
+
if (!this.containers[innermostIndex].containerCache.over) {
|
852
|
+
this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
|
853
|
+
this.containers[innermostIndex].containerCache.over = 1;
|
854
|
+
}
|
855
|
+
} else {
|
856
|
+
|
857
|
+
//When entering a new container, we will find the item with the least distance and append our item near it
|
858
|
+
dist = 10000;
|
859
|
+
itemWithLeastDistance = null;
|
860
|
+
floating = innermostContainer.floating || isFloating(this.currentItem);
|
861
|
+
posProperty = floating ? "left" : "top";
|
862
|
+
sizeProperty = floating ? "width" : "height";
|
863
|
+
base = this.positionAbs[posProperty] + this.offset.click[posProperty];
|
864
|
+
for (j = this.items.length - 1; j >= 0; j--) {
|
865
|
+
if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) {
|
866
|
+
continue;
|
867
|
+
}
|
868
|
+
if(this.items[j].item[0] === this.currentItem[0]) {
|
869
|
+
continue;
|
870
|
+
}
|
871
|
+
if (floating && !isOverAxis(this.positionAbs.top + this.offset.click.top, this.items[j].top, this.items[j].height)) {
|
872
|
+
continue;
|
873
|
+
}
|
874
|
+
cur = this.items[j].item.offset()[posProperty];
|
875
|
+
nearBottom = false;
|
876
|
+
if(Math.abs(cur - base) > Math.abs(cur + this.items[j][sizeProperty] - base)){
|
877
|
+
nearBottom = true;
|
878
|
+
cur += this.items[j][sizeProperty];
|
879
|
+
}
|
880
|
+
|
881
|
+
if(Math.abs(cur - base) < dist) {
|
882
|
+
dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j];
|
883
|
+
this.direction = nearBottom ? "up": "down";
|
884
|
+
}
|
885
|
+
}
|
886
|
+
|
887
|
+
//Check if dropOnEmpty is enabled
|
888
|
+
if(!itemWithLeastDistance && !this.options.dropOnEmpty) {
|
889
|
+
return;
|
890
|
+
}
|
891
|
+
|
892
|
+
if(this.currentContainer === this.containers[innermostIndex]) {
|
893
|
+
return;
|
894
|
+
}
|
895
|
+
|
896
|
+
itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);
|
897
|
+
this._trigger("change", event, this._uiHash());
|
898
|
+
this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));
|
899
|
+
this.currentContainer = this.containers[innermostIndex];
|
900
|
+
|
901
|
+
//Update the placeholder
|
902
|
+
this.options.placeholder.update(this.currentContainer, this.placeholder);
|
903
|
+
|
904
|
+
this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
|
905
|
+
this.containers[innermostIndex].containerCache.over = 1;
|
906
|
+
}
|
907
|
+
|
908
|
+
|
909
|
+
},
|
910
|
+
|
911
|
+
_createHelper: function(event) {
|
912
|
+
|
913
|
+
var o = this.options,
|
914
|
+
helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper === "clone" ? this.currentItem.clone() : this.currentItem);
|
915
|
+
|
916
|
+
//Add the helper to the DOM if that didn't happen already
|
917
|
+
if(!helper.parents("body").length) {
|
918
|
+
$(o.appendTo !== "parent" ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);
|
919
|
+
}
|
920
|
+
|
921
|
+
if(helper[0] === this.currentItem[0]) {
|
922
|
+
this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") };
|
923
|
+
}
|
924
|
+
|
925
|
+
if(!helper[0].style.width || o.forceHelperSize) {
|
926
|
+
helper.width(this.currentItem.width());
|
927
|
+
}
|
928
|
+
if(!helper[0].style.height || o.forceHelperSize) {
|
929
|
+
helper.height(this.currentItem.height());
|
930
|
+
}
|
931
|
+
|
932
|
+
return helper;
|
933
|
+
|
934
|
+
},
|
935
|
+
|
936
|
+
_adjustOffsetFromHelper: function(obj) {
|
937
|
+
if (typeof obj === "string") {
|
938
|
+
obj = obj.split(" ");
|
939
|
+
}
|
940
|
+
if ($.isArray(obj)) {
|
941
|
+
obj = {left: +obj[0], top: +obj[1] || 0};
|
942
|
+
}
|
943
|
+
if ("left" in obj) {
|
944
|
+
this.offset.click.left = obj.left + this.margins.left;
|
945
|
+
}
|
946
|
+
if ("right" in obj) {
|
947
|
+
this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
|
948
|
+
}
|
949
|
+
if ("top" in obj) {
|
950
|
+
this.offset.click.top = obj.top + this.margins.top;
|
951
|
+
}
|
952
|
+
if ("bottom" in obj) {
|
953
|
+
this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
|
954
|
+
}
|
955
|
+
},
|
956
|
+
|
957
|
+
_getParentOffset: function() {
|
958
|
+
|
959
|
+
|
960
|
+
//Get the offsetParent and cache its position
|
961
|
+
this.offsetParent = this.helper.offsetParent();
|
962
|
+
var po = this.offsetParent.offset();
|
963
|
+
|
964
|
+
// This is a special case where we need to modify a offset calculated on start, since the following happened:
|
965
|
+
// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
|
966
|
+
// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
|
967
|
+
// the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
|
968
|
+
if(this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
|
969
|
+
po.left += this.scrollParent.scrollLeft();
|
970
|
+
po.top += this.scrollParent.scrollTop();
|
971
|
+
}
|
972
|
+
|
973
|
+
// This needs to be actually done for all browsers, since pageX/pageY includes this information
|
974
|
+
// with an ugly IE fix
|
975
|
+
if( this.offsetParent[0] === document.body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
|
976
|
+
po = { top: 0, left: 0 };
|
977
|
+
}
|
978
|
+
|
979
|
+
return {
|
980
|
+
top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
|
981
|
+
left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
|
982
|
+
};
|
983
|
+
|
984
|
+
},
|
985
|
+
|
986
|
+
_getRelativeOffset: function() {
|
987
|
+
|
988
|
+
if(this.cssPosition === "relative") {
|
989
|
+
var p = this.currentItem.position();
|
990
|
+
return {
|
991
|
+
top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
|
992
|
+
left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
|
993
|
+
};
|
994
|
+
} else {
|
995
|
+
return { top: 0, left: 0 };
|
996
|
+
}
|
997
|
+
|
998
|
+
},
|
999
|
+
|
1000
|
+
_cacheMargins: function() {
|
1001
|
+
this.margins = {
|
1002
|
+
left: (parseInt(this.currentItem.css("marginLeft"),10) || 0),
|
1003
|
+
top: (parseInt(this.currentItem.css("marginTop"),10) || 0)
|
1004
|
+
};
|
1005
|
+
},
|
1006
|
+
|
1007
|
+
_cacheHelperProportions: function() {
|
1008
|
+
this.helperProportions = {
|
1009
|
+
width: this.helper.outerWidth(),
|
1010
|
+
height: this.helper.outerHeight()
|
1011
|
+
};
|
1012
|
+
},
|
1013
|
+
|
1014
|
+
_setContainment: function() {
|
1015
|
+
|
1016
|
+
var ce, co, over,
|
1017
|
+
o = this.options;
|
1018
|
+
if(o.containment === "parent") {
|
1019
|
+
o.containment = this.helper[0].parentNode;
|
1020
|
+
}
|
1021
|
+
if(o.containment === "document" || o.containment === "window") {
|
1022
|
+
this.containment = [
|
1023
|
+
0 - this.offset.relative.left - this.offset.parent.left,
|
1024
|
+
0 - this.offset.relative.top - this.offset.parent.top,
|
1025
|
+
$(o.containment === "document" ? document : window).width() - this.helperProportions.width - this.margins.left,
|
1026
|
+
($(o.containment === "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
|
1027
|
+
];
|
1028
|
+
}
|
1029
|
+
|
1030
|
+
if(!(/^(document|window|parent)$/).test(o.containment)) {
|
1031
|
+
ce = $(o.containment)[0];
|
1032
|
+
co = $(o.containment).offset();
|
1033
|
+
over = ($(ce).css("overflow") !== "hidden");
|
1034
|
+
|
1035
|
+
this.containment = [
|
1036
|
+
co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
|
1037
|
+
co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
|
1038
|
+
co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
|
1039
|
+
co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
|
1040
|
+
];
|
1041
|
+
}
|
1042
|
+
|
1043
|
+
},
|
1044
|
+
|
1045
|
+
_convertPositionTo: function(d, pos) {
|
1046
|
+
|
1047
|
+
if(!pos) {
|
1048
|
+
pos = this.position;
|
1049
|
+
}
|
1050
|
+
var mod = d === "absolute" ? 1 : -1,
|
1051
|
+
scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,
|
1052
|
+
scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
|
1053
|
+
|
1054
|
+
return {
|
1055
|
+
top: (
|
1056
|
+
pos.top + // The absolute mouse position
|
1057
|
+
this.offset.relative.top * mod + // Only for relative positioned nodes: Relative offset from element to offset parent
|
1058
|
+
this.offset.parent.top * mod - // The offsetParent's offset without borders (offset + border)
|
1059
|
+
( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
|
1060
|
+
),
|
1061
|
+
left: (
|
1062
|
+
pos.left + // The absolute mouse position
|
1063
|
+
this.offset.relative.left * mod + // Only for relative positioned nodes: Relative offset from element to offset parent
|
1064
|
+
this.offset.parent.left * mod - // The offsetParent's offset without borders (offset + border)
|
1065
|
+
( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
|
1066
|
+
)
|
1067
|
+
};
|
1068
|
+
|
1069
|
+
},
|
1070
|
+
|
1071
|
+
_generatePosition: function(event) {
|
1072
|
+
|
1073
|
+
var top, left,
|
1074
|
+
o = this.options,
|
1075
|
+
pageX = event.pageX,
|
1076
|
+
pageY = event.pageY,
|
1077
|
+
scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
|
1078
|
+
|
1079
|
+
// This is another very weird special case that only happens for relative elements:
|
1080
|
+
// 1. If the css position is relative
|
1081
|
+
// 2. and the scroll parent is the document or similar to the offset parent
|
1082
|
+
// we have to refresh the relative offset during the scroll so there are no jumps
|
1083
|
+
if(this.cssPosition === "relative" && !(this.scrollParent[0] !== document && this.scrollParent[0] !== this.offsetParent[0])) {
|
1084
|
+
this.offset.relative = this._getRelativeOffset();
|
1085
|
+
}
|
1086
|
+
|
1087
|
+
/*
|
1088
|
+
* - Position constraining -
|
1089
|
+
* Constrain the position to a mix of grid, containment.
|
1090
|
+
*/
|
1091
|
+
|
1092
|
+
if(this.originalPosition) { //If we are not dragging yet, we won't check for options
|
1093
|
+
|
1094
|
+
if(this.containment) {
|
1095
|
+
if(event.pageX - this.offset.click.left < this.containment[0]) {
|
1096
|
+
pageX = this.containment[0] + this.offset.click.left;
|
1097
|
+
}
|
1098
|
+
if(event.pageY - this.offset.click.top < this.containment[1]) {
|
1099
|
+
pageY = this.containment[1] + this.offset.click.top;
|
1100
|
+
}
|
1101
|
+
if(event.pageX - this.offset.click.left > this.containment[2]) {
|
1102
|
+
pageX = this.containment[2] + this.offset.click.left;
|
1103
|
+
}
|
1104
|
+
if(event.pageY - this.offset.click.top > this.containment[3]) {
|
1105
|
+
pageY = this.containment[3] + this.offset.click.top;
|
1106
|
+
}
|
1107
|
+
}
|
1108
|
+
|
1109
|
+
if(o.grid) {
|
1110
|
+
top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
|
1111
|
+
pageY = this.containment ? ( (top - this.offset.click.top >= this.containment[1] && top - this.offset.click.top <= this.containment[3]) ? top : ((top - this.offset.click.top >= this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
|
1112
|
+
|
1113
|
+
left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
|
1114
|
+
pageX = this.containment ? ( (left - this.offset.click.left >= this.containment[0] && left - this.offset.click.left <= this.containment[2]) ? left : ((left - this.offset.click.left >= this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
|
1115
|
+
}
|
1116
|
+
|
1117
|
+
}
|
1118
|
+
|
1119
|
+
return {
|
1120
|
+
top: (
|
1121
|
+
pageY - // The absolute mouse position
|
1122
|
+
this.offset.click.top - // Click offset (relative to the element)
|
1123
|
+
this.offset.relative.top - // Only for relative positioned nodes: Relative offset from element to offset parent
|
1124
|
+
this.offset.parent.top + // The offsetParent's offset without borders (offset + border)
|
1125
|
+
( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
|
1126
|
+
),
|
1127
|
+
left: (
|
1128
|
+
pageX - // The absolute mouse position
|
1129
|
+
this.offset.click.left - // Click offset (relative to the element)
|
1130
|
+
this.offset.relative.left - // Only for relative positioned nodes: Relative offset from element to offset parent
|
1131
|
+
this.offset.parent.left + // The offsetParent's offset without borders (offset + border)
|
1132
|
+
( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
|
1133
|
+
)
|
1134
|
+
};
|
1135
|
+
|
1136
|
+
},
|
1137
|
+
|
1138
|
+
_rearrange: function(event, i, a, hardRefresh) {
|
1139
|
+
|
1140
|
+
a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction === "down" ? i.item[0] : i.item[0].nextSibling));
|
1141
|
+
|
1142
|
+
//Various things done here to improve the performance:
|
1143
|
+
// 1. we create a setTimeout, that calls refreshPositions
|
1144
|
+
// 2. on the instance, we have a counter variable, that get's higher after every append
|
1145
|
+
// 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same
|
1146
|
+
// 4. this lets only the last addition to the timeout stack through
|
1147
|
+
this.counter = this.counter ? ++this.counter : 1;
|
1148
|
+
var counter = this.counter;
|
1149
|
+
|
1150
|
+
this._delay(function() {
|
1151
|
+
if(counter === this.counter) {
|
1152
|
+
this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove
|
1153
|
+
}
|
1154
|
+
});
|
1155
|
+
|
1156
|
+
},
|
1157
|
+
|
1158
|
+
_clear: function(event, noPropagation) {
|
1159
|
+
|
1160
|
+
this.reverting = false;
|
1161
|
+
// We delay all events that have to be triggered to after the point where the placeholder has been removed and
|
1162
|
+
// everything else normalized again
|
1163
|
+
var i,
|
1164
|
+
delayedTriggers = [];
|
1165
|
+
|
1166
|
+
// We first have to update the dom position of the actual currentItem
|
1167
|
+
// Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)
|
1168
|
+
if(!this._noFinalSort && this.currentItem.parent().length) {
|
1169
|
+
this.placeholder.before(this.currentItem);
|
1170
|
+
}
|
1171
|
+
this._noFinalSort = null;
|
1172
|
+
|
1173
|
+
if(this.helper[0] === this.currentItem[0]) {
|
1174
|
+
for(i in this._storedCSS) {
|
1175
|
+
if(this._storedCSS[i] === "auto" || this._storedCSS[i] === "static") {
|
1176
|
+
this._storedCSS[i] = "";
|
1177
|
+
}
|
1178
|
+
}
|
1179
|
+
this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
|
1180
|
+
} else {
|
1181
|
+
this.currentItem.show();
|
1182
|
+
}
|
1183
|
+
|
1184
|
+
if(this.fromOutside && !noPropagation) {
|
1185
|
+
delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });
|
1186
|
+
}
|
1187
|
+
if((this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !noPropagation) {
|
1188
|
+
delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed
|
1189
|
+
}
|
1190
|
+
|
1191
|
+
// Check if the items Container has Changed and trigger appropriate
|
1192
|
+
// events.
|
1193
|
+
if (this !== this.currentContainer) {
|
1194
|
+
if(!noPropagation) {
|
1195
|
+
delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });
|
1196
|
+
delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.currentContainer));
|
1197
|
+
delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.currentContainer));
|
1198
|
+
}
|
1199
|
+
}
|
1200
|
+
|
1201
|
+
|
1202
|
+
//Post events to containers
|
1203
|
+
function delayEvent( type, instance, container ) {
|
1204
|
+
return function( event ) {
|
1205
|
+
container._trigger( type, event, instance._uiHash( instance ) );
|
1206
|
+
};
|
1207
|
+
}
|
1208
|
+
for (i = this.containers.length - 1; i >= 0; i--){
|
1209
|
+
if (!noPropagation) {
|
1210
|
+
delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) );
|
1211
|
+
}
|
1212
|
+
if(this.containers[i].containerCache.over) {
|
1213
|
+
delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) );
|
1214
|
+
this.containers[i].containerCache.over = 0;
|
1215
|
+
}
|
1216
|
+
}
|
1217
|
+
|
1218
|
+
//Do what was originally in plugins
|
1219
|
+
if ( this.storedCursor ) {
|
1220
|
+
this.document.find( "body" ).css( "cursor", this.storedCursor );
|
1221
|
+
this.storedStylesheet.remove();
|
1222
|
+
}
|
1223
|
+
if(this._storedOpacity) {
|
1224
|
+
this.helper.css("opacity", this._storedOpacity);
|
1225
|
+
}
|
1226
|
+
if(this._storedZIndex) {
|
1227
|
+
this.helper.css("zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex);
|
1228
|
+
}
|
1229
|
+
|
1230
|
+
this.dragging = false;
|
1231
|
+
if(this.cancelHelperRemoval) {
|
1232
|
+
if(!noPropagation) {
|
1233
|
+
this._trigger("beforeStop", event, this._uiHash());
|
1234
|
+
for (i=0; i < delayedTriggers.length; i++) {
|
1235
|
+
delayedTriggers[i].call(this, event);
|
1236
|
+
} //Trigger all delayed events
|
1237
|
+
this._trigger("stop", event, this._uiHash());
|
1238
|
+
}
|
1239
|
+
|
1240
|
+
this.fromOutside = false;
|
1241
|
+
return false;
|
1242
|
+
}
|
1243
|
+
|
1244
|
+
if(!noPropagation) {
|
1245
|
+
this._trigger("beforeStop", event, this._uiHash());
|
1246
|
+
}
|
1247
|
+
|
1248
|
+
//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
|
1249
|
+
this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
|
1250
|
+
|
1251
|
+
if(this.helper[0] !== this.currentItem[0]) {
|
1252
|
+
this.helper.remove();
|
1253
|
+
}
|
1254
|
+
this.helper = null;
|
1255
|
+
|
1256
|
+
if(!noPropagation) {
|
1257
|
+
for (i=0; i < delayedTriggers.length; i++) {
|
1258
|
+
delayedTriggers[i].call(this, event);
|
1259
|
+
} //Trigger all delayed events
|
1260
|
+
this._trigger("stop", event, this._uiHash());
|
1261
|
+
}
|
1262
|
+
|
1263
|
+
this.fromOutside = false;
|
1264
|
+
return true;
|
1265
|
+
|
1266
|
+
},
|
1267
|
+
|
1268
|
+
_trigger: function() {
|
1269
|
+
if ($.Widget.prototype._trigger.apply(this, arguments) === false) {
|
1270
|
+
this.cancel();
|
1271
|
+
}
|
1272
|
+
},
|
1273
|
+
|
1274
|
+
_uiHash: function(_inst) {
|
1275
|
+
var inst = _inst || this;
|
1276
|
+
return {
|
1277
|
+
helper: inst.helper,
|
1278
|
+
placeholder: inst.placeholder || $([]),
|
1279
|
+
position: inst.position,
|
1280
|
+
originalPosition: inst.originalPosition,
|
1281
|
+
offset: inst.positionAbs,
|
1282
|
+
item: inst.currentItem,
|
1283
|
+
sender: _inst ? _inst.element : null
|
1284
|
+
};
|
1285
|
+
}
|
1286
|
+
|
1287
|
+
});
|
1288
|
+
|
1289
|
+
})(jQuery);
|