h2ocube_rails_assets 0.0.19 → 0.0.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/README.md +1 -0
  4. data/Vendorfile +196 -0
  5. data/h2ocube_rails_assets.gemspec +3 -4
  6. data/lib/h2ocube_rails_assets.rb +8 -6
  7. data/test/jquery_test.rb +1 -1
  8. data/test/turbolinks_test.rb +1 -3
  9. data/vendor/assets/images/jquery.fancybox/fancybox_loading.gif +0 -0
  10. data/vendor/assets/images/jquery.fancybox/fancybox_loading@2x.gif +0 -0
  11. data/vendor/assets/images/jquery.fancybox/fancybox_sprite@2x.png +0 -0
  12. data/vendor/assets/javascripts/backbone.js +4 -1571
  13. data/vendor/assets/javascripts/bootstrap.js +6 -2276
  14. data/vendor/assets/javascripts/highcharts.js +272 -15281
  15. data/vendor/assets/javascripts/jasny-bootstrap.js +7 -3060
  16. data/vendor/assets/javascripts/jquery/1.10.js +6 -9807
  17. data/vendor/assets/javascripts/jquery/1.8.js +2 -9472
  18. data/vendor/assets/javascripts/jquery/1.9.js +5 -9597
  19. data/vendor/assets/javascripts/jquery/2.0.js +5 -8841
  20. data/vendor/assets/javascripts/jquery.cookie.js +26 -23
  21. data/vendor/assets/javascripts/jquery.fancybox.js +46 -1983
  22. data/vendor/assets/javascripts/jquery.fileupload.js +1329 -4
  23. data/vendor/assets/javascripts/jquery.iframe-transport.js +24 -4
  24. data/vendor/assets/javascripts/jquery.js +1 -1
  25. data/vendor/assets/javascripts/jquery.lazyload.js +3 -216
  26. data/vendor/assets/javascripts/jquery.mobile.js +7 -11092
  27. data/vendor/assets/javascripts/jquery.pnotify.js +29 -903
  28. data/vendor/assets/javascripts/jquery.timeago.coffee +2 -4
  29. data/vendor/assets/javascripts/jquery.turbolinks.coffee +40 -51
  30. data/vendor/assets/javascripts/jquery.ui/jquery.ui.accordion.js +4 -572
  31. data/vendor/assets/javascripts/jquery.ui/jquery.ui.autocomplete.js +4 -610
  32. data/vendor/assets/javascripts/jquery.ui/jquery.ui.button.js +4 -419
  33. data/vendor/assets/javascripts/jquery.ui/jquery.ui.core.js +4 -320
  34. data/vendor/assets/javascripts/jquery.ui/jquery.ui.datepicker.js +5 -2050
  35. data/vendor/assets/javascripts/jquery.ui/jquery.ui.dialog.js +4 -808
  36. data/vendor/assets/javascripts/jquery.ui/jquery.ui.draggable.js +4 -933
  37. data/vendor/assets/javascripts/jquery.ui/jquery.ui.droppable.js +4 -372
  38. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-blind.js +4 -82
  39. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-bounce.js +4 -113
  40. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-clip.js +4 -67
  41. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-drop.js +4 -65
  42. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-explode.js +4 -97
  43. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-fade.js +4 -30
  44. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-fold.js +4 -76
  45. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-highlight.js +4 -50
  46. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-pulsate.js +4 -63
  47. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-scale.js +4 -318
  48. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-shake.js +4 -74
  49. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-slide.js +4 -64
  50. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-transfer.js +4 -47
  51. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect.js +4 -1289
  52. data/vendor/assets/javascripts/jquery.ui/jquery.ui.menu.js +4 -621
  53. data/vendor/assets/javascripts/jquery.ui/jquery.ui.mouse.js +4 -169
  54. data/vendor/assets/javascripts/jquery.ui/jquery.ui.position.js +4 -497
  55. data/vendor/assets/javascripts/jquery.ui/jquery.ui.progressbar.js +4 -145
  56. data/vendor/assets/javascripts/jquery.ui/jquery.ui.resizable.js +4 -968
  57. data/vendor/assets/javascripts/jquery.ui/jquery.ui.selectable.js +4 -277
  58. data/vendor/assets/javascripts/jquery.ui/jquery.ui.slider.js +4 -672
  59. data/vendor/assets/javascripts/jquery.ui/jquery.ui.sortable.js +4 -1282
  60. data/vendor/assets/javascripts/jquery.ui/jquery.ui.spinner.js +4 -493
  61. data/vendor/assets/javascripts/jquery.ui/jquery.ui.tabs.js +4 -846
  62. data/vendor/assets/javascripts/jquery.ui/jquery.ui.tooltip.js +4 -402
  63. data/vendor/assets/javascripts/jquery.ui/jquery.ui.widget.js +4 -521
  64. data/vendor/assets/javascripts/jquery.validate.js +2 -1207
  65. data/vendor/assets/javascripts/lazyload.js +4 -391
  66. data/vendor/assets/javascripts/sammy.js +5 -2117
  67. data/vendor/assets/javascripts/underscore.js +4 -1224
  68. data/vendor/assets/javascripts/zepto.js +1 -1564
  69. data/vendor/assets/stylesheets/bootstrap.responsive.css +2 -1102
  70. data/vendor/assets/stylesheets/bootstrap.scss +2 -6151
  71. data/vendor/assets/stylesheets/jasny-bootstrap.responsive.css +2 -1263
  72. data/vendor/assets/stylesheets/jasny-bootstrap.scss +2 -7591
  73. data/vendor/assets/stylesheets/jquery.fancybox.scss +27 -2
  74. data/vendor/assets/stylesheets/jquery.mobile.scss +2 -3356
  75. data/vendor/assets/stylesheets/jquery.ui.scss +2 -1184
  76. metadata +43 -19
  77. data/vendor/assets/images/jquery.mobile/ajax-loader.gif +0 -0
  78. data/vendor/assets/images/jquery.mobile/icons-18-black.png +0 -0
  79. data/vendor/assets/images/jquery.mobile/icons-18-white.png +0 -0
  80. data/vendor/assets/images/jquery.mobile/icons-36-black.png +0 -0
  81. data/vendor/assets/images/jquery.mobile/icons-36-white.png +0 -0
  82. data/vendor/assets/javascripts/_jquery.fileupload.js +0 -1164
  83. data/vendor/assets/javascripts/zepto/fx_methods.js +0 -71
@@ -1,145 +1,4 @@
1
- /*!
2
- * jQuery UI Progressbar 1.10.2
3
- * http://jqueryui.com
4
- *
5
- * Copyright 2013 jQuery Foundation and other contributors
6
- * Released under the MIT license.
7
- * http://jquery.org/license
8
- *
9
- * http://api.jqueryui.com/progressbar/
10
- *
11
- * Depends:
12
- * jquery.ui.core.js
13
- * jquery.ui.widget.js
14
- */
15
- (function( $, undefined ) {
16
-
17
- $.widget( "ui.progressbar", {
18
- version: "1.10.2",
19
- options: {
20
- max: 100,
21
- value: 0,
22
-
23
- change: null,
24
- complete: null
25
- },
26
-
27
- min: 0,
28
-
29
- _create: function() {
30
- // Constrain initial value
31
- this.oldValue = this.options.value = this._constrainedValue();
32
-
33
- this.element
34
- .addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
35
- .attr({
36
- // Only set static values, aria-valuenow and aria-valuemax are
37
- // set inside _refreshValue()
38
- role: "progressbar",
39
- "aria-valuemin": this.min
40
- });
41
-
42
- this.valueDiv = $( "<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>" )
43
- .appendTo( this.element );
44
-
45
- this._refreshValue();
46
- },
47
-
48
- _destroy: function() {
49
- this.element
50
- .removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
51
- .removeAttr( "role" )
52
- .removeAttr( "aria-valuemin" )
53
- .removeAttr( "aria-valuemax" )
54
- .removeAttr( "aria-valuenow" );
55
-
56
- this.valueDiv.remove();
57
- },
58
-
59
- value: function( newValue ) {
60
- if ( newValue === undefined ) {
61
- return this.options.value;
62
- }
63
-
64
- this.options.value = this._constrainedValue( newValue );
65
- this._refreshValue();
66
- },
67
-
68
- _constrainedValue: function( newValue ) {
69
- if ( newValue === undefined ) {
70
- newValue = this.options.value;
71
- }
72
-
73
- this.indeterminate = newValue === false;
74
-
75
- // sanitize value
76
- if ( typeof newValue !== "number" ) {
77
- newValue = 0;
78
- }
79
-
80
- return this.indeterminate ? false :
81
- Math.min( this.options.max, Math.max( this.min, newValue ) );
82
- },
83
-
84
- _setOptions: function( options ) {
85
- // Ensure "value" option is set after other values (like max)
86
- var value = options.value;
87
- delete options.value;
88
-
89
- this._super( options );
90
-
91
- this.options.value = this._constrainedValue( value );
92
- this._refreshValue();
93
- },
94
-
95
- _setOption: function( key, value ) {
96
- if ( key === "max" ) {
97
- // Don't allow a max less than min
98
- value = Math.max( this.min, value );
99
- }
100
-
101
- this._super( key, value );
102
- },
103
-
104
- _percentage: function() {
105
- return this.indeterminate ? 100 : 100 * ( this.options.value - this.min ) / ( this.options.max - this.min );
106
- },
107
-
108
- _refreshValue: function() {
109
- var value = this.options.value,
110
- percentage = this._percentage();
111
-
112
- this.valueDiv
113
- .toggle( this.indeterminate || value > this.min )
114
- .toggleClass( "ui-corner-right", value === this.options.max )
115
- .width( percentage.toFixed(0) + "%" );
116
-
117
- this.element.toggleClass( "ui-progressbar-indeterminate", this.indeterminate );
118
-
119
- if ( this.indeterminate ) {
120
- this.element.removeAttr( "aria-valuenow" );
121
- if ( !this.overlayDiv ) {
122
- this.overlayDiv = $( "<div class='ui-progressbar-overlay'></div>" ).appendTo( this.valueDiv );
123
- }
124
- } else {
125
- this.element.attr({
126
- "aria-valuemax": this.options.max,
127
- "aria-valuenow": value
128
- });
129
- if ( this.overlayDiv ) {
130
- this.overlayDiv.remove();
131
- this.overlayDiv = null;
132
- }
133
- }
134
-
135
- if ( this.oldValue !== value ) {
136
- this.oldValue = value;
137
- this._trigger( "change" );
138
- }
139
- if ( value === this.options.max ) {
140
- this._trigger( "complete" );
141
- }
142
- }
143
- });
144
-
145
- })( jQuery );
1
+ /*! jQuery UI - v1.10.3 - 2013-05-03
2
+ * http://jqueryui.com
3
+ * Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
4
+ (function(t,e){t.widget("ui.progressbar",{version:"1.10.3",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=t("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(t){return t===e?this.options.value:(this.options.value=this._constrainedValue(t),this._refreshValue(),e)},_constrainedValue:function(t){return t===e&&(t=this.options.value),this.indeterminate=t===!1,"number"!=typeof t&&(t=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}})})(jQuery);
@@ -1,968 +1,4 @@
1
- /*!
2
- * jQuery UI Resizable 1.10.2
3
- * http://jqueryui.com
4
- *
5
- * Copyright 2013 jQuery Foundation and other contributors
6
- * Released under the MIT license.
7
- * http://jquery.org/license
8
- *
9
- * http://api.jqueryui.com/resizable/
10
- *
11
- * Depends:
12
- * jquery.ui.core.js
13
- * jquery.ui.mouse.js
14
- * jquery.ui.widget.js
15
- */
16
- (function( $, undefined ) {
17
-
18
- function num(v) {
19
- return parseInt(v, 10) || 0;
20
- }
21
-
22
- function isNumber(value) {
23
- return !isNaN(parseInt(value, 10));
24
- }
25
-
26
- $.widget("ui.resizable", $.ui.mouse, {
27
- version: "1.10.2",
28
- widgetEventPrefix: "resize",
29
- options: {
30
- alsoResize: false,
31
- animate: false,
32
- animateDuration: "slow",
33
- animateEasing: "swing",
34
- aspectRatio: false,
35
- autoHide: false,
36
- containment: false,
37
- ghost: false,
38
- grid: false,
39
- handles: "e,s,se",
40
- helper: false,
41
- maxHeight: null,
42
- maxWidth: null,
43
- minHeight: 10,
44
- minWidth: 10,
45
- // See #7960
46
- zIndex: 90,
47
-
48
- // callbacks
49
- resize: null,
50
- start: null,
51
- stop: null
52
- },
53
- _create: function() {
54
-
55
- var n, i, handle, axis, hname,
56
- that = this,
57
- o = this.options;
58
- this.element.addClass("ui-resizable");
59
-
60
- $.extend(this, {
61
- _aspectRatio: !!(o.aspectRatio),
62
- aspectRatio: o.aspectRatio,
63
- originalElement: this.element,
64
- _proportionallyResizeElements: [],
65
- _helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
66
- });
67
-
68
- //Wrap the element if it cannot hold child nodes
69
- if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) {
70
-
71
- //Create a wrapper element and set the wrapper to the new current internal element
72
- this.element.wrap(
73
- $("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({
74
- position: this.element.css("position"),
75
- width: this.element.outerWidth(),
76
- height: this.element.outerHeight(),
77
- top: this.element.css("top"),
78
- left: this.element.css("left")
79
- })
80
- );
81
-
82
- //Overwrite the original this.element
83
- this.element = this.element.parent().data(
84
- "ui-resizable", this.element.data("ui-resizable")
85
- );
86
-
87
- this.elementIsWrapper = true;
88
-
89
- //Move margins to the wrapper
90
- this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") });
91
- this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0});
92
-
93
- //Prevent Safari textarea resize
94
- this.originalResizeStyle = this.originalElement.css("resize");
95
- this.originalElement.css("resize", "none");
96
-
97
- //Push the actual element to our proportionallyResize internal array
98
- this._proportionallyResizeElements.push(this.originalElement.css({ position: "static", zoom: 1, display: "block" }));
99
-
100
- // avoid IE jump (hard set the margin)
101
- this.originalElement.css({ margin: this.originalElement.css("margin") });
102
-
103
- // fix handlers offset
104
- this._proportionallyResize();
105
-
106
- }
107
-
108
- 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" });
109
- if(this.handles.constructor === String) {
110
-
111
- if ( this.handles === "all") {
112
- this.handles = "n,e,s,w,se,sw,ne,nw";
113
- }
114
-
115
- n = this.handles.split(",");
116
- this.handles = {};
117
-
118
- for(i = 0; i < n.length; i++) {
119
-
120
- handle = $.trim(n[i]);
121
- hname = "ui-resizable-"+handle;
122
- axis = $("<div class='ui-resizable-handle " + hname + "'></div>");
123
-
124
- // Apply zIndex to all handles - see #7960
125
- axis.css({ zIndex: o.zIndex });
126
-
127
- //TODO : What's going on here?
128
- if ("se" === handle) {
129
- axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se");
130
- }
131
-
132
- //Insert into internal handles object and append to element
133
- this.handles[handle] = ".ui-resizable-"+handle;
134
- this.element.append(axis);
135
- }
136
-
137
- }
138
-
139
- this._renderAxis = function(target) {
140
-
141
- var i, axis, padPos, padWrapper;
142
-
143
- target = target || this.element;
144
-
145
- for(i in this.handles) {
146
-
147
- if(this.handles[i].constructor === String) {
148
- this.handles[i] = $(this.handles[i], this.element).show();
149
- }
150
-
151
- //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls)
152
- if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) {
153
-
154
- axis = $(this.handles[i], this.element);
155
-
156
- //Checking the correct pad and border
157
- padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
158
-
159
- //The padding type i have to apply...
160
- padPos = [ "padding",
161
- /ne|nw|n/.test(i) ? "Top" :
162
- /se|sw|s/.test(i) ? "Bottom" :
163
- /^e$/.test(i) ? "Right" : "Left" ].join("");
164
-
165
- target.css(padPos, padWrapper);
166
-
167
- this._proportionallyResize();
168
-
169
- }
170
-
171
- //TODO: What's that good for? There's not anything to be executed left
172
- if(!$(this.handles[i]).length) {
173
- continue;
174
- }
175
- }
176
- };
177
-
178
- //TODO: make renderAxis a prototype function
179
- this._renderAxis(this.element);
180
-
181
- this._handles = $(".ui-resizable-handle", this.element)
182
- .disableSelection();
183
-
184
- //Matching axis name
185
- this._handles.mouseover(function() {
186
- if (!that.resizing) {
187
- if (this.className) {
188
- axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
189
- }
190
- //Axis, default = se
191
- that.axis = axis && axis[1] ? axis[1] : "se";
192
- }
193
- });
194
-
195
- //If we want to auto hide the elements
196
- if (o.autoHide) {
197
- this._handles.hide();
198
- $(this.element)
199
- .addClass("ui-resizable-autohide")
200
- .mouseenter(function() {
201
- if (o.disabled) {
202
- return;
203
- }
204
- $(this).removeClass("ui-resizable-autohide");
205
- that._handles.show();
206
- })
207
- .mouseleave(function(){
208
- if (o.disabled) {
209
- return;
210
- }
211
- if (!that.resizing) {
212
- $(this).addClass("ui-resizable-autohide");
213
- that._handles.hide();
214
- }
215
- });
216
- }
217
-
218
- //Initialize the mouse interaction
219
- this._mouseInit();
220
-
221
- },
222
-
223
- _destroy: function() {
224
-
225
- this._mouseDestroy();
226
-
227
- var wrapper,
228
- _destroy = function(exp) {
229
- $(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
230
- .removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove();
231
- };
232
-
233
- //TODO: Unwrap at same DOM position
234
- if (this.elementIsWrapper) {
235
- _destroy(this.element);
236
- wrapper = this.element;
237
- this.originalElement.css({
238
- position: wrapper.css("position"),
239
- width: wrapper.outerWidth(),
240
- height: wrapper.outerHeight(),
241
- top: wrapper.css("top"),
242
- left: wrapper.css("left")
243
- }).insertAfter( wrapper );
244
- wrapper.remove();
245
- }
246
-
247
- this.originalElement.css("resize", this.originalResizeStyle);
248
- _destroy(this.originalElement);
249
-
250
- return this;
251
- },
252
-
253
- _mouseCapture: function(event) {
254
- var i, handle,
255
- capture = false;
256
-
257
- for (i in this.handles) {
258
- handle = $(this.handles[i])[0];
259
- if (handle === event.target || $.contains(handle, event.target)) {
260
- capture = true;
261
- }
262
- }
263
-
264
- return !this.options.disabled && capture;
265
- },
266
-
267
- _mouseStart: function(event) {
268
-
269
- var curleft, curtop, cursor,
270
- o = this.options,
271
- iniPos = this.element.position(),
272
- el = this.element;
273
-
274
- this.resizing = true;
275
-
276
- // bugfix for http://dev.jquery.com/ticket/1749
277
- if ( (/absolute/).test( el.css("position") ) ) {
278
- el.css({ position: "absolute", top: el.css("top"), left: el.css("left") });
279
- } else if (el.is(".ui-draggable")) {
280
- el.css({ position: "absolute", top: iniPos.top, left: iniPos.left });
281
- }
282
-
283
- this._renderProxy();
284
-
285
- curleft = num(this.helper.css("left"));
286
- curtop = num(this.helper.css("top"));
287
-
288
- if (o.containment) {
289
- curleft += $(o.containment).scrollLeft() || 0;
290
- curtop += $(o.containment).scrollTop() || 0;
291
- }
292
-
293
- //Store needed variables
294
- this.offset = this.helper.offset();
295
- this.position = { left: curleft, top: curtop };
296
- this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
297
- this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
298
- this.originalPosition = { left: curleft, top: curtop };
299
- this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() };
300
- this.originalMousePosition = { left: event.pageX, top: event.pageY };
301
-
302
- //Aspect Ratio
303
- this.aspectRatio = (typeof o.aspectRatio === "number") ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1);
304
-
305
- cursor = $(".ui-resizable-" + this.axis).css("cursor");
306
- $("body").css("cursor", cursor === "auto" ? this.axis + "-resize" : cursor);
307
-
308
- el.addClass("ui-resizable-resizing");
309
- this._propagate("start", event);
310
- return true;
311
- },
312
-
313
- _mouseDrag: function(event) {
314
-
315
- //Increase performance, avoid regex
316
- var data,
317
- el = this.helper, props = {},
318
- smp = this.originalMousePosition,
319
- a = this.axis,
320
- prevTop = this.position.top,
321
- prevLeft = this.position.left,
322
- prevWidth = this.size.width,
323
- prevHeight = this.size.height,
324
- dx = (event.pageX-smp.left)||0,
325
- dy = (event.pageY-smp.top)||0,
326
- trigger = this._change[a];
327
-
328
- if (!trigger) {
329
- return false;
330
- }
331
-
332
- // Calculate the attrs that will be change
333
- data = trigger.apply(this, [event, dx, dy]);
334
-
335
- // Put this in the mouseDrag handler since the user can start pressing shift while resizing
336
- this._updateVirtualBoundaries(event.shiftKey);
337
- if (this._aspectRatio || event.shiftKey) {
338
- data = this._updateRatio(data, event);
339
- }
340
-
341
- data = this._respectSize(data, event);
342
-
343
- this._updateCache(data);
344
-
345
- // plugins callbacks need to be called first
346
- this._propagate("resize", event);
347
-
348
- if (this.position.top !== prevTop) {
349
- props.top = this.position.top + "px";
350
- }
351
- if (this.position.left !== prevLeft) {
352
- props.left = this.position.left + "px";
353
- }
354
- if (this.size.width !== prevWidth) {
355
- props.width = this.size.width + "px";
356
- }
357
- if (this.size.height !== prevHeight) {
358
- props.height = this.size.height + "px";
359
- }
360
- el.css(props);
361
-
362
- if (!this._helper && this._proportionallyResizeElements.length) {
363
- this._proportionallyResize();
364
- }
365
-
366
- // Call the user callback if the element was resized
367
- if ( ! $.isEmptyObject(props) ) {
368
- this._trigger("resize", event, this.ui());
369
- }
370
-
371
- return false;
372
- },
373
-
374
- _mouseStop: function(event) {
375
-
376
- this.resizing = false;
377
- var pr, ista, soffseth, soffsetw, s, left, top,
378
- o = this.options, that = this;
379
-
380
- if(this._helper) {
381
-
382
- pr = this._proportionallyResizeElements;
383
- ista = pr.length && (/textarea/i).test(pr[0].nodeName);
384
- soffseth = ista && $.ui.hasScroll(pr[0], "left") /* TODO - jump height */ ? 0 : that.sizeDiff.height;
385
- soffsetw = ista ? 0 : that.sizeDiff.width;
386
-
387
- s = { width: (that.helper.width() - soffsetw), height: (that.helper.height() - soffseth) };
388
- left = (parseInt(that.element.css("left"), 10) + (that.position.left - that.originalPosition.left)) || null;
389
- top = (parseInt(that.element.css("top"), 10) + (that.position.top - that.originalPosition.top)) || null;
390
-
391
- if (!o.animate) {
392
- this.element.css($.extend(s, { top: top, left: left }));
393
- }
394
-
395
- that.helper.height(that.size.height);
396
- that.helper.width(that.size.width);
397
-
398
- if (this._helper && !o.animate) {
399
- this._proportionallyResize();
400
- }
401
- }
402
-
403
- $("body").css("cursor", "auto");
404
-
405
- this.element.removeClass("ui-resizable-resizing");
406
-
407
- this._propagate("stop", event);
408
-
409
- if (this._helper) {
410
- this.helper.remove();
411
- }
412
-
413
- return false;
414
-
415
- },
416
-
417
- _updateVirtualBoundaries: function(forceAspectRatio) {
418
- var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
419
- o = this.options;
420
-
421
- b = {
422
- minWidth: isNumber(o.minWidth) ? o.minWidth : 0,
423
- maxWidth: isNumber(o.maxWidth) ? o.maxWidth : Infinity,
424
- minHeight: isNumber(o.minHeight) ? o.minHeight : 0,
425
- maxHeight: isNumber(o.maxHeight) ? o.maxHeight : Infinity
426
- };
427
-
428
- if(this._aspectRatio || forceAspectRatio) {
429
- // We want to create an enclosing box whose aspect ration is the requested one
430
- // First, compute the "projected" size for each dimension based on the aspect ratio and other dimension
431
- pMinWidth = b.minHeight * this.aspectRatio;
432
- pMinHeight = b.minWidth / this.aspectRatio;
433
- pMaxWidth = b.maxHeight * this.aspectRatio;
434
- pMaxHeight = b.maxWidth / this.aspectRatio;
435
-
436
- if(pMinWidth > b.minWidth) {
437
- b.minWidth = pMinWidth;
438
- }
439
- if(pMinHeight > b.minHeight) {
440
- b.minHeight = pMinHeight;
441
- }
442
- if(pMaxWidth < b.maxWidth) {
443
- b.maxWidth = pMaxWidth;
444
- }
445
- if(pMaxHeight < b.maxHeight) {
446
- b.maxHeight = pMaxHeight;
447
- }
448
- }
449
- this._vBoundaries = b;
450
- },
451
-
452
- _updateCache: function(data) {
453
- this.offset = this.helper.offset();
454
- if (isNumber(data.left)) {
455
- this.position.left = data.left;
456
- }
457
- if (isNumber(data.top)) {
458
- this.position.top = data.top;
459
- }
460
- if (isNumber(data.height)) {
461
- this.size.height = data.height;
462
- }
463
- if (isNumber(data.width)) {
464
- this.size.width = data.width;
465
- }
466
- },
467
-
468
- _updateRatio: function( data ) {
469
-
470
- var cpos = this.position,
471
- csize = this.size,
472
- a = this.axis;
473
-
474
- if (isNumber(data.height)) {
475
- data.width = (data.height * this.aspectRatio);
476
- } else if (isNumber(data.width)) {
477
- data.height = (data.width / this.aspectRatio);
478
- }
479
-
480
- if (a === "sw") {
481
- data.left = cpos.left + (csize.width - data.width);
482
- data.top = null;
483
- }
484
- if (a === "nw") {
485
- data.top = cpos.top + (csize.height - data.height);
486
- data.left = cpos.left + (csize.width - data.width);
487
- }
488
-
489
- return data;
490
- },
491
-
492
- _respectSize: function( data ) {
493
-
494
- var o = this._vBoundaries,
495
- a = this.axis,
496
- ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
497
- isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height),
498
- dw = this.originalPosition.left + this.originalSize.width,
499
- dh = this.position.top + this.size.height,
500
- cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
501
- if (isminw) {
502
- data.width = o.minWidth;
503
- }
504
- if (isminh) {
505
- data.height = o.minHeight;
506
- }
507
- if (ismaxw) {
508
- data.width = o.maxWidth;
509
- }
510
- if (ismaxh) {
511
- data.height = o.maxHeight;
512
- }
513
-
514
- if (isminw && cw) {
515
- data.left = dw - o.minWidth;
516
- }
517
- if (ismaxw && cw) {
518
- data.left = dw - o.maxWidth;
519
- }
520
- if (isminh && ch) {
521
- data.top = dh - o.minHeight;
522
- }
523
- if (ismaxh && ch) {
524
- data.top = dh - o.maxHeight;
525
- }
526
-
527
- // fixing jump error on top/left - bug #2330
528
- if (!data.width && !data.height && !data.left && data.top) {
529
- data.top = null;
530
- } else if (!data.width && !data.height && !data.top && data.left) {
531
- data.left = null;
532
- }
533
-
534
- return data;
535
- },
536
-
537
- _proportionallyResize: function() {
538
-
539
- if (!this._proportionallyResizeElements.length) {
540
- return;
541
- }
542
-
543
- var i, j, borders, paddings, prel,
544
- element = this.helper || this.element;
545
-
546
- for ( i=0; i < this._proportionallyResizeElements.length; i++) {
547
-
548
- prel = this._proportionallyResizeElements[i];
549
-
550
- if (!this.borderDif) {
551
- this.borderDif = [];
552
- borders = [prel.css("borderTopWidth"), prel.css("borderRightWidth"), prel.css("borderBottomWidth"), prel.css("borderLeftWidth")];
553
- paddings = [prel.css("paddingTop"), prel.css("paddingRight"), prel.css("paddingBottom"), prel.css("paddingLeft")];
554
-
555
- for ( j = 0; j < borders.length; j++ ) {
556
- this.borderDif[ j ] = ( parseInt( borders[ j ], 10 ) || 0 ) + ( parseInt( paddings[ j ], 10 ) || 0 );
557
- }
558
- }
559
-
560
- prel.css({
561
- height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0,
562
- width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0
563
- });
564
-
565
- }
566
-
567
- },
568
-
569
- _renderProxy: function() {
570
-
571
- var el = this.element, o = this.options;
572
- this.elementOffset = el.offset();
573
-
574
- if(this._helper) {
575
-
576
- this.helper = this.helper || $("<div style='overflow:hidden;'></div>");
577
-
578
- this.helper.addClass(this._helper).css({
579
- width: this.element.outerWidth() - 1,
580
- height: this.element.outerHeight() - 1,
581
- position: "absolute",
582
- left: this.elementOffset.left +"px",
583
- top: this.elementOffset.top +"px",
584
- zIndex: ++o.zIndex //TODO: Don't modify option
585
- });
586
-
587
- this.helper
588
- .appendTo("body")
589
- .disableSelection();
590
-
591
- } else {
592
- this.helper = this.element;
593
- }
594
-
595
- },
596
-
597
- _change: {
598
- e: function(event, dx) {
599
- return { width: this.originalSize.width + dx };
600
- },
601
- w: function(event, dx) {
602
- var cs = this.originalSize, sp = this.originalPosition;
603
- return { left: sp.left + dx, width: cs.width - dx };
604
- },
605
- n: function(event, dx, dy) {
606
- var cs = this.originalSize, sp = this.originalPosition;
607
- return { top: sp.top + dy, height: cs.height - dy };
608
- },
609
- s: function(event, dx, dy) {
610
- return { height: this.originalSize.height + dy };
611
- },
612
- se: function(event, dx, dy) {
613
- return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
614
- },
615
- sw: function(event, dx, dy) {
616
- return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
617
- },
618
- ne: function(event, dx, dy) {
619
- return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
620
- },
621
- nw: function(event, dx, dy) {
622
- return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
623
- }
624
- },
625
-
626
- _propagate: function(n, event) {
627
- $.ui.plugin.call(this, n, [event, this.ui()]);
628
- (n !== "resize" && this._trigger(n, event, this.ui()));
629
- },
630
-
631
- plugins: {},
632
-
633
- ui: function() {
634
- return {
635
- originalElement: this.originalElement,
636
- element: this.element,
637
- helper: this.helper,
638
- position: this.position,
639
- size: this.size,
640
- originalSize: this.originalSize,
641
- originalPosition: this.originalPosition
642
- };
643
- }
644
-
645
- });
646
-
647
- /*
648
- * Resizable Extensions
649
- */
650
-
651
- $.ui.plugin.add("resizable", "animate", {
652
-
653
- stop: function( event ) {
654
- var that = $(this).data("ui-resizable"),
655
- o = that.options,
656
- pr = that._proportionallyResizeElements,
657
- ista = pr.length && (/textarea/i).test(pr[0].nodeName),
658
- soffseth = ista && $.ui.hasScroll(pr[0], "left") /* TODO - jump height */ ? 0 : that.sizeDiff.height,
659
- soffsetw = ista ? 0 : that.sizeDiff.width,
660
- style = { width: (that.size.width - soffsetw), height: (that.size.height - soffseth) },
661
- left = (parseInt(that.element.css("left"), 10) + (that.position.left - that.originalPosition.left)) || null,
662
- top = (parseInt(that.element.css("top"), 10) + (that.position.top - that.originalPosition.top)) || null;
663
-
664
- that.element.animate(
665
- $.extend(style, top && left ? { top: top, left: left } : {}), {
666
- duration: o.animateDuration,
667
- easing: o.animateEasing,
668
- step: function() {
669
-
670
- var data = {
671
- width: parseInt(that.element.css("width"), 10),
672
- height: parseInt(that.element.css("height"), 10),
673
- top: parseInt(that.element.css("top"), 10),
674
- left: parseInt(that.element.css("left"), 10)
675
- };
676
-
677
- if (pr && pr.length) {
678
- $(pr[0]).css({ width: data.width, height: data.height });
679
- }
680
-
681
- // propagating resize, and updating values for each animation step
682
- that._updateCache(data);
683
- that._propagate("resize", event);
684
-
685
- }
686
- }
687
- );
688
- }
689
-
690
- });
691
-
692
- $.ui.plugin.add("resizable", "containment", {
693
-
694
- start: function() {
695
- var element, p, co, ch, cw, width, height,
696
- that = $(this).data("ui-resizable"),
697
- o = that.options,
698
- el = that.element,
699
- oc = o.containment,
700
- ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc;
701
-
702
- if (!ce) {
703
- return;
704
- }
705
-
706
- that.containerElement = $(ce);
707
-
708
- if (/document/.test(oc) || oc === document) {
709
- that.containerOffset = { left: 0, top: 0 };
710
- that.containerPosition = { left: 0, top: 0 };
711
-
712
- that.parentData = {
713
- element: $(document), left: 0, top: 0,
714
- width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight
715
- };
716
- }
717
-
718
- // i'm a node, so compute top, left, right, bottom
719
- else {
720
- element = $(ce);
721
- p = [];
722
- $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); });
723
-
724
- that.containerOffset = element.offset();
725
- that.containerPosition = element.position();
726
- that.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) };
727
-
728
- co = that.containerOffset;
729
- ch = that.containerSize.height;
730
- cw = that.containerSize.width;
731
- width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw );
732
- height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch);
733
-
734
- that.parentData = {
735
- element: ce, left: co.left, top: co.top, width: width, height: height
736
- };
737
- }
738
- },
739
-
740
- resize: function( event ) {
741
- var woset, hoset, isParent, isOffsetRelative,
742
- that = $(this).data("ui-resizable"),
743
- o = that.options,
744
- co = that.containerOffset, cp = that.position,
745
- pRatio = that._aspectRatio || event.shiftKey,
746
- cop = { top:0, left:0 }, ce = that.containerElement;
747
-
748
- if (ce[0] !== document && (/static/).test(ce.css("position"))) {
749
- cop = co;
750
- }
751
-
752
- if (cp.left < (that._helper ? co.left : 0)) {
753
- that.size.width = that.size.width + (that._helper ? (that.position.left - co.left) : (that.position.left - cop.left));
754
- if (pRatio) {
755
- that.size.height = that.size.width / that.aspectRatio;
756
- }
757
- that.position.left = o.helper ? co.left : 0;
758
- }
759
-
760
- if (cp.top < (that._helper ? co.top : 0)) {
761
- that.size.height = that.size.height + (that._helper ? (that.position.top - co.top) : that.position.top);
762
- if (pRatio) {
763
- that.size.width = that.size.height * that.aspectRatio;
764
- }
765
- that.position.top = that._helper ? co.top : 0;
766
- }
767
-
768
- that.offset.left = that.parentData.left+that.position.left;
769
- that.offset.top = that.parentData.top+that.position.top;
770
-
771
- woset = Math.abs( (that._helper ? that.offset.left - cop.left : (that.offset.left - cop.left)) + that.sizeDiff.width );
772
- hoset = Math.abs( (that._helper ? that.offset.top - cop.top : (that.offset.top - co.top)) + that.sizeDiff.height );
773
-
774
- isParent = that.containerElement.get(0) === that.element.parent().get(0);
775
- isOffsetRelative = /relative|absolute/.test(that.containerElement.css("position"));
776
-
777
- if(isParent && isOffsetRelative) {
778
- woset -= that.parentData.left;
779
- }
780
-
781
- if (woset + that.size.width >= that.parentData.width) {
782
- that.size.width = that.parentData.width - woset;
783
- if (pRatio) {
784
- that.size.height = that.size.width / that.aspectRatio;
785
- }
786
- }
787
-
788
- if (hoset + that.size.height >= that.parentData.height) {
789
- that.size.height = that.parentData.height - hoset;
790
- if (pRatio) {
791
- that.size.width = that.size.height * that.aspectRatio;
792
- }
793
- }
794
- },
795
-
796
- stop: function(){
797
- var that = $(this).data("ui-resizable"),
798
- o = that.options,
799
- co = that.containerOffset,
800
- cop = that.containerPosition,
801
- ce = that.containerElement,
802
- helper = $(that.helper),
803
- ho = helper.offset(),
804
- w = helper.outerWidth() - that.sizeDiff.width,
805
- h = helper.outerHeight() - that.sizeDiff.height;
806
-
807
- if (that._helper && !o.animate && (/relative/).test(ce.css("position"))) {
808
- $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
809
- }
810
-
811
- if (that._helper && !o.animate && (/static/).test(ce.css("position"))) {
812
- $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
813
- }
814
-
815
- }
816
- });
817
-
818
- $.ui.plugin.add("resizable", "alsoResize", {
819
-
820
- start: function () {
821
- var that = $(this).data("ui-resizable"),
822
- o = that.options,
823
- _store = function (exp) {
824
- $(exp).each(function() {
825
- var el = $(this);
826
- el.data("ui-resizable-alsoresize", {
827
- width: parseInt(el.width(), 10), height: parseInt(el.height(), 10),
828
- left: parseInt(el.css("left"), 10), top: parseInt(el.css("top"), 10)
829
- });
830
- });
831
- };
832
-
833
- if (typeof(o.alsoResize) === "object" && !o.alsoResize.parentNode) {
834
- if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); }
835
- else { $.each(o.alsoResize, function (exp) { _store(exp); }); }
836
- }else{
837
- _store(o.alsoResize);
838
- }
839
- },
840
-
841
- resize: function (event, ui) {
842
- var that = $(this).data("ui-resizable"),
843
- o = that.options,
844
- os = that.originalSize,
845
- op = that.originalPosition,
846
- delta = {
847
- height: (that.size.height - os.height) || 0, width: (that.size.width - os.width) || 0,
848
- top: (that.position.top - op.top) || 0, left: (that.position.left - op.left) || 0
849
- },
850
-
851
- _alsoResize = function (exp, c) {
852
- $(exp).each(function() {
853
- var el = $(this), start = $(this).data("ui-resizable-alsoresize"), style = {},
854
- css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ["width", "height"] : ["width", "height", "top", "left"];
855
-
856
- $.each(css, function (i, prop) {
857
- var sum = (start[prop]||0) + (delta[prop]||0);
858
- if (sum && sum >= 0) {
859
- style[prop] = sum || null;
860
- }
861
- });
862
-
863
- el.css(style);
864
- });
865
- };
866
-
867
- if (typeof(o.alsoResize) === "object" && !o.alsoResize.nodeType) {
868
- $.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); });
869
- }else{
870
- _alsoResize(o.alsoResize);
871
- }
872
- },
873
-
874
- stop: function () {
875
- $(this).removeData("resizable-alsoresize");
876
- }
877
- });
878
-
879
- $.ui.plugin.add("resizable", "ghost", {
880
-
881
- start: function() {
882
-
883
- var that = $(this).data("ui-resizable"), o = that.options, cs = that.size;
884
-
885
- that.ghost = that.originalElement.clone();
886
- that.ghost
887
- .css({ opacity: 0.25, display: "block", position: "relative", height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 })
888
- .addClass("ui-resizable-ghost")
889
- .addClass(typeof o.ghost === "string" ? o.ghost : "");
890
-
891
- that.ghost.appendTo(that.helper);
892
-
893
- },
894
-
895
- resize: function(){
896
- var that = $(this).data("ui-resizable");
897
- if (that.ghost) {
898
- that.ghost.css({ position: "relative", height: that.size.height, width: that.size.width });
899
- }
900
- },
901
-
902
- stop: function() {
903
- var that = $(this).data("ui-resizable");
904
- if (that.ghost && that.helper) {
905
- that.helper.get(0).removeChild(that.ghost.get(0));
906
- }
907
- }
908
-
909
- });
910
-
911
- $.ui.plugin.add("resizable", "grid", {
912
-
913
- resize: function() {
914
- var that = $(this).data("ui-resizable"),
915
- o = that.options,
916
- cs = that.size,
917
- os = that.originalSize,
918
- op = that.originalPosition,
919
- a = that.axis,
920
- grid = typeof o.grid === "number" ? [o.grid, o.grid] : o.grid,
921
- gridX = (grid[0]||1),
922
- gridY = (grid[1]||1),
923
- ox = Math.round((cs.width - os.width) / gridX) * gridX,
924
- oy = Math.round((cs.height - os.height) / gridY) * gridY,
925
- newWidth = os.width + ox,
926
- newHeight = os.height + oy,
927
- isMaxWidth = o.maxWidth && (o.maxWidth < newWidth),
928
- isMaxHeight = o.maxHeight && (o.maxHeight < newHeight),
929
- isMinWidth = o.minWidth && (o.minWidth > newWidth),
930
- isMinHeight = o.minHeight && (o.minHeight > newHeight);
931
-
932
- o.grid = grid;
933
-
934
- if (isMinWidth) {
935
- newWidth = newWidth + gridX;
936
- }
937
- if (isMinHeight) {
938
- newHeight = newHeight + gridY;
939
- }
940
- if (isMaxWidth) {
941
- newWidth = newWidth - gridX;
942
- }
943
- if (isMaxHeight) {
944
- newHeight = newHeight - gridY;
945
- }
946
-
947
- if (/^(se|s|e)$/.test(a)) {
948
- that.size.width = newWidth;
949
- that.size.height = newHeight;
950
- } else if (/^(ne)$/.test(a)) {
951
- that.size.width = newWidth;
952
- that.size.height = newHeight;
953
- that.position.top = op.top - oy;
954
- } else if (/^(sw)$/.test(a)) {
955
- that.size.width = newWidth;
956
- that.size.height = newHeight;
957
- that.position.left = op.left - ox;
958
- } else {
959
- that.size.width = newWidth;
960
- that.size.height = newHeight;
961
- that.position.top = op.top - oy;
962
- that.position.left = op.left - ox;
963
- }
964
- }
965
-
966
- });
967
-
968
- })(jQuery);
1
+ /*! jQuery UI - v1.10.3 - 2013-05-03
2
+ * http://jqueryui.com
3
+ * Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
4
+ (function(e){function t(e){return parseInt(e,10)||0}function i(e){return!isNaN(parseInt(e,10))}e.widget("ui.resizable",e.ui.mouse,{version:"1.10.3",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var t,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(e(".ui-resizable-handle",this.element).length?{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"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;t.length>i;i++)s=e.trim(t[i]),a="ui-resizable-"+s,n=e("<div class='ui-resizable-handle "+a+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(t){var i,s,n,a;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=e(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=e(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(n,a),this._proportionallyResize()),e(this.handles[i]).length},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(e(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,s,n=!1;for(i in this.handles)s=e(this.handles[i])[0],(s===t.target||e.contains(s,t.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(i){var s,n,a,o=this.options,r=this.element.position(),h=this.element;return this.resizing=!0,/absolute/.test(h.css("position"))?h.css({position:"absolute",top:h.css("top"),left:h.css("left")}):h.is(".ui-draggable")&&h.css({position:"absolute",top:r.top,left:r.left}),this._renderProxy(),s=t(this.helper.css("left")),n=t(this.helper.css("top")),o.containment&&(s+=e(o.containment).scrollLeft()||0,n+=e(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:s,top:n},this.size=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalSize=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalPosition={left:s,top:n},this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()},this.originalMousePosition={left:i.pageX,top:i.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,a=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===a?this.axis+"-resize":a),h.addClass("ui-resizable-resizing"),this._propagate("start",i),!0},_mouseDrag:function(t){var i,s=this.helper,n={},a=this.originalMousePosition,o=this.axis,r=this.position.top,h=this.position.left,l=this.size.width,u=this.size.height,c=t.pageX-a.left||0,d=t.pageY-a.top||0,p=this._change[o];return p?(i=p.apply(this,[t,c,d]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),this.position.top!==r&&(n.top=this.position.top+"px"),this.position.left!==h&&(n.left=this.position.left+"px"),this.size.width!==l&&(n.width=this.size.width+"px"),this.size.height!==u&&(n.height=this.size.height+"px"),s.css(n),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(n)||this._trigger("resize",t,this.ui()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&e.ui.hasScroll(i[0],"left")?0:u.sizeDiff.height,a=s?0:u.sizeDiff.width,o={width:u.helper.width()-a,height:u.helper.height()-n},r=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,h=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(e.extend(o,{top:h,left:r})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(e){var t,s,n,a,o,r=this.options;o={minWidth:i(r.minWidth)?r.minWidth:0,maxWidth:i(r.maxWidth)?r.maxWidth:1/0,minHeight:i(r.minHeight)?r.minHeight:0,maxHeight:i(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||e)&&(t=o.minHeight*this.aspectRatio,n=o.minWidth/this.aspectRatio,s=o.maxHeight*this.aspectRatio,a=o.maxWidth/this.aspectRatio,t>o.minWidth&&(o.minWidth=t),n>o.minHeight&&(o.minHeight=n),o.maxWidth>s&&(o.maxWidth=s),o.maxHeight>a&&(o.maxHeight=a)),this._vBoundaries=o},_updateCache:function(e){this.offset=this.helper.offset(),i(e.left)&&(this.position.left=e.left),i(e.top)&&(this.position.top=e.top),i(e.height)&&(this.size.height=e.height),i(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,s=this.size,n=this.axis;return i(e.height)?e.width=e.height*this.aspectRatio:i(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===n&&(e.left=t.left+(s.width-e.width),e.top=null),"nw"===n&&(e.top=t.top+(s.height-e.height),e.left=t.left+(s.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,s=this.axis,n=i(e.width)&&t.maxWidth&&t.maxWidth<e.width,a=i(e.height)&&t.maxHeight&&t.maxHeight<e.height,o=i(e.width)&&t.minWidth&&t.minWidth>e.width,r=i(e.height)&&t.minHeight&&t.minHeight>e.height,h=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,u=/sw|nw|w/.test(s),c=/nw|ne|n/.test(s);return o&&(e.width=t.minWidth),r&&(e.height=t.minHeight),n&&(e.width=t.maxWidth),a&&(e.height=t.maxHeight),o&&u&&(e.left=h-t.minWidth),n&&u&&(e.left=h-t.maxWidth),r&&c&&(e.top=l-t.minHeight),a&&c&&(e.top=l-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var e,t,i,s,n,a=this.helper||this.element;for(e=0;this._proportionallyResizeElements.length>e;e++){if(n=this._proportionallyResizeElements[e],!this.borderDif)for(this.borderDif=[],i=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],s=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")],t=0;i.length>t;t++)this.borderDif[t]=(parseInt(i[t],10)||0)+(parseInt(s[t],10)||0);n.css({height:a.height()-this.borderDif[0]-this.borderDif[2]||0,width:a.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},sw:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,s]))},ne:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},nw:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,s]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).data("ui-resizable"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&e.ui.hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(h,u&&l?{top:u,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&e(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var i,s,n,a,o,r,h,l=e(this).data("ui-resizable"),u=l.options,c=l.element,d=u.containment,p=d instanceof e?d.get(0):/parent/.test(d)?c.parent().get(0):d;p&&(l.containerElement=e(p),/document/.test(d)||d===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(i=e(p),s=[],e(["Top","Right","Left","Bottom"]).each(function(e,n){s[e]=t(i.css("padding"+n))}),l.containerOffset=i.offset(),l.containerPosition=i.position(),l.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},n=l.containerOffset,a=l.containerSize.height,o=l.containerSize.width,r=e.ui.hasScroll(p,"left")?p.scrollWidth:o,h=e.ui.hasScroll(p)?p.scrollHeight:a,l.parentData={element:p,left:n.left,top:n.top,width:r,height:h}))},resize:function(t){var i,s,n,a,o=e(this).data("ui-resizable"),r=o.options,h=o.containerOffset,l=o.position,u=o._aspectRatio||t.shiftKey,c={top:0,left:0},d=o.containerElement;d[0]!==document&&/static/.test(d.css("position"))&&(c=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-c.left),u&&(o.size.height=o.size.width/o.aspectRatio),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),u&&(o.size.width=o.size.height*o.aspectRatio),o.position.top=o._helper?h.top:0),o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top,i=Math.abs((o._helper?o.offset.left-c.left:o.offset.left-c.left)+o.sizeDiff.width),s=Math.abs((o._helper?o.offset.top-c.top:o.offset.top-h.top)+o.sizeDiff.height),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a&&(i-=o.parentData.left),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,u&&(o.size.height=o.size.width/o.aspectRatio)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,u&&(o.size.width=o.size.height*o.aspectRatio))},stop:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.containerOffset,n=t.containerPosition,a=t.containerElement,o=e(t.helper),r=o.offset(),h=o.outerWidth()-t.sizeDiff.width,l=o.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).data("ui-resizable"),i=t.options,s=function(t){e(t).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):e.each(i.alsoResize,function(e){s(e)})},resize:function(t,i){var s=e(this).data("ui-resizable"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0},h=function(t,s){e(t).each(function(){var t=e(this),n=e(this).data("ui-resizable-alsoresize"),a={},o=s&&s.length?s:t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(o,function(e,t){var i=(n[t]||0)+(r[t]||0);i&&i>=0&&(a[t]=i||null)}),t.css(a)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):e.each(n.alsoResize,function(e,t){h(e,t)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).data("ui-resizable");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).data("ui-resizable");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.size,n=t.originalSize,a=t.originalPosition,o=t.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=r[0]||1,l=r[1]||1,u=Math.round((s.width-n.width)/h)*h,c=Math.round((s.height-n.height)/l)*l,d=n.width+u,p=n.height+c,f=i.maxWidth&&d>i.maxWidth,m=i.maxHeight&&p>i.maxHeight,g=i.minWidth&&i.minWidth>d,v=i.minHeight&&i.minHeight>p;i.grid=r,g&&(d+=h),v&&(p+=l),f&&(d-=h),m&&(p-=l),/^(se|s|e)$/.test(o)?(t.size.width=d,t.size.height=p):/^(ne)$/.test(o)?(t.size.width=d,t.size.height=p,t.position.top=a.top-c):/^(sw)$/.test(o)?(t.size.width=d,t.size.height=p,t.position.left=a.left-u):(t.size.width=d,t.size.height=p,t.position.top=a.top-c,t.position.left=a.left-u)}})})(jQuery);