jquery-ui-rails-test 6.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +2 -0
  3. data/.gitmodules +3 -0
  4. data/.travis.yml +2 -0
  5. data/Gemfile +3 -0
  6. data/History.md +172 -0
  7. data/License.txt +2 -0
  8. data/README.md +311 -0
  9. data/Rakefile +261 -0
  10. data/VERSIONS.md +40 -0
  11. data/app/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  12. data/app/assets/images/jquery-ui/ui-icons_444444_256x240.png +0 -0
  13. data/app/assets/images/jquery-ui/ui-icons_555555_256x240.png +0 -0
  14. data/app/assets/images/jquery-ui/ui-icons_777620_256x240.png +0 -0
  15. data/app/assets/images/jquery-ui/ui-icons_777777_256x240.png +0 -0
  16. data/app/assets/images/jquery-ui/ui-icons_cc0000_256x240.png +0 -0
  17. data/app/assets/images/jquery-ui/ui-icons_ffffff_256x240.png +0 -0
  18. data/app/assets/javascripts/jquery-ui/core.js +15 -0
  19. data/app/assets/javascripts/jquery-ui/data.js +45 -0
  20. data/app/assets/javascripts/jquery-ui/disable-selection.js +51 -0
  21. data/app/assets/javascripts/jquery-ui/effect.all.js +15 -0
  22. data/app/assets/javascripts/jquery-ui/effect.js +975 -0
  23. data/app/assets/javascripts/jquery-ui/effects/effect-blind.js +76 -0
  24. data/app/assets/javascripts/jquery-ui/effects/effect-bounce.js +116 -0
  25. data/app/assets/javascripts/jquery-ui/effects/effect-clip.js +71 -0
  26. data/app/assets/javascripts/jquery-ui/effects/effect-drop.js +75 -0
  27. data/app/assets/javascripts/jquery-ui/effects/effect-explode.js +117 -0
  28. data/app/assets/javascripts/jquery-ui/effects/effect-fade.js +53 -0
  29. data/app/assets/javascripts/jquery-ui/effects/effect-fold.js +95 -0
  30. data/app/assets/javascripts/jquery-ui/effects/effect-highlight.js +63 -0
  31. data/app/assets/javascripts/jquery-ui/effects/effect-puff.js +49 -0
  32. data/app/assets/javascripts/jquery-ui/effects/effect-pulsate.js +70 -0
  33. data/app/assets/javascripts/jquery-ui/effects/effect-scale.js +63 -0
  34. data/app/assets/javascripts/jquery-ui/effects/effect-shake.js +80 -0
  35. data/app/assets/javascripts/jquery-ui/effects/effect-size.js +199 -0
  36. data/app/assets/javascripts/jquery-ui/effects/effect-slide.js +82 -0
  37. data/app/assets/javascripts/jquery-ui/effects/effect-transfer.js +46 -0
  38. data/app/assets/javascripts/jquery-ui/focusable.js +89 -0
  39. data/app/assets/javascripts/jquery-ui/form-reset-mixin.js +83 -0
  40. data/app/assets/javascripts/jquery-ui/form.js +25 -0
  41. data/app/assets/javascripts/jquery-ui/i18n/datepicker-af.js +40 -0
  42. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ar-DZ.js +42 -0
  43. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ar.js +42 -0
  44. data/app/assets/javascripts/jquery-ui/i18n/datepicker-az.js +40 -0
  45. data/app/assets/javascripts/jquery-ui/i18n/datepicker-be.js +40 -0
  46. data/app/assets/javascripts/jquery-ui/i18n/datepicker-bg.js +41 -0
  47. data/app/assets/javascripts/jquery-ui/i18n/datepicker-bs.js +40 -0
  48. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ca.js +40 -0
  49. data/app/assets/javascripts/jquery-ui/i18n/datepicker-cs.js +40 -0
  50. data/app/assets/javascripts/jquery-ui/i18n/datepicker-cy-GB.js +48 -0
  51. data/app/assets/javascripts/jquery-ui/i18n/datepicker-da.js +40 -0
  52. data/app/assets/javascripts/jquery-ui/i18n/datepicker-de-AT.js +41 -0
  53. data/app/assets/javascripts/jquery-ui/i18n/datepicker-de.js +40 -0
  54. data/app/assets/javascripts/jquery-ui/i18n/datepicker-el.js +40 -0
  55. data/app/assets/javascripts/jquery-ui/i18n/datepicker-en-AU.js +40 -0
  56. data/app/assets/javascripts/jquery-ui/i18n/datepicker-en-GB.js +40 -0
  57. data/app/assets/javascripts/jquery-ui/i18n/datepicker-en-NZ.js +40 -0
  58. data/app/assets/javascripts/jquery-ui/i18n/datepicker-eo.js +40 -0
  59. data/app/assets/javascripts/jquery-ui/i18n/datepicker-es.js +40 -0
  60. data/app/assets/javascripts/jquery-ui/i18n/datepicker-et.js +48 -0
  61. data/app/assets/javascripts/jquery-ui/i18n/datepicker-eu.js +39 -0
  62. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fa.js +76 -0
  63. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fi.js +40 -0
  64. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fo.js +48 -0
  65. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fr-CA.js +40 -0
  66. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fr-CH.js +40 -0
  67. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fr.js +42 -0
  68. data/app/assets/javascripts/jquery-ui/i18n/datepicker-gl.js +40 -0
  69. data/app/assets/javascripts/jquery-ui/i18n/datepicker-he.js +40 -0
  70. data/app/assets/javascripts/jquery-ui/i18n/datepicker-hi.js +40 -0
  71. data/app/assets/javascripts/jquery-ui/i18n/datepicker-hr.js +40 -0
  72. data/app/assets/javascripts/jquery-ui/i18n/datepicker-hu.js +39 -0
  73. data/app/assets/javascripts/jquery-ui/i18n/datepicker-hy.js +40 -0
  74. data/app/assets/javascripts/jquery-ui/i18n/datepicker-id.js +40 -0
  75. data/app/assets/javascripts/jquery-ui/i18n/datepicker-is.js +48 -0
  76. data/app/assets/javascripts/jquery-ui/i18n/datepicker-it-CH.js +40 -0
  77. data/app/assets/javascripts/jquery-ui/i18n/datepicker-it.js +40 -0
  78. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ja.js +40 -0
  79. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ka.js +51 -0
  80. data/app/assets/javascripts/jquery-ui/i18n/datepicker-kk.js +40 -0
  81. data/app/assets/javascripts/jquery-ui/i18n/datepicker-km.js +40 -0
  82. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ko.js +40 -0
  83. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ky.js +41 -0
  84. data/app/assets/javascripts/jquery-ui/i18n/datepicker-lb.js +48 -0
  85. data/app/assets/javascripts/jquery-ui/i18n/datepicker-lt.js +48 -0
  86. data/app/assets/javascripts/jquery-ui/i18n/datepicker-lv.js +48 -0
  87. data/app/assets/javascripts/jquery-ui/i18n/datepicker-mk.js +40 -0
  88. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ml.js +40 -0
  89. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ms.js +40 -0
  90. data/app/assets/javascripts/jquery-ui/i18n/datepicker-nb.js +52 -0
  91. data/app/assets/javascripts/jquery-ui/i18n/datepicker-nl-BE.js +40 -0
  92. data/app/assets/javascripts/jquery-ui/i18n/datepicker-nl.js +40 -0
  93. data/app/assets/javascripts/jquery-ui/i18n/datepicker-nn.js +52 -0
  94. data/app/assets/javascripts/jquery-ui/i18n/datepicker-no.js +53 -0
  95. data/app/assets/javascripts/jquery-ui/i18n/datepicker-pl.js +40 -0
  96. data/app/assets/javascripts/jquery-ui/i18n/datepicker-pt-BR.js +48 -0
  97. data/app/assets/javascripts/jquery-ui/i18n/datepicker-pt.js +47 -0
  98. data/app/assets/javascripts/jquery-ui/i18n/datepicker-rm.js +64 -0
  99. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ro.js +43 -0
  100. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ru.js +40 -0
  101. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sk.js +40 -0
  102. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sl.js +41 -0
  103. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sq.js +40 -0
  104. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sr-SR.js +40 -0
  105. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sr.js +40 -0
  106. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sv.js +40 -0
  107. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ta.js +56 -0
  108. data/app/assets/javascripts/jquery-ui/i18n/datepicker-th.js +40 -0
  109. data/app/assets/javascripts/jquery-ui/i18n/datepicker-tj.js +40 -0
  110. data/app/assets/javascripts/jquery-ui/i18n/datepicker-tr.js +40 -0
  111. data/app/assets/javascripts/jquery-ui/i18n/datepicker-uk.js +41 -0
  112. data/app/assets/javascripts/jquery-ui/i18n/datepicker-vi.js +40 -0
  113. data/app/assets/javascripts/jquery-ui/i18n/datepicker-zh-CN.js +40 -0
  114. data/app/assets/javascripts/jquery-ui/i18n/datepicker-zh-HK.js +40 -0
  115. data/app/assets/javascripts/jquery-ui/i18n/datepicker-zh-TW.js +40 -0
  116. data/app/assets/javascripts/jquery-ui/ie.js +20 -0
  117. data/app/assets/javascripts/jquery-ui/jquery-patch.js +91 -0
  118. data/app/assets/javascripts/jquery-ui/jquery-var-for-color.js +24 -0
  119. data/app/assets/javascripts/jquery-ui/keycode.js +51 -0
  120. data/app/assets/javascripts/jquery-ui/labels.js +71 -0
  121. data/app/assets/javascripts/jquery-ui/plugin.js +49 -0
  122. data/app/assets/javascripts/jquery-ui/position.js +513 -0
  123. data/app/assets/javascripts/jquery-ui/safe-active-element.js +46 -0
  124. data/app/assets/javascripts/jquery-ui/safe-blur.js +27 -0
  125. data/app/assets/javascripts/jquery-ui/scroll-parent.js +50 -0
  126. data/app/assets/javascripts/jquery-ui/tabbable.js +41 -0
  127. data/app/assets/javascripts/jquery-ui/unique-id.js +54 -0
  128. data/app/assets/javascripts/jquery-ui/vendor/jquery-color/LICENSE.txt +43 -0
  129. data/app/assets/javascripts/jquery-ui/vendor/jquery-color/jquery.color.js +722 -0
  130. data/app/assets/javascripts/jquery-ui/version.js +20 -0
  131. data/app/assets/javascripts/jquery-ui/widget.js +758 -0
  132. data/app/assets/javascripts/jquery-ui/widgets/accordion.js +627 -0
  133. data/app/assets/javascripts/jquery-ui/widgets/autocomplete.js +685 -0
  134. data/app/assets/javascripts/jquery-ui/widgets/button.js +454 -0
  135. data/app/assets/javascripts/jquery-ui/widgets/checkboxradio.js +289 -0
  136. data/app/assets/javascripts/jquery-ui/widgets/controlgroup.js +304 -0
  137. data/app/assets/javascripts/jquery-ui/widgets/datepicker.js +2243 -0
  138. data/app/assets/javascripts/jquery-ui/widgets/dialog.js +968 -0
  139. data/app/assets/javascripts/jquery-ui/widgets/draggable.js +1268 -0
  140. data/app/assets/javascripts/jquery-ui/widgets/droppable.js +508 -0
  141. data/app/assets/javascripts/jquery-ui/widgets/menu.js +720 -0
  142. data/app/assets/javascripts/jquery-ui/widgets/mouse.js +241 -0
  143. data/app/assets/javascripts/jquery-ui/widgets/progressbar.js +184 -0
  144. data/app/assets/javascripts/jquery-ui/widgets/resizable.js +1225 -0
  145. data/app/assets/javascripts/jquery-ui/widgets/selectable.js +321 -0
  146. data/app/assets/javascripts/jquery-ui/widgets/selectmenu.js +702 -0
  147. data/app/assets/javascripts/jquery-ui/widgets/slider.js +760 -0
  148. data/app/assets/javascripts/jquery-ui/widgets/sortable.js +1622 -0
  149. data/app/assets/javascripts/jquery-ui/widgets/spinner.js +588 -0
  150. data/app/assets/javascripts/jquery-ui/widgets/tabs.js +931 -0
  151. data/app/assets/javascripts/jquery-ui/widgets/tooltip.js +533 -0
  152. data/app/assets/javascripts/jquery-ui.js +56 -0
  153. data/app/assets/stylesheets/jquery-ui/accordion.css +26 -0
  154. data/app/assets/stylesheets/jquery-ui/all.css +14 -0
  155. data/app/assets/stylesheets/jquery-ui/autocomplete.css +19 -0
  156. data/app/assets/stylesheets/jquery-ui/base.css +32 -0
  157. data/app/assets/stylesheets/jquery-ui/button.css +85 -0
  158. data/app/assets/stylesheets/jquery-ui/checkboxradio.css +37 -0
  159. data/app/assets/stylesheets/jquery-ui/controlgroup.css +68 -0
  160. data/app/assets/stylesheets/jquery-ui/core.css +100 -0
  161. data/app/assets/stylesheets/jquery-ui/datepicker.css +188 -0
  162. data/app/assets/stylesheets/jquery-ui/dialog.css +104 -0
  163. data/app/assets/stylesheets/jquery-ui/draggable.css +15 -0
  164. data/app/assets/stylesheets/jquery-ui/menu.css +67 -0
  165. data/app/assets/stylesheets/jquery-ui/progressbar.css +31 -0
  166. data/app/assets/stylesheets/jquery-ui/resizable.css +81 -0
  167. data/app/assets/stylesheets/jquery-ui/selectable.css +20 -0
  168. data/app/assets/stylesheets/jquery-ui/selectmenu.css +53 -0
  169. data/app/assets/stylesheets/jquery-ui/slider.css +78 -0
  170. data/app/assets/stylesheets/jquery-ui/sortable.css +15 -0
  171. data/app/assets/stylesheets/jquery-ui/spinner.css +55 -0
  172. data/app/assets/stylesheets/jquery-ui/tabs.css +54 -0
  173. data/app/assets/stylesheets/jquery-ui/theme.css.erb +456 -0
  174. data/app/assets/stylesheets/jquery-ui/tooltip.css +22 -0
  175. data/app/assets/stylesheets/jquery-ui.css +1 -0
  176. data/lib/jquery/ui/rails/engine.rb +8 -0
  177. data/lib/jquery/ui/rails/version.rb +8 -0
  178. data/lib/jquery/ui/rails.rb +2 -0
  179. data/lib/jquery-ui-rails.rb +1 -0
  180. metadata +250 -0
@@ -0,0 +1,508 @@
1
+ //= require jquery-ui/widgets/draggable
2
+ //= require jquery-ui/widgets/mouse
3
+ //= require jquery-ui/version
4
+ //= require jquery-ui/widget
5
+
6
+ /*!
7
+ * jQuery UI Droppable 1.13.1
8
+ * http://jqueryui.com
9
+ *
10
+ * Copyright jQuery Foundation and other contributors
11
+ * Released under the MIT license.
12
+ * http://jquery.org/license
13
+ */
14
+
15
+ //>>label: Droppable
16
+ //>>group: Interactions
17
+ //>>description: Enables drop targets for draggable elements.
18
+ //>>docs: http://api.jqueryui.com/droppable/
19
+ //>>demos: http://jqueryui.com/droppable/
20
+
21
+ ( function( factory ) {
22
+ "use strict";
23
+
24
+ if ( typeof define === "function" && define.amd ) {
25
+
26
+ // AMD. Register as an anonymous module.
27
+ define( [
28
+ "jquery",
29
+ "./draggable",
30
+ "./mouse",
31
+ "../version",
32
+ "../widget"
33
+ ], factory );
34
+ } else {
35
+
36
+ // Browser globals
37
+ factory( jQuery );
38
+ }
39
+ } )( function( $ ) {
40
+ "use strict";
41
+
42
+ $.widget( "ui.droppable", {
43
+ version: "1.13.1",
44
+ widgetEventPrefix: "drop",
45
+ options: {
46
+ accept: "*",
47
+ addClasses: true,
48
+ greedy: false,
49
+ scope: "default",
50
+ tolerance: "intersect",
51
+
52
+ // Callbacks
53
+ activate: null,
54
+ deactivate: null,
55
+ drop: null,
56
+ out: null,
57
+ over: null
58
+ },
59
+ _create: function() {
60
+
61
+ var proportions,
62
+ o = this.options,
63
+ accept = o.accept;
64
+
65
+ this.isover = false;
66
+ this.isout = true;
67
+
68
+ this.accept = typeof accept === "function" ? accept : function( d ) {
69
+ return d.is( accept );
70
+ };
71
+
72
+ this.proportions = function( /* valueToWrite */ ) {
73
+ if ( arguments.length ) {
74
+
75
+ // Store the droppable's proportions
76
+ proportions = arguments[ 0 ];
77
+ } else {
78
+
79
+ // Retrieve or derive the droppable's proportions
80
+ return proportions ?
81
+ proportions :
82
+ proportions = {
83
+ width: this.element[ 0 ].offsetWidth,
84
+ height: this.element[ 0 ].offsetHeight
85
+ };
86
+ }
87
+ };
88
+
89
+ this._addToManager( o.scope );
90
+
91
+ if ( o.addClasses ) {
92
+ this._addClass( "ui-droppable" );
93
+ }
94
+
95
+ },
96
+
97
+ _addToManager: function( scope ) {
98
+
99
+ // Add the reference and positions to the manager
100
+ $.ui.ddmanager.droppables[ scope ] = $.ui.ddmanager.droppables[ scope ] || [];
101
+ $.ui.ddmanager.droppables[ scope ].push( this );
102
+ },
103
+
104
+ _splice: function( drop ) {
105
+ var i = 0;
106
+ for ( ; i < drop.length; i++ ) {
107
+ if ( drop[ i ] === this ) {
108
+ drop.splice( i, 1 );
109
+ }
110
+ }
111
+ },
112
+
113
+ _destroy: function() {
114
+ var drop = $.ui.ddmanager.droppables[ this.options.scope ];
115
+
116
+ this._splice( drop );
117
+ },
118
+
119
+ _setOption: function( key, value ) {
120
+
121
+ if ( key === "accept" ) {
122
+ this.accept = typeof value === "function" ? value : function( d ) {
123
+ return d.is( value );
124
+ };
125
+ } else if ( key === "scope" ) {
126
+ var drop = $.ui.ddmanager.droppables[ this.options.scope ];
127
+
128
+ this._splice( drop );
129
+ this._addToManager( value );
130
+ }
131
+
132
+ this._super( key, value );
133
+ },
134
+
135
+ _activate: function( event ) {
136
+ var draggable = $.ui.ddmanager.current;
137
+
138
+ this._addActiveClass();
139
+ if ( draggable ) {
140
+ this._trigger( "activate", event, this.ui( draggable ) );
141
+ }
142
+ },
143
+
144
+ _deactivate: function( event ) {
145
+ var draggable = $.ui.ddmanager.current;
146
+
147
+ this._removeActiveClass();
148
+ if ( draggable ) {
149
+ this._trigger( "deactivate", event, this.ui( draggable ) );
150
+ }
151
+ },
152
+
153
+ _over: function( event ) {
154
+
155
+ var draggable = $.ui.ddmanager.current;
156
+
157
+ // Bail if draggable and droppable are same element
158
+ if ( !draggable || ( draggable.currentItem ||
159
+ draggable.element )[ 0 ] === this.element[ 0 ] ) {
160
+ return;
161
+ }
162
+
163
+ if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem ||
164
+ draggable.element ) ) ) {
165
+ this._addHoverClass();
166
+ this._trigger( "over", event, this.ui( draggable ) );
167
+ }
168
+
169
+ },
170
+
171
+ _out: function( event ) {
172
+
173
+ var draggable = $.ui.ddmanager.current;
174
+
175
+ // Bail if draggable and droppable are same element
176
+ if ( !draggable || ( draggable.currentItem ||
177
+ draggable.element )[ 0 ] === this.element[ 0 ] ) {
178
+ return;
179
+ }
180
+
181
+ if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem ||
182
+ draggable.element ) ) ) {
183
+ this._removeHoverClass();
184
+ this._trigger( "out", event, this.ui( draggable ) );
185
+ }
186
+
187
+ },
188
+
189
+ _drop: function( event, custom ) {
190
+
191
+ var draggable = custom || $.ui.ddmanager.current,
192
+ childrenIntersection = false;
193
+
194
+ // Bail if draggable and droppable are same element
195
+ if ( !draggable || ( draggable.currentItem ||
196
+ draggable.element )[ 0 ] === this.element[ 0 ] ) {
197
+ return false;
198
+ }
199
+
200
+ this.element
201
+ .find( ":data(ui-droppable)" )
202
+ .not( ".ui-draggable-dragging" )
203
+ .each( function() {
204
+ var inst = $( this ).droppable( "instance" );
205
+ if (
206
+ inst.options.greedy &&
207
+ !inst.options.disabled &&
208
+ inst.options.scope === draggable.options.scope &&
209
+ inst.accept.call(
210
+ inst.element[ 0 ], ( draggable.currentItem || draggable.element )
211
+ ) &&
212
+ $.ui.intersect(
213
+ draggable,
214
+ $.extend( inst, { offset: inst.element.offset() } ),
215
+ inst.options.tolerance, event
216
+ )
217
+ ) {
218
+ childrenIntersection = true;
219
+ return false;
220
+ }
221
+ } );
222
+ if ( childrenIntersection ) {
223
+ return false;
224
+ }
225
+
226
+ if ( this.accept.call( this.element[ 0 ],
227
+ ( draggable.currentItem || draggable.element ) ) ) {
228
+ this._removeActiveClass();
229
+ this._removeHoverClass();
230
+
231
+ this._trigger( "drop", event, this.ui( draggable ) );
232
+ return this.element;
233
+ }
234
+
235
+ return false;
236
+
237
+ },
238
+
239
+ ui: function( c ) {
240
+ return {
241
+ draggable: ( c.currentItem || c.element ),
242
+ helper: c.helper,
243
+ position: c.position,
244
+ offset: c.positionAbs
245
+ };
246
+ },
247
+
248
+ // Extension points just to make backcompat sane and avoid duplicating logic
249
+ // TODO: Remove in 1.14 along with call to it below
250
+ _addHoverClass: function() {
251
+ this._addClass( "ui-droppable-hover" );
252
+ },
253
+
254
+ _removeHoverClass: function() {
255
+ this._removeClass( "ui-droppable-hover" );
256
+ },
257
+
258
+ _addActiveClass: function() {
259
+ this._addClass( "ui-droppable-active" );
260
+ },
261
+
262
+ _removeActiveClass: function() {
263
+ this._removeClass( "ui-droppable-active" );
264
+ }
265
+ } );
266
+
267
+ $.ui.intersect = ( function() {
268
+ function isOverAxis( x, reference, size ) {
269
+ return ( x >= reference ) && ( x < ( reference + size ) );
270
+ }
271
+
272
+ return function( draggable, droppable, toleranceMode, event ) {
273
+
274
+ if ( !droppable.offset ) {
275
+ return false;
276
+ }
277
+
278
+ var x1 = ( draggable.positionAbs ||
279
+ draggable.position.absolute ).left + draggable.margins.left,
280
+ y1 = ( draggable.positionAbs ||
281
+ draggable.position.absolute ).top + draggable.margins.top,
282
+ x2 = x1 + draggable.helperProportions.width,
283
+ y2 = y1 + draggable.helperProportions.height,
284
+ l = droppable.offset.left,
285
+ t = droppable.offset.top,
286
+ r = l + droppable.proportions().width,
287
+ b = t + droppable.proportions().height;
288
+
289
+ switch ( toleranceMode ) {
290
+ case "fit":
291
+ return ( l <= x1 && x2 <= r && t <= y1 && y2 <= b );
292
+ case "intersect":
293
+ return ( l < x1 + ( draggable.helperProportions.width / 2 ) && // Right Half
294
+ x2 - ( draggable.helperProportions.width / 2 ) < r && // Left Half
295
+ t < y1 + ( draggable.helperProportions.height / 2 ) && // Bottom Half
296
+ y2 - ( draggable.helperProportions.height / 2 ) < b ); // Top Half
297
+ case "pointer":
298
+ return isOverAxis( event.pageY, t, droppable.proportions().height ) &&
299
+ isOverAxis( event.pageX, l, droppable.proportions().width );
300
+ case "touch":
301
+ return (
302
+ ( y1 >= t && y1 <= b ) || // Top edge touching
303
+ ( y2 >= t && y2 <= b ) || // Bottom edge touching
304
+ ( y1 < t && y2 > b ) // Surrounded vertically
305
+ ) && (
306
+ ( x1 >= l && x1 <= r ) || // Left edge touching
307
+ ( x2 >= l && x2 <= r ) || // Right edge touching
308
+ ( x1 < l && x2 > r ) // Surrounded horizontally
309
+ );
310
+ default:
311
+ return false;
312
+ }
313
+ };
314
+ } )();
315
+
316
+ /*
317
+ This manager tracks offsets of draggables and droppables
318
+ */
319
+ $.ui.ddmanager = {
320
+ current: null,
321
+ droppables: { "default": [] },
322
+ prepareOffsets: function( t, event ) {
323
+
324
+ var i, j,
325
+ m = $.ui.ddmanager.droppables[ t.options.scope ] || [],
326
+ type = event ? event.type : null, // workaround for #2317
327
+ list = ( t.currentItem || t.element ).find( ":data(ui-droppable)" ).addBack();
328
+
329
+ droppablesLoop: for ( i = 0; i < m.length; i++ ) {
330
+
331
+ // No disabled and non-accepted
332
+ if ( m[ i ].options.disabled || ( t && !m[ i ].accept.call( m[ i ].element[ 0 ],
333
+ ( t.currentItem || t.element ) ) ) ) {
334
+ continue;
335
+ }
336
+
337
+ // Filter out elements in the current dragged item
338
+ for ( j = 0; j < list.length; j++ ) {
339
+ if ( list[ j ] === m[ i ].element[ 0 ] ) {
340
+ m[ i ].proportions().height = 0;
341
+ continue droppablesLoop;
342
+ }
343
+ }
344
+
345
+ m[ i ].visible = m[ i ].element.css( "display" ) !== "none";
346
+ if ( !m[ i ].visible ) {
347
+ continue;
348
+ }
349
+
350
+ // Activate the droppable if used directly from draggables
351
+ if ( type === "mousedown" ) {
352
+ m[ i ]._activate.call( m[ i ], event );
353
+ }
354
+
355
+ m[ i ].offset = m[ i ].element.offset();
356
+ m[ i ].proportions( {
357
+ width: m[ i ].element[ 0 ].offsetWidth,
358
+ height: m[ i ].element[ 0 ].offsetHeight
359
+ } );
360
+
361
+ }
362
+
363
+ },
364
+ drop: function( draggable, event ) {
365
+
366
+ var dropped = false;
367
+
368
+ // Create a copy of the droppables in case the list changes during the drop (#9116)
369
+ $.each( ( $.ui.ddmanager.droppables[ draggable.options.scope ] || [] ).slice(), function() {
370
+
371
+ if ( !this.options ) {
372
+ return;
373
+ }
374
+ if ( !this.options.disabled && this.visible &&
375
+ $.ui.intersect( draggable, this, this.options.tolerance, event ) ) {
376
+ dropped = this._drop.call( this, event ) || dropped;
377
+ }
378
+
379
+ if ( !this.options.disabled && this.visible && this.accept.call( this.element[ 0 ],
380
+ ( draggable.currentItem || draggable.element ) ) ) {
381
+ this.isout = true;
382
+ this.isover = false;
383
+ this._deactivate.call( this, event );
384
+ }
385
+
386
+ } );
387
+ return dropped;
388
+
389
+ },
390
+ dragStart: function( draggable, event ) {
391
+
392
+ // Listen for scrolling so that if the dragging causes scrolling the position of the
393
+ // droppables can be recalculated (see #5003)
394
+ draggable.element.parentsUntil( "body" ).on( "scroll.droppable", function() {
395
+ if ( !draggable.options.refreshPositions ) {
396
+ $.ui.ddmanager.prepareOffsets( draggable, event );
397
+ }
398
+ } );
399
+ },
400
+ drag: function( draggable, event ) {
401
+
402
+ // If you have a highly dynamic page, you might try this option. It renders positions
403
+ // every time you move the mouse.
404
+ if ( draggable.options.refreshPositions ) {
405
+ $.ui.ddmanager.prepareOffsets( draggable, event );
406
+ }
407
+
408
+ // Run through all droppables and check their positions based on specific tolerance options
409
+ $.each( $.ui.ddmanager.droppables[ draggable.options.scope ] || [], function() {
410
+
411
+ if ( this.options.disabled || this.greedyChild || !this.visible ) {
412
+ return;
413
+ }
414
+
415
+ var parentInstance, scope, parent,
416
+ intersects = $.ui.intersect( draggable, this, this.options.tolerance, event ),
417
+ c = !intersects && this.isover ?
418
+ "isout" :
419
+ ( intersects && !this.isover ? "isover" : null );
420
+ if ( !c ) {
421
+ return;
422
+ }
423
+
424
+ if ( this.options.greedy ) {
425
+
426
+ // find droppable parents with same scope
427
+ scope = this.options.scope;
428
+ parent = this.element.parents( ":data(ui-droppable)" ).filter( function() {
429
+ return $( this ).droppable( "instance" ).options.scope === scope;
430
+ } );
431
+
432
+ if ( parent.length ) {
433
+ parentInstance = $( parent[ 0 ] ).droppable( "instance" );
434
+ parentInstance.greedyChild = ( c === "isover" );
435
+ }
436
+ }
437
+
438
+ // We just moved into a greedy child
439
+ if ( parentInstance && c === "isover" ) {
440
+ parentInstance.isover = false;
441
+ parentInstance.isout = true;
442
+ parentInstance._out.call( parentInstance, event );
443
+ }
444
+
445
+ this[ c ] = true;
446
+ this[ c === "isout" ? "isover" : "isout" ] = false;
447
+ this[ c === "isover" ? "_over" : "_out" ].call( this, event );
448
+
449
+ // We just moved out of a greedy child
450
+ if ( parentInstance && c === "isout" ) {
451
+ parentInstance.isout = false;
452
+ parentInstance.isover = true;
453
+ parentInstance._over.call( parentInstance, event );
454
+ }
455
+ } );
456
+
457
+ },
458
+ dragStop: function( draggable, event ) {
459
+ draggable.element.parentsUntil( "body" ).off( "scroll.droppable" );
460
+
461
+ // Call prepareOffsets one final time since IE does not fire return scroll events when
462
+ // overflow was caused by drag (see #5003)
463
+ if ( !draggable.options.refreshPositions ) {
464
+ $.ui.ddmanager.prepareOffsets( draggable, event );
465
+ }
466
+ }
467
+ };
468
+
469
+ // DEPRECATED
470
+ // TODO: switch return back to widget declaration at top of file when this is removed
471
+ if ( $.uiBackCompat !== false ) {
472
+
473
+ // Backcompat for activeClass and hoverClass options
474
+ $.widget( "ui.droppable", $.ui.droppable, {
475
+ options: {
476
+ hoverClass: false,
477
+ activeClass: false
478
+ },
479
+ _addActiveClass: function() {
480
+ this._super();
481
+ if ( this.options.activeClass ) {
482
+ this.element.addClass( this.options.activeClass );
483
+ }
484
+ },
485
+ _removeActiveClass: function() {
486
+ this._super();
487
+ if ( this.options.activeClass ) {
488
+ this.element.removeClass( this.options.activeClass );
489
+ }
490
+ },
491
+ _addHoverClass: function() {
492
+ this._super();
493
+ if ( this.options.hoverClass ) {
494
+ this.element.addClass( this.options.hoverClass );
495
+ }
496
+ },
497
+ _removeHoverClass: function() {
498
+ this._super();
499
+ if ( this.options.hoverClass ) {
500
+ this.element.removeClass( this.options.hoverClass );
501
+ }
502
+ }
503
+ } );
504
+ }
505
+
506
+ return $.ui.droppable;
507
+
508
+ } );