jquery-ui-rails 4.2.1 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (291) hide show
  1. checksums.yaml +7 -0
  2. data/.travis.yml +1 -1
  3. data/History.md +45 -2
  4. data/README.md +100 -83
  5. data/Rakefile +82 -49
  6. data/VERSIONS.md +10 -0
  7. data/app/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  8. data/app/assets/images/jquery-ui/ui-icons_444444_256x240.png +0 -0
  9. data/app/assets/images/jquery-ui/ui-icons_555555_256x240.png +0 -0
  10. data/app/assets/images/jquery-ui/ui-icons_777620_256x240.png +0 -0
  11. data/app/assets/images/jquery-ui/ui-icons_777777_256x240.png +0 -0
  12. data/app/assets/images/jquery-ui/ui-icons_cc0000_256x240.png +0 -0
  13. data/app/assets/images/jquery-ui/ui-icons_ffffff_256x240.png +0 -0
  14. data/app/assets/javascripts/jquery-ui/data.js +39 -0
  15. data/app/assets/javascripts/jquery-ui/disable-selection.js +51 -0
  16. data/app/assets/javascripts/jquery-ui/effect.all.js +15 -0
  17. data/app/assets/javascripts/jquery-ui/effect.js +954 -0
  18. data/app/assets/javascripts/jquery-ui/effects/effect-blind.js +76 -0
  19. data/app/assets/javascripts/jquery-ui/effects/effect-bounce.js +116 -0
  20. data/app/assets/javascripts/jquery-ui/effects/effect-clip.js +71 -0
  21. data/app/assets/javascripts/jquery-ui/effects/effect-drop.js +75 -0
  22. data/app/assets/javascripts/jquery-ui/effects/effect-explode.js +117 -0
  23. data/app/assets/javascripts/jquery-ui/effects/effect-fade.js +53 -0
  24. data/app/assets/javascripts/jquery-ui/effects/effect-fold.js +95 -0
  25. data/app/assets/javascripts/jquery-ui/effects/effect-highlight.js +63 -0
  26. data/app/assets/javascripts/jquery-ui/effects/effect-puff.js +49 -0
  27. data/app/assets/javascripts/jquery-ui/effects/effect-pulsate.js +70 -0
  28. data/app/assets/javascripts/jquery-ui/effects/effect-scale.js +63 -0
  29. data/app/assets/javascripts/jquery-ui/effects/effect-shake.js +80 -0
  30. data/app/assets/javascripts/jquery-ui/effects/effect-size.js +199 -0
  31. data/app/assets/javascripts/jquery-ui/effects/effect-slide.js +82 -0
  32. data/app/assets/javascripts/jquery-ui/effects/effect-transfer.js +46 -0
  33. data/app/assets/javascripts/jquery-ui/focusable.js +79 -0
  34. data/app/assets/javascripts/jquery-ui/form-reset-mixin.js +81 -0
  35. data/app/assets/javascripts/jquery-ui/i18n/datepicker-af.js +40 -0
  36. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ar-DZ.js +42 -0
  37. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ar.js +42 -0
  38. data/app/assets/javascripts/jquery-ui/i18n/datepicker-az.js +40 -0
  39. data/app/assets/javascripts/jquery-ui/i18n/datepicker-be.js +40 -0
  40. data/app/assets/javascripts/jquery-ui/i18n/datepicker-bg.js +41 -0
  41. data/app/assets/javascripts/jquery-ui/i18n/datepicker-bs.js +40 -0
  42. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ca.js +40 -0
  43. data/app/assets/javascripts/jquery-ui/i18n/datepicker-cs.js +40 -0
  44. data/app/assets/javascripts/jquery-ui/i18n/datepicker-cy-GB.js +48 -0
  45. data/app/assets/javascripts/jquery-ui/i18n/datepicker-da.js +40 -0
  46. data/app/assets/javascripts/jquery-ui/i18n/datepicker-de-AT.js +41 -0
  47. data/app/assets/javascripts/jquery-ui/i18n/datepicker-de.js +40 -0
  48. data/app/assets/javascripts/jquery-ui/i18n/datepicker-el.js +40 -0
  49. data/app/assets/javascripts/jquery-ui/i18n/datepicker-en-AU.js +40 -0
  50. data/app/assets/javascripts/jquery-ui/i18n/datepicker-en-GB.js +40 -0
  51. data/app/assets/javascripts/jquery-ui/i18n/datepicker-en-NZ.js +40 -0
  52. data/app/assets/javascripts/jquery-ui/i18n/datepicker-eo.js +40 -0
  53. data/app/assets/javascripts/jquery-ui/i18n/datepicker-es.js +40 -0
  54. data/app/assets/javascripts/jquery-ui/i18n/datepicker-et.js +48 -0
  55. data/app/assets/javascripts/jquery-ui/i18n/datepicker-eu.js +39 -0
  56. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fa.js +76 -0
  57. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fi.js +40 -0
  58. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fo.js +48 -0
  59. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fr-CA.js +40 -0
  60. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fr-CH.js +40 -0
  61. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fr.js +42 -0
  62. data/app/assets/javascripts/jquery-ui/i18n/datepicker-gl.js +40 -0
  63. data/app/assets/javascripts/jquery-ui/i18n/datepicker-he.js +40 -0
  64. data/app/assets/javascripts/jquery-ui/i18n/datepicker-hi.js +40 -0
  65. data/app/assets/javascripts/jquery-ui/i18n/datepicker-hr.js +40 -0
  66. data/app/assets/javascripts/jquery-ui/i18n/datepicker-hu.js +39 -0
  67. data/app/assets/javascripts/jquery-ui/i18n/datepicker-hy.js +40 -0
  68. data/app/assets/javascripts/jquery-ui/i18n/datepicker-id.js +41 -0
  69. data/app/assets/javascripts/jquery-ui/i18n/datepicker-is.js +48 -0
  70. data/app/assets/javascripts/jquery-ui/i18n/datepicker-it-CH.js +40 -0
  71. data/app/assets/javascripts/jquery-ui/i18n/datepicker-it.js +40 -0
  72. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ja.js +40 -0
  73. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ka.js +51 -0
  74. data/app/assets/javascripts/jquery-ui/i18n/datepicker-kk.js +40 -0
  75. data/app/assets/javascripts/jquery-ui/i18n/datepicker-km.js +40 -0
  76. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ko.js +40 -0
  77. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ky.js +41 -0
  78. data/app/assets/javascripts/jquery-ui/i18n/datepicker-lb.js +48 -0
  79. data/app/assets/javascripts/jquery-ui/i18n/datepicker-lt.js +48 -0
  80. data/app/assets/javascripts/jquery-ui/i18n/datepicker-lv.js +48 -0
  81. data/app/assets/javascripts/jquery-ui/i18n/datepicker-mk.js +40 -0
  82. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ml.js +40 -0
  83. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ms.js +40 -0
  84. data/app/assets/javascripts/jquery-ui/i18n/datepicker-nb.js +52 -0
  85. data/app/assets/javascripts/jquery-ui/i18n/datepicker-nl-BE.js +40 -0
  86. data/app/assets/javascripts/jquery-ui/i18n/datepicker-nl.js +40 -0
  87. data/app/assets/javascripts/jquery-ui/i18n/datepicker-nn.js +52 -0
  88. data/app/assets/javascripts/jquery-ui/i18n/datepicker-no.js +53 -0
  89. data/app/assets/javascripts/jquery-ui/i18n/datepicker-pl.js +40 -0
  90. data/app/assets/javascripts/jquery-ui/i18n/datepicker-pt-BR.js +48 -0
  91. data/app/assets/javascripts/jquery-ui/i18n/datepicker-pt.js +47 -0
  92. data/app/assets/javascripts/jquery-ui/i18n/datepicker-rm.js +64 -0
  93. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ro.js +43 -0
  94. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ru.js +40 -0
  95. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sk.js +40 -0
  96. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sl.js +41 -0
  97. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sq.js +40 -0
  98. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sr-SR.js +40 -0
  99. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sr.js +40 -0
  100. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sv.js +40 -0
  101. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ta.js +56 -0
  102. data/app/assets/javascripts/jquery-ui/i18n/datepicker-th.js +40 -0
  103. data/app/assets/javascripts/jquery-ui/i18n/datepicker-tj.js +40 -0
  104. data/app/assets/javascripts/jquery-ui/i18n/datepicker-tr.js +40 -0
  105. data/app/assets/javascripts/jquery-ui/i18n/datepicker-uk.js +41 -0
  106. data/app/assets/javascripts/jquery-ui/i18n/datepicker-vi.js +40 -0
  107. data/app/assets/javascripts/jquery-ui/i18n/datepicker-zh-CN.js +40 -0
  108. data/app/assets/javascripts/jquery-ui/i18n/datepicker-zh-HK.js +40 -0
  109. data/app/assets/javascripts/jquery-ui/i18n/datepicker-zh-TW.js +40 -0
  110. data/app/assets/javascripts/jquery-ui/jquery-patch.js +58 -0
  111. data/app/assets/javascripts/jquery-ui/jquery-var-for-color.js +24 -0
  112. data/app/assets/javascripts/jquery-ui/keycode.js +51 -0
  113. data/app/assets/javascripts/jquery-ui/labels.js +70 -0
  114. data/app/assets/javascripts/jquery-ui/plugin.js +49 -0
  115. data/app/assets/javascripts/{jquery.ui.position.js → jquery-ui/position.js} +123 -111
  116. data/app/assets/javascripts/jquery-ui/scroll-parent.js +50 -0
  117. data/app/assets/javascripts/jquery-ui/tabbable.js +41 -0
  118. data/app/assets/javascripts/jquery-ui/unique-id.js +54 -0
  119. data/app/assets/javascripts/jquery-ui/vendor/jquery-color/jquery.color.js +691 -0
  120. data/app/assets/javascripts/jquery-ui/version.js +20 -0
  121. data/app/assets/javascripts/jquery-ui/widget.js +761 -0
  122. data/app/assets/javascripts/{jquery.ui.accordion.js → jquery-ui/widgets/accordion.js} +263 -209
  123. data/app/assets/javascripts/{jquery.ui.autocomplete.js → jquery-ui/widgets/autocomplete.js} +177 -142
  124. data/app/assets/javascripts/jquery-ui/widgets/button.js +454 -0
  125. data/app/assets/javascripts/jquery-ui/widgets/checkboxradio.js +294 -0
  126. data/app/assets/javascripts/jquery-ui/widgets/controlgroup.js +304 -0
  127. data/app/assets/javascripts/jquery-ui/widgets/datepicker.js +2240 -0
  128. data/app/assets/javascripts/jquery-ui/widgets/dialog.js +957 -0
  129. data/app/assets/javascripts/jquery-ui/widgets/draggable.js +1264 -0
  130. data/app/assets/javascripts/jquery-ui/widgets/droppable.js +508 -0
  131. data/app/assets/javascripts/{jquery.ui.menu.js → jquery-ui/widgets/menu.js} +276 -189
  132. data/app/assets/javascripts/jquery-ui/widgets/mouse.js +226 -0
  133. data/app/assets/javascripts/jquery-ui/widgets/progressbar.js +184 -0
  134. data/app/assets/javascripts/jquery-ui/widgets/resizable.js +1281 -0
  135. data/app/assets/javascripts/jquery-ui/widgets/selectable.js +321 -0
  136. data/app/assets/javascripts/jquery-ui/widgets/selectmenu.js +675 -0
  137. data/app/assets/javascripts/{jquery.ui.slider.js → jquery-ui/widgets/slider.js} +256 -176
  138. data/app/assets/javascripts/jquery-ui/widgets/sortable.js +1614 -0
  139. data/app/assets/javascripts/{jquery.ui.spinner.js → jquery-ui/widgets/spinner.js} +200 -137
  140. data/app/assets/javascripts/{jquery.ui.tabs.js → jquery-ui/widgets/tabs.js} +322 -277
  141. data/app/assets/javascripts/jquery-ui/widgets/tooltip.js +528 -0
  142. data/app/assets/javascripts/jquery-ui.js +52 -0
  143. data/app/assets/stylesheets/jquery-ui/accordion.css +26 -0
  144. data/app/assets/stylesheets/jquery-ui/all.css +14 -0
  145. data/app/assets/stylesheets/jquery-ui/autocomplete.css +19 -0
  146. data/app/assets/stylesheets/jquery-ui/base.css +32 -0
  147. data/app/assets/stylesheets/jquery-ui/button.css +80 -0
  148. data/app/assets/stylesheets/jquery-ui/checkboxradio.css +37 -0
  149. data/app/assets/stylesheets/jquery-ui/controlgroup.css +65 -0
  150. data/app/assets/stylesheets/{jquery.ui.core.css.erb → jquery-ui/core.css} +15 -12
  151. data/app/assets/stylesheets/{jquery.ui.datepicker.css.erb → jquery-ui/datepicker.css} +17 -8
  152. data/app/assets/stylesheets/{jquery.ui.dialog.css.erb → jquery-ui/dialog.css} +43 -15
  153. data/app/assets/stylesheets/jquery-ui/draggable.css +14 -0
  154. data/app/assets/stylesheets/jquery-ui/menu.css +65 -0
  155. data/app/assets/stylesheets/jquery-ui/progressbar.css +30 -0
  156. data/app/assets/stylesheets/{jquery.ui.resizable.css.erb → jquery-ui/resizable.css} +6 -6
  157. data/app/assets/stylesheets/jquery-ui/selectable.css +19 -0
  158. data/app/assets/stylesheets/jquery-ui/selectmenu.css +53 -0
  159. data/app/assets/stylesheets/{jquery.ui.slider.css.erb → jquery-ui/slider.css} +8 -14
  160. data/app/assets/stylesheets/jquery-ui/sortable.css +14 -0
  161. data/app/assets/stylesheets/{jquery.ui.spinner.css.erb → jquery-ui/spinner.css} +12 -27
  162. data/app/assets/stylesheets/{jquery.ui.tabs.css.erb → jquery-ui/tabs.css} +6 -7
  163. data/app/assets/stylesheets/{jquery.ui.theme.css.erb → jquery-ui/theme.css.erb} +121 -102
  164. data/app/assets/stylesheets/jquery-ui/tooltip.css +22 -0
  165. data/app/assets/stylesheets/jquery-ui.css +1 -0
  166. data/lib/jquery/ui/rails/version.rb +2 -2
  167. metadata +178 -169
  168. data/app/assets/images/jquery-ui/animated-overlay.gif +0 -0
  169. data/app/assets/images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png +0 -0
  170. data/app/assets/images/jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  171. data/app/assets/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png +0 -0
  172. data/app/assets/images/jquery-ui/ui-bg_glass_75_dadada_1x400.png +0 -0
  173. data/app/assets/images/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  174. data/app/assets/images/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  175. data/app/assets/images/jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  176. data/app/assets/images/jquery-ui/ui-icons_222222_256x240.png +0 -0
  177. data/app/assets/images/jquery-ui/ui-icons_2e83ff_256x240.png +0 -0
  178. data/app/assets/images/jquery-ui/ui-icons_454545_256x240.png +0 -0
  179. data/app/assets/images/jquery-ui/ui-icons_888888_256x240.png +0 -0
  180. data/app/assets/images/jquery-ui/ui-icons_cd0a0a_256x240.png +0 -0
  181. data/app/assets/javascripts/jquery.ui.all.js +0 -34
  182. data/app/assets/javascripts/jquery.ui.button.js +0 -398
  183. data/app/assets/javascripts/jquery.ui.core.js +0 -320
  184. data/app/assets/javascripts/jquery.ui.datepicker-af.js +0 -23
  185. data/app/assets/javascripts/jquery.ui.datepicker-ar-DZ.js +0 -23
  186. data/app/assets/javascripts/jquery.ui.datepicker-ar.js +0 -23
  187. data/app/assets/javascripts/jquery.ui.datepicker-az.js +0 -23
  188. data/app/assets/javascripts/jquery.ui.datepicker-be.js +0 -23
  189. data/app/assets/javascripts/jquery.ui.datepicker-bg.js +0 -24
  190. data/app/assets/javascripts/jquery.ui.datepicker-bs.js +0 -23
  191. data/app/assets/javascripts/jquery.ui.datepicker-ca.js +0 -23
  192. data/app/assets/javascripts/jquery.ui.datepicker-cs.js +0 -23
  193. data/app/assets/javascripts/jquery.ui.datepicker-cy-GB.js +0 -23
  194. data/app/assets/javascripts/jquery.ui.datepicker-da.js +0 -23
  195. data/app/assets/javascripts/jquery.ui.datepicker-de.js +0 -23
  196. data/app/assets/javascripts/jquery.ui.datepicker-el.js +0 -23
  197. data/app/assets/javascripts/jquery.ui.datepicker-en-AU.js +0 -23
  198. data/app/assets/javascripts/jquery.ui.datepicker-en-GB.js +0 -23
  199. data/app/assets/javascripts/jquery.ui.datepicker-en-NZ.js +0 -23
  200. data/app/assets/javascripts/jquery.ui.datepicker-eo.js +0 -23
  201. data/app/assets/javascripts/jquery.ui.datepicker-es.js +0 -23
  202. data/app/assets/javascripts/jquery.ui.datepicker-et.js +0 -23
  203. data/app/assets/javascripts/jquery.ui.datepicker-eu.js +0 -23
  204. data/app/assets/javascripts/jquery.ui.datepicker-fa.js +0 -59
  205. data/app/assets/javascripts/jquery.ui.datepicker-fi.js +0 -23
  206. data/app/assets/javascripts/jquery.ui.datepicker-fo.js +0 -23
  207. data/app/assets/javascripts/jquery.ui.datepicker-fr-CA.js +0 -23
  208. data/app/assets/javascripts/jquery.ui.datepicker-fr-CH.js +0 -23
  209. data/app/assets/javascripts/jquery.ui.datepicker-fr.js +0 -25
  210. data/app/assets/javascripts/jquery.ui.datepicker-gl.js +0 -23
  211. data/app/assets/javascripts/jquery.ui.datepicker-he.js +0 -23
  212. data/app/assets/javascripts/jquery.ui.datepicker-hi.js +0 -23
  213. data/app/assets/javascripts/jquery.ui.datepicker-hr.js +0 -23
  214. data/app/assets/javascripts/jquery.ui.datepicker-hu.js +0 -23
  215. data/app/assets/javascripts/jquery.ui.datepicker-hy.js +0 -23
  216. data/app/assets/javascripts/jquery.ui.datepicker-id.js +0 -23
  217. data/app/assets/javascripts/jquery.ui.datepicker-is.js +0 -23
  218. data/app/assets/javascripts/jquery.ui.datepicker-it.js +0 -23
  219. data/app/assets/javascripts/jquery.ui.datepicker-ja.js +0 -23
  220. data/app/assets/javascripts/jquery.ui.datepicker-ka.js +0 -21
  221. data/app/assets/javascripts/jquery.ui.datepicker-kk.js +0 -23
  222. data/app/assets/javascripts/jquery.ui.datepicker-km.js +0 -23
  223. data/app/assets/javascripts/jquery.ui.datepicker-ko.js +0 -23
  224. data/app/assets/javascripts/jquery.ui.datepicker-ky.js +0 -24
  225. data/app/assets/javascripts/jquery.ui.datepicker-lb.js +0 -23
  226. data/app/assets/javascripts/jquery.ui.datepicker-lt.js +0 -23
  227. data/app/assets/javascripts/jquery.ui.datepicker-lv.js +0 -23
  228. data/app/assets/javascripts/jquery.ui.datepicker-mk.js +0 -23
  229. data/app/assets/javascripts/jquery.ui.datepicker-ml.js +0 -23
  230. data/app/assets/javascripts/jquery.ui.datepicker-ms.js +0 -23
  231. data/app/assets/javascripts/jquery.ui.datepicker-nb.js +0 -22
  232. data/app/assets/javascripts/jquery.ui.datepicker-nl-BE.js +0 -23
  233. data/app/assets/javascripts/jquery.ui.datepicker-nl.js +0 -23
  234. data/app/assets/javascripts/jquery.ui.datepicker-nn.js +0 -22
  235. data/app/assets/javascripts/jquery.ui.datepicker-no.js +0 -23
  236. data/app/assets/javascripts/jquery.ui.datepicker-pl.js +0 -23
  237. data/app/assets/javascripts/jquery.ui.datepicker-pt-BR.js +0 -23
  238. data/app/assets/javascripts/jquery.ui.datepicker-pt.js +0 -22
  239. data/app/assets/javascripts/jquery.ui.datepicker-rm.js +0 -21
  240. data/app/assets/javascripts/jquery.ui.datepicker-ro.js +0 -26
  241. data/app/assets/javascripts/jquery.ui.datepicker-ru.js +0 -23
  242. data/app/assets/javascripts/jquery.ui.datepicker-sk.js +0 -23
  243. data/app/assets/javascripts/jquery.ui.datepicker-sl.js +0 -24
  244. data/app/assets/javascripts/jquery.ui.datepicker-sq.js +0 -23
  245. data/app/assets/javascripts/jquery.ui.datepicker-sr-SR.js +0 -23
  246. data/app/assets/javascripts/jquery.ui.datepicker-sr.js +0 -23
  247. data/app/assets/javascripts/jquery.ui.datepicker-sv.js +0 -23
  248. data/app/assets/javascripts/jquery.ui.datepicker-ta.js +0 -23
  249. data/app/assets/javascripts/jquery.ui.datepicker-th.js +0 -23
  250. data/app/assets/javascripts/jquery.ui.datepicker-tj.js +0 -23
  251. data/app/assets/javascripts/jquery.ui.datepicker-tr.js +0 -23
  252. data/app/assets/javascripts/jquery.ui.datepicker-uk.js +0 -24
  253. data/app/assets/javascripts/jquery.ui.datepicker-vi.js +0 -23
  254. data/app/assets/javascripts/jquery.ui.datepicker-zh-CN.js +0 -23
  255. data/app/assets/javascripts/jquery.ui.datepicker-zh-HK.js +0 -23
  256. data/app/assets/javascripts/jquery.ui.datepicker-zh-TW.js +0 -23
  257. data/app/assets/javascripts/jquery.ui.datepicker.js +0 -2040
  258. data/app/assets/javascripts/jquery.ui.dialog.js +0 -830
  259. data/app/assets/javascripts/jquery.ui.draggable.js +0 -962
  260. data/app/assets/javascripts/jquery.ui.droppable.js +0 -394
  261. data/app/assets/javascripts/jquery.ui.effect-blind.js +0 -84
  262. data/app/assets/javascripts/jquery.ui.effect-bounce.js +0 -115
  263. data/app/assets/javascripts/jquery.ui.effect-clip.js +0 -69
  264. data/app/assets/javascripts/jquery.ui.effect-drop.js +0 -67
  265. data/app/assets/javascripts/jquery.ui.effect-explode.js +0 -99
  266. data/app/assets/javascripts/jquery.ui.effect-fade.js +0 -32
  267. data/app/assets/javascripts/jquery.ui.effect-fold.js +0 -78
  268. data/app/assets/javascripts/jquery.ui.effect-highlight.js +0 -52
  269. data/app/assets/javascripts/jquery.ui.effect-pulsate.js +0 -65
  270. data/app/assets/javascripts/jquery.ui.effect-scale.js +0 -320
  271. data/app/assets/javascripts/jquery.ui.effect-shake.js +0 -76
  272. data/app/assets/javascripts/jquery.ui.effect-slide.js +0 -66
  273. data/app/assets/javascripts/jquery.ui.effect-transfer.js +0 -49
  274. data/app/assets/javascripts/jquery.ui.effect.all.js +0 -14
  275. data/app/assets/javascripts/jquery.ui.effect.js +0 -1289
  276. data/app/assets/javascripts/jquery.ui.mouse.js +0 -172
  277. data/app/assets/javascripts/jquery.ui.progressbar.js +0 -148
  278. data/app/assets/javascripts/jquery.ui.resizable.js +0 -982
  279. data/app/assets/javascripts/jquery.ui.selectable.js +0 -281
  280. data/app/assets/javascripts/jquery.ui.sortable.js +0 -1293
  281. data/app/assets/javascripts/jquery.ui.tooltip.js +0 -406
  282. data/app/assets/javascripts/jquery.ui.widget.js +0 -521
  283. data/app/assets/stylesheets/jquery.ui.accordion.css.erb +0 -42
  284. data/app/assets/stylesheets/jquery.ui.all.css.erb +0 -14
  285. data/app/assets/stylesheets/jquery.ui.autocomplete.css.erb +0 -21
  286. data/app/assets/stylesheets/jquery.ui.base.css.erb +0 -27
  287. data/app/assets/stylesheets/jquery.ui.button.css.erb +0 -118
  288. data/app/assets/stylesheets/jquery.ui.menu.css.erb +0 -83
  289. data/app/assets/stylesheets/jquery.ui.progressbar.css.erb +0 -37
  290. data/app/assets/stylesheets/jquery.ui.selectable.css.erb +0 -17
  291. data/app/assets/stylesheets/jquery.ui.tooltip.css.erb +0 -25
@@ -0,0 +1,1614 @@
1
+ //= require jquery-ui/widgets/mouse
2
+ //= require jquery-ui/data
3
+ //= require jquery-ui/scroll-parent
4
+ //= require jquery-ui/version
5
+ //= require jquery-ui/widget
6
+
7
+ /*!
8
+ * jQuery UI Sortable 1.14.1
9
+ * https://jqueryui.com
10
+ *
11
+ * Copyright OpenJS Foundation and other contributors
12
+ * Released under the MIT license.
13
+ * https://jquery.org/license
14
+ */
15
+
16
+ //>>label: Sortable
17
+ //>>group: Interactions
18
+ //>>description: Enables items in a list to be sorted using the mouse.
19
+ //>>docs: https://api.jqueryui.com/sortable/
20
+ //>>demos: https://jqueryui.com/sortable/
21
+ //>>css.structure: ../../themes/base/sortable.css
22
+
23
+ ( function( factory ) {
24
+ "use strict";
25
+
26
+ if ( typeof define === "function" && define.amd ) {
27
+
28
+ // AMD. Register as an anonymous module.
29
+ define( [
30
+ "jquery",
31
+ "./mouse",
32
+ "../data",
33
+ "../scroll-parent",
34
+ "../version",
35
+ "../widget"
36
+ ], factory );
37
+ } else {
38
+
39
+ // Browser globals
40
+ factory( jQuery );
41
+ }
42
+ } )( function( $ ) {
43
+ "use strict";
44
+
45
+ return $.widget( "ui.sortable", $.ui.mouse, {
46
+ version: "1.14.1",
47
+ widgetEventPrefix: "sort",
48
+ ready: false,
49
+ options: {
50
+ appendTo: "parent",
51
+ axis: false,
52
+ connectWith: false,
53
+ containment: false,
54
+ cursor: "auto",
55
+ cursorAt: false,
56
+ dropOnEmpty: true,
57
+ forcePlaceholderSize: false,
58
+ forceHelperSize: false,
59
+ grid: false,
60
+ handle: false,
61
+ helper: "original",
62
+ items: "> *",
63
+ opacity: false,
64
+ placeholder: false,
65
+ revert: false,
66
+ scroll: true,
67
+ scrollSensitivity: 20,
68
+ scrollSpeed: 20,
69
+ scope: "default",
70
+ tolerance: "intersect",
71
+ zIndex: 1000,
72
+
73
+ // Callbacks
74
+ activate: null,
75
+ beforeStop: null,
76
+ change: null,
77
+ deactivate: null,
78
+ out: null,
79
+ over: null,
80
+ receive: null,
81
+ remove: null,
82
+ sort: null,
83
+ start: null,
84
+ stop: null,
85
+ update: null
86
+ },
87
+
88
+ _isOverAxis: function( x, reference, size ) {
89
+ return ( x >= reference ) && ( x < ( reference + size ) );
90
+ },
91
+
92
+ _isFloating: function( item ) {
93
+ return ( /left|right/ ).test( item.css( "float" ) ) ||
94
+ ( /inline|table-cell/ ).test( item.css( "display" ) );
95
+ },
96
+
97
+ _create: function() {
98
+ this.containerCache = {};
99
+ this._addClass( "ui-sortable" );
100
+
101
+ //Get the items
102
+ this.refresh();
103
+
104
+ //Let's determine the parent's offset
105
+ this.offset = this.element.offset();
106
+
107
+ //Initialize mouse events for interaction
108
+ this._mouseInit();
109
+
110
+ this._setHandleClassName();
111
+
112
+ //We're ready to go
113
+ this.ready = true;
114
+
115
+ },
116
+
117
+ _setOption: function( key, value ) {
118
+ this._super( key, value );
119
+
120
+ if ( key === "handle" ) {
121
+ this._setHandleClassName();
122
+ }
123
+ },
124
+
125
+ _setHandleClassName: function() {
126
+ var that = this;
127
+ this._removeClass( this.element.find( ".ui-sortable-handle" ), "ui-sortable-handle" );
128
+ $.each( this.items, function() {
129
+ that._addClass(
130
+ this.instance.options.handle ?
131
+ this.item.find( this.instance.options.handle ) :
132
+ this.item,
133
+ "ui-sortable-handle"
134
+ );
135
+ } );
136
+ },
137
+
138
+ _destroy: function() {
139
+ this._mouseDestroy();
140
+
141
+ for ( var i = this.items.length - 1; i >= 0; i-- ) {
142
+ this.items[ i ].item.removeData( this.widgetName + "-item" );
143
+ }
144
+
145
+ return this;
146
+ },
147
+
148
+ _mouseCapture: function( event, overrideHandle ) {
149
+ var currentItem = null,
150
+ validHandle = false,
151
+ that = this;
152
+
153
+ if ( this.reverting ) {
154
+ return false;
155
+ }
156
+
157
+ if ( this.options.disabled || this.options.type === "static" ) {
158
+ return false;
159
+ }
160
+
161
+ //We have to refresh the items data once first
162
+ this._refreshItems( event );
163
+
164
+ //Find out if the clicked node (or one of its parents) is a actual item in this.items
165
+ $( event.target ).parents().each( function() {
166
+ if ( $.data( this, that.widgetName + "-item" ) === that ) {
167
+ currentItem = $( this );
168
+ return false;
169
+ }
170
+ } );
171
+ if ( $.data( event.target, that.widgetName + "-item" ) === that ) {
172
+ currentItem = $( event.target );
173
+ }
174
+
175
+ if ( !currentItem ) {
176
+ return false;
177
+ }
178
+ if ( this.options.handle && !overrideHandle ) {
179
+ $( this.options.handle, currentItem ).find( "*" ).addBack().each( function() {
180
+ if ( this === event.target ) {
181
+ validHandle = true;
182
+ }
183
+ } );
184
+ if ( !validHandle ) {
185
+ return false;
186
+ }
187
+ }
188
+
189
+ this.currentItem = currentItem;
190
+ this._removeCurrentsFromItems();
191
+ return true;
192
+
193
+ },
194
+
195
+ _mouseStart: function( event, overrideHandle, noActivation ) {
196
+
197
+ var i, body,
198
+ o = this.options;
199
+
200
+ this.currentContainer = this;
201
+
202
+ //We only need to call refreshPositions, because the refreshItems call has been moved to
203
+ // mouseCapture
204
+ this.refreshPositions();
205
+
206
+ //Prepare the dragged items parent
207
+ this.appendTo = $( o.appendTo !== "parent" ?
208
+ o.appendTo :
209
+ this.currentItem.parent() );
210
+
211
+ //Create and append the visible helper
212
+ this.helper = this._createHelper( event );
213
+
214
+ //Cache the helper size
215
+ this._cacheHelperProportions();
216
+
217
+ /*
218
+ * - Position generation -
219
+ * This block generates everything position related - it's the core of draggables.
220
+ */
221
+
222
+ //Cache the margins of the original element
223
+ this._cacheMargins();
224
+
225
+ //The element's absolute position on the page minus margins
226
+ this.offset = this.currentItem.offset();
227
+ this.offset = {
228
+ top: this.offset.top - this.margins.top,
229
+ left: this.offset.left - this.margins.left
230
+ };
231
+
232
+ $.extend( this.offset, {
233
+ click: { //Where the click happened, relative to the element
234
+ left: event.pageX - this.offset.left,
235
+ top: event.pageY - this.offset.top
236
+ },
237
+
238
+ // This is a relative to absolute position minus the actual position calculation -
239
+ // only used for relative positioned helper
240
+ relative: this._getRelativeOffset()
241
+ } );
242
+
243
+ // After we get the helper offset, but before we get the parent offset we can
244
+ // change the helper's position to absolute
245
+ // TODO: Still need to figure out a way to make relative sorting possible
246
+ this.helper.css( "position", "absolute" );
247
+ this.cssPosition = this.helper.css( "position" );
248
+
249
+ //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
250
+ if ( o.cursorAt ) {
251
+ this._adjustOffsetFromHelper( o.cursorAt );
252
+ }
253
+
254
+ //Cache the former DOM position
255
+ this.domPosition = {
256
+ prev: this.currentItem.prev()[ 0 ],
257
+ parent: this.currentItem.parent()[ 0 ]
258
+ };
259
+
260
+ // If the helper is not the original, hide the original so it's not playing any role during
261
+ // the drag, won't cause anything bad this way
262
+ if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
263
+ this.currentItem.hide();
264
+ }
265
+
266
+ //Create the placeholder
267
+ this._createPlaceholder();
268
+
269
+ //Get the next scrolling parent
270
+ this.scrollParent = this.placeholder.scrollParent();
271
+
272
+ $.extend( this.offset, {
273
+ parent: this._getParentOffset()
274
+ } );
275
+
276
+ //Set a containment if given in the options
277
+ if ( o.containment ) {
278
+ this._setContainment();
279
+ }
280
+
281
+ if ( o.cursor && o.cursor !== "auto" ) { // cursor option
282
+ body = this.document.find( "body" );
283
+
284
+ this._storedStylesheet =
285
+ $( "<style>*{ cursor: " + o.cursor + " !important; }</style>" ).appendTo( body );
286
+ }
287
+
288
+ // We need to make sure to grab the zIndex before setting the
289
+ // opacity, because setting the opacity to anything lower than 1
290
+ // causes the zIndex to change from "auto" to 0.
291
+ if ( o.zIndex ) { // zIndex option
292
+ if ( this.helper.css( "zIndex" ) ) {
293
+ this._storedZIndex = this.helper.css( "zIndex" );
294
+ }
295
+ this.helper.css( "zIndex", o.zIndex );
296
+ }
297
+
298
+ if ( o.opacity ) { // opacity option
299
+ if ( this.helper.css( "opacity" ) ) {
300
+ this._storedOpacity = this.helper.css( "opacity" );
301
+ }
302
+ this.helper.css( "opacity", o.opacity );
303
+ }
304
+
305
+ //Prepare scrolling
306
+ if ( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
307
+ this.scrollParent[ 0 ].tagName !== "HTML" ) {
308
+ this.overflowOffset = this.scrollParent.offset();
309
+ }
310
+
311
+ //Call callbacks
312
+ this._trigger( "start", event, this._uiHash() );
313
+
314
+ //Recache the helper size
315
+ if ( !this._preserveHelperProportions ) {
316
+ this._cacheHelperProportions();
317
+ }
318
+
319
+ //Post "activate" events to possible containers
320
+ if ( !noActivation ) {
321
+ for ( i = this.containers.length - 1; i >= 0; i-- ) {
322
+ this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) );
323
+ }
324
+ }
325
+
326
+ //Prepare possible droppables
327
+ if ( $.ui.ddmanager ) {
328
+ $.ui.ddmanager.current = this;
329
+ }
330
+
331
+ if ( $.ui.ddmanager && !o.dropBehaviour ) {
332
+ $.ui.ddmanager.prepareOffsets( this, event );
333
+ }
334
+
335
+ this.dragging = true;
336
+
337
+ this._addClass( this.helper, "ui-sortable-helper" );
338
+
339
+ //Move the helper, if needed
340
+ if ( !this.helper.parent().is( this.appendTo ) ) {
341
+ this.helper.detach().appendTo( this.appendTo );
342
+
343
+ //Update position
344
+ this.offset.parent = this._getParentOffset();
345
+ }
346
+
347
+ //Generate the original position
348
+ this.position = this.originalPosition = this._generatePosition( event );
349
+ this.originalPageX = event.pageX;
350
+ this.originalPageY = event.pageY;
351
+ this.lastPositionAbs = this.positionAbs = this._convertPositionTo( "absolute" );
352
+
353
+ this._mouseDrag( event );
354
+
355
+ return true;
356
+
357
+ },
358
+
359
+ _scroll: function( event ) {
360
+ var o = this.options,
361
+ scrolled = false;
362
+
363
+ if ( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
364
+ this.scrollParent[ 0 ].tagName !== "HTML" ) {
365
+
366
+ if ( ( this.overflowOffset.top + this.scrollParent[ 0 ].offsetHeight ) -
367
+ event.pageY < o.scrollSensitivity ) {
368
+ this.scrollParent[ 0 ].scrollTop =
369
+ scrolled = this.scrollParent[ 0 ].scrollTop + o.scrollSpeed;
370
+ } else if ( event.pageY - this.overflowOffset.top < o.scrollSensitivity ) {
371
+ this.scrollParent[ 0 ].scrollTop =
372
+ scrolled = this.scrollParent[ 0 ].scrollTop - o.scrollSpeed;
373
+ }
374
+
375
+ if ( ( this.overflowOffset.left + this.scrollParent[ 0 ].offsetWidth ) -
376
+ event.pageX < o.scrollSensitivity ) {
377
+ this.scrollParent[ 0 ].scrollLeft = scrolled =
378
+ this.scrollParent[ 0 ].scrollLeft + o.scrollSpeed;
379
+ } else if ( event.pageX - this.overflowOffset.left < o.scrollSensitivity ) {
380
+ this.scrollParent[ 0 ].scrollLeft = scrolled =
381
+ this.scrollParent[ 0 ].scrollLeft - o.scrollSpeed;
382
+ }
383
+
384
+ } else {
385
+
386
+ if ( event.pageY - this.document.scrollTop() < o.scrollSensitivity ) {
387
+ scrolled = this.document.scrollTop( this.document.scrollTop() - o.scrollSpeed );
388
+ } else if ( this.window.height() - ( event.pageY - this.document.scrollTop() ) <
389
+ o.scrollSensitivity ) {
390
+ scrolled = this.document.scrollTop( this.document.scrollTop() + o.scrollSpeed );
391
+ }
392
+
393
+ if ( event.pageX - this.document.scrollLeft() < o.scrollSensitivity ) {
394
+ scrolled = this.document.scrollLeft(
395
+ this.document.scrollLeft() - o.scrollSpeed
396
+ );
397
+ } else if ( this.window.width() - ( event.pageX - this.document.scrollLeft() ) <
398
+ o.scrollSensitivity ) {
399
+ scrolled = this.document.scrollLeft(
400
+ this.document.scrollLeft() + o.scrollSpeed
401
+ );
402
+ }
403
+
404
+ }
405
+
406
+ return scrolled;
407
+ },
408
+
409
+ _mouseDrag: function( event ) {
410
+ var i, item, itemElement, intersection,
411
+ o = this.options;
412
+
413
+ //Compute the helpers position
414
+ this.position = this._generatePosition( event );
415
+ this.positionAbs = this._convertPositionTo( "absolute" );
416
+
417
+ //Set the helper position
418
+ if ( !this.options.axis || this.options.axis !== "y" ) {
419
+ this.helper[ 0 ].style.left = this.position.left + "px";
420
+ }
421
+ if ( !this.options.axis || this.options.axis !== "x" ) {
422
+ this.helper[ 0 ].style.top = this.position.top + "px";
423
+ }
424
+
425
+ //Do scrolling
426
+ if ( o.scroll ) {
427
+ if ( this._scroll( event ) !== false ) {
428
+
429
+ //Update item positions used in position checks
430
+ this._refreshItemPositions( true );
431
+
432
+ if ( $.ui.ddmanager && !o.dropBehaviour ) {
433
+ $.ui.ddmanager.prepareOffsets( this, event );
434
+ }
435
+ }
436
+ }
437
+
438
+ this.dragDirection = {
439
+ vertical: this._getDragVerticalDirection(),
440
+ horizontal: this._getDragHorizontalDirection()
441
+ };
442
+
443
+ //Rearrange
444
+ for ( i = this.items.length - 1; i >= 0; i-- ) {
445
+
446
+ //Cache variables and intersection, continue if no intersection
447
+ item = this.items[ i ];
448
+ itemElement = item.item[ 0 ];
449
+ intersection = this._intersectsWithPointer( item );
450
+ if ( !intersection ) {
451
+ continue;
452
+ }
453
+
454
+ // Only put the placeholder inside the current Container, skip all
455
+ // items from other containers. This works because when moving
456
+ // an item from one container to another the
457
+ // currentContainer is switched before the placeholder is moved.
458
+ //
459
+ // Without this, moving items in "sub-sortables" can cause
460
+ // the placeholder to jitter between the outer and inner container.
461
+ if ( item.instance !== this.currentContainer ) {
462
+ continue;
463
+ }
464
+
465
+ // Cannot intersect with itself
466
+ // no useless actions that have been done before
467
+ // no action if the item moved is the parent of the item checked
468
+ if ( itemElement !== this.currentItem[ 0 ] &&
469
+ this.placeholder[ intersection === 1 ?
470
+ "next" : "prev" ]()[ 0 ] !== itemElement &&
471
+ !$.contains( this.placeholder[ 0 ], itemElement ) &&
472
+ ( this.options.type === "semi-dynamic" ?
473
+ !$.contains( this.element[ 0 ], itemElement ) :
474
+ true
475
+ )
476
+ ) {
477
+
478
+ this.direction = intersection === 1 ? "down" : "up";
479
+
480
+ if ( this.options.tolerance === "pointer" ||
481
+ this._intersectsWithSides( item ) ) {
482
+ this._rearrange( event, item );
483
+ } else {
484
+ break;
485
+ }
486
+
487
+ this._trigger( "change", event, this._uiHash() );
488
+ break;
489
+ }
490
+ }
491
+
492
+ //Post events to containers
493
+ this._contactContainers( event );
494
+
495
+ //Interconnect with droppables
496
+ if ( $.ui.ddmanager ) {
497
+ $.ui.ddmanager.drag( this, event );
498
+ }
499
+
500
+ //Call callbacks
501
+ this._trigger( "sort", event, this._uiHash() );
502
+
503
+ this.lastPositionAbs = this.positionAbs;
504
+ return false;
505
+
506
+ },
507
+
508
+ _mouseStop: function( event, noPropagation ) {
509
+
510
+ if ( !event ) {
511
+ return;
512
+ }
513
+
514
+ //If we are using droppables, inform the manager about the drop
515
+ if ( $.ui.ddmanager && !this.options.dropBehaviour ) {
516
+ $.ui.ddmanager.drop( this, event );
517
+ }
518
+
519
+ if ( this.options.revert ) {
520
+ var that = this,
521
+ cur = this.placeholder.offset(),
522
+ axis = this.options.axis,
523
+ animation = {};
524
+
525
+ if ( !axis || axis === "x" ) {
526
+ animation.left = cur.left - this.offset.parent.left - this.margins.left +
527
+ ( this.offsetParent[ 0 ] === this.document[ 0 ].body ?
528
+ 0 :
529
+ this.offsetParent[ 0 ].scrollLeft
530
+ );
531
+ }
532
+ if ( !axis || axis === "y" ) {
533
+ animation.top = cur.top - this.offset.parent.top - this.margins.top +
534
+ ( this.offsetParent[ 0 ] === this.document[ 0 ].body ?
535
+ 0 :
536
+ this.offsetParent[ 0 ].scrollTop
537
+ );
538
+ }
539
+ this.reverting = true;
540
+ $( this.helper ).animate(
541
+ animation,
542
+ parseInt( this.options.revert, 10 ) || 500,
543
+ function() {
544
+ that._clear( event );
545
+ }
546
+ );
547
+ } else {
548
+ this._clear( event, noPropagation );
549
+ }
550
+
551
+ return false;
552
+
553
+ },
554
+
555
+ cancel: function() {
556
+
557
+ if ( this.dragging ) {
558
+
559
+ this._mouseUp( new $.Event( "mouseup", { target: null } ) );
560
+
561
+ if ( this.options.helper === "original" ) {
562
+ this.currentItem.css( this._storedCSS );
563
+ this._removeClass( this.currentItem, "ui-sortable-helper" );
564
+ } else {
565
+ this.currentItem.show();
566
+ }
567
+
568
+ //Post deactivating events to containers
569
+ for ( var i = this.containers.length - 1; i >= 0; i-- ) {
570
+ this.containers[ i ]._trigger( "deactivate", null, this._uiHash( this ) );
571
+ if ( this.containers[ i ].containerCache.over ) {
572
+ this.containers[ i ]._trigger( "out", null, this._uiHash( this ) );
573
+ this.containers[ i ].containerCache.over = 0;
574
+ }
575
+ }
576
+
577
+ }
578
+
579
+ if ( this.placeholder ) {
580
+
581
+ //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,
582
+ // it unbinds ALL events from the original node!
583
+ if ( this.placeholder[ 0 ].parentNode ) {
584
+ this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] );
585
+ }
586
+ if ( this.options.helper !== "original" && this.helper &&
587
+ this.helper[ 0 ].parentNode ) {
588
+ this.helper.remove();
589
+ }
590
+
591
+ $.extend( this, {
592
+ helper: null,
593
+ dragging: false,
594
+ reverting: false,
595
+ _noFinalSort: null
596
+ } );
597
+
598
+ if ( this.domPosition.prev ) {
599
+ $( this.domPosition.prev ).after( this.currentItem );
600
+ } else {
601
+ $( this.domPosition.parent ).prepend( this.currentItem );
602
+ }
603
+ }
604
+
605
+ return this;
606
+
607
+ },
608
+
609
+ serialize: function( o ) {
610
+
611
+ var items = this._getItemsAsjQuery( o && o.connected ),
612
+ str = [];
613
+ o = o || {};
614
+
615
+ $( items ).each( function() {
616
+ var res = ( $( o.item || this ).attr( o.attribute || "id" ) || "" )
617
+ .match( o.expression || ( /(.+)[\-=_](.+)/ ) );
618
+ if ( res ) {
619
+ str.push(
620
+ ( o.key || res[ 1 ] + "[]" ) +
621
+ "=" + ( o.key && o.expression ? res[ 1 ] : res[ 2 ] ) );
622
+ }
623
+ } );
624
+
625
+ if ( !str.length && o.key ) {
626
+ str.push( o.key + "=" );
627
+ }
628
+
629
+ return str.join( "&" );
630
+
631
+ },
632
+
633
+ toArray: function( o ) {
634
+
635
+ var items = this._getItemsAsjQuery( o && o.connected ),
636
+ ret = [];
637
+
638
+ o = o || {};
639
+
640
+ items.each( function() {
641
+ ret.push( $( o.item || this ).attr( o.attribute || "id" ) || "" );
642
+ } );
643
+ return ret;
644
+
645
+ },
646
+
647
+ /* Be careful with the following core functions */
648
+ _intersectsWith: function( item ) {
649
+
650
+ var x1 = this.positionAbs.left,
651
+ x2 = x1 + this.helperProportions.width,
652
+ y1 = this.positionAbs.top,
653
+ y2 = y1 + this.helperProportions.height,
654
+ l = item.left,
655
+ r = l + item.width,
656
+ t = item.top,
657
+ b = t + item.height,
658
+ dyClick = this.offset.click.top,
659
+ dxClick = this.offset.click.left,
660
+ isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t &&
661
+ ( y1 + dyClick ) < b ),
662
+ isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l &&
663
+ ( x1 + dxClick ) < r ),
664
+ isOverElement = isOverElementHeight && isOverElementWidth;
665
+
666
+ if ( this.options.tolerance === "pointer" ||
667
+ this.options.forcePointerForContainers ||
668
+ ( this.options.tolerance !== "pointer" &&
669
+ this.helperProportions[ this.floating ? "width" : "height" ] >
670
+ item[ this.floating ? "width" : "height" ] )
671
+ ) {
672
+ return isOverElement;
673
+ } else {
674
+
675
+ return ( l < x1 + ( this.helperProportions.width / 2 ) && // Right Half
676
+ x2 - ( this.helperProportions.width / 2 ) < r && // Left Half
677
+ t < y1 + ( this.helperProportions.height / 2 ) && // Bottom Half
678
+ y2 - ( this.helperProportions.height / 2 ) < b ); // Top Half
679
+
680
+ }
681
+ },
682
+
683
+ _intersectsWithPointer: function( item ) {
684
+ var verticalDirection, horizontalDirection,
685
+ isOverElementHeight = ( this.options.axis === "x" ) ||
686
+ this._isOverAxis(
687
+ this.positionAbs.top + this.offset.click.top, item.top, item.height ),
688
+ isOverElementWidth = ( this.options.axis === "y" ) ||
689
+ this._isOverAxis(
690
+ this.positionAbs.left + this.offset.click.left, item.left, item.width ),
691
+ isOverElement = isOverElementHeight && isOverElementWidth;
692
+
693
+ if ( !isOverElement ) {
694
+ return false;
695
+ }
696
+
697
+ verticalDirection = this.dragDirection.vertical;
698
+ horizontalDirection = this.dragDirection.horizontal;
699
+
700
+ return this.floating ?
701
+ ( ( horizontalDirection === "right" || verticalDirection === "down" ) ? 2 : 1 ) :
702
+ ( verticalDirection && ( verticalDirection === "down" ? 2 : 1 ) );
703
+
704
+ },
705
+
706
+ _intersectsWithSides: function( item ) {
707
+
708
+ var isOverBottomHalf = this._isOverAxis( this.positionAbs.top +
709
+ this.offset.click.top, item.top + ( item.height / 2 ), item.height ),
710
+ isOverRightHalf = this._isOverAxis( this.positionAbs.left +
711
+ this.offset.click.left, item.left + ( item.width / 2 ), item.width ),
712
+ verticalDirection = this.dragDirection.vertical,
713
+ horizontalDirection = this.dragDirection.horizontal;
714
+
715
+ if ( this.floating && horizontalDirection ) {
716
+ return ( ( horizontalDirection === "right" && isOverRightHalf ) ||
717
+ ( horizontalDirection === "left" && !isOverRightHalf ) );
718
+ } else {
719
+ return verticalDirection && ( ( verticalDirection === "down" && isOverBottomHalf ) ||
720
+ ( verticalDirection === "up" && !isOverBottomHalf ) );
721
+ }
722
+
723
+ },
724
+
725
+ _getDragVerticalDirection: function() {
726
+ var delta = this.positionAbs.top - this.lastPositionAbs.top;
727
+ return delta !== 0 && ( delta > 0 ? "down" : "up" );
728
+ },
729
+
730
+ _getDragHorizontalDirection: function() {
731
+ var delta = this.positionAbs.left - this.lastPositionAbs.left;
732
+ return delta !== 0 && ( delta > 0 ? "right" : "left" );
733
+ },
734
+
735
+ refresh: function( event ) {
736
+ this._refreshItems( event );
737
+ this._setHandleClassName();
738
+ this.refreshPositions();
739
+ return this;
740
+ },
741
+
742
+ _connectWith: function() {
743
+ var options = this.options;
744
+ return options.connectWith.constructor === String ?
745
+ [ options.connectWith ] :
746
+ options.connectWith;
747
+ },
748
+
749
+ _getItemsAsjQuery: function( connected ) {
750
+
751
+ var i, j, cur, inst,
752
+ items = [],
753
+ queries = [],
754
+ connectWith = this._connectWith();
755
+
756
+ if ( connectWith && connected ) {
757
+ for ( i = connectWith.length - 1; i >= 0; i-- ) {
758
+ cur = $( connectWith[ i ], this.document[ 0 ] );
759
+ for ( j = cur.length - 1; j >= 0; j-- ) {
760
+ inst = $.data( cur[ j ], this.widgetFullName );
761
+ if ( inst && inst !== this && !inst.options.disabled ) {
762
+ queries.push( [ typeof inst.options.items === "function" ?
763
+ inst.options.items.call( inst.element ) :
764
+ $( inst.options.items, inst.element )
765
+ .not( ".ui-sortable-helper" )
766
+ .not( ".ui-sortable-placeholder" ), inst ] );
767
+ }
768
+ }
769
+ }
770
+ }
771
+
772
+ queries.push( [ typeof this.options.items === "function" ?
773
+ this.options.items
774
+ .call( this.element, null, { options: this.options, item: this.currentItem } ) :
775
+ $( this.options.items, this.element )
776
+ .not( ".ui-sortable-helper" )
777
+ .not( ".ui-sortable-placeholder" ), this ] );
778
+
779
+ function addItems() {
780
+ items.push( this );
781
+ }
782
+ for ( i = queries.length - 1; i >= 0; i-- ) {
783
+ queries[ i ][ 0 ].each( addItems );
784
+ }
785
+
786
+ return $( items );
787
+
788
+ },
789
+
790
+ _removeCurrentsFromItems: function() {
791
+
792
+ var list = this.currentItem.find( ":data(" + this.widgetName + "-item)" );
793
+
794
+ this.items = $.grep( this.items, function( item ) {
795
+ for ( var j = 0; j < list.length; j++ ) {
796
+ if ( list[ j ] === item.item[ 0 ] ) {
797
+ return false;
798
+ }
799
+ }
800
+ return true;
801
+ } );
802
+
803
+ },
804
+
805
+ _refreshItems: function( event ) {
806
+
807
+ this.items = [];
808
+ this.containers = [ this ];
809
+
810
+ var i, j, cur, inst, targetData, _queries, item, queriesLength,
811
+ items = this.items,
812
+ queries = [ [ typeof this.options.items === "function" ?
813
+ this.options.items.call( this.element[ 0 ], event, { item: this.currentItem } ) :
814
+ $( this.options.items, this.element ), this ] ],
815
+ connectWith = this._connectWith();
816
+
817
+ //Shouldn't be run the first time through due to massive slow-down
818
+ if ( connectWith && this.ready ) {
819
+ for ( i = connectWith.length - 1; i >= 0; i-- ) {
820
+ cur = $( connectWith[ i ], this.document[ 0 ] );
821
+ for ( j = cur.length - 1; j >= 0; j-- ) {
822
+ inst = $.data( cur[ j ], this.widgetFullName );
823
+ if ( inst && inst !== this && !inst.options.disabled ) {
824
+ queries.push( [ typeof inst.options.items === "function" ?
825
+ inst.options.items
826
+ .call( inst.element[ 0 ], event, { item: this.currentItem } ) :
827
+ $( inst.options.items, inst.element ), inst ] );
828
+ this.containers.push( inst );
829
+ }
830
+ }
831
+ }
832
+ }
833
+
834
+ for ( i = queries.length - 1; i >= 0; i-- ) {
835
+ targetData = queries[ i ][ 1 ];
836
+ _queries = queries[ i ][ 0 ];
837
+
838
+ for ( j = 0, queriesLength = _queries.length; j < queriesLength; j++ ) {
839
+ item = $( _queries[ j ] );
840
+
841
+ // Data for target checking (mouse manager)
842
+ item.data( this.widgetName + "-item", targetData );
843
+
844
+ items.push( {
845
+ item: item,
846
+ instance: targetData,
847
+ width: 0, height: 0,
848
+ left: 0, top: 0
849
+ } );
850
+ }
851
+ }
852
+
853
+ },
854
+
855
+ _refreshItemPositions: function( fast ) {
856
+ var i, item, t, p;
857
+
858
+ for ( i = this.items.length - 1; i >= 0; i-- ) {
859
+ item = this.items[ i ];
860
+
861
+ //We ignore calculating positions of all connected containers when we're not over them
862
+ if ( this.currentContainer && item.instance !== this.currentContainer &&
863
+ item.item[ 0 ] !== this.currentItem[ 0 ] ) {
864
+ continue;
865
+ }
866
+
867
+ t = this.options.toleranceElement ?
868
+ $( this.options.toleranceElement, item.item ) :
869
+ item.item;
870
+
871
+ if ( !fast ) {
872
+ item.width = t.outerWidth();
873
+ item.height = t.outerHeight();
874
+ }
875
+
876
+ p = t.offset();
877
+ item.left = p.left;
878
+ item.top = p.top;
879
+ }
880
+ },
881
+
882
+ refreshPositions: function( fast ) {
883
+
884
+ // Determine whether items are being displayed horizontally
885
+ this.floating = this.items.length ?
886
+ this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) :
887
+ false;
888
+
889
+ // This has to be redone because due to the item being moved out/into the offsetParent,
890
+ // the offsetParent's position will change
891
+ if ( this.offsetParent && this.helper ) {
892
+ this.offset.parent = this._getParentOffset();
893
+ }
894
+
895
+ this._refreshItemPositions( fast );
896
+
897
+ var i, p;
898
+
899
+ if ( this.options.custom && this.options.custom.refreshContainers ) {
900
+ this.options.custom.refreshContainers.call( this );
901
+ } else {
902
+ for ( i = this.containers.length - 1; i >= 0; i-- ) {
903
+ p = this.containers[ i ].element.offset();
904
+ this.containers[ i ].containerCache.left = p.left;
905
+ this.containers[ i ].containerCache.top = p.top;
906
+ this.containers[ i ].containerCache.width =
907
+ this.containers[ i ].element.outerWidth();
908
+ this.containers[ i ].containerCache.height =
909
+ this.containers[ i ].element.outerHeight();
910
+ }
911
+ }
912
+
913
+ return this;
914
+ },
915
+
916
+ _createPlaceholder: function( that ) {
917
+ that = that || this;
918
+ var className, nodeName,
919
+ o = that.options;
920
+
921
+ if ( !o.placeholder || o.placeholder.constructor === String ) {
922
+ className = o.placeholder;
923
+ nodeName = that.currentItem[ 0 ].nodeName.toLowerCase();
924
+ o.placeholder = {
925
+ element: function() {
926
+
927
+ var element = $( "<" + nodeName + ">", that.document[ 0 ] );
928
+
929
+ that._addClass( element, "ui-sortable-placeholder",
930
+ className || that.currentItem[ 0 ].className )
931
+ ._removeClass( element, "ui-sortable-helper" );
932
+
933
+ if ( nodeName === "tbody" ) {
934
+ that._createTrPlaceholder(
935
+ that.currentItem.find( "tr" ).eq( 0 ),
936
+ $( "<tr>", that.document[ 0 ] ).appendTo( element )
937
+ );
938
+ } else if ( nodeName === "tr" ) {
939
+ that._createTrPlaceholder( that.currentItem, element );
940
+ } else if ( nodeName === "img" ) {
941
+ element.attr( "src", that.currentItem.attr( "src" ) );
942
+ }
943
+
944
+ if ( !className ) {
945
+ element.css( "visibility", "hidden" );
946
+ }
947
+
948
+ return element;
949
+ },
950
+ update: function( container, p ) {
951
+
952
+ // 1. If a className is set as 'placeholder option, we don't force sizes -
953
+ // the class is responsible for that
954
+ // 2. The option 'forcePlaceholderSize can be enabled to force it even if a
955
+ // class name is specified
956
+ if ( className && !o.forcePlaceholderSize ) {
957
+ return;
958
+ }
959
+
960
+ // If the element doesn't have a actual height or width by itself (without
961
+ // styles coming from a stylesheet), it receives the inline height and width
962
+ // from the dragged item. Or, if it's a tbody or tr, it's going to have a height
963
+ // anyway since we're populating them with <td>s above, but they're unlikely to
964
+ // be the correct height on their own if the row heights are dynamic, so we'll
965
+ // always assign the height of the dragged item given forcePlaceholderSize
966
+ // is true.
967
+ if ( !p.height() || ( o.forcePlaceholderSize &&
968
+ ( nodeName === "tbody" || nodeName === "tr" ) ) ) {
969
+ p.height(
970
+ that.currentItem.innerHeight() -
971
+ parseInt( that.currentItem.css( "paddingTop" ) || 0, 10 ) -
972
+ parseInt( that.currentItem.css( "paddingBottom" ) || 0, 10 ) );
973
+ }
974
+ if ( !p.width() ) {
975
+ p.width(
976
+ that.currentItem.innerWidth() -
977
+ parseInt( that.currentItem.css( "paddingLeft" ) || 0, 10 ) -
978
+ parseInt( that.currentItem.css( "paddingRight" ) || 0, 10 ) );
979
+ }
980
+ }
981
+ };
982
+ }
983
+
984
+ //Create the placeholder
985
+ that.placeholder = $( o.placeholder.element.call( that.element, that.currentItem ) );
986
+
987
+ //Append it after the actual current item
988
+ that.currentItem.after( that.placeholder );
989
+
990
+ //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
991
+ o.placeholder.update( that, that.placeholder );
992
+
993
+ },
994
+
995
+ _createTrPlaceholder: function( sourceTr, targetTr ) {
996
+ var that = this;
997
+
998
+ sourceTr.children().each( function() {
999
+ $( "<td>&#160;</td>", that.document[ 0 ] )
1000
+ .attr( "colspan", $( this ).attr( "colspan" ) || 1 )
1001
+ .appendTo( targetTr );
1002
+ } );
1003
+ },
1004
+
1005
+ _contactContainers: function( event ) {
1006
+ var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom,
1007
+ floating, axis,
1008
+ innermostContainer = null,
1009
+ innermostIndex = null;
1010
+
1011
+ // Get innermost container that intersects with item
1012
+ for ( i = this.containers.length - 1; i >= 0; i-- ) {
1013
+
1014
+ // Never consider a container that's located within the item itself
1015
+ if ( $.contains( this.currentItem[ 0 ], this.containers[ i ].element[ 0 ] ) ) {
1016
+ continue;
1017
+ }
1018
+
1019
+ if ( this._intersectsWith( this.containers[ i ].containerCache ) ) {
1020
+
1021
+ // If we've already found a container and it's more "inner" than this, then continue
1022
+ if ( innermostContainer &&
1023
+ $.contains(
1024
+ this.containers[ i ].element[ 0 ],
1025
+ innermostContainer.element[ 0 ] ) ) {
1026
+ continue;
1027
+ }
1028
+
1029
+ innermostContainer = this.containers[ i ];
1030
+ innermostIndex = i;
1031
+
1032
+ } else {
1033
+
1034
+ // container doesn't intersect. trigger "out" event if necessary
1035
+ if ( this.containers[ i ].containerCache.over ) {
1036
+ this.containers[ i ]._trigger( "out", event, this._uiHash( this ) );
1037
+ this.containers[ i ].containerCache.over = 0;
1038
+ }
1039
+ }
1040
+
1041
+ }
1042
+
1043
+ // If no intersecting containers found, return
1044
+ if ( !innermostContainer ) {
1045
+ return;
1046
+ }
1047
+
1048
+ // Move the item into the container if it's not there already
1049
+ if ( this.containers.length === 1 ) {
1050
+ if ( !this.containers[ innermostIndex ].containerCache.over ) {
1051
+ this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) );
1052
+ this.containers[ innermostIndex ].containerCache.over = 1;
1053
+ }
1054
+ } else {
1055
+
1056
+ // When entering a new container, we will find the item with the least distance and
1057
+ // append our item near it
1058
+ dist = 10000;
1059
+ itemWithLeastDistance = null;
1060
+ floating = innermostContainer.floating || this._isFloating( this.currentItem );
1061
+ posProperty = floating ? "left" : "top";
1062
+ sizeProperty = floating ? "width" : "height";
1063
+ axis = floating ? "pageX" : "pageY";
1064
+
1065
+ for ( j = this.items.length - 1; j >= 0; j-- ) {
1066
+ if ( !$.contains(
1067
+ this.containers[ innermostIndex ].element[ 0 ], this.items[ j ].item[ 0 ] )
1068
+ ) {
1069
+ continue;
1070
+ }
1071
+ if ( this.items[ j ].item[ 0 ] === this.currentItem[ 0 ] ) {
1072
+ continue;
1073
+ }
1074
+
1075
+ cur = this.items[ j ].item.offset()[ posProperty ];
1076
+ nearBottom = false;
1077
+ if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) {
1078
+ nearBottom = true;
1079
+ }
1080
+
1081
+ if ( Math.abs( event[ axis ] - cur ) < dist ) {
1082
+ dist = Math.abs( event[ axis ] - cur );
1083
+ itemWithLeastDistance = this.items[ j ];
1084
+ this.direction = nearBottom ? "up" : "down";
1085
+ }
1086
+ }
1087
+
1088
+ //Check if dropOnEmpty is enabled
1089
+ if ( !itemWithLeastDistance && !this.options.dropOnEmpty ) {
1090
+ return;
1091
+ }
1092
+
1093
+ if ( this.currentContainer === this.containers[ innermostIndex ] ) {
1094
+ if ( !this.currentContainer.containerCache.over ) {
1095
+ this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() );
1096
+ this.currentContainer.containerCache.over = 1;
1097
+ }
1098
+ return;
1099
+ }
1100
+
1101
+ if ( itemWithLeastDistance ) {
1102
+ this._rearrange( event, itemWithLeastDistance, null, true );
1103
+ } else {
1104
+ this._rearrange( event, null, this.containers[ innermostIndex ].element, true );
1105
+ }
1106
+ this._trigger( "change", event, this._uiHash() );
1107
+ this.containers[ innermostIndex ]._trigger( "change", event, this._uiHash( this ) );
1108
+ this.currentContainer = this.containers[ innermostIndex ];
1109
+
1110
+ //Update the placeholder
1111
+ this.options.placeholder.update( this.currentContainer, this.placeholder );
1112
+
1113
+ //Update scrollParent
1114
+ this.scrollParent = this.placeholder.scrollParent();
1115
+
1116
+ //Update overflowOffset
1117
+ if ( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
1118
+ this.scrollParent[ 0 ].tagName !== "HTML" ) {
1119
+ this.overflowOffset = this.scrollParent.offset();
1120
+ }
1121
+
1122
+ this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) );
1123
+ this.containers[ innermostIndex ].containerCache.over = 1;
1124
+ }
1125
+
1126
+ },
1127
+
1128
+ _createHelper: function( event ) {
1129
+
1130
+ var o = this.options,
1131
+ helper = typeof o.helper === "function" ?
1132
+ $( o.helper.apply( this.element[ 0 ], [ event, this.currentItem ] ) ) :
1133
+ ( o.helper === "clone" ? this.currentItem.clone() : this.currentItem );
1134
+
1135
+ //Add the helper to the DOM if that didn't happen already
1136
+ if ( !helper.parents( "body" ).length ) {
1137
+ this.appendTo[ 0 ].appendChild( helper[ 0 ] );
1138
+ }
1139
+
1140
+ if ( helper[ 0 ] === this.currentItem[ 0 ] ) {
1141
+ this._storedCSS = {
1142
+ width: this.currentItem[ 0 ].style.width,
1143
+ height: this.currentItem[ 0 ].style.height,
1144
+ position: this.currentItem.css( "position" ),
1145
+ top: this.currentItem.css( "top" ),
1146
+ left: this.currentItem.css( "left" )
1147
+ };
1148
+ }
1149
+
1150
+ if ( !helper[ 0 ].style.width || o.forceHelperSize ) {
1151
+ helper.width( this.currentItem.width() );
1152
+ }
1153
+ if ( !helper[ 0 ].style.height || o.forceHelperSize ) {
1154
+ helper.height( this.currentItem.height() );
1155
+ }
1156
+
1157
+ return helper;
1158
+
1159
+ },
1160
+
1161
+ _adjustOffsetFromHelper: function( obj ) {
1162
+ if ( typeof obj === "string" ) {
1163
+ obj = obj.split( " " );
1164
+ }
1165
+ if ( Array.isArray( obj ) ) {
1166
+ obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 };
1167
+ }
1168
+ if ( "left" in obj ) {
1169
+ this.offset.click.left = obj.left + this.margins.left;
1170
+ }
1171
+ if ( "right" in obj ) {
1172
+ this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
1173
+ }
1174
+ if ( "top" in obj ) {
1175
+ this.offset.click.top = obj.top + this.margins.top;
1176
+ }
1177
+ if ( "bottom" in obj ) {
1178
+ this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
1179
+ }
1180
+ },
1181
+
1182
+ _getParentOffset: function() {
1183
+
1184
+ //Get the offsetParent and cache its position
1185
+ this.offsetParent = this.helper.offsetParent();
1186
+ var po = this.offsetParent.offset();
1187
+
1188
+ // This is a special case where we need to modify a offset calculated on start, since the
1189
+ // following happened:
1190
+ // 1. The position of the helper is absolute, so it's position is calculated based on the
1191
+ // next positioned parent
1192
+ // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't
1193
+ // the document, which means that the scroll is included in the initial calculation of the
1194
+ // offset of the parent, and never recalculated upon drag
1195
+ if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== this.document[ 0 ] &&
1196
+ $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) {
1197
+ po.left += this.scrollParent.scrollLeft();
1198
+ po.top += this.scrollParent.scrollTop();
1199
+ }
1200
+
1201
+ // This needs to be actually done for all browsers, since pageX/pageY includes
1202
+ // this information.
1203
+ if ( this.offsetParent[ 0 ] === this.document[ 0 ].body ) {
1204
+ po = { top: 0, left: 0 };
1205
+ }
1206
+
1207
+ return {
1208
+ top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ),
1209
+ left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 )
1210
+ };
1211
+
1212
+ },
1213
+
1214
+ _getRelativeOffset: function() {
1215
+
1216
+ if ( this.cssPosition === "relative" ) {
1217
+ var p = this.currentItem.position();
1218
+ return {
1219
+ top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) +
1220
+ this.scrollParent.scrollTop(),
1221
+ left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) +
1222
+ this.scrollParent.scrollLeft()
1223
+ };
1224
+ } else {
1225
+ return { top: 0, left: 0 };
1226
+ }
1227
+
1228
+ },
1229
+
1230
+ _cacheMargins: function() {
1231
+ this.margins = {
1232
+ left: ( parseInt( this.currentItem.css( "marginLeft" ), 10 ) || 0 ),
1233
+ top: ( parseInt( this.currentItem.css( "marginTop" ), 10 ) || 0 )
1234
+ };
1235
+ },
1236
+
1237
+ _cacheHelperProportions: function() {
1238
+ this.helperProportions = {
1239
+ width: this.helper.outerWidth(),
1240
+ height: this.helper.outerHeight()
1241
+ };
1242
+ },
1243
+
1244
+ _setContainment: function() {
1245
+
1246
+ var ce, co, over,
1247
+ o = this.options;
1248
+ if ( o.containment === "parent" ) {
1249
+ o.containment = this.helper[ 0 ].parentNode;
1250
+ }
1251
+ if ( o.containment === "document" || o.containment === "window" ) {
1252
+ this.containment = [
1253
+ 0 - this.offset.relative.left - this.offset.parent.left,
1254
+ 0 - this.offset.relative.top - this.offset.parent.top,
1255
+ o.containment === "document" ?
1256
+ this.document.width() :
1257
+ this.window.width() - this.helperProportions.width - this.margins.left,
1258
+ ( o.containment === "document" ?
1259
+ ( this.document.height() || document.body.parentNode.scrollHeight ) :
1260
+ this.window.height() || this.document[ 0 ].body.parentNode.scrollHeight
1261
+ ) - this.helperProportions.height - this.margins.top
1262
+ ];
1263
+ }
1264
+
1265
+ if ( !( /^(document|window|parent)$/ ).test( o.containment ) ) {
1266
+ ce = $( o.containment )[ 0 ];
1267
+ co = $( o.containment ).offset();
1268
+ over = ( $( ce ).css( "overflow" ) !== "hidden" );
1269
+
1270
+ this.containment = [
1271
+ co.left + ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) +
1272
+ ( parseInt( $( ce ).css( "paddingLeft" ), 10 ) || 0 ) - this.margins.left,
1273
+ co.top + ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) +
1274
+ ( parseInt( $( ce ).css( "paddingTop" ), 10 ) || 0 ) - this.margins.top,
1275
+ co.left + ( over ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
1276
+ ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) -
1277
+ ( parseInt( $( ce ).css( "paddingRight" ), 10 ) || 0 ) -
1278
+ this.helperProportions.width - this.margins.left,
1279
+ co.top + ( over ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
1280
+ ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) -
1281
+ ( parseInt( $( ce ).css( "paddingBottom" ), 10 ) || 0 ) -
1282
+ this.helperProportions.height - this.margins.top
1283
+ ];
1284
+ }
1285
+
1286
+ },
1287
+
1288
+ _convertPositionTo: function( d, pos ) {
1289
+
1290
+ if ( !pos ) {
1291
+ pos = this.position;
1292
+ }
1293
+ var mod = d === "absolute" ? 1 : -1,
1294
+ scroll = this.cssPosition === "absolute" &&
1295
+ !( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
1296
+ $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ?
1297
+ this.offsetParent :
1298
+ this.scrollParent,
1299
+ scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName );
1300
+
1301
+ return {
1302
+ top: (
1303
+
1304
+ // The absolute mouse position
1305
+ pos.top +
1306
+
1307
+ // Only for relative positioned nodes: Relative offset from element to offset parent
1308
+ this.offset.relative.top * mod +
1309
+
1310
+ // The offsetParent's offset without borders (offset + border)
1311
+ this.offset.parent.top * mod -
1312
+ ( ( this.cssPosition === "fixed" ?
1313
+ -this.scrollParent.scrollTop() :
1314
+ ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod )
1315
+ ),
1316
+ left: (
1317
+
1318
+ // The absolute mouse position
1319
+ pos.left +
1320
+
1321
+ // Only for relative positioned nodes: Relative offset from element to offset parent
1322
+ this.offset.relative.left * mod +
1323
+
1324
+ // The offsetParent's offset without borders (offset + border)
1325
+ this.offset.parent.left * mod -
1326
+ ( ( this.cssPosition === "fixed" ?
1327
+ -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 :
1328
+ scroll.scrollLeft() ) * mod )
1329
+ )
1330
+ };
1331
+
1332
+ },
1333
+
1334
+ _generatePosition: function( event ) {
1335
+
1336
+ var top, left,
1337
+ o = this.options,
1338
+ pageX = event.pageX,
1339
+ pageY = event.pageY,
1340
+ scroll = this.cssPosition === "absolute" &&
1341
+ !( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
1342
+ $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ?
1343
+ this.offsetParent :
1344
+ this.scrollParent,
1345
+ scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName );
1346
+
1347
+ // This is another very weird special case that only happens for relative elements:
1348
+ // 1. If the css position is relative
1349
+ // 2. and the scroll parent is the document or similar to the offset parent
1350
+ // we have to refresh the relative offset during the scroll so there are no jumps
1351
+ if ( this.cssPosition === "relative" && !( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
1352
+ this.scrollParent[ 0 ] !== this.offsetParent[ 0 ] ) ) {
1353
+ this.offset.relative = this._getRelativeOffset();
1354
+ }
1355
+
1356
+ /*
1357
+ * - Position constraining -
1358
+ * Constrain the position to a mix of grid, containment.
1359
+ */
1360
+
1361
+ if ( this.originalPosition ) { //If we are not dragging yet, we won't check for options
1362
+
1363
+ if ( this.containment ) {
1364
+ if ( event.pageX - this.offset.click.left < this.containment[ 0 ] ) {
1365
+ pageX = this.containment[ 0 ] + this.offset.click.left;
1366
+ }
1367
+ if ( event.pageY - this.offset.click.top < this.containment[ 1 ] ) {
1368
+ pageY = this.containment[ 1 ] + this.offset.click.top;
1369
+ }
1370
+ if ( event.pageX - this.offset.click.left > this.containment[ 2 ] ) {
1371
+ pageX = this.containment[ 2 ] + this.offset.click.left;
1372
+ }
1373
+ if ( event.pageY - this.offset.click.top > this.containment[ 3 ] ) {
1374
+ pageY = this.containment[ 3 ] + this.offset.click.top;
1375
+ }
1376
+ }
1377
+
1378
+ if ( o.grid ) {
1379
+ top = this.originalPageY + Math.round( ( pageY - this.originalPageY ) /
1380
+ o.grid[ 1 ] ) * o.grid[ 1 ];
1381
+ pageY = this.containment ?
1382
+ ( ( top - this.offset.click.top >= this.containment[ 1 ] &&
1383
+ top - this.offset.click.top <= this.containment[ 3 ] ) ?
1384
+ top :
1385
+ ( ( top - this.offset.click.top >= this.containment[ 1 ] ) ?
1386
+ top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) :
1387
+ top;
1388
+
1389
+ left = this.originalPageX + Math.round( ( pageX - this.originalPageX ) /
1390
+ o.grid[ 0 ] ) * o.grid[ 0 ];
1391
+ pageX = this.containment ?
1392
+ ( ( left - this.offset.click.left >= this.containment[ 0 ] &&
1393
+ left - this.offset.click.left <= this.containment[ 2 ] ) ?
1394
+ left :
1395
+ ( ( left - this.offset.click.left >= this.containment[ 0 ] ) ?
1396
+ left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) :
1397
+ left;
1398
+ }
1399
+
1400
+ }
1401
+
1402
+ return {
1403
+ top: (
1404
+
1405
+ // The absolute mouse position
1406
+ pageY -
1407
+
1408
+ // Click offset (relative to the element)
1409
+ this.offset.click.top -
1410
+
1411
+ // Only for relative positioned nodes: Relative offset from element to offset parent
1412
+ this.offset.relative.top -
1413
+
1414
+ // The offsetParent's offset without borders (offset + border)
1415
+ this.offset.parent.top +
1416
+ ( ( this.cssPosition === "fixed" ?
1417
+ -this.scrollParent.scrollTop() :
1418
+ ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) )
1419
+ ),
1420
+ left: (
1421
+
1422
+ // The absolute mouse position
1423
+ pageX -
1424
+
1425
+ // Click offset (relative to the element)
1426
+ this.offset.click.left -
1427
+
1428
+ // Only for relative positioned nodes: Relative offset from element to offset parent
1429
+ this.offset.relative.left -
1430
+
1431
+ // The offsetParent's offset without borders (offset + border)
1432
+ this.offset.parent.left +
1433
+ ( ( this.cssPosition === "fixed" ?
1434
+ -this.scrollParent.scrollLeft() :
1435
+ scrollIsRootNode ? 0 : scroll.scrollLeft() ) )
1436
+ )
1437
+ };
1438
+
1439
+ },
1440
+
1441
+ _rearrange: function( event, i, a, hardRefresh ) {
1442
+
1443
+ if ( a ) {
1444
+ a[ 0 ].appendChild( this.placeholder[ 0 ] );
1445
+ } else {
1446
+ i.item[ 0 ].parentNode.insertBefore( this.placeholder[ 0 ],
1447
+ ( this.direction === "down" ? i.item[ 0 ] : i.item[ 0 ].nextSibling ) );
1448
+ }
1449
+
1450
+ //Various things done here to improve the performance:
1451
+ // 1. we create a setTimeout, that calls refreshPositions
1452
+ // 2. on the instance, we have a counter variable, that get's higher after every append
1453
+ // 3. on the local scope, we copy the counter variable, and check in the timeout,
1454
+ // if it's still the same
1455
+ // 4. this lets only the last addition to the timeout stack through
1456
+ this.counter = this.counter ? ++this.counter : 1;
1457
+ var counter = this.counter;
1458
+
1459
+ this._delay( function() {
1460
+ if ( counter === this.counter ) {
1461
+
1462
+ //Precompute after each DOM insertion, NOT on mousemove
1463
+ this.refreshPositions( !hardRefresh );
1464
+ }
1465
+ } );
1466
+
1467
+ },
1468
+
1469
+ _clear: function( event, noPropagation ) {
1470
+
1471
+ this.reverting = false;
1472
+
1473
+ // We delay all events that have to be triggered to after the point where the placeholder
1474
+ // has been removed and everything else normalized again
1475
+ var i,
1476
+ delayedTriggers = [];
1477
+
1478
+ // We first have to update the dom position of the actual currentItem
1479
+ // Note: don't do it if the current item is already removed (by a user), or it gets
1480
+ // reappended (see #4088)
1481
+ if ( !this._noFinalSort && this.currentItem.parent().length ) {
1482
+ this.placeholder.before( this.currentItem );
1483
+ }
1484
+ this._noFinalSort = null;
1485
+
1486
+ if ( this.helper[ 0 ] === this.currentItem[ 0 ] ) {
1487
+ for ( i in this._storedCSS ) {
1488
+ if ( this._storedCSS[ i ] === "auto" || this._storedCSS[ i ] === "static" ) {
1489
+ this._storedCSS[ i ] = "";
1490
+ }
1491
+ }
1492
+ this.currentItem.css( this._storedCSS );
1493
+ this._removeClass( this.currentItem, "ui-sortable-helper" );
1494
+ } else {
1495
+ this.currentItem.show();
1496
+ }
1497
+
1498
+ if ( this.fromOutside && !noPropagation ) {
1499
+ delayedTriggers.push( function( event ) {
1500
+ this._trigger( "receive", event, this._uiHash( this.fromOutside ) );
1501
+ } );
1502
+ }
1503
+ if ( ( this.fromOutside ||
1504
+ this.domPosition.prev !==
1505
+ this.currentItem.prev().not( ".ui-sortable-helper" )[ 0 ] ||
1506
+ this.domPosition.parent !== this.currentItem.parent()[ 0 ] ) && !noPropagation ) {
1507
+
1508
+ // Trigger update callback if the DOM position has changed
1509
+ delayedTriggers.push( function( event ) {
1510
+ this._trigger( "update", event, this._uiHash() );
1511
+ } );
1512
+ }
1513
+
1514
+ // Check if the items Container has Changed and trigger appropriate
1515
+ // events.
1516
+ if ( this !== this.currentContainer ) {
1517
+ if ( !noPropagation ) {
1518
+ delayedTriggers.push( function( event ) {
1519
+ this._trigger( "remove", event, this._uiHash() );
1520
+ } );
1521
+ delayedTriggers.push( ( function( c ) {
1522
+ return function( event ) {
1523
+ c._trigger( "receive", event, this._uiHash( this ) );
1524
+ };
1525
+ } ).call( this, this.currentContainer ) );
1526
+ delayedTriggers.push( ( function( c ) {
1527
+ return function( event ) {
1528
+ c._trigger( "update", event, this._uiHash( this ) );
1529
+ };
1530
+ } ).call( this, this.currentContainer ) );
1531
+ }
1532
+ }
1533
+
1534
+ //Post events to containers
1535
+ function delayEvent( type, instance, container ) {
1536
+ return function( event ) {
1537
+ container._trigger( type, event, instance._uiHash( instance ) );
1538
+ };
1539
+ }
1540
+ for ( i = this.containers.length - 1; i >= 0; i-- ) {
1541
+ if ( !noPropagation ) {
1542
+ delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) );
1543
+ }
1544
+ if ( this.containers[ i ].containerCache.over ) {
1545
+ delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) );
1546
+ this.containers[ i ].containerCache.over = 0;
1547
+ }
1548
+ }
1549
+
1550
+ //Do what was originally in plugins
1551
+ if ( this._storedStylesheet ) {
1552
+ this._storedStylesheet.remove();
1553
+ this._storedStylesheet = null;
1554
+ }
1555
+ if ( this._storedOpacity ) {
1556
+ this.helper.css( "opacity", this._storedOpacity );
1557
+ }
1558
+ if ( this._storedZIndex ) {
1559
+ this.helper.css( "zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex );
1560
+ }
1561
+
1562
+ this.dragging = false;
1563
+
1564
+ if ( !noPropagation ) {
1565
+ this._trigger( "beforeStop", event, this._uiHash() );
1566
+ }
1567
+
1568
+ //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,
1569
+ // it unbinds ALL events from the original node!
1570
+ this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] );
1571
+
1572
+ if ( !this.cancelHelperRemoval ) {
1573
+ if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
1574
+ this.helper.remove();
1575
+ }
1576
+ this.helper = null;
1577
+ }
1578
+
1579
+ if ( !noPropagation ) {
1580
+ for ( i = 0; i < delayedTriggers.length; i++ ) {
1581
+
1582
+ // Trigger all delayed events
1583
+ delayedTriggers[ i ].call( this, event );
1584
+ }
1585
+ this._trigger( "stop", event, this._uiHash() );
1586
+ }
1587
+
1588
+ this.fromOutside = false;
1589
+ return !this.cancelHelperRemoval;
1590
+
1591
+ },
1592
+
1593
+ _trigger: function() {
1594
+ if ( $.Widget.prototype._trigger.apply( this, arguments ) === false ) {
1595
+ this.cancel();
1596
+ }
1597
+ },
1598
+
1599
+ _uiHash: function( _inst ) {
1600
+ var inst = _inst || this;
1601
+ return {
1602
+ helper: inst.helper,
1603
+ placeholder: inst.placeholder || $( [] ),
1604
+ position: inst.position,
1605
+ originalPosition: inst.originalPosition,
1606
+ offset: inst.positionAbs,
1607
+ item: inst.currentItem,
1608
+ sender: _inst ? _inst.element : null
1609
+ };
1610
+ }
1611
+
1612
+ } );
1613
+
1614
+ } );