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,846 +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/tabs/
|
10
|
-
*
|
11
|
-
* Depends:
|
12
|
-
* jquery.ui.core.js
|
13
|
-
* jquery.ui.widget.js
|
14
|
-
*/
|
15
|
-
(function( $, undefined ) {
|
16
|
-
|
17
|
-
var tabId = 0,
|
18
|
-
rhash = /#.*$/;
|
19
|
-
|
20
|
-
function getNextTabId() {
|
21
|
-
return ++tabId;
|
22
|
-
}
|
23
|
-
|
24
|
-
function isLocal( anchor ) {
|
25
|
-
return anchor.hash.length > 1 &&
|
26
|
-
decodeURIComponent( anchor.href.replace( rhash, "" ) ) ===
|
27
|
-
decodeURIComponent( location.href.replace( rhash, "" ) );
|
28
|
-
}
|
29
|
-
|
30
|
-
$.widget( "ui.tabs", {
|
31
|
-
version: "1.10.2",
|
32
|
-
delay: 300,
|
33
|
-
options: {
|
34
|
-
active: null,
|
35
|
-
collapsible: false,
|
36
|
-
event: "click",
|
37
|
-
heightStyle: "content",
|
38
|
-
hide: null,
|
39
|
-
show: null,
|
40
|
-
|
41
|
-
// callbacks
|
42
|
-
activate: null,
|
43
|
-
beforeActivate: null,
|
44
|
-
beforeLoad: null,
|
45
|
-
load: null
|
46
|
-
},
|
47
|
-
|
48
|
-
_create: function() {
|
49
|
-
var that = this,
|
50
|
-
options = this.options;
|
51
|
-
|
52
|
-
this.running = false;
|
53
|
-
|
54
|
-
this.element
|
55
|
-
.addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" )
|
56
|
-
.toggleClass( "ui-tabs-collapsible", options.collapsible )
|
57
|
-
// Prevent users from focusing disabled tabs via click
|
58
|
-
.delegate( ".ui-tabs-nav > li", "mousedown" + this.eventNamespace, function( event ) {
|
59
|
-
if ( $( this ).is( ".ui-state-disabled" ) ) {
|
60
|
-
event.preventDefault();
|
61
|
-
}
|
62
|
-
})
|
63
|
-
// support: IE <9
|
64
|
-
// Preventing the default action in mousedown doesn't prevent IE
|
65
|
-
// from focusing the element, so if the anchor gets focused, blur.
|
66
|
-
// We don't have to worry about focusing the previously focused
|
67
|
-
// element since clicking on a non-focusable element should focus
|
68
|
-
// the body anyway.
|
69
|
-
.delegate( ".ui-tabs-anchor", "focus" + this.eventNamespace, function() {
|
70
|
-
if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) {
|
71
|
-
this.blur();
|
72
|
-
}
|
73
|
-
});
|
74
|
-
|
75
|
-
this._processTabs();
|
76
|
-
options.active = this._initialActive();
|
77
|
-
|
78
|
-
// Take disabling tabs via class attribute from HTML
|
79
|
-
// into account and update option properly.
|
80
|
-
if ( $.isArray( options.disabled ) ) {
|
81
|
-
options.disabled = $.unique( options.disabled.concat(
|
82
|
-
$.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) {
|
83
|
-
return that.tabs.index( li );
|
84
|
-
})
|
85
|
-
) ).sort();
|
86
|
-
}
|
87
|
-
|
88
|
-
// check for length avoids error when initializing empty list
|
89
|
-
if ( this.options.active !== false && this.anchors.length ) {
|
90
|
-
this.active = this._findActive( options.active );
|
91
|
-
} else {
|
92
|
-
this.active = $();
|
93
|
-
}
|
94
|
-
|
95
|
-
this._refresh();
|
96
|
-
|
97
|
-
if ( this.active.length ) {
|
98
|
-
this.load( options.active );
|
99
|
-
}
|
100
|
-
},
|
101
|
-
|
102
|
-
_initialActive: function() {
|
103
|
-
var active = this.options.active,
|
104
|
-
collapsible = this.options.collapsible,
|
105
|
-
locationHash = location.hash.substring( 1 );
|
106
|
-
|
107
|
-
if ( active === null ) {
|
108
|
-
// check the fragment identifier in the URL
|
109
|
-
if ( locationHash ) {
|
110
|
-
this.tabs.each(function( i, tab ) {
|
111
|
-
if ( $( tab ).attr( "aria-controls" ) === locationHash ) {
|
112
|
-
active = i;
|
113
|
-
return false;
|
114
|
-
}
|
115
|
-
});
|
116
|
-
}
|
117
|
-
|
118
|
-
// check for a tab marked active via a class
|
119
|
-
if ( active === null ) {
|
120
|
-
active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) );
|
121
|
-
}
|
122
|
-
|
123
|
-
// no active tab, set to false
|
124
|
-
if ( active === null || active === -1 ) {
|
125
|
-
active = this.tabs.length ? 0 : false;
|
126
|
-
}
|
127
|
-
}
|
128
|
-
|
129
|
-
// handle numbers: negative, out of range
|
130
|
-
if ( active !== false ) {
|
131
|
-
active = this.tabs.index( this.tabs.eq( active ) );
|
132
|
-
if ( active === -1 ) {
|
133
|
-
active = collapsible ? false : 0;
|
134
|
-
}
|
135
|
-
}
|
136
|
-
|
137
|
-
// don't allow collapsible: false and active: false
|
138
|
-
if ( !collapsible && active === false && this.anchors.length ) {
|
139
|
-
active = 0;
|
140
|
-
}
|
141
|
-
|
142
|
-
return active;
|
143
|
-
},
|
144
|
-
|
145
|
-
_getCreateEventData: function() {
|
146
|
-
return {
|
147
|
-
tab: this.active,
|
148
|
-
panel: !this.active.length ? $() : this._getPanelForTab( this.active )
|
149
|
-
};
|
150
|
-
},
|
151
|
-
|
152
|
-
_tabKeydown: function( event ) {
|
153
|
-
/*jshint maxcomplexity:15*/
|
154
|
-
var focusedTab = $( this.document[0].activeElement ).closest( "li" ),
|
155
|
-
selectedIndex = this.tabs.index( focusedTab ),
|
156
|
-
goingForward = true;
|
157
|
-
|
158
|
-
if ( this._handlePageNav( event ) ) {
|
159
|
-
return;
|
160
|
-
}
|
161
|
-
|
162
|
-
switch ( event.keyCode ) {
|
163
|
-
case $.ui.keyCode.RIGHT:
|
164
|
-
case $.ui.keyCode.DOWN:
|
165
|
-
selectedIndex++;
|
166
|
-
break;
|
167
|
-
case $.ui.keyCode.UP:
|
168
|
-
case $.ui.keyCode.LEFT:
|
169
|
-
goingForward = false;
|
170
|
-
selectedIndex--;
|
171
|
-
break;
|
172
|
-
case $.ui.keyCode.END:
|
173
|
-
selectedIndex = this.anchors.length - 1;
|
174
|
-
break;
|
175
|
-
case $.ui.keyCode.HOME:
|
176
|
-
selectedIndex = 0;
|
177
|
-
break;
|
178
|
-
case $.ui.keyCode.SPACE:
|
179
|
-
// Activate only, no collapsing
|
180
|
-
event.preventDefault();
|
181
|
-
clearTimeout( this.activating );
|
182
|
-
this._activate( selectedIndex );
|
183
|
-
return;
|
184
|
-
case $.ui.keyCode.ENTER:
|
185
|
-
// Toggle (cancel delayed activation, allow collapsing)
|
186
|
-
event.preventDefault();
|
187
|
-
clearTimeout( this.activating );
|
188
|
-
// Determine if we should collapse or activate
|
189
|
-
this._activate( selectedIndex === this.options.active ? false : selectedIndex );
|
190
|
-
return;
|
191
|
-
default:
|
192
|
-
return;
|
193
|
-
}
|
194
|
-
|
195
|
-
// Focus the appropriate tab, based on which key was pressed
|
196
|
-
event.preventDefault();
|
197
|
-
clearTimeout( this.activating );
|
198
|
-
selectedIndex = this._focusNextTab( selectedIndex, goingForward );
|
199
|
-
|
200
|
-
// Navigating with control key will prevent automatic activation
|
201
|
-
if ( !event.ctrlKey ) {
|
202
|
-
// Update aria-selected immediately so that AT think the tab is already selected.
|
203
|
-
// Otherwise AT may confuse the user by stating that they need to activate the tab,
|
204
|
-
// but the tab will already be activated by the time the announcement finishes.
|
205
|
-
focusedTab.attr( "aria-selected", "false" );
|
206
|
-
this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" );
|
207
|
-
|
208
|
-
this.activating = this._delay(function() {
|
209
|
-
this.option( "active", selectedIndex );
|
210
|
-
}, this.delay );
|
211
|
-
}
|
212
|
-
},
|
213
|
-
|
214
|
-
_panelKeydown: function( event ) {
|
215
|
-
if ( this._handlePageNav( event ) ) {
|
216
|
-
return;
|
217
|
-
}
|
218
|
-
|
219
|
-
// Ctrl+up moves focus to the current tab
|
220
|
-
if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) {
|
221
|
-
event.preventDefault();
|
222
|
-
this.active.focus();
|
223
|
-
}
|
224
|
-
},
|
225
|
-
|
226
|
-
// Alt+page up/down moves focus to the previous/next tab (and activates)
|
227
|
-
_handlePageNav: function( event ) {
|
228
|
-
if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) {
|
229
|
-
this._activate( this._focusNextTab( this.options.active - 1, false ) );
|
230
|
-
return true;
|
231
|
-
}
|
232
|
-
if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) {
|
233
|
-
this._activate( this._focusNextTab( this.options.active + 1, true ) );
|
234
|
-
return true;
|
235
|
-
}
|
236
|
-
},
|
237
|
-
|
238
|
-
_findNextTab: function( index, goingForward ) {
|
239
|
-
var lastTabIndex = this.tabs.length - 1;
|
240
|
-
|
241
|
-
function constrain() {
|
242
|
-
if ( index > lastTabIndex ) {
|
243
|
-
index = 0;
|
244
|
-
}
|
245
|
-
if ( index < 0 ) {
|
246
|
-
index = lastTabIndex;
|
247
|
-
}
|
248
|
-
return index;
|
249
|
-
}
|
250
|
-
|
251
|
-
while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) {
|
252
|
-
index = goingForward ? index + 1 : index - 1;
|
253
|
-
}
|
254
|
-
|
255
|
-
return index;
|
256
|
-
},
|
257
|
-
|
258
|
-
_focusNextTab: function( index, goingForward ) {
|
259
|
-
index = this._findNextTab( index, goingForward );
|
260
|
-
this.tabs.eq( index ).focus();
|
261
|
-
return index;
|
262
|
-
},
|
263
|
-
|
264
|
-
_setOption: function( key, value ) {
|
265
|
-
if ( key === "active" ) {
|
266
|
-
// _activate() will handle invalid values and update this.options
|
267
|
-
this._activate( value );
|
268
|
-
return;
|
269
|
-
}
|
270
|
-
|
271
|
-
if ( key === "disabled" ) {
|
272
|
-
// don't use the widget factory's disabled handling
|
273
|
-
this._setupDisabled( value );
|
274
|
-
return;
|
275
|
-
}
|
276
|
-
|
277
|
-
this._super( key, value);
|
278
|
-
|
279
|
-
if ( key === "collapsible" ) {
|
280
|
-
this.element.toggleClass( "ui-tabs-collapsible", value );
|
281
|
-
// Setting collapsible: false while collapsed; open first panel
|
282
|
-
if ( !value && this.options.active === false ) {
|
283
|
-
this._activate( 0 );
|
284
|
-
}
|
285
|
-
}
|
286
|
-
|
287
|
-
if ( key === "event" ) {
|
288
|
-
this._setupEvents( value );
|
289
|
-
}
|
290
|
-
|
291
|
-
if ( key === "heightStyle" ) {
|
292
|
-
this._setupHeightStyle( value );
|
293
|
-
}
|
294
|
-
},
|
295
|
-
|
296
|
-
_tabId: function( tab ) {
|
297
|
-
return tab.attr( "aria-controls" ) || "ui-tabs-" + getNextTabId();
|
298
|
-
},
|
299
|
-
|
300
|
-
_sanitizeSelector: function( hash ) {
|
301
|
-
return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : "";
|
302
|
-
},
|
303
|
-
|
304
|
-
refresh: function() {
|
305
|
-
var options = this.options,
|
306
|
-
lis = this.tablist.children( ":has(a[href])" );
|
307
|
-
|
308
|
-
// get disabled tabs from class attribute from HTML
|
309
|
-
// this will get converted to a boolean if needed in _refresh()
|
310
|
-
options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) {
|
311
|
-
return lis.index( tab );
|
312
|
-
});
|
313
|
-
|
314
|
-
this._processTabs();
|
315
|
-
|
316
|
-
// was collapsed or no tabs
|
317
|
-
if ( options.active === false || !this.anchors.length ) {
|
318
|
-
options.active = false;
|
319
|
-
this.active = $();
|
320
|
-
// was active, but active tab is gone
|
321
|
-
} else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) {
|
322
|
-
// all remaining tabs are disabled
|
323
|
-
if ( this.tabs.length === options.disabled.length ) {
|
324
|
-
options.active = false;
|
325
|
-
this.active = $();
|
326
|
-
// activate previous tab
|
327
|
-
} else {
|
328
|
-
this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) );
|
329
|
-
}
|
330
|
-
// was active, active tab still exists
|
331
|
-
} else {
|
332
|
-
// make sure active index is correct
|
333
|
-
options.active = this.tabs.index( this.active );
|
334
|
-
}
|
335
|
-
|
336
|
-
this._refresh();
|
337
|
-
},
|
338
|
-
|
339
|
-
_refresh: function() {
|
340
|
-
this._setupDisabled( this.options.disabled );
|
341
|
-
this._setupEvents( this.options.event );
|
342
|
-
this._setupHeightStyle( this.options.heightStyle );
|
343
|
-
|
344
|
-
this.tabs.not( this.active ).attr({
|
345
|
-
"aria-selected": "false",
|
346
|
-
tabIndex: -1
|
347
|
-
});
|
348
|
-
this.panels.not( this._getPanelForTab( this.active ) )
|
349
|
-
.hide()
|
350
|
-
.attr({
|
351
|
-
"aria-expanded": "false",
|
352
|
-
"aria-hidden": "true"
|
353
|
-
});
|
354
|
-
|
355
|
-
// Make sure one tab is in the tab order
|
356
|
-
if ( !this.active.length ) {
|
357
|
-
this.tabs.eq( 0 ).attr( "tabIndex", 0 );
|
358
|
-
} else {
|
359
|
-
this.active
|
360
|
-
.addClass( "ui-tabs-active ui-state-active" )
|
361
|
-
.attr({
|
362
|
-
"aria-selected": "true",
|
363
|
-
tabIndex: 0
|
364
|
-
});
|
365
|
-
this._getPanelForTab( this.active )
|
366
|
-
.show()
|
367
|
-
.attr({
|
368
|
-
"aria-expanded": "true",
|
369
|
-
"aria-hidden": "false"
|
370
|
-
});
|
371
|
-
}
|
372
|
-
},
|
373
|
-
|
374
|
-
_processTabs: function() {
|
375
|
-
var that = this;
|
376
|
-
|
377
|
-
this.tablist = this._getList()
|
378
|
-
.addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
|
379
|
-
.attr( "role", "tablist" );
|
380
|
-
|
381
|
-
this.tabs = this.tablist.find( "> li:has(a[href])" )
|
382
|
-
.addClass( "ui-state-default ui-corner-top" )
|
383
|
-
.attr({
|
384
|
-
role: "tab",
|
385
|
-
tabIndex: -1
|
386
|
-
});
|
387
|
-
|
388
|
-
this.anchors = this.tabs.map(function() {
|
389
|
-
return $( "a", this )[ 0 ];
|
390
|
-
})
|
391
|
-
.addClass( "ui-tabs-anchor" )
|
392
|
-
.attr({
|
393
|
-
role: "presentation",
|
394
|
-
tabIndex: -1
|
395
|
-
});
|
396
|
-
|
397
|
-
this.panels = $();
|
398
|
-
|
399
|
-
this.anchors.each(function( i, anchor ) {
|
400
|
-
var selector, panel, panelId,
|
401
|
-
anchorId = $( anchor ).uniqueId().attr( "id" ),
|
402
|
-
tab = $( anchor ).closest( "li" ),
|
403
|
-
originalAriaControls = tab.attr( "aria-controls" );
|
404
|
-
|
405
|
-
// inline tab
|
406
|
-
if ( isLocal( anchor ) ) {
|
407
|
-
selector = anchor.hash;
|
408
|
-
panel = that.element.find( that._sanitizeSelector( selector ) );
|
409
|
-
// remote tab
|
410
|
-
} else {
|
411
|
-
panelId = that._tabId( tab );
|
412
|
-
selector = "#" + panelId;
|
413
|
-
panel = that.element.find( selector );
|
414
|
-
if ( !panel.length ) {
|
415
|
-
panel = that._createPanel( panelId );
|
416
|
-
panel.insertAfter( that.panels[ i - 1 ] || that.tablist );
|
417
|
-
}
|
418
|
-
panel.attr( "aria-live", "polite" );
|
419
|
-
}
|
420
|
-
|
421
|
-
if ( panel.length) {
|
422
|
-
that.panels = that.panels.add( panel );
|
423
|
-
}
|
424
|
-
if ( originalAriaControls ) {
|
425
|
-
tab.data( "ui-tabs-aria-controls", originalAriaControls );
|
426
|
-
}
|
427
|
-
tab.attr({
|
428
|
-
"aria-controls": selector.substring( 1 ),
|
429
|
-
"aria-labelledby": anchorId
|
430
|
-
});
|
431
|
-
panel.attr( "aria-labelledby", anchorId );
|
432
|
-
});
|
433
|
-
|
434
|
-
this.panels
|
435
|
-
.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
|
436
|
-
.attr( "role", "tabpanel" );
|
437
|
-
},
|
438
|
-
|
439
|
-
// allow overriding how to find the list for rare usage scenarios (#7715)
|
440
|
-
_getList: function() {
|
441
|
-
return this.element.find( "ol,ul" ).eq( 0 );
|
442
|
-
},
|
443
|
-
|
444
|
-
_createPanel: function( id ) {
|
445
|
-
return $( "<div>" )
|
446
|
-
.attr( "id", id )
|
447
|
-
.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
|
448
|
-
.data( "ui-tabs-destroy", true );
|
449
|
-
},
|
450
|
-
|
451
|
-
_setupDisabled: function( disabled ) {
|
452
|
-
if ( $.isArray( disabled ) ) {
|
453
|
-
if ( !disabled.length ) {
|
454
|
-
disabled = false;
|
455
|
-
} else if ( disabled.length === this.anchors.length ) {
|
456
|
-
disabled = true;
|
457
|
-
}
|
458
|
-
}
|
459
|
-
|
460
|
-
// disable tabs
|
461
|
-
for ( var i = 0, li; ( li = this.tabs[ i ] ); i++ ) {
|
462
|
-
if ( disabled === true || $.inArray( i, disabled ) !== -1 ) {
|
463
|
-
$( li )
|
464
|
-
.addClass( "ui-state-disabled" )
|
465
|
-
.attr( "aria-disabled", "true" );
|
466
|
-
} else {
|
467
|
-
$( li )
|
468
|
-
.removeClass( "ui-state-disabled" )
|
469
|
-
.removeAttr( "aria-disabled" );
|
470
|
-
}
|
471
|
-
}
|
472
|
-
|
473
|
-
this.options.disabled = disabled;
|
474
|
-
},
|
475
|
-
|
476
|
-
_setupEvents: function( event ) {
|
477
|
-
var events = {
|
478
|
-
click: function( event ) {
|
479
|
-
event.preventDefault();
|
480
|
-
}
|
481
|
-
};
|
482
|
-
if ( event ) {
|
483
|
-
$.each( event.split(" "), function( index, eventName ) {
|
484
|
-
events[ eventName ] = "_eventHandler";
|
485
|
-
});
|
486
|
-
}
|
487
|
-
|
488
|
-
this._off( this.anchors.add( this.tabs ).add( this.panels ) );
|
489
|
-
this._on( this.anchors, events );
|
490
|
-
this._on( this.tabs, { keydown: "_tabKeydown" } );
|
491
|
-
this._on( this.panels, { keydown: "_panelKeydown" } );
|
492
|
-
|
493
|
-
this._focusable( this.tabs );
|
494
|
-
this._hoverable( this.tabs );
|
495
|
-
},
|
496
|
-
|
497
|
-
_setupHeightStyle: function( heightStyle ) {
|
498
|
-
var maxHeight,
|
499
|
-
parent = this.element.parent();
|
500
|
-
|
501
|
-
if ( heightStyle === "fill" ) {
|
502
|
-
maxHeight = parent.height();
|
503
|
-
maxHeight -= this.element.outerHeight() - this.element.height();
|
504
|
-
|
505
|
-
this.element.siblings( ":visible" ).each(function() {
|
506
|
-
var elem = $( this ),
|
507
|
-
position = elem.css( "position" );
|
508
|
-
|
509
|
-
if ( position === "absolute" || position === "fixed" ) {
|
510
|
-
return;
|
511
|
-
}
|
512
|
-
maxHeight -= elem.outerHeight( true );
|
513
|
-
});
|
514
|
-
|
515
|
-
this.element.children().not( this.panels ).each(function() {
|
516
|
-
maxHeight -= $( this ).outerHeight( true );
|
517
|
-
});
|
518
|
-
|
519
|
-
this.panels.each(function() {
|
520
|
-
$( this ).height( Math.max( 0, maxHeight -
|
521
|
-
$( this ).innerHeight() + $( this ).height() ) );
|
522
|
-
})
|
523
|
-
.css( "overflow", "auto" );
|
524
|
-
} else if ( heightStyle === "auto" ) {
|
525
|
-
maxHeight = 0;
|
526
|
-
this.panels.each(function() {
|
527
|
-
maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() );
|
528
|
-
}).height( maxHeight );
|
529
|
-
}
|
530
|
-
},
|
531
|
-
|
532
|
-
_eventHandler: function( event ) {
|
533
|
-
var options = this.options,
|
534
|
-
active = this.active,
|
535
|
-
anchor = $( event.currentTarget ),
|
536
|
-
tab = anchor.closest( "li" ),
|
537
|
-
clickedIsActive = tab[ 0 ] === active[ 0 ],
|
538
|
-
collapsing = clickedIsActive && options.collapsible,
|
539
|
-
toShow = collapsing ? $() : this._getPanelForTab( tab ),
|
540
|
-
toHide = !active.length ? $() : this._getPanelForTab( active ),
|
541
|
-
eventData = {
|
542
|
-
oldTab: active,
|
543
|
-
oldPanel: toHide,
|
544
|
-
newTab: collapsing ? $() : tab,
|
545
|
-
newPanel: toShow
|
546
|
-
};
|
547
|
-
|
548
|
-
event.preventDefault();
|
549
|
-
|
550
|
-
if ( tab.hasClass( "ui-state-disabled" ) ||
|
551
|
-
// tab is already loading
|
552
|
-
tab.hasClass( "ui-tabs-loading" ) ||
|
553
|
-
// can't switch durning an animation
|
554
|
-
this.running ||
|
555
|
-
// click on active header, but not collapsible
|
556
|
-
( clickedIsActive && !options.collapsible ) ||
|
557
|
-
// allow canceling activation
|
558
|
-
( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
|
559
|
-
return;
|
560
|
-
}
|
561
|
-
|
562
|
-
options.active = collapsing ? false : this.tabs.index( tab );
|
563
|
-
|
564
|
-
this.active = clickedIsActive ? $() : tab;
|
565
|
-
if ( this.xhr ) {
|
566
|
-
this.xhr.abort();
|
567
|
-
}
|
568
|
-
|
569
|
-
if ( !toHide.length && !toShow.length ) {
|
570
|
-
$.error( "jQuery UI Tabs: Mismatching fragment identifier." );
|
571
|
-
}
|
572
|
-
|
573
|
-
if ( toShow.length ) {
|
574
|
-
this.load( this.tabs.index( tab ), event );
|
575
|
-
}
|
576
|
-
this._toggle( event, eventData );
|
577
|
-
},
|
578
|
-
|
579
|
-
// handles show/hide for selecting tabs
|
580
|
-
_toggle: function( event, eventData ) {
|
581
|
-
var that = this,
|
582
|
-
toShow = eventData.newPanel,
|
583
|
-
toHide = eventData.oldPanel;
|
584
|
-
|
585
|
-
this.running = true;
|
586
|
-
|
587
|
-
function complete() {
|
588
|
-
that.running = false;
|
589
|
-
that._trigger( "activate", event, eventData );
|
590
|
-
}
|
591
|
-
|
592
|
-
function show() {
|
593
|
-
eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" );
|
594
|
-
|
595
|
-
if ( toShow.length && that.options.show ) {
|
596
|
-
that._show( toShow, that.options.show, complete );
|
597
|
-
} else {
|
598
|
-
toShow.show();
|
599
|
-
complete();
|
600
|
-
}
|
601
|
-
}
|
602
|
-
|
603
|
-
// start out by hiding, then showing, then completing
|
604
|
-
if ( toHide.length && this.options.hide ) {
|
605
|
-
this._hide( toHide, this.options.hide, function() {
|
606
|
-
eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
|
607
|
-
show();
|
608
|
-
});
|
609
|
-
} else {
|
610
|
-
eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
|
611
|
-
toHide.hide();
|
612
|
-
show();
|
613
|
-
}
|
614
|
-
|
615
|
-
toHide.attr({
|
616
|
-
"aria-expanded": "false",
|
617
|
-
"aria-hidden": "true"
|
618
|
-
});
|
619
|
-
eventData.oldTab.attr( "aria-selected", "false" );
|
620
|
-
// If we're switching tabs, remove the old tab from the tab order.
|
621
|
-
// If we're opening from collapsed state, remove the previous tab from the tab order.
|
622
|
-
// If we're collapsing, then keep the collapsing tab in the tab order.
|
623
|
-
if ( toShow.length && toHide.length ) {
|
624
|
-
eventData.oldTab.attr( "tabIndex", -1 );
|
625
|
-
} else if ( toShow.length ) {
|
626
|
-
this.tabs.filter(function() {
|
627
|
-
return $( this ).attr( "tabIndex" ) === 0;
|
628
|
-
})
|
629
|
-
.attr( "tabIndex", -1 );
|
630
|
-
}
|
631
|
-
|
632
|
-
toShow.attr({
|
633
|
-
"aria-expanded": "true",
|
634
|
-
"aria-hidden": "false"
|
635
|
-
});
|
636
|
-
eventData.newTab.attr({
|
637
|
-
"aria-selected": "true",
|
638
|
-
tabIndex: 0
|
639
|
-
});
|
640
|
-
},
|
641
|
-
|
642
|
-
_activate: function( index ) {
|
643
|
-
var anchor,
|
644
|
-
active = this._findActive( index );
|
645
|
-
|
646
|
-
// trying to activate the already active panel
|
647
|
-
if ( active[ 0 ] === this.active[ 0 ] ) {
|
648
|
-
return;
|
649
|
-
}
|
650
|
-
|
651
|
-
// trying to collapse, simulate a click on the current active header
|
652
|
-
if ( !active.length ) {
|
653
|
-
active = this.active;
|
654
|
-
}
|
655
|
-
|
656
|
-
anchor = active.find( ".ui-tabs-anchor" )[ 0 ];
|
657
|
-
this._eventHandler({
|
658
|
-
target: anchor,
|
659
|
-
currentTarget: anchor,
|
660
|
-
preventDefault: $.noop
|
661
|
-
});
|
662
|
-
},
|
663
|
-
|
664
|
-
_findActive: function( index ) {
|
665
|
-
return index === false ? $() : this.tabs.eq( index );
|
666
|
-
},
|
667
|
-
|
668
|
-
_getIndex: function( index ) {
|
669
|
-
// meta-function to give users option to provide a href string instead of a numerical index.
|
670
|
-
if ( typeof index === "string" ) {
|
671
|
-
index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) );
|
672
|
-
}
|
673
|
-
|
674
|
-
return index;
|
675
|
-
},
|
676
|
-
|
677
|
-
_destroy: function() {
|
678
|
-
if ( this.xhr ) {
|
679
|
-
this.xhr.abort();
|
680
|
-
}
|
681
|
-
|
682
|
-
this.element.removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" );
|
683
|
-
|
684
|
-
this.tablist
|
685
|
-
.removeClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
|
686
|
-
.removeAttr( "role" );
|
687
|
-
|
688
|
-
this.anchors
|
689
|
-
.removeClass( "ui-tabs-anchor" )
|
690
|
-
.removeAttr( "role" )
|
691
|
-
.removeAttr( "tabIndex" )
|
692
|
-
.removeUniqueId();
|
693
|
-
|
694
|
-
this.tabs.add( this.panels ).each(function() {
|
695
|
-
if ( $.data( this, "ui-tabs-destroy" ) ) {
|
696
|
-
$( this ).remove();
|
697
|
-
} else {
|
698
|
-
$( this )
|
699
|
-
.removeClass( "ui-state-default ui-state-active ui-state-disabled " +
|
700
|
-
"ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel" )
|
701
|
-
.removeAttr( "tabIndex" )
|
702
|
-
.removeAttr( "aria-live" )
|
703
|
-
.removeAttr( "aria-busy" )
|
704
|
-
.removeAttr( "aria-selected" )
|
705
|
-
.removeAttr( "aria-labelledby" )
|
706
|
-
.removeAttr( "aria-hidden" )
|
707
|
-
.removeAttr( "aria-expanded" )
|
708
|
-
.removeAttr( "role" );
|
709
|
-
}
|
710
|
-
});
|
711
|
-
|
712
|
-
this.tabs.each(function() {
|
713
|
-
var li = $( this ),
|
714
|
-
prev = li.data( "ui-tabs-aria-controls" );
|
715
|
-
if ( prev ) {
|
716
|
-
li
|
717
|
-
.attr( "aria-controls", prev )
|
718
|
-
.removeData( "ui-tabs-aria-controls" );
|
719
|
-
} else {
|
720
|
-
li.removeAttr( "aria-controls" );
|
721
|
-
}
|
722
|
-
});
|
723
|
-
|
724
|
-
this.panels.show();
|
725
|
-
|
726
|
-
if ( this.options.heightStyle !== "content" ) {
|
727
|
-
this.panels.css( "height", "" );
|
728
|
-
}
|
729
|
-
},
|
730
|
-
|
731
|
-
enable: function( index ) {
|
732
|
-
var disabled = this.options.disabled;
|
733
|
-
if ( disabled === false ) {
|
734
|
-
return;
|
735
|
-
}
|
736
|
-
|
737
|
-
if ( index === undefined ) {
|
738
|
-
disabled = false;
|
739
|
-
} else {
|
740
|
-
index = this._getIndex( index );
|
741
|
-
if ( $.isArray( disabled ) ) {
|
742
|
-
disabled = $.map( disabled, function( num ) {
|
743
|
-
return num !== index ? num : null;
|
744
|
-
});
|
745
|
-
} else {
|
746
|
-
disabled = $.map( this.tabs, function( li, num ) {
|
747
|
-
return num !== index ? num : null;
|
748
|
-
});
|
749
|
-
}
|
750
|
-
}
|
751
|
-
this._setupDisabled( disabled );
|
752
|
-
},
|
753
|
-
|
754
|
-
disable: function( index ) {
|
755
|
-
var disabled = this.options.disabled;
|
756
|
-
if ( disabled === true ) {
|
757
|
-
return;
|
758
|
-
}
|
759
|
-
|
760
|
-
if ( index === undefined ) {
|
761
|
-
disabled = true;
|
762
|
-
} else {
|
763
|
-
index = this._getIndex( index );
|
764
|
-
if ( $.inArray( index, disabled ) !== -1 ) {
|
765
|
-
return;
|
766
|
-
}
|
767
|
-
if ( $.isArray( disabled ) ) {
|
768
|
-
disabled = $.merge( [ index ], disabled ).sort();
|
769
|
-
} else {
|
770
|
-
disabled = [ index ];
|
771
|
-
}
|
772
|
-
}
|
773
|
-
this._setupDisabled( disabled );
|
774
|
-
},
|
775
|
-
|
776
|
-
load: function( index, event ) {
|
777
|
-
index = this._getIndex( index );
|
778
|
-
var that = this,
|
779
|
-
tab = this.tabs.eq( index ),
|
780
|
-
anchor = tab.find( ".ui-tabs-anchor" ),
|
781
|
-
panel = this._getPanelForTab( tab ),
|
782
|
-
eventData = {
|
783
|
-
tab: tab,
|
784
|
-
panel: panel
|
785
|
-
};
|
786
|
-
|
787
|
-
// not remote
|
788
|
-
if ( isLocal( anchor[ 0 ] ) ) {
|
789
|
-
return;
|
790
|
-
}
|
791
|
-
|
792
|
-
this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) );
|
793
|
-
|
794
|
-
// support: jQuery <1.8
|
795
|
-
// jQuery <1.8 returns false if the request is canceled in beforeSend,
|
796
|
-
// but as of 1.8, $.ajax() always returns a jqXHR object.
|
797
|
-
if ( this.xhr && this.xhr.statusText !== "canceled" ) {
|
798
|
-
tab.addClass( "ui-tabs-loading" );
|
799
|
-
panel.attr( "aria-busy", "true" );
|
800
|
-
|
801
|
-
this.xhr
|
802
|
-
.success(function( response ) {
|
803
|
-
// support: jQuery <1.8
|
804
|
-
// http://bugs.jquery.com/ticket/11778
|
805
|
-
setTimeout(function() {
|
806
|
-
panel.html( response );
|
807
|
-
that._trigger( "load", event, eventData );
|
808
|
-
}, 1 );
|
809
|
-
})
|
810
|
-
.complete(function( jqXHR, status ) {
|
811
|
-
// support: jQuery <1.8
|
812
|
-
// http://bugs.jquery.com/ticket/11778
|
813
|
-
setTimeout(function() {
|
814
|
-
if ( status === "abort" ) {
|
815
|
-
that.panels.stop( false, true );
|
816
|
-
}
|
817
|
-
|
818
|
-
tab.removeClass( "ui-tabs-loading" );
|
819
|
-
panel.removeAttr( "aria-busy" );
|
820
|
-
|
821
|
-
if ( jqXHR === that.xhr ) {
|
822
|
-
delete that.xhr;
|
823
|
-
}
|
824
|
-
}, 1 );
|
825
|
-
});
|
826
|
-
}
|
827
|
-
},
|
828
|
-
|
829
|
-
_ajaxSettings: function( anchor, event, eventData ) {
|
830
|
-
var that = this;
|
831
|
-
return {
|
832
|
-
url: anchor.attr( "href" ),
|
833
|
-
beforeSend: function( jqXHR, settings ) {
|
834
|
-
return that._trigger( "beforeLoad", event,
|
835
|
-
$.extend( { jqXHR : jqXHR, ajaxSettings: settings }, eventData ) );
|
836
|
-
}
|
837
|
-
};
|
838
|
-
},
|
839
|
-
|
840
|
-
_getPanelForTab: function( tab ) {
|
841
|
-
var id = $( tab ).attr( "aria-controls" );
|
842
|
-
return this.element.find( this._sanitizeSelector( "#" + id ) );
|
843
|
-
}
|
844
|
-
});
|
845
|
-
|
846
|
-
})( 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){function i(){return++n}function s(t){return t.hash.length>1&&decodeURIComponent(t.href.replace(a,""))===decodeURIComponent(location.href.replace(a,""))}var n=0,a=/#.*$/;t.widget("ui.tabs",{version:"1.10.3",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var e=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var i=this.options.active,s=this.options.collapsible,n=location.hash.substring(1);return null===i&&(n&&this.tabs.each(function(s,a){return t(a).attr("aria-controls")===n?(i=s,!1):e}),null===i&&(i=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===i||-1===i)&&(i=this.tabs.length?0:!1)),i!==!1&&(i=this.tabs.index(this.tabs.eq(i)),-1===i&&(i=s?!1:0)),!s&&i===!1&&this.anchors.length&&(i=0),i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(i){var s=t(this.document[0].activeElement).closest("li"),n=this.tabs.index(s),a=!0;if(!this._handlePageNav(i)){switch(i.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:n++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:a=!1,n--;break;case t.ui.keyCode.END:n=this.anchors.length-1;break;case t.ui.keyCode.HOME:n=0;break;case t.ui.keyCode.SPACE:return i.preventDefault(),clearTimeout(this.activating),this._activate(n),e;case t.ui.keyCode.ENTER:return i.preventDefault(),clearTimeout(this.activating),this._activate(n===this.options.active?!1:n),e;default:return}i.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,a),i.ctrlKey||(s.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(i){return i.altKey&&i.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):i.altKey&&i.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):e},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).focus(),t},_setOption:function(t,i){return"active"===t?(this._activate(i),e):"disabled"===t?(this._setupDisabled(i),e):(this._super(t,i),"collapsible"===t&&(this.element.toggleClass("ui-tabs-collapsible",i),i||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(i),"heightStyle"===t&&this._setupHeightStyle(i),e)},_tabId:function(t){return t.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=t(),this.anchors.each(function(i,n){var a,o,r,h=t(n).uniqueId().attr("id"),l=t(n).closest("li"),u=l.attr("aria-controls");s(n)?(a=n.hash,o=e.element.find(e._sanitizeSelector(a))):(r=e._tabId(l),a="#"+r,o=e.element.find(a),o.length||(o=e._createPanel(r),o.insertAfter(e.panels[i-1]||e.tablist)),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),u&&l.data("ui-tabs-aria-controls",u),l.attr({"aria-controls":a.substring(1),"aria-labelledby":h}),o.attr("aria-labelledby",h)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(e){t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1);for(var i,s=0;i=this.tabs[s];s++)e===!0||-1!==t.inArray(s,e)?t(i).addClass("ui-state-disabled").attr("aria-disabled","true"):t(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=e},_setupEvents:function(e){var i={click:function(t){t.preventDefault()}};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?t():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):t(),u={oldTab:s,oldPanel:l,newTab:r?t():a,newPanel:h};e.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",e,u)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?t():a,this.xhr&&this.xhr.abort(),l.length||h.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),e),this._toggle(e,u))},_toggle:function(e,i){function s(){a.running=!1,a._trigger("activate",e,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr({"aria-expanded":"false","aria-hidden":"true"}),i.oldTab.attr("aria-selected","false"),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr({"aria-expanded":"true","aria-hidden":"false"}),i.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+t+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var s=this.options.disabled;s!==!1&&(i===e?s=!1:(i=this._getIndex(i),s=t.isArray(s)?t.map(s,function(t){return t!==i?t:null}):t.map(this.tabs,function(t,e){return e!==i?e:null})),this._setupDisabled(s))},disable:function(i){var s=this.options.disabled;if(s!==!0){if(i===e)s=!0;else{if(i=this._getIndex(i),-1!==t.inArray(i,s))return;s=t.isArray(s)?t.merge([i],s).sort():[i]}this._setupDisabled(s)}},load:function(e,i){e=this._getIndex(e);var n=this,a=this.tabs.eq(e),o=a.find(".ui-tabs-anchor"),r=this._getPanelForTab(a),h={tab:a,panel:r};s(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,h)),this.xhr&&"canceled"!==this.xhr.statusText&&(a.addClass("ui-tabs-loading"),r.attr("aria-busy","true"),this.xhr.success(function(t){setTimeout(function(){r.html(t),n._trigger("load",i,h)},1)}).complete(function(t,e){setTimeout(function(){"abort"===e&&n.panels.stop(!1,!0),a.removeClass("ui-tabs-loading"),r.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href"),beforeSend:function(e,a){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:a},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}})})(jQuery);
|