Редакция 283 | Редакция 290 | К новейшей редакции | Весь файл | Учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 283 | Редакция 289 | ||
---|---|---|---|
Строка 4... | Строка 4... | ||
4 | *
|
4 | *
|
5 | * Copyright (c) 2009 John Resig
|
5 | * Copyright (c) 2009 John Resig
|
6 | * Dual licensed under the MIT and GPL licenses.
|
6 | * Dual licensed under the MIT and GPL licenses.
|
7 | * http://docs.jquery.com/License
|
7 | * http://docs.jquery.com/License
|
8 | *
|
8 | *
|
9 | * Date: 2009-05-12 22:43:51 +0700 (Втр, 12 Май 2009)
|
9 | * Date: 2009-06-17 09:31:45 +0700 (Срд, 17 Июн 2009)
|
10 | * Revision: 6348
|
10 | * Revision: 6399
|
11 | */
|
11 | */
|
12 | (function(){ |
12 | (function(window, undefined){ |
13 | - | ||
14 | // Will speed up references to window, and allows munging its name.
|
- | |
15 | var window = this, |
- | |
16 | 13 | ||
- | 14 | // Define a local copy of jQuery
|
|
- | 15 | var jQuery = function( selector, context ) { |
|
17 | // Will speed up references to undefined, and allows munging its name.
|
16 | // The jQuery object is actually just the init constructor 'enhanced'
|
- | 17 | return arguments.length === 0 ? |
|
18 | undefined, |
18 | rootjQuery :
|
- | 19 | new jQuery.fn.init( selector, context ); |
|
- | 20 | }, |
|
19 | 21 | ||
20 | // Map over jQuery in case of overwrite
|
22 | // Map over jQuery in case of overwrite
|
21 | _jQuery = window.jQuery, |
23 | _jQuery = window.jQuery, |
22 | 24 | ||
23 | // Map over the $ in case of overwrite
|
25 | // Map over the $ in case of overwrite
|
24 | _$ = window.$, |
26 | _$ = window.$, |
25 | 27 | ||
26 | // Define a local copy of jQuery
|
- | |
27 | jQuery,
|
- | |
28 | - | ||
29 | // A central reference to the root jQuery(document)
|
28 | // A central reference to the root jQuery(document)
|
30 | rootjQuery,
|
29 | rootjQuery,
|
31 | 30 | ||
32 | jQuery = window.jQuery = window.$ = function( selector, context ) { |
- | |
33 | // The jQuery object is actually just the init constructor 'enhanced'
|
- | |
34 | return arguments.length === 0 ? |
- | |
35 | rootjQuery :
|
- | |
36 | new jQuery.fn.init( selector, context ); |
- | |
37 | }, |
- | |
38 | - | ||
39 | // A simple way to check for HTML strings or ID strings
|
31 | // A simple way to check for HTML strings or ID strings
|
40 | // (both of which we optimize for)
|
32 | // (both of which we optimize for)
|
41 | quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/, |
33 | quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/, |
42 | 34 | ||
43 | // Is it a simple selector
|
35 | // Is it a simple selector
|
Строка 47... | Строка 39... | ||
47 | userAgent = navigator.userAgent.toLowerCase(), |
39 | userAgent = navigator.userAgent.toLowerCase(), |
48 | 40 | ||
49 | // Save a reference to the core toString method
|
41 | // Save a reference to the core toString method
|
50 | toString = Object.prototype.toString; |
42 | toString = Object.prototype.toString; |
51 | 43 | ||
- | 44 | // Expose jQuery to the global object
|
|
- | 45 | window.jQuery = window.$ = jQuery; |
|
- | 46 | ||
52 | jQuery.fn = jQuery.prototype = { |
47 | jQuery.fn = jQuery.prototype = { |
53 | init: function( selector, context ) { |
48 | init: function( selector, context ) { |
54 | var match, elem, ret; |
49 | var match, elem, ret; |
55 | 50 | ||
56 | // Handle $(""), $(null), or $(undefined)
|
51 | // Handle $(""), $(null), or $(undefined)
|
Строка 1193... | Строка 1188... | ||
1193 | } else if ( name === "contains" ) { |
1188 | } else if ( name === "contains" ) { |
1194 | return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0; |
1189 | return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0; |
1195 | } else if ( name === "not" ) { |
1190 | } else if ( name === "not" ) { |
1196 | var not = match[3]; |
1191 | var not = match[3]; |
1197 | 1192 | ||
1198 | for ( var i = 0, l = not.length; i < l; i++ ) { |
1193 | for ( i = 0, l = not.length; i < l; i++ ) { |
1199 | if ( not[i] === elem ) { |
1194 | if ( not[i] === elem ) { |
1200 | return false; |
1195 | return false; |
1201 | }
|
1196 | }
|
1202 | }
|
1197 | }
|
1203 | 1198 | ||
Строка 1207... | Строка 1202... | ||
1207 | CHILD: function(elem, match){ |
1202 | CHILD: function(elem, match){ |
1208 | var type = match[1], node = elem; |
1203 | var type = match[1], node = elem; |
1209 | switch (type) { |
1204 | switch (type) { |
1210 | case 'only': |
1205 | case 'only': |
1211 | case 'first': |
1206 | case 'first': |
1212 | while (node = node.previousSibling) { |
1207 | while ( (node = node.previousSibling) ) { |
1213 | if ( node.nodeType === 1 ) return false; |
1208 | if ( node.nodeType === 1 ) return false; |
1214 | }
|
1209 | }
|
1215 | if ( type == 'first') return true; |
1210 | if ( type == 'first') return true; |
1216 | node = elem; |
1211 | node = elem; |
1217 | case 'last': |
1212 | case 'last': |
1218 | while (node = node.nextSibling) { |
1213 | while ( (node = node.nextSibling) ) { |
1219 | if ( node.nodeType === 1 ) return false; |
1214 | if ( node.nodeType === 1 ) return false; |
1220 | }
|
1215 | }
|
1221 | return true; |
1216 | return true; |
1222 | case 'nth': |
1217 | case 'nth': |
1223 | var first = match[2], last = match[3]; |
1218 | var first = match[2], last = match[3]; |
Строка 1619... | Строка 1614... | ||
1619 | jQuery.find = Sizzle; |
1614 | jQuery.find = Sizzle; |
1620 | jQuery.expr = Sizzle.selectors; |
1615 | jQuery.expr = Sizzle.selectors; |
1621 | jQuery.expr[":"] = jQuery.expr.filters; |
1616 | jQuery.expr[":"] = jQuery.expr.filters; |
1622 | 1617 | ||
1623 | Sizzle.selectors.filters.hidden = function(elem){ |
1618 | Sizzle.selectors.filters.hidden = function(elem){ |
1624 | return elem.offsetWidth === 0 && elem.offsetHeight === 0; |
1619 | var width = elem.offsetWidth, height = elem.offsetHeight; |
- | 1620 | return ( width === 0 && height === 0 ) ? |
|
- | 1621 | true : |
|
- | 1622 | ( width !== 0 && height !== 0 ) ? |
|
- | 1623 | false : |
|
- | 1624 | !!( jQuery.curCSS(elem, "display") === "none" ); |
|
1625 | }; |
1625 | }; |
1626 | 1626 | ||
1627 | Sizzle.selectors.filters.visible = function(elem){ |
1627 | Sizzle.selectors.filters.visible = function(elem){ |
1628 | return elem.offsetWidth > 0 || elem.offsetHeight > 0; |
1628 | var width = elem.offsetWidth, height = elem.offsetHeight; |
- | 1629 | return ( width === 0 && height === 0 ) ? |
|
- | 1630 | false : |
|
- | 1631 | ( width > 0 && height > 0 ) ? |
|
- | 1632 | true : |
|
- | 1633 | !!( jQuery.curCSS(elem, "display") !== "none" ); |
|
1629 | }; |
1634 | }; |
1630 | 1635 | ||
1631 | Sizzle.selectors.filters.animated = function(elem){ |
1636 | Sizzle.selectors.filters.animated = function(elem){ |
1632 | return jQuery.grep(jQuery.timers, function(fn){ |
1637 | return jQuery.grep(jQuery.timers, function(fn){ |
1633 | return elem === fn.elem; |
1638 | return elem === fn.elem; |
Строка 2244... | Строка 2249... | ||
2244 | 2249 | ||
2245 | jQuery.each({ |
2250 | jQuery.each({ |
2246 | remove: function( selector ) { |
2251 | remove: function( selector ) { |
2247 | if ( !selector || jQuery.multiFilter( selector, [ this ] ).length ) { |
2252 | if ( !selector || jQuery.multiFilter( selector, [ this ] ).length ) { |
2248 | if ( this.nodeType === 1 ) { |
2253 | if ( this.nodeType === 1 ) { |
2249 | cleanData( this.getElementsByTagName("*") ); |
2254 | cleanData( jQuery("*", this).add(this) ); |
2250 | cleanData( [this] ); |
- | |
2251 | }
|
2255 | }
|
2252 | 2256 | ||
2253 | if ( this.parentNode ) { |
2257 | if ( this.parentNode ) { |
2254 | this.parentNode.removeChild( this ); |
2258 | this.parentNode.removeChild( this ); |
2255 | }
|
2259 | }
|
Строка 2257... | Строка 2261... | ||
2257 | }, |
2261 | }, |
2258 | 2262 | ||
2259 | empty: function() { |
2263 | empty: function() { |
2260 | // Remove element nodes and prevent memory leaks
|
2264 | // Remove element nodes and prevent memory leaks
|
2261 | if ( this.nodeType === 1 ) { |
2265 | if ( this.nodeType === 1 ) { |
2262 | cleanData( this.getElementsByTagName("*") ); |
2266 | cleanData( jQuery("*", this) ); |
2263 | }
|
2267 | }
|
2264 | 2268 | ||
2265 | // Remove any remaining nodes
|
2269 | // Remove any remaining nodes
|
2266 | while ( this.firstChild ) { |
2270 | while ( this.firstChild ) { |
2267 | this.removeChild( this.firstChild ); |
2271 | this.removeChild( this.firstChild ); |
Строка 2650... | Строка 2654... | ||
2650 | var handle = jQuery.data( elem, "handle" ); |
2654 | var handle = jQuery.data( elem, "handle" ); |
2651 | if ( handle ) { |
2655 | if ( handle ) { |
2652 | handle.apply( elem, data ); |
2656 | handle.apply( elem, data ); |
2653 | }
|
2657 | }
|
2654 | 2658 | ||
- | 2659 | var nativeFn, nativeHandler; |
|
- | 2660 | try { |
|
- | 2661 | nativeFn = elem[ type ]; |
|
- | 2662 | nativeHandler = elem[ "on" + type ]; |
|
- | 2663 | // prevent IE from throwing an error for some elements with some event types, see #3533
|
|
- | 2664 | } catch (e) {} |
|
2655 | // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links)
|
2665 | // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links)
|
2656 | if ( (!elem[ type ] || (jQuery.nodeName(elem, 'a') && type === "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false ) { |
2666 | if ( (!nativeFn || (jQuery.nodeName(elem, 'a') && type === "click")) && nativeHandler && nativeHandler.apply( elem, data ) === false ) { |
2657 | event.result = false; |
2667 | event.result = false; |
2658 | }
|
2668 | }
|
2659 | 2669 | ||
2660 | // Trigger the native events (except for clicks on links)
|
2670 | // Trigger the native events (except for clicks on links)
|
2661 | if ( !bubbling && elem[ type ] && !event.isDefaultPrevented() && !(jQuery.nodeName(elem, 'a') && type === "click") ) { |
2671 | if ( !bubbling && nativeFn && !event.isDefaultPrevented() && !(jQuery.nodeName(elem, 'a') && type === "click") ) { |
2662 | this.triggered = true; |
2672 | this.triggered = true; |
2663 | try { |
2673 | try { |
2664 | elem[ type ](); |
2674 | nativeFn(); |
2665 | // prevent IE from throwing an error for some hidden elements
|
2675 | // prevent IE from throwing an error for some hidden elements
|
2666 | } catch (e) {} |
2676 | } catch (e) {} |
2667 | }
|
2677 | }
|
2668 | 2678 | ||
2669 | this.triggered = false; |
2679 | this.triggered = false; |
Строка 2771... | Строка 2781... | ||
2771 | event.metaKey = event.ctrlKey; |
2781 | event.metaKey = event.ctrlKey; |
2772 | }
|
2782 | }
|
2773 | 2783 | ||
2774 | // Add which for click: 1 == left; 2 == middle; 3 == right
|
2784 | // Add which for click: 1 == left; 2 == middle; 3 == right
|
2775 | // Note: button is not normalized, so don't use it
|
2785 | // Note: button is not normalized, so don't use it
|
2776 | if ( !event.which && event.button ) { |
2786 | if ( !event.which && event.button !== undefined ) { |
2777 | event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); |
2787 | event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); |
2778 | }
|
2788 | }
|
2779 | 2789 | ||
2780 | return event; |
2790 | return event; |
2781 | }, |
2791 | }, |
Строка 3284... | Строка 3294... | ||
3284 | "class": "className", |
3294 | "class": "className", |
3285 | readonly: "readOnly", |
3295 | readonly: "readOnly", |
3286 | maxlength: "maxLength", |
3296 | maxlength: "maxLength", |
3287 | cellspacing: "cellSpacing", |
3297 | cellspacing: "cellSpacing", |
3288 | rowspan: "rowSpan", |
3298 | rowspan: "rowSpan", |
- | 3299 | colspan: "colSpan", |
|
3289 | tabindex: "tabIndex" |
3300 | tabindex: "tabIndex" |
3290 | }; |
3301 | }; |
3291 | // exclude the following css properties to add px
|
3302 | // exclude the following css properties to add px
|
3292 | var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i, |
3303 | var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i, |
3293 | // cache check for defaultView.getComputedStyle
|
3304 | // cache check for defaultView.getComputedStyle
|
Строка 3408... | Строка 3419... | ||
3408 | 3419 | ||
3409 | return jQuery.curCSS( elem, name, force ); |
3420 | return jQuery.curCSS( elem, name, force ); |
3410 | }, |
3421 | }, |
3411 | 3422 | ||
3412 | curCSS: function( elem, name, force ) { |
3423 | curCSS: function( elem, name, force ) { |
3413 | var ret, style = elem.style; |
3424 | var ret, style = elem.style, filter; |
3414 | 3425 | ||
3415 | // IE uses filters for opacity
|
3426 | // IE uses filters for opacity
|
3416 | if ( !jQuery.support.opacity && name == "opacity" ) { |
3427 | if ( !jQuery.support.opacity && name === "opacity" && elem.currentStyle ) { |
3417 | ret = style.filter && style.filter.indexOf("opacity=") >= 0 ? |
3428 | ret = (elem.currentStyle.filter || "").match(/opacity=([^)]*)/) ? |
3418 | (parseFloat( style.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '': |
3429 | (parseFloat(RegExp.$1) / 100) + "" : |
3419 | ""; |
3430 | ""; |
3420 | 3431 | ||
3421 | return ret === "" ? |
3432 | return ret === "" ? |
3422 | "1" : |
3433 | "1" : |
3423 | ret;
|
3434 | ret;
|
Строка 3662... | Строка 3673... | ||
3662 | }
|
3673 | }
|
3663 | }, |
3674 | }, |
3664 | 3675 | ||
3665 | // Last-Modified header cache for next request
|
3676 | // Last-Modified header cache for next request
|
3666 | lastModified: {}, |
3677 | lastModified: {}, |
- | 3678 | etag: {}, |
|
3667 | 3679 | ||
3668 | ajax: function( s ) { |
3680 | ajax: function( s ) { |
3669 | // Extend the settings, but re-extend 's' so that it can be
|
3681 | // Extend the settings, but re-extend 's' so that it can be
|
3670 | // checked again later (in the test suite, specifically)
|
3682 | // checked again later (in the test suite, specifically)
|
3671 | s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s)); |
3683 | s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s)); |
Строка 3725... | Строка 3737... | ||
3725 | }
|
3737 | }
|
3726 | 3738 | ||
3727 | // If data is available, append data to url for get requests
|
3739 | // If data is available, append data to url for get requests
|
3728 | if ( s.data && type == "GET" ) { |
3740 | if ( s.data && type == "GET" ) { |
3729 | s.url += (s.url.match(/\?/) ? "&" : "?") + s.data; |
3741 | s.url += (s.url.match(/\?/) ? "&" : "?") + s.data; |
3730 | - | ||
3731 | // IE likes to send both get and post data, prevent this
|
- | |
3732 | s.data = null; |
- | |
3733 | }
|
3742 | }
|
3734 | 3743 | ||
3735 | // Watch for a new set of requests
|
3744 | // Watch for a new set of requests
|
3736 | if ( s.global && ! jQuery.active++ ) |
3745 | if ( s.global && ! jQuery.active++ ) |
3737 | jQuery.event.trigger( "ajaxStart" ); |
3746 | jQuery.event.trigger( "ajaxStart" ); |
Строка 3793... | Строка 3802... | ||
3793 | try { |
3802 | try { |
3794 | // Set the correct header, if data is being sent
|
3803 | // Set the correct header, if data is being sent
|
3795 | if ( s.data ) |
3804 | if ( s.data ) |
3796 | xhr.setRequestHeader("Content-Type", s.contentType); |
3805 | xhr.setRequestHeader("Content-Type", s.contentType); |
3797 | 3806 | ||
3798 | // Set the If-Modified-Since header, if ifModified mode.
|
3807 | // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
|
3799 | if ( s.ifModified ) |
3808 | if ( s.ifModified ) { |
- | 3809 | if (jQuery.lastModified[s.url]) |
|
3800 | xhr.setRequestHeader("If-Modified-Since", |
3810 | xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]); |
- | 3811 | if (jQuery.etag[s.url]) |
|
3801 | jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" ); |
3812 | xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]); |
- | 3813 | }
|
|
3802 | 3814 | ||
3803 | // Set header so the called script knows that it's an XMLHttpRequest
|
3815 | // Set header so the called script knows that it's an XMLHttpRequest
|
3804 | xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); |
3816 | xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); |
3805 | 3817 | ||
3806 | // Set the Accepts header for the server, depending on the dataType
|
3818 | // Set the Accepts header for the server, depending on the dataType
|
Строка 3858... | Строка 3870... | ||
3858 | status = "parsererror"; |
3870 | status = "parsererror"; |
3859 | }
|
3871 | }
|
3860 | }
|
3872 | }
|
3861 | 3873 | ||
3862 | // Make sure that the request was successful or notmodified
|
3874 | // Make sure that the request was successful or notmodified
|
3863 | if ( status == "success" ) { |
3875 | if ( status == "success" || status == "notmodified" ) { |
3864 | // Cache Last-Modified header, if ifModified mode.
|
- | |
3865 | var modRes; |
- | |
3866 | try { |
- | |
3867 | modRes = xhr.getResponseHeader("Last-Modified"); |
- | |
3868 | } catch(e) {} // swallow exception thrown by FF if header is not available |
- | |
3869 | - | ||
3870 | if ( s.ifModified && modRes ) |
- | |
3871 | jQuery.lastModified[s.url] = modRes; |
- | |
3872 | - | ||
3873 | // JSONP handles its own success callback
|
3876 | // JSONP handles its own success callback
|
3874 | if ( !jsonp ) |
3877 | if ( !jsonp ) |
3875 | success(); |
3878 | success(); |
3876 | } else |
3879 | } else |
3877 | jQuery.handleError(s, xhr, status); |
3880 | jQuery.handleError(s, xhr, status); |
Строка 3901... | Строка 3904... | ||
3901 | }, s.timeout); |
3904 | }, s.timeout); |
3902 | }
|
3905 | }
|
3903 | 3906 | ||
3904 | // Send the data
|
3907 | // Send the data
|
3905 | try { |
3908 | try { |
3906 | xhr.send(s.data); |
3909 | xhr.send( type === "POST" ? s.data : null ); |
3907 | } catch(e) { |
3910 | } catch(e) { |
3908 | jQuery.handleError(s, xhr, null, e); |
3911 | jQuery.handleError(s, xhr, null, e); |
3909 | }
|
3912 | }
|
3910 | 3913 | ||
3911 | // firefox 1.5 doesn't fire statechange for sync requests
|
3914 | // firefox 1.5 doesn't fire statechange for sync requests
|
Строка 3962... | Строка 3965... | ||
3962 | return false; |
3965 | return false; |
3963 | }, |
3966 | }, |
3964 | 3967 | ||
3965 | // Determines if an XMLHttpRequest returns NotModified
|
3968 | // Determines if an XMLHttpRequest returns NotModified
|
3966 | httpNotModified: function( xhr, url ) { |
3969 | httpNotModified: function( xhr, url ) { |
3967 | try { |
- | |
3968 | var xhrRes = xhr.getResponseHeader("Last-Modified"); |
3970 | var last_modified = xhr.getResponseHeader("Last-Modified"); |
- | 3971 | var etag = xhr.getResponseHeader("Etag"); |
|
3969 | 3972 | ||
3970 | // Firefox always returns 200. check Last-Modified date
|
3973 | if (last_modified) |
3971 | return xhr.status == 304 || xhrRes == jQuery.lastModified[url]; |
3974 | jQuery.lastModified[url] = last_modified; |
- | 3975 | ||
3972 | } catch(e){} |
3976 | if (etag) |
- | 3977 | jQuery.etag[url] = etag; |
|
- | 3978 | ||
3973 | return false; |
3979 | return xhr.status == 304; |
3974 | }, |
3980 | }, |
3975 | 3981 | ||
3976 | httpData: function( xhr, type, s ) { |
3982 | httpData: function( xhr, type, s ) { |
3977 | var ct = xhr.getResponseHeader("content-type"), |
3983 | var ct = xhr.getResponseHeader("content-type"), |
3978 | xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0, |
3984 | xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0, |
3979 | data = xml ? xhr.responseXML : xhr.responseText; |
3985 | data = xml ? xhr.responseXML : xhr.responseText; |
3980 | 3986 | ||
3981 | if ( xml && data.documentElement.tagName == "parsererror" ) |
3987 | if ( xml && data.documentElement.tagName == "parsererror" ) { |
3982 | throw "parsererror"; |
3988 | throw "parsererror"; |
- | 3989 | }
|
|
3983 | 3990 | ||
3984 | // Allow a pre-filtering function to sanitize the response
|
3991 | // Allow a pre-filtering function to sanitize the response
|
3985 | // s != null is checked to keep backwards compatibility
|
3992 | // s != null is checked to keep backwards compatibility
|
3986 | if( s && s.dataFilter ) |
3993 | if ( s && s.dataFilter ) { |
3987 | data = s.dataFilter( data, type ); |
3994 | data = s.dataFilter( data, type ); |
- | 3995 | }
|
|
3988 | 3996 | ||
3989 | // The filter can actually parse the response
|
3997 | // The filter can actually parse the response
|
3990 | if( typeof data === "string" ){ |
3998 | if ( typeof data === "string" ) { |
3991 | 3999 | ||
3992 | // If the type is "script", eval it in global context
|
4000 | // If the type is "script", eval it in global context
|
3993 | if ( type == "script" ) |
4001 | if ( type === "script" ) { |
3994 | jQuery.globalEval( data ); |
4002 | jQuery.globalEval( data ); |
- | 4003 | }
|
|
3995 | 4004 | ||
3996 | // Get the JavaScript object, if JSON is used.
|
4005 | // Get the JavaScript object, if JSON is used.
|
3997 | if ( type == "json" ) |
4006 | if ( type == "json" ) { |
- | 4007 | if ( typeof JSON === "object" && JSON.parse ) { |
|
- | 4008 | data = JSON.parse( data ); |
|
- | 4009 | } else { |
|
3998 | data = window["eval"]("(" + data + ")"); |
4010 | data = (new Function("return " + data))(); |
- | 4011 | }
|
|
- | 4012 | }
|
|
3999 | }
|
4013 | }
|
4000 | 4014 | ||
4001 | return data; |
4015 | return data; |
4002 | }, |
4016 | }, |
4003 | 4017 | ||
Строка 4321... | Строка 4335... | ||
4321 | return self.step(gotoEnd); |
4335 | return self.step(gotoEnd); |
4322 | }
|
4336 | }
|
4323 | 4337 | ||
4324 | t.elem = this.elem; |
4338 | t.elem = this.elem; |
4325 | 4339 | ||
4326 | if ( t() && jQuery.timers.push(t) && !timerId ) { |
4340 | if ( t() && jQuery.timers.push(t) && !timerId ) |
4327 | timerId = setInterval(function(){ |
4341 | timerId = setInterval(jQuery.fx.tick, 13); |
4328 | var timers = jQuery.timers; |
- | |
4329 | - | ||
4330 | for ( var i = 0; i < timers.length; i++ ) |
- | |
4331 | if ( !timers[i]() ) |
- | |
4332 | timers.splice(i--, 1); |
- | |
4333 | - | ||
4334 | if ( !timers.length ) { |
- | |
4335 | clearInterval( timerId ); |
- | |
4336 | timerId = undefined; |
- | |
4337 | }
|
- | |
4338 | }, 13); |
- | |
4339 | }
|
- | |
4340 | }, |
4342 | }, |
4341 | 4343 | ||
4342 | // Simple 'show' function
|
4344 | // Simple 'show' function
|
4343 | show: function(){ |
4345 | show: function(){ |
4344 | // Remember where we started, so that we can go back to it later
|
4346 | // Remember where we started, so that we can go back to it later
|
Строка 4421... | Строка 4423... | ||
4421 | }
|
4423 | }
|
4422 | 4424 | ||
4423 | }; |
4425 | }; |
4424 | 4426 | ||
4425 | jQuery.extend( jQuery.fx, { |
4427 | jQuery.extend( jQuery.fx, { |
- | 4428 | ||
- | 4429 | tick:function(){ |
|
- | 4430 | var timers = jQuery.timers; |
|
- | 4431 | ||
- | 4432 | for ( var i = 0; i < timers.length; i++ ) |
|
- | 4433 | if ( !timers[i]() ) |
|
- | 4434 | timers.splice(i--, 1); |
|
- | 4435 | ||
- | 4436 | if ( !timers.length ) |
|
- | 4437 | jQuery.fx.stop(); |
|
- | 4438 | }, |
|
- | 4439 | ||
- | 4440 | stop:function(){ |
|
- | 4441 | clearInterval( timerId ); |
|
- | 4442 | timerId = null; |
|
- | 4443 | }, |
|
- | 4444 | ||
4426 | speeds:{ |
4445 | speeds:{ |
4427 | slow: 600, |
4446 | slow: 600, |
4428 | fast: 200, |
4447 | fast: 200, |
4429 | // Default speed
|
4448 | // Default speed
|
4430 | _default: 400 |
4449 | _default: 400 |
4431 | }, |
4450 | }, |
- | 4451 | ||
4432 | step: { |
4452 | step: { |
4433 | 4453 | ||
4434 | opacity: function(fx){ |
4454 | opacity: function(fx){ |
4435 | jQuery.style(fx.elem, "opacity", fx.now); |
4455 | jQuery.style(fx.elem, "opacity", fx.now); |
4436 | }, |
4456 | }, |
Строка 4654... | Строка 4674... | ||
4654 | // Set the width or height on the element (default to pixels if value is unitless)
|
4674 | // Set the width or height on the element (default to pixels if value is unitless)
|
4655 | this.css( type, typeof size === "string" ? size : size + "px" ); |
4675 | this.css( type, typeof size === "string" ? size : size + "px" ); |
4656 | }; |
4676 | }; |
4657 | 4677 | ||
4658 | }); |
4678 | }); |
4659 | })(); |
4679 | })(window); |