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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +1 -0
- data/Vendorfile +196 -0
- data/h2ocube_rails_assets.gemspec +3 -4
- data/lib/h2ocube_rails_assets.rb +8 -6
- data/test/jquery_test.rb +1 -1
- data/test/turbolinks_test.rb +1 -3
- data/vendor/assets/images/jquery.fancybox/fancybox_loading.gif +0 -0
- data/vendor/assets/images/jquery.fancybox/fancybox_loading@2x.gif +0 -0
- data/vendor/assets/images/jquery.fancybox/fancybox_sprite@2x.png +0 -0
- data/vendor/assets/javascripts/backbone.js +4 -1571
- data/vendor/assets/javascripts/bootstrap.js +6 -2276
- data/vendor/assets/javascripts/highcharts.js +272 -15281
- data/vendor/assets/javascripts/jasny-bootstrap.js +7 -3060
- data/vendor/assets/javascripts/jquery/1.10.js +6 -9807
- data/vendor/assets/javascripts/jquery/1.8.js +2 -9472
- data/vendor/assets/javascripts/jquery/1.9.js +5 -9597
- data/vendor/assets/javascripts/jquery/2.0.js +5 -8841
- data/vendor/assets/javascripts/jquery.cookie.js +26 -23
- data/vendor/assets/javascripts/jquery.fancybox.js +46 -1983
- data/vendor/assets/javascripts/jquery.fileupload.js +1329 -4
- data/vendor/assets/javascripts/jquery.iframe-transport.js +24 -4
- data/vendor/assets/javascripts/jquery.js +1 -1
- data/vendor/assets/javascripts/jquery.lazyload.js +3 -216
- data/vendor/assets/javascripts/jquery.mobile.js +7 -11092
- data/vendor/assets/javascripts/jquery.pnotify.js +29 -903
- data/vendor/assets/javascripts/jquery.timeago.coffee +2 -4
- data/vendor/assets/javascripts/jquery.turbolinks.coffee +40 -51
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.accordion.js +4 -572
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.autocomplete.js +4 -610
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.button.js +4 -419
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.core.js +4 -320
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.datepicker.js +5 -2050
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.dialog.js +4 -808
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.draggable.js +4 -933
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.droppable.js +4 -372
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-blind.js +4 -82
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-bounce.js +4 -113
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-clip.js +4 -67
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-drop.js +4 -65
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-explode.js +4 -97
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-fade.js +4 -30
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-fold.js +4 -76
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-highlight.js +4 -50
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-pulsate.js +4 -63
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-scale.js +4 -318
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-shake.js +4 -74
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-slide.js +4 -64
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-transfer.js +4 -47
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect.js +4 -1289
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.menu.js +4 -621
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.mouse.js +4 -169
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.position.js +4 -497
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.progressbar.js +4 -145
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.resizable.js +4 -968
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.selectable.js +4 -277
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.slider.js +4 -672
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.sortable.js +4 -1282
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.spinner.js +4 -493
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.tabs.js +4 -846
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.tooltip.js +4 -402
- data/vendor/assets/javascripts/jquery.ui/jquery.ui.widget.js +4 -521
- data/vendor/assets/javascripts/jquery.validate.js +2 -1207
- data/vendor/assets/javascripts/lazyload.js +4 -391
- data/vendor/assets/javascripts/sammy.js +5 -2117
- data/vendor/assets/javascripts/underscore.js +4 -1224
- data/vendor/assets/javascripts/zepto.js +1 -1564
- data/vendor/assets/stylesheets/bootstrap.responsive.css +2 -1102
- data/vendor/assets/stylesheets/bootstrap.scss +2 -6151
- data/vendor/assets/stylesheets/jasny-bootstrap.responsive.css +2 -1263
- data/vendor/assets/stylesheets/jasny-bootstrap.scss +2 -7591
- data/vendor/assets/stylesheets/jquery.fancybox.scss +27 -2
- data/vendor/assets/stylesheets/jquery.mobile.scss +2 -3356
- data/vendor/assets/stylesheets/jquery.ui.scss +2 -1184
- metadata +43 -19
- data/vendor/assets/images/jquery.mobile/ajax-loader.gif +0 -0
- data/vendor/assets/images/jquery.mobile/icons-18-black.png +0 -0
- data/vendor/assets/images/jquery.mobile/icons-18-white.png +0 -0
- data/vendor/assets/images/jquery.mobile/icons-36-black.png +0 -0
- data/vendor/assets/images/jquery.mobile/icons-36-white.png +0 -0
- data/vendor/assets/javascripts/_jquery.fileupload.js +0 -1164
- data/vendor/assets/javascripts/zepto/fx_methods.js +0 -71
@@ -1,808 +1,4 @@
|
|
1
|
-
/*!
|
2
|
-
|
3
|
-
|
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/dialog/
|
10
|
-
*
|
11
|
-
* Depends:
|
12
|
-
* jquery.ui.core.js
|
13
|
-
* jquery.ui.widget.js
|
14
|
-
* jquery.ui.button.js
|
15
|
-
* jquery.ui.draggable.js
|
16
|
-
* jquery.ui.mouse.js
|
17
|
-
* jquery.ui.position.js
|
18
|
-
* jquery.ui.resizable.js
|
19
|
-
*/
|
20
|
-
(function( $, undefined ) {
|
21
|
-
|
22
|
-
var sizeRelatedOptions = {
|
23
|
-
buttons: true,
|
24
|
-
height: true,
|
25
|
-
maxHeight: true,
|
26
|
-
maxWidth: true,
|
27
|
-
minHeight: true,
|
28
|
-
minWidth: true,
|
29
|
-
width: true
|
30
|
-
},
|
31
|
-
resizableRelatedOptions = {
|
32
|
-
maxHeight: true,
|
33
|
-
maxWidth: true,
|
34
|
-
minHeight: true,
|
35
|
-
minWidth: true
|
36
|
-
};
|
37
|
-
|
38
|
-
$.widget( "ui.dialog", {
|
39
|
-
version: "1.10.2",
|
40
|
-
options: {
|
41
|
-
appendTo: "body",
|
42
|
-
autoOpen: true,
|
43
|
-
buttons: [],
|
44
|
-
closeOnEscape: true,
|
45
|
-
closeText: "close",
|
46
|
-
dialogClass: "",
|
47
|
-
draggable: true,
|
48
|
-
hide: null,
|
49
|
-
height: "auto",
|
50
|
-
maxHeight: null,
|
51
|
-
maxWidth: null,
|
52
|
-
minHeight: 150,
|
53
|
-
minWidth: 150,
|
54
|
-
modal: false,
|
55
|
-
position: {
|
56
|
-
my: "center",
|
57
|
-
at: "center",
|
58
|
-
of: window,
|
59
|
-
collision: "fit",
|
60
|
-
// Ensure the titlebar is always visible
|
61
|
-
using: function( pos ) {
|
62
|
-
var topOffset = $( this ).css( pos ).offset().top;
|
63
|
-
if ( topOffset < 0 ) {
|
64
|
-
$( this ).css( "top", pos.top - topOffset );
|
65
|
-
}
|
66
|
-
}
|
67
|
-
},
|
68
|
-
resizable: true,
|
69
|
-
show: null,
|
70
|
-
title: null,
|
71
|
-
width: 300,
|
72
|
-
|
73
|
-
// callbacks
|
74
|
-
beforeClose: null,
|
75
|
-
close: null,
|
76
|
-
drag: null,
|
77
|
-
dragStart: null,
|
78
|
-
dragStop: null,
|
79
|
-
focus: null,
|
80
|
-
open: null,
|
81
|
-
resize: null,
|
82
|
-
resizeStart: null,
|
83
|
-
resizeStop: null
|
84
|
-
},
|
85
|
-
|
86
|
-
_create: function() {
|
87
|
-
this.originalCss = {
|
88
|
-
display: this.element[0].style.display,
|
89
|
-
width: this.element[0].style.width,
|
90
|
-
minHeight: this.element[0].style.minHeight,
|
91
|
-
maxHeight: this.element[0].style.maxHeight,
|
92
|
-
height: this.element[0].style.height
|
93
|
-
};
|
94
|
-
this.originalPosition = {
|
95
|
-
parent: this.element.parent(),
|
96
|
-
index: this.element.parent().children().index( this.element )
|
97
|
-
};
|
98
|
-
this.originalTitle = this.element.attr("title");
|
99
|
-
this.options.title = this.options.title || this.originalTitle;
|
100
|
-
|
101
|
-
this._createWrapper();
|
102
|
-
|
103
|
-
this.element
|
104
|
-
.show()
|
105
|
-
.removeAttr("title")
|
106
|
-
.addClass("ui-dialog-content ui-widget-content")
|
107
|
-
.appendTo( this.uiDialog );
|
108
|
-
|
109
|
-
this._createTitlebar();
|
110
|
-
this._createButtonPane();
|
111
|
-
|
112
|
-
if ( this.options.draggable && $.fn.draggable ) {
|
113
|
-
this._makeDraggable();
|
114
|
-
}
|
115
|
-
if ( this.options.resizable && $.fn.resizable ) {
|
116
|
-
this._makeResizable();
|
117
|
-
}
|
118
|
-
|
119
|
-
this._isOpen = false;
|
120
|
-
},
|
121
|
-
|
122
|
-
_init: function() {
|
123
|
-
if ( this.options.autoOpen ) {
|
124
|
-
this.open();
|
125
|
-
}
|
126
|
-
},
|
127
|
-
|
128
|
-
_appendTo: function() {
|
129
|
-
var element = this.options.appendTo;
|
130
|
-
if ( element && (element.jquery || element.nodeType) ) {
|
131
|
-
return $( element );
|
132
|
-
}
|
133
|
-
return this.document.find( element || "body" ).eq( 0 );
|
134
|
-
},
|
135
|
-
|
136
|
-
_destroy: function() {
|
137
|
-
var next,
|
138
|
-
originalPosition = this.originalPosition;
|
139
|
-
|
140
|
-
this._destroyOverlay();
|
141
|
-
|
142
|
-
this.element
|
143
|
-
.removeUniqueId()
|
144
|
-
.removeClass("ui-dialog-content ui-widget-content")
|
145
|
-
.css( this.originalCss )
|
146
|
-
// Without detaching first, the following becomes really slow
|
147
|
-
.detach();
|
148
|
-
|
149
|
-
this.uiDialog.stop( true, true ).remove();
|
150
|
-
|
151
|
-
if ( this.originalTitle ) {
|
152
|
-
this.element.attr( "title", this.originalTitle );
|
153
|
-
}
|
154
|
-
|
155
|
-
next = originalPosition.parent.children().eq( originalPosition.index );
|
156
|
-
// Don't try to place the dialog next to itself (#8613)
|
157
|
-
if ( next.length && next[0] !== this.element[0] ) {
|
158
|
-
next.before( this.element );
|
159
|
-
} else {
|
160
|
-
originalPosition.parent.append( this.element );
|
161
|
-
}
|
162
|
-
},
|
163
|
-
|
164
|
-
widget: function() {
|
165
|
-
return this.uiDialog;
|
166
|
-
},
|
167
|
-
|
168
|
-
disable: $.noop,
|
169
|
-
enable: $.noop,
|
170
|
-
|
171
|
-
close: function( event ) {
|
172
|
-
var that = this;
|
173
|
-
|
174
|
-
if ( !this._isOpen || this._trigger( "beforeClose", event ) === false ) {
|
175
|
-
return;
|
176
|
-
}
|
177
|
-
|
178
|
-
this._isOpen = false;
|
179
|
-
this._destroyOverlay();
|
180
|
-
|
181
|
-
if ( !this.opener.filter(":focusable").focus().length ) {
|
182
|
-
// Hiding a focused element doesn't trigger blur in WebKit
|
183
|
-
// so in case we have nothing to focus on, explicitly blur the active element
|
184
|
-
// https://bugs.webkit.org/show_bug.cgi?id=47182
|
185
|
-
$( this.document[0].activeElement ).blur();
|
186
|
-
}
|
187
|
-
|
188
|
-
this._hide( this.uiDialog, this.options.hide, function() {
|
189
|
-
that._trigger( "close", event );
|
190
|
-
});
|
191
|
-
},
|
192
|
-
|
193
|
-
isOpen: function() {
|
194
|
-
return this._isOpen;
|
195
|
-
},
|
196
|
-
|
197
|
-
moveToTop: function() {
|
198
|
-
this._moveToTop();
|
199
|
-
},
|
200
|
-
|
201
|
-
_moveToTop: function( event, silent ) {
|
202
|
-
var moved = !!this.uiDialog.nextAll(":visible").insertBefore( this.uiDialog ).length;
|
203
|
-
if ( moved && !silent ) {
|
204
|
-
this._trigger( "focus", event );
|
205
|
-
}
|
206
|
-
return moved;
|
207
|
-
},
|
208
|
-
|
209
|
-
open: function() {
|
210
|
-
var that = this;
|
211
|
-
if ( this._isOpen ) {
|
212
|
-
if ( this._moveToTop() ) {
|
213
|
-
this._focusTabbable();
|
214
|
-
}
|
215
|
-
return;
|
216
|
-
}
|
217
|
-
|
218
|
-
this._isOpen = true;
|
219
|
-
this.opener = $( this.document[0].activeElement );
|
220
|
-
|
221
|
-
this._size();
|
222
|
-
this._position();
|
223
|
-
this._createOverlay();
|
224
|
-
this._moveToTop( null, true );
|
225
|
-
this._show( this.uiDialog, this.options.show, function() {
|
226
|
-
that._focusTabbable();
|
227
|
-
that._trigger("focus");
|
228
|
-
});
|
229
|
-
|
230
|
-
this._trigger("open");
|
231
|
-
},
|
232
|
-
|
233
|
-
_focusTabbable: function() {
|
234
|
-
// Set focus to the first match:
|
235
|
-
// 1. First element inside the dialog matching [autofocus]
|
236
|
-
// 2. Tabbable element inside the content element
|
237
|
-
// 3. Tabbable element inside the buttonpane
|
238
|
-
// 4. The close button
|
239
|
-
// 5. The dialog itself
|
240
|
-
var hasFocus = this.element.find("[autofocus]");
|
241
|
-
if ( !hasFocus.length ) {
|
242
|
-
hasFocus = this.element.find(":tabbable");
|
243
|
-
}
|
244
|
-
if ( !hasFocus.length ) {
|
245
|
-
hasFocus = this.uiDialogButtonPane.find(":tabbable");
|
246
|
-
}
|
247
|
-
if ( !hasFocus.length ) {
|
248
|
-
hasFocus = this.uiDialogTitlebarClose.filter(":tabbable");
|
249
|
-
}
|
250
|
-
if ( !hasFocus.length ) {
|
251
|
-
hasFocus = this.uiDialog;
|
252
|
-
}
|
253
|
-
hasFocus.eq( 0 ).focus();
|
254
|
-
},
|
255
|
-
|
256
|
-
_keepFocus: function( event ) {
|
257
|
-
function checkFocus() {
|
258
|
-
var activeElement = this.document[0].activeElement,
|
259
|
-
isActive = this.uiDialog[0] === activeElement ||
|
260
|
-
$.contains( this.uiDialog[0], activeElement );
|
261
|
-
if ( !isActive ) {
|
262
|
-
this._focusTabbable();
|
263
|
-
}
|
264
|
-
}
|
265
|
-
event.preventDefault();
|
266
|
-
checkFocus.call( this );
|
267
|
-
// support: IE
|
268
|
-
// IE <= 8 doesn't prevent moving focus even with event.preventDefault()
|
269
|
-
// so we check again later
|
270
|
-
this._delay( checkFocus );
|
271
|
-
},
|
272
|
-
|
273
|
-
_createWrapper: function() {
|
274
|
-
this.uiDialog = $("<div>")
|
275
|
-
.addClass( "ui-dialog ui-widget ui-widget-content ui-corner-all ui-front " +
|
276
|
-
this.options.dialogClass )
|
277
|
-
.hide()
|
278
|
-
.attr({
|
279
|
-
// Setting tabIndex makes the div focusable
|
280
|
-
tabIndex: -1,
|
281
|
-
role: "dialog"
|
282
|
-
})
|
283
|
-
.appendTo( this._appendTo() );
|
284
|
-
|
285
|
-
this._on( this.uiDialog, {
|
286
|
-
keydown: function( event ) {
|
287
|
-
if ( this.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
|
288
|
-
event.keyCode === $.ui.keyCode.ESCAPE ) {
|
289
|
-
event.preventDefault();
|
290
|
-
this.close( event );
|
291
|
-
return;
|
292
|
-
}
|
293
|
-
|
294
|
-
// prevent tabbing out of dialogs
|
295
|
-
if ( event.keyCode !== $.ui.keyCode.TAB ) {
|
296
|
-
return;
|
297
|
-
}
|
298
|
-
var tabbables = this.uiDialog.find(":tabbable"),
|
299
|
-
first = tabbables.filter(":first"),
|
300
|
-
last = tabbables.filter(":last");
|
301
|
-
|
302
|
-
if ( ( event.target === last[0] || event.target === this.uiDialog[0] ) && !event.shiftKey ) {
|
303
|
-
first.focus( 1 );
|
304
|
-
event.preventDefault();
|
305
|
-
} else if ( ( event.target === first[0] || event.target === this.uiDialog[0] ) && event.shiftKey ) {
|
306
|
-
last.focus( 1 );
|
307
|
-
event.preventDefault();
|
308
|
-
}
|
309
|
-
},
|
310
|
-
mousedown: function( event ) {
|
311
|
-
if ( this._moveToTop( event ) ) {
|
312
|
-
this._focusTabbable();
|
313
|
-
}
|
314
|
-
}
|
315
|
-
});
|
316
|
-
|
317
|
-
// We assume that any existing aria-describedby attribute means
|
318
|
-
// that the dialog content is marked up properly
|
319
|
-
// otherwise we brute force the content as the description
|
320
|
-
if ( !this.element.find("[aria-describedby]").length ) {
|
321
|
-
this.uiDialog.attr({
|
322
|
-
"aria-describedby": this.element.uniqueId().attr("id")
|
323
|
-
});
|
324
|
-
}
|
325
|
-
},
|
326
|
-
|
327
|
-
_createTitlebar: function() {
|
328
|
-
var uiDialogTitle;
|
329
|
-
|
330
|
-
this.uiDialogTitlebar = $("<div>")
|
331
|
-
.addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix")
|
332
|
-
.prependTo( this.uiDialog );
|
333
|
-
this._on( this.uiDialogTitlebar, {
|
334
|
-
mousedown: function( event ) {
|
335
|
-
// Don't prevent click on close button (#8838)
|
336
|
-
// Focusing a dialog that is partially scrolled out of view
|
337
|
-
// causes the browser to scroll it into view, preventing the click event
|
338
|
-
if ( !$( event.target ).closest(".ui-dialog-titlebar-close") ) {
|
339
|
-
// Dialog isn't getting focus when dragging (#8063)
|
340
|
-
this.uiDialog.focus();
|
341
|
-
}
|
342
|
-
}
|
343
|
-
});
|
344
|
-
|
345
|
-
this.uiDialogTitlebarClose = $("<button></button>")
|
346
|
-
.button({
|
347
|
-
label: this.options.closeText,
|
348
|
-
icons: {
|
349
|
-
primary: "ui-icon-closethick"
|
350
|
-
},
|
351
|
-
text: false
|
352
|
-
})
|
353
|
-
.addClass("ui-dialog-titlebar-close")
|
354
|
-
.appendTo( this.uiDialogTitlebar );
|
355
|
-
this._on( this.uiDialogTitlebarClose, {
|
356
|
-
click: function( event ) {
|
357
|
-
event.preventDefault();
|
358
|
-
this.close( event );
|
359
|
-
}
|
360
|
-
});
|
361
|
-
|
362
|
-
uiDialogTitle = $("<span>")
|
363
|
-
.uniqueId()
|
364
|
-
.addClass("ui-dialog-title")
|
365
|
-
.prependTo( this.uiDialogTitlebar );
|
366
|
-
this._title( uiDialogTitle );
|
367
|
-
|
368
|
-
this.uiDialog.attr({
|
369
|
-
"aria-labelledby": uiDialogTitle.attr("id")
|
370
|
-
});
|
371
|
-
},
|
372
|
-
|
373
|
-
_title: function( title ) {
|
374
|
-
if ( !this.options.title ) {
|
375
|
-
title.html(" ");
|
376
|
-
}
|
377
|
-
title.text( this.options.title );
|
378
|
-
},
|
379
|
-
|
380
|
-
_createButtonPane: function() {
|
381
|
-
this.uiDialogButtonPane = $("<div>")
|
382
|
-
.addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");
|
383
|
-
|
384
|
-
this.uiButtonSet = $("<div>")
|
385
|
-
.addClass("ui-dialog-buttonset")
|
386
|
-
.appendTo( this.uiDialogButtonPane );
|
387
|
-
|
388
|
-
this._createButtons();
|
389
|
-
},
|
390
|
-
|
391
|
-
_createButtons: function() {
|
392
|
-
var that = this,
|
393
|
-
buttons = this.options.buttons;
|
394
|
-
|
395
|
-
// if we already have a button pane, remove it
|
396
|
-
this.uiDialogButtonPane.remove();
|
397
|
-
this.uiButtonSet.empty();
|
398
|
-
|
399
|
-
if ( $.isEmptyObject( buttons ) || ($.isArray( buttons ) && !buttons.length) ) {
|
400
|
-
this.uiDialog.removeClass("ui-dialog-buttons");
|
401
|
-
return;
|
402
|
-
}
|
403
|
-
|
404
|
-
$.each( buttons, function( name, props ) {
|
405
|
-
var click, buttonOptions;
|
406
|
-
props = $.isFunction( props ) ?
|
407
|
-
{ click: props, text: name } :
|
408
|
-
props;
|
409
|
-
// Default to a non-submitting button
|
410
|
-
props = $.extend( { type: "button" }, props );
|
411
|
-
// Change the context for the click callback to be the main element
|
412
|
-
click = props.click;
|
413
|
-
props.click = function() {
|
414
|
-
click.apply( that.element[0], arguments );
|
415
|
-
};
|
416
|
-
buttonOptions = {
|
417
|
-
icons: props.icons,
|
418
|
-
text: props.showText
|
419
|
-
};
|
420
|
-
delete props.icons;
|
421
|
-
delete props.showText;
|
422
|
-
$( "<button></button>", props )
|
423
|
-
.button( buttonOptions )
|
424
|
-
.appendTo( that.uiButtonSet );
|
425
|
-
});
|
426
|
-
this.uiDialog.addClass("ui-dialog-buttons");
|
427
|
-
this.uiDialogButtonPane.appendTo( this.uiDialog );
|
428
|
-
},
|
429
|
-
|
430
|
-
_makeDraggable: function() {
|
431
|
-
var that = this,
|
432
|
-
options = this.options;
|
433
|
-
|
434
|
-
function filteredUi( ui ) {
|
435
|
-
return {
|
436
|
-
position: ui.position,
|
437
|
-
offset: ui.offset
|
438
|
-
};
|
439
|
-
}
|
440
|
-
|
441
|
-
this.uiDialog.draggable({
|
442
|
-
cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
|
443
|
-
handle: ".ui-dialog-titlebar",
|
444
|
-
containment: "document",
|
445
|
-
start: function( event, ui ) {
|
446
|
-
$( this ).addClass("ui-dialog-dragging");
|
447
|
-
that._blockFrames();
|
448
|
-
that._trigger( "dragStart", event, filteredUi( ui ) );
|
449
|
-
},
|
450
|
-
drag: function( event, ui ) {
|
451
|
-
that._trigger( "drag", event, filteredUi( ui ) );
|
452
|
-
},
|
453
|
-
stop: function( event, ui ) {
|
454
|
-
options.position = [
|
455
|
-
ui.position.left - that.document.scrollLeft(),
|
456
|
-
ui.position.top - that.document.scrollTop()
|
457
|
-
];
|
458
|
-
$( this ).removeClass("ui-dialog-dragging");
|
459
|
-
that._unblockFrames();
|
460
|
-
that._trigger( "dragStop", event, filteredUi( ui ) );
|
461
|
-
}
|
462
|
-
});
|
463
|
-
},
|
464
|
-
|
465
|
-
_makeResizable: function() {
|
466
|
-
var that = this,
|
467
|
-
options = this.options,
|
468
|
-
handles = options.resizable,
|
469
|
-
// .ui-resizable has position: relative defined in the stylesheet
|
470
|
-
// but dialogs have to use absolute or fixed positioning
|
471
|
-
position = this.uiDialog.css("position"),
|
472
|
-
resizeHandles = typeof handles === "string" ?
|
473
|
-
handles :
|
474
|
-
"n,e,s,w,se,sw,ne,nw";
|
475
|
-
|
476
|
-
function filteredUi( ui ) {
|
477
|
-
return {
|
478
|
-
originalPosition: ui.originalPosition,
|
479
|
-
originalSize: ui.originalSize,
|
480
|
-
position: ui.position,
|
481
|
-
size: ui.size
|
482
|
-
};
|
483
|
-
}
|
484
|
-
|
485
|
-
this.uiDialog.resizable({
|
486
|
-
cancel: ".ui-dialog-content",
|
487
|
-
containment: "document",
|
488
|
-
alsoResize: this.element,
|
489
|
-
maxWidth: options.maxWidth,
|
490
|
-
maxHeight: options.maxHeight,
|
491
|
-
minWidth: options.minWidth,
|
492
|
-
minHeight: this._minHeight(),
|
493
|
-
handles: resizeHandles,
|
494
|
-
start: function( event, ui ) {
|
495
|
-
$( this ).addClass("ui-dialog-resizing");
|
496
|
-
that._blockFrames();
|
497
|
-
that._trigger( "resizeStart", event, filteredUi( ui ) );
|
498
|
-
},
|
499
|
-
resize: function( event, ui ) {
|
500
|
-
that._trigger( "resize", event, filteredUi( ui ) );
|
501
|
-
},
|
502
|
-
stop: function( event, ui ) {
|
503
|
-
options.height = $( this ).height();
|
504
|
-
options.width = $( this ).width();
|
505
|
-
$( this ).removeClass("ui-dialog-resizing");
|
506
|
-
that._unblockFrames();
|
507
|
-
that._trigger( "resizeStop", event, filteredUi( ui ) );
|
508
|
-
}
|
509
|
-
})
|
510
|
-
.css( "position", position );
|
511
|
-
},
|
512
|
-
|
513
|
-
_minHeight: function() {
|
514
|
-
var options = this.options;
|
515
|
-
|
516
|
-
return options.height === "auto" ?
|
517
|
-
options.minHeight :
|
518
|
-
Math.min( options.minHeight, options.height );
|
519
|
-
},
|
520
|
-
|
521
|
-
_position: function() {
|
522
|
-
// Need to show the dialog to get the actual offset in the position plugin
|
523
|
-
var isVisible = this.uiDialog.is(":visible");
|
524
|
-
if ( !isVisible ) {
|
525
|
-
this.uiDialog.show();
|
526
|
-
}
|
527
|
-
this.uiDialog.position( this.options.position );
|
528
|
-
if ( !isVisible ) {
|
529
|
-
this.uiDialog.hide();
|
530
|
-
}
|
531
|
-
},
|
532
|
-
|
533
|
-
_setOptions: function( options ) {
|
534
|
-
var that = this,
|
535
|
-
resize = false,
|
536
|
-
resizableOptions = {};
|
537
|
-
|
538
|
-
$.each( options, function( key, value ) {
|
539
|
-
that._setOption( key, value );
|
540
|
-
|
541
|
-
if ( key in sizeRelatedOptions ) {
|
542
|
-
resize = true;
|
543
|
-
}
|
544
|
-
if ( key in resizableRelatedOptions ) {
|
545
|
-
resizableOptions[ key ] = value;
|
546
|
-
}
|
547
|
-
});
|
548
|
-
|
549
|
-
if ( resize ) {
|
550
|
-
this._size();
|
551
|
-
this._position();
|
552
|
-
}
|
553
|
-
if ( this.uiDialog.is(":data(ui-resizable)") ) {
|
554
|
-
this.uiDialog.resizable( "option", resizableOptions );
|
555
|
-
}
|
556
|
-
},
|
557
|
-
|
558
|
-
_setOption: function( key, value ) {
|
559
|
-
/*jshint maxcomplexity:15*/
|
560
|
-
var isDraggable, isResizable,
|
561
|
-
uiDialog = this.uiDialog;
|
562
|
-
|
563
|
-
if ( key === "dialogClass" ) {
|
564
|
-
uiDialog
|
565
|
-
.removeClass( this.options.dialogClass )
|
566
|
-
.addClass( value );
|
567
|
-
}
|
568
|
-
|
569
|
-
if ( key === "disabled" ) {
|
570
|
-
return;
|
571
|
-
}
|
572
|
-
|
573
|
-
this._super( key, value );
|
574
|
-
|
575
|
-
if ( key === "appendTo" ) {
|
576
|
-
this.uiDialog.appendTo( this._appendTo() );
|
577
|
-
}
|
578
|
-
|
579
|
-
if ( key === "buttons" ) {
|
580
|
-
this._createButtons();
|
581
|
-
}
|
582
|
-
|
583
|
-
if ( key === "closeText" ) {
|
584
|
-
this.uiDialogTitlebarClose.button({
|
585
|
-
// Ensure that we always pass a string
|
586
|
-
label: "" + value
|
587
|
-
});
|
588
|
-
}
|
589
|
-
|
590
|
-
if ( key === "draggable" ) {
|
591
|
-
isDraggable = uiDialog.is(":data(ui-draggable)");
|
592
|
-
if ( isDraggable && !value ) {
|
593
|
-
uiDialog.draggable("destroy");
|
594
|
-
}
|
595
|
-
|
596
|
-
if ( !isDraggable && value ) {
|
597
|
-
this._makeDraggable();
|
598
|
-
}
|
599
|
-
}
|
600
|
-
|
601
|
-
if ( key === "position" ) {
|
602
|
-
this._position();
|
603
|
-
}
|
604
|
-
|
605
|
-
if ( key === "resizable" ) {
|
606
|
-
// currently resizable, becoming non-resizable
|
607
|
-
isResizable = uiDialog.is(":data(ui-resizable)");
|
608
|
-
if ( isResizable && !value ) {
|
609
|
-
uiDialog.resizable("destroy");
|
610
|
-
}
|
611
|
-
|
612
|
-
// currently resizable, changing handles
|
613
|
-
if ( isResizable && typeof value === "string" ) {
|
614
|
-
uiDialog.resizable( "option", "handles", value );
|
615
|
-
}
|
616
|
-
|
617
|
-
// currently non-resizable, becoming resizable
|
618
|
-
if ( !isResizable && value !== false ) {
|
619
|
-
this._makeResizable();
|
620
|
-
}
|
621
|
-
}
|
622
|
-
|
623
|
-
if ( key === "title" ) {
|
624
|
-
this._title( this.uiDialogTitlebar.find(".ui-dialog-title") );
|
625
|
-
}
|
626
|
-
},
|
627
|
-
|
628
|
-
_size: function() {
|
629
|
-
// If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
|
630
|
-
// divs will both have width and height set, so we need to reset them
|
631
|
-
var nonContentHeight, minContentHeight, maxContentHeight,
|
632
|
-
options = this.options;
|
633
|
-
|
634
|
-
// Reset content sizing
|
635
|
-
this.element.show().css({
|
636
|
-
width: "auto",
|
637
|
-
minHeight: 0,
|
638
|
-
maxHeight: "none",
|
639
|
-
height: 0
|
640
|
-
});
|
641
|
-
|
642
|
-
if ( options.minWidth > options.width ) {
|
643
|
-
options.width = options.minWidth;
|
644
|
-
}
|
645
|
-
|
646
|
-
// reset wrapper sizing
|
647
|
-
// determine the height of all the non-content elements
|
648
|
-
nonContentHeight = this.uiDialog.css({
|
649
|
-
height: "auto",
|
650
|
-
width: options.width
|
651
|
-
})
|
652
|
-
.outerHeight();
|
653
|
-
minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
|
654
|
-
maxContentHeight = typeof options.maxHeight === "number" ?
|
655
|
-
Math.max( 0, options.maxHeight - nonContentHeight ) :
|
656
|
-
"none";
|
657
|
-
|
658
|
-
if ( options.height === "auto" ) {
|
659
|
-
this.element.css({
|
660
|
-
minHeight: minContentHeight,
|
661
|
-
maxHeight: maxContentHeight,
|
662
|
-
height: "auto"
|
663
|
-
});
|
664
|
-
} else {
|
665
|
-
this.element.height( Math.max( 0, options.height - nonContentHeight ) );
|
666
|
-
}
|
667
|
-
|
668
|
-
if (this.uiDialog.is(":data(ui-resizable)") ) {
|
669
|
-
this.uiDialog.resizable( "option", "minHeight", this._minHeight() );
|
670
|
-
}
|
671
|
-
},
|
672
|
-
|
673
|
-
_blockFrames: function() {
|
674
|
-
this.iframeBlocks = this.document.find( "iframe" ).map(function() {
|
675
|
-
var iframe = $( this );
|
676
|
-
|
677
|
-
return $( "<div>" )
|
678
|
-
.css({
|
679
|
-
position: "absolute",
|
680
|
-
width: iframe.outerWidth(),
|
681
|
-
height: iframe.outerHeight()
|
682
|
-
})
|
683
|
-
.appendTo( iframe.parent() )
|
684
|
-
.offset( iframe.offset() )[0];
|
685
|
-
});
|
686
|
-
},
|
687
|
-
|
688
|
-
_unblockFrames: function() {
|
689
|
-
if ( this.iframeBlocks ) {
|
690
|
-
this.iframeBlocks.remove();
|
691
|
-
delete this.iframeBlocks;
|
692
|
-
}
|
693
|
-
},
|
694
|
-
|
695
|
-
_allowInteraction: function( event ) {
|
696
|
-
if ( $( event.target ).closest(".ui-dialog").length ) {
|
697
|
-
return true;
|
698
|
-
}
|
699
|
-
|
700
|
-
// TODO: Remove hack when datepicker implements
|
701
|
-
// the .ui-front logic (#8989)
|
702
|
-
return !!$( event.target ).closest(".ui-datepicker").length;
|
703
|
-
},
|
704
|
-
|
705
|
-
_createOverlay: function() {
|
706
|
-
if ( !this.options.modal ) {
|
707
|
-
return;
|
708
|
-
}
|
709
|
-
|
710
|
-
var that = this,
|
711
|
-
widgetFullName = this.widgetFullName;
|
712
|
-
if ( !$.ui.dialog.overlayInstances ) {
|
713
|
-
// Prevent use of anchors and inputs.
|
714
|
-
// We use a delay in case the overlay is created from an
|
715
|
-
// event that we're going to be cancelling. (#2804)
|
716
|
-
this._delay(function() {
|
717
|
-
// Handle .dialog().dialog("close") (#4065)
|
718
|
-
if ( $.ui.dialog.overlayInstances ) {
|
719
|
-
this.document.bind( "focusin.dialog", function( event ) {
|
720
|
-
if ( !that._allowInteraction( event ) ) {
|
721
|
-
event.preventDefault();
|
722
|
-
$(".ui-dialog:visible:last .ui-dialog-content")
|
723
|
-
.data( widgetFullName )._focusTabbable();
|
724
|
-
}
|
725
|
-
});
|
726
|
-
}
|
727
|
-
});
|
728
|
-
}
|
729
|
-
|
730
|
-
this.overlay = $("<div>")
|
731
|
-
.addClass("ui-widget-overlay ui-front")
|
732
|
-
.appendTo( this._appendTo() );
|
733
|
-
this._on( this.overlay, {
|
734
|
-
mousedown: "_keepFocus"
|
735
|
-
});
|
736
|
-
$.ui.dialog.overlayInstances++;
|
737
|
-
},
|
738
|
-
|
739
|
-
_destroyOverlay: function() {
|
740
|
-
if ( !this.options.modal ) {
|
741
|
-
return;
|
742
|
-
}
|
743
|
-
|
744
|
-
if ( this.overlay ) {
|
745
|
-
$.ui.dialog.overlayInstances--;
|
746
|
-
|
747
|
-
if ( !$.ui.dialog.overlayInstances ) {
|
748
|
-
this.document.unbind( "focusin.dialog" );
|
749
|
-
}
|
750
|
-
this.overlay.remove();
|
751
|
-
this.overlay = null;
|
752
|
-
}
|
753
|
-
}
|
754
|
-
});
|
755
|
-
|
756
|
-
$.ui.dialog.overlayInstances = 0;
|
757
|
-
|
758
|
-
// DEPRECATED
|
759
|
-
if ( $.uiBackCompat !== false ) {
|
760
|
-
// position option with array notation
|
761
|
-
// just override with old implementation
|
762
|
-
$.widget( "ui.dialog", $.ui.dialog, {
|
763
|
-
_position: function() {
|
764
|
-
var position = this.options.position,
|
765
|
-
myAt = [],
|
766
|
-
offset = [ 0, 0 ],
|
767
|
-
isVisible;
|
768
|
-
|
769
|
-
if ( position ) {
|
770
|
-
if ( typeof position === "string" || (typeof position === "object" && "0" in position ) ) {
|
771
|
-
myAt = position.split ? position.split(" ") : [ position[0], position[1] ];
|
772
|
-
if ( myAt.length === 1 ) {
|
773
|
-
myAt[1] = myAt[0];
|
774
|
-
}
|
775
|
-
|
776
|
-
$.each( [ "left", "top" ], function( i, offsetPosition ) {
|
777
|
-
if ( +myAt[ i ] === myAt[ i ] ) {
|
778
|
-
offset[ i ] = myAt[ i ];
|
779
|
-
myAt[ i ] = offsetPosition;
|
780
|
-
}
|
781
|
-
});
|
782
|
-
|
783
|
-
position = {
|
784
|
-
my: myAt[0] + (offset[0] < 0 ? offset[0] : "+" + offset[0]) + " " +
|
785
|
-
myAt[1] + (offset[1] < 0 ? offset[1] : "+" + offset[1]),
|
786
|
-
at: myAt.join(" ")
|
787
|
-
};
|
788
|
-
}
|
789
|
-
|
790
|
-
position = $.extend( {}, $.ui.dialog.prototype.options.position, position );
|
791
|
-
} else {
|
792
|
-
position = $.ui.dialog.prototype.options.position;
|
793
|
-
}
|
794
|
-
|
795
|
-
// need to show the dialog to get the actual offset in the position plugin
|
796
|
-
isVisible = this.uiDialog.is(":visible");
|
797
|
-
if ( !isVisible ) {
|
798
|
-
this.uiDialog.show();
|
799
|
-
}
|
800
|
-
this.uiDialog.position( position );
|
801
|
-
if ( !isVisible ) {
|
802
|
-
this.uiDialog.hide();
|
803
|
-
}
|
804
|
-
}
|
805
|
-
});
|
806
|
-
}
|
807
|
-
|
808
|
-
}( 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){var e={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};t.widget("ui.dialog",{version:"1.10.3",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var i=t(this).css(e).offset().top;0>i&&t(this).css("top",e.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&t.fn.draggable&&this._makeDraggable(),this.options.resizable&&t.fn.resizable&&this._makeResizable(),this._isOpen=!1},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var e=this.options.appendTo;return e&&(e.jquery||e.nodeType)?t(e):this.document.find(e||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),t=e.parent.children().eq(e.index),t.length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:t.noop,enable:t.noop,close:function(e){var i=this;this._isOpen&&this._trigger("beforeClose",e)!==!1&&(this._isOpen=!1,this._destroyOverlay(),this.opener.filter(":focusable").focus().length||t(this.document[0].activeElement).blur(),this._hide(this.uiDialog,this.options.hide,function(){i._trigger("close",e)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,e){var i=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;return i&&!e&&this._trigger("focus",t),i},open:function(){var e=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),undefined):(this._isOpen=!0,this.opener=t(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){e._focusTabbable(),e._trigger("focus")}),this._trigger("open"),undefined)},_focusTabbable:function(){var t=this.element.find("[autofocus]");t.length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).focus()},_keepFocus:function(e){function i(){var e=this.document[0].activeElement,i=this.uiDialog[0]===e||t.contains(this.uiDialog[0],e);i||this._focusTabbable()}e.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=t("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE)return e.preventDefault(),this.close(e),undefined;if(e.keyCode===t.ui.keyCode.TAB){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");e.target!==n[0]&&e.target!==this.uiDialog[0]||e.shiftKey?e.target!==s[0]&&e.target!==this.uiDialog[0]||!e.shiftKey||(n.focus(1),e.preventDefault()):(s.focus(1),e.preventDefault())}},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var e;this.uiDialogTitlebar=t("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(e){t(e.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=t("<button></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),e=t("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(e),this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(t){this.options.title||t.html(" "),t.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=t("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=t("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var e=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),t.isEmptyObject(i)||t.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),undefined):(t.each(i,function(i,s){var n,a;s=t.isFunction(s)?{click:s,text:i}:s,s=t.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(e.element[0],arguments)},a={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,t("<button></button>",s).button(a).appendTo(e.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),undefined)},_makeDraggable:function(){function e(t){return{position:t.position,offset:t.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){t(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,e(n))},drag:function(t,s){i._trigger("drag",t,e(s))},stop:function(n,a){s.position=[a.position.left-i.document.scrollLeft(),a.position.top-i.document.scrollTop()],t(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,e(a))}})},_makeResizable:function(){function e(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}var i=this,s=this.options,n=s.resizable,a=this.uiDialog.css("position"),o="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:o,start:function(s,n){t(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,e(n))},resize:function(t,s){i._trigger("resize",t,e(s))},stop:function(n,a){s.height=t(this).height(),s.width=t(this).width(),t(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,e(a))}}).css("position",a)},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(s){var n=this,a=!1,o={};t.each(s,function(t,s){n._setOption(t,s),t in e&&(a=!0),t in i&&(o[t]=s)}),a&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",o)},_setOption:function(t,e){var i,s,n=this.uiDialog;"dialogClass"===t&&n.removeClass(this.options.dialogClass).addClass(e),"disabled"!==t&&(this._super(t,e),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:""+e}),"draggable"===t&&(i=n.is(":data(ui-draggable)"),i&&!e&&n.draggable("destroy"),!i&&e&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&(s=n.is(":data(ui-resizable)"),s&&!e&&n.resizable("destroy"),s&&"string"==typeof e&&n.resizable("option","handles",e),s||e===!1||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var e=t(this);return t("<div>").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return t(e.target).closest(".ui-dialog").length?!0:!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=this,i=this.widgetFullName;t.ui.dialog.overlayInstances||this._delay(function(){t.ui.dialog.overlayInstances&&this.document.bind("focusin.dialog",function(s){e._allowInteraction(s)||(s.preventDefault(),t(".ui-dialog:visible:last .ui-dialog-content").data(i)._focusTabbable())})}),this.overlay=t("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),t.ui.dialog.overlayInstances++}},_destroyOverlay:function(){this.options.modal&&this.overlay&&(t.ui.dialog.overlayInstances--,t.ui.dialog.overlayInstances||this.document.unbind("focusin.dialog"),this.overlay.remove(),this.overlay=null)}}),t.ui.dialog.overlayInstances=0,t.uiBackCompat!==!1&&t.widget("ui.dialog",t.ui.dialog,{_position:function(){var e,i=this.options.position,s=[],n=[0,0];i?(("string"==typeof i||"object"==typeof i&&"0"in i)&&(s=i.split?i.split(" "):[i[0],i[1]],1===s.length&&(s[1]=s[0]),t.each(["left","top"],function(t,e){+s[t]===s[t]&&(n[t]=s[t],s[t]=e)}),i={my:s[0]+(0>n[0]?n[0]:"+"+n[0])+" "+s[1]+(0>n[1]?n[1]:"+"+n[1]),at:s.join(" ")}),i=t.extend({},t.ui.dialog.prototype.options.position,i)):i=t.ui.dialog.prototype.options.position,e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.position(i),e||this.uiDialog.hide()}})})(jQuery);
|