jquery-ui-rails 4.2.1 → 5.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 (217) hide show
  1. data/History.md +6 -0
  2. data/README.md +69 -73
  3. data/Rakefile +28 -24
  4. data/VERSIONS.md +1 -0
  5. data/app/assets/javascripts/jquery-ui.js +37 -0
  6. data/app/assets/javascripts/{jquery.ui.accordion.js → jquery-ui/accordion.js} +62 -57
  7. data/app/assets/javascripts/{jquery.ui.autocomplete.js → jquery-ui/autocomplete.js} +70 -50
  8. data/app/assets/javascripts/{jquery.ui.button.js → jquery-ui/button.js} +41 -25
  9. data/app/assets/javascripts/{jquery.ui.core.js → jquery-ui/core.js} +106 -123
  10. data/app/assets/javascripts/jquery-ui/datepicker-af.js +37 -0
  11. data/app/assets/javascripts/jquery-ui/datepicker-ar-DZ.js +37 -0
  12. data/app/assets/javascripts/jquery-ui/datepicker-ar.js +37 -0
  13. data/app/assets/javascripts/jquery-ui/datepicker-az.js +37 -0
  14. data/app/assets/javascripts/jquery-ui/datepicker-be.js +37 -0
  15. data/app/assets/javascripts/jquery-ui/datepicker-bg.js +38 -0
  16. data/app/assets/javascripts/jquery-ui/datepicker-bs.js +37 -0
  17. data/app/assets/javascripts/jquery-ui/datepicker-ca.js +37 -0
  18. data/app/assets/javascripts/jquery-ui/datepicker-cs.js +37 -0
  19. data/app/assets/javascripts/jquery-ui/datepicker-cy-GB.js +37 -0
  20. data/app/assets/javascripts/jquery-ui/datepicker-da.js +37 -0
  21. data/app/assets/javascripts/jquery-ui/datepicker-de.js +37 -0
  22. data/app/assets/javascripts/jquery-ui/datepicker-el.js +37 -0
  23. data/app/assets/javascripts/jquery-ui/datepicker-en-AU.js +37 -0
  24. data/app/assets/javascripts/jquery-ui/datepicker-en-GB.js +37 -0
  25. data/app/assets/javascripts/jquery-ui/datepicker-en-NZ.js +37 -0
  26. data/app/assets/javascripts/jquery-ui/datepicker-eo.js +37 -0
  27. data/app/assets/javascripts/jquery-ui/datepicker-es.js +37 -0
  28. data/app/assets/javascripts/jquery-ui/datepicker-et.js +37 -0
  29. data/app/assets/javascripts/jquery-ui/datepicker-eu.js +36 -0
  30. data/app/assets/javascripts/jquery-ui/datepicker-fa.js +73 -0
  31. data/app/assets/javascripts/jquery-ui/datepicker-fi.js +37 -0
  32. data/app/assets/javascripts/jquery-ui/datepicker-fo.js +37 -0
  33. data/app/assets/javascripts/jquery-ui/datepicker-fr-CA.js +37 -0
  34. data/app/assets/javascripts/jquery-ui/datepicker-fr-CH.js +37 -0
  35. data/app/assets/javascripts/jquery-ui/datepicker-fr.js +39 -0
  36. data/app/assets/javascripts/jquery-ui/datepicker-gl.js +37 -0
  37. data/app/assets/javascripts/jquery-ui/datepicker-he.js +37 -0
  38. data/app/assets/javascripts/jquery-ui/datepicker-hi.js +37 -0
  39. data/app/assets/javascripts/jquery-ui/datepicker-hr.js +37 -0
  40. data/app/assets/javascripts/jquery-ui/datepicker-hu.js +36 -0
  41. data/app/assets/javascripts/jquery-ui/datepicker-hy.js +37 -0
  42. data/app/assets/javascripts/jquery-ui/datepicker-id.js +37 -0
  43. data/app/assets/javascripts/jquery-ui/datepicker-is.js +37 -0
  44. data/app/assets/javascripts/jquery-ui/datepicker-it-CH.js +37 -0
  45. data/app/assets/javascripts/jquery-ui/datepicker-it.js +37 -0
  46. data/app/assets/javascripts/jquery-ui/datepicker-ja.js +37 -0
  47. data/app/assets/javascripts/jquery-ui/datepicker-ka.js +35 -0
  48. data/app/assets/javascripts/jquery-ui/datepicker-kk.js +37 -0
  49. data/app/assets/javascripts/jquery-ui/datepicker-km.js +37 -0
  50. data/app/assets/javascripts/jquery-ui/datepicker-ko.js +37 -0
  51. data/app/assets/javascripts/jquery-ui/datepicker-ky.js +38 -0
  52. data/app/assets/javascripts/jquery-ui/datepicker-lb.js +37 -0
  53. data/app/assets/javascripts/jquery-ui/datepicker-lt.js +37 -0
  54. data/app/assets/javascripts/jquery-ui/datepicker-lv.js +37 -0
  55. data/app/assets/javascripts/jquery-ui/datepicker-mk.js +37 -0
  56. data/app/assets/javascripts/jquery-ui/datepicker-ml.js +37 -0
  57. data/app/assets/javascripts/jquery-ui/datepicker-ms.js +37 -0
  58. data/app/assets/javascripts/jquery-ui/datepicker-nb.js +36 -0
  59. data/app/assets/javascripts/jquery-ui/datepicker-nl-BE.js +37 -0
  60. data/app/assets/javascripts/jquery-ui/datepicker-nl.js +37 -0
  61. data/app/assets/javascripts/jquery-ui/datepicker-nn.js +36 -0
  62. data/app/assets/javascripts/jquery-ui/datepicker-no.js +37 -0
  63. data/app/assets/javascripts/jquery-ui/datepicker-pl.js +37 -0
  64. data/app/assets/javascripts/jquery-ui/datepicker-pt-BR.js +37 -0
  65. data/app/assets/javascripts/jquery-ui/datepicker-pt.js +36 -0
  66. data/app/assets/javascripts/jquery-ui/datepicker-rm.js +35 -0
  67. data/app/assets/javascripts/jquery-ui/datepicker-ro.js +40 -0
  68. data/app/assets/javascripts/jquery-ui/datepicker-ru.js +37 -0
  69. data/app/assets/javascripts/jquery-ui/datepicker-sk.js +37 -0
  70. data/app/assets/javascripts/jquery-ui/datepicker-sl.js +38 -0
  71. data/app/assets/javascripts/jquery-ui/datepicker-sq.js +37 -0
  72. data/app/assets/javascripts/jquery-ui/datepicker-sr-SR.js +37 -0
  73. data/app/assets/javascripts/jquery-ui/datepicker-sr.js +37 -0
  74. data/app/assets/javascripts/jquery-ui/datepicker-sv.js +37 -0
  75. data/app/assets/javascripts/jquery-ui/datepicker-ta.js +37 -0
  76. data/app/assets/javascripts/jquery-ui/datepicker-th.js +37 -0
  77. data/app/assets/javascripts/jquery-ui/datepicker-tj.js +37 -0
  78. data/app/assets/javascripts/jquery-ui/datepicker-tr.js +37 -0
  79. data/app/assets/javascripts/jquery-ui/datepicker-uk.js +38 -0
  80. data/app/assets/javascripts/jquery-ui/datepicker-vi.js +37 -0
  81. data/app/assets/javascripts/jquery-ui/datepicker-zh-CN.js +37 -0
  82. data/app/assets/javascripts/jquery-ui/datepicker-zh-HK.js +37 -0
  83. data/app/assets/javascripts/jquery-ui/datepicker-zh-TW.js +37 -0
  84. data/app/assets/javascripts/{jquery.ui.datepicker.js → jquery-ui/datepicker.js} +72 -37
  85. data/app/assets/javascripts/{jquery.ui.dialog.js → jquery-ui/dialog.js} +215 -180
  86. data/app/assets/javascripts/{jquery.ui.draggable.js → jquery-ui/draggable.js} +219 -161
  87. data/app/assets/javascripts/jquery-ui/droppable.js +421 -0
  88. data/app/assets/javascripts/{jquery.ui.effect-blind.js → jquery-ui/effect-blind.js} +20 -12
  89. data/app/assets/javascripts/{jquery.ui.effect-bounce.js → jquery-ui/effect-bounce.js} +18 -8
  90. data/app/assets/javascripts/{jquery.ui.effect-clip.js → jquery-ui/effect-clip.js} +18 -8
  91. data/app/assets/javascripts/{jquery.ui.effect-drop.js → jquery-ui/effect-drop.js} +18 -8
  92. data/app/assets/javascripts/{jquery.ui.effect-explode.js → jquery-ui/effect-explode.js} +20 -10
  93. data/app/assets/javascripts/{jquery.ui.effect-fade.js → jquery-ui/effect-fade.js} +18 -8
  94. data/app/assets/javascripts/{jquery.ui.effect-fold.js → jquery-ui/effect-fold.js} +18 -8
  95. data/app/assets/javascripts/{jquery.ui.effect-highlight.js → jquery-ui/effect-highlight.js} +18 -8
  96. data/app/assets/javascripts/jquery-ui/effect-puff.js +63 -0
  97. data/app/assets/javascripts/{jquery.ui.effect-pulsate.js → jquery-ui/effect-pulsate.js} +18 -8
  98. data/app/assets/javascripts/jquery-ui/effect-scale.js +92 -0
  99. data/app/assets/javascripts/{jquery.ui.effect-shake.js → jquery-ui/effect-shake.js} +19 -9
  100. data/app/assets/javascripts/{jquery.ui.effect-scale.js → jquery-ui/effect-size.js} +19 -104
  101. data/app/assets/javascripts/{jquery.ui.effect-slide.js → jquery-ui/effect-slide.js} +18 -8
  102. data/app/assets/javascripts/{jquery.ui.effect-transfer.js → jquery-ui/effect-transfer.js} +22 -12
  103. data/app/assets/javascripts/jquery-ui/effect.all.js +16 -0
  104. data/app/assets/javascripts/{jquery.ui.effect.js → jquery-ui/effect.js} +28 -20
  105. data/app/assets/javascripts/{jquery.ui.menu.js → jquery-ui/menu.js} +93 -80
  106. data/app/assets/javascripts/{jquery.ui.mouse.js → jquery-ui/mouse.js} +41 -23
  107. data/app/assets/javascripts/{jquery.ui.position.js → jquery-ui/position.js} +25 -12
  108. data/app/assets/javascripts/{jquery.ui.progressbar.js → jquery-ui/progressbar.js} +26 -12
  109. data/app/assets/javascripts/{jquery.ui.resizable.js → jquery-ui/resizable.js} +196 -146
  110. data/app/assets/javascripts/{jquery.ui.selectable.js → jquery-ui/selectable.js} +25 -15
  111. data/app/assets/javascripts/jquery-ui/selectmenu.js +560 -0
  112. data/app/assets/javascripts/{jquery.ui.slider.js → jquery-ui/slider.js} +43 -31
  113. data/app/assets/javascripts/{jquery.ui.sortable.js → jquery-ui/sortable.js} +71 -50
  114. data/app/assets/javascripts/{jquery.ui.spinner.js → jquery-ui/spinner.js} +46 -29
  115. data/app/assets/javascripts/{jquery.ui.tabs.js → jquery-ui/tabs.js} +69 -52
  116. data/app/assets/javascripts/{jquery.ui.tooltip.js → jquery-ui/tooltip.js} +97 -55
  117. data/app/assets/javascripts/{jquery.ui.widget.js → jquery-ui/widget.js} +52 -30
  118. data/app/assets/stylesheets/jquery-ui.css +1 -0
  119. data/app/assets/stylesheets/{jquery.ui.accordion.css.erb → jquery-ui/accordion.css.erb} +5 -7
  120. data/app/assets/stylesheets/{jquery.ui.all.css.erb → jquery-ui/all.css.erb} +3 -3
  121. data/app/assets/stylesheets/{jquery.ui.autocomplete.css.erb → jquery-ui/autocomplete.css.erb} +4 -4
  122. data/app/assets/stylesheets/jquery-ui/base.css.erb +30 -0
  123. data/app/assets/stylesheets/{jquery.ui.button.css.erb → jquery-ui/button.css.erb} +3 -3
  124. data/app/assets/stylesheets/{jquery.ui.core.css.erb → jquery-ui/core.css.erb} +4 -1
  125. data/app/assets/stylesheets/{jquery.ui.datepicker.css.erb → jquery-ui/datepicker.css.erb} +3 -3
  126. data/app/assets/stylesheets/{jquery.ui.dialog.css.erb → jquery-ui/dialog.css.erb} +6 -5
  127. data/app/assets/stylesheets/jquery-ui/draggable.css.erb +16 -0
  128. data/app/assets/stylesheets/{jquery.ui.menu.css.erb → jquery-ui/menu.css.erb} +18 -34
  129. data/app/assets/stylesheets/{jquery.ui.progressbar.css.erb → jquery-ui/progressbar.css.erb} +3 -3
  130. data/app/assets/stylesheets/{jquery.ui.resizable.css.erb → jquery-ui/resizable.css.erb} +5 -3
  131. data/app/assets/stylesheets/{jquery.ui.selectable.css.erb → jquery-ui/selectable.css.erb} +7 -3
  132. data/app/assets/stylesheets/jquery-ui/selectmenu.css.erb +64 -0
  133. data/app/assets/stylesheets/{jquery.ui.slider.css.erb → jquery-ui/slider.css.erb} +5 -3
  134. data/app/assets/stylesheets/jquery-ui/sortable.css.erb +16 -0
  135. data/app/assets/stylesheets/{jquery.ui.spinner.css.erb → jquery-ui/spinner.css.erb} +4 -4
  136. data/app/assets/stylesheets/{jquery.ui.tabs.css.erb → jquery-ui/tabs.css.erb} +3 -3
  137. data/app/assets/stylesheets/{jquery.ui.theme.css.erb → jquery-ui/theme.css.erb} +1 -4
  138. data/app/assets/stylesheets/{jquery.ui.tooltip.css.erb → jquery-ui/tooltip.css.erb} +3 -3
  139. data/lib/jquery/ui/rails/version.rb +2 -2
  140. metadata +137 -129
  141. data/app/assets/javascripts/jquery.ui.all.js +0 -34
  142. data/app/assets/javascripts/jquery.ui.datepicker-af.js +0 -23
  143. data/app/assets/javascripts/jquery.ui.datepicker-ar-DZ.js +0 -23
  144. data/app/assets/javascripts/jquery.ui.datepicker-ar.js +0 -23
  145. data/app/assets/javascripts/jquery.ui.datepicker-az.js +0 -23
  146. data/app/assets/javascripts/jquery.ui.datepicker-be.js +0 -23
  147. data/app/assets/javascripts/jquery.ui.datepicker-bg.js +0 -24
  148. data/app/assets/javascripts/jquery.ui.datepicker-bs.js +0 -23
  149. data/app/assets/javascripts/jquery.ui.datepicker-ca.js +0 -23
  150. data/app/assets/javascripts/jquery.ui.datepicker-cs.js +0 -23
  151. data/app/assets/javascripts/jquery.ui.datepicker-cy-GB.js +0 -23
  152. data/app/assets/javascripts/jquery.ui.datepicker-da.js +0 -23
  153. data/app/assets/javascripts/jquery.ui.datepicker-de.js +0 -23
  154. data/app/assets/javascripts/jquery.ui.datepicker-el.js +0 -23
  155. data/app/assets/javascripts/jquery.ui.datepicker-en-AU.js +0 -23
  156. data/app/assets/javascripts/jquery.ui.datepicker-en-GB.js +0 -23
  157. data/app/assets/javascripts/jquery.ui.datepicker-en-NZ.js +0 -23
  158. data/app/assets/javascripts/jquery.ui.datepicker-eo.js +0 -23
  159. data/app/assets/javascripts/jquery.ui.datepicker-es.js +0 -23
  160. data/app/assets/javascripts/jquery.ui.datepicker-et.js +0 -23
  161. data/app/assets/javascripts/jquery.ui.datepicker-eu.js +0 -23
  162. data/app/assets/javascripts/jquery.ui.datepicker-fa.js +0 -59
  163. data/app/assets/javascripts/jquery.ui.datepicker-fi.js +0 -23
  164. data/app/assets/javascripts/jquery.ui.datepicker-fo.js +0 -23
  165. data/app/assets/javascripts/jquery.ui.datepicker-fr-CA.js +0 -23
  166. data/app/assets/javascripts/jquery.ui.datepicker-fr-CH.js +0 -23
  167. data/app/assets/javascripts/jquery.ui.datepicker-fr.js +0 -25
  168. data/app/assets/javascripts/jquery.ui.datepicker-gl.js +0 -23
  169. data/app/assets/javascripts/jquery.ui.datepicker-he.js +0 -23
  170. data/app/assets/javascripts/jquery.ui.datepicker-hi.js +0 -23
  171. data/app/assets/javascripts/jquery.ui.datepicker-hr.js +0 -23
  172. data/app/assets/javascripts/jquery.ui.datepicker-hu.js +0 -23
  173. data/app/assets/javascripts/jquery.ui.datepicker-hy.js +0 -23
  174. data/app/assets/javascripts/jquery.ui.datepicker-id.js +0 -23
  175. data/app/assets/javascripts/jquery.ui.datepicker-is.js +0 -23
  176. data/app/assets/javascripts/jquery.ui.datepicker-it.js +0 -23
  177. data/app/assets/javascripts/jquery.ui.datepicker-ja.js +0 -23
  178. data/app/assets/javascripts/jquery.ui.datepicker-ka.js +0 -21
  179. data/app/assets/javascripts/jquery.ui.datepicker-kk.js +0 -23
  180. data/app/assets/javascripts/jquery.ui.datepicker-km.js +0 -23
  181. data/app/assets/javascripts/jquery.ui.datepicker-ko.js +0 -23
  182. data/app/assets/javascripts/jquery.ui.datepicker-ky.js +0 -24
  183. data/app/assets/javascripts/jquery.ui.datepicker-lb.js +0 -23
  184. data/app/assets/javascripts/jquery.ui.datepicker-lt.js +0 -23
  185. data/app/assets/javascripts/jquery.ui.datepicker-lv.js +0 -23
  186. data/app/assets/javascripts/jquery.ui.datepicker-mk.js +0 -23
  187. data/app/assets/javascripts/jquery.ui.datepicker-ml.js +0 -23
  188. data/app/assets/javascripts/jquery.ui.datepicker-ms.js +0 -23
  189. data/app/assets/javascripts/jquery.ui.datepicker-nb.js +0 -22
  190. data/app/assets/javascripts/jquery.ui.datepicker-nl-BE.js +0 -23
  191. data/app/assets/javascripts/jquery.ui.datepicker-nl.js +0 -23
  192. data/app/assets/javascripts/jquery.ui.datepicker-nn.js +0 -22
  193. data/app/assets/javascripts/jquery.ui.datepicker-no.js +0 -23
  194. data/app/assets/javascripts/jquery.ui.datepicker-pl.js +0 -23
  195. data/app/assets/javascripts/jquery.ui.datepicker-pt-BR.js +0 -23
  196. data/app/assets/javascripts/jquery.ui.datepicker-pt.js +0 -22
  197. data/app/assets/javascripts/jquery.ui.datepicker-rm.js +0 -21
  198. data/app/assets/javascripts/jquery.ui.datepicker-ro.js +0 -26
  199. data/app/assets/javascripts/jquery.ui.datepicker-ru.js +0 -23
  200. data/app/assets/javascripts/jquery.ui.datepicker-sk.js +0 -23
  201. data/app/assets/javascripts/jquery.ui.datepicker-sl.js +0 -24
  202. data/app/assets/javascripts/jquery.ui.datepicker-sq.js +0 -23
  203. data/app/assets/javascripts/jquery.ui.datepicker-sr-SR.js +0 -23
  204. data/app/assets/javascripts/jquery.ui.datepicker-sr.js +0 -23
  205. data/app/assets/javascripts/jquery.ui.datepicker-sv.js +0 -23
  206. data/app/assets/javascripts/jquery.ui.datepicker-ta.js +0 -23
  207. data/app/assets/javascripts/jquery.ui.datepicker-th.js +0 -23
  208. data/app/assets/javascripts/jquery.ui.datepicker-tj.js +0 -23
  209. data/app/assets/javascripts/jquery.ui.datepicker-tr.js +0 -23
  210. data/app/assets/javascripts/jquery.ui.datepicker-uk.js +0 -24
  211. data/app/assets/javascripts/jquery.ui.datepicker-vi.js +0 -23
  212. data/app/assets/javascripts/jquery.ui.datepicker-zh-CN.js +0 -23
  213. data/app/assets/javascripts/jquery.ui.datepicker-zh-HK.js +0 -23
  214. data/app/assets/javascripts/jquery.ui.datepicker-zh-TW.js +0 -23
  215. data/app/assets/javascripts/jquery.ui.droppable.js +0 -394
  216. data/app/assets/javascripts/jquery.ui.effect.all.js +0 -14
  217. data/app/assets/stylesheets/jquery.ui.base.css.erb +0 -27
@@ -1,23 +0,0 @@
1
- /* Chinese initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Cloudream (cloudream@gmail.com). */
3
- jQuery(function($){
4
- $.datepicker.regional['zh-CN'] = {
5
- closeText: '关闭',
6
- prevText: '<上月',
7
- nextText: '下月>',
8
- currentText: '今天',
9
- monthNames: ['一月','二月','三月','四月','五月','六月',
10
- '七月','八月','九月','十月','十一月','十二月'],
11
- monthNamesShort: ['一月','二月','三月','四月','五月','六月',
12
- '七月','八月','九月','十月','十一月','十二月'],
13
- dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
14
- dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
15
- dayNamesMin: ['日','一','二','三','四','五','六'],
16
- weekHeader: '周',
17
- dateFormat: 'yy-mm-dd',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: true,
21
- yearSuffix: '年'};
22
- $.datepicker.setDefaults($.datepicker.regional['zh-CN']);
23
- });
@@ -1,23 +0,0 @@
1
- /* Chinese initialisation for the jQuery UI date picker plugin. */
2
- /* Written by SCCY (samuelcychan@gmail.com). */
3
- jQuery(function($){
4
- $.datepicker.regional['zh-HK'] = {
5
- closeText: '關閉',
6
- prevText: '<上月',
7
- nextText: '下月>',
8
- currentText: '今天',
9
- monthNames: ['一月','二月','三月','四月','五月','六月',
10
- '七月','八月','九月','十月','十一月','十二月'],
11
- monthNamesShort: ['一月','二月','三月','四月','五月','六月',
12
- '七月','八月','九月','十月','十一月','十二月'],
13
- dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
14
- dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
15
- dayNamesMin: ['日','一','二','三','四','五','六'],
16
- weekHeader: '周',
17
- dateFormat: 'dd-mm-yy',
18
- firstDay: 0,
19
- isRTL: false,
20
- showMonthAfterYear: true,
21
- yearSuffix: '年'};
22
- $.datepicker.setDefaults($.datepicker.regional['zh-HK']);
23
- });
@@ -1,23 +0,0 @@
1
- /* Chinese initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Ressol (ressol@gmail.com). */
3
- jQuery(function($){
4
- $.datepicker.regional['zh-TW'] = {
5
- closeText: '關閉',
6
- prevText: '<上月',
7
- nextText: '下月>',
8
- currentText: '今天',
9
- monthNames: ['一月','二月','三月','四月','五月','六月',
10
- '七月','八月','九月','十月','十一月','十二月'],
11
- monthNamesShort: ['一月','二月','三月','四月','五月','六月',
12
- '七月','八月','九月','十月','十一月','十二月'],
13
- dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
14
- dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
15
- dayNamesMin: ['日','一','二','三','四','五','六'],
16
- weekHeader: '周',
17
- dateFormat: 'yy/mm/dd',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: true,
21
- yearSuffix: '年'};
22
- $.datepicker.setDefaults($.datepicker.regional['zh-TW']);
23
- });
@@ -1,394 +0,0 @@
1
- //= require jquery.ui.core
2
- //= require jquery.ui.widget
3
- //= require jquery.ui.mouse
4
- //= require jquery.ui.draggable
5
-
6
- /*!
7
- * jQuery UI Droppable 1.10.4
8
- * http://jqueryui.com
9
- *
10
- * Copyright 2014 jQuery Foundation and other contributors
11
- * Released under the MIT license.
12
- * http://jquery.org/license
13
- *
14
- * http://api.jqueryui.com/droppable/
15
- *
16
- * Depends:
17
- * jquery.ui.core.js
18
- * jquery.ui.widget.js
19
- * jquery.ui.mouse.js
20
- * jquery.ui.draggable.js
21
- */
22
- (function( $, undefined ) {
23
-
24
- function isOverAxis( x, reference, size ) {
25
- return ( x > reference ) && ( x < ( reference + size ) );
26
- }
27
-
28
- $.widget("ui.droppable", {
29
- version: "1.10.4",
30
- widgetEventPrefix: "drop",
31
- options: {
32
- accept: "*",
33
- activeClass: false,
34
- addClasses: true,
35
- greedy: false,
36
- hoverClass: false,
37
- scope: "default",
38
- tolerance: "intersect",
39
-
40
- // callbacks
41
- activate: null,
42
- deactivate: null,
43
- drop: null,
44
- out: null,
45
- over: null
46
- },
47
- _create: function() {
48
-
49
- var proportions,
50
- o = this.options,
51
- accept = o.accept;
52
-
53
- this.isover = false;
54
- this.isout = true;
55
-
56
- this.accept = $.isFunction(accept) ? accept : function(d) {
57
- return d.is(accept);
58
- };
59
-
60
- this.proportions = function( /* valueToWrite */ ) {
61
- if ( arguments.length ) {
62
- // Store the droppable's proportions
63
- proportions = arguments[ 0 ];
64
- } else {
65
- // Retrieve or derive the droppable's proportions
66
- return proportions ?
67
- proportions :
68
- proportions = {
69
- width: this.element[ 0 ].offsetWidth,
70
- height: this.element[ 0 ].offsetHeight
71
- };
72
- }
73
- };
74
-
75
- // Add the reference and positions to the manager
76
- $.ui.ddmanager.droppables[o.scope] = $.ui.ddmanager.droppables[o.scope] || [];
77
- $.ui.ddmanager.droppables[o.scope].push(this);
78
-
79
- (o.addClasses && this.element.addClass("ui-droppable"));
80
-
81
- },
82
-
83
- _destroy: function() {
84
- var i = 0,
85
- drop = $.ui.ddmanager.droppables[this.options.scope];
86
-
87
- for ( ; i < drop.length; i++ ) {
88
- if ( drop[i] === this ) {
89
- drop.splice(i, 1);
90
- }
91
- }
92
-
93
- this.element.removeClass("ui-droppable ui-droppable-disabled");
94
- },
95
-
96
- _setOption: function(key, value) {
97
-
98
- if(key === "accept") {
99
- this.accept = $.isFunction(value) ? value : function(d) {
100
- return d.is(value);
101
- };
102
- }
103
- $.Widget.prototype._setOption.apply(this, arguments);
104
- },
105
-
106
- _activate: function(event) {
107
- var draggable = $.ui.ddmanager.current;
108
- if(this.options.activeClass) {
109
- this.element.addClass(this.options.activeClass);
110
- }
111
- if(draggable){
112
- this._trigger("activate", event, this.ui(draggable));
113
- }
114
- },
115
-
116
- _deactivate: function(event) {
117
- var draggable = $.ui.ddmanager.current;
118
- if(this.options.activeClass) {
119
- this.element.removeClass(this.options.activeClass);
120
- }
121
- if(draggable){
122
- this._trigger("deactivate", event, this.ui(draggable));
123
- }
124
- },
125
-
126
- _over: function(event) {
127
-
128
- var draggable = $.ui.ddmanager.current;
129
-
130
- // Bail if draggable and droppable are same element
131
- if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) {
132
- return;
133
- }
134
-
135
- if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
136
- if(this.options.hoverClass) {
137
- this.element.addClass(this.options.hoverClass);
138
- }
139
- this._trigger("over", event, this.ui(draggable));
140
- }
141
-
142
- },
143
-
144
- _out: function(event) {
145
-
146
- var draggable = $.ui.ddmanager.current;
147
-
148
- // Bail if draggable and droppable are same element
149
- if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) {
150
- return;
151
- }
152
-
153
- if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
154
- if(this.options.hoverClass) {
155
- this.element.removeClass(this.options.hoverClass);
156
- }
157
- this._trigger("out", event, this.ui(draggable));
158
- }
159
-
160
- },
161
-
162
- _drop: function(event,custom) {
163
-
164
- var draggable = custom || $.ui.ddmanager.current,
165
- childrenIntersection = false;
166
-
167
- // Bail if draggable and droppable are same element
168
- if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) {
169
- return false;
170
- }
171
-
172
- this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function() {
173
- var inst = $.data(this, "ui-droppable");
174
- if(
175
- inst.options.greedy &&
176
- !inst.options.disabled &&
177
- inst.options.scope === draggable.options.scope &&
178
- inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element)) &&
179
- $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)
180
- ) { childrenIntersection = true; return false; }
181
- });
182
- if(childrenIntersection) {
183
- return false;
184
- }
185
-
186
- if(this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
187
- if(this.options.activeClass) {
188
- this.element.removeClass(this.options.activeClass);
189
- }
190
- if(this.options.hoverClass) {
191
- this.element.removeClass(this.options.hoverClass);
192
- }
193
- this._trigger("drop", event, this.ui(draggable));
194
- return this.element;
195
- }
196
-
197
- return false;
198
-
199
- },
200
-
201
- ui: function(c) {
202
- return {
203
- draggable: (c.currentItem || c.element),
204
- helper: c.helper,
205
- position: c.position,
206
- offset: c.positionAbs
207
- };
208
- }
209
-
210
- });
211
-
212
- $.ui.intersect = function(draggable, droppable, toleranceMode) {
213
-
214
- if (!droppable.offset) {
215
- return false;
216
- }
217
-
218
- var draggableLeft, draggableTop,
219
- x1 = (draggable.positionAbs || draggable.position.absolute).left,
220
- y1 = (draggable.positionAbs || draggable.position.absolute).top,
221
- x2 = x1 + draggable.helperProportions.width,
222
- y2 = y1 + draggable.helperProportions.height,
223
- l = droppable.offset.left,
224
- t = droppable.offset.top,
225
- r = l + droppable.proportions().width,
226
- b = t + droppable.proportions().height;
227
-
228
- switch (toleranceMode) {
229
- case "fit":
230
- return (l <= x1 && x2 <= r && t <= y1 && y2 <= b);
231
- case "intersect":
232
- return (l < x1 + (draggable.helperProportions.width / 2) && // Right Half
233
- x2 - (draggable.helperProportions.width / 2) < r && // Left Half
234
- t < y1 + (draggable.helperProportions.height / 2) && // Bottom Half
235
- y2 - (draggable.helperProportions.height / 2) < b ); // Top Half
236
- case "pointer":
237
- draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left);
238
- draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top);
239
- return isOverAxis( draggableTop, t, droppable.proportions().height ) && isOverAxis( draggableLeft, l, droppable.proportions().width );
240
- case "touch":
241
- return (
242
- (y1 >= t && y1 <= b) || // Top edge touching
243
- (y2 >= t && y2 <= b) || // Bottom edge touching
244
- (y1 < t && y2 > b) // Surrounded vertically
245
- ) && (
246
- (x1 >= l && x1 <= r) || // Left edge touching
247
- (x2 >= l && x2 <= r) || // Right edge touching
248
- (x1 < l && x2 > r) // Surrounded horizontally
249
- );
250
- default:
251
- return false;
252
- }
253
-
254
- };
255
-
256
- /*
257
- This manager tracks offsets of draggables and droppables
258
- */
259
- $.ui.ddmanager = {
260
- current: null,
261
- droppables: { "default": [] },
262
- prepareOffsets: function(t, event) {
263
-
264
- var i, j,
265
- m = $.ui.ddmanager.droppables[t.options.scope] || [],
266
- type = event ? event.type : null, // workaround for #2317
267
- list = (t.currentItem || t.element).find(":data(ui-droppable)").addBack();
268
-
269
- droppablesLoop: for (i = 0; i < m.length; i++) {
270
-
271
- //No disabled and non-accepted
272
- if(m[i].options.disabled || (t && !m[i].accept.call(m[i].element[0],(t.currentItem || t.element)))) {
273
- continue;
274
- }
275
-
276
- // Filter out elements in the current dragged item
277
- for (j=0; j < list.length; j++) {
278
- if(list[j] === m[i].element[0]) {
279
- m[i].proportions().height = 0;
280
- continue droppablesLoop;
281
- }
282
- }
283
-
284
- m[i].visible = m[i].element.css("display") !== "none";
285
- if(!m[i].visible) {
286
- continue;
287
- }
288
-
289
- //Activate the droppable if used directly from draggables
290
- if(type === "mousedown") {
291
- m[i]._activate.call(m[i], event);
292
- }
293
-
294
- m[ i ].offset = m[ i ].element.offset();
295
- m[ i ].proportions({ width: m[ i ].element[ 0 ].offsetWidth, height: m[ i ].element[ 0 ].offsetHeight });
296
-
297
- }
298
-
299
- },
300
- drop: function(draggable, event) {
301
-
302
- var dropped = false;
303
- // Create a copy of the droppables in case the list changes during the drop (#9116)
304
- $.each(($.ui.ddmanager.droppables[draggable.options.scope] || []).slice(), function() {
305
-
306
- if(!this.options) {
307
- return;
308
- }
309
- if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance)) {
310
- dropped = this._drop.call(this, event) || dropped;
311
- }
312
-
313
- if (!this.options.disabled && this.visible && this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
314
- this.isout = true;
315
- this.isover = false;
316
- this._deactivate.call(this, event);
317
- }
318
-
319
- });
320
- return dropped;
321
-
322
- },
323
- dragStart: function( draggable, event ) {
324
- //Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003)
325
- draggable.element.parentsUntil( "body" ).bind( "scroll.droppable", function() {
326
- if( !draggable.options.refreshPositions ) {
327
- $.ui.ddmanager.prepareOffsets( draggable, event );
328
- }
329
- });
330
- },
331
- drag: function(draggable, event) {
332
-
333
- //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
334
- if(draggable.options.refreshPositions) {
335
- $.ui.ddmanager.prepareOffsets(draggable, event);
336
- }
337
-
338
- //Run through all droppables and check their positions based on specific tolerance options
339
- $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() {
340
-
341
- if(this.options.disabled || this.greedyChild || !this.visible) {
342
- return;
343
- }
344
-
345
- var parentInstance, scope, parent,
346
- intersects = $.ui.intersect(draggable, this, this.options.tolerance),
347
- c = !intersects && this.isover ? "isout" : (intersects && !this.isover ? "isover" : null);
348
- if(!c) {
349
- return;
350
- }
351
-
352
- if (this.options.greedy) {
353
- // find droppable parents with same scope
354
- scope = this.options.scope;
355
- parent = this.element.parents(":data(ui-droppable)").filter(function () {
356
- return $.data(this, "ui-droppable").options.scope === scope;
357
- });
358
-
359
- if (parent.length) {
360
- parentInstance = $.data(parent[0], "ui-droppable");
361
- parentInstance.greedyChild = (c === "isover");
362
- }
363
- }
364
-
365
- // we just moved into a greedy child
366
- if (parentInstance && c === "isover") {
367
- parentInstance.isover = false;
368
- parentInstance.isout = true;
369
- parentInstance._out.call(parentInstance, event);
370
- }
371
-
372
- this[c] = true;
373
- this[c === "isout" ? "isover" : "isout"] = false;
374
- this[c === "isover" ? "_over" : "_out"].call(this, event);
375
-
376
- // we just moved out of a greedy child
377
- if (parentInstance && c === "isout") {
378
- parentInstance.isout = false;
379
- parentInstance.isover = true;
380
- parentInstance._over.call(parentInstance, event);
381
- }
382
- });
383
-
384
- },
385
- dragStop: function( draggable, event ) {
386
- draggable.element.parentsUntil( "body" ).unbind( "scroll.droppable" );
387
- //Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003)
388
- if( !draggable.options.refreshPositions ) {
389
- $.ui.ddmanager.prepareOffsets( draggable, event );
390
- }
391
- }
392
- };
393
-
394
- })(jQuery);