jquery-ui-rails 5.0.5 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of jquery-ui-rails might be problematic. Click here for more details.

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