jquery_rails3 1.4.2.b2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -1
- data/lib/generators/{jquery_install → jquery/install}/USAGE +3 -2
- data/lib/generators/jquery/install/install_generator.rb +40 -0
- data/lib/jquery_rails3.rb +11 -0
- metadata +13 -186
- data/lib/generators/jquery_install/jquery_install_generator.rb +0 -102
- data/lib/generators/jquery_install/templates/jquery-1.4.2.js +0 -6240
- data/lib/generators/jquery_install/templates/jquery-1.4.2.min.js +0 -154
- data/lib/generators/jquery_install/templates/layout.html.erb +0 -14
- data/lib/generators/jquery_install/templates/rails.js +0 -132
- data/lib/generators/jquery_install/templates/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/lib/generators/jquery_install/templates/themes/base/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/lib/generators/jquery_install/templates/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/lib/generators/jquery_install/templates/themes/base/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/generators/jquery_install/templates/themes/base/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/lib/generators/jquery_install/templates/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/lib/generators/jquery_install/templates/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/lib/generators/jquery_install/templates/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/lib/generators/jquery_install/templates/themes/base/images/ui-icons_222222_256x240.png +0 -0
- data/lib/generators/jquery_install/templates/themes/base/images/ui-icons_2e83ff_256x240.png +0 -0
- data/lib/generators/jquery_install/templates/themes/base/images/ui-icons_454545_256x240.png +0 -0
- data/lib/generators/jquery_install/templates/themes/base/images/ui-icons_888888_256x240.png +0 -0
- data/lib/generators/jquery_install/templates/themes/base/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.accordion.css +0 -19
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.all.css +0 -11
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.autocomplete.css +0 -53
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.base.css +0 -11
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.button.css +0 -38
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.core.css +0 -41
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.datepicker.css +0 -68
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.dialog.css +0 -21
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.progressbar.css +0 -11
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.resizable.css +0 -20
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.selectable.css +0 -10
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.slider.css +0 -24
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.tabs.css +0 -18
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.theme.css +0 -252
- data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery-ui-1.8.4.custom.css +0 -572
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.accordion.css +0 -19
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.all.css +0 -11
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.autocomplete.css +0 -53
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.base.css +0 -11
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.button.css +0 -38
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.core.css +0 -41
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.datepicker.css +0 -68
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.dialog.css +0 -21
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.progressbar.css +0 -11
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.resizable.css +0 -20
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.selectable.css +0 -10
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.slider.css +0 -24
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.tabs.css +0 -18
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.theme.css +0 -254
- data/lib/generators/jquery_install/templates/ui/i18n/jquery-ui-i18n.js +0 -1176
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-af.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-ar.js +0 -24
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-az.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-bg.js +0 -24
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-bs.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-ca.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-cs.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-da.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-de.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-el.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-en-GB.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-eo.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-es.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-et.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-eu.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-fa.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-fi.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-fo.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-fr-CH.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-fr.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-he.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-hr.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-hu.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-hy.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-id.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-is.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-it.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-ja.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-ko.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-lt.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-lv.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-ms.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-nl.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-no.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-pl.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-pt-BR.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-ro.js +0 -26
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-ru.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-sk.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-sl.js +0 -24
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-sq.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-sr-SR.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-sr.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-sv.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-ta.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-th.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-tr.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-uk.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-vi.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-zh-CN.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-zh-HK.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-zh-TW.js +0 -23
- data/lib/generators/jquery_install/templates/ui/jquery-ui-1.8.4.custom.js +0 -11241
- data/lib/generators/jquery_install/templates/ui/jquery.effects.blind.js +0 -49
- data/lib/generators/jquery_install/templates/ui/jquery.effects.bounce.js +0 -78
- data/lib/generators/jquery_install/templates/ui/jquery.effects.clip.js +0 -54
- data/lib/generators/jquery_install/templates/ui/jquery.effects.core.js +0 -714
- data/lib/generators/jquery_install/templates/ui/jquery.effects.drop.js +0 -50
- data/lib/generators/jquery_install/templates/ui/jquery.effects.explode.js +0 -79
- data/lib/generators/jquery_install/templates/ui/jquery.effects.fold.js +0 -56
- data/lib/generators/jquery_install/templates/ui/jquery.effects.highlight.js +0 -50
- data/lib/generators/jquery_install/templates/ui/jquery.effects.pulsate.js +0 -51
- data/lib/generators/jquery_install/templates/ui/jquery.effects.scale.js +0 -178
- data/lib/generators/jquery_install/templates/ui/jquery.effects.shake.js +0 -57
- data/lib/generators/jquery_install/templates/ui/jquery.effects.slide.js +0 -50
- data/lib/generators/jquery_install/templates/ui/jquery.effects.transfer.js +0 -45
- data/lib/generators/jquery_install/templates/ui/jquery.ui.accordion.js +0 -598
- data/lib/generators/jquery_install/templates/ui/jquery.ui.autocomplete.js +0 -544
- data/lib/generators/jquery_install/templates/ui/jquery.ui.button.js +0 -365
- data/lib/generators/jquery_install/templates/ui/jquery.ui.core.js +0 -281
- data/lib/generators/jquery_install/templates/ui/jquery.ui.datepicker.js +0 -1732
- data/lib/generators/jquery_install/templates/ui/jquery.ui.dialog.js +0 -827
- data/lib/generators/jquery_install/templates/ui/jquery.ui.draggable.js +0 -797
- data/lib/generators/jquery_install/templates/ui/jquery.ui.droppable.js +0 -285
- data/lib/generators/jquery_install/templates/ui/jquery.ui.mouse.js +0 -151
- data/lib/generators/jquery_install/templates/ui/jquery.ui.position.js +0 -233
- data/lib/generators/jquery_install/templates/ui/jquery.ui.progressbar.js +0 -94
- data/lib/generators/jquery_install/templates/ui/jquery.ui.resizable.js +0 -812
- data/lib/generators/jquery_install/templates/ui/jquery.ui.selectable.js +0 -266
- data/lib/generators/jquery_install/templates/ui/jquery.ui.slider.js +0 -680
- data/lib/generators/jquery_install/templates/ui/jquery.ui.sortable.js +0 -1071
- data/lib/generators/jquery_install/templates/ui/jquery.ui.tabs.js +0 -757
- data/lib/generators/jquery_install/templates/ui/jquery.ui.widget.js +0 -237
- data/lib/generators/jquery_install/templates/ui-min/jquery.effects.blind.min.js +0 -14
- data/lib/generators/jquery_install/templates/ui-min/jquery.effects.bounce.min.js +0 -15
- data/lib/generators/jquery_install/templates/ui-min/jquery.effects.clip.min.js +0 -14
- data/lib/generators/jquery_install/templates/ui-min/jquery.effects.core.min.js +0 -30
- data/lib/generators/jquery_install/templates/ui-min/jquery.effects.drop.min.js +0 -14
- data/lib/generators/jquery_install/templates/ui-min/jquery.effects.explode.min.js +0 -15
- data/lib/generators/jquery_install/templates/ui-min/jquery.effects.fold.min.js +0 -14
- data/lib/generators/jquery_install/templates/ui-min/jquery.effects.highlight.min.js +0 -14
- data/lib/generators/jquery_install/templates/ui-min/jquery.effects.pulsate.min.js +0 -14
- data/lib/generators/jquery_install/templates/ui-min/jquery.effects.scale.min.js +0 -20
- data/lib/generators/jquery_install/templates/ui-min/jquery.effects.shake.min.js +0 -14
- data/lib/generators/jquery_install/templates/ui-min/jquery.effects.slide.min.js +0 -14
- data/lib/generators/jquery_install/templates/ui-min/jquery.effects.transfer.min.js +0 -14
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.accordion.min.js +0 -30
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.autocomplete.min.js +0 -31
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.button.min.js +0 -24
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.core.min.js +0 -17
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.datepicker.min.js +0 -80
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.dialog.min.js +0 -39
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.draggable.min.js +0 -49
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.droppable.min.js +0 -26
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.mouse.min.js +0 -17
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.position.min.js +0 -15
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.progressbar.min.js +0 -16
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.resizable.min.js +0 -47
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.selectable.min.js +0 -22
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.slider.min.js +0 -33
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.sortable.min.js +0 -60
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.tabs.min.js +0 -35
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.widget.min.js +0 -15
@@ -1,827 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* jQuery UI Dialog 1.8.4
|
3
|
-
*
|
4
|
-
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
|
5
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
6
|
-
* http://jquery.org/license
|
7
|
-
*
|
8
|
-
* http://docs.jquery.com/UI/Dialog
|
9
|
-
*
|
10
|
-
* Depends:
|
11
|
-
* jquery.ui.core.js
|
12
|
-
* jquery.ui.widget.js
|
13
|
-
* jquery.ui.button.js
|
14
|
-
* jquery.ui.draggable.js
|
15
|
-
* jquery.ui.mouse.js
|
16
|
-
* jquery.ui.position.js
|
17
|
-
* jquery.ui.resizable.js
|
18
|
-
*/
|
19
|
-
(function( $, undefined ) {
|
20
|
-
|
21
|
-
var uiDialogClasses =
|
22
|
-
'ui-dialog ' +
|
23
|
-
'ui-widget ' +
|
24
|
-
'ui-widget-content ' +
|
25
|
-
'ui-corner-all ';
|
26
|
-
|
27
|
-
$.widget("ui.dialog", {
|
28
|
-
options: {
|
29
|
-
autoOpen: true,
|
30
|
-
buttons: {},
|
31
|
-
closeOnEscape: true,
|
32
|
-
closeText: 'close',
|
33
|
-
dialogClass: '',
|
34
|
-
draggable: true,
|
35
|
-
hide: null,
|
36
|
-
height: 'auto',
|
37
|
-
maxHeight: false,
|
38
|
-
maxWidth: false,
|
39
|
-
minHeight: 150,
|
40
|
-
minWidth: 150,
|
41
|
-
modal: false,
|
42
|
-
position: {
|
43
|
-
my: 'center',
|
44
|
-
at: 'center',
|
45
|
-
of: window,
|
46
|
-
collision: 'fit',
|
47
|
-
// ensure that the titlebar is never outside the document
|
48
|
-
using: function(pos) {
|
49
|
-
var topOffset = $(this).css(pos).offset().top;
|
50
|
-
if (topOffset < 0) {
|
51
|
-
$(this).css('top', pos.top - topOffset);
|
52
|
-
}
|
53
|
-
}
|
54
|
-
},
|
55
|
-
resizable: true,
|
56
|
-
show: null,
|
57
|
-
stack: true,
|
58
|
-
title: '',
|
59
|
-
width: 300,
|
60
|
-
zIndex: 1000
|
61
|
-
},
|
62
|
-
|
63
|
-
_create: function() {
|
64
|
-
this.originalTitle = this.element.attr('title');
|
65
|
-
// #5742 - .attr() might return a DOMElement
|
66
|
-
if ( typeof this.originalTitle !== "string" ) {
|
67
|
-
this.originalTitle = "";
|
68
|
-
}
|
69
|
-
|
70
|
-
var self = this,
|
71
|
-
options = self.options,
|
72
|
-
|
73
|
-
title = options.title || self.originalTitle || ' ',
|
74
|
-
titleId = $.ui.dialog.getTitleId(self.element),
|
75
|
-
|
76
|
-
uiDialog = (self.uiDialog = $('<div></div>'))
|
77
|
-
.appendTo(document.body)
|
78
|
-
.hide()
|
79
|
-
.addClass(uiDialogClasses + options.dialogClass)
|
80
|
-
.css({
|
81
|
-
zIndex: options.zIndex
|
82
|
-
})
|
83
|
-
// setting tabIndex makes the div focusable
|
84
|
-
// setting outline to 0 prevents a border on focus in Mozilla
|
85
|
-
.attr('tabIndex', -1).css('outline', 0).keydown(function(event) {
|
86
|
-
if (options.closeOnEscape && event.keyCode &&
|
87
|
-
event.keyCode === $.ui.keyCode.ESCAPE) {
|
88
|
-
|
89
|
-
self.close(event);
|
90
|
-
event.preventDefault();
|
91
|
-
}
|
92
|
-
})
|
93
|
-
.attr({
|
94
|
-
role: 'dialog',
|
95
|
-
'aria-labelledby': titleId
|
96
|
-
})
|
97
|
-
.mousedown(function(event) {
|
98
|
-
self.moveToTop(false, event);
|
99
|
-
}),
|
100
|
-
|
101
|
-
uiDialogContent = self.element
|
102
|
-
.show()
|
103
|
-
.removeAttr('title')
|
104
|
-
.addClass(
|
105
|
-
'ui-dialog-content ' +
|
106
|
-
'ui-widget-content')
|
107
|
-
.appendTo(uiDialog),
|
108
|
-
|
109
|
-
uiDialogTitlebar = (self.uiDialogTitlebar = $('<div></div>'))
|
110
|
-
.addClass(
|
111
|
-
'ui-dialog-titlebar ' +
|
112
|
-
'ui-widget-header ' +
|
113
|
-
'ui-corner-all ' +
|
114
|
-
'ui-helper-clearfix'
|
115
|
-
)
|
116
|
-
.prependTo(uiDialog),
|
117
|
-
|
118
|
-
uiDialogTitlebarClose = $('<a href="#"></a>')
|
119
|
-
.addClass(
|
120
|
-
'ui-dialog-titlebar-close ' +
|
121
|
-
'ui-corner-all'
|
122
|
-
)
|
123
|
-
.attr('role', 'button')
|
124
|
-
.hover(
|
125
|
-
function() {
|
126
|
-
uiDialogTitlebarClose.addClass('ui-state-hover');
|
127
|
-
},
|
128
|
-
function() {
|
129
|
-
uiDialogTitlebarClose.removeClass('ui-state-hover');
|
130
|
-
}
|
131
|
-
)
|
132
|
-
.focus(function() {
|
133
|
-
uiDialogTitlebarClose.addClass('ui-state-focus');
|
134
|
-
})
|
135
|
-
.blur(function() {
|
136
|
-
uiDialogTitlebarClose.removeClass('ui-state-focus');
|
137
|
-
})
|
138
|
-
.click(function(event) {
|
139
|
-
self.close(event);
|
140
|
-
return false;
|
141
|
-
})
|
142
|
-
.appendTo(uiDialogTitlebar),
|
143
|
-
|
144
|
-
uiDialogTitlebarCloseText = (self.uiDialogTitlebarCloseText = $('<span></span>'))
|
145
|
-
.addClass(
|
146
|
-
'ui-icon ' +
|
147
|
-
'ui-icon-closethick'
|
148
|
-
)
|
149
|
-
.text(options.closeText)
|
150
|
-
.appendTo(uiDialogTitlebarClose),
|
151
|
-
|
152
|
-
uiDialogTitle = $('<span></span>')
|
153
|
-
.addClass('ui-dialog-title')
|
154
|
-
.attr('id', titleId)
|
155
|
-
.html(title)
|
156
|
-
.prependTo(uiDialogTitlebar);
|
157
|
-
|
158
|
-
//handling of deprecated beforeclose (vs beforeClose) option
|
159
|
-
//Ticket #4669 http://dev.jqueryui.com/ticket/4669
|
160
|
-
//TODO: remove in 1.9pre
|
161
|
-
if ($.isFunction(options.beforeclose) && !$.isFunction(options.beforeClose)) {
|
162
|
-
options.beforeClose = options.beforeclose;
|
163
|
-
}
|
164
|
-
|
165
|
-
uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection();
|
166
|
-
|
167
|
-
if (options.draggable && $.fn.draggable) {
|
168
|
-
self._makeDraggable();
|
169
|
-
}
|
170
|
-
if (options.resizable && $.fn.resizable) {
|
171
|
-
self._makeResizable();
|
172
|
-
}
|
173
|
-
|
174
|
-
self._createButtons(options.buttons);
|
175
|
-
self._isOpen = false;
|
176
|
-
|
177
|
-
if ($.fn.bgiframe) {
|
178
|
-
uiDialog.bgiframe();
|
179
|
-
}
|
180
|
-
},
|
181
|
-
|
182
|
-
_init: function() {
|
183
|
-
if ( this.options.autoOpen ) {
|
184
|
-
this.open();
|
185
|
-
}
|
186
|
-
},
|
187
|
-
|
188
|
-
destroy: function() {
|
189
|
-
var self = this;
|
190
|
-
|
191
|
-
if (self.overlay) {
|
192
|
-
self.overlay.destroy();
|
193
|
-
}
|
194
|
-
self.uiDialog.hide();
|
195
|
-
self.element
|
196
|
-
.unbind('.dialog')
|
197
|
-
.removeData('dialog')
|
198
|
-
.removeClass('ui-dialog-content ui-widget-content')
|
199
|
-
.hide().appendTo('body');
|
200
|
-
self.uiDialog.remove();
|
201
|
-
|
202
|
-
if (self.originalTitle) {
|
203
|
-
self.element.attr('title', self.originalTitle);
|
204
|
-
}
|
205
|
-
|
206
|
-
return self;
|
207
|
-
},
|
208
|
-
|
209
|
-
widget: function() {
|
210
|
-
return this.uiDialog;
|
211
|
-
},
|
212
|
-
|
213
|
-
close: function(event) {
|
214
|
-
var self = this,
|
215
|
-
maxZ;
|
216
|
-
|
217
|
-
if (false === self._trigger('beforeClose', event)) {
|
218
|
-
return;
|
219
|
-
}
|
220
|
-
|
221
|
-
if (self.overlay) {
|
222
|
-
self.overlay.destroy();
|
223
|
-
}
|
224
|
-
self.uiDialog.unbind('keypress.ui-dialog');
|
225
|
-
|
226
|
-
self._isOpen = false;
|
227
|
-
|
228
|
-
if (self.options.hide) {
|
229
|
-
self.uiDialog.hide(self.options.hide, function() {
|
230
|
-
self._trigger('close', event);
|
231
|
-
});
|
232
|
-
} else {
|
233
|
-
self.uiDialog.hide();
|
234
|
-
self._trigger('close', event);
|
235
|
-
}
|
236
|
-
|
237
|
-
$.ui.dialog.overlay.resize();
|
238
|
-
|
239
|
-
// adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
|
240
|
-
if (self.options.modal) {
|
241
|
-
maxZ = 0;
|
242
|
-
$('.ui-dialog').each(function() {
|
243
|
-
if (this !== self.uiDialog[0]) {
|
244
|
-
maxZ = Math.max(maxZ, $(this).css('z-index'));
|
245
|
-
}
|
246
|
-
});
|
247
|
-
$.ui.dialog.maxZ = maxZ;
|
248
|
-
}
|
249
|
-
|
250
|
-
return self;
|
251
|
-
},
|
252
|
-
|
253
|
-
isOpen: function() {
|
254
|
-
return this._isOpen;
|
255
|
-
},
|
256
|
-
|
257
|
-
// the force parameter allows us to move modal dialogs to their correct
|
258
|
-
// position on open
|
259
|
-
moveToTop: function(force, event) {
|
260
|
-
var self = this,
|
261
|
-
options = self.options,
|
262
|
-
saveScroll;
|
263
|
-
|
264
|
-
if ((options.modal && !force) ||
|
265
|
-
(!options.stack && !options.modal)) {
|
266
|
-
return self._trigger('focus', event);
|
267
|
-
}
|
268
|
-
|
269
|
-
if (options.zIndex > $.ui.dialog.maxZ) {
|
270
|
-
$.ui.dialog.maxZ = options.zIndex;
|
271
|
-
}
|
272
|
-
if (self.overlay) {
|
273
|
-
$.ui.dialog.maxZ += 1;
|
274
|
-
self.overlay.$el.css('z-index', $.ui.dialog.overlay.maxZ = $.ui.dialog.maxZ);
|
275
|
-
}
|
276
|
-
|
277
|
-
//Save and then restore scroll since Opera 9.5+ resets when parent z-Index is changed.
|
278
|
-
// http://ui.jquery.com/bugs/ticket/3193
|
279
|
-
saveScroll = { scrollTop: self.element.attr('scrollTop'), scrollLeft: self.element.attr('scrollLeft') };
|
280
|
-
$.ui.dialog.maxZ += 1;
|
281
|
-
self.uiDialog.css('z-index', $.ui.dialog.maxZ);
|
282
|
-
self.element.attr(saveScroll);
|
283
|
-
self._trigger('focus', event);
|
284
|
-
|
285
|
-
return self;
|
286
|
-
},
|
287
|
-
|
288
|
-
open: function() {
|
289
|
-
if (this._isOpen) { return; }
|
290
|
-
|
291
|
-
var self = this,
|
292
|
-
options = self.options,
|
293
|
-
uiDialog = self.uiDialog;
|
294
|
-
|
295
|
-
self.overlay = options.modal ? new $.ui.dialog.overlay(self) : null;
|
296
|
-
if (uiDialog.next().length) {
|
297
|
-
uiDialog.appendTo('body');
|
298
|
-
}
|
299
|
-
self._size();
|
300
|
-
self._position(options.position);
|
301
|
-
uiDialog.show(options.show);
|
302
|
-
self.moveToTop(true);
|
303
|
-
|
304
|
-
// prevent tabbing out of modal dialogs
|
305
|
-
if (options.modal) {
|
306
|
-
uiDialog.bind('keypress.ui-dialog', function(event) {
|
307
|
-
if (event.keyCode !== $.ui.keyCode.TAB) {
|
308
|
-
return;
|
309
|
-
}
|
310
|
-
|
311
|
-
var tabbables = $(':tabbable', this),
|
312
|
-
first = tabbables.filter(':first'),
|
313
|
-
last = tabbables.filter(':last');
|
314
|
-
|
315
|
-
if (event.target === last[0] && !event.shiftKey) {
|
316
|
-
first.focus(1);
|
317
|
-
return false;
|
318
|
-
} else if (event.target === first[0] && event.shiftKey) {
|
319
|
-
last.focus(1);
|
320
|
-
return false;
|
321
|
-
}
|
322
|
-
});
|
323
|
-
}
|
324
|
-
|
325
|
-
// set focus to the first tabbable element in the content area or the first button
|
326
|
-
// if there are no tabbable elements, set focus on the dialog itself
|
327
|
-
$(self.element.find(':tabbable').get().concat(
|
328
|
-
uiDialog.find('.ui-dialog-buttonpane :tabbable').get().concat(
|
329
|
-
uiDialog.get()))).eq(0).focus();
|
330
|
-
|
331
|
-
self._trigger('open');
|
332
|
-
self._isOpen = true;
|
333
|
-
|
334
|
-
return self;
|
335
|
-
},
|
336
|
-
|
337
|
-
_createButtons: function(buttons) {
|
338
|
-
var self = this,
|
339
|
-
hasButtons = false,
|
340
|
-
uiDialogButtonPane = $('<div></div>')
|
341
|
-
.addClass(
|
342
|
-
'ui-dialog-buttonpane ' +
|
343
|
-
'ui-widget-content ' +
|
344
|
-
'ui-helper-clearfix'
|
345
|
-
),
|
346
|
-
uiButtonSet = $( "<div></div>" )
|
347
|
-
.addClass( "ui-dialog-buttonset" )
|
348
|
-
.appendTo( uiDialogButtonPane );
|
349
|
-
|
350
|
-
// if we already have a button pane, remove it
|
351
|
-
self.uiDialog.find('.ui-dialog-buttonpane').remove();
|
352
|
-
|
353
|
-
if (typeof buttons === 'object' && buttons !== null) {
|
354
|
-
$.each(buttons, function() {
|
355
|
-
return !(hasButtons = true);
|
356
|
-
});
|
357
|
-
}
|
358
|
-
if (hasButtons) {
|
359
|
-
$.each(buttons, function(name, fn) {
|
360
|
-
var button = $('<button type="button"></button>')
|
361
|
-
.text(name)
|
362
|
-
.click(function() { fn.apply(self.element[0], arguments); })
|
363
|
-
.appendTo(uiButtonSet);
|
364
|
-
if ($.fn.button) {
|
365
|
-
button.button();
|
366
|
-
}
|
367
|
-
});
|
368
|
-
uiDialogButtonPane.appendTo(self.uiDialog);
|
369
|
-
}
|
370
|
-
},
|
371
|
-
|
372
|
-
_makeDraggable: function() {
|
373
|
-
var self = this,
|
374
|
-
options = self.options,
|
375
|
-
doc = $(document),
|
376
|
-
heightBeforeDrag;
|
377
|
-
|
378
|
-
function filteredUi(ui) {
|
379
|
-
return {
|
380
|
-
position: ui.position,
|
381
|
-
offset: ui.offset
|
382
|
-
};
|
383
|
-
}
|
384
|
-
|
385
|
-
self.uiDialog.draggable({
|
386
|
-
cancel: '.ui-dialog-content, .ui-dialog-titlebar-close',
|
387
|
-
handle: '.ui-dialog-titlebar',
|
388
|
-
containment: 'document',
|
389
|
-
start: function(event, ui) {
|
390
|
-
heightBeforeDrag = options.height === "auto" ? "auto" : $(this).height();
|
391
|
-
$(this).height($(this).height()).addClass("ui-dialog-dragging");
|
392
|
-
self._trigger('dragStart', event, filteredUi(ui));
|
393
|
-
},
|
394
|
-
drag: function(event, ui) {
|
395
|
-
self._trigger('drag', event, filteredUi(ui));
|
396
|
-
},
|
397
|
-
stop: function(event, ui) {
|
398
|
-
options.position = [ui.position.left - doc.scrollLeft(),
|
399
|
-
ui.position.top - doc.scrollTop()];
|
400
|
-
$(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag);
|
401
|
-
self._trigger('dragStop', event, filteredUi(ui));
|
402
|
-
$.ui.dialog.overlay.resize();
|
403
|
-
}
|
404
|
-
});
|
405
|
-
},
|
406
|
-
|
407
|
-
_makeResizable: function(handles) {
|
408
|
-
handles = (handles === undefined ? this.options.resizable : handles);
|
409
|
-
var self = this,
|
410
|
-
options = self.options,
|
411
|
-
// .ui-resizable has position: relative defined in the stylesheet
|
412
|
-
// but dialogs have to use absolute or fixed positioning
|
413
|
-
position = self.uiDialog.css('position'),
|
414
|
-
resizeHandles = (typeof handles === 'string' ?
|
415
|
-
handles :
|
416
|
-
'n,e,s,w,se,sw,ne,nw'
|
417
|
-
);
|
418
|
-
|
419
|
-
function filteredUi(ui) {
|
420
|
-
return {
|
421
|
-
originalPosition: ui.originalPosition,
|
422
|
-
originalSize: ui.originalSize,
|
423
|
-
position: ui.position,
|
424
|
-
size: ui.size
|
425
|
-
};
|
426
|
-
}
|
427
|
-
|
428
|
-
self.uiDialog.resizable({
|
429
|
-
cancel: '.ui-dialog-content',
|
430
|
-
containment: 'document',
|
431
|
-
alsoResize: self.element,
|
432
|
-
maxWidth: options.maxWidth,
|
433
|
-
maxHeight: options.maxHeight,
|
434
|
-
minWidth: options.minWidth,
|
435
|
-
minHeight: self._minHeight(),
|
436
|
-
handles: resizeHandles,
|
437
|
-
start: function(event, ui) {
|
438
|
-
$(this).addClass("ui-dialog-resizing");
|
439
|
-
self._trigger('resizeStart', event, filteredUi(ui));
|
440
|
-
},
|
441
|
-
resize: function(event, ui) {
|
442
|
-
self._trigger('resize', event, filteredUi(ui));
|
443
|
-
},
|
444
|
-
stop: function(event, ui) {
|
445
|
-
$(this).removeClass("ui-dialog-resizing");
|
446
|
-
options.height = $(this).height();
|
447
|
-
options.width = $(this).width();
|
448
|
-
self._trigger('resizeStop', event, filteredUi(ui));
|
449
|
-
$.ui.dialog.overlay.resize();
|
450
|
-
}
|
451
|
-
})
|
452
|
-
.css('position', position)
|
453
|
-
.find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se');
|
454
|
-
},
|
455
|
-
|
456
|
-
_minHeight: function() {
|
457
|
-
var options = this.options;
|
458
|
-
|
459
|
-
if (options.height === 'auto') {
|
460
|
-
return options.minHeight;
|
461
|
-
} else {
|
462
|
-
return Math.min(options.minHeight, options.height);
|
463
|
-
}
|
464
|
-
},
|
465
|
-
|
466
|
-
_position: function(position) {
|
467
|
-
var myAt = [],
|
468
|
-
offset = [0, 0],
|
469
|
-
isVisible;
|
470
|
-
|
471
|
-
if (position) {
|
472
|
-
// deep extending converts arrays to objects in jQuery <= 1.3.2 :-(
|
473
|
-
// if (typeof position == 'string' || $.isArray(position)) {
|
474
|
-
// myAt = $.isArray(position) ? position : position.split(' ');
|
475
|
-
|
476
|
-
if (typeof position === 'string' || (typeof position === 'object' && '0' in position)) {
|
477
|
-
myAt = position.split ? position.split(' ') : [position[0], position[1]];
|
478
|
-
if (myAt.length === 1) {
|
479
|
-
myAt[1] = myAt[0];
|
480
|
-
}
|
481
|
-
|
482
|
-
$.each(['left', 'top'], function(i, offsetPosition) {
|
483
|
-
if (+myAt[i] === myAt[i]) {
|
484
|
-
offset[i] = myAt[i];
|
485
|
-
myAt[i] = offsetPosition;
|
486
|
-
}
|
487
|
-
});
|
488
|
-
|
489
|
-
position = {
|
490
|
-
my: myAt.join(" "),
|
491
|
-
at: myAt.join(" "),
|
492
|
-
offset: offset.join(" ")
|
493
|
-
};
|
494
|
-
}
|
495
|
-
|
496
|
-
position = $.extend({}, $.ui.dialog.prototype.options.position, position);
|
497
|
-
} else {
|
498
|
-
position = $.ui.dialog.prototype.options.position;
|
499
|
-
}
|
500
|
-
|
501
|
-
// need to show the dialog to get the actual offset in the position plugin
|
502
|
-
isVisible = this.uiDialog.is(':visible');
|
503
|
-
if (!isVisible) {
|
504
|
-
this.uiDialog.show();
|
505
|
-
}
|
506
|
-
this.uiDialog
|
507
|
-
// workaround for jQuery bug #5781 http://dev.jquery.com/ticket/5781
|
508
|
-
.css({ top: 0, left: 0 })
|
509
|
-
.position(position);
|
510
|
-
if (!isVisible) {
|
511
|
-
this.uiDialog.hide();
|
512
|
-
}
|
513
|
-
},
|
514
|
-
|
515
|
-
_setOption: function(key, value){
|
516
|
-
var self = this,
|
517
|
-
uiDialog = self.uiDialog,
|
518
|
-
isResizable = uiDialog.is(':data(resizable)'),
|
519
|
-
resize = false;
|
520
|
-
|
521
|
-
switch (key) {
|
522
|
-
//handling of deprecated beforeclose (vs beforeClose) option
|
523
|
-
//Ticket #4669 http://dev.jqueryui.com/ticket/4669
|
524
|
-
//TODO: remove in 1.9pre
|
525
|
-
case "beforeclose":
|
526
|
-
key = "beforeClose";
|
527
|
-
break;
|
528
|
-
case "buttons":
|
529
|
-
self._createButtons(value);
|
530
|
-
resize = true;
|
531
|
-
break;
|
532
|
-
case "closeText":
|
533
|
-
// convert whatever was passed in to a string, for text() to not throw up
|
534
|
-
self.uiDialogTitlebarCloseText.text("" + value);
|
535
|
-
break;
|
536
|
-
case "dialogClass":
|
537
|
-
uiDialog
|
538
|
-
.removeClass(self.options.dialogClass)
|
539
|
-
.addClass(uiDialogClasses + value);
|
540
|
-
break;
|
541
|
-
case "disabled":
|
542
|
-
if (value) {
|
543
|
-
uiDialog.addClass('ui-dialog-disabled');
|
544
|
-
} else {
|
545
|
-
uiDialog.removeClass('ui-dialog-disabled');
|
546
|
-
}
|
547
|
-
break;
|
548
|
-
case "draggable":
|
549
|
-
if (value) {
|
550
|
-
self._makeDraggable();
|
551
|
-
} else {
|
552
|
-
uiDialog.draggable('destroy');
|
553
|
-
}
|
554
|
-
break;
|
555
|
-
case "height":
|
556
|
-
resize = true;
|
557
|
-
break;
|
558
|
-
case "maxHeight":
|
559
|
-
if (isResizable) {
|
560
|
-
uiDialog.resizable('option', 'maxHeight', value);
|
561
|
-
}
|
562
|
-
resize = true;
|
563
|
-
break;
|
564
|
-
case "maxWidth":
|
565
|
-
if (isResizable) {
|
566
|
-
uiDialog.resizable('option', 'maxWidth', value);
|
567
|
-
}
|
568
|
-
resize = true;
|
569
|
-
break;
|
570
|
-
case "minHeight":
|
571
|
-
if (isResizable) {
|
572
|
-
uiDialog.resizable('option', 'minHeight', value);
|
573
|
-
}
|
574
|
-
resize = true;
|
575
|
-
break;
|
576
|
-
case "minWidth":
|
577
|
-
if (isResizable) {
|
578
|
-
uiDialog.resizable('option', 'minWidth', value);
|
579
|
-
}
|
580
|
-
resize = true;
|
581
|
-
break;
|
582
|
-
case "position":
|
583
|
-
self._position(value);
|
584
|
-
break;
|
585
|
-
case "resizable":
|
586
|
-
// currently resizable, becoming non-resizable
|
587
|
-
if (isResizable && !value) {
|
588
|
-
uiDialog.resizable('destroy');
|
589
|
-
}
|
590
|
-
|
591
|
-
// currently resizable, changing handles
|
592
|
-
if (isResizable && typeof value === 'string') {
|
593
|
-
uiDialog.resizable('option', 'handles', value);
|
594
|
-
}
|
595
|
-
|
596
|
-
// currently non-resizable, becoming resizable
|
597
|
-
if (!isResizable && value !== false) {
|
598
|
-
self._makeResizable(value);
|
599
|
-
}
|
600
|
-
break;
|
601
|
-
case "title":
|
602
|
-
// convert whatever was passed in o a string, for html() to not throw up
|
603
|
-
$(".ui-dialog-title", self.uiDialogTitlebar).html("" + (value || ' '));
|
604
|
-
break;
|
605
|
-
case "width":
|
606
|
-
resize = true;
|
607
|
-
break;
|
608
|
-
}
|
609
|
-
|
610
|
-
$.Widget.prototype._setOption.apply(self, arguments);
|
611
|
-
if (resize) {
|
612
|
-
self._size();
|
613
|
-
}
|
614
|
-
},
|
615
|
-
|
616
|
-
_size: function() {
|
617
|
-
/* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
|
618
|
-
* divs will both have width and height set, so we need to reset them
|
619
|
-
*/
|
620
|
-
var options = this.options,
|
621
|
-
nonContentHeight;
|
622
|
-
|
623
|
-
// reset content sizing
|
624
|
-
// hide for non content measurement because height: 0 doesn't work in IE quirks mode (see #4350)
|
625
|
-
this.element.css({
|
626
|
-
width: 'auto',
|
627
|
-
minHeight: 0,
|
628
|
-
height: 0
|
629
|
-
});
|
630
|
-
|
631
|
-
if (options.minWidth > options.width) {
|
632
|
-
options.width = options.minWidth;
|
633
|
-
}
|
634
|
-
|
635
|
-
// reset wrapper sizing
|
636
|
-
// determine the height of all the non-content elements
|
637
|
-
nonContentHeight = this.uiDialog.css({
|
638
|
-
height: 'auto',
|
639
|
-
width: options.width
|
640
|
-
})
|
641
|
-
.height();
|
642
|
-
|
643
|
-
this.element
|
644
|
-
.css(options.height === 'auto' ? {
|
645
|
-
minHeight: Math.max(options.minHeight - nonContentHeight, 0),
|
646
|
-
height: 'auto'
|
647
|
-
} : {
|
648
|
-
minHeight: 0,
|
649
|
-
height: Math.max(options.height - nonContentHeight, 0)
|
650
|
-
})
|
651
|
-
.show();
|
652
|
-
|
653
|
-
if (this.uiDialog.is(':data(resizable)')) {
|
654
|
-
this.uiDialog.resizable('option', 'minHeight', this._minHeight());
|
655
|
-
}
|
656
|
-
}
|
657
|
-
});
|
658
|
-
|
659
|
-
$.extend($.ui.dialog, {
|
660
|
-
version: "1.8.4",
|
661
|
-
|
662
|
-
uuid: 0,
|
663
|
-
maxZ: 0,
|
664
|
-
|
665
|
-
getTitleId: function($el) {
|
666
|
-
var id = $el.attr('id');
|
667
|
-
if (!id) {
|
668
|
-
this.uuid += 1;
|
669
|
-
id = this.uuid;
|
670
|
-
}
|
671
|
-
return 'ui-dialog-title-' + id;
|
672
|
-
},
|
673
|
-
|
674
|
-
overlay: function(dialog) {
|
675
|
-
this.$el = $.ui.dialog.overlay.create(dialog);
|
676
|
-
}
|
677
|
-
});
|
678
|
-
|
679
|
-
$.extend($.ui.dialog.overlay, {
|
680
|
-
instances: [],
|
681
|
-
// reuse old instances due to IE memory leak with alpha transparency (see #5185)
|
682
|
-
oldInstances: [],
|
683
|
-
maxZ: 0,
|
684
|
-
events: $.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','),
|
685
|
-
function(event) { return event + '.dialog-overlay'; }).join(' '),
|
686
|
-
create: function(dialog) {
|
687
|
-
if (this.instances.length === 0) {
|
688
|
-
// prevent use of anchors and inputs
|
689
|
-
// we use a setTimeout in case the overlay is created from an
|
690
|
-
// event that we're going to be cancelling (see #2804)
|
691
|
-
setTimeout(function() {
|
692
|
-
// handle $(el).dialog().dialog('close') (see #4065)
|
693
|
-
if ($.ui.dialog.overlay.instances.length) {
|
694
|
-
$(document).bind($.ui.dialog.overlay.events, function(event) {
|
695
|
-
// stop events if the z-index of the target is < the z-index of the overlay
|
696
|
-
return ($(event.target).zIndex() >= $.ui.dialog.overlay.maxZ);
|
697
|
-
});
|
698
|
-
}
|
699
|
-
}, 1);
|
700
|
-
|
701
|
-
// allow closing by pressing the escape key
|
702
|
-
$(document).bind('keydown.dialog-overlay', function(event) {
|
703
|
-
if (dialog.options.closeOnEscape && event.keyCode &&
|
704
|
-
event.keyCode === $.ui.keyCode.ESCAPE) {
|
705
|
-
|
706
|
-
dialog.close(event);
|
707
|
-
event.preventDefault();
|
708
|
-
}
|
709
|
-
});
|
710
|
-
|
711
|
-
// handle window resize
|
712
|
-
$(window).bind('resize.dialog-overlay', $.ui.dialog.overlay.resize);
|
713
|
-
}
|
714
|
-
|
715
|
-
var $el = (this.oldInstances.pop() || $('<div></div>').addClass('ui-widget-overlay'))
|
716
|
-
.appendTo(document.body)
|
717
|
-
.css({
|
718
|
-
width: this.width(),
|
719
|
-
height: this.height()
|
720
|
-
});
|
721
|
-
|
722
|
-
if ($.fn.bgiframe) {
|
723
|
-
$el.bgiframe();
|
724
|
-
}
|
725
|
-
|
726
|
-
this.instances.push($el);
|
727
|
-
return $el;
|
728
|
-
},
|
729
|
-
|
730
|
-
destroy: function($el) {
|
731
|
-
this.oldInstances.push(this.instances.splice($.inArray($el, this.instances), 1)[0]);
|
732
|
-
|
733
|
-
if (this.instances.length === 0) {
|
734
|
-
$([document, window]).unbind('.dialog-overlay');
|
735
|
-
}
|
736
|
-
|
737
|
-
$el.remove();
|
738
|
-
|
739
|
-
// adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
|
740
|
-
var maxZ = 0;
|
741
|
-
$.each(this.instances, function() {
|
742
|
-
maxZ = Math.max(maxZ, this.css('z-index'));
|
743
|
-
});
|
744
|
-
this.maxZ = maxZ;
|
745
|
-
},
|
746
|
-
|
747
|
-
height: function() {
|
748
|
-
var scrollHeight,
|
749
|
-
offsetHeight;
|
750
|
-
// handle IE 6
|
751
|
-
if ($.browser.msie && $.browser.version < 7) {
|
752
|
-
scrollHeight = Math.max(
|
753
|
-
document.documentElement.scrollHeight,
|
754
|
-
document.body.scrollHeight
|
755
|
-
);
|
756
|
-
offsetHeight = Math.max(
|
757
|
-
document.documentElement.offsetHeight,
|
758
|
-
document.body.offsetHeight
|
759
|
-
);
|
760
|
-
|
761
|
-
if (scrollHeight < offsetHeight) {
|
762
|
-
return $(window).height() + 'px';
|
763
|
-
} else {
|
764
|
-
return scrollHeight + 'px';
|
765
|
-
}
|
766
|
-
// handle "good" browsers
|
767
|
-
} else {
|
768
|
-
return $(document).height() + 'px';
|
769
|
-
}
|
770
|
-
},
|
771
|
-
|
772
|
-
width: function() {
|
773
|
-
var scrollWidth,
|
774
|
-
offsetWidth;
|
775
|
-
// handle IE 6
|
776
|
-
if ($.browser.msie && $.browser.version < 7) {
|
777
|
-
scrollWidth = Math.max(
|
778
|
-
document.documentElement.scrollWidth,
|
779
|
-
document.body.scrollWidth
|
780
|
-
);
|
781
|
-
offsetWidth = Math.max(
|
782
|
-
document.documentElement.offsetWidth,
|
783
|
-
document.body.offsetWidth
|
784
|
-
);
|
785
|
-
|
786
|
-
if (scrollWidth < offsetWidth) {
|
787
|
-
return $(window).width() + 'px';
|
788
|
-
} else {
|
789
|
-
return scrollWidth + 'px';
|
790
|
-
}
|
791
|
-
// handle "good" browsers
|
792
|
-
} else {
|
793
|
-
return $(document).width() + 'px';
|
794
|
-
}
|
795
|
-
},
|
796
|
-
|
797
|
-
resize: function() {
|
798
|
-
/* If the dialog is draggable and the user drags it past the
|
799
|
-
* right edge of the window, the document becomes wider so we
|
800
|
-
* need to stretch the overlay. If the user then drags the
|
801
|
-
* dialog back to the left, the document will become narrower,
|
802
|
-
* so we need to shrink the overlay to the appropriate size.
|
803
|
-
* This is handled by shrinking the overlay before setting it
|
804
|
-
* to the full document size.
|
805
|
-
*/
|
806
|
-
var $overlays = $([]);
|
807
|
-
$.each($.ui.dialog.overlay.instances, function() {
|
808
|
-
$overlays = $overlays.add(this);
|
809
|
-
});
|
810
|
-
|
811
|
-
$overlays.css({
|
812
|
-
width: 0,
|
813
|
-
height: 0
|
814
|
-
}).css({
|
815
|
-
width: $.ui.dialog.overlay.width(),
|
816
|
-
height: $.ui.dialog.overlay.height()
|
817
|
-
});
|
818
|
-
}
|
819
|
-
});
|
820
|
-
|
821
|
-
$.extend($.ui.dialog.overlay.prototype, {
|
822
|
-
destroy: function() {
|
823
|
-
$.ui.dialog.overlay.destroy(this.$el);
|
824
|
-
}
|
825
|
-
});
|
826
|
-
|
827
|
-
}(jQuery));
|