1+ /*!
2+ * jQuery UI Core @VERSION
3+ * http://jqueryui.com
4+ *
5+ * Copyright 2013 jQuery Foundation and other contributors
6+ * Released under the MIT license.
7+ * http://jquery.org/license
8+ *
9+ * http://api.jqueryui.com/category/ui-core/
10+ */
11+ ( function ( $ , undefined ) {
12+
13+ var uuid = 0 ,
14+ runiqueId = / ^ u i - i d - \d + $ / ;
15+
16+ // $.ui might exist from components with no dependencies, e.g., $.ui.position
17+ $ . ui = $ . ui || { } ;
18+
19+ $ . extend ( $ . ui , {
20+ version : "@VERSION" ,
21+
22+ keyCode : {
23+ BACKSPACE : 8 ,
24+ COMMA : 188 ,
25+ DELETE : 46 ,
26+ DOWN : 40 ,
27+ END : 35 ,
28+ ENTER : 13 ,
29+ ESCAPE : 27 ,
30+ HOME : 36 ,
31+ LEFT : 37 ,
32+ PAGE_DOWN : 34 ,
33+ PAGE_UP : 33 ,
34+ PERIOD : 190 ,
35+ RIGHT : 39 ,
36+ SPACE : 32 ,
37+ TAB : 9 ,
38+ UP : 38
39+ }
40+ } ) ;
41+
42+ // plugins
43+ $ . fn . extend ( {
44+ focus : ( function ( orig ) {
45+ return function ( delay , fn ) {
46+ return typeof delay === "number" ?
47+ this . each ( function ( ) {
48+ var elem = this ;
49+ setTimeout ( function ( ) {
50+ $ ( elem ) . focus ( ) ;
51+ if ( fn ) {
52+ fn . call ( elem ) ;
53+ }
54+ } , delay ) ;
55+ } ) :
56+ orig . apply ( this , arguments ) ;
57+ } ;
58+ } ) ( $ . fn . focus ) ,
59+
60+ scrollParent : function ( ) {
61+ var scrollParent ;
62+ if ( ( $ . ui . ie && ( / ( s t a t i c | r e l a t i v e ) / ) . test ( this . css ( "position" ) ) ) || ( / a b s o l u t e / ) . test ( this . css ( "position" ) ) ) {
63+ scrollParent = this . parents ( ) . filter ( function ( ) {
64+ return ( / ( r e l a t i v e | a b s o l u t e | f i x e d ) / ) . test ( $ . css ( this , "position" ) ) && ( / ( a u t o | s c r o l l ) / ) . test ( $ . css ( this , "overflow" ) + $ . css ( this , "overflow-y" ) + $ . css ( this , "overflow-x" ) ) ;
65+ } ) . eq ( 0 ) ;
66+ } else {
67+ scrollParent = this . parents ( ) . filter ( function ( ) {
68+ return ( / ( a u t o | s c r o l l ) / ) . test ( $ . css ( this , "overflow" ) + $ . css ( this , "overflow-y" ) + $ . css ( this , "overflow-x" ) ) ;
69+ } ) . eq ( 0 ) ;
70+ }
71+
72+ return ( / f i x e d / ) . test ( this . css ( "position" ) ) || ! scrollParent . length ? $ ( this [ 0 ] . ownerDocument || document ) : scrollParent ;
73+ } ,
74+
75+ uniqueId : function ( ) {
76+ return this . each ( function ( ) {
77+ if ( ! this . id ) {
78+ this . id = "ui-id-" + ( ++ uuid ) ;
79+ }
80+ } ) ;
81+ } ,
82+
83+ removeUniqueId : function ( ) {
84+ return this . each ( function ( ) {
85+ if ( runiqueId . test ( this . id ) ) {
86+ $ ( this ) . removeAttr ( "id" ) ;
87+ }
88+ } ) ;
89+ }
90+ } ) ;
91+
92+ // selectors
93+ function focusable ( element , isTabIndexNotNaN ) {
94+ var map , mapName , img ,
95+ nodeName = element . nodeName . toLowerCase ( ) ;
96+ if ( "area" === nodeName ) {
97+ map = element . parentNode ;
98+ mapName = map . name ;
99+ if ( ! element . href || ! mapName || map . nodeName . toLowerCase ( ) !== "map" ) {
100+ return false ;
101+ }
102+ img = $ ( "img[usemap=#" + mapName + "]" ) [ 0 ] ;
103+ return ! ! img && visible ( img ) ;
104+ }
105+ return ( / i n p u t | s e l e c t | t e x t a r e a | b u t t o n | o b j e c t / . test ( nodeName ) ?
106+ ! element . disabled :
107+ "a" === nodeName ?
108+ element . href || isTabIndexNotNaN :
109+ isTabIndexNotNaN ) &&
110+ // the element and all of its ancestors must be visible
111+ visible ( element ) ;
112+ }
113+
114+ function visible ( element ) {
115+ return $ . expr . filters . visible ( element ) &&
116+ ! $ ( element ) . parents ( ) . addBack ( ) . filter ( function ( ) {
117+ return $ . css ( this , "visibility" ) === "hidden" ;
118+ } ) . length ;
119+ }
120+
121+ $ . extend ( $ . expr [ ":" ] , {
122+ data : $ . expr . createPseudo ?
123+ $ . expr . createPseudo ( function ( dataName ) {
124+ return function ( elem ) {
125+ return ! ! $ . data ( elem , dataName ) ;
126+ } ;
127+ } ) :
128+ // support: jQuery <1.8
129+ function ( elem , i , match ) {
130+ return ! ! $ . data ( elem , match [ 3 ] ) ;
131+ } ,
132+
133+ focusable : function ( element ) {
134+ return focusable ( element , ! isNaN ( $ . attr ( element , "tabindex" ) ) ) ;
135+ } ,
136+
137+ tabbable : function ( element ) {
138+ var tabIndex = $ . attr ( element , "tabindex" ) ,
139+ isTabIndexNaN = isNaN ( tabIndex ) ;
140+ return ( isTabIndexNaN || tabIndex >= 0 ) && focusable ( element , ! isTabIndexNaN ) ;
141+ }
142+ } ) ;
143+
144+ // support: jQuery <1.8
145+ if ( ! $ ( "<a>" ) . outerWidth ( 1 ) . jquery ) {
146+ $ . each ( [ "Width" , "Height" ] , function ( i , name ) {
147+ var side = name === "Width" ? [ "Left" , "Right" ] : [ "Top" , "Bottom" ] ,
148+ type = name . toLowerCase ( ) ,
149+ orig = {
150+ innerWidth : $ . fn . innerWidth ,
151+ innerHeight : $ . fn . innerHeight ,
152+ outerWidth : $ . fn . outerWidth ,
153+ outerHeight : $ . fn . outerHeight
154+ } ;
155+
156+ function reduce ( elem , size , border , margin ) {
157+ $ . each ( side , function ( ) {
158+ size -= parseFloat ( $ . css ( elem , "padding" + this ) ) || 0 ;
159+ if ( border ) {
160+ size -= parseFloat ( $ . css ( elem , "border" + this + "Width" ) ) || 0 ;
161+ }
162+ if ( margin ) {
163+ size -= parseFloat ( $ . css ( elem , "margin" + this ) ) || 0 ;
164+ }
165+ } ) ;
166+ return size ;
167+ }
168+
169+ $ . fn [ "inner" + name ] = function ( size ) {
170+ if ( size === undefined ) {
171+ return orig [ "inner" + name ] . call ( this ) ;
172+ }
173+
174+ return this . each ( function ( ) {
175+ $ ( this ) . css ( type , reduce ( this , size ) + "px" ) ;
176+ } ) ;
177+ } ;
178+
179+ $ . fn [ "outer" + name ] = function ( size , margin ) {
180+ if ( typeof size !== "number" ) {
181+ return orig [ "outer" + name ] . call ( this , size ) ;
182+ }
183+
184+ return this . each ( function ( ) {
185+ $ ( this ) . css ( type , reduce ( this , size , true , margin ) + "px" ) ;
186+ } ) ;
187+ } ;
188+ } ) ;
189+ }
190+
191+ // support: jQuery <1.8
192+ if ( ! $ . fn . addBack ) {
193+ $ . fn . addBack = function ( selector ) {
194+ return this . add ( selector == null ?
195+ this . prevObject : this . prevObject . filter ( selector )
196+ ) ;
197+ } ;
198+ }
199+
200+ // support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413)
201+ if ( $ ( "<a>" ) . data ( "a-b" , "a" ) . removeData ( "a-b" ) . data ( "a-b" ) ) {
202+ $ . fn . removeData = ( function ( removeData ) {
203+ return function ( key ) {
204+ if ( arguments . length ) {
205+ return removeData . call ( this , $ . camelCase ( key ) ) ;
206+ } else {
207+ return removeData . call ( this ) ;
208+ }
209+ } ;
210+ } ) ( $ . fn . removeData ) ;
211+ }
212+
213+
214+
215+
216+
217+ // deprecated
218+ $ . ui . ie = ! ! / m s i e [ \w . ] + / . exec ( navigator . userAgent . toLowerCase ( ) ) ;
219+
220+ $ . support . selectstart = "onselectstart" in document . createElement ( "div" ) ;
221+ $ . fn . extend ( {
222+ disableSelection : function ( ) {
223+ return this . bind ( ( $ . support . selectstart ? "selectstart" : "mousedown" ) +
224+ ".ui-disableSelection" , function ( event ) {
225+ event . preventDefault ( ) ;
226+ } ) ;
227+ } ,
228+
229+ enableSelection : function ( ) {
230+ return this . unbind ( ".ui-disableSelection" ) ;
231+ } ,
232+
233+ zIndex : function ( zIndex ) {
234+ if ( zIndex !== undefined ) {
235+ return this . css ( "zIndex" , zIndex ) ;
236+ }
237+
238+ if ( this . length ) {
239+ var elem = $ ( this [ 0 ] ) , position , value ;
240+ while ( elem . length && elem [ 0 ] !== document ) {
241+ // Ignore z-index if position is set to a value where z-index is ignored by the browser
242+ // This makes behavior of this function consistent across browsers
243+ // WebKit always returns auto if the element is positioned
244+ position = elem . css ( "position" ) ;
245+ if ( position === "absolute" || position === "relative" || position === "fixed" ) {
246+ // IE returns 0 when zIndex is not specified
247+ // other browsers return a string
248+ // we ignore the case of nested elements with an explicit value of 0
249+ // <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
250+ value = parseInt ( elem . css ( "zIndex" ) , 10 ) ;
251+ if ( ! isNaN ( value ) && value !== 0 ) {
252+ return value ;
253+ }
254+ }
255+ elem = elem . parent ( ) ;
256+ }
257+ }
258+
259+ return 0 ;
260+ }
261+ } ) ;
262+
263+ // $.ui.plugin is deprecated. Use $.widget() extensions instead.
264+ $ . ui . plugin = {
265+ add : function ( module , option , set ) {
266+ var i ,
267+ proto = $ . ui [ module ] . prototype ;
268+ for ( i in set ) {
269+ proto . plugins [ i ] = proto . plugins [ i ] || [ ] ;
270+ proto . plugins [ i ] . push ( [ option , set [ i ] ] ) ;
271+ }
272+ } ,
273+ call : function ( instance , name , args , allowDisconnected ) {
274+ var i ,
275+ set = instance . plugins [ name ] ;
276+
277+ if ( ! set ) {
278+ return ;
279+ }
280+
281+ if ( ! allowDisconnected && ( ! instance . element [ 0 ] . parentNode || instance . element [ 0 ] . parentNode . nodeType === 11 ) ) {
282+ return ;
283+ }
284+
285+ for ( i = 0 ; i < set . length ; i ++ ) {
286+ if ( instance . options [ set [ i ] [ 0 ] ] ) {
287+ set [ i ] [ 1 ] . apply ( instance . element , args ) ;
288+ }
289+ }
290+ }
291+ } ;
292+
293+ } ) ( jQuery ) ;
0 commit comments