From 21154cfa2e02ef1814a6aff68b14553bdad165cb Mon Sep 17 00:00:00 2001 From: Rafael Xavier de Souza Date: Mon, 2 Dec 2013 16:36:12 -0200 Subject: All: Rename all files, removing the "jquery.ui." prefix; - By executing https://gist.github.com/jzaefferer/893fcf70b7eebc1dc271; Fixes #9464 Closes gh-1029 --- Gruntfile.js | 22 +- demos/accordion/collapsible.html | 8 +- demos/accordion/custom-icons.html | 10 +- demos/accordion/default.html | 8 +- demos/accordion/fillspace.html | 12 +- demos/accordion/hoverintent.html | 8 +- demos/accordion/no-auto-height.html | 8 +- demos/accordion/sortable.html | 12 +- demos/autocomplete/categories.html | 12 +- demos/autocomplete/combobox.html | 16 +- demos/autocomplete/custom-data.html | 12 +- demos/autocomplete/default.html | 12 +- demos/autocomplete/folding.html | 12 +- demos/autocomplete/maxheight.html | 12 +- demos/autocomplete/multiple-remote.html | 12 +- demos/autocomplete/multiple.html | 12 +- demos/autocomplete/remote-jsonp.html | 12 +- demos/autocomplete/remote-with-cache.html | 12 +- demos/autocomplete/remote.html | 12 +- demos/autocomplete/xml.html | 12 +- demos/button/checkbox.html | 8 +- demos/button/default.html | 8 +- demos/button/icons.html | 8 +- demos/button/radio.html | 8 +- demos/button/splitbutton.html | 12 +- demos/button/toolbar.html | 8 +- demos/datepicker/alt-field.html | 8 +- demos/datepicker/animation.html | 22 +- demos/datepicker/buttonbar.html | 8 +- demos/datepicker/date-formats.html | 8 +- demos/datepicker/date-range.html | 8 +- demos/datepicker/datepicker-ar.js | 36 + demos/datepicker/datepicker-fr.js | 38 + demos/datepicker/datepicker-he.js | 36 + demos/datepicker/datepicker-zh-TW.js | 36 + demos/datepicker/default.html | 8 +- demos/datepicker/dropdown-month-year.html | 8 +- demos/datepicker/icon-trigger.html | 8 +- demos/datepicker/inline.html | 8 +- demos/datepicker/jquery.ui.datepicker-ar.js | 36 - demos/datepicker/jquery.ui.datepicker-fr.js | 38 - demos/datepicker/jquery.ui.datepicker-he.js | 36 - demos/datepicker/jquery.ui.datepicker-zh-TW.js | 36 - demos/datepicker/localization.html | 16 +- demos/datepicker/min-max.html | 8 +- demos/datepicker/multiple-calendars.html | 8 +- demos/datepicker/other-months.html | 8 +- demos/datepicker/show-week.html | 8 +- demos/dialog/animated.html | 24 +- demos/dialog/default.html | 18 +- demos/dialog/modal-confirmation.html | 16 +- demos/dialog/modal-form.html | 20 +- demos/dialog/modal-message.html | 18 +- demos/dialog/modal.html | 18 +- demos/draggable/constrain-movement.html | 10 +- demos/draggable/cursor-style.html | 10 +- demos/draggable/default.html | 10 +- demos/draggable/delay-start.html | 10 +- demos/draggable/events.html | 10 +- demos/draggable/handle.html | 10 +- demos/draggable/revert.html | 10 +- demos/draggable/scroll.html | 10 +- demos/draggable/snap-to.html | 10 +- demos/draggable/sortable.html | 12 +- demos/draggable/visual-feedback.html | 10 +- demos/droppable/accepted-elements.html | 12 +- demos/droppable/default.html | 12 +- demos/droppable/photo-manager.html | 18 +- demos/droppable/propagation.html | 12 +- demos/droppable/revert.html | 12 +- demos/droppable/shopping-cart.html | 16 +- demos/droppable/visual-feedback.html | 12 +- demos/effect/addClass.html | 4 +- demos/effect/animate.html | 4 +- demos/effect/default.html | 34 +- demos/effect/easing.html | 4 +- demos/effect/hide.html | 26 +- demos/effect/removeClass.html | 4 +- demos/effect/show.html | 26 +- demos/effect/switchClass.html | 4 +- demos/effect/toggle.html | 26 +- demos/effect/toggleClass.html | 4 +- demos/menu/default.html | 10 +- demos/menu/icons.html | 10 +- demos/position/cycler.html | 8 +- demos/position/default.html | 12 +- demos/progressbar/default.html | 8 +- demos/progressbar/download.html | 18 +- demos/progressbar/indeterminate.html | 8 +- demos/progressbar/label.html | 8 +- demos/resizable/animate.html | 10 +- demos/resizable/aspect-ratio.html | 10 +- demos/resizable/constrain-area.html | 10 +- demos/resizable/default.html | 10 +- demos/resizable/delay-start.html | 10 +- demos/resizable/helper.html | 10 +- demos/resizable/max-min.html | 10 +- demos/resizable/snap-to-grid.html | 10 +- demos/resizable/synchronous-resize.html | 10 +- demos/resizable/textarea.html | 10 +- demos/resizable/visual-feedback.html | 10 +- demos/selectable/default.html | 10 +- demos/selectable/display-grid.html | 10 +- demos/selectable/serialize.html | 10 +- demos/selectmenu/custom_render.html | 12 +- demos/selectmenu/default.html | 12 +- demos/slider/colorpicker.html | 10 +- demos/slider/default.html | 10 +- demos/slider/hotelrooms.html | 10 +- demos/slider/multiple-vertical.html | 10 +- demos/slider/range-vertical.html | 10 +- demos/slider/range.html | 10 +- demos/slider/rangemax.html | 10 +- demos/slider/rangemin.html | 10 +- demos/slider/side-scroll.html | 10 +- demos/slider/slider-vertical.html | 10 +- demos/slider/steps.html | 10 +- demos/sortable/connect-lists-through-tabs.html | 14 +- demos/sortable/connect-lists.html | 10 +- demos/sortable/default.html | 10 +- demos/sortable/delay-start.html | 10 +- demos/sortable/display-grid.html | 10 +- demos/sortable/empty-lists.html | 10 +- demos/sortable/items.html | 10 +- demos/sortable/placeholder.html | 10 +- demos/sortable/portlets.html | 10 +- demos/spinner/currency.html | 10 +- demos/spinner/decimal.html | 10 +- demos/spinner/default.html | 10 +- demos/spinner/latlong.html | 10 +- demos/spinner/overflow.html | 10 +- demos/spinner/time.html | 10 +- demos/tabs/ajax.html | 8 +- demos/tabs/bottom.html | 8 +- demos/tabs/collapsible.html | 8 +- demos/tabs/default.html | 8 +- demos/tabs/manipulation.html | 14 +- demos/tabs/mouseover.html | 8 +- demos/tabs/sortable.html | 12 +- demos/tabs/vertical.html | 8 +- demos/tooltip/custom-animation.html | 14 +- demos/tooltip/custom-content.html | 10 +- demos/tooltip/custom-style.html | 10 +- demos/tooltip/default.html | 10 +- demos/tooltip/forms.html | 12 +- demos/tooltip/tracking.html | 10 +- demos/tooltip/video-player.html | 18 +- demos/widget/default.html | 10 +- tests/index.html | 4 +- tests/unit/accordion/accordion.html | 8 +- tests/unit/autocomplete/autocomplete.html | 12 +- tests/unit/button/button.html | 8 +- tests/unit/core/core.html | 2 +- tests/unit/core/core_deprecated.html | 2 +- tests/unit/datepicker/datepicker.html | 12 +- tests/unit/dialog/dialog.html | 26 +- tests/unit/draggable/draggable.html | 14 +- tests/unit/droppable/droppable.html | 12 +- tests/unit/effects/effects.html | 32 +- tests/unit/index.html | 4 +- tests/unit/menu/menu.html | 8 +- tests/unit/position/position.html | 2 +- tests/unit/progressbar/progressbar.html | 8 +- tests/unit/resizable/resizable.html | 10 +- tests/unit/selectable/selectable.html | 10 +- tests/unit/selectmenu/selectmenu.html | 12 +- tests/unit/slider/slider.html | 10 +- tests/unit/sortable/sortable.html | 10 +- tests/unit/spinner/spinner.html | 10 +- tests/unit/tabs/tabs.html | 8 +- tests/unit/testsuite.js | 4 +- tests/unit/tooltip/tooltip.html | 10 +- tests/unit/widget/widget.html | 4 +- tests/visual/accordion/icons.html | 8 +- tests/visual/addClass/queue.html | 4 +- tests/visual/button/button.html | 8 +- tests/visual/button/performance.html | 8 +- tests/visual/compound/accordion_tabs.html | 10 +- tests/visual/compound/datepicker_dialog.html | 18 +- tests/visual/compound/dialog_widgets.html | 36 +- tests/visual/compound/draggable_accordion.html | 12 +- ...aggable_accordion_accordion_tabs_draggable.html | 14 +- .../compound/sortable_accordion_sortable_tabs.html | 14 +- tests/visual/compound/tabs_selectmenu.html | 14 +- tests/visual/compound/tabs_tabs.html | 10 +- tests/visual/compound/tabs_tooltips.html | 12 +- tests/visual/dialog/animated.html | 24 +- tests/visual/dialog/complex-dialogs.html | 26 +- tests/visual/dialog/form.html | 24 +- tests/visual/dialog/performance.html | 18 +- tests/visual/dialog/stacking.html | 18 +- tests/visual/effects/all.html | 28 +- tests/visual/effects/scale.html | 4 +- tests/visual/index.html | 4 +- tests/visual/menu/menu.html | 10 +- tests/visual/position/position.html | 10 +- tests/visual/position/position_feedback.html | 10 +- tests/visual/selectmenu/selectmenu.html | 12 +- tests/visual/theme.html | 36 +- tests/visual/tooltip/animations.html | 20 +- tests/visual/tooltip/tooltip.html | 12 +- themes/base/accordion.css | 36 + themes/base/all.css | 12 + themes/base/autocomplete.css | 16 + themes/base/base.css | 28 + themes/base/button.css | 114 ++ themes/base/core.css | 93 + themes/base/datepicker.css | 175 ++ themes/base/dialog.css | 70 + themes/base/draggable.css | 12 + themes/base/jquery.ui.accordion.css | 36 - themes/base/jquery.ui.all.css | 12 - themes/base/jquery.ui.autocomplete.css | 16 - themes/base/jquery.ui.base.css | 28 - themes/base/jquery.ui.button.css | 114 -- themes/base/jquery.ui.core.css | 93 - themes/base/jquery.ui.datepicker.css | 175 -- themes/base/jquery.ui.dialog.css | 70 - themes/base/jquery.ui.draggable.css | 12 - themes/base/jquery.ui.menu.css | 63 - themes/base/jquery.ui.progressbar.css | 28 - themes/base/jquery.ui.resizable.css | 78 - themes/base/jquery.ui.selectable.css | 17 - themes/base/jquery.ui.selectmenu.css | 59 - themes/base/jquery.ui.slider.css | 75 - themes/base/jquery.ui.sortable.css | 12 - themes/base/jquery.ui.spinner.css | 65 - themes/base/jquery.ui.tabs.css | 51 - themes/base/jquery.ui.theme.css | 410 ---- themes/base/jquery.ui.tooltip.css | 21 - themes/base/menu.css | 63 + themes/base/progressbar.css | 28 + themes/base/resizable.css | 78 + themes/base/selectable.css | 17 + themes/base/selectmenu.css | 59 + themes/base/slider.css | 75 + themes/base/sortable.css | 12 + themes/base/spinner.css | 65 + themes/base/tabs.css | 51 + themes/base/theme.css | 410 ++++ themes/base/tooltip.css | 21 + ui/accordion.js | 575 ++++++ ui/autocomplete.js | 617 ++++++ ui/button.js | 405 ++++ ui/core.js | 299 +++ ui/datepicker.js | 2071 ++++++++++++++++++++ ui/dialog.js | 854 ++++++++ ui/draggable.js | 1019 ++++++++++ ui/droppable.js | 416 ++++ ui/effect-blind.js | 90 + ui/effect-bounce.js | 123 ++ ui/effect-clip.js | 77 + ui/effect-drop.js | 75 + ui/effect-explode.js | 107 + ui/effect-fade.js | 40 + ui/effect-fold.js | 86 + ui/effect-highlight.js | 60 + ui/effect-puff.js | 60 + ui/effect-pulsate.js | 73 + ui/effect-scale.js | 89 + ui/effect-shake.js | 84 + ui/effect-size.js | 233 +++ ui/effect-slide.js | 74 + ui/effect-transfer.js | 57 + ui/effect.js | 1297 ++++++++++++ ui/i18n/datepicker-af.js | 36 + ui/i18n/datepicker-ar-DZ.js | 36 + ui/i18n/datepicker-ar.js | 36 + ui/i18n/datepicker-az.js | 36 + ui/i18n/datepicker-be.js | 36 + ui/i18n/datepicker-bg.js | 37 + ui/i18n/datepicker-bs.js | 36 + ui/i18n/datepicker-ca.js | 36 + ui/i18n/datepicker-cs.js | 36 + ui/i18n/datepicker-cy-GB.js | 36 + ui/i18n/datepicker-da.js | 36 + ui/i18n/datepicker-de.js | 36 + ui/i18n/datepicker-el.js | 36 + ui/i18n/datepicker-en-AU.js | 36 + ui/i18n/datepicker-en-GB.js | 36 + ui/i18n/datepicker-en-NZ.js | 36 + ui/i18n/datepicker-eo.js | 36 + ui/i18n/datepicker-es.js | 36 + ui/i18n/datepicker-et.js | 36 + ui/i18n/datepicker-eu.js | 36 + ui/i18n/datepicker-fa.js | 72 + ui/i18n/datepicker-fi.js | 36 + ui/i18n/datepicker-fo.js | 36 + ui/i18n/datepicker-fr-CA.js | 36 + ui/i18n/datepicker-fr-CH.js | 36 + ui/i18n/datepicker-fr.js | 38 + ui/i18n/datepicker-gl.js | 36 + ui/i18n/datepicker-he.js | 36 + ui/i18n/datepicker-hi.js | 36 + ui/i18n/datepicker-hr.js | 36 + ui/i18n/datepicker-hu.js | 36 + ui/i18n/datepicker-hy.js | 36 + ui/i18n/datepicker-id.js | 36 + ui/i18n/datepicker-is.js | 36 + ui/i18n/datepicker-it-CH.js | 36 + ui/i18n/datepicker-it.js | 36 + ui/i18n/datepicker-ja.js | 36 + ui/i18n/datepicker-ka.js | 34 + ui/i18n/datepicker-kk.js | 36 + ui/i18n/datepicker-km.js | 36 + ui/i18n/datepicker-ko.js | 36 + ui/i18n/datepicker-ky.js | 37 + ui/i18n/datepicker-lb.js | 36 + ui/i18n/datepicker-lt.js | 36 + ui/i18n/datepicker-lv.js | 36 + ui/i18n/datepicker-mk.js | 36 + ui/i18n/datepicker-ml.js | 36 + ui/i18n/datepicker-ms.js | 36 + ui/i18n/datepicker-nb.js | 35 + ui/i18n/datepicker-nl-BE.js | 36 + ui/i18n/datepicker-nl.js | 36 + ui/i18n/datepicker-nn.js | 35 + ui/i18n/datepicker-no.js | 36 + ui/i18n/datepicker-pl.js | 36 + ui/i18n/datepicker-pt-BR.js | 36 + ui/i18n/datepicker-pt.js | 35 + ui/i18n/datepicker-rm.js | 34 + ui/i18n/datepicker-ro.js | 39 + ui/i18n/datepicker-ru.js | 36 + ui/i18n/datepicker-sk.js | 36 + ui/i18n/datepicker-sl.js | 37 + ui/i18n/datepicker-sq.js | 36 + ui/i18n/datepicker-sr-SR.js | 36 + ui/i18n/datepicker-sr.js | 36 + ui/i18n/datepicker-sv.js | 36 + ui/i18n/datepicker-ta.js | 36 + ui/i18n/datepicker-th.js | 36 + ui/i18n/datepicker-tj.js | 36 + ui/i18n/datepicker-tr.js | 36 + ui/i18n/datepicker-uk.js | 37 + ui/i18n/datepicker-vi.js | 36 + ui/i18n/datepicker-zh-CN.js | 36 + ui/i18n/datepicker-zh-HK.js | 36 + ui/i18n/datepicker-zh-TW.js | 36 + ui/i18n/jquery.ui.datepicker-af.js | 36 - ui/i18n/jquery.ui.datepicker-ar-DZ.js | 36 - ui/i18n/jquery.ui.datepicker-ar.js | 36 - ui/i18n/jquery.ui.datepicker-az.js | 36 - ui/i18n/jquery.ui.datepicker-be.js | 36 - ui/i18n/jquery.ui.datepicker-bg.js | 37 - ui/i18n/jquery.ui.datepicker-bs.js | 36 - ui/i18n/jquery.ui.datepicker-ca.js | 36 - ui/i18n/jquery.ui.datepicker-cs.js | 36 - ui/i18n/jquery.ui.datepicker-cy-GB.js | 36 - ui/i18n/jquery.ui.datepicker-da.js | 36 - ui/i18n/jquery.ui.datepicker-de.js | 36 - ui/i18n/jquery.ui.datepicker-el.js | 36 - ui/i18n/jquery.ui.datepicker-en-AU.js | 36 - ui/i18n/jquery.ui.datepicker-en-GB.js | 36 - ui/i18n/jquery.ui.datepicker-en-NZ.js | 36 - ui/i18n/jquery.ui.datepicker-eo.js | 36 - ui/i18n/jquery.ui.datepicker-es.js | 36 - ui/i18n/jquery.ui.datepicker-et.js | 36 - ui/i18n/jquery.ui.datepicker-eu.js | 36 - ui/i18n/jquery.ui.datepicker-fa.js | 72 - ui/i18n/jquery.ui.datepicker-fi.js | 36 - ui/i18n/jquery.ui.datepicker-fo.js | 36 - ui/i18n/jquery.ui.datepicker-fr-CA.js | 36 - ui/i18n/jquery.ui.datepicker-fr-CH.js | 36 - ui/i18n/jquery.ui.datepicker-fr.js | 38 - ui/i18n/jquery.ui.datepicker-gl.js | 36 - ui/i18n/jquery.ui.datepicker-he.js | 36 - ui/i18n/jquery.ui.datepicker-hi.js | 36 - ui/i18n/jquery.ui.datepicker-hr.js | 36 - ui/i18n/jquery.ui.datepicker-hu.js | 36 - ui/i18n/jquery.ui.datepicker-hy.js | 36 - ui/i18n/jquery.ui.datepicker-id.js | 36 - ui/i18n/jquery.ui.datepicker-is.js | 36 - ui/i18n/jquery.ui.datepicker-it-CH.js | 36 - ui/i18n/jquery.ui.datepicker-it.js | 36 - ui/i18n/jquery.ui.datepicker-ja.js | 36 - ui/i18n/jquery.ui.datepicker-ka.js | 34 - ui/i18n/jquery.ui.datepicker-kk.js | 36 - ui/i18n/jquery.ui.datepicker-km.js | 36 - ui/i18n/jquery.ui.datepicker-ko.js | 36 - ui/i18n/jquery.ui.datepicker-ky.js | 37 - ui/i18n/jquery.ui.datepicker-lb.js | 36 - ui/i18n/jquery.ui.datepicker-lt.js | 36 - ui/i18n/jquery.ui.datepicker-lv.js | 36 - ui/i18n/jquery.ui.datepicker-mk.js | 36 - ui/i18n/jquery.ui.datepicker-ml.js | 36 - ui/i18n/jquery.ui.datepicker-ms.js | 36 - ui/i18n/jquery.ui.datepicker-nb.js | 35 - ui/i18n/jquery.ui.datepicker-nl-BE.js | 36 - ui/i18n/jquery.ui.datepicker-nl.js | 36 - ui/i18n/jquery.ui.datepicker-nn.js | 35 - ui/i18n/jquery.ui.datepicker-no.js | 36 - ui/i18n/jquery.ui.datepicker-pl.js | 36 - ui/i18n/jquery.ui.datepicker-pt-BR.js | 36 - ui/i18n/jquery.ui.datepicker-pt.js | 35 - ui/i18n/jquery.ui.datepicker-rm.js | 34 - ui/i18n/jquery.ui.datepicker-ro.js | 39 - ui/i18n/jquery.ui.datepicker-ru.js | 36 - ui/i18n/jquery.ui.datepicker-sk.js | 36 - ui/i18n/jquery.ui.datepicker-sl.js | 37 - ui/i18n/jquery.ui.datepicker-sq.js | 36 - ui/i18n/jquery.ui.datepicker-sr-SR.js | 36 - ui/i18n/jquery.ui.datepicker-sr.js | 36 - ui/i18n/jquery.ui.datepicker-sv.js | 36 - ui/i18n/jquery.ui.datepicker-ta.js | 36 - ui/i18n/jquery.ui.datepicker-th.js | 36 - ui/i18n/jquery.ui.datepicker-tj.js | 36 - ui/i18n/jquery.ui.datepicker-tr.js | 36 - ui/i18n/jquery.ui.datepicker-uk.js | 37 - ui/i18n/jquery.ui.datepicker-vi.js | 36 - ui/i18n/jquery.ui.datepicker-zh-CN.js | 36 - ui/i18n/jquery.ui.datepicker-zh-HK.js | 36 - ui/i18n/jquery.ui.datepicker-zh-TW.js | 36 - ui/jquery.ui.accordion.js | 575 ------ ui/jquery.ui.autocomplete.js | 617 ------ ui/jquery.ui.button.js | 405 ---- ui/jquery.ui.core.js | 299 --- ui/jquery.ui.datepicker.js | 2071 -------------------- ui/jquery.ui.dialog.js | 854 -------- ui/jquery.ui.draggable.js | 1019 ---------- ui/jquery.ui.droppable.js | 416 ---- ui/jquery.ui.effect-blind.js | 90 - ui/jquery.ui.effect-bounce.js | 123 -- ui/jquery.ui.effect-clip.js | 77 - ui/jquery.ui.effect-drop.js | 75 - ui/jquery.ui.effect-explode.js | 107 - ui/jquery.ui.effect-fade.js | 40 - ui/jquery.ui.effect-fold.js | 86 - ui/jquery.ui.effect-highlight.js | 60 - ui/jquery.ui.effect-puff.js | 60 - ui/jquery.ui.effect-pulsate.js | 73 - ui/jquery.ui.effect-scale.js | 89 - ui/jquery.ui.effect-shake.js | 84 - ui/jquery.ui.effect-size.js | 233 --- ui/jquery.ui.effect-slide.js | 74 - ui/jquery.ui.effect-transfer.js | 57 - ui/jquery.ui.effect.js | 1297 ------------ ui/jquery.ui.menu.js | 640 ------ ui/jquery.ui.mouse.js | 187 -- ui/jquery.ui.position.js | 514 ----- ui/jquery.ui.progressbar.js | 159 -- ui/jquery.ui.resizable.js | 1036 ---------- ui/jquery.ui.selectable.js | 287 --- ui/jquery.ui.selectmenu.js | 536 ----- ui/jquery.ui.slider.js | 692 ------- ui/jquery.ui.sortable.js | 1310 ------------- ui/jquery.ui.spinner.js | 515 ----- ui/jquery.ui.tabs.js | 868 -------- ui/jquery.ui.tooltip.js | 444 ----- ui/jquery.ui.widget.js | 544 ----- ui/menu.js | 640 ++++++ ui/mouse.js | 187 ++ ui/position.js | 514 +++++ ui/progressbar.js | 159 ++ ui/resizable.js | 1036 ++++++++++ ui/selectable.js | 287 +++ ui/selectmenu.js | 536 +++++ ui/slider.js | 692 +++++++ ui/sortable.js | 1310 +++++++++++++ ui/spinner.js | 515 +++++ ui/tabs.js | 868 ++++++++ ui/tooltip.js | 444 +++++ ui/widget.js | 544 +++++ 463 files changed, 22007 insertions(+), 22007 deletions(-) create mode 100644 demos/datepicker/datepicker-ar.js create mode 100644 demos/datepicker/datepicker-fr.js create mode 100644 demos/datepicker/datepicker-he.js create mode 100644 demos/datepicker/datepicker-zh-TW.js delete mode 100644 demos/datepicker/jquery.ui.datepicker-ar.js delete mode 100644 demos/datepicker/jquery.ui.datepicker-fr.js delete mode 100644 demos/datepicker/jquery.ui.datepicker-he.js delete mode 100644 demos/datepicker/jquery.ui.datepicker-zh-TW.js create mode 100644 themes/base/accordion.css create mode 100644 themes/base/all.css create mode 100644 themes/base/autocomplete.css create mode 100644 themes/base/base.css create mode 100644 themes/base/button.css create mode 100644 themes/base/core.css create mode 100644 themes/base/datepicker.css create mode 100644 themes/base/dialog.css create mode 100644 themes/base/draggable.css delete mode 100644 themes/base/jquery.ui.accordion.css delete mode 100644 themes/base/jquery.ui.all.css delete mode 100644 themes/base/jquery.ui.autocomplete.css delete mode 100644 themes/base/jquery.ui.base.css delete mode 100644 themes/base/jquery.ui.button.css delete mode 100644 themes/base/jquery.ui.core.css delete mode 100644 themes/base/jquery.ui.datepicker.css delete mode 100644 themes/base/jquery.ui.dialog.css delete mode 100644 themes/base/jquery.ui.draggable.css delete mode 100644 themes/base/jquery.ui.menu.css delete mode 100644 themes/base/jquery.ui.progressbar.css delete mode 100644 themes/base/jquery.ui.resizable.css delete mode 100644 themes/base/jquery.ui.selectable.css delete mode 100644 themes/base/jquery.ui.selectmenu.css delete mode 100644 themes/base/jquery.ui.slider.css delete mode 100644 themes/base/jquery.ui.sortable.css delete mode 100644 themes/base/jquery.ui.spinner.css delete mode 100644 themes/base/jquery.ui.tabs.css delete mode 100644 themes/base/jquery.ui.theme.css delete mode 100644 themes/base/jquery.ui.tooltip.css create mode 100644 themes/base/menu.css create mode 100644 themes/base/progressbar.css create mode 100644 themes/base/resizable.css create mode 100644 themes/base/selectable.css create mode 100644 themes/base/selectmenu.css create mode 100644 themes/base/slider.css create mode 100644 themes/base/sortable.css create mode 100644 themes/base/spinner.css create mode 100644 themes/base/tabs.css create mode 100644 themes/base/theme.css create mode 100644 themes/base/tooltip.css create mode 100644 ui/accordion.js create mode 100644 ui/autocomplete.js create mode 100644 ui/button.js create mode 100644 ui/core.js create mode 100644 ui/datepicker.js create mode 100644 ui/dialog.js create mode 100644 ui/draggable.js create mode 100644 ui/droppable.js create mode 100644 ui/effect-blind.js create mode 100644 ui/effect-bounce.js create mode 100644 ui/effect-clip.js create mode 100644 ui/effect-drop.js create mode 100644 ui/effect-explode.js create mode 100644 ui/effect-fade.js create mode 100644 ui/effect-fold.js create mode 100644 ui/effect-highlight.js create mode 100644 ui/effect-puff.js create mode 100644 ui/effect-pulsate.js create mode 100644 ui/effect-scale.js create mode 100644 ui/effect-shake.js create mode 100644 ui/effect-size.js create mode 100644 ui/effect-slide.js create mode 100644 ui/effect-transfer.js create mode 100644 ui/effect.js create mode 100644 ui/i18n/datepicker-af.js create mode 100644 ui/i18n/datepicker-ar-DZ.js create mode 100644 ui/i18n/datepicker-ar.js create mode 100644 ui/i18n/datepicker-az.js create mode 100644 ui/i18n/datepicker-be.js create mode 100644 ui/i18n/datepicker-bg.js create mode 100644 ui/i18n/datepicker-bs.js create mode 100644 ui/i18n/datepicker-ca.js create mode 100644 ui/i18n/datepicker-cs.js create mode 100644 ui/i18n/datepicker-cy-GB.js create mode 100644 ui/i18n/datepicker-da.js create mode 100644 ui/i18n/datepicker-de.js create mode 100644 ui/i18n/datepicker-el.js create mode 100644 ui/i18n/datepicker-en-AU.js create mode 100644 ui/i18n/datepicker-en-GB.js create mode 100644 ui/i18n/datepicker-en-NZ.js create mode 100644 ui/i18n/datepicker-eo.js create mode 100644 ui/i18n/datepicker-es.js create mode 100644 ui/i18n/datepicker-et.js create mode 100644 ui/i18n/datepicker-eu.js create mode 100644 ui/i18n/datepicker-fa.js create mode 100644 ui/i18n/datepicker-fi.js create mode 100644 ui/i18n/datepicker-fo.js create mode 100644 ui/i18n/datepicker-fr-CA.js create mode 100644 ui/i18n/datepicker-fr-CH.js create mode 100644 ui/i18n/datepicker-fr.js create mode 100644 ui/i18n/datepicker-gl.js create mode 100644 ui/i18n/datepicker-he.js create mode 100644 ui/i18n/datepicker-hi.js create mode 100644 ui/i18n/datepicker-hr.js create mode 100644 ui/i18n/datepicker-hu.js create mode 100644 ui/i18n/datepicker-hy.js create mode 100644 ui/i18n/datepicker-id.js create mode 100644 ui/i18n/datepicker-is.js create mode 100644 ui/i18n/datepicker-it-CH.js create mode 100644 ui/i18n/datepicker-it.js create mode 100644 ui/i18n/datepicker-ja.js create mode 100644 ui/i18n/datepicker-ka.js create mode 100644 ui/i18n/datepicker-kk.js create mode 100644 ui/i18n/datepicker-km.js create mode 100644 ui/i18n/datepicker-ko.js create mode 100644 ui/i18n/datepicker-ky.js create mode 100644 ui/i18n/datepicker-lb.js create mode 100644 ui/i18n/datepicker-lt.js create mode 100644 ui/i18n/datepicker-lv.js create mode 100644 ui/i18n/datepicker-mk.js create mode 100644 ui/i18n/datepicker-ml.js create mode 100644 ui/i18n/datepicker-ms.js create mode 100644 ui/i18n/datepicker-nb.js create mode 100644 ui/i18n/datepicker-nl-BE.js create mode 100644 ui/i18n/datepicker-nl.js create mode 100644 ui/i18n/datepicker-nn.js create mode 100644 ui/i18n/datepicker-no.js create mode 100644 ui/i18n/datepicker-pl.js create mode 100644 ui/i18n/datepicker-pt-BR.js create mode 100644 ui/i18n/datepicker-pt.js create mode 100644 ui/i18n/datepicker-rm.js create mode 100644 ui/i18n/datepicker-ro.js create mode 100644 ui/i18n/datepicker-ru.js create mode 100644 ui/i18n/datepicker-sk.js create mode 100644 ui/i18n/datepicker-sl.js create mode 100644 ui/i18n/datepicker-sq.js create mode 100644 ui/i18n/datepicker-sr-SR.js create mode 100644 ui/i18n/datepicker-sr.js create mode 100644 ui/i18n/datepicker-sv.js create mode 100644 ui/i18n/datepicker-ta.js create mode 100644 ui/i18n/datepicker-th.js create mode 100644 ui/i18n/datepicker-tj.js create mode 100644 ui/i18n/datepicker-tr.js create mode 100644 ui/i18n/datepicker-uk.js create mode 100644 ui/i18n/datepicker-vi.js create mode 100644 ui/i18n/datepicker-zh-CN.js create mode 100644 ui/i18n/datepicker-zh-HK.js create mode 100644 ui/i18n/datepicker-zh-TW.js delete mode 100644 ui/i18n/jquery.ui.datepicker-af.js delete mode 100644 ui/i18n/jquery.ui.datepicker-ar-DZ.js delete mode 100644 ui/i18n/jquery.ui.datepicker-ar.js delete mode 100644 ui/i18n/jquery.ui.datepicker-az.js delete mode 100644 ui/i18n/jquery.ui.datepicker-be.js delete mode 100644 ui/i18n/jquery.ui.datepicker-bg.js delete mode 100644 ui/i18n/jquery.ui.datepicker-bs.js delete mode 100644 ui/i18n/jquery.ui.datepicker-ca.js delete mode 100644 ui/i18n/jquery.ui.datepicker-cs.js delete mode 100644 ui/i18n/jquery.ui.datepicker-cy-GB.js delete mode 100644 ui/i18n/jquery.ui.datepicker-da.js delete mode 100644 ui/i18n/jquery.ui.datepicker-de.js delete mode 100644 ui/i18n/jquery.ui.datepicker-el.js delete mode 100644 ui/i18n/jquery.ui.datepicker-en-AU.js delete mode 100644 ui/i18n/jquery.ui.datepicker-en-GB.js delete mode 100644 ui/i18n/jquery.ui.datepicker-en-NZ.js delete mode 100644 ui/i18n/jquery.ui.datepicker-eo.js delete mode 100644 ui/i18n/jquery.ui.datepicker-es.js delete mode 100644 ui/i18n/jquery.ui.datepicker-et.js delete mode 100644 ui/i18n/jquery.ui.datepicker-eu.js delete mode 100644 ui/i18n/jquery.ui.datepicker-fa.js delete mode 100644 ui/i18n/jquery.ui.datepicker-fi.js delete mode 100644 ui/i18n/jquery.ui.datepicker-fo.js delete mode 100644 ui/i18n/jquery.ui.datepicker-fr-CA.js delete mode 100644 ui/i18n/jquery.ui.datepicker-fr-CH.js delete mode 100644 ui/i18n/jquery.ui.datepicker-fr.js delete mode 100644 ui/i18n/jquery.ui.datepicker-gl.js delete mode 100644 ui/i18n/jquery.ui.datepicker-he.js delete mode 100644 ui/i18n/jquery.ui.datepicker-hi.js delete mode 100644 ui/i18n/jquery.ui.datepicker-hr.js delete mode 100644 ui/i18n/jquery.ui.datepicker-hu.js delete mode 100644 ui/i18n/jquery.ui.datepicker-hy.js delete mode 100644 ui/i18n/jquery.ui.datepicker-id.js delete mode 100644 ui/i18n/jquery.ui.datepicker-is.js delete mode 100644 ui/i18n/jquery.ui.datepicker-it-CH.js delete mode 100644 ui/i18n/jquery.ui.datepicker-it.js delete mode 100644 ui/i18n/jquery.ui.datepicker-ja.js delete mode 100644 ui/i18n/jquery.ui.datepicker-ka.js delete mode 100644 ui/i18n/jquery.ui.datepicker-kk.js delete mode 100644 ui/i18n/jquery.ui.datepicker-km.js delete mode 100644 ui/i18n/jquery.ui.datepicker-ko.js delete mode 100644 ui/i18n/jquery.ui.datepicker-ky.js delete mode 100644 ui/i18n/jquery.ui.datepicker-lb.js delete mode 100644 ui/i18n/jquery.ui.datepicker-lt.js delete mode 100644 ui/i18n/jquery.ui.datepicker-lv.js delete mode 100644 ui/i18n/jquery.ui.datepicker-mk.js delete mode 100644 ui/i18n/jquery.ui.datepicker-ml.js delete mode 100644 ui/i18n/jquery.ui.datepicker-ms.js delete mode 100644 ui/i18n/jquery.ui.datepicker-nb.js delete mode 100644 ui/i18n/jquery.ui.datepicker-nl-BE.js delete mode 100644 ui/i18n/jquery.ui.datepicker-nl.js delete mode 100644 ui/i18n/jquery.ui.datepicker-nn.js delete mode 100644 ui/i18n/jquery.ui.datepicker-no.js delete mode 100644 ui/i18n/jquery.ui.datepicker-pl.js delete mode 100644 ui/i18n/jquery.ui.datepicker-pt-BR.js delete mode 100644 ui/i18n/jquery.ui.datepicker-pt.js delete mode 100644 ui/i18n/jquery.ui.datepicker-rm.js delete mode 100644 ui/i18n/jquery.ui.datepicker-ro.js delete mode 100644 ui/i18n/jquery.ui.datepicker-ru.js delete mode 100644 ui/i18n/jquery.ui.datepicker-sk.js delete mode 100644 ui/i18n/jquery.ui.datepicker-sl.js delete mode 100644 ui/i18n/jquery.ui.datepicker-sq.js delete mode 100644 ui/i18n/jquery.ui.datepicker-sr-SR.js delete mode 100644 ui/i18n/jquery.ui.datepicker-sr.js delete mode 100644 ui/i18n/jquery.ui.datepicker-sv.js delete mode 100644 ui/i18n/jquery.ui.datepicker-ta.js delete mode 100644 ui/i18n/jquery.ui.datepicker-th.js delete mode 100644 ui/i18n/jquery.ui.datepicker-tj.js delete mode 100644 ui/i18n/jquery.ui.datepicker-tr.js delete mode 100644 ui/i18n/jquery.ui.datepicker-uk.js delete mode 100644 ui/i18n/jquery.ui.datepicker-vi.js delete mode 100644 ui/i18n/jquery.ui.datepicker-zh-CN.js delete mode 100644 ui/i18n/jquery.ui.datepicker-zh-HK.js delete mode 100644 ui/i18n/jquery.ui.datepicker-zh-TW.js delete mode 100644 ui/jquery.ui.accordion.js delete mode 100644 ui/jquery.ui.autocomplete.js delete mode 100644 ui/jquery.ui.button.js delete mode 100644 ui/jquery.ui.core.js delete mode 100644 ui/jquery.ui.datepicker.js delete mode 100644 ui/jquery.ui.dialog.js delete mode 100644 ui/jquery.ui.draggable.js delete mode 100644 ui/jquery.ui.droppable.js delete mode 100644 ui/jquery.ui.effect-blind.js delete mode 100644 ui/jquery.ui.effect-bounce.js delete mode 100644 ui/jquery.ui.effect-clip.js delete mode 100644 ui/jquery.ui.effect-drop.js delete mode 100644 ui/jquery.ui.effect-explode.js delete mode 100644 ui/jquery.ui.effect-fade.js delete mode 100644 ui/jquery.ui.effect-fold.js delete mode 100644 ui/jquery.ui.effect-highlight.js delete mode 100644 ui/jquery.ui.effect-puff.js delete mode 100644 ui/jquery.ui.effect-pulsate.js delete mode 100644 ui/jquery.ui.effect-scale.js delete mode 100644 ui/jquery.ui.effect-shake.js delete mode 100644 ui/jquery.ui.effect-size.js delete mode 100644 ui/jquery.ui.effect-slide.js delete mode 100644 ui/jquery.ui.effect-transfer.js delete mode 100644 ui/jquery.ui.effect.js delete mode 100644 ui/jquery.ui.menu.js delete mode 100644 ui/jquery.ui.mouse.js delete mode 100644 ui/jquery.ui.position.js delete mode 100644 ui/jquery.ui.progressbar.js delete mode 100644 ui/jquery.ui.resizable.js delete mode 100644 ui/jquery.ui.selectable.js delete mode 100644 ui/jquery.ui.selectmenu.js delete mode 100644 ui/jquery.ui.slider.js delete mode 100644 ui/jquery.ui.sortable.js delete mode 100644 ui/jquery.ui.spinner.js delete mode 100644 ui/jquery.ui.tabs.js delete mode 100644 ui/jquery.ui.tooltip.js delete mode 100644 ui/jquery.ui.widget.js create mode 100644 ui/menu.js create mode 100644 ui/mouse.js create mode 100644 ui/position.js create mode 100644 ui/progressbar.js create mode 100644 ui/resizable.js create mode 100644 ui/selectable.js create mode 100644 ui/selectmenu.js create mode 100644 ui/slider.js create mode 100644 ui/sortable.js create mode 100644 ui/spinner.js create mode 100644 ui/tabs.js create mode 100644 ui/tooltip.js create mode 100644 ui/widget.js diff --git a/Gruntfile.js b/Gruntfile.js index 60d02efd0..545329df0 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -5,15 +5,15 @@ module.exports = function( grunt ) { var // files coreFiles = [ - "jquery.ui.core.js", - "jquery.ui.widget.js", - "jquery.ui.mouse.js", - "jquery.ui.draggable.js", - "jquery.ui.droppable.js", - "jquery.ui.resizable.js", - "jquery.ui.selectable.js", - "jquery.ui.sortable.js", - "jquery.ui.effect.js" + "core.js", + "widget.js", + "mouse.js", + "draggable.js", + "droppable.js", + "resizable.js", + "selectable.js", + "sortable.js", + "effect.js" ], uiFiles = coreFiles.map(function( file ) { @@ -42,7 +42,7 @@ var "tooltip", "theme" ].map(function( component ) { - return "themes/base/jquery.ui." + component + ".css"; + return "themes/base/" + component + ".css"; }), // minified files @@ -166,7 +166,7 @@ grunt.initConfig({ }, jscs: { // datepicker, sortable, resizable and draggable are getting rewritten, ignore until that's done - ui: [ "ui/jquery.ui.*.js", "!ui/jquery.ui.datepicker.js", "!ui/jquery.ui.sortable.js", "!ui/jquery.ui.resizable.js", "!ui/jquery.ui.draggable.js" ], + ui: [ "ui/*.js", "!ui/datepicker.js", "!ui/sortable.js", "!ui/resizable.js", "!ui/draggable.js" ], // TODO enable this once we have a tool that can help with fixing formatting of existing files // tests: "tests/unit/**/*.js", grunt: "Gruntfile.js" diff --git a/demos/accordion/collapsible.html b/demos/accordion/collapsible.html index edee8cd10..864be026b 100644 --- a/demos/accordion/collapsible.html +++ b/demos/accordion/collapsible.html @@ -3,11 +3,11 @@ jQuery UI Accordion - Collapse content - + - - - + + + - - - - + + + + - - - + + + - - - - - + + + + + " ).appendTo( body ); - } - - if(o.opacity) { // opacity option - if (this.helper.css("opacity")) { - this._storedOpacity = this.helper.css("opacity"); - } - this.helper.css("opacity", o.opacity); - } - - if(o.zIndex) { // zIndex option - if (this.helper.css("zIndex")) { - this._storedZIndex = this.helper.css("zIndex"); - } - this.helper.css("zIndex", o.zIndex); - } - - //Prepare scrolling - if(this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") { - this.overflowOffset = this.scrollParent.offset(); - } - - //Call callbacks - this._trigger("start", event, this._uiHash()); - - //Recache the helper size - if(!this._preserveHelperProportions) { - this._cacheHelperProportions(); - } - - - //Post "activate" events to possible containers - if( !noActivation ) { - for ( i = this.containers.length - 1; i >= 0; i-- ) { - this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) ); - } - } - - //Prepare possible droppables - if($.ui.ddmanager) { - $.ui.ddmanager.current = this; - } - - if ($.ui.ddmanager && !o.dropBehaviour) { - $.ui.ddmanager.prepareOffsets(this, event); - } - - this.dragging = true; - - this.helper.addClass("ui-sortable-helper"); - this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position - return true; - - }, - - _mouseDrag: function(event) { - var i, item, itemElement, intersection, - o = this.options, - scrolled = false; - - //Compute the helpers position - this.position = this._generatePosition(event); - this.positionAbs = this._convertPositionTo("absolute"); - - if (!this.lastPositionAbs) { - this.lastPositionAbs = this.positionAbs; - } - - //Do scrolling - if(this.options.scroll) { - if(this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") { - - if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) { - this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed; - } else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) { - this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed; - } - - if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) { - this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed; - } else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) { - this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed; - } - - } else { - - if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) { - scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); - } else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) { - scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); - } - - if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) { - scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); - } else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) { - scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); - } - - } - - if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) { - $.ui.ddmanager.prepareOffsets(this, event); - } - } - - //Regenerate the absolute position used for position checks - this.positionAbs = this._convertPositionTo("absolute"); - - //Set the helper position - if(!this.options.axis || this.options.axis !== "y") { - this.helper[0].style.left = this.position.left+"px"; - } - if(!this.options.axis || this.options.axis !== "x") { - this.helper[0].style.top = this.position.top+"px"; - } - - //Rearrange - for (i = this.items.length - 1; i >= 0; i--) { - - //Cache variables and intersection, continue if no intersection - item = this.items[i]; - itemElement = item.item[0]; - intersection = this._intersectsWithPointer(item); - if (!intersection) { - continue; - } - - // Only put the placeholder inside the current Container, skip all - // items from other containers. This works because when moving - // an item from one container to another the - // currentContainer is switched before the placeholder is moved. - // - // Without this, moving items in "sub-sortables" can cause - // the placeholder to jitter beetween the outer and inner container. - if (item.instance !== this.currentContainer) { - continue; - } - - // cannot intersect with itself - // no useless actions that have been done before - // no action if the item moved is the parent of the item checked - if (itemElement !== this.currentItem[0] && - this.placeholder[intersection === 1 ? "next" : "prev"]()[0] !== itemElement && - !$.contains(this.placeholder[0], itemElement) && - (this.options.type === "semi-dynamic" ? !$.contains(this.element[0], itemElement) : true) - ) { - - this.direction = intersection === 1 ? "down" : "up"; - - if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) { - this._rearrange(event, item); - } else { - break; - } - - this._trigger("change", event, this._uiHash()); - break; - } - } - - //Post events to containers - this._contactContainers(event); - - //Interconnect with droppables - if($.ui.ddmanager) { - $.ui.ddmanager.drag(this, event); - } - - //Call callbacks - this._trigger("sort", event, this._uiHash()); - - this.lastPositionAbs = this.positionAbs; - return false; - - }, - - _mouseStop: function(event, noPropagation) { - - if(!event) { - return; - } - - //If we are using droppables, inform the manager about the drop - if ($.ui.ddmanager && !this.options.dropBehaviour) { - $.ui.ddmanager.drop(this, event); - } - - if(this.options.revert) { - var that = this, - cur = this.placeholder.offset(), - axis = this.options.axis, - animation = {}; - - if ( !axis || axis === "x" ) { - animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollLeft); - } - if ( !axis || axis === "y" ) { - animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollTop); - } - this.reverting = true; - $(this.helper).animate( animation, parseInt(this.options.revert, 10) || 500, function() { - that._clear(event); - }); - } else { - this._clear(event, noPropagation); - } - - return false; - - }, - - cancel: function() { - - if(this.dragging) { - - this._mouseUp({ target: null }); - - if(this.options.helper === "original") { - this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); - } else { - this.currentItem.show(); - } - - //Post deactivating events to containers - for (var i = this.containers.length - 1; i >= 0; i--){ - this.containers[i]._trigger("deactivate", null, this._uiHash(this)); - if(this.containers[i].containerCache.over) { - this.containers[i]._trigger("out", null, this._uiHash(this)); - this.containers[i].containerCache.over = 0; - } - } - - } - - if (this.placeholder) { - //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! - if(this.placeholder[0].parentNode) { - this.placeholder[0].parentNode.removeChild(this.placeholder[0]); - } - if(this.options.helper !== "original" && this.helper && this.helper[0].parentNode) { - this.helper.remove(); - } - - $.extend(this, { - helper: null, - dragging: false, - reverting: false, - _noFinalSort: null - }); - - if(this.domPosition.prev) { - $(this.domPosition.prev).after(this.currentItem); - } else { - $(this.domPosition.parent).prepend(this.currentItem); - } - } - - return this; - - }, - - serialize: function(o) { - - var items = this._getItemsAsjQuery(o && o.connected), - str = []; - o = o || {}; - - $(items).each(function() { - var res = ($(o.item || this).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[\-=_](.+)/)); - if (res) { - str.push((o.key || res[1]+"[]")+"="+(o.key && o.expression ? res[1] : res[2])); - } - }); - - if(!str.length && o.key) { - str.push(o.key + "="); - } - - return str.join("&"); - - }, - - toArray: function(o) { - - var items = this._getItemsAsjQuery(o && o.connected), - ret = []; - - o = o || {}; - - items.each(function() { ret.push($(o.item || this).attr(o.attribute || "id") || ""); }); - return ret; - - }, - - /* Be careful with the following core functions */ - _intersectsWith: function(item) { - - var x1 = this.positionAbs.left, - x2 = x1 + this.helperProportions.width, - y1 = this.positionAbs.top, - y2 = y1 + this.helperProportions.height, - l = item.left, - r = l + item.width, - t = item.top, - b = t + item.height, - dyClick = this.offset.click.top, - dxClick = this.offset.click.left, - isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && ( y1 + dyClick ) < b ), - isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && ( x1 + dxClick ) < r ), - isOverElement = isOverElementHeight && isOverElementWidth; - - if ( this.options.tolerance === "pointer" || - this.options.forcePointerForContainers || - (this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > item[this.floating ? "width" : "height"]) - ) { - return isOverElement; - } else { - - return (l < x1 + (this.helperProportions.width / 2) && // Right Half - x2 - (this.helperProportions.width / 2) < r && // Left Half - t < y1 + (this.helperProportions.height / 2) && // Bottom Half - y2 - (this.helperProportions.height / 2) < b ); // Top Half - - } - }, - - _intersectsWithPointer: function(item) { - - var isOverElementHeight = (this.options.axis === "x") || this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height), - isOverElementWidth = (this.options.axis === "y") || this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width), - isOverElement = isOverElementHeight && isOverElementWidth, - verticalDirection = this._getDragVerticalDirection(), - horizontalDirection = this._getDragHorizontalDirection(); - - if (!isOverElement) { - return false; - } - - return this.floating ? - ( ((horizontalDirection && horizontalDirection === "right") || verticalDirection === "down") ? 2 : 1 ) - : ( verticalDirection && (verticalDirection === "down" ? 2 : 1) ); - - }, - - _intersectsWithSides: function(item) { - - var isOverBottomHalf = this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height), - isOverRightHalf = this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width), - verticalDirection = this._getDragVerticalDirection(), - horizontalDirection = this._getDragHorizontalDirection(); - - if (this.floating && horizontalDirection) { - return ((horizontalDirection === "right" && isOverRightHalf) || (horizontalDirection === "left" && !isOverRightHalf)); - } else { - return verticalDirection && ((verticalDirection === "down" && isOverBottomHalf) || (verticalDirection === "up" && !isOverBottomHalf)); - } - - }, - - _getDragVerticalDirection: function() { - var delta = this.positionAbs.top - this.lastPositionAbs.top; - return delta !== 0 && (delta > 0 ? "down" : "up"); - }, - - _getDragHorizontalDirection: function() { - var delta = this.positionAbs.left - this.lastPositionAbs.left; - return delta !== 0 && (delta > 0 ? "right" : "left"); - }, - - refresh: function(event) { - this._refreshItems(event); - this._setHandleClassName(); - this.refreshPositions(); - return this; - }, - - _connectWith: function() { - var options = this.options; - return options.connectWith.constructor === String ? [options.connectWith] : options.connectWith; - }, - - _getItemsAsjQuery: function(connected) { - - var i, j, cur, inst, - items = [], - queries = [], - connectWith = this._connectWith(); - - if(connectWith && connected) { - for (i = connectWith.length - 1; i >= 0; i--){ - cur = $(connectWith[i]); - for ( j = cur.length - 1; j >= 0; j--){ - inst = $.data(cur[j], this.widgetFullName); - if(inst && inst !== this && !inst.options.disabled) { - 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]); - } - } - } - } - - 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]); - - function addItems() { - items.push( this ); - } - for (i = queries.length - 1; i >= 0; i--){ - queries[i][0].each( addItems ); - } - - return $(items); - - }, - - _removeCurrentsFromItems: function() { - - var list = this.currentItem.find(":data(" + this.widgetName + "-item)"); - - this.items = $.grep(this.items, function (item) { - for (var j=0; j < list.length; j++) { - if(list[j] === item.item[0]) { - return false; - } - } - return true; - }); - - }, - - _refreshItems: function(event) { - - this.items = []; - this.containers = [this]; - - var i, j, cur, inst, targetData, _queries, item, queriesLength, - items = this.items, - queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]], - connectWith = this._connectWith(); - - if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down - for (i = connectWith.length - 1; i >= 0; i--){ - cur = $(connectWith[i]); - for (j = cur.length - 1; j >= 0; j--){ - inst = $.data(cur[j], this.widgetFullName); - if(inst && inst !== this && !inst.options.disabled) { - queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]); - this.containers.push(inst); - } - } - } - } - - for (i = queries.length - 1; i >= 0; i--) { - targetData = queries[i][1]; - _queries = queries[i][0]; - - for (j=0, queriesLength = _queries.length; j < queriesLength; j++) { - item = $(_queries[j]); - - item.data(this.widgetName + "-item", targetData); // Data for target checking (mouse manager) - - items.push({ - item: item, - instance: targetData, - width: 0, height: 0, - left: 0, top: 0 - }); - } - } - - }, - - refreshPositions: function(fast) { - - //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change - if(this.offsetParent && this.helper) { - this.offset.parent = this._getParentOffset(); - } - - var i, item, t, p; - - for (i = this.items.length - 1; i >= 0; i--){ - item = this.items[i]; - - //We ignore calculating positions of all connected containers when we're not over them - if(item.instance !== this.currentContainer && this.currentContainer && item.item[0] !== this.currentItem[0]) { - continue; - } - - t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item; - - if (!fast) { - item.width = t.outerWidth(); - item.height = t.outerHeight(); - } - - p = t.offset(); - item.left = p.left; - item.top = p.top; - } - - if(this.options.custom && this.options.custom.refreshContainers) { - this.options.custom.refreshContainers.call(this); - } else { - for (i = this.containers.length - 1; i >= 0; i--){ - p = this.containers[i].element.offset(); - this.containers[i].containerCache.left = p.left; - this.containers[i].containerCache.top = p.top; - this.containers[i].containerCache.width = this.containers[i].element.outerWidth(); - this.containers[i].containerCache.height = this.containers[i].element.outerHeight(); - } - } - - return this; - }, - - _createPlaceholder: function(that) { - that = that || this; - var className, - o = that.options; - - if(!o.placeholder || o.placeholder.constructor === String) { - className = o.placeholder; - o.placeholder = { - element: function() { - - var nodeName = that.currentItem[0].nodeName.toLowerCase(), - element = $( "<" + nodeName + ">", that.document[0] ) - .addClass(className || that.currentItem[0].className+" ui-sortable-placeholder") - .removeClass("ui-sortable-helper"); - - if ( nodeName === "tr" ) { - that.currentItem.children().each(function() { - $( " ", that.document[0] ) - .attr( "colspan", $( this ).attr( "colspan" ) || 1 ) - .appendTo( element ); - }); - } else if ( nodeName === "img" ) { - element.attr( "src", that.currentItem.attr( "src" ) ); - } - - if ( !className ) { - element.css( "visibility", "hidden" ); - } - - return element; - }, - update: function(container, p) { - - // 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that - // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified - if(className && !o.forcePlaceholderSize) { - return; - } - - //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 - if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css("paddingTop")||0, 10) - parseInt(that.currentItem.css("paddingBottom")||0, 10)); } - if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css("paddingLeft")||0, 10) - parseInt(that.currentItem.css("paddingRight")||0, 10)); } - } - }; - } - - //Create the placeholder - that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem)); - - //Append it after the actual current item - that.currentItem.after(that.placeholder); - - //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317) - o.placeholder.update(that, that.placeholder); - - }, - - _contactContainers: function(event) { - var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom, floating, axis, - innermostContainer = null, - innermostIndex = null; - - // get innermost container that intersects with item - for (i = this.containers.length - 1; i >= 0; i--) { - - // never consider a container that's located within the item itself - if($.contains(this.currentItem[0], this.containers[i].element[0])) { - continue; - } - - if(this._intersectsWith(this.containers[i].containerCache)) { - - // if we've already found a container and it's more "inner" than this, then continue - if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) { - continue; - } - - innermostContainer = this.containers[i]; - innermostIndex = i; - - } else { - // container doesn't intersect. trigger "out" event if necessary - if(this.containers[i].containerCache.over) { - this.containers[i]._trigger("out", event, this._uiHash(this)); - this.containers[i].containerCache.over = 0; - } - } - - } - - // if no intersecting containers found, return - if(!innermostContainer) { - return; - } - - // move the item into the container if it's not there already - if(this.containers.length === 1) { - if (!this.containers[innermostIndex].containerCache.over) { - this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); - this.containers[innermostIndex].containerCache.over = 1; - } - } else { - - //When entering a new container, we will find the item with the least distance and append our item near it - dist = 10000; - itemWithLeastDistance = null; - floating = innermostContainer.floating || this._isFloating(this.currentItem); - posProperty = floating ? "left" : "top"; - sizeProperty = floating ? "width" : "height"; - axis = floating ? "clientX" : "clientY"; - - for (j = this.items.length - 1; j >= 0; j--) { - if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) { - continue; - } - if(this.items[j].item[0] === this.currentItem[0]) { - continue; - } - - cur = this.items[j].item.offset()[posProperty]; - nearBottom = false; - if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) { - nearBottom = true; - } - - if ( Math.abs( event[ axis ] - cur ) < dist ) { - dist = Math.abs( event[ axis ] - cur ); - itemWithLeastDistance = this.items[ j ]; - this.direction = nearBottom ? "up": "down"; - } - } - - //Check if dropOnEmpty is enabled - if(!itemWithLeastDistance && !this.options.dropOnEmpty) { - return; - } - - if(this.currentContainer === this.containers[innermostIndex]) { - return; - } - - itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true); - this._trigger("change", event, this._uiHash()); - this.containers[innermostIndex]._trigger("change", event, this._uiHash(this)); - this.currentContainer = this.containers[innermostIndex]; - - //Update the placeholder - this.options.placeholder.update(this.currentContainer, this.placeholder); - - this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); - this.containers[innermostIndex].containerCache.over = 1; - } - - - }, - - _createHelper: function(event) { - - var o = this.options, - helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper === "clone" ? this.currentItem.clone() : this.currentItem); - - //Add the helper to the DOM if that didn't happen already - if(!helper.parents("body").length) { - $(o.appendTo !== "parent" ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]); - } - - if(helper[0] === this.currentItem[0]) { - 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") }; - } - - if(!helper[0].style.width || o.forceHelperSize) { - helper.width(this.currentItem.width()); - } - if(!helper[0].style.height || o.forceHelperSize) { - helper.height(this.currentItem.height()); - } - - return helper; - - }, - - _adjustOffsetFromHelper: function(obj) { - if (typeof obj === "string") { - obj = obj.split(" "); - } - if ($.isArray(obj)) { - obj = {left: +obj[0], top: +obj[1] || 0}; - } - if ("left" in obj) { - this.offset.click.left = obj.left + this.margins.left; - } - if ("right" in obj) { - this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; - } - if ("top" in obj) { - this.offset.click.top = obj.top + this.margins.top; - } - if ("bottom" in obj) { - this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; - } - }, - - _getParentOffset: function() { - - - //Get the offsetParent and cache its position - this.offsetParent = this.helper.offsetParent(); - var po = this.offsetParent.offset(); - - // This is a special case where we need to modify a offset calculated on start, since the following happened: - // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent - // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that - // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag - if(this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) { - po.left += this.scrollParent.scrollLeft(); - po.top += this.scrollParent.scrollTop(); - } - - // This needs to be actually done for all browsers, since pageX/pageY includes this information - // with an ugly IE fix - if( this.offsetParent[0] === document.body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) { - po = { top: 0, left: 0 }; - } - - return { - top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), - left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) - }; - - }, - - _getRelativeOffset: function() { - - if(this.cssPosition === "relative") { - var p = this.currentItem.position(); - return { - top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), - left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() - }; - } else { - return { top: 0, left: 0 }; - } - - }, - - _cacheMargins: function() { - this.margins = { - left: (parseInt(this.currentItem.css("marginLeft"),10) || 0), - top: (parseInt(this.currentItem.css("marginTop"),10) || 0) - }; - }, - - _cacheHelperProportions: function() { - this.helperProportions = { - width: this.helper.outerWidth(), - height: this.helper.outerHeight() - }; - }, - - _setContainment: function() { - - var ce, co, over, - o = this.options; - if(o.containment === "parent") { - o.containment = this.helper[0].parentNode; - } - if(o.containment === "document" || o.containment === "window") { - this.containment = [ - 0 - this.offset.relative.left - this.offset.parent.left, - 0 - this.offset.relative.top - this.offset.parent.top, - $(o.containment === "document" ? document : window).width() - this.helperProportions.width - this.margins.left, - ($(o.containment === "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top - ]; - } - - if(!(/^(document|window|parent)$/).test(o.containment)) { - ce = $(o.containment)[0]; - co = $(o.containment).offset(); - over = ($(ce).css("overflow") !== "hidden"); - - this.containment = [ - co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left, - co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top, - 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, - 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 - ]; - } - - }, - - _convertPositionTo: function(d, pos) { - - if(!pos) { - pos = this.position; - } - var mod = d === "absolute" ? 1 : -1, - 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); - - return { - top: ( - pos.top + // The absolute mouse position - this.offset.relative.top * mod + // Only for relative positioned nodes: Relative offset from element to offset parent - this.offset.parent.top * mod - // The offsetParent's offset without borders (offset + border) - ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod) - ), - left: ( - pos.left + // The absolute mouse position - this.offset.relative.left * mod + // Only for relative positioned nodes: Relative offset from element to offset parent - this.offset.parent.left * mod - // The offsetParent's offset without borders (offset + border) - ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod) - ) - }; - - }, - - _generatePosition: function(event) { - - var top, left, - o = this.options, - pageX = event.pageX, - pageY = event.pageY, - 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); - - // This is another very weird special case that only happens for relative elements: - // 1. If the css position is relative - // 2. and the scroll parent is the document or similar to the offset parent - // we have to refresh the relative offset during the scroll so there are no jumps - if(this.cssPosition === "relative" && !(this.scrollParent[0] !== document && this.scrollParent[0] !== this.offsetParent[0])) { - this.offset.relative = this._getRelativeOffset(); - } - - /* - * - Position constraining - - * Constrain the position to a mix of grid, containment. - */ - - if(this.originalPosition) { //If we are not dragging yet, we won't check for options - - if(this.containment) { - if(event.pageX - this.offset.click.left < this.containment[0]) { - pageX = this.containment[0] + this.offset.click.left; - } - if(event.pageY - this.offset.click.top < this.containment[1]) { - pageY = this.containment[1] + this.offset.click.top; - } - if(event.pageX - this.offset.click.left > this.containment[2]) { - pageX = this.containment[2] + this.offset.click.left; - } - if(event.pageY - this.offset.click.top > this.containment[3]) { - pageY = this.containment[3] + this.offset.click.top; - } - } - - if(o.grid) { - top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1]; - 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; - - left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0]; - 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; - } - - } - - return { - top: ( - pageY - // The absolute mouse position - this.offset.click.top - // Click offset (relative to the element) - this.offset.relative.top - // Only for relative positioned nodes: Relative offset from element to offset parent - this.offset.parent.top + // The offsetParent's offset without borders (offset + border) - ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )) - ), - left: ( - pageX - // The absolute mouse position - this.offset.click.left - // Click offset (relative to the element) - this.offset.relative.left - // Only for relative positioned nodes: Relative offset from element to offset parent - this.offset.parent.left + // The offsetParent's offset without borders (offset + border) - ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )) - ) - }; - - }, - - _rearrange: function(event, i, a, hardRefresh) { - - 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)); - - //Various things done here to improve the performance: - // 1. we create a setTimeout, that calls refreshPositions - // 2. on the instance, we have a counter variable, that get's higher after every append - // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same - // 4. this lets only the last addition to the timeout stack through - this.counter = this.counter ? ++this.counter : 1; - var counter = this.counter; - - this._delay(function() { - if(counter === this.counter) { - this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove - } - }); - - }, - - _clear: function(event, noPropagation) { - - this.reverting = false; - // We delay all events that have to be triggered to after the point where the placeholder has been removed and - // everything else normalized again - var i, - delayedTriggers = []; - - // We first have to update the dom position of the actual currentItem - // Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088) - if(!this._noFinalSort && this.currentItem.parent().length) { - this.placeholder.before(this.currentItem); - } - this._noFinalSort = null; - - if(this.helper[0] === this.currentItem[0]) { - for(i in this._storedCSS) { - if(this._storedCSS[i] === "auto" || this._storedCSS[i] === "static") { - this._storedCSS[i] = ""; - } - } - this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); - } else { - this.currentItem.show(); - } - - if(this.fromOutside && !noPropagation) { - delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); }); - } - if((this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !noPropagation) { - delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed - } - - // Check if the items Container has Changed and trigger appropriate - // events. - if (this !== this.currentContainer) { - if(!noPropagation) { - delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); }); - delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.currentContainer)); - delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.currentContainer)); - } - } - - - //Post events to containers - function delayEvent( type, instance, container ) { - return function( event ) { - container._trigger( type, event, instance._uiHash( instance ) ); - }; - } - for (i = this.containers.length - 1; i >= 0; i--){ - if (!noPropagation) { - delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) ); - } - if(this.containers[i].containerCache.over) { - delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) ); - this.containers[i].containerCache.over = 0; - } - } - - //Do what was originally in plugins - if ( this.storedCursor ) { - this.document.find( "body" ).css( "cursor", this.storedCursor ); - this.storedStylesheet.remove(); - } - if(this._storedOpacity) { - this.helper.css("opacity", this._storedOpacity); - } - if(this._storedZIndex) { - this.helper.css("zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex); - } - - this.dragging = false; - if(this.cancelHelperRemoval) { - if(!noPropagation) { - this._trigger("beforeStop", event, this._uiHash()); - for (i=0; i < delayedTriggers.length; i++) { - delayedTriggers[i].call(this, event); - } //Trigger all delayed events - this._trigger("stop", event, this._uiHash()); - } - - this.fromOutside = false; - return false; - } - - if(!noPropagation) { - this._trigger("beforeStop", event, this._uiHash()); - } - - //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! - this.placeholder[0].parentNode.removeChild(this.placeholder[0]); - - if(this.helper[0] !== this.currentItem[0]) { - this.helper.remove(); - } - this.helper = null; - - if(!noPropagation) { - for (i=0; i < delayedTriggers.length; i++) { - delayedTriggers[i].call(this, event); - } //Trigger all delayed events - this._trigger("stop", event, this._uiHash()); - } - - this.fromOutside = false; - return true; - - }, - - _trigger: function() { - if ($.Widget.prototype._trigger.apply(this, arguments) === false) { - this.cancel(); - } - }, - - _uiHash: function(_inst) { - var inst = _inst || this; - return { - helper: inst.helper, - placeholder: inst.placeholder || $([]), - position: inst.position, - originalPosition: inst.originalPosition, - offset: inst.positionAbs, - item: inst.currentItem, - sender: _inst ? _inst.element : null - }; - } - -}); - -})); diff --git a/ui/jquery.ui.spinner.js b/ui/jquery.ui.spinner.js deleted file mode 100644 index ba2a9d5ec..000000000 --- a/ui/jquery.ui.spinner.js +++ /dev/null @@ -1,515 +0,0 @@ -/*! - * jQuery UI Spinner @VERSION - * http://jqueryui.com - * - * Copyright 2013 jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * http://api.jqueryui.com/spinner/ - */ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - - // AMD. Register as an anonymous module. - define([ - "jquery", - "./jquery.ui.core", - "./jquery.ui.widget", - "./jquery.ui.button" - ], factory ); - } else { - - // Browser globals - factory( jQuery ); - } -}(function( $ ) { - -function spinner_modifier( fn ) { - return function() { - var previous = this.element.val(); - fn.apply( this, arguments ); - this._refresh(); - if ( previous !== this.element.val() ) { - this._trigger( "change" ); - } - }; -} - -return $.widget( "ui.spinner", { - version: "@VERSION", - defaultElement: "", - widgetEventPrefix: "spin", - options: { - culture: null, - icons: { - down: "ui-icon-triangle-1-s", - up: "ui-icon-triangle-1-n" - }, - incremental: true, - max: null, - min: null, - numberFormat: null, - page: 10, - step: 1, - - change: null, - spin: null, - start: null, - stop: null - }, - - _create: function() { - // handle string values that need to be parsed - this._setOption( "max", this.options.max ); - this._setOption( "min", this.options.min ); - this._setOption( "step", this.options.step ); - - // Only format if there is a value, prevents the field from being marked - // as invalid in Firefox, see #9573. - if ( this.value() !== "" ) { - // Format the value, but don't constrain. - this._value( this.element.val(), true ); - } - - this._draw(); - this._on( this._events ); - this._refresh(); - - // turning off autocomplete prevents the browser from remembering the - // value when navigating through history, so we re-enable autocomplete - // if the page is unloaded before the widget is destroyed. #7790 - this._on( this.window, { - beforeunload: function() { - this.element.removeAttr( "autocomplete" ); - } - }); - }, - - _getCreateOptions: function() { - var options = {}, - element = this.element; - - $.each( [ "min", "max", "step" ], function( i, option ) { - var value = element.attr( option ); - if ( value !== undefined && value.length ) { - options[ option ] = value; - } - }); - - return options; - }, - - _events: { - keydown: function( event ) { - if ( this._start( event ) && this._keydown( event ) ) { - event.preventDefault(); - } - }, - keyup: "_stop", - focus: function() { - this.previous = this.element.val(); - }, - blur: function( event ) { - if ( this.cancelBlur ) { - delete this.cancelBlur; - return; - } - - this._stop(); - this._refresh(); - if ( this.previous !== this.element.val() ) { - this._trigger( "change", event ); - } - }, - mousewheel: function( event, delta ) { - if ( !delta ) { - return; - } - if ( !this.spinning && !this._start( event ) ) { - return false; - } - - this._spin( (delta > 0 ? 1 : -1) * this.options.step, event ); - clearTimeout( this.mousewheelTimer ); - this.mousewheelTimer = this._delay(function() { - if ( this.spinning ) { - this._stop( event ); - } - }, 100 ); - event.preventDefault(); - }, - "mousedown .ui-spinner-button": function( event ) { - var previous; - - // We never want the buttons to have focus; whenever the user is - // interacting with the spinner, the focus should be on the input. - // If the input is focused then this.previous is properly set from - // when the input first received focus. If the input is not focused - // then we need to set this.previous based on the value before spinning. - previous = this.element[0] === this.document[0].activeElement ? - this.previous : this.element.val(); - function checkFocus() { - var isActive = this.element[0] === this.document[0].activeElement; - if ( !isActive ) { - this.element.focus(); - this.previous = previous; - // support: IE - // IE sets focus asynchronously, so we need to check if focus - // moved off of the input because the user clicked on the button. - this._delay(function() { - this.previous = previous; - }); - } - } - - // ensure focus is on (or stays on) the text field - event.preventDefault(); - checkFocus.call( this ); - - // support: IE - // IE doesn't prevent moving focus even with event.preventDefault() - // so we set a flag to know when we should ignore the blur event - // and check (again) if focus moved off of the input. - this.cancelBlur = true; - this._delay(function() { - delete this.cancelBlur; - checkFocus.call( this ); - }); - - if ( this._start( event ) === false ) { - return; - } - - this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event ); - }, - "mouseup .ui-spinner-button": "_stop", - "mouseenter .ui-spinner-button": function( event ) { - // button will add ui-state-active if mouse was down while mouseleave and kept down - if ( !$( event.currentTarget ).hasClass( "ui-state-active" ) ) { - return; - } - - if ( this._start( event ) === false ) { - return false; - } - this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event ); - }, - // TODO: do we really want to consider this a stop? - // shouldn't we just stop the repeater and wait until mouseup before - // we trigger the stop event? - "mouseleave .ui-spinner-button": "_stop" - }, - - _draw: function() { - var uiSpinner = this.uiSpinner = this.element - .addClass( "ui-spinner-input" ) - .attr( "autocomplete", "off" ) - .wrap( this._uiSpinnerHtml() ) - .parent() - // add buttons - .append( this._buttonHtml() ); - - this.element.attr( "role", "spinbutton" ); - - // button bindings - this.buttons = uiSpinner.find( ".ui-spinner-button" ) - .attr( "tabIndex", -1 ) - .button() - .removeClass( "ui-corner-all" ); - - // IE 6 doesn't understand height: 50% for the buttons - // unless the wrapper has an explicit height - if ( this.buttons.height() > Math.ceil( uiSpinner.height() * 0.5 ) && - uiSpinner.height() > 0 ) { - uiSpinner.height( uiSpinner.height() ); - } - - // disable spinner if element was already disabled - if ( this.options.disabled ) { - this.disable(); - } - }, - - _keydown: function( event ) { - var options = this.options, - keyCode = $.ui.keyCode; - - switch ( event.keyCode ) { - case keyCode.UP: - this._repeat( null, 1, event ); - return true; - case keyCode.DOWN: - this._repeat( null, -1, event ); - return true; - case keyCode.PAGE_UP: - this._repeat( null, options.page, event ); - return true; - case keyCode.PAGE_DOWN: - this._repeat( null, -options.page, event ); - return true; - } - - return false; - }, - - _uiSpinnerHtml: function() { - return ""; - }, - - _buttonHtml: function() { - return "" + - "" + - "" + - "" + - "" + - "" + - ""; - }, - - _start: function( event ) { - if ( !this.spinning && this._trigger( "start", event ) === false ) { - return false; - } - - if ( !this.counter ) { - this.counter = 1; - } - this.spinning = true; - return true; - }, - - _repeat: function( i, steps, event ) { - i = i || 500; - - clearTimeout( this.timer ); - this.timer = this._delay(function() { - this._repeat( 40, steps, event ); - }, i ); - - this._spin( steps * this.options.step, event ); - }, - - _spin: function( step, event ) { - var value = this.value() || 0; - - if ( !this.counter ) { - this.counter = 1; - } - - value = this._adjustValue( value + step * this._increment( this.counter ) ); - - if ( !this.spinning || this._trigger( "spin", event, { value: value } ) !== false) { - this._value( value ); - this.counter++; - } - }, - - _increment: function( i ) { - var incremental = this.options.incremental; - - if ( incremental ) { - return $.isFunction( incremental ) ? - incremental( i ) : - Math.floor( i * i * i / 50000 - i * i / 500 + 17 * i / 200 + 1 ); - } - - return 1; - }, - - _precision: function() { - var precision = this._precisionOf( this.options.step ); - if ( this.options.min !== null ) { - precision = Math.max( precision, this._precisionOf( this.options.min ) ); - } - return precision; - }, - - _precisionOf: function( num ) { - var str = num.toString(), - decimal = str.indexOf( "." ); - return decimal === -1 ? 0 : str.length - decimal - 1; - }, - - _adjustValue: function( value ) { - var base, aboveMin, - options = this.options; - - // make sure we're at a valid step - // - find out where we are relative to the base (min or 0) - base = options.min !== null ? options.min : 0; - aboveMin = value - base; - // - round to the nearest step - aboveMin = Math.round(aboveMin / options.step) * options.step; - // - rounding is based on 0, so adjust back to our base - value = base + aboveMin; - - // fix precision from bad JS floating point math - value = parseFloat( value.toFixed( this._precision() ) ); - - // clamp the value - if ( options.max !== null && value > options.max) { - return options.max; - } - if ( options.min !== null && value < options.min ) { - return options.min; - } - - return value; - }, - - _stop: function( event ) { - if ( !this.spinning ) { - return; - } - - clearTimeout( this.timer ); - clearTimeout( this.mousewheelTimer ); - this.counter = 0; - this.spinning = false; - this._trigger( "stop", event ); - }, - - _setOption: function( key, value ) { - if ( key === "culture" || key === "numberFormat" ) { - var prevValue = this._parse( this.element.val() ); - this.options[ key ] = value; - this.element.val( this._format( prevValue ) ); - return; - } - - if ( key === "max" || key === "min" || key === "step" ) { - if ( typeof value === "string" ) { - value = this._parse( value ); - } - } - if ( key === "icons" ) { - this.buttons.first().find( ".ui-icon" ) - .removeClass( this.options.icons.up ) - .addClass( value.up ); - this.buttons.last().find( ".ui-icon" ) - .removeClass( this.options.icons.down ) - .addClass( value.down ); - } - - this._super( key, value ); - - if ( key === "disabled" ) { - this.widget().toggleClass( "ui-state-disabled", !!value ); - this.element.prop( "disabled", !!value ); - this.buttons.button( value ? "disable" : "enable" ); - } - }, - - _setOptions: spinner_modifier(function( options ) { - this._super( options ); - this._value( this.element.val() ); - }), - - _parse: function( val ) { - if ( typeof val === "string" && val !== "" ) { - val = window.Globalize && this.options.numberFormat ? - Globalize.parseFloat( val, 10, this.options.culture ) : +val; - } - return val === "" || isNaN( val ) ? null : val; - }, - - _format: function( value ) { - if ( value === "" ) { - return ""; - } - return window.Globalize && this.options.numberFormat ? - Globalize.format( value, this.options.numberFormat, this.options.culture ) : - value; - }, - - _refresh: function() { - this.element.attr({ - "aria-valuemin": this.options.min, - "aria-valuemax": this.options.max, - // TODO: what should we do with values that can't be parsed? - "aria-valuenow": this._parse( this.element.val() ) - }); - }, - - isValid: function() { - var value = this.value(); - - // null is invalid - if ( value === null ) { - return false; - } - - // if value gets adjusted, it's invalid - return value === this._adjustValue( value ); - }, - - // update the value without triggering change - _value: function( value, allowAny ) { - var parsed; - if ( value !== "" ) { - parsed = this._parse( value ); - if ( parsed !== null ) { - if ( !allowAny ) { - parsed = this._adjustValue( parsed ); - } - value = this._format( parsed ); - } - } - this.element.val( value ); - this._refresh(); - }, - - _destroy: function() { - this.element - .removeClass( "ui-spinner-input" ) - .prop( "disabled", false ) - .removeAttr( "autocomplete" ) - .removeAttr( "role" ) - .removeAttr( "aria-valuemin" ) - .removeAttr( "aria-valuemax" ) - .removeAttr( "aria-valuenow" ); - this.uiSpinner.replaceWith( this.element ); - }, - - stepUp: spinner_modifier(function( steps ) { - this._stepUp( steps ); - }), - _stepUp: function( steps ) { - if ( this._start() ) { - this._spin( (steps || 1) * this.options.step ); - this._stop(); - } - }, - - stepDown: spinner_modifier(function( steps ) { - this._stepDown( steps ); - }), - _stepDown: function( steps ) { - if ( this._start() ) { - this._spin( (steps || 1) * -this.options.step ); - this._stop(); - } - }, - - pageUp: spinner_modifier(function( pages ) { - this._stepUp( (pages || 1) * this.options.page ); - }), - - pageDown: spinner_modifier(function( pages ) { - this._stepDown( (pages || 1) * this.options.page ); - }), - - value: function( newVal ) { - if ( !arguments.length ) { - return this._parse( this.element.val() ); - } - spinner_modifier( this._value ).call( this, newVal ); - }, - - widget: function() { - return this.uiSpinner; - } -}); - -})); diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js deleted file mode 100644 index 32f0f8625..000000000 --- a/ui/jquery.ui.tabs.js +++ /dev/null @@ -1,868 +0,0 @@ -/*! - * jQuery UI Tabs @VERSION - * http://jqueryui.com - * - * Copyright 2013 jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * http://api.jqueryui.com/tabs/ - */ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - - // AMD. Register as an anonymous module. - define([ - "jquery", - "./jquery.ui.core", - "./jquery.ui.widget" - ], factory ); - } else { - - // Browser globals - factory( jQuery ); - } -}(function( $ ) { - -return $.widget( "ui.tabs", { - version: "@VERSION", - delay: 300, - options: { - active: null, - collapsible: false, - event: "click", - heightStyle: "content", - hide: null, - show: null, - - // callbacks - activate: null, - beforeActivate: null, - beforeLoad: null, - load: null - }, - - _isLocal: (function() { - var rhash = /#.*$/; - - return function( anchor ) { - var anchorUrl, locationUrl; - - // support: IE7 - // IE7 doesn't normalize the href property when set via script (#9317) - anchor = anchor.cloneNode( false ); - - anchorUrl = anchor.href.replace( rhash, "" ); - locationUrl = location.href.replace( rhash, "" ); - - // decoding may throw an error if the URL isn't UTF-8 (#9518) - try { - anchorUrl = decodeURIComponent( anchorUrl ); - } catch ( error ) {} - try { - locationUrl = decodeURIComponent( locationUrl ); - } catch ( error ) {} - - return anchor.hash.length > 1 && anchorUrl === locationUrl; - }; - })(), - - _create: function() { - var that = this, - options = this.options; - - this.running = false; - - this.element - .addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" ) - .toggleClass( "ui-tabs-collapsible", options.collapsible ) - // Prevent users from focusing disabled tabs via click - .delegate( ".ui-tabs-nav > li", "mousedown" + this.eventNamespace, function( event ) { - if ( $( this ).is( ".ui-state-disabled" ) ) { - event.preventDefault(); - } - }) - // support: IE <9 - // Preventing the default action in mousedown doesn't prevent IE - // from focusing the element, so if the anchor gets focused, blur. - // We don't have to worry about focusing the previously focused - // element since clicking on a non-focusable element should focus - // the body anyway. - .delegate( ".ui-tabs-anchor", "focus" + this.eventNamespace, function() { - if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) { - this.blur(); - } - }); - - this._processTabs(); - options.active = this._initialActive(); - - // Take disabling tabs via class attribute from HTML - // into account and update option properly. - if ( $.isArray( options.disabled ) ) { - options.disabled = $.unique( options.disabled.concat( - $.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) { - return that.tabs.index( li ); - }) - ) ).sort(); - } - - // check for length avoids error when initializing empty list - if ( this.options.active !== false && this.anchors.length ) { - this.active = this._findActive( options.active ); - } else { - this.active = $(); - } - - this._refresh(); - - if ( this.active.length ) { - this.load( options.active ); - } - }, - - _initialActive: function() { - var active = this.options.active, - collapsible = this.options.collapsible, - locationHash = location.hash.substring( 1 ); - - if ( active === null ) { - // check the fragment identifier in the URL - if ( locationHash ) { - this.tabs.each(function( i, tab ) { - if ( $( tab ).attr( "aria-controls" ) === locationHash ) { - active = i; - return false; - } - }); - } - - // check for a tab marked active via a class - if ( active === null ) { - active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) ); - } - - // no active tab, set to false - if ( active === null || active === -1 ) { - active = this.tabs.length ? 0 : false; - } - } - - // handle numbers: negative, out of range - if ( active !== false ) { - active = this.tabs.index( this.tabs.eq( active ) ); - if ( active === -1 ) { - active = collapsible ? false : 0; - } - } - - // don't allow collapsible: false and active: false - if ( !collapsible && active === false && this.anchors.length ) { - active = 0; - } - - return active; - }, - - _getCreateEventData: function() { - return { - tab: this.active, - panel: !this.active.length ? $() : this._getPanelForTab( this.active ) - }; - }, - - _tabKeydown: function( event ) { - var focusedTab = $( this.document[0].activeElement ).closest( "li" ), - selectedIndex = this.tabs.index( focusedTab ), - goingForward = true; - - if ( this._handlePageNav( event ) ) { - return; - } - - switch ( event.keyCode ) { - case $.ui.keyCode.RIGHT: - case $.ui.keyCode.DOWN: - selectedIndex++; - break; - case $.ui.keyCode.UP: - case $.ui.keyCode.LEFT: - goingForward = false; - selectedIndex--; - break; - case $.ui.keyCode.END: - selectedIndex = this.anchors.length - 1; - break; - case $.ui.keyCode.HOME: - selectedIndex = 0; - break; - case $.ui.keyCode.SPACE: - // Activate only, no collapsing - event.preventDefault(); - clearTimeout( this.activating ); - this._activate( selectedIndex ); - return; - case $.ui.keyCode.ENTER: - // Toggle (cancel delayed activation, allow collapsing) - event.preventDefault(); - clearTimeout( this.activating ); - // Determine if we should collapse or activate - this._activate( selectedIndex === this.options.active ? false : selectedIndex ); - return; - default: - return; - } - - // Focus the appropriate tab, based on which key was pressed - event.preventDefault(); - clearTimeout( this.activating ); - selectedIndex = this._focusNextTab( selectedIndex, goingForward ); - - // Navigating with control key will prevent automatic activation - if ( !event.ctrlKey ) { - // Update aria-selected immediately so that AT think the tab is already selected. - // Otherwise AT may confuse the user by stating that they need to activate the tab, - // but the tab will already be activated by the time the announcement finishes. - focusedTab.attr( "aria-selected", "false" ); - this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" ); - - this.activating = this._delay(function() { - this.option( "active", selectedIndex ); - }, this.delay ); - } - }, - - _panelKeydown: function( event ) { - if ( this._handlePageNav( event ) ) { - return; - } - - // Ctrl+up moves focus to the current tab - if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) { - event.preventDefault(); - this.active.focus(); - } - }, - - // Alt+page up/down moves focus to the previous/next tab (and activates) - _handlePageNav: function( event ) { - if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) { - this._activate( this._focusNextTab( this.options.active - 1, false ) ); - return true; - } - if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) { - this._activate( this._focusNextTab( this.options.active + 1, true ) ); - return true; - } - }, - - _findNextTab: function( index, goingForward ) { - var lastTabIndex = this.tabs.length - 1; - - function constrain() { - if ( index > lastTabIndex ) { - index = 0; - } - if ( index < 0 ) { - index = lastTabIndex; - } - return index; - } - - while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) { - index = goingForward ? index + 1 : index - 1; - } - - return index; - }, - - _focusNextTab: function( index, goingForward ) { - index = this._findNextTab( index, goingForward ); - this.tabs.eq( index ).focus(); - return index; - }, - - _setOption: function( key, value ) { - if ( key === "active" ) { - // _activate() will handle invalid values and update this.options - this._activate( value ); - return; - } - - if ( key === "disabled" ) { - // don't use the widget factory's disabled handling - this._setupDisabled( value ); - return; - } - - this._super( key, value); - - if ( key === "collapsible" ) { - this.element.toggleClass( "ui-tabs-collapsible", value ); - // Setting collapsible: false while collapsed; open first panel - if ( !value && this.options.active === false ) { - this._activate( 0 ); - } - } - - if ( key === "event" ) { - this._setupEvents( value ); - } - - if ( key === "heightStyle" ) { - this._setupHeightStyle( value ); - } - }, - - _sanitizeSelector: function( hash ) { - return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : ""; - }, - - refresh: function() { - var options = this.options, - lis = this.tablist.children( ":has(a[href])" ); - - // get disabled tabs from class attribute from HTML - // this will get converted to a boolean if needed in _refresh() - options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) { - return lis.index( tab ); - }); - - this._processTabs(); - - // was collapsed or no tabs - if ( options.active === false || !this.anchors.length ) { - options.active = false; - this.active = $(); - // was active, but active tab is gone - } else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) { - // all remaining tabs are disabled - if ( this.tabs.length === options.disabled.length ) { - options.active = false; - this.active = $(); - // activate previous tab - } else { - this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) ); - } - // was active, active tab still exists - } else { - // make sure active index is correct - options.active = this.tabs.index( this.active ); - } - - this._refresh(); - }, - - _refresh: function() { - this._setupDisabled( this.options.disabled ); - this._setupEvents( this.options.event ); - this._setupHeightStyle( this.options.heightStyle ); - - this.tabs.not( this.active ).attr({ - "aria-selected": "false", - tabIndex: -1 - }); - this.panels.not( this._getPanelForTab( this.active ) ) - .hide() - .attr({ - "aria-expanded": "false", - "aria-hidden": "true" - }); - - // Make sure one tab is in the tab order - if ( !this.active.length ) { - this.tabs.eq( 0 ).attr( "tabIndex", 0 ); - } else { - this.active - .addClass( "ui-tabs-active ui-state-active" ) - .attr({ - "aria-selected": "true", - tabIndex: 0 - }); - this._getPanelForTab( this.active ) - .show() - .attr({ - "aria-expanded": "true", - "aria-hidden": "false" - }); - } - }, - - _processTabs: function() { - var that = this; - - this.tablist = this._getList() - .addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" ) - .attr( "role", "tablist" ); - - this.tabs = this.tablist.find( "> li:has(a[href])" ) - .addClass( "ui-state-default ui-corner-top" ) - .attr({ - role: "tab", - tabIndex: -1 - }); - - this.anchors = this.tabs.map(function() { - return $( "a", this )[ 0 ]; - }) - .addClass( "ui-tabs-anchor" ) - .attr({ - role: "presentation", - tabIndex: -1 - }); - - this.panels = $(); - - this.anchors.each(function( i, anchor ) { - var selector, panel, panelId, - anchorId = $( anchor ).uniqueId().attr( "id" ), - tab = $( anchor ).closest( "li" ), - originalAriaControls = tab.attr( "aria-controls" ); - - // inline tab - if ( that._isLocal( anchor ) ) { - selector = anchor.hash; - panelId = selector.substring( 1 ); - panel = that.element.find( that._sanitizeSelector( selector ) ); - // remote tab - } else { - // If the tab doesn't already have aria-controls, - // generate an id by using a throw-away element - panelId = tab.attr( "aria-controls" ) || $( {} ).uniqueId()[ 0 ].id; - selector = "#" + panelId; - panel = that.element.find( selector ); - if ( !panel.length ) { - panel = that._createPanel( panelId ); - panel.insertAfter( that.panels[ i - 1 ] || that.tablist ); - } - panel.attr( "aria-live", "polite" ); - } - - if ( panel.length) { - that.panels = that.panels.add( panel ); - } - if ( originalAriaControls ) { - tab.data( "ui-tabs-aria-controls", originalAriaControls ); - } - tab.attr({ - "aria-controls": panelId, - "aria-labelledby": anchorId - }); - panel.attr( "aria-labelledby", anchorId ); - }); - - this.panels - .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ) - .attr( "role", "tabpanel" ); - }, - - // allow overriding how to find the list for rare usage scenarios (#7715) - _getList: function() { - return this.tablist || this.element.find( "ol,ul" ).eq( 0 ); - }, - - _createPanel: function( id ) { - return $( "
" ) - .attr( "id", id ) - .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ) - .data( "ui-tabs-destroy", true ); - }, - - _setupDisabled: function( disabled ) { - if ( $.isArray( disabled ) ) { - if ( !disabled.length ) { - disabled = false; - } else if ( disabled.length === this.anchors.length ) { - disabled = true; - } - } - - // disable tabs - for ( var i = 0, li; ( li = this.tabs[ i ] ); i++ ) { - if ( disabled === true || $.inArray( i, disabled ) !== -1 ) { - $( li ) - .addClass( "ui-state-disabled" ) - .attr( "aria-disabled", "true" ); - } else { - $( li ) - .removeClass( "ui-state-disabled" ) - .removeAttr( "aria-disabled" ); - } - } - - this.options.disabled = disabled; - }, - - _setupEvents: function( event ) { - var events = {}; - if ( event ) { - $.each( event.split(" "), function( index, eventName ) { - events[ eventName ] = "_eventHandler"; - }); - } - - this._off( this.anchors.add( this.tabs ).add( this.panels ) ); - // Always prevent the default action, even when disabled - this._on( true, this.anchors, { - click: function( event ) { - event.preventDefault(); - } - }); - this._on( this.anchors, events ); - this._on( this.tabs, { keydown: "_tabKeydown" } ); - this._on( this.panels, { keydown: "_panelKeydown" } ); - - this._focusable( this.tabs ); - this._hoverable( this.tabs ); - }, - - _setupHeightStyle: function( heightStyle ) { - var maxHeight, - parent = this.element.parent(); - - if ( heightStyle === "fill" ) { - maxHeight = parent.height(); - maxHeight -= this.element.outerHeight() - this.element.height(); - - this.element.siblings( ":visible" ).each(function() { - var elem = $( this ), - position = elem.css( "position" ); - - if ( position === "absolute" || position === "fixed" ) { - return; - } - maxHeight -= elem.outerHeight( true ); - }); - - this.element.children().not( this.panels ).each(function() { - maxHeight -= $( this ).outerHeight( true ); - }); - - this.panels.each(function() { - $( this ).height( Math.max( 0, maxHeight - - $( this ).innerHeight() + $( this ).height() ) ); - }) - .css( "overflow", "auto" ); - } else if ( heightStyle === "auto" ) { - maxHeight = 0; - this.panels.each(function() { - maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() ); - }).height( maxHeight ); - } - }, - - _eventHandler: function( event ) { - var options = this.options, - active = this.active, - anchor = $( event.currentTarget ), - tab = anchor.closest( "li" ), - clickedIsActive = tab[ 0 ] === active[ 0 ], - collapsing = clickedIsActive && options.collapsible, - toShow = collapsing ? $() : this._getPanelForTab( tab ), - toHide = !active.length ? $() : this._getPanelForTab( active ), - eventData = { - oldTab: active, - oldPanel: toHide, - newTab: collapsing ? $() : tab, - newPanel: toShow - }; - - event.preventDefault(); - - if ( tab.hasClass( "ui-state-disabled" ) || - // tab is already loading - tab.hasClass( "ui-tabs-loading" ) || - // can't switch durning an animation - this.running || - // click on active header, but not collapsible - ( clickedIsActive && !options.collapsible ) || - // allow canceling activation - ( this._trigger( "beforeActivate", event, eventData ) === false ) ) { - return; - } - - options.active = collapsing ? false : this.tabs.index( tab ); - - this.active = clickedIsActive ? $() : tab; - if ( this.xhr ) { - this.xhr.abort(); - } - - if ( !toHide.length && !toShow.length ) { - $.error( "jQuery UI Tabs: Mismatching fragment identifier." ); - } - - if ( toShow.length ) { - this.load( this.tabs.index( tab ), event ); - } - this._toggle( event, eventData ); - }, - - // handles show/hide for selecting tabs - _toggle: function( event, eventData ) { - var that = this, - toShow = eventData.newPanel, - toHide = eventData.oldPanel; - - this.running = true; - - function complete() { - that.running = false; - that._trigger( "activate", event, eventData ); - } - - function show() { - eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" ); - - if ( toShow.length && that.options.show ) { - that._show( toShow, that.options.show, complete ); - } else { - toShow.show(); - complete(); - } - } - - // start out by hiding, then showing, then completing - if ( toHide.length && this.options.hide ) { - this._hide( toHide, this.options.hide, function() { - eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" ); - show(); - }); - } else { - eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" ); - toHide.hide(); - show(); - } - - toHide.attr({ - "aria-expanded": "false", - "aria-hidden": "true" - }); - eventData.oldTab.attr( "aria-selected", "false" ); - // If we're switching tabs, remove the old tab from the tab order. - // If we're opening from collapsed state, remove the previous tab from the tab order. - // If we're collapsing, then keep the collapsing tab in the tab order. - if ( toShow.length && toHide.length ) { - eventData.oldTab.attr( "tabIndex", -1 ); - } else if ( toShow.length ) { - this.tabs.filter(function() { - return $( this ).attr( "tabIndex" ) === 0; - }) - .attr( "tabIndex", -1 ); - } - - toShow.attr({ - "aria-expanded": "true", - "aria-hidden": "false" - }); - eventData.newTab.attr({ - "aria-selected": "true", - tabIndex: 0 - }); - }, - - _activate: function( index ) { - var anchor, - active = this._findActive( index ); - - // trying to activate the already active panel - if ( active[ 0 ] === this.active[ 0 ] ) { - return; - } - - // trying to collapse, simulate a click on the current active header - if ( !active.length ) { - active = this.active; - } - - anchor = active.find( ".ui-tabs-anchor" )[ 0 ]; - this._eventHandler({ - target: anchor, - currentTarget: anchor, - preventDefault: $.noop - }); - }, - - _findActive: function( index ) { - return index === false ? $() : this.tabs.eq( index ); - }, - - _getIndex: function( index ) { - // meta-function to give users option to provide a href string instead of a numerical index. - if ( typeof index === "string" ) { - index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) ); - } - - return index; - }, - - _destroy: function() { - if ( this.xhr ) { - this.xhr.abort(); - } - - this.element.removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" ); - - this.tablist - .removeClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" ) - .removeAttr( "role" ); - - this.anchors - .removeClass( "ui-tabs-anchor" ) - .removeAttr( "role" ) - .removeAttr( "tabIndex" ) - .removeUniqueId(); - - this.tabs.add( this.panels ).each(function() { - if ( $.data( this, "ui-tabs-destroy" ) ) { - $( this ).remove(); - } else { - $( this ) - .removeClass( "ui-state-default ui-state-active ui-state-disabled " + - "ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel" ) - .removeAttr( "tabIndex" ) - .removeAttr( "aria-live" ) - .removeAttr( "aria-busy" ) - .removeAttr( "aria-selected" ) - .removeAttr( "aria-labelledby" ) - .removeAttr( "aria-hidden" ) - .removeAttr( "aria-expanded" ) - .removeAttr( "role" ); - } - }); - - this.tabs.each(function() { - var li = $( this ), - prev = li.data( "ui-tabs-aria-controls" ); - if ( prev ) { - li - .attr( "aria-controls", prev ) - .removeData( "ui-tabs-aria-controls" ); - } else { - li.removeAttr( "aria-controls" ); - } - }); - - this.panels.show(); - - if ( this.options.heightStyle !== "content" ) { - this.panels.css( "height", "" ); - } - }, - - enable: function( index ) { - var disabled = this.options.disabled; - if ( disabled === false ) { - return; - } - - if ( index === undefined ) { - disabled = false; - } else { - index = this._getIndex( index ); - if ( $.isArray( disabled ) ) { - disabled = $.map( disabled, function( num ) { - return num !== index ? num : null; - }); - } else { - disabled = $.map( this.tabs, function( li, num ) { - return num !== index ? num : null; - }); - } - } - this._setupDisabled( disabled ); - }, - - disable: function( index ) { - var disabled = this.options.disabled; - if ( disabled === true ) { - return; - } - - if ( index === undefined ) { - disabled = true; - } else { - index = this._getIndex( index ); - if ( $.inArray( index, disabled ) !== -1 ) { - return; - } - if ( $.isArray( disabled ) ) { - disabled = $.merge( [ index ], disabled ).sort(); - } else { - disabled = [ index ]; - } - } - this._setupDisabled( disabled ); - }, - - load: function( index, event ) { - index = this._getIndex( index ); - var that = this, - tab = this.tabs.eq( index ), - anchor = tab.find( ".ui-tabs-anchor" ), - panel = this._getPanelForTab( tab ), - eventData = { - tab: tab, - panel: panel - }; - - // not remote - if ( this._isLocal( anchor[ 0 ] ) ) { - return; - } - - this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) ); - - // support: jQuery <1.8 - // jQuery <1.8 returns false if the request is canceled in beforeSend, - // but as of 1.8, $.ajax() always returns a jqXHR object. - if ( this.xhr && this.xhr.statusText !== "canceled" ) { - tab.addClass( "ui-tabs-loading" ); - panel.attr( "aria-busy", "true" ); - - this.xhr - .success(function( response ) { - // support: jQuery <1.8 - // http://bugs.jquery.com/ticket/11778 - setTimeout(function() { - panel.html( response ); - that._trigger( "load", event, eventData ); - }, 1 ); - }) - .complete(function( jqXHR, status ) { - // support: jQuery <1.8 - // http://bugs.jquery.com/ticket/11778 - setTimeout(function() { - if ( status === "abort" ) { - that.panels.stop( false, true ); - } - - tab.removeClass( "ui-tabs-loading" ); - panel.removeAttr( "aria-busy" ); - - if ( jqXHR === that.xhr ) { - delete that.xhr; - } - }, 1 ); - }); - } - }, - - _ajaxSettings: function( anchor, event, eventData ) { - var that = this; - return { - url: anchor.attr( "href" ), - beforeSend: function( jqXHR, settings ) { - return that._trigger( "beforeLoad", event, - $.extend( { jqXHR: jqXHR, ajaxSettings: settings }, eventData ) ); - } - }; - }, - - _getPanelForTab: function( tab ) { - var id = $( tab ).attr( "aria-controls" ); - return this.element.find( this._sanitizeSelector( "#" + id ) ); - } -}); - -})); diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js deleted file mode 100644 index 7a4ee79e4..000000000 --- a/ui/jquery.ui.tooltip.js +++ /dev/null @@ -1,444 +0,0 @@ -/*! - * jQuery UI Tooltip @VERSION - * http://jqueryui.com - * - * Copyright 2013 jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * http://api.jqueryui.com/tooltip/ - */ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - - // AMD. Register as an anonymous module. - define([ - "jquery", - "./jquery.ui.core", - "./jquery.ui.widget", - "./jquery.ui.position" - ], factory ); - } else { - - // Browser globals - factory( jQuery ); - } -}(function( $ ) { - -return $.widget( "ui.tooltip", { - version: "@VERSION", - options: { - content: function() { - // support: IE<9, Opera in jQuery <1.7 - // .text() can't accept undefined, so coerce to a string - var title = $( this ).attr( "title" ) || ""; - // Escape title, since we're going from an attribute to raw HTML - return $( "" ).text( title ).html(); - }, - hide: true, - // Disabled elements have inconsistent behavior across browsers (#8661) - items: "[title]:not([disabled])", - position: { - my: "left top+15", - at: "left bottom", - collision: "flipfit flip" - }, - show: true, - tooltipClass: null, - track: false, - - // callbacks - close: null, - open: null - }, - - _addDescribedBy: function( elem, id ) { - var describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ ); - describedby.push( id ); - elem - .data( "ui-tooltip-id", id ) - .attr( "aria-describedby", $.trim( describedby.join( " " ) ) ); - }, - - _removeDescribedBy: function( elem ) { - var id = elem.data( "ui-tooltip-id" ), - describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ ), - index = $.inArray( id, describedby ); - - if ( index !== -1 ) { - describedby.splice( index, 1 ); - } - - elem.removeData( "ui-tooltip-id" ); - describedby = $.trim( describedby.join( " " ) ); - if ( describedby ) { - elem.attr( "aria-describedby", describedby ); - } else { - elem.removeAttr( "aria-describedby" ); - } - }, - - _create: function() { - this._on({ - mouseover: "open", - focusin: "open" - }); - - // IDs of generated tooltips, needed for destroy - this.tooltips = {}; - // IDs of parent tooltips where we removed the title attribute - this.parents = {}; - - if ( this.options.disabled ) { - this._disable(); - } - - // Append the aria-live region so tooltips announce correctly - this.liveRegion = $( "
" ) - .attr({ - role: "log", - "aria-live": "assertive", - "aria-relevant": "additions" - }) - .addClass( "ui-helper-hidden-accessible" ) - .appendTo( this.document[ 0 ].body ); - }, - - _setOption: function( key, value ) { - var that = this; - - if ( key === "disabled" ) { - this[ value ? "_disable" : "_enable" ](); - this.options[ key ] = value; - // disable element style changes - return; - } - - this._super( key, value ); - - if ( key === "content" ) { - $.each( this.tooltips, function( id, element ) { - that._updateContent( element ); - }); - } - }, - - _disable: function() { - var that = this; - - // close open tooltips - $.each( this.tooltips, function( id, element ) { - var event = $.Event( "blur" ); - event.target = event.currentTarget = element[0]; - that.close( event, true ); - }); - - // remove title attributes to prevent native tooltips - this.element.find( this.options.items ).addBack().each(function() { - var element = $( this ); - if ( element.is( "[title]" ) ) { - element - .data( "ui-tooltip-title", element.attr( "title" ) ) - .removeAttr( "title" ); - } - }); - }, - - _enable: function() { - // restore title attributes - this.element.find( this.options.items ).addBack().each(function() { - var element = $( this ); - if ( element.data( "ui-tooltip-title" ) ) { - element.attr( "title", element.data( "ui-tooltip-title" ) ); - } - }); - }, - - open: function( event ) { - var that = this, - target = $( event ? event.target : this.element ) - // we need closest here due to mouseover bubbling, - // but always pointing at the same event target - .closest( this.options.items ); - - // No element to show a tooltip for or the tooltip is already open - if ( !target.length || target.data( "ui-tooltip-id" ) ) { - return; - } - - if ( target.attr( "title" ) ) { - target.data( "ui-tooltip-title", target.attr( "title" ) ); - } - - target.data( "ui-tooltip-open", true ); - - // kill parent tooltips, custom or native, for hover - if ( event && event.type === "mouseover" ) { - target.parents().each(function() { - var parent = $( this ), - blurEvent; - if ( parent.data( "ui-tooltip-open" ) ) { - blurEvent = $.Event( "blur" ); - blurEvent.target = blurEvent.currentTarget = this; - that.close( blurEvent, true ); - } - if ( parent.attr( "title" ) ) { - parent.uniqueId(); - that.parents[ this.id ] = { - element: this, - title: parent.attr( "title" ) - }; - parent.attr( "title", "" ); - } - }); - } - - this._updateContent( target, event ); - }, - - _updateContent: function( target, event ) { - var content, - contentOption = this.options.content, - that = this, - eventType = event ? event.type : null; - - if ( typeof contentOption === "string" ) { - return this._open( event, target, contentOption ); - } - - content = contentOption.call( target[0], function( response ) { - // ignore async response if tooltip was closed already - if ( !target.data( "ui-tooltip-open" ) ) { - return; - } - // IE may instantly serve a cached response for ajax requests - // delay this call to _open so the other call to _open runs first - that._delay(function() { - // jQuery creates a special event for focusin when it doesn't - // exist natively. To improve performance, the native event - // object is reused and the type is changed. Therefore, we can't - // rely on the type being correct after the event finished - // bubbling, so we set it back to the previous value. (#8740) - if ( event ) { - event.type = eventType; - } - this._open( event, target, response ); - }); - }); - if ( content ) { - this._open( event, target, content ); - } - }, - - _open: function( event, target, content ) { - var tooltip, events, delayedShow, a11yContent, - positionOption = $.extend( {}, this.options.position ); - - if ( !content ) { - return; - } - - // Content can be updated multiple times. If the tooltip already - // exists, then just update the content and bail. - tooltip = this._find( target ); - if ( tooltip.length ) { - tooltip.find( ".ui-tooltip-content" ).html( content ); - return; - } - - // if we have a title, clear it to prevent the native tooltip - // we have to check first to avoid defining a title if none exists - // (we don't want to cause an element to start matching [title]) - // - // We use removeAttr only for key events, to allow IE to export the correct - // accessible attributes. For mouse events, set to empty string to avoid - // native tooltip showing up (happens only when removing inside mouseover). - if ( target.is( "[title]" ) ) { - if ( event && event.type === "mouseover" ) { - target.attr( "title", "" ); - } else { - target.removeAttr( "title" ); - } - } - - tooltip = this._tooltip( target ); - this._addDescribedBy( target, tooltip.attr( "id" ) ); - tooltip.find( ".ui-tooltip-content" ).html( content ); - - // Support: Voiceover on OS X, JAWS on IE <= 9 - // JAWS announces deletions even when aria-relevant="additions" - // Voiceover will sometimes re-read the entire log region's contents from the beginning - this.liveRegion.children().hide(); - if ( content.clone ) { - a11yContent = content.clone(); - a11yContent.removeAttr( "id" ).find( "[id]" ).removeAttr( "id" ); - } else { - a11yContent = content; - } - $( "
" ).html( a11yContent ).appendTo( this.liveRegion ); - - function position( event ) { - positionOption.of = event; - if ( tooltip.is( ":hidden" ) ) { - return; - } - tooltip.position( positionOption ); - } - if ( this.options.track && event && /^mouse/.test( event.type ) ) { - this._on( this.document, { - mousemove: position - }); - // trigger once to override element-relative positioning - position( event ); - } else { - tooltip.position( $.extend({ - of: target - }, this.options.position ) ); - } - - tooltip.hide(); - - this._show( tooltip, this.options.show ); - // Handle tracking tooltips that are shown with a delay (#8644). As soon - // as the tooltip is visible, position the tooltip using the most recent - // event. - if ( this.options.show && this.options.show.delay ) { - delayedShow = this.delayedShow = setInterval(function() { - if ( tooltip.is( ":visible" ) ) { - position( positionOption.of ); - clearInterval( delayedShow ); - } - }, $.fx.interval ); - } - - this._trigger( "open", event, { tooltip: tooltip } ); - - events = { - keyup: function( event ) { - if ( event.keyCode === $.ui.keyCode.ESCAPE ) { - var fakeEvent = $.Event(event); - fakeEvent.currentTarget = target[0]; - this.close( fakeEvent, true ); - } - } - }; - - // Only bind remove handler for delegated targets. Non-delegated - // tooltips will handle this in destroy. - if ( target[ 0 ] !== this.element[ 0 ] ) { - events.remove = function() { - this._removeTooltip( tooltip ); - }; - } - - if ( !event || event.type === "mouseover" ) { - events.mouseleave = "close"; - } - if ( !event || event.type === "focusin" ) { - events.focusout = "close"; - } - this._on( true, target, events ); - }, - - close: function( event ) { - var that = this, - target = $( event ? event.currentTarget : this.element ), - tooltip = this._find( target ); - - // disabling closes the tooltip, so we need to track when we're closing - // to avoid an infinite loop in case the tooltip becomes disabled on close - if ( this.closing ) { - return; - } - - // Clear the interval for delayed tracking tooltips - clearInterval( this.delayedShow ); - - // only set title if we had one before (see comment in _open()) - // If the title attribute has changed since open(), don't restore - if ( target.data( "ui-tooltip-title" ) && !target.attr( "title" ) ) { - target.attr( "title", target.data( "ui-tooltip-title" ) ); - } - - this._removeDescribedBy( target ); - - tooltip.stop( true ); - this._hide( tooltip, this.options.hide, function() { - that._removeTooltip( $( this ) ); - }); - - target.removeData( "ui-tooltip-open" ); - this._off( target, "mouseleave focusout keyup" ); - - // Remove 'remove' binding only on delegated targets - if ( target[ 0 ] !== this.element[ 0 ] ) { - this._off( target, "remove" ); - } - this._off( this.document, "mousemove" ); - - if ( event && event.type === "mouseleave" ) { - $.each( this.parents, function( id, parent ) { - $( parent.element ).attr( "title", parent.title ); - delete that.parents[ id ]; - }); - } - - this.closing = true; - this._trigger( "close", event, { tooltip: tooltip } ); - this.closing = false; - }, - - _tooltip: function( element ) { - var tooltip = $( "
" ) - .attr( "role", "tooltip" ) - .addClass( "ui-tooltip ui-widget ui-corner-all ui-widget-content " + - ( this.options.tooltipClass || "" ) ), - id = tooltip.uniqueId().attr( "id" ); - - $( "
" ) - .addClass( "ui-tooltip-content" ) - .appendTo( tooltip ); - - tooltip.appendTo( this.document[0].body ); - this.tooltips[ id ] = element; - return tooltip; - }, - - _find: function( target ) { - var id = target.data( "ui-tooltip-id" ); - return id ? $( "#" + id ) : $(); - }, - - _removeTooltip: function( tooltip ) { - tooltip.remove(); - delete this.tooltips[ tooltip.attr( "id" ) ]; - }, - - _destroy: function() { - var that = this; - - // close open tooltips - $.each( this.tooltips, function( id, element ) { - // Delegate to close method to handle common cleanup - var event = $.Event( "blur" ); - event.target = event.currentTarget = element[0]; - that.close( event, true ); - - // Remove immediately; destroying an open tooltip doesn't use the - // hide animation - $( "#" + id ).remove(); - - // Restore the title - if ( element.data( "ui-tooltip-title" ) ) { - // If the title attribute has changed since open(), don't restore - if ( !element.attr( "title" ) ) { - element.attr( "title", element.data( "ui-tooltip-title" ) ); - } - element.removeData( "ui-tooltip-title" ); - } - }); - this.liveRegion.remove(); - } -}); - -})); diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js deleted file mode 100644 index 2486610ef..000000000 --- a/ui/jquery.ui.widget.js +++ /dev/null @@ -1,544 +0,0 @@ -/*! - * jQuery UI Widget @VERSION - * http://jqueryui.com - * - * Copyright 2013 jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * http://api.jqueryui.com/jQuery.widget/ - */ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - - // AMD. Register as an anonymous module. - define( [ "jquery" ], factory ); - } else { - - // Browser globals - factory( jQuery ); - } -}(function( $ ) { - -var widget_uuid = 0, - widget_slice = Array.prototype.slice; - -$.cleanData = (function( orig ) { - return function( elems ) { - for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { - try { - $( elem ).triggerHandler( "remove" ); - // http://bugs.jquery.com/ticket/8235 - } catch( e ) {} - } - orig( elems ); - }; -})( $.cleanData ); - -$.widget = function( name, base, prototype ) { - var fullName, existingConstructor, constructor, basePrototype, - // proxiedPrototype allows the provided prototype to remain unmodified - // so that it can be used as a mixin for multiple widgets (#8876) - proxiedPrototype = {}, - namespace = name.split( "." )[ 0 ]; - - name = name.split( "." )[ 1 ]; - fullName = namespace + "-" + name; - - if ( !prototype ) { - prototype = base; - base = $.Widget; - } - - // create selector for plugin - $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) { - return !!$.data( elem, fullName ); - }; - - $[ namespace ] = $[ namespace ] || {}; - existingConstructor = $[ namespace ][ name ]; - constructor = $[ namespace ][ name ] = function( options, element ) { - // allow instantiation without "new" keyword - if ( !this._createWidget ) { - return new constructor( options, element ); - } - - // allow instantiation without initializing for simple inheritance - // must use "new" keyword (the code above always passes args) - if ( arguments.length ) { - this._createWidget( options, element ); - } - }; - // extend with the existing constructor to carry over any static properties - $.extend( constructor, existingConstructor, { - version: prototype.version, - // copy the object used to create the prototype in case we need to - // redefine the widget later - _proto: $.extend( {}, prototype ), - // track widgets that inherit from this widget in case this widget is - // redefined after a widget inherits from it - _childConstructors: [] - }); - - basePrototype = new base(); - // we need to make the options hash a property directly on the new instance - // otherwise we'll modify the options hash on the prototype that we're - // inheriting from - basePrototype.options = $.widget.extend( {}, basePrototype.options ); - $.each( prototype, function( prop, value ) { - if ( !$.isFunction( value ) ) { - proxiedPrototype[ prop ] = value; - return; - } - proxiedPrototype[ prop ] = (function() { - var _super = function() { - return base.prototype[ prop ].apply( this, arguments ); - }, - _superApply = function( args ) { - return base.prototype[ prop ].apply( this, args ); - }; - return function() { - var __super = this._super, - __superApply = this._superApply, - returnValue; - - this._super = _super; - this._superApply = _superApply; - - returnValue = value.apply( this, arguments ); - - this._super = __super; - this._superApply = __superApply; - - return returnValue; - }; - })(); - }); - constructor.prototype = $.widget.extend( basePrototype, { - // TODO: remove support for widgetEventPrefix - // always use the name + a colon as the prefix, e.g., draggable:start - // don't prefix for widgets that aren't DOM-based - widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name - }, proxiedPrototype, { - constructor: constructor, - namespace: namespace, - widgetName: name, - widgetFullName: fullName - }); - - // If this widget is being redefined then we need to find all widgets that - // are inheriting from it and redefine all of them so that they inherit from - // the new version of this widget. We're essentially trying to replace one - // level in the prototype chain. - if ( existingConstructor ) { - $.each( existingConstructor._childConstructors, function( i, child ) { - var childPrototype = child.prototype; - - // redefine the child widget using the same prototype that was - // originally used, but inherit from the new version of the base - $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto ); - }); - // remove the list of existing child constructors from the old constructor - // so the old child constructors can be garbage collected - delete existingConstructor._childConstructors; - } else { - base._childConstructors.push( constructor ); - } - - $.widget.bridge( name, constructor ); - - return constructor; -}; - -$.widget.extend = function( target ) { - var input = widget_slice.call( arguments, 1 ), - inputIndex = 0, - inputLength = input.length, - key, - value; - for ( ; inputIndex < inputLength; inputIndex++ ) { - for ( key in input[ inputIndex ] ) { - value = input[ inputIndex ][ key ]; - if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) { - // Clone objects - if ( $.isPlainObject( value ) ) { - target[ key ] = $.isPlainObject( target[ key ] ) ? - $.widget.extend( {}, target[ key ], value ) : - // Don't extend strings, arrays, etc. with objects - $.widget.extend( {}, value ); - // Copy everything else by reference - } else { - target[ key ] = value; - } - } - } - } - return target; -}; - -$.widget.bridge = function( name, object ) { - var fullName = object.prototype.widgetFullName || name; - $.fn[ name ] = function( options ) { - var isMethodCall = typeof options === "string", - args = widget_slice.call( arguments, 1 ), - returnValue = this; - - // allow multiple hashes to be passed on init - options = !isMethodCall && args.length ? - $.widget.extend.apply( null, [ options ].concat(args) ) : - options; - - if ( isMethodCall ) { - this.each(function() { - var methodValue, - instance = $.data( this, fullName ); - if ( options === "instance" ) { - returnValue = instance; - return false; - } - if ( !instance ) { - return $.error( "cannot call methods on " + name + " prior to initialization; " + - "attempted to call method '" + options + "'" ); - } - if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) { - return $.error( "no such method '" + options + "' for " + name + " widget instance" ); - } - methodValue = instance[ options ].apply( instance, args ); - if ( methodValue !== instance && methodValue !== undefined ) { - returnValue = methodValue && methodValue.jquery ? - returnValue.pushStack( methodValue.get() ) : - methodValue; - return false; - } - }); - } else { - this.each(function() { - var instance = $.data( this, fullName ); - if ( instance ) { - instance.option( options || {} ); - if ( instance._init ) { - instance._init(); - } - } else { - $.data( this, fullName, new object( options, this ) ); - } - }); - } - - return returnValue; - }; -}; - -$.Widget = function( /* options, element */ ) {}; -$.Widget._childConstructors = []; - -$.Widget.prototype = { - widgetName: "widget", - widgetEventPrefix: "", - defaultElement: "
", - options: { - disabled: false, - - // callbacks - create: null - }, - _createWidget: function( options, element ) { - element = $( element || this.defaultElement || this )[ 0 ]; - this.element = $( element ); - this.uuid = widget_uuid++; - this.eventNamespace = "." + this.widgetName + this.uuid; - this.options = $.widget.extend( {}, - this.options, - this._getCreateOptions(), - options ); - - this.bindings = $(); - this.hoverable = $(); - this.focusable = $(); - - if ( element !== this ) { - $.data( element, this.widgetFullName, this ); - this._on( true, this.element, { - remove: function( event ) { - if ( event.target === element ) { - this.destroy(); - } - } - }); - this.document = $( element.style ? - // element within the document - element.ownerDocument : - // element is window or document - element.document || element ); - this.window = $( this.document[0].defaultView || this.document[0].parentWindow ); - } - - this._create(); - this._trigger( "create", null, this._getCreateEventData() ); - this._init(); - }, - _getCreateOptions: $.noop, - _getCreateEventData: $.noop, - _create: $.noop, - _init: $.noop, - - destroy: function() { - this._destroy(); - // we can probably remove the unbind calls in 2.0 - // all event bindings should go through this._on() - this.element - .unbind( this.eventNamespace ) - .removeData( this.widgetFullName ) - // support: jquery <1.6.3 - // http://bugs.jquery.com/ticket/9413 - .removeData( $.camelCase( this.widgetFullName ) ); - this.widget() - .unbind( this.eventNamespace ) - .removeAttr( "aria-disabled" ) - .removeClass( - this.widgetFullName + "-disabled " + - "ui-state-disabled" ); - - // clean up events and states - this.bindings.unbind( this.eventNamespace ); - this.hoverable.removeClass( "ui-state-hover" ); - this.focusable.removeClass( "ui-state-focus" ); - }, - _destroy: $.noop, - - widget: function() { - return this.element; - }, - - option: function( key, value ) { - var options = key, - parts, - curOption, - i; - - if ( arguments.length === 0 ) { - // don't return a reference to the internal hash - return $.widget.extend( {}, this.options ); - } - - if ( typeof key === "string" ) { - // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } - options = {}; - parts = key.split( "." ); - key = parts.shift(); - if ( parts.length ) { - curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] ); - for ( i = 0; i < parts.length - 1; i++ ) { - curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {}; - curOption = curOption[ parts[ i ] ]; - } - key = parts.pop(); - if ( arguments.length === 1 ) { - return curOption[ key ] === undefined ? null : curOption[ key ]; - } - curOption[ key ] = value; - } else { - if ( arguments.length === 1 ) { - return this.options[ key ] === undefined ? null : this.options[ key ]; - } - options[ key ] = value; - } - } - - this._setOptions( options ); - - return this; - }, - _setOptions: function( options ) { - var key; - - for ( key in options ) { - this._setOption( key, options[ key ] ); - } - - return this; - }, - _setOption: function( key, value ) { - this.options[ key ] = value; - - if ( key === "disabled" ) { - this.widget() - .toggleClass( this.widgetFullName + "-disabled", !!value ); - - // If the widget is becoming disabled, then nothing is interactive - if ( value ) { - this.hoverable.removeClass( "ui-state-hover" ); - this.focusable.removeClass( "ui-state-focus" ); - } - } - - return this; - }, - - enable: function() { - return this._setOptions({ disabled: false }); - }, - disable: function() { - return this._setOptions({ disabled: true }); - }, - - _on: function( suppressDisabledCheck, element, handlers ) { - var delegateElement, - instance = this; - - // no suppressDisabledCheck flag, shuffle arguments - if ( typeof suppressDisabledCheck !== "boolean" ) { - handlers = element; - element = suppressDisabledCheck; - suppressDisabledCheck = false; - } - - // no element argument, shuffle and use this.element - if ( !handlers ) { - handlers = element; - element = this.element; - delegateElement = this.widget(); - } else { - // accept selectors, DOM elements - element = delegateElement = $( element ); - this.bindings = this.bindings.add( element ); - } - - $.each( handlers, function( event, handler ) { - function handlerProxy() { - // allow widgets to customize the disabled handling - // - disabled as an array instead of boolean - // - disabled class as method for disabling individual parts - if ( !suppressDisabledCheck && - ( instance.options.disabled === true || - $( this ).hasClass( "ui-state-disabled" ) ) ) { - return; - } - return ( typeof handler === "string" ? instance[ handler ] : handler ) - .apply( instance, arguments ); - } - - // copy the guid so direct unbinding works - if ( typeof handler !== "string" ) { - handlerProxy.guid = handler.guid = - handler.guid || handlerProxy.guid || $.guid++; - } - - var match = event.match( /^([\w:-]*)\s*(.*)$/ ), - eventName = match[1] + instance.eventNamespace, - selector = match[2]; - if ( selector ) { - delegateElement.delegate( selector, eventName, handlerProxy ); - } else { - element.bind( eventName, handlerProxy ); - } - }); - }, - - _off: function( element, eventName ) { - eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace; - element.unbind( eventName ).undelegate( eventName ); - }, - - _delay: function( handler, delay ) { - function handlerProxy() { - return ( typeof handler === "string" ? instance[ handler ] : handler ) - .apply( instance, arguments ); - } - var instance = this; - return setTimeout( handlerProxy, delay || 0 ); - }, - - _hoverable: function( element ) { - this.hoverable = this.hoverable.add( element ); - this._on( element, { - mouseenter: function( event ) { - $( event.currentTarget ).addClass( "ui-state-hover" ); - }, - mouseleave: function( event ) { - $( event.currentTarget ).removeClass( "ui-state-hover" ); - } - }); - }, - - _focusable: function( element ) { - this.focusable = this.focusable.add( element ); - this._on( element, { - focusin: function( event ) { - $( event.currentTarget ).addClass( "ui-state-focus" ); - }, - focusout: function( event ) { - $( event.currentTarget ).removeClass( "ui-state-focus" ); - } - }); - }, - - _trigger: function( type, event, data ) { - var prop, orig, - callback = this.options[ type ]; - - data = data || {}; - event = $.Event( event ); - event.type = ( type === this.widgetEventPrefix ? - type : - this.widgetEventPrefix + type ).toLowerCase(); - // the original event may come from any element - // so we need to reset the target on the new event - event.target = this.element[ 0 ]; - - // copy original event properties over to the new event - orig = event.originalEvent; - if ( orig ) { - for ( prop in orig ) { - if ( !( prop in event ) ) { - event[ prop ] = orig[ prop ]; - } - } - } - - this.element.trigger( event, data ); - return !( $.isFunction( callback ) && - callback.apply( this.element[0], [ event ].concat( data ) ) === false || - event.isDefaultPrevented() ); - } -}; - -$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { - $.Widget.prototype[ "_" + method ] = function( element, options, callback ) { - if ( typeof options === "string" ) { - options = { effect: options }; - } - var hasOptions, - effectName = !options ? - method : - options === true || typeof options === "number" ? - defaultEffect : - options.effect || defaultEffect; - options = options || {}; - if ( typeof options === "number" ) { - options = { duration: options }; - } - hasOptions = !$.isEmptyObject( options ); - options.complete = callback; - if ( options.delay ) { - element.delay( options.delay ); - } - if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) { - element[ method ]( options ); - } else if ( effectName !== method && element[ effectName ] ) { - element[ effectName ]( options.duration, options.easing, callback ); - } else { - element.queue(function( next ) { - $( this )[ method ](); - if ( callback ) { - callback.call( element[ 0 ] ); - } - next(); - }); - } - }; -}); - -return $.widget; - -})); diff --git a/ui/menu.js b/ui/menu.js new file mode 100644 index 000000000..612802511 --- /dev/null +++ b/ui/menu.js @@ -0,0 +1,640 @@ +/*! + * jQuery UI Menu @VERSION + * http://jqueryui.com + * + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/menu/ + */ +(function( factory ) { + if ( typeof define === "function" && define.amd ) { + + // AMD. Register as an anonymous module. + define([ + "jquery", + "./core", + "./widget", + "./position" + ], factory ); + } else { + + // Browser globals + factory( jQuery ); + } +}(function( $ ) { + +return $.widget( "ui.menu", { + version: "@VERSION", + defaultElement: "