jquery-ui-rails 0.0.1

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 (137) hide show
  1. data/.gitmodules +3 -0
  2. data/Gemfile +3 -0
  3. data/README.md +1 -0
  4. data/Rakefile +77 -0
  5. data/dependencies.js +1 -0
  6. data/jquery-ui-rails.gemspec +23 -0
  7. data/lib/jquery-ui-rails.rb +1 -0
  8. data/lib/jquery/ui/rails.rb +2 -0
  9. data/lib/jquery/ui/rails/engine.rb +8 -0
  10. data/lib/jquery/ui/rails/version.rb +7 -0
  11. data/vendor/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  12. data/vendor/assets/images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png +0 -0
  13. data/vendor/assets/images/jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  14. data/vendor/assets/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png +0 -0
  15. data/vendor/assets/images/jquery-ui/ui-bg_glass_75_dadada_1x400.png +0 -0
  16. data/vendor/assets/images/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  17. data/vendor/assets/images/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  18. data/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  19. data/vendor/assets/images/jquery-ui/ui-icons_222222_256x240.png +0 -0
  20. data/vendor/assets/images/jquery-ui/ui-icons_2e83ff_256x240.png +0 -0
  21. data/vendor/assets/images/jquery-ui/ui-icons_454545_256x240.png +0 -0
  22. data/vendor/assets/images/jquery-ui/ui-icons_888888_256x240.png +0 -0
  23. data/vendor/assets/images/jquery-ui/ui-icons_cd0a0a_256x240.png +0 -0
  24. data/vendor/assets/javascripts/jquery-ui.js +31 -0
  25. data/vendor/assets/javascripts/jquery-uix.js +31 -0
  26. data/vendor/assets/javascripts/jquery.effects.blind.js +52 -0
  27. data/vendor/assets/javascripts/jquery.effects.bounce.js +81 -0
  28. data/vendor/assets/javascripts/jquery.effects.clip.js +57 -0
  29. data/vendor/assets/javascripts/jquery.effects.core.js +764 -0
  30. data/vendor/assets/javascripts/jquery.effects.drop.js +53 -0
  31. data/vendor/assets/javascripts/jquery.effects.explode.js +82 -0
  32. data/vendor/assets/javascripts/jquery.effects.fade.js +35 -0
  33. data/vendor/assets/javascripts/jquery.effects.fold.js +59 -0
  34. data/vendor/assets/javascripts/jquery.effects.highlight.js +53 -0
  35. data/vendor/assets/javascripts/jquery.effects.pulsate.js +54 -0
  36. data/vendor/assets/javascripts/jquery.effects.scale.js +181 -0
  37. data/vendor/assets/javascripts/jquery.effects.shake.js +60 -0
  38. data/vendor/assets/javascripts/jquery.effects.slide.js +53 -0
  39. data/vendor/assets/javascripts/jquery.effects.transfer.js +48 -0
  40. data/vendor/assets/javascripts/jquery.ui.accordion.js +615 -0
  41. data/vendor/assets/javascripts/jquery.ui.autocomplete.js +627 -0
  42. data/vendor/assets/javascripts/jquery.ui.button.js +420 -0
  43. data/vendor/assets/javascripts/jquery.ui.core.js +315 -0
  44. data/vendor/assets/javascripts/jquery.ui.datepicker-af.js +26 -0
  45. data/vendor/assets/javascripts/jquery.ui.datepicker-ar-DZ.js +26 -0
  46. data/vendor/assets/javascripts/jquery.ui.datepicker-ar.js +26 -0
  47. data/vendor/assets/javascripts/jquery.ui.datepicker-az.js +26 -0
  48. data/vendor/assets/javascripts/jquery.ui.datepicker-bg.js +27 -0
  49. data/vendor/assets/javascripts/jquery.ui.datepicker-bs.js +26 -0
  50. data/vendor/assets/javascripts/jquery.ui.datepicker-ca.js +26 -0
  51. data/vendor/assets/javascripts/jquery.ui.datepicker-cs.js +26 -0
  52. data/vendor/assets/javascripts/jquery.ui.datepicker-cy-GB.js +26 -0
  53. data/vendor/assets/javascripts/jquery.ui.datepicker-da.js +26 -0
  54. data/vendor/assets/javascripts/jquery.ui.datepicker-de.js +26 -0
  55. data/vendor/assets/javascripts/jquery.ui.datepicker-el.js +26 -0
  56. data/vendor/assets/javascripts/jquery.ui.datepicker-en-AU.js +26 -0
  57. data/vendor/assets/javascripts/jquery.ui.datepicker-en-GB.js +26 -0
  58. data/vendor/assets/javascripts/jquery.ui.datepicker-en-NZ.js +26 -0
  59. data/vendor/assets/javascripts/jquery.ui.datepicker-eo.js +26 -0
  60. data/vendor/assets/javascripts/jquery.ui.datepicker-es.js +26 -0
  61. data/vendor/assets/javascripts/jquery.ui.datepicker-et.js +26 -0
  62. data/vendor/assets/javascripts/jquery.ui.datepicker-eu.js +26 -0
  63. data/vendor/assets/javascripts/jquery.ui.datepicker-fa.js +26 -0
  64. data/vendor/assets/javascripts/jquery.ui.datepicker-fi.js +26 -0
  65. data/vendor/assets/javascripts/jquery.ui.datepicker-fo.js +26 -0
  66. data/vendor/assets/javascripts/jquery.ui.datepicker-fr-CH.js +26 -0
  67. data/vendor/assets/javascripts/jquery.ui.datepicker-fr.js +28 -0
  68. data/vendor/assets/javascripts/jquery.ui.datepicker-gl.js +26 -0
  69. data/vendor/assets/javascripts/jquery.ui.datepicker-he.js +26 -0
  70. data/vendor/assets/javascripts/jquery.ui.datepicker-hr.js +26 -0
  71. data/vendor/assets/javascripts/jquery.ui.datepicker-hu.js +26 -0
  72. data/vendor/assets/javascripts/jquery.ui.datepicker-hy.js +26 -0
  73. data/vendor/assets/javascripts/jquery.ui.datepicker-id.js +26 -0
  74. data/vendor/assets/javascripts/jquery.ui.datepicker-is.js +26 -0
  75. data/vendor/assets/javascripts/jquery.ui.datepicker-it.js +26 -0
  76. data/vendor/assets/javascripts/jquery.ui.datepicker-ja.js +26 -0
  77. data/vendor/assets/javascripts/jquery.ui.datepicker-kk.js +26 -0
  78. data/vendor/assets/javascripts/jquery.ui.datepicker-ko.js +26 -0
  79. data/vendor/assets/javascripts/jquery.ui.datepicker-lb.js +26 -0
  80. data/vendor/assets/javascripts/jquery.ui.datepicker-lt.js +26 -0
  81. data/vendor/assets/javascripts/jquery.ui.datepicker-lv.js +26 -0
  82. data/vendor/assets/javascripts/jquery.ui.datepicker-mk.js +26 -0
  83. data/vendor/assets/javascripts/jquery.ui.datepicker-ml.js +26 -0
  84. data/vendor/assets/javascripts/jquery.ui.datepicker-ms.js +26 -0
  85. data/vendor/assets/javascripts/jquery.ui.datepicker-nl-BE.js +26 -0
  86. data/vendor/assets/javascripts/jquery.ui.datepicker-nl.js +26 -0
  87. data/vendor/assets/javascripts/jquery.ui.datepicker-no.js +26 -0
  88. data/vendor/assets/javascripts/jquery.ui.datepicker-pl.js +26 -0
  89. data/vendor/assets/javascripts/jquery.ui.datepicker-pt-BR.js +26 -0
  90. data/vendor/assets/javascripts/jquery.ui.datepicker-pt.js +25 -0
  91. data/vendor/assets/javascripts/jquery.ui.datepicker-rm.js +24 -0
  92. data/vendor/assets/javascripts/jquery.ui.datepicker-ro.js +29 -0
  93. data/vendor/assets/javascripts/jquery.ui.datepicker-ru.js +26 -0
  94. data/vendor/assets/javascripts/jquery.ui.datepicker-sk.js +26 -0
  95. data/vendor/assets/javascripts/jquery.ui.datepicker-sl.js +27 -0
  96. data/vendor/assets/javascripts/jquery.ui.datepicker-sq.js +26 -0
  97. data/vendor/assets/javascripts/jquery.ui.datepicker-sr-SR.js +26 -0
  98. data/vendor/assets/javascripts/jquery.ui.datepicker-sr.js +26 -0
  99. data/vendor/assets/javascripts/jquery.ui.datepicker-sv.js +26 -0
  100. data/vendor/assets/javascripts/jquery.ui.datepicker-ta.js +26 -0
  101. data/vendor/assets/javascripts/jquery.ui.datepicker-th.js +26 -0
  102. data/vendor/assets/javascripts/jquery.ui.datepicker-tj.js +26 -0
  103. data/vendor/assets/javascripts/jquery.ui.datepicker-tr.js +26 -0
  104. data/vendor/assets/javascripts/jquery.ui.datepicker-uk.js +27 -0
  105. data/vendor/assets/javascripts/jquery.ui.datepicker-vi.js +26 -0
  106. data/vendor/assets/javascripts/jquery.ui.datepicker-zh-CN.js +26 -0
  107. data/vendor/assets/javascripts/jquery.ui.datepicker-zh-HK.js +26 -0
  108. data/vendor/assets/javascripts/jquery.ui.datepicker-zh-TW.js +26 -0
  109. data/vendor/assets/javascripts/jquery.ui.datepicker.js +1826 -0
  110. data/vendor/assets/javascripts/jquery.ui.dialog.js +883 -0
  111. data/vendor/assets/javascripts/jquery.ui.draggable.js +830 -0
  112. data/vendor/assets/javascripts/jquery.ui.droppable.js +302 -0
  113. data/vendor/assets/javascripts/jquery.ui.mouse.js +166 -0
  114. data/vendor/assets/javascripts/jquery.ui.position.js +299 -0
  115. data/vendor/assets/javascripts/jquery.ui.progressbar.js +113 -0
  116. data/vendor/assets/javascripts/jquery.ui.resizable.js +847 -0
  117. data/vendor/assets/javascripts/jquery.ui.selectable.js +272 -0
  118. data/vendor/assets/javascripts/jquery.ui.slider.js +671 -0
  119. data/vendor/assets/javascripts/jquery.ui.sortable.js +1081 -0
  120. data/vendor/assets/javascripts/jquery.ui.tabs.js +762 -0
  121. data/vendor/assets/javascripts/jquery.ui.widget.js +273 -0
  122. data/vendor/assets/stylesheets/jquery-ui.js +1 -0
  123. data/vendor/assets/stylesheets/jquery.ui.accordion.css +19 -0
  124. data/vendor/assets/stylesheets/jquery.ui.all.css +13 -0
  125. data/vendor/assets/stylesheets/jquery.ui.autocomplete.css +53 -0
  126. data/vendor/assets/stylesheets/jquery.ui.base.css +23 -0
  127. data/vendor/assets/stylesheets/jquery.ui.button.css +38 -0
  128. data/vendor/assets/stylesheets/jquery.ui.core.css +38 -0
  129. data/vendor/assets/stylesheets/jquery.ui.datepicker.css +68 -0
  130. data/vendor/assets/stylesheets/jquery.ui.dialog.css +21 -0
  131. data/vendor/assets/stylesheets/jquery.ui.progressbar.css +11 -0
  132. data/vendor/assets/stylesheets/jquery.ui.resizable.css +20 -0
  133. data/vendor/assets/stylesheets/jquery.ui.selectable.css +10 -0
  134. data/vendor/assets/stylesheets/jquery.ui.slider.css +24 -0
  135. data/vendor/assets/stylesheets/jquery.ui.tabs.css +18 -0
  136. data/vendor/assets/stylesheets/jquery.ui.theme.css +247 -0
  137. metadata +216 -0
@@ -0,0 +1,299 @@
1
+ //= require jquery
2
+ /*
3
+ * jQuery UI Position 1.8.17
4
+ *
5
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
6
+ * Dual licensed under the MIT or GPL Version 2 licenses.
7
+ * http://jquery.org/license
8
+ *
9
+ * http://docs.jquery.com/UI/Position
10
+ */
11
+ (function( $, undefined ) {
12
+
13
+ $.ui = $.ui || {};
14
+
15
+ var horizontalPositions = /left|center|right/,
16
+ verticalPositions = /top|center|bottom/,
17
+ center = "center",
18
+ support = {},
19
+ _position = $.fn.position,
20
+ _offset = $.fn.offset;
21
+
22
+ $.fn.position = function( options ) {
23
+ if ( !options || !options.of ) {
24
+ return _position.apply( this, arguments );
25
+ }
26
+
27
+ // make a copy, we don't want to modify arguments
28
+ options = $.extend( {}, options );
29
+
30
+ var target = $( options.of ),
31
+ targetElem = target[0],
32
+ collision = ( options.collision || "flip" ).split( " " ),
33
+ offset = options.offset ? options.offset.split( " " ) : [ 0, 0 ],
34
+ targetWidth,
35
+ targetHeight,
36
+ basePosition;
37
+
38
+ if ( targetElem.nodeType === 9 ) {
39
+ targetWidth = target.width();
40
+ targetHeight = target.height();
41
+ basePosition = { top: 0, left: 0 };
42
+ // TODO: use $.isWindow() in 1.9
43
+ } else if ( targetElem.setTimeout ) {
44
+ targetWidth = target.width();
45
+ targetHeight = target.height();
46
+ basePosition = { top: target.scrollTop(), left: target.scrollLeft() };
47
+ } else if ( targetElem.preventDefault ) {
48
+ // force left top to allow flipping
49
+ options.at = "left top";
50
+ targetWidth = targetHeight = 0;
51
+ basePosition = { top: options.of.pageY, left: options.of.pageX };
52
+ } else {
53
+ targetWidth = target.outerWidth();
54
+ targetHeight = target.outerHeight();
55
+ basePosition = target.offset();
56
+ }
57
+
58
+ // force my and at to have valid horizontal and veritcal positions
59
+ // if a value is missing or invalid, it will be converted to center
60
+ $.each( [ "my", "at" ], function() {
61
+ var pos = ( options[this] || "" ).split( " " );
62
+ if ( pos.length === 1) {
63
+ pos = horizontalPositions.test( pos[0] ) ?
64
+ pos.concat( [center] ) :
65
+ verticalPositions.test( pos[0] ) ?
66
+ [ center ].concat( pos ) :
67
+ [ center, center ];
68
+ }
69
+ pos[ 0 ] = horizontalPositions.test( pos[0] ) ? pos[ 0 ] : center;
70
+ pos[ 1 ] = verticalPositions.test( pos[1] ) ? pos[ 1 ] : center;
71
+ options[ this ] = pos;
72
+ });
73
+
74
+ // normalize collision option
75
+ if ( collision.length === 1 ) {
76
+ collision[ 1 ] = collision[ 0 ];
77
+ }
78
+
79
+ // normalize offset option
80
+ offset[ 0 ] = parseInt( offset[0], 10 ) || 0;
81
+ if ( offset.length === 1 ) {
82
+ offset[ 1 ] = offset[ 0 ];
83
+ }
84
+ offset[ 1 ] = parseInt( offset[1], 10 ) || 0;
85
+
86
+ if ( options.at[0] === "right" ) {
87
+ basePosition.left += targetWidth;
88
+ } else if ( options.at[0] === center ) {
89
+ basePosition.left += targetWidth / 2;
90
+ }
91
+
92
+ if ( options.at[1] === "bottom" ) {
93
+ basePosition.top += targetHeight;
94
+ } else if ( options.at[1] === center ) {
95
+ basePosition.top += targetHeight / 2;
96
+ }
97
+
98
+ basePosition.left += offset[ 0 ];
99
+ basePosition.top += offset[ 1 ];
100
+
101
+ return this.each(function() {
102
+ var elem = $( this ),
103
+ elemWidth = elem.outerWidth(),
104
+ elemHeight = elem.outerHeight(),
105
+ marginLeft = parseInt( $.curCSS( this, "marginLeft", true ) ) || 0,
106
+ marginTop = parseInt( $.curCSS( this, "marginTop", true ) ) || 0,
107
+ collisionWidth = elemWidth + marginLeft +
108
+ ( parseInt( $.curCSS( this, "marginRight", true ) ) || 0 ),
109
+ collisionHeight = elemHeight + marginTop +
110
+ ( parseInt( $.curCSS( this, "marginBottom", true ) ) || 0 ),
111
+ position = $.extend( {}, basePosition ),
112
+ collisionPosition;
113
+
114
+ if ( options.my[0] === "right" ) {
115
+ position.left -= elemWidth;
116
+ } else if ( options.my[0] === center ) {
117
+ position.left -= elemWidth / 2;
118
+ }
119
+
120
+ if ( options.my[1] === "bottom" ) {
121
+ position.top -= elemHeight;
122
+ } else if ( options.my[1] === center ) {
123
+ position.top -= elemHeight / 2;
124
+ }
125
+
126
+ // prevent fractions if jQuery version doesn't support them (see #5280)
127
+ if ( !support.fractions ) {
128
+ position.left = Math.round( position.left );
129
+ position.top = Math.round( position.top );
130
+ }
131
+
132
+ collisionPosition = {
133
+ left: position.left - marginLeft,
134
+ top: position.top - marginTop
135
+ };
136
+
137
+ $.each( [ "left", "top" ], function( i, dir ) {
138
+ if ( $.ui.position[ collision[i] ] ) {
139
+ $.ui.position[ collision[i] ][ dir ]( position, {
140
+ targetWidth: targetWidth,
141
+ targetHeight: targetHeight,
142
+ elemWidth: elemWidth,
143
+ elemHeight: elemHeight,
144
+ collisionPosition: collisionPosition,
145
+ collisionWidth: collisionWidth,
146
+ collisionHeight: collisionHeight,
147
+ offset: offset,
148
+ my: options.my,
149
+ at: options.at
150
+ });
151
+ }
152
+ });
153
+
154
+ if ( $.fn.bgiframe ) {
155
+ elem.bgiframe();
156
+ }
157
+ elem.offset( $.extend( position, { using: options.using } ) );
158
+ });
159
+ };
160
+
161
+ $.ui.position = {
162
+ fit: {
163
+ left: function( position, data ) {
164
+ var win = $( window ),
165
+ over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft();
166
+ position.left = over > 0 ? position.left - over : Math.max( position.left - data.collisionPosition.left, position.left );
167
+ },
168
+ top: function( position, data ) {
169
+ var win = $( window ),
170
+ over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop();
171
+ position.top = over > 0 ? position.top - over : Math.max( position.top - data.collisionPosition.top, position.top );
172
+ }
173
+ },
174
+
175
+ flip: {
176
+ left: function( position, data ) {
177
+ if ( data.at[0] === center ) {
178
+ return;
179
+ }
180
+ var win = $( window ),
181
+ over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft(),
182
+ myOffset = data.my[ 0 ] === "left" ?
183
+ -data.elemWidth :
184
+ data.my[ 0 ] === "right" ?
185
+ data.elemWidth :
186
+ 0,
187
+ atOffset = data.at[ 0 ] === "left" ?
188
+ data.targetWidth :
189
+ -data.targetWidth,
190
+ offset = -2 * data.offset[ 0 ];
191
+ position.left += data.collisionPosition.left < 0 ?
192
+ myOffset + atOffset + offset :
193
+ over > 0 ?
194
+ myOffset + atOffset + offset :
195
+ 0;
196
+ },
197
+ top: function( position, data ) {
198
+ if ( data.at[1] === center ) {
199
+ return;
200
+ }
201
+ var win = $( window ),
202
+ over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop(),
203
+ myOffset = data.my[ 1 ] === "top" ?
204
+ -data.elemHeight :
205
+ data.my[ 1 ] === "bottom" ?
206
+ data.elemHeight :
207
+ 0,
208
+ atOffset = data.at[ 1 ] === "top" ?
209
+ data.targetHeight :
210
+ -data.targetHeight,
211
+ offset = -2 * data.offset[ 1 ];
212
+ position.top += data.collisionPosition.top < 0 ?
213
+ myOffset + atOffset + offset :
214
+ over > 0 ?
215
+ myOffset + atOffset + offset :
216
+ 0;
217
+ }
218
+ }
219
+ };
220
+
221
+ // offset setter from jQuery 1.4
222
+ if ( !$.offset.setOffset ) {
223
+ $.offset.setOffset = function( elem, options ) {
224
+ // set position first, in-case top/left are set even on static elem
225
+ if ( /static/.test( $.curCSS( elem, "position" ) ) ) {
226
+ elem.style.position = "relative";
227
+ }
228
+ var curElem = $( elem ),
229
+ curOffset = curElem.offset(),
230
+ curTop = parseInt( $.curCSS( elem, "top", true ), 10 ) || 0,
231
+ curLeft = parseInt( $.curCSS( elem, "left", true ), 10) || 0,
232
+ props = {
233
+ top: (options.top - curOffset.top) + curTop,
234
+ left: (options.left - curOffset.left) + curLeft
235
+ };
236
+
237
+ if ( 'using' in options ) {
238
+ options.using.call( elem, props );
239
+ } else {
240
+ curElem.css( props );
241
+ }
242
+ };
243
+
244
+ $.fn.offset = function( options ) {
245
+ var elem = this[ 0 ];
246
+ if ( !elem || !elem.ownerDocument ) { return null; }
247
+ if ( options ) {
248
+ return this.each(function() {
249
+ $.offset.setOffset( this, options );
250
+ });
251
+ }
252
+ return _offset.call( this );
253
+ };
254
+ }
255
+
256
+ // fraction support test (older versions of jQuery don't support fractions)
257
+ (function () {
258
+ var body = document.getElementsByTagName( "body" )[ 0 ],
259
+ div = document.createElement( "div" ),
260
+ testElement, testElementParent, testElementStyle, offset, offsetTotal;
261
+
262
+ //Create a "fake body" for testing based on method used in jQuery.support
263
+ testElement = document.createElement( body ? "div" : "body" );
264
+ testElementStyle = {
265
+ visibility: "hidden",
266
+ width: 0,
267
+ height: 0,
268
+ border: 0,
269
+ margin: 0,
270
+ background: "none"
271
+ };
272
+ if ( body ) {
273
+ jQuery.extend( testElementStyle, {
274
+ position: "absolute",
275
+ left: "-1000px",
276
+ top: "-1000px"
277
+ });
278
+ }
279
+ for ( var i in testElementStyle ) {
280
+ testElement.style[ i ] = testElementStyle[ i ];
281
+ }
282
+ testElement.appendChild( div );
283
+ testElementParent = body || document.documentElement;
284
+ testElementParent.insertBefore( testElement, testElementParent.firstChild );
285
+
286
+ div.style.cssText = "position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;";
287
+
288
+ offset = $( div ).offset( function( _, offset ) {
289
+ return offset;
290
+ }).offset();
291
+
292
+ testElement.innerHTML = "";
293
+ testElementParent.removeChild( testElement );
294
+
295
+ offsetTotal = offset.top + offset.left + ( body ? 2000 : 0 );
296
+ support.fractions = offsetTotal > 21 && offsetTotal < 22;
297
+ })();
298
+
299
+ }( jQuery ));
@@ -0,0 +1,113 @@
1
+ //= require jquery
2
+ //= require jquery.ui.core
3
+ //= require jquery.ui.widget
4
+
5
+ /*
6
+ * jQuery UI Progressbar 1.8.17
7
+ *
8
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
9
+ * Dual licensed under the MIT or GPL Version 2 licenses.
10
+ * http://jquery.org/license
11
+ *
12
+ * http://docs.jquery.com/UI/Progressbar
13
+ *
14
+ * Depends:
15
+ * jquery.ui.core.js
16
+ * jquery.ui.widget.js
17
+ */
18
+ (function( $, undefined ) {
19
+
20
+ $.widget( "ui.progressbar", {
21
+ options: {
22
+ value: 0,
23
+ max: 100
24
+ },
25
+
26
+ min: 0,
27
+
28
+ _create: function() {
29
+ this.element
30
+ .addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
31
+ .attr({
32
+ role: "progressbar",
33
+ "aria-valuemin": this.min,
34
+ "aria-valuemax": this.options.max,
35
+ "aria-valuenow": this._value()
36
+ });
37
+
38
+ this.valueDiv = $( "<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>" )
39
+ .appendTo( this.element );
40
+
41
+ this.oldValue = this._value();
42
+ this._refreshValue();
43
+ },
44
+
45
+ destroy: function() {
46
+ this.element
47
+ .removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
48
+ .removeAttr( "role" )
49
+ .removeAttr( "aria-valuemin" )
50
+ .removeAttr( "aria-valuemax" )
51
+ .removeAttr( "aria-valuenow" );
52
+
53
+ this.valueDiv.remove();
54
+
55
+ $.Widget.prototype.destroy.apply( this, arguments );
56
+ },
57
+
58
+ value: function( newValue ) {
59
+ if ( newValue === undefined ) {
60
+ return this._value();
61
+ }
62
+
63
+ this._setOption( "value", newValue );
64
+ return this;
65
+ },
66
+
67
+ _setOption: function( key, value ) {
68
+ if ( key === "value" ) {
69
+ this.options.value = value;
70
+ this._refreshValue();
71
+ if ( this._value() === this.options.max ) {
72
+ this._trigger( "complete" );
73
+ }
74
+ }
75
+
76
+ $.Widget.prototype._setOption.apply( this, arguments );
77
+ },
78
+
79
+ _value: function() {
80
+ var val = this.options.value;
81
+ // normalize invalid value
82
+ if ( typeof val !== "number" ) {
83
+ val = 0;
84
+ }
85
+ return Math.min( this.options.max, Math.max( this.min, val ) );
86
+ },
87
+
88
+ _percentage: function() {
89
+ return 100 * this._value() / this.options.max;
90
+ },
91
+
92
+ _refreshValue: function() {
93
+ var value = this.value();
94
+ var percentage = this._percentage();
95
+
96
+ if ( this.oldValue !== value ) {
97
+ this.oldValue = value;
98
+ this._trigger( "change" );
99
+ }
100
+
101
+ this.valueDiv
102
+ .toggle( value > this.min )
103
+ .toggleClass( "ui-corner-right", value === this.options.max )
104
+ .width( percentage.toFixed(0) + "%" );
105
+ this.element.attr( "aria-valuenow", value );
106
+ }
107
+ });
108
+
109
+ $.extend( $.ui.progressbar, {
110
+ version: "1.8.17"
111
+ });
112
+
113
+ })( jQuery );
@@ -0,0 +1,847 @@
1
+ //= require jquery
2
+ //= require jquery.ui.core
3
+ //= require jquery.ui.widget
4
+ //= require jquery.ui.mouse
5
+
6
+ /*
7
+ * jQuery UI Resizable 1.8.17
8
+ *
9
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
10
+ * Dual licensed under the MIT or GPL Version 2 licenses.
11
+ * http://jquery.org/license
12
+ *
13
+ * http://docs.jquery.com/UI/Resizables
14
+ *
15
+ * Depends:
16
+ * jquery.ui.core.js
17
+ * jquery.ui.mouse.js
18
+ * jquery.ui.widget.js
19
+ */
20
+ (function( $, undefined ) {
21
+
22
+ $.widget("ui.resizable", $.ui.mouse, {
23
+ widgetEventPrefix: "resize",
24
+ options: {
25
+ alsoResize: false,
26
+ animate: false,
27
+ animateDuration: "slow",
28
+ animateEasing: "swing",
29
+ aspectRatio: false,
30
+ autoHide: false,
31
+ containment: false,
32
+ ghost: false,
33
+ grid: false,
34
+ handles: "e,s,se",
35
+ helper: false,
36
+ maxHeight: null,
37
+ maxWidth: null,
38
+ minHeight: 10,
39
+ minWidth: 10,
40
+ zIndex: 1000
41
+ },
42
+ _create: function() {
43
+
44
+ var self = this, o = this.options;
45
+ this.element.addClass("ui-resizable");
46
+
47
+ $.extend(this, {
48
+ _aspectRatio: !!(o.aspectRatio),
49
+ aspectRatio: o.aspectRatio,
50
+ originalElement: this.element,
51
+ _proportionallyResizeElements: [],
52
+ _helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null
53
+ });
54
+
55
+ //Wrap the element if it cannot hold child nodes
56
+ if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) {
57
+
58
+ //Opera fix for relative positioning
59
+ if (/relative/.test(this.element.css('position')) && $.browser.opera)
60
+ this.element.css({ position: 'relative', top: 'auto', left: 'auto' });
61
+
62
+ //Create a wrapper element and set the wrapper to the new current internal element
63
+ this.element.wrap(
64
+ $('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({
65
+ position: this.element.css('position'),
66
+ width: this.element.outerWidth(),
67
+ height: this.element.outerHeight(),
68
+ top: this.element.css('top'),
69
+ left: this.element.css('left')
70
+ })
71
+ );
72
+
73
+ //Overwrite the original this.element
74
+ this.element = this.element.parent().data(
75
+ "resizable", this.element.data('resizable')
76
+ );
77
+
78
+ this.elementIsWrapper = true;
79
+
80
+ //Move margins to the wrapper
81
+ this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") });
82
+ this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0});
83
+
84
+ //Prevent Safari textarea resize
85
+ this.originalResizeStyle = this.originalElement.css('resize');
86
+ this.originalElement.css('resize', 'none');
87
+
88
+ //Push the actual element to our proportionallyResize internal array
89
+ this._proportionallyResizeElements.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' }));
90
+
91
+ // avoid IE jump (hard set the margin)
92
+ this.originalElement.css({ margin: this.originalElement.css('margin') });
93
+
94
+ // fix handlers offset
95
+ this._proportionallyResize();
96
+
97
+ }
98
+
99
+ this.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' });
100
+ if(this.handles.constructor == String) {
101
+
102
+ if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw';
103
+ var n = this.handles.split(","); this.handles = {};
104
+
105
+ for(var i = 0; i < n.length; i++) {
106
+
107
+ var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle;
108
+ var axis = $('<div class="ui-resizable-handle ' + hname + '"></div>');
109
+
110
+ // increase zIndex of sw, se, ne, nw axis
111
+ //TODO : this modifies original option
112
+ if(/sw|se|ne|nw/.test(handle)) axis.css({ zIndex: ++o.zIndex });
113
+
114
+ //TODO : What's going on here?
115
+ if ('se' == handle) {
116
+ axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se');
117
+ };
118
+
119
+ //Insert into internal handles object and append to element
120
+ this.handles[handle] = '.ui-resizable-'+handle;
121
+ this.element.append(axis);
122
+ }
123
+
124
+ }
125
+
126
+ this._renderAxis = function(target) {
127
+
128
+ target = target || this.element;
129
+
130
+ for(var i in this.handles) {
131
+
132
+ if(this.handles[i].constructor == String)
133
+ this.handles[i] = $(this.handles[i], this.element).show();
134
+
135
+ //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls)
136
+ if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) {
137
+
138
+ var axis = $(this.handles[i], this.element), padWrapper = 0;
139
+
140
+ //Checking the correct pad and border
141
+ padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
142
+
143
+ //The padding type i have to apply...
144
+ var padPos = [ 'padding',
145
+ /ne|nw|n/.test(i) ? 'Top' :
146
+ /se|sw|s/.test(i) ? 'Bottom' :
147
+ /^e$/.test(i) ? 'Right' : 'Left' ].join("");
148
+
149
+ target.css(padPos, padWrapper);
150
+
151
+ this._proportionallyResize();
152
+
153
+ }
154
+
155
+ //TODO: What's that good for? There's not anything to be executed left
156
+ if(!$(this.handles[i]).length)
157
+ continue;
158
+
159
+ }
160
+ };
161
+
162
+ //TODO: make renderAxis a prototype function
163
+ this._renderAxis(this.element);
164
+
165
+ this._handles = $('.ui-resizable-handle', this.element)
166
+ .disableSelection();
167
+
168
+ //Matching axis name
169
+ this._handles.mouseover(function() {
170
+ if (!self.resizing) {
171
+ if (this.className)
172
+ var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
173
+ //Axis, default = se
174
+ self.axis = axis && axis[1] ? axis[1] : 'se';
175
+ }
176
+ });
177
+
178
+ //If we want to auto hide the elements
179
+ if (o.autoHide) {
180
+ this._handles.hide();
181
+ $(this.element)
182
+ .addClass("ui-resizable-autohide")
183
+ .hover(function() {
184
+ if (o.disabled) return;
185
+ $(this).removeClass("ui-resizable-autohide");
186
+ self._handles.show();
187
+ },
188
+ function(){
189
+ if (o.disabled) return;
190
+ if (!self.resizing) {
191
+ $(this).addClass("ui-resizable-autohide");
192
+ self._handles.hide();
193
+ }
194
+ });
195
+ }
196
+
197
+ //Initialize the mouse interaction
198
+ this._mouseInit();
199
+
200
+ },
201
+
202
+ destroy: function() {
203
+
204
+ this._mouseDestroy();
205
+
206
+ var _destroy = function(exp) {
207
+ $(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
208
+ .removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove();
209
+ };
210
+
211
+ //TODO: Unwrap at same DOM position
212
+ if (this.elementIsWrapper) {
213
+ _destroy(this.element);
214
+ var wrapper = this.element;
215
+ wrapper.after(
216
+ this.originalElement.css({
217
+ position: wrapper.css('position'),
218
+ width: wrapper.outerWidth(),
219
+ height: wrapper.outerHeight(),
220
+ top: wrapper.css('top'),
221
+ left: wrapper.css('left')
222
+ })
223
+ ).remove();
224
+ }
225
+
226
+ this.originalElement.css('resize', this.originalResizeStyle);
227
+ _destroy(this.originalElement);
228
+
229
+ return this;
230
+ },
231
+
232
+ _mouseCapture: function(event) {
233
+ var handle = false;
234
+ for (var i in this.handles) {
235
+ if ($(this.handles[i])[0] == event.target) {
236
+ handle = true;
237
+ }
238
+ }
239
+
240
+ return !this.options.disabled && handle;
241
+ },
242
+
243
+ _mouseStart: function(event) {
244
+
245
+ var o = this.options, iniPos = this.element.position(), el = this.element;
246
+
247
+ this.resizing = true;
248
+ this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() };
249
+
250
+ // bugfix for http://dev.jquery.com/ticket/1749
251
+ if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) {
252
+ el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left });
253
+ }
254
+
255
+ //Opera fixing relative position
256
+ if ($.browser.opera && (/relative/).test(el.css('position')))
257
+ el.css({ position: 'relative', top: 'auto', left: 'auto' });
258
+
259
+ this._renderProxy();
260
+
261
+ var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top'));
262
+
263
+ if (o.containment) {
264
+ curleft += $(o.containment).scrollLeft() || 0;
265
+ curtop += $(o.containment).scrollTop() || 0;
266
+ }
267
+
268
+ //Store needed variables
269
+ this.offset = this.helper.offset();
270
+ this.position = { left: curleft, top: curtop };
271
+ this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
272
+ this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
273
+ this.originalPosition = { left: curleft, top: curtop };
274
+ this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() };
275
+ this.originalMousePosition = { left: event.pageX, top: event.pageY };
276
+
277
+ //Aspect Ratio
278
+ this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1);
279
+
280
+ var cursor = $('.ui-resizable-' + this.axis).css('cursor');
281
+ $('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor);
282
+
283
+ el.addClass("ui-resizable-resizing");
284
+ this._propagate("start", event);
285
+ return true;
286
+ },
287
+
288
+ _mouseDrag: function(event) {
289
+
290
+ //Increase performance, avoid regex
291
+ var el = this.helper, o = this.options, props = {},
292
+ self = this, smp = this.originalMousePosition, a = this.axis;
293
+
294
+ var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0;
295
+ var trigger = this._change[a];
296
+ if (!trigger) return false;
297
+
298
+ // Calculate the attrs that will be change
299
+ var data = trigger.apply(this, [event, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff;
300
+
301
+ // Put this in the mouseDrag handler since the user can start pressing shift while resizing
302
+ this._updateVirtualBoundaries(event.shiftKey);
303
+ if (this._aspectRatio || event.shiftKey)
304
+ data = this._updateRatio(data, event);
305
+
306
+ data = this._respectSize(data, event);
307
+
308
+ // plugins callbacks need to be called first
309
+ this._propagate("resize", event);
310
+
311
+ el.css({
312
+ top: this.position.top + "px", left: this.position.left + "px",
313
+ width: this.size.width + "px", height: this.size.height + "px"
314
+ });
315
+
316
+ if (!this._helper && this._proportionallyResizeElements.length)
317
+ this._proportionallyResize();
318
+
319
+ this._updateCache(data);
320
+
321
+ // calling the user callback at the end
322
+ this._trigger('resize', event, this.ui());
323
+
324
+ return false;
325
+ },
326
+
327
+ _mouseStop: function(event) {
328
+
329
+ this.resizing = false;
330
+ var o = this.options, self = this;
331
+
332
+ if(this._helper) {
333
+ var pr = this._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),
334
+ soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
335
+ soffsetw = ista ? 0 : self.sizeDiff.width;
336
+
337
+ var s = { width: (self.helper.width() - soffsetw), height: (self.helper.height() - soffseth) },
338
+ left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
339
+ top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;
340
+
341
+ if (!o.animate)
342
+ this.element.css($.extend(s, { top: top, left: left }));
343
+
344
+ self.helper.height(self.size.height);
345
+ self.helper.width(self.size.width);
346
+
347
+ if (this._helper && !o.animate) this._proportionallyResize();
348
+ }
349
+
350
+ $('body').css('cursor', 'auto');
351
+
352
+ this.element.removeClass("ui-resizable-resizing");
353
+
354
+ this._propagate("stop", event);
355
+
356
+ if (this._helper) this.helper.remove();
357
+ return false;
358
+
359
+ },
360
+
361
+ _updateVirtualBoundaries: function(forceAspectRatio) {
362
+ var o = this.options, pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b;
363
+
364
+ b = {
365
+ minWidth: isNumber(o.minWidth) ? o.minWidth : 0,
366
+ maxWidth: isNumber(o.maxWidth) ? o.maxWidth : Infinity,
367
+ minHeight: isNumber(o.minHeight) ? o.minHeight : 0,
368
+ maxHeight: isNumber(o.maxHeight) ? o.maxHeight : Infinity
369
+ };
370
+
371
+ if(this._aspectRatio || forceAspectRatio) {
372
+ // We want to create an enclosing box whose aspect ration is the requested one
373
+ // First, compute the "projected" size for each dimension based on the aspect ratio and other dimension
374
+ pMinWidth = b.minHeight * this.aspectRatio;
375
+ pMinHeight = b.minWidth / this.aspectRatio;
376
+ pMaxWidth = b.maxHeight * this.aspectRatio;
377
+ pMaxHeight = b.maxWidth / this.aspectRatio;
378
+
379
+ if(pMinWidth > b.minWidth) b.minWidth = pMinWidth;
380
+ if(pMinHeight > b.minHeight) b.minHeight = pMinHeight;
381
+ if(pMaxWidth < b.maxWidth) b.maxWidth = pMaxWidth;
382
+ if(pMaxHeight < b.maxHeight) b.maxHeight = pMaxHeight;
383
+ }
384
+ this._vBoundaries = b;
385
+ },
386
+
387
+ _updateCache: function(data) {
388
+ var o = this.options;
389
+ this.offset = this.helper.offset();
390
+ if (isNumber(data.left)) this.position.left = data.left;
391
+ if (isNumber(data.top)) this.position.top = data.top;
392
+ if (isNumber(data.height)) this.size.height = data.height;
393
+ if (isNumber(data.width)) this.size.width = data.width;
394
+ },
395
+
396
+ _updateRatio: function(data, event) {
397
+
398
+ var o = this.options, cpos = this.position, csize = this.size, a = this.axis;
399
+
400
+ if (isNumber(data.height)) data.width = (data.height * this.aspectRatio);
401
+ else if (isNumber(data.width)) data.height = (data.width / this.aspectRatio);
402
+
403
+ if (a == 'sw') {
404
+ data.left = cpos.left + (csize.width - data.width);
405
+ data.top = null;
406
+ }
407
+ if (a == 'nw') {
408
+ data.top = cpos.top + (csize.height - data.height);
409
+ data.left = cpos.left + (csize.width - data.width);
410
+ }
411
+
412
+ return data;
413
+ },
414
+
415
+ _respectSize: function(data, event) {
416
+
417
+ var el = this.helper, o = this._vBoundaries, pRatio = this._aspectRatio || event.shiftKey, a = this.axis,
418
+ ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
419
+ isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height);
420
+
421
+ if (isminw) data.width = o.minWidth;
422
+ if (isminh) data.height = o.minHeight;
423
+ if (ismaxw) data.width = o.maxWidth;
424
+ if (ismaxh) data.height = o.maxHeight;
425
+
426
+ var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height;
427
+ var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
428
+
429
+ if (isminw && cw) data.left = dw - o.minWidth;
430
+ if (ismaxw && cw) data.left = dw - o.maxWidth;
431
+ if (isminh && ch) data.top = dh - o.minHeight;
432
+ if (ismaxh && ch) data.top = dh - o.maxHeight;
433
+
434
+ // fixing jump error on top/left - bug #2330
435
+ var isNotwh = !data.width && !data.height;
436
+ if (isNotwh && !data.left && data.top) data.top = null;
437
+ else if (isNotwh && !data.top && data.left) data.left = null;
438
+
439
+ return data;
440
+ },
441
+
442
+ _proportionallyResize: function() {
443
+
444
+ var o = this.options;
445
+ if (!this._proportionallyResizeElements.length) return;
446
+ var element = this.helper || this.element;
447
+
448
+ for (var i=0; i < this._proportionallyResizeElements.length; i++) {
449
+
450
+ var prel = this._proportionallyResizeElements[i];
451
+
452
+ if (!this.borderDif) {
453
+ var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')],
454
+ p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')];
455
+
456
+ this.borderDif = $.map(b, function(v, i) {
457
+ var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0;
458
+ return border + padding;
459
+ });
460
+ }
461
+
462
+ if ($.browser.msie && !(!($(element).is(':hidden') || $(element).parents(':hidden').length)))
463
+ continue;
464
+
465
+ prel.css({
466
+ height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0,
467
+ width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0
468
+ });
469
+
470
+ };
471
+
472
+ },
473
+
474
+ _renderProxy: function() {
475
+
476
+ var el = this.element, o = this.options;
477
+ this.elementOffset = el.offset();
478
+
479
+ if(this._helper) {
480
+
481
+ this.helper = this.helper || $('<div style="overflow:hidden;"></div>');
482
+
483
+ // fix ie6 offset TODO: This seems broken
484
+ var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0),
485
+ pxyoffset = ( ie6 ? 2 : -1 );
486
+
487
+ this.helper.addClass(this._helper).css({
488
+ width: this.element.outerWidth() + pxyoffset,
489
+ height: this.element.outerHeight() + pxyoffset,
490
+ position: 'absolute',
491
+ left: this.elementOffset.left - ie6offset +'px',
492
+ top: this.elementOffset.top - ie6offset +'px',
493
+ zIndex: ++o.zIndex //TODO: Don't modify option
494
+ });
495
+
496
+ this.helper
497
+ .appendTo("body")
498
+ .disableSelection();
499
+
500
+ } else {
501
+ this.helper = this.element;
502
+ }
503
+
504
+ },
505
+
506
+ _change: {
507
+ e: function(event, dx, dy) {
508
+ return { width: this.originalSize.width + dx };
509
+ },
510
+ w: function(event, dx, dy) {
511
+ var o = this.options, cs = this.originalSize, sp = this.originalPosition;
512
+ return { left: sp.left + dx, width: cs.width - dx };
513
+ },
514
+ n: function(event, dx, dy) {
515
+ var o = this.options, cs = this.originalSize, sp = this.originalPosition;
516
+ return { top: sp.top + dy, height: cs.height - dy };
517
+ },
518
+ s: function(event, dx, dy) {
519
+ return { height: this.originalSize.height + dy };
520
+ },
521
+ se: function(event, dx, dy) {
522
+ return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
523
+ },
524
+ sw: function(event, dx, dy) {
525
+ return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
526
+ },
527
+ ne: function(event, dx, dy) {
528
+ return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
529
+ },
530
+ nw: function(event, dx, dy) {
531
+ return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
532
+ }
533
+ },
534
+
535
+ _propagate: function(n, event) {
536
+ $.ui.plugin.call(this, n, [event, this.ui()]);
537
+ (n != "resize" && this._trigger(n, event, this.ui()));
538
+ },
539
+
540
+ plugins: {},
541
+
542
+ ui: function() {
543
+ return {
544
+ originalElement: this.originalElement,
545
+ element: this.element,
546
+ helper: this.helper,
547
+ position: this.position,
548
+ size: this.size,
549
+ originalSize: this.originalSize,
550
+ originalPosition: this.originalPosition
551
+ };
552
+ }
553
+
554
+ });
555
+
556
+ $.extend($.ui.resizable, {
557
+ version: "1.8.17"
558
+ });
559
+
560
+ /*
561
+ * Resizable Extensions
562
+ */
563
+
564
+ $.ui.plugin.add("resizable", "alsoResize", {
565
+
566
+ start: function (event, ui) {
567
+ var self = $(this).data("resizable"), o = self.options;
568
+
569
+ var _store = function (exp) {
570
+ $(exp).each(function() {
571
+ var el = $(this);
572
+ el.data("resizable-alsoresize", {
573
+ width: parseInt(el.width(), 10), height: parseInt(el.height(), 10),
574
+ left: parseInt(el.css('left'), 10), top: parseInt(el.css('top'), 10),
575
+ position: el.css('position') // to reset Opera on stop()
576
+ });
577
+ });
578
+ };
579
+
580
+ if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) {
581
+ if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); }
582
+ else { $.each(o.alsoResize, function (exp) { _store(exp); }); }
583
+ }else{
584
+ _store(o.alsoResize);
585
+ }
586
+ },
587
+
588
+ resize: function (event, ui) {
589
+ var self = $(this).data("resizable"), o = self.options, os = self.originalSize, op = self.originalPosition;
590
+
591
+ var delta = {
592
+ height: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0,
593
+ top: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0
594
+ },
595
+
596
+ _alsoResize = function (exp, c) {
597
+ $(exp).each(function() {
598
+ var el = $(this), start = $(this).data("resizable-alsoresize"), style = {},
599
+ css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ['width', 'height'] : ['width', 'height', 'top', 'left'];
600
+
601
+ $.each(css, function (i, prop) {
602
+ var sum = (start[prop]||0) + (delta[prop]||0);
603
+ if (sum && sum >= 0)
604
+ style[prop] = sum || null;
605
+ });
606
+
607
+ // Opera fixing relative position
608
+ if ($.browser.opera && /relative/.test(el.css('position'))) {
609
+ self._revertToRelativePosition = true;
610
+ el.css({ position: 'absolute', top: 'auto', left: 'auto' });
611
+ }
612
+
613
+ el.css(style);
614
+ });
615
+ };
616
+
617
+ if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) {
618
+ $.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); });
619
+ }else{
620
+ _alsoResize(o.alsoResize);
621
+ }
622
+ },
623
+
624
+ stop: function (event, ui) {
625
+ var self = $(this).data("resizable"), o = self.options;
626
+
627
+ var _reset = function (exp) {
628
+ $(exp).each(function() {
629
+ var el = $(this);
630
+ // reset position for Opera - no need to verify it was changed
631
+ el.css({ position: el.data("resizable-alsoresize").position });
632
+ });
633
+ };
634
+
635
+ if (self._revertToRelativePosition) {
636
+ self._revertToRelativePosition = false;
637
+ if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) {
638
+ $.each(o.alsoResize, function (exp) { _reset(exp); });
639
+ }else{
640
+ _reset(o.alsoResize);
641
+ }
642
+ }
643
+
644
+ $(this).removeData("resizable-alsoresize");
645
+ }
646
+ });
647
+
648
+ $.ui.plugin.add("resizable", "animate", {
649
+
650
+ stop: function(event, ui) {
651
+ var self = $(this).data("resizable"), o = self.options;
652
+
653
+ var pr = self._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),
654
+ soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
655
+ soffsetw = ista ? 0 : self.sizeDiff.width;
656
+
657
+ var style = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) },
658
+ left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
659
+ top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;
660
+
661
+ self.element.animate(
662
+ $.extend(style, top && left ? { top: top, left: left } : {}), {
663
+ duration: o.animateDuration,
664
+ easing: o.animateEasing,
665
+ step: function() {
666
+
667
+ var data = {
668
+ width: parseInt(self.element.css('width'), 10),
669
+ height: parseInt(self.element.css('height'), 10),
670
+ top: parseInt(self.element.css('top'), 10),
671
+ left: parseInt(self.element.css('left'), 10)
672
+ };
673
+
674
+ if (pr && pr.length) $(pr[0]).css({ width: data.width, height: data.height });
675
+
676
+ // propagating resize, and updating values for each animation step
677
+ self._updateCache(data);
678
+ self._propagate("resize", event);
679
+
680
+ }
681
+ }
682
+ );
683
+ }
684
+
685
+ });
686
+
687
+ $.ui.plugin.add("resizable", "containment", {
688
+
689
+ start: function(event, ui) {
690
+ var self = $(this).data("resizable"), o = self.options, el = self.element;
691
+ var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc;
692
+ if (!ce) return;
693
+
694
+ self.containerElement = $(ce);
695
+
696
+ if (/document/.test(oc) || oc == document) {
697
+ self.containerOffset = { left: 0, top: 0 };
698
+ self.containerPosition = { left: 0, top: 0 };
699
+
700
+ self.parentData = {
701
+ element: $(document), left: 0, top: 0,
702
+ width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight
703
+ };
704
+ }
705
+
706
+ // i'm a node, so compute top, left, right, bottom
707
+ else {
708
+ var element = $(ce), p = [];
709
+ $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); });
710
+
711
+ self.containerOffset = element.offset();
712
+ self.containerPosition = element.position();
713
+ self.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) };
714
+
715
+ var co = self.containerOffset, ch = self.containerSize.height, cw = self.containerSize.width,
716
+ width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch);
717
+
718
+ self.parentData = {
719
+ element: ce, left: co.left, top: co.top, width: width, height: height
720
+ };
721
+ }
722
+ },
723
+
724
+ resize: function(event, ui) {
725
+ var self = $(this).data("resizable"), o = self.options,
726
+ ps = self.containerSize, co = self.containerOffset, cs = self.size, cp = self.position,
727
+ pRatio = self._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = self.containerElement;
728
+
729
+ if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co;
730
+
731
+ if (cp.left < (self._helper ? co.left : 0)) {
732
+ self.size.width = self.size.width + (self._helper ? (self.position.left - co.left) : (self.position.left - cop.left));
733
+ if (pRatio) self.size.height = self.size.width / o.aspectRatio;
734
+ self.position.left = o.helper ? co.left : 0;
735
+ }
736
+
737
+ if (cp.top < (self._helper ? co.top : 0)) {
738
+ self.size.height = self.size.height + (self._helper ? (self.position.top - co.top) : self.position.top);
739
+ if (pRatio) self.size.width = self.size.height * o.aspectRatio;
740
+ self.position.top = self._helper ? co.top : 0;
741
+ }
742
+
743
+ self.offset.left = self.parentData.left+self.position.left;
744
+ self.offset.top = self.parentData.top+self.position.top;
745
+
746
+ var woset = Math.abs( (self._helper ? self.offset.left - cop.left : (self.offset.left - cop.left)) + self.sizeDiff.width ),
747
+ hoset = Math.abs( (self._helper ? self.offset.top - cop.top : (self.offset.top - co.top)) + self.sizeDiff.height );
748
+
749
+ var isParent = self.containerElement.get(0) == self.element.parent().get(0),
750
+ isOffsetRelative = /relative|absolute/.test(self.containerElement.css('position'));
751
+
752
+ if(isParent && isOffsetRelative) woset -= self.parentData.left;
753
+
754
+ if (woset + self.size.width >= self.parentData.width) {
755
+ self.size.width = self.parentData.width - woset;
756
+ if (pRatio) self.size.height = self.size.width / self.aspectRatio;
757
+ }
758
+
759
+ if (hoset + self.size.height >= self.parentData.height) {
760
+ self.size.height = self.parentData.height - hoset;
761
+ if (pRatio) self.size.width = self.size.height * self.aspectRatio;
762
+ }
763
+ },
764
+
765
+ stop: function(event, ui){
766
+ var self = $(this).data("resizable"), o = self.options, cp = self.position,
767
+ co = self.containerOffset, cop = self.containerPosition, ce = self.containerElement;
768
+
769
+ var helper = $(self.helper), ho = helper.offset(), w = helper.outerWidth() - self.sizeDiff.width, h = helper.outerHeight() - self.sizeDiff.height;
770
+
771
+ if (self._helper && !o.animate && (/relative/).test(ce.css('position')))
772
+ $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
773
+
774
+ if (self._helper && !o.animate && (/static/).test(ce.css('position')))
775
+ $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
776
+
777
+ }
778
+ });
779
+
780
+ $.ui.plugin.add("resizable", "ghost", {
781
+
782
+ start: function(event, ui) {
783
+
784
+ var self = $(this).data("resizable"), o = self.options, cs = self.size;
785
+
786
+ self.ghost = self.originalElement.clone();
787
+ self.ghost
788
+ .css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 })
789
+ .addClass('ui-resizable-ghost')
790
+ .addClass(typeof o.ghost == 'string' ? o.ghost : '');
791
+
792
+ self.ghost.appendTo(self.helper);
793
+
794
+ },
795
+
796
+ resize: function(event, ui){
797
+ var self = $(this).data("resizable"), o = self.options;
798
+ if (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width });
799
+ },
800
+
801
+ stop: function(event, ui){
802
+ var self = $(this).data("resizable"), o = self.options;
803
+ if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0));
804
+ }
805
+
806
+ });
807
+
808
+ $.ui.plugin.add("resizable", "grid", {
809
+
810
+ resize: function(event, ui) {
811
+ var self = $(this).data("resizable"), o = self.options, cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || event.shiftKey;
812
+ o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid;
813
+ var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1);
814
+
815
+ if (/^(se|s|e)$/.test(a)) {
816
+ self.size.width = os.width + ox;
817
+ self.size.height = os.height + oy;
818
+ }
819
+ else if (/^(ne)$/.test(a)) {
820
+ self.size.width = os.width + ox;
821
+ self.size.height = os.height + oy;
822
+ self.position.top = op.top - oy;
823
+ }
824
+ else if (/^(sw)$/.test(a)) {
825
+ self.size.width = os.width + ox;
826
+ self.size.height = os.height + oy;
827
+ self.position.left = op.left - ox;
828
+ }
829
+ else {
830
+ self.size.width = os.width + ox;
831
+ self.size.height = os.height + oy;
832
+ self.position.top = op.top - oy;
833
+ self.position.left = op.left - ox;
834
+ }
835
+ }
836
+
837
+ });
838
+
839
+ var num = function(v) {
840
+ return parseInt(v, 10) || 0;
841
+ };
842
+
843
+ var isNumber = function(value) {
844
+ return !isNaN(parseInt(value, 10));
845
+ };
846
+
847
+ })(jQuery);