vendor: 9,083 bytes, lines 1-656
1/*! 2 3 * jQuery JavaScript Library v1.9.1 4 5 * http://jquery.com/ 6 7 * 8 9 * Includes Sizzle.js 10 11 * http://sizzlejs.com/ 12 13 * 14 15 * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors 16 17 * Released under the MIT license 18 19 * http://jquery.org/license 20 21 * 22 23 * Date: 2013-2-4 24 25 */ 26 27(function( window, undefined ) { 28 29 30 31// Can't do this because several apps including ASP.NET trace 32 33// the stack via arguments.caller.callee and Firefox dies if 34 35// you try to trace through "use strict" call chains. (#13335) 36 37// Support: Firefox 18+ 38 39//"use strict"; 40 41var 42 43 // The deferred used on DOM ready 44 45 readyList, 46 47 48 49 // A central reference to the root jQuery(document) 50 51 rootjQuery, 52 53 54 55 // Support: IE<9 56 57 // For `typeof node.method` instead of `node.method !== undefined` 58 59 core_strundefined = typeof undefined, 60 61 62 63 // Use the correct document accordingly with window argument (sandbox) 64 65 document = window.document, 66 67 location = window.location, 68 69 70 71 // Map over jQuery in case of overwrite 72 73 _jQuery = window.jQuery, 74 75 76 77 // Map over the $ in case of overwrite 78 79 _$ = window.$, 80 81 82 83 // [[Class]] -> type pairs 84 85 class2type = {}, 86 87 88 89 // List of deleted data cache ids, so we can reuse them 90 91 core_deletedIds = [], 92 93 94 95 core_version = "1.9.1", 96 97 98 99 // Save a reference to some core methods 100 101 core_concat = core_deletedIds.concat, 102 103 core_push = core_deletedIds.push, 104 105 core_slice = core_deletedIds.slice, 106 107 core_indexOf = core_deletedIds.indexOf, 108 109 core_toString = class2type.toString, 110 111 core_hasOwn = class2type.hasOwnProperty, 112 113 core_trim = core_version.trim, 114 115 116 117 // Define a local copy of jQuery 118 119 jQuery = function( selector, context ) { 120 121 // The jQuery object is actually just the init constructor 'enhanced' 122 123 return new jQuery.fn.init( selector, context, rootjQuery ); 124 125 }, 126 127 128 129 // Used for matching numbers 130 131 core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, 132 133 134 135 // Used for splitting on whitespace 136 137 core_rnotwhite = /\S+/g, 138 139 140 141 // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) 142 143 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, 144 145 146 147 // A simple way to check for HTML strings 148 149 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) 150 151 // Strict HTML recognition (#11290: must start with <) 152 153 rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/, 154 155 156 157 // Match a standalone tag 158 159 rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, 160 161 162 163 // JSON RegExp 164 165 rvalidchars = /^[\],:{}\s]*$/, 166 167 rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, 168 169 rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, 170 171 rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, 172 173 174 175 // Matches dashed string for camelizing 176 177 rmsPrefix = /^-ms-/, 178 179 rdashAlpha = /-([\da-z])/gi, 180 181 182 183 // Used by jQuery.camelCase as callback to replace() 184 185 fcamelCase = function( all, letter ) { 186 187 return letter.toUpperCase(); 188 189 }, 190 191 192 193 // The ready event handler 194 195 completed = function( event ) { 196 197 198 199 // readyState === "complete" is good enough for us to call the dom ready in oldIE 200 201 if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { 202 203 detach(); 204 205 jQuery.ready(); 206 207 } 208 209 }, 210 211 // Clean-up method for dom ready events 212 213 detach = function() { 214 215 if ( document.addEventListener ) { 216 217 document.removeEventListener( "DOMContentLoaded", completed, false ); 218 219 window.removeEventListener( "load", completed, false ); 220 221 222 223 } else { 224 225 document.detachEvent( "onreadystatechange", completed ); 226 227 window.detachEvent( "onload", completed ); 228 229 } 230 231 }; 232 233 234 235jQuery.fn = jQuery.prototype = { 236 237 // The current version of jQuery being used 238 239 jquery: core_version, 240 241 242 243 constructor: jQuery, 244 245 init: function( selector, context, rootjQuery ) { 246 247 var match, elem; 248 249 250 251 // HANDLE: $(""), $(null), $(undefined), $(false) 252 253 if ( !selector ) { 254 255 return this; 256 257 } 258 259 260 261 // Handle HTML strings 262 263 if ( typeof selector === "string" ) { 264 265 if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { 266 267 // Assume that strings that start and end with <> are HTML and skip the regex check 268 269 match = [ null, selector, null ]; 270 271 272 273 } else { 274 275 match = rquickExpr.exec( selector ); 276 277 } 278 279 280 281 // Match html or make sure no context is specified for #id 282 283 if ( match && (match[1] || !context) ) { 284 285 286 287 // HANDLE: $(html) -> $(array) 288 289 if ( match[1] ) { 290 291 context = context instanceof jQuery ? context[0] : context; 292 293 294 295 // scripts is true for back-compat 296 297 jQuery.merge( this, jQuery.parseHTML( 298 299 match[1], 300 301 context && context.nodeType ? context.ownerDocument || context : document, 302 303 true 304 305 ) ); 306 307 308 309 // HANDLE: $(html, props) 310 311 if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { 312 313 for ( match in context ) { 314 315 // Properties of context are called as methods if possible 316 317 if ( jQuery.isFunction( this[ match ] ) ) { 318 319 this[ match ]( context[ match ] ); 320 321 322 323 // ...and otherwise set as attributes 324 325 } else { 326 327 this.attr( match, context[ match ] ); 328 329 } 330 331 } 332 333 } 334 335 336 337 return this; 338 339 340 341 // HANDLE: $(#id) 342 343 } else { 344 345 elem = document.getElementById( match[2] ); 346 347 348 349 // Check parentNode to catch when Blackberry 4.6 returns 350 351 // nodes that are no longer in the document #6963 352 353 if ( elem && elem.parentNode ) { 354 355 // Handle the case where IE and Opera return items 356 357 // by name instead of ID 358 359 if ( elem.id !== match[2] ) { 360 361 return rootjQuery.find( selector ); 362 363 } 364 365 366 367 // Otherwise, we inject the element directly into the jQuery object 368 369 this.length = 1; 370 371 this[0] = elem; 372 373 } 374 375 376 377 this.context = document; 378 379 this.selector = selector; 380 381 return this; 382 383 } 384 385 386 387 // HANDLE: $(expr, $(...)) 388 389 } else if ( !context || context.jquery ) { 390 391 return ( context || rootjQuery ).find( selector ); 392 393 394 395 // HANDLE: $(expr, context) 396 397 // (which is just equivalent to: $(context).find(expr) 398 399 } else { 400 401 return this.constructor( context ).find( selector ); 402 403 } 404 405 406 407 // HANDLE: $(DOMElement) 408 409 } else if ( selector.nodeType ) { 410 411 this.context = this[0] = selector; 412 413 this.length = 1; 414 415 return this; 416 417 418 419 // HANDLE: $(function) 420 421 // Shortcut for document ready 422 423 } else if ( jQuery.isFunction( selector ) ) { 424 425 return rootjQuery.ready( selector ); 426 427 } 428 429 430 431 if ( selector.selector !== undefined ) { 432 433 this.selector = selector.selector; 434 435 this.context = selector.context; 436 437 } 438 439 440 441 return jQuery.makeArray( selector, this ); 442 443 }, 444 445 446 447 // Start with an empty selector 448 449 selector: "", 450 451 452 453 // The default length of a jQuery object is 0 454 455 length: 0, 456 457 458 459 // The number of elements contained in the matched element set 460 461 size: function() { 462 463 return this.length; 464 465 }, 466 467 468 469 toArray: function() { 470 471 return core_slice.call( this ); 472 473 }, 474 475 476 477 // Get the Nth element in the matched element set OR 478 479 // Get the whole matched element set as a clean array 480 481 get: function( num ) { 482 483 return num == null ? 484 485 486 487 // Return a 'clean' array 488 489 this.toArray() : 490 491 492 493 // Return just the object 494 495 ( num < 0 ? this[ this.length + num ] : this[ num ] ); 496 497 }, 498 499 500 501 // Take an array of elements and push it onto the stack 502 503 // (returning the new matched element set) 504 505 pushStack: function( elems ) { 506 507 508 509 // Build a new jQuery matched element set 510 511 var ret = jQuery.merge( this.constructor(), elems ); 512 513 514 515 // Add the old object onto the stack (as a reference) 516 517 ret.prevObject = this; 518 519 ret.context = this.context; 520 521 522 523 // Return the newly-formed element set 524 525 return ret; 526 527 }, 528 529 530 531 // Execute a callback for every element in the matched set. 532 533 // (You can seed the arguments with an array of args, but this is 534 535 // only used internally.) 536 537 each: function( callback, args ) { 538 539 return jQuery.each( this, callback, args ); 540 541 }, 542 543 544 545 ready: function( fn ) { 546 547 // Add the callback 548 549 jQuery.ready.promise().done( fn ); 550 551 552 553 return this; 554 555 }, 556 557 558 559 slice: function() { 560 561 return this.pushStack( core_slice.apply( this, arguments ) ); 562 563 }, 564 565 566 567 first: function() { 568 569 return this.eq( 0 ); 570 571 }, 572 573 574 575 last: function() { 576 577 return this.eq( -1 ); 578 579 }, 580 581 582 583 eq: function( i ) { 584 585 var len = this.length, 586 587 j = +i + ( i < 0 ? len : 0 ); 588 589 return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); 590 591 }, 592 593 594 595 map: function( callback ) { 596 597 return this.pushStack( jQuery.map(this, function( elem, i ) { 598 599 return callback.call( elem, i, elem ); 600 601 })); 602 603 }, 604 605 606 607 end: function() { 608 609 return this.prevObject || this.constructor(null); 610 611 }, 612 613 614 615 // For internal use only. 616 617 // Behaves like an Array's method, not like a jQuery method. 618 619 push: core_push, 620 621 sort: [].sort, 622 623 splice: [].splice 624 625}; 626 627 628 629// Give the init function the jQuery prototype for later instantiation 630 631jQuery.fn.init.prototype = jQuery.fn; 632 633 634 635jQuery.extend = jQuery.fn.extend = function() { 636 637 var src, copyIsArray, copy, name, options, clone, 638 639 target = arguments[0] || {}, 640 641 i = 1, 642 643 length = arguments.length, 644 645 deep = false; 646 647 648 649 // Handle a deep copy situation 650 651 if ( typeof target === "boolean" ) { 652 653 deep = target; 654 655 target = arguments[1] || {}; 656
vendor: 4,129 bytes, lines 657-971
657 // skip the boolean and the target 658 659 i = 2; 660 661 } 662 663 664 665 // Handle case when target is a string or something (possible in deep copy) 666 667 if ( typeof target !== "object" && !jQuery.isFunction(target) ) { 668 669 target = {}; 670 671 } 672 673 674 675 // extend jQuery itself if only one argument is passed 676 677 if ( length === i ) { 678 679 target = this; 680 681 --i; 682 683 } 684 685 686 687 for ( ; i < length; i++ ) { 688 689 // Only deal with non-null/undefined values 690 691 if ( (options = arguments[ i ]) != null ) { 692 693 // Extend the base object 694 695 for ( name in options ) { 696 697 src = target[ name ]; 698 699 copy = options[ name ]; 700 701 702 703 // Prevent never-ending loop 704 705 if ( target === copy ) { 706 707 continue; 708 709 } 710 711 712 713 // Recurse if we're merging plain objects or arrays 714 715 if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { 716 717 if ( copyIsArray ) { 718 719 copyIsArray = false; 720 721 clone = src && jQuery.isArray(src) ? src : []; 722 723 724 725 } else { 726 727 clone = src && jQuery.isPlainObject(src) ? src : {}; 728 729 } 730 731 732 733 // Never move original objects, clone them 734 735 target[ name ] = jQuery.extend( deep, clone, copy ); 736 737 738 739 // Don't bring in undefined values 740 741 } else if ( copy !== undefined ) { 742 743 target[ name ] = copy; 744 745 } 746 747 } 748 749 } 750 751 } 752 753 754 755 // Return the modified object 756 757 return target; 758 759}; 760 761 762 763jQuery.extend({ 764 765 noConflict: function( deep ) { 766 767 if ( window.$ === jQuery ) { 768 769 window.$ = _$; 770 771 } 772 773 774 775 if ( deep && window.jQuery === jQuery ) { 776 777 window.jQuery = _jQuery; 778 779 } 780 781 782 783 return jQuery; 784 785 }, 786 787 788 789 // Is the DOM ready to be used? Set to true once it occurs. 790 791 isReady: false, 792 793 794 795 // A counter to track how many items to wait for before 796 797 // the ready event fires. See #6781 798 799 readyWait: 1, 800 801 802 803 // Hold (or release) the ready event 804 805 holdReady: function( hold ) { 806 807 if ( hold ) { 808 809 jQuery.readyWait++; 810 811 } else { 812 813 jQuery.ready( true ); 814 815 } 816 817 }, 818 819 820 821 // Handle when the DOM is ready 822 823 ready: function( wait ) { 824 825 826 827 // Abort if there are pending holds or we're already ready 828 829 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { 830 831 return; 832 833 } 834 835 836 837 // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). 838 839 if ( !document.body ) { 840 841 return setTimeout( jQuery.ready ); 842 843 } 844 845 846 847 // Remember that the DOM is ready 848 849 jQuery.isReady = true; 850 851 852 853 // If a normal DOM Ready event fired, decrement, and wait if need be 854 855 if ( wait !== true && --jQuery.readyWait > 0 ) { 856 857 return; 858 859 } 860 861 862 863 // If there are functions bound, to execute 864 865 readyList.resolveWith( document, [ jQuery ] ); 866 867 868 869 // Trigger any bound ready events 870 871 if ( jQuery.fn.trigger ) { 872 873 jQuery( document ).trigger("ready").off("ready"); 874 875 } 876 877 }, 878 879 880 881 // See test/unit/core.js for details concerning isFunction. 882 883 // Since version 1.3, DOM methods and functions like alert 884 885 // aren't supported. They return false on IE (#2968). 886 887 isFunction: function( obj ) { 888 889 return jQuery.type(obj) === "function"; 890 891 }, 892 893 894 895 isArray: Array.isArray || function( obj ) { 896 897 return jQuery.type(obj) === "array"; 898 899 }, 900 901 902 903 isWindow: function( obj ) { 904 905 return obj != null && obj == obj.window; 906 907 }, 908 909 910 911 isNumeric: function( obj ) { 912 913 return !isNaN( parseFloat(obj) ) && isFinite( obj ); 914 915 }, 916 917 918 919 type: function( obj ) { 920 921 if ( obj == null ) { 922 923 return String( obj ); 924 925 } 926 927 return typeof obj === "object" || typeof obj === "function" ? 928 929 class2type[ core_toString.call(obj) ] || "object" : 930 931 typeof obj; 932 933 }, 934 935 936 937 isPlainObject: function( obj ) { 938 939 // Must be an Object. 940 941 // Because of IE, we also have to check the presence of the constructor property. 942 943 // Make sure that DOM nodes and window objects don't pass through, as well 944 945 if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { 946 947 return false; 948 949 } 950 951 952 953 try { 954 955 // Not own constructor property must be Object 956 957 if ( obj.constructor && 958 959 !core_hasOwn.call(obj, "constructor") && 960 961 !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { 962 963 return false; 964 965 } 966 967 } catch ( e ) { 968 969 // IE8,9 Will throw exceptions on certain host objects #9897 970 971 return false;
vendor: 21,633 bytes, lines 972-2600
972 973 } 974 975 976 977 // Own properties are enumerated firstly, so to speed up, 978 979 // if last one is own, then all properties are own. 980 981 982 983 var key; 984 985 for ( key in obj ) {} 986 987 988 989 return key === undefined || core_hasOwn.call( obj, key ); 990 991 }, 992 993 994 995 isEmptyObject: function( obj ) { 996 997 var name; 998 999 for ( name in obj ) { 1000 1001 return false; 1002 1003 } 1004 1005 return true; 1006 1007 }, 1008 1009 1010 1011 error: function( msg ) { 1012 1013 throw new Error( msg ); 1014 1015 }, 1016 1017 1018 1019 // data: string of html 1020 1021 // context (optional): If specified, the fragment will be created in this context, defaults to document 1022 1023 // keepScripts (optional): If true, will include scripts passed in the html string 1024 1025 parseHTML: function( data, context, keepScripts ) { 1026 1027 if ( !data || typeof data !== "string" ) { 1028 1029 return null; 1030 1031 } 1032 1033 if ( typeof context === "boolean" ) { 1034 1035 keepScripts = context; 1036 1037 context = false; 1038 1039 } 1040 1041 context = context || document; 1042 1043 1044 1045 var parsed = rsingleTag.exec( data ), 1046 1047 scripts = !keepScripts && []; 1048 1049 1050 1051 // Single tag 1052 1053 if ( parsed ) { 1054 1055 return [ context.createElement( parsed[1] ) ]; 1056 1057 } 1058 1059 1060 1061 parsed = jQuery.buildFragment( [ data ], context, scripts ); 1062 1063 if ( scripts ) { 1064 1065 jQuery( scripts ).remove(); 1066 1067 } 1068 1069 return jQuery.merge( [], parsed.childNodes ); 1070 1071 }, 1072 1073 1074 1075 parseJSON: function( data ) { 1076 1077 // Attempt to parse using the native JSON parser first 1078 1079 if ( window.JSON && window.JSON.parse ) { 1080 1081 return window.JSON.parse( data ); 1082 1083 } 1084 1085 1086 1087 if ( data === null ) { 1088 1089 return data; 1090 1091 } 1092 1093 1094 1095 if ( typeof data === "string" ) { 1096 1097 1098 1099 // Make sure leading/trailing whitespace is removed (IE can't handle it) 1100 1101 data = jQuery.trim( data ); 1102 1103 1104 1105 if ( data ) { 1106 1107 // Make sure the incoming data is actual JSON 1108 1109 // Logic borrowed from http://json.org/json2.js 1110 1111 if ( rvalidchars.test( data.replace( rvalidescape, "@" ) 1112 1113 .replace( rvalidtokens, "]" ) 1114 1115 .replace( rvalidbraces, "")) ) { 1116 1117 1118 1119 return ( new Function( "return " + data ) )(); 1120 1121 } 1122 1123 } 1124 1125 } 1126 1127 1128 1129 jQuery.error( "Invalid JSON: " + data ); 1130 1131 }, 1132 1133 1134 1135 // Cross-browser xml parsing 1136 1137 parseXML: function( data ) { 1138 1139 var xml, tmp; 1140 1141 if ( !data || typeof data !== "string" ) { 1142 1143 return null; 1144 1145 } 1146 1147 try { 1148 1149 if ( window.DOMParser ) { // Standard 1150 1151 tmp = new DOMParser(); 1152 1153 xml = tmp.parseFromString( data , "text/xml" ); 1154 1155 } else { // IE 1156 1157 xml = new ActiveXObject( "Microsoft.XMLDOM" ); 1158 1159 xml.async = "false"; 1160 1161 xml.loadXML( data ); 1162 1163 } 1164 1165 } catch( e ) { 1166 1167 xml = undefined; 1168 1169 } 1170 1171 if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { 1172 1173 jQuery.error( "Invalid XML: " + data ); 1174 1175 } 1176 1177 return xml; 1178 1179 }, 1180 1181 1182 1183 noop: function() {}, 1184 1185 1186 1187 // Evaluates a script in a global context 1188 1189 // Workarounds based on findings by Jim Driscoll 1190 1191 // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context 1192 1193 globalEval: function( data ) { 1194 1195 if ( data && jQuery.trim( data ) ) { 1196 1197 // We use execScript on Internet Explorer 1198 1199 // We use an anonymous function so that context is window 1200 1201 // rather than jQuery in Firefox 1202 1203 ( window.execScript || function( data ) { 1204 1205 window[ "eval" ].call( window, data ); 1206 1207 } )( data ); 1208 1209 } 1210 1211 }, 1212 1213 1214 1215 // Convert dashed to camelCase; used by the css and data modules 1216 1217 // Microsoft forgot to hump their vendor prefix (#9572) 1218 1219 camelCase: function( string ) { 1220 1221 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 1222 1223 }, 1224 1225 1226 1227 nodeName: function( elem, name ) { 1228 1229 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 1230 1231 }, 1232 1233 1234 1235 // args is for internal usage only 1236 1237 each: function( obj, callback, args ) { 1238 1239 var value, 1240 1241 i = 0, 1242 1243 length = obj.length, 1244 1245 isArray = isArraylike( obj ); 1246 1247 1248 1249 if ( args ) { 1250 1251 if ( isArray ) { 1252 1253 for ( ; i < length; i++ ) { 1254 1255 value = callback.apply( obj[ i ], args ); 1256 1257 1258 1259 if ( value === false ) { 1260 1261 break; 1262 1263 } 1264 1265 } 1266 1267 } else { 1268 1269 for ( i in obj ) { 1270 1271 value = callback.apply( obj[ i ], args ); 1272 1273 1274 1275 if ( value === false ) { 1276 1277 break; 1278 1279 } 1280 1281 } 1282 1283 } 1284 1285 1286 1287 // A special, fast, case for the most common use of each 1288 1289 } else { 1290 1291 if ( isArray ) { 1292 1293 for ( ; i < length; i++ ) { 1294 1295 value = callback.call( obj[ i ], i, obj[ i ] ); 1296 1297 1298 1299 if ( value === false ) { 1300 1301 break; 1302 1303 } 1304 1305 } 1306 1307 } else { 1308 1309 for ( i in obj ) { 1310 1311 value = callback.call( obj[ i ], i, obj[ i ] ); 1312 1313 1314 1315 if ( value === false ) { 1316 1317 break; 1318 1319 } 1320 1321 } 1322 1323 } 1324 1325 } 1326 1327 1328 1329 return obj; 1330 1331 }, 1332 1333 1334 1335 // Use native String.trim function wherever possible 1336 1337 trim: core_trim && !core_trim.call("\uFEFF\xA0") ? 1338 1339 function( text ) { 1340 1341 return text == null ? 1342 1343 "" : 1344 1345 core_trim.call( text ); 1346 1347 } : 1348 1349 1350 1351 // Otherwise use our own trimming functionality 1352 1353 function( text ) { 1354 1355 return text == null ? 1356 1357 "" : 1358 1359 ( text + "" ).replace( rtrim, "" ); 1360 1361 }, 1362 1363 1364 1365 // results is for internal usage only 1366 1367 makeArray: function( arr, results ) { 1368 1369 var ret = results || []; 1370 1371 1372 1373 if ( arr != null ) { 1374 1375 if ( isArraylike( Object(arr) ) ) { 1376 1377 jQuery.merge( ret, 1378 1379 typeof arr === "string" ? 1380 1381 [ arr ] : arr 1382 1383 ); 1384 1385 } else { 1386 1387 core_push.call( ret, arr ); 1388 1389 } 1390 1391 } 1392 1393 1394 1395 return ret; 1396 1397 }, 1398 1399 1400 1401 inArray: function( elem, arr, i ) { 1402 1403 var len; 1404 1405 1406 1407 if ( arr ) { 1408 1409 if ( core_indexOf ) { 1410 1411 return core_indexOf.call( arr, elem, i ); 1412 1413 } 1414 1415 1416 1417 len = arr.length; 1418 1419 i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; 1420 1421 1422 1423 for ( ; i < len; i++ ) { 1424 1425 // Skip accessing in sparse arrays 1426 1427 if ( i in arr && arr[ i ] === elem ) { 1428 1429 return i; 1430 1431 } 1432 1433 } 1434 1435 } 1436 1437 1438 1439 return -1; 1440 1441 }, 1442 1443 1444 1445 merge: function( first, second ) { 1446 1447 var l = second.length, 1448 1449 i = first.length, 1450 1451 j = 0; 1452 1453 1454 1455 if ( typeof l === "number" ) { 1456 1457 for ( ; j < l; j++ ) { 1458 1459 first[ i++ ] = second[ j ]; 1460 1461 } 1462 1463 } else { 1464 1465 while ( second[j] !== undefined ) { 1466 1467 first[ i++ ] = second[ j++ ]; 1468 1469 } 1470 1471 } 1472 1473 1474 1475 first.length = i; 1476 1477 1478 1479 return first; 1480 1481 }, 1482 1483 1484 1485 grep: function( elems, callback, inv ) { 1486 1487 var retVal, 1488 1489 ret = [], 1490 1491 i = 0, 1492 1493 length = elems.length; 1494 1495 inv = !!inv; 1496 1497 1498 1499 // Go through the array, only saving the items 1500 1501 // that pass the validator function 1502 1503 for ( ; i < length; i++ ) { 1504 1505 retVal = !!callback( elems[ i ], i ); 1506 1507 if ( inv !== retVal ) { 1508 1509 ret.push( elems[ i ] ); 1510 1511 } 1512 1513 } 1514 1515 1516 1517 return ret; 1518 1519 }, 1520 1521 1522 1523 // arg is for internal usage only 1524 1525 map: function( elems, callback, arg ) { 1526 1527 var value, 1528 1529 i = 0, 1530 1531 length = elems.length, 1532 1533 isArray = isArraylike( elems ), 1534 1535 ret = []; 1536 1537 1538 1539 // Go through the array, translating each of the items to their 1540 1541 if ( isArray ) { 1542 1543 for ( ; i < length; i++ ) { 1544 1545 value = callback( elems[ i ], i, arg ); 1546 1547 1548 1549 if ( value != null ) { 1550 1551 ret[ ret.length ] = value; 1552 1553 } 1554 1555 } 1556 1557 1558 1559 // Go through every key on the object, 1560 1561 } else { 1562 1563 for ( i in elems ) { 1564 1565 value = callback( elems[ i ], i, arg ); 1566 1567 1568 1569 if ( value != null ) { 1570 1571 ret[ ret.length ] = value; 1572 1573 } 1574 1575 } 1576 1577 } 1578 1579 1580 1581 // Flatten any nested arrays 1582 1583 return core_concat.apply( [], ret ); 1584 1585 }, 1586 1587 1588 1589 // A global GUID counter for objects 1590 1591 guid: 1, 1592 1593 1594 1595 // Bind a function to a context, optionally partially applying any 1596 1597 // arguments. 1598 1599 proxy: function( fn, context ) { 1600 1601 var args, proxy, tmp; 1602 1603 1604 1605 if ( typeof context === "string" ) { 1606 1607 tmp = fn[ context ]; 1608 1609 context = fn; 1610 1611 fn = tmp; 1612 1613 } 1614 1615 1616 1617 // Quick check to determine if target is callable, in the spec 1618 1619 // this throws a TypeError, but we will just return undefined. 1620 1621 if ( !jQuery.isFunction( fn ) ) { 1622 1623 return undefined; 1624 1625 } 1626 1627 1628 1629 // Simulated bind 1630 1631 args = core_slice.call( arguments, 2 ); 1632 1633 proxy = function() { 1634 1635 return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) ); 1636 1637 }; 1638 1639 1640 1641 // Set the guid of unique handler to the same of original handler, so it can be removed 1642 1643 proxy.guid = fn.guid = fn.guid || jQuery.guid++; 1644 1645 1646 1647 return proxy; 1648 1649 }, 1650 1651 1652 1653 // Multifunctional method to get and set values of a collection 1654 1655 // The value/s can optionally be executed if it's a function 1656 1657 access: function( elems, fn, key, value, chainable, emptyGet, raw ) { 1658 1659 var i = 0, 1660 1661 length = elems.length, 1662 1663 bulk = key == null; 1664 1665 1666 1667 // Sets many values 1668 1669 if ( jQuery.type( key ) === "object" ) { 1670 1671 chainable = true; 1672 1673 for ( i in key ) { 1674 1675 jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); 1676 1677 } 1678 1679 1680 1681 // Sets one value 1682 1683 } else if ( value !== undefined ) { 1684 1685 chainable = true; 1686 1687 1688 1689 if ( !jQuery.isFunction( value ) ) { 1690 1691 raw = true; 1692 1693 } 1694 1695 1696 1697 if ( bulk ) { 1698 1699 // Bulk operations run against the entire set 1700 1701 if ( raw ) { 1702 1703 fn.call( elems, value ); 1704 1705 fn = null; 1706 1707 1708 1709 // ...except when executing function values 1710 1711 } else { 1712 1713 bulk = fn; 1714 1715 fn = function( elem, key, value ) { 1716 1717 return bulk.call( jQuery( elem ), value ); 1718 1719 }; 1720 1721 } 1722 1723 } 1724 1725 1726 1727 if ( fn ) { 1728 1729 for ( ; i < length; i++ ) { 1730 1731 fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); 1732 1733 } 1734 1735 } 1736 1737 } 1738 1739 1740 1741 return chainable ? 1742 1743 elems : 1744 1745 1746 1747 // Gets 1748 1749 bulk ? 1750 1751 fn.call( elems ) : 1752 1753 length ? fn( elems[0], key ) : emptyGet; 1754 1755 }, 1756 1757 1758 1759 now: function() { 1760 1761 return ( new Date() ).getTime(); 1762 1763 } 1764 1765}); 1766 1767 1768 1769jQuery.ready.promise = function( obj ) { 1770 1771 if ( !readyList ) { 1772 1773 1774 1775 readyList = jQuery.Deferred(); 1776 1777 1778 1779 // Catch cases where $(document).ready() is called after the browser event has already occurred. 1780 1781 // we once tried to use readyState "interactive" here, but it caused issues like the one 1782 1783 // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 1784 1785 if ( document.readyState === "complete" ) { 1786 1787 // Handle it asynchronously to allow scripts the opportunity to delay ready 1788 1789 setTimeout( jQuery.ready ); 1790 1791 1792 1793 // Standards-based browsers support DOMContentLoaded 1794 1795 } else if ( document.addEventListener ) { 1796 1797 // Use the handy event callback 1798 1799 document.addEventListener( "DOMContentLoaded", completed, false ); 1800 1801 1802 1803 // A fallback to window.onload, that will always work 1804 1805 window.addEventListener( "load", completed, false ); 1806 1807 1808 1809 // If IE event model is used 1810 1811 } else { 1812 1813 // Ensure firing before onload, maybe late but safe also for iframes 1814 1815 document.attachEvent( "onreadystatechange", completed ); 1816 1817 1818 1819 // A fallback to window.onload, that will always work 1820 1821 window.attachEvent( "onload", completed ); 1822 1823 1824 1825 // If IE and not a frame 1826 1827 // continually check to see if the document is ready 1828 1829 var top = false; 1830 1831 1832 1833 try { 1834 1835 top = window.frameElement == null && document.documentElement; 1836 1837 } catch(e) {} 1838 1839 1840 1841 if ( top && top.doScroll ) { 1842 1843 (function doScrollCheck() { 1844 1845 if ( !jQuery.isReady ) { 1846 1847 1848 1849 try { 1850 1851 // Use the trick by Diego Perini 1852 1853 // http://javascript.nwbox.com/IEContentLoaded/ 1854 1855 top.doScroll("left"); 1856 1857 } catch(e) { 1858 1859 return setTimeout( doScrollCheck, 50 ); 1860 1861 } 1862 1863 1864 1865 // detach all dom ready events 1866 1867 detach(); 1868 1869 1870 1871 // and execute any waiting functions 1872 1873 jQuery.ready(); 1874 1875 } 1876 1877 })(); 1878 1879 } 1880 1881 } 1882 1883 } 1884 1885 return readyList.promise( obj ); 1886 1887}; 1888 1889 1890 1891// Populate the class2type map 1892 1893jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { 1894 1895 class2type[ "[object " + name + "]" ] = name.toLowerCase(); 1896 1897}); 1898 1899 1900 1901function isArraylike( obj ) { 1902 1903 var length = obj.length, 1904 1905 type = jQuery.type( obj ); 1906 1907 1908 1909 if ( jQuery.isWindow( obj ) ) { 1910 1911 return false; 1912 1913 } 1914 1915 1916 1917 if ( obj.nodeType === 1 && length ) { 1918 1919 return true; 1920 1921 } 1922 1923 1924 1925 return type === "array" || type !== "function" && 1926 1927 ( length === 0 || 1928 1929 typeof length === "number" && length > 0 && ( length - 1 ) in obj ); 1930 1931} 1932 1933 1934 1935// All jQuery objects should point back to these 1936 1937rootjQuery = jQuery(document); 1938 1939// String to Object options format cache 1940 1941var optionsCache = {}; 1942 1943 1944 1945// Convert String-formatted options into Object-formatted ones and store in cache 1946 1947function createOptions( options ) { 1948 1949 var object = optionsCache[ options ] = {}; 1950 1951 jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) { 1952 1953 object[ flag ] = true; 1954 1955 }); 1956 1957 return object; 1958 1959} 1960 1961 1962 1963/* 1964 1965 * Create a callback list using the following parameters: 1966 1967 * 1968 1969 * options: an optional list of space-separated options that will change how 1970 1971 * the callback list behaves or a more traditional option object 1972 1973 * 1974 1975 * By default a callback list will act like an event callback list and can be 1976 1977 * "fired" multiple times. 1978 1979 * 1980 1981 * Possible options: 1982 1983 * 1984 1985 * once: will ensure the callback list can only be fired once (like a Deferred) 1986 1987 * 1988 1989 * memory: will keep track of previous values and will call any callback added 1990 1991 * after the list has been fired right away with the latest "memorized" 1992 1993 * values (like a Deferred) 1994 1995 * 1996 1997 * unique: will ensure a callback can only be added once (no duplicate in the list) 1998 1999 * 2000 2001 * stopOnFalse: interrupt callings when a callback returns false 2002 2003 * 2004 2005 */ 2006 2007jQuery.Callbacks = function( options ) { 2008 2009 2010 2011 // Convert options from String-formatted to Object-formatted if needed 2012 2013 // (we check in cache first) 2014 2015 options = typeof options === "string" ? 2016 2017 ( optionsCache[ options ] || createOptions( options ) ) : 2018 2019 jQuery.extend( {}, options ); 2020 2021 2022 2023 var // Flag to know if list is currently firing 2024 2025 firing, 2026 2027 // Last fire value (for non-forgettable lists) 2028 2029 memory, 2030 2031 // Flag to know if list was already fired 2032 2033 fired, 2034 2035 // End of the loop when firing 2036 2037 firingLength, 2038 2039 // Index of currently firing callback (modified by remove if needed) 2040 2041 firingIndex, 2042 2043 // First callback to fire (used internally by add and fireWith) 2044 2045 firingStart, 2046 2047 // Actual callback list 2048 2049 list = [], 2050 2051 // Stack of fire calls for repeatable lists 2052 2053 stack = !options.once && [], 2054 2055 // Fire callbacks 2056 2057 fire = function( data ) { 2058 2059 memory = options.memory && data; 2060 2061 fired = true; 2062 2063 firingIndex = firingStart || 0; 2064 2065 firingStart = 0; 2066 2067 firingLength = list.length; 2068 2069 firing = true; 2070 2071 for ( ; list && firingIndex < firingLength; firingIndex++ ) { 2072 2073 if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { 2074 2075 memory = false; // To prevent further calls using add 2076 2077 break; 2078 2079 } 2080 2081 } 2082 2083 firing = false; 2084 2085 if ( list ) { 2086 2087 if ( stack ) { 2088 2089 if ( stack.length ) { 2090 2091 fire( stack.shift() ); 2092 2093 } 2094 2095 } else if ( memory ) { 2096 2097 list = []; 2098 2099 } else { 2100 2101 self.disable(); 2102 2103 } 2104 2105 } 2106 2107 }, 2108 2109 // Actual Callbacks object 2110 2111 self = { 2112 2113 // Add a callback or a collection of callbacks to the list 2114 2115 add: function() { 2116 2117 if ( list ) { 2118 2119 // First, we save the current length 2120 2121 var start = list.length; 2122 2123 (function add( args ) { 2124 2125 jQuery.each( args, function( _, arg ) { 2126 2127 var type = jQuery.type( arg ); 2128 2129 if ( type === "function" ) { 2130 2131 if ( !options.unique || !self.has( arg ) ) { 2132 2133 list.push( arg ); 2134 2135 } 2136 2137 } else if ( arg && arg.length && type !== "string" ) { 2138 2139 // Inspect recursively 2140 2141 add( arg ); 2142 2143 } 2144 2145 }); 2146 2147 })( arguments ); 2148 2149 // Do we need to add the callbacks to the 2150 2151 // current firing batch? 2152 2153 if ( firing ) { 2154 2155 firingLength = list.length; 2156 2157 // With memory, if we're not firing then 2158 2159 // we should call right away 2160 2161 } else if ( memory ) { 2162 2163 firingStart = start; 2164 2165 fire( memory ); 2166 2167 } 2168 2169 } 2170 2171 return this; 2172 2173 }, 2174 2175 // Remove a callback from the list 2176 2177 remove: function() { 2178 2179 if ( list ) { 2180 2181 jQuery.each( arguments, function( _, arg ) { 2182 2183 var index; 2184 2185 while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { 2186 2187 list.splice( index, 1 ); 2188 2189 // Handle firing indexes 2190 2191 if ( firing ) { 2192 2193 if ( index <= firingLength ) { 2194 2195 firingLength--; 2196 2197 } 2198 2199 if ( index <= firingIndex ) { 2200 2201 firingIndex--; 2202 2203 } 2204 2205 } 2206 2207 } 2208 2209 }); 2210 2211 } 2212 2213 return this; 2214 2215 }, 2216 2217 // Check if a given callback is in the list. 2218 2219 // If no argument is given, return whether or not list has callbacks attached. 2220 2221 has: function( fn ) { 2222 2223 return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); 2224 2225 }, 2226 2227 // Remove all callbacks from the list 2228 2229 empty: function() { 2230 2231 list = []; 2232 2233 return this; 2234 2235 }, 2236 2237 // Have the list do nothing anymore 2238 2239 disable: function() { 2240 2241 list = stack = memory = undefined; 2242 2243 return this; 2244 2245 }, 2246 2247 // Is it disabled? 2248 2249 disabled: function() { 2250 2251 return !list; 2252 2253 }, 2254 2255 // Lock the list in its current state 2256 2257 lock: function() { 2258 2259 stack = undefined; 2260 2261 if ( !memory ) { 2262 2263 self.disable(); 2264 2265 } 2266 2267 return this; 2268 2269 }, 2270 2271 // Is it locked? 2272 2273 locked: function() { 2274 2275 return !stack; 2276 2277 }, 2278 2279 // Call all callbacks with the given context and arguments 2280 2281 fireWith: function( context, args ) { 2282 2283 args = args || []; 2284 2285 args = [ context, args.slice ? args.slice() : args ]; 2286 2287 if ( list && ( !fired || stack ) ) { 2288 2289 if ( firing ) { 2290 2291 stack.push( args ); 2292 2293 } else { 2294 2295 fire( args ); 2296 2297 } 2298 2299 } 2300 2301 return this; 2302 2303 }, 2304 2305 // Call all the callbacks with the given arguments 2306 2307 fire: function() { 2308 2309 self.fireWith( this, arguments ); 2310 2311 return this; 2312 2313 }, 2314 2315 // To know if the callbacks have already been called at least once 2316 2317 fired: function() { 2318 2319 return !!fired; 2320 2321 } 2322 2323 }; 2324 2325 2326 2327 return self; 2328 2329}; 2330 2331jQuery.extend({ 2332 2333 2334 2335 Deferred: function( func ) { 2336 2337 var tuples = [ 2338 2339 // action, add listener, listener list, final state 2340 2341 [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], 2342 2343 [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], 2344 2345 [ "notify", "progress", jQuery.Callbacks("memory") ] 2346 2347 ], 2348 2349 state = "pending", 2350 2351 promise = { 2352 2353 state: function() { 2354 2355 return state; 2356 2357 }, 2358 2359 always: function() { 2360 2361 deferred.done( arguments ).fail( arguments ); 2362 2363 return this; 2364 2365 }, 2366 2367 then: function( /* fnDone, fnFail, fnProgress */ ) { 2368 2369 var fns = arguments; 2370 2371 return jQuery.Deferred(function( newDefer ) { 2372 2373 jQuery.each( tuples, function( i, tuple ) { 2374 2375 var action = tuple[ 0 ], 2376 2377 fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; 2378 2379 // deferred[ done | fail | progress ] for forwarding actions to newDefer 2380 2381 deferred[ tuple[1] ](function() { 2382 2383 var returned = fn && fn.apply( this, arguments ); 2384 2385 if ( returned && jQuery.isFunction( returned.promise ) ) { 2386 2387 returned.promise() 2388 2389 .done( newDefer.resolve ) 2390 2391 .fail( newDefer.reject ) 2392 2393 .progress( newDefer.notify ); 2394 2395 } else { 2396 2397 newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); 2398 2399 } 2400 2401 }); 2402 2403 }); 2404 2405 fns = null; 2406 2407 }).promise(); 2408 2409 }, 2410 2411 // Get a promise for this deferred 2412 2413 // If obj is provided, the promise aspect is added to the object 2414 2415 promise: function( obj ) { 2416 2417 return obj != null ? jQuery.extend( obj, promise ) : promise; 2418 2419 } 2420 2421 }, 2422 2423 deferred = {}; 2424 2425 2426 2427 // Keep pipe for back-compat 2428 2429 promise.pipe = promise.then; 2430 2431 2432 2433 // Add list-specific methods 2434 2435 jQuery.each( tuples, function( i, tuple ) { 2436 2437 var list = tuple[ 2 ], 2438 2439 stateString = tuple[ 3 ]; 2440 2441 2442 2443 // promise[ done | fail | progress ] = list.add 2444 2445 promise[ tuple[1] ] = list.add; 2446 2447 2448 2449 // Handle state 2450 2451 if ( stateString ) { 2452 2453 list.add(function() { 2454 2455 // state = [ resolved | rejected ] 2456 2457 state = stateString; 2458 2459 2460 2461 // [ reject_list | resolve_list ].disable; progress_list.lock 2462 2463 }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); 2464 2465 } 2466 2467 2468 2469 // deferred[ resolve | reject | notify ] 2470 2471 deferred[ tuple[0] ] = function() { 2472 2473 deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); 2474 2475 return this; 2476 2477 }; 2478 2479 deferred[ tuple[0] + "With" ] = list.fireWith; 2480 2481 }); 2482 2483 2484 2485 // Make the deferred a promise 2486 2487 promise.promise( deferred ); 2488 2489 2490 2491 // Call given func if any 2492 2493 if ( func ) { 2494 2495 func.call( deferred, deferred ); 2496 2497 } 2498 2499 2500 2501 // All done! 2502 2503 return deferred; 2504 2505 }, 2506 2507 2508 2509 // Deferred helper 2510 2511 when: function( subordinate /* , ..., subordinateN */ ) { 2512 2513 var i = 0, 2514 2515 resolveValues = core_slice.call( arguments ), 2516 2517 length = resolveValues.length, 2518 2519 2520 2521 // the count of uncompleted subordinates 2522 2523 remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, 2524 2525 2526 2527 // the master Deferred. If resolveValues consist of only a single Deferred, just use that. 2528 2529 deferred = remaining === 1 ? subordinate : jQuery.Deferred(), 2530 2531 2532 2533 // Update function for both resolve and progress values 2534 2535 updateFunc = function( i, contexts, values ) { 2536 2537 return function( value ) { 2538 2539 contexts[ i ] = this; 2540 2541 values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; 2542 2543 if( values === progressValues ) { 2544 2545 deferred.notifyWith( contexts, values ); 2546 2547 } else if ( !( --remaining ) ) { 2548 2549 deferred.resolveWith( contexts, values ); 2550 2551 } 2552 2553 }; 2554 2555 }, 2556 2557 2558 2559 progressValues, progressContexts, resolveContexts; 2560 2561 2562 2563 // add listeners to Deferred subordinates; treat others as resolved 2564 2565 if ( length > 1 ) { 2566 2567 progressValues = new Array( length ); 2568 2569 progressContexts = new Array( length ); 2570 2571 resolveContexts = new Array( length ); 2572 2573 for ( ; i < length; i++ ) { 2574 2575 if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { 2576 2577 resolveValues[ i ].promise() 2578 2579 .done( updateFunc( i, resolveContexts, resolveValues ) ) 2580 2581 .fail( deferred.reject ) 2582 2583 .progress( updateFunc( i, progressContexts, progressValues ) ); 2584 2585 } else { 2586 2587 --remaining; 2588 2589 } 2590 2591 } 2592 2593 } 2594 2595 2596 2597 // if we're not waiting on anything, resolve the master 2598 2599 if ( !remaining ) { 2600
2601 deferred.resolveWith( resolveContexts, resolveValues ); 2602 2603 } 2604 2605 2606 2607 return deferred.promise(); 2608 2609 } 2610 2611}); 2612 2613jQuery.support = (function() { 2614 2615 2616 2617 var support, all, a, 2618 2619 input, select, fragment, 2620 2621 opt, eventName, isSupported, i, 2622 2623 div = document.createElement("div"); 2624 2625 2626 2627 // Setup 2628 2629 div.setAttribute( "className", "t" ); 2630 2631 div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; 2632 2633 2634 2635 // Support tests won't run in some limited or non-browser environments 2636 2637 all = div.getElementsByTagName("*"); 2638 2639 a = div.getElementsByTagName("a")[ 0 ]; 2640 2641 if ( !all || !a || !all.length ) { 2642 2643 return {}; 2644 2645 } 2646 2647 2648 2649 // First batch of tests 2650 2651 select = document.createElement("select"); 2652 2653 opt = select.appendChild( document.createElement("option") ); 2654 2655 input = div.getElementsByTagName("input")[ 0 ]; 2656 2657 2658 2659 a.style.cssText = "top:1px;float:left;opacity:.5"; 2660 2661 support = { 2662 2663 // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) 2664 2665 getSetAttribute: div.className !== "t", 2666 2667 2668 2669 // IE strips leading whitespace when .innerHTML is used 2670 2671 leadingWhitespace: div.firstChild.nodeType === 3, 2672 2673 2674 2675 // Make sure that tbody elements aren't automatically inserted 2676 2677 // IE will insert them into empty tables 2678 2679 tbody: !div.getElementsByTagName("tbody").length, 2680 2681 2682 2683 // Make sure that link elements get serialized correctly by innerHTML 2684 2685 // This requires a wrapper element in IE 2686 2687 htmlSerialize: !!div.getElementsByTagName("link").length, 2688 2689 2690 2691 // Get the style information from getAttribute 2692 2693 // (IE uses .cssText instead) 2694 2695 style: /top/.test( a.getAttribute("style") ), 2696 2697 2698 2699 // Make sure that URLs aren't manipulated 2700 2701 // (IE normalizes it by default) 2702 2703 hrefNormalized: a.getAttribute("href") === "/a", 2704 2705 2706 2707 // Make sure that element opacity exists 2708 2709 // (IE uses filter instead) 2710 2711 // Use a regex to work around a WebKit issue. See #5145 2712 2713 opacity: /^0.5/.test( a.style.opacity ), 2714 2715 2716 2717 // Verify style float existence 2718 2719 // (IE uses styleFloat instead of cssFloat) 2720 2721 cssFloat: !!a.style.cssFloat, 2722 2723 2724 2725 // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) 2726 2727 checkOn: !!input.value, 2728 2729 2730 2731 // Make sure that a selected-by-default option has a working selected property. 2732 2733 // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) 2734 2735 optSelected: opt.selected, 2736 2737 2738 2739 // Tests for enctype support on a form (#6743) 2740 2741 enctype: !!document.createElement("form").enctype, 2742 2743 2744 2745 // Makes sure cloning an html5 element does not cause problems 2746 2747 // Where outerHTML is undefined, this still works 2748 2749 html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>", 2750 2751 2752 2753 // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode 2754 2755 boxModel: document.compatMode === "CSS1Compat", 2756 2757 2758 2759 // Will be defined later 2760 2761 deleteExpando: true, 2762 2763 noCloneEvent: true, 2764 2765 inlineBlockNeedsLayout: false, 2766 2767 shrinkWrapBlocks: false, 2768 2769 reliableMarginRight: true, 2770 2771 boxSizingReliable: true, 2772 2773 pixelPosition: false 2774 2775 }; 2776 2777 2778 2779 // Make sure checked status is properly cloned 2780 2781 input.checked = true; 2782 2783 support.noCloneChecked = input.cloneNode( true ).checked; 2784 2785 2786 2787 // Make sure that the options inside disabled selects aren't marked as disabled 2788 2789 // (WebKit marks them as disabled) 2790 2791 select.disabled = true; 2792 2793 support.optDisabled = !opt.disabled; 2794 2795 2796 2797 // Support: IE<9 2798 2799 try { 2800 2801 delete div.test; 2802 2803 } catch( e ) { 2804 2805 support.deleteExpando = false; 2806 2807 } 2808 2809 2810 2811 // Check if we can trust getAttribute("value") 2812 2813 input = document.createElement("input"); 2814 2815 input.setAttribute( "value", "" ); 2816 2817 support.input = input.getAttribute( "value" ) === ""; 2818 2819 2820 2821 // Check if an input maintains its value after becoming a radio 2822 2823 input.value = "t"; 2824 2825 input.setAttribute( "type", "radio" ); 2826 2827 support.radioValue = input.value === "t"; 2828 2829 2830 2831 // #11217 - WebKit loses check when the name is after the checked attribute 2832 2833 input.setAttribute( "checked", "t" ); 2834 2835 input.setAttribute( "name", "t" ); 2836 2837 2838 2839 fragment = document.createDocumentFragment(); 2840 2841 fragment.appendChild( input ); 2842 2843 2844 2845 // Check if a disconnected checkbox will retain its checked 2846 2847 // value of true after appended to the DOM (IE6/7) 2848 2849 support.appendChecked = input.checked; 2850 2851 2852 2853 // WebKit doesn't clone checked state correctly in fragments 2854 2855 support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; 2856 2857 2858 2859 // Support: IE<9 2860 2861 // Opera does not clone events (and typeof div.attachEvent === undefined). 2862 2863 // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() 2864 2865 if ( div.attachEvent ) { 2866 2867 div.attachEvent( "onclick", function() { 2868 2869 support.noCloneEvent = false;
2870 2871 }); 2872 2873 2874 2875 div.cloneNode( true ).click(); 2876 2877 } 2878 2879 2880 2881 // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event) 2882 2883 // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php 2884 2885 for ( i in { submit: true, change: true, focusin: true }) { 2886 2887 div.setAttribute( eventName = "on" + i, "t" ); 2888 2889 2890 2891 support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false; 2892 2893 } 2894 2895 2896 2897 div.style.backgroundClip = "content-box"; 2898 2899 div.cloneNode( true ).style.backgroundClip = ""; 2900 2901 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 2902 2903 2904 2905 // Run tests that need a body at doc ready 2906 2907 jQuery(function() { 2908 2909 var container, marginDiv, tds, 2910 2911 divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", 2912 2913 body = document.getElementsByTagName("body")[0]; 2914 2915 2916 2917 if ( !body ) { 2918 2919 // Return for frameset docs that don't have a body 2920 2921 return; 2922 2923 } 2924 2925 2926 2927 container = document.createElement("div"); 2928 2929 container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; 2930 2931 2932 2933 body.appendChild( container ).appendChild( div ); 2934 2935 2936 2937 // Support: IE8 2938 2939 // Check if table cells still have offsetWidth/Height when they are set 2940 2941 // to display:none and there are still other visible table cells in a 2942 2943 // table row; if so, offsetWidth/Height are not reliable for use when 2944 2945 // determining if an element has been hidden directly using 2946 2947 // display:none (it is still safe to use offsets if a parent element is 2948 2949 // hidden; don safety goggles and see bug #4512 for more information). 2950 2951 div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; 2952 2953 tds = div.getElementsByTagName("td"); 2954 2955 tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; 2956 2957 isSupported = ( tds[ 0 ].offsetHeight === 0 ); 2958 2959 2960 2961 tds[ 0 ].style.display = ""; 2962 2963 tds[ 1 ].style.display = "none"; 2964 2965 2966 2967 // Support: IE8 2968 2969 // Check if empty table cells still have offsetWidth/Height 2970 2971 support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); 2972 2973 2974 2975 // Check box-sizing and margin behavior 2976 2977 div.innerHTML = ""; 2978 2979 div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; 2980 2981 support.boxSizing = ( div.offsetWidth === 4 ); 2982 2983 support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 ); 2984 2985 2986 2987 // Use window.getComputedStyle because jsdom on node.js will break without it. 2988 2989 if ( window.getComputedStyle ) { 2990 2991 support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; 2992 2993 support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; 2994 2995 2996 2997 // Check if div with explicit width and no margin-right incorrectly 2998 2999 // gets computed margin-right based on width of container. (#3333) 3000 3001 // Fails in WebKit before Feb 2011 nightlies 3002 3003 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right 3004 3005 marginDiv = div.appendChild( document.createElement("div") ); 3006 3007 marginDiv.style.cssText = div.style.cssText = divReset; 3008 3009 marginDiv.style.marginRight = marginDiv.style.width = "0"; 3010 3011 div.style.width = "1px"; 3012 3013 3014 3015 support.reliableMarginRight = 3016 3017 !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); 3018 3019 } 3020 3021 3022 3023 if ( typeof div.style.zoom !== core_strundefined ) { 3024 3025 // Support: IE<8 3026 3027 // Check if natively block-level elements act like inline-block 3028 3029 // elements when setting their display to 'inline' and giving 3030 3031 // them layout 3032 3033 div.innerHTML = ""; 3034 3035 div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; 3036 3037 support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); 3038 3039 3040 3041 // Support: IE6 3042 3043 // Check if elements with layout shrink-wrap their children 3044 3045 div.style.display = "block"; 3046 3047 div.innerHTML = "<div></div>"; 3048 3049 div.firstChild.style.width = "5px"; 3050 3051 support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); 3052 3053 3054 3055 if ( support.inlineBlockNeedsLayout ) { 3056 3057 // Prevent IE 6 from affecting layout for positioned elements #11048 3058 3059 // Prevent IE from shrinking the body in IE 7 mode #12869 3060
vendor: 9,460 bytes, lines 3061-3763
3061 // Support: IE<8 3062 3063 body.style.zoom = 1; 3064 3065 } 3066 3067 } 3068 3069 3070 3071 body.removeChild( container ); 3072 3073 3074 3075 // Null elements to avoid leaks in IE 3076 3077 container = div = tds = marginDiv = null; 3078 3079 }); 3080 3081 3082 3083 // Null elements to avoid leaks in IE 3084 3085 all = select = fragment = opt = a = input = null; 3086 3087 3088 3089 return support; 3090 3091})(); 3092 3093 3094 3095var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, 3096 3097 rmultiDash = /([A-Z])/g; 3098 3099 3100 3101function internalData( elem, name, data, pvt /* Internal Use Only */ ){ 3102 3103 if ( !jQuery.acceptData( elem ) ) { 3104 3105 return; 3106 3107 } 3108 3109 3110 3111 var thisCache, ret, 3112 3113 internalKey = jQuery.expando, 3114 3115 getByName = typeof name === "string", 3116 3117 3118 3119 // We have to handle DOM nodes and JS objects differently because IE6-7 3120 3121 // can't GC object references properly across the DOM-JS boundary 3122 3123 isNode = elem.nodeType, 3124 3125 3126 3127 // Only DOM nodes need the global jQuery cache; JS object data is 3128 3129 // attached directly to the object so GC can occur automatically 3130 3131 cache = isNode ? jQuery.cache : elem, 3132 3133 3134 3135 // Only defining an ID for JS objects if its cache already exists allows 3136 3137 // the code to shortcut on the same path as a DOM node with no cache 3138 3139 id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; 3140 3141 3142 3143 // Avoid doing any more work than we need to when trying to get data on an 3144 3145 // object that has no data at all 3146 3147 if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) { 3148 3149 return; 3150 3151 } 3152 3153 3154 3155 if ( !id ) { 3156 3157 // Only DOM nodes need a new unique ID for each element since their data 3158 3159 // ends up in the global cache 3160 3161 if ( isNode ) { 3162 3163 elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++; 3164 3165 } else { 3166 3167 id = internalKey; 3168 3169 } 3170 3171 } 3172 3173 3174 3175 if ( !cache[ id ] ) { 3176 3177 cache[ id ] = {}; 3178 3179 3180 3181 // Avoids exposing jQuery metadata on plain JS objects when the object 3182 3183 // is serialized using JSON.stringify 3184 3185 if ( !isNode ) { 3186 3187 cache[ id ].toJSON = jQuery.noop; 3188 3189 } 3190 3191 } 3192 3193 3194 3195 // An object can be passed to jQuery.data instead of a key/value pair; this gets 3196 3197 // shallow copied over onto the existing cache 3198 3199 if ( typeof name === "object" || typeof name === "function" ) { 3200 3201 if ( pvt ) { 3202 3203 cache[ id ] = jQuery.extend( cache[ id ], name ); 3204 3205 } else { 3206 3207 cache[ id ].data = jQuery.extend( cache[ id ].data, name ); 3208 3209 } 3210 3211 } 3212 3213 3214 3215 thisCache = cache[ id ]; 3216 3217 3218 3219 // jQuery data() is stored in a separate object inside the object's internal data 3220 3221 // cache in order to avoid key collisions between internal data and user-defined 3222 3223 // data. 3224 3225 if ( !pvt ) { 3226 3227 if ( !thisCache.data ) { 3228 3229 thisCache.data = {}; 3230 3231 } 3232 3233 3234 3235 thisCache = thisCache.data; 3236 3237 } 3238 3239 3240 3241 if ( data !== undefined ) { 3242 3243 thisCache[ jQuery.camelCase( name ) ] = data; 3244 3245 } 3246 3247 3248 3249 // Check for both converted-to-camel and non-converted data property names 3250 3251 // If a data property was specified 3252 3253 if ( getByName ) { 3254 3255 3256 3257 // First Try to find as-is property data 3258 3259 ret = thisCache[ name ]; 3260 3261 3262 3263 // Test for null|undefined property data 3264 3265 if ( ret == null ) { 3266 3267 3268 3269 // Try to find the camelCased property 3270 3271 ret = thisCache[ jQuery.camelCase( name ) ]; 3272 3273 } 3274 3275 } else { 3276 3277 ret = thisCache; 3278 3279 } 3280 3281 3282 3283 return ret; 3284 3285} 3286 3287 3288 3289function internalRemoveData( elem, name, pvt ) { 3290 3291 if ( !jQuery.acceptData( elem ) ) { 3292 3293 return; 3294 3295 } 3296 3297 3298 3299 var i, l, thisCache, 3300 3301 isNode = elem.nodeType, 3302 3303 3304 3305 // See jQuery.data for more information 3306 3307 cache = isNode ? jQuery.cache : elem, 3308 3309 id = isNode ? elem[ jQuery.expando ] : jQuery.expando; 3310 3311 3312 3313 // If there is already no cache entry for this object, there is no 3314 3315 // purpose in continuing 3316 3317 if ( !cache[ id ] ) { 3318 3319 return; 3320 3321 } 3322 3323 3324 3325 if ( name ) { 3326 3327 3328 3329 thisCache = pvt ? cache[ id ] : cache[ id ].data; 3330 3331 3332 3333 if ( thisCache ) { 3334 3335 3336 3337 // Support array or space separated string names for data keys 3338 3339 if ( !jQuery.isArray( name ) ) { 3340 3341 3342 3343 // try the string as a key before any manipulation 3344 3345 if ( name in thisCache ) { 3346 3347 name = [ name ]; 3348 3349 } else { 3350 3351 3352 3353 // split the camel cased version by spaces unless a key with the spaces exists 3354 3355 name = jQuery.camelCase( name ); 3356 3357 if ( name in thisCache ) { 3358 3359 name = [ name ]; 3360 3361 } else { 3362 3363 name = name.split(" "); 3364 3365 } 3366 3367 } 3368 3369 } else { 3370 3371 // If "name" is an array of keys... 3372 3373 // When data is initially created, via ("key", "val") signature, 3374 3375 // keys will be converted to camelCase. 3376 3377 // Since there is no way to tell _how_ a key was added, remove 3378 3379 // both plain key and camelCase key. #12786 3380 3381 // This will only penalize the array argument path. 3382 3383 name = name.concat( jQuery.map( name, jQuery.camelCase ) ); 3384 3385 } 3386 3387 3388 3389 for ( i = 0, l = name.length; i < l; i++ ) { 3390 3391 delete thisCache[ name[i] ]; 3392 3393 } 3394 3395 3396 3397 // If there is no data left in the cache, we want to continue 3398 3399 // and let the cache object itself get destroyed 3400 3401 if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) { 3402 3403 return; 3404 3405 } 3406 3407 } 3408 3409 } 3410 3411 3412 3413 // See jQuery.data for more information 3414 3415 if ( !pvt ) { 3416 3417 delete cache[ id ].data; 3418 3419 3420 3421 // Don't destroy the parent cache unless the internal data object 3422 3423 // had been the only thing left in it 3424 3425 if ( !isEmptyDataObject( cache[ id ] ) ) { 3426 3427 return; 3428 3429 } 3430 3431 } 3432 3433 3434 3435 // Destroy the cache 3436 3437 if ( isNode ) { 3438 3439 jQuery.cleanData( [ elem ], true ); 3440 3441 3442 3443 // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) 3444 3445 } else if ( jQuery.support.deleteExpando || cache != cache.window ) { 3446 3447 delete cache[ id ]; 3448 3449 3450 3451 // When all else fails, null 3452 3453 } else { 3454 3455 cache[ id ] = null; 3456 3457 } 3458 3459} 3460 3461 3462 3463jQuery.extend({ 3464 3465 cache: {}, 3466 3467 3468 3469 // Unique for each copy of jQuery on the page 3470 3471 // Non-digits removed to match rinlinejQuery 3472 3473 expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ), 3474 3475 3476 3477 // The following elements throw uncatchable exceptions if you 3478 3479 // attempt to add expando properties to them. 3480 3481 noData: { 3482 3483 "embed": true, 3484 3485 // Ban all objects except for Flash (which handle expandos) 3486 3487 "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", 3488 3489 "applet": true 3490 3491 }, 3492 3493 3494 3495 hasData: function( elem ) { 3496 3497 elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; 3498 3499 return !!elem && !isEmptyDataObject( elem ); 3500 3501 }, 3502 3503 3504 3505 data: function( elem, name, data ) { 3506 3507 return internalData( elem, name, data ); 3508 3509 }, 3510 3511 3512 3513 removeData: function( elem, name ) { 3514 3515 return internalRemoveData( elem, name ); 3516 3517 }, 3518 3519 3520 3521 // For internal use only. 3522 3523 _data: function( elem, name, data ) { 3524 3525 return internalData( elem, name, data, true ); 3526 3527 }, 3528 3529 3530 3531 _removeData: function( elem, name ) { 3532 3533 return internalRemoveData( elem, name, true ); 3534 3535 }, 3536 3537 3538 3539 // A method for determining if a DOM node can handle the data expando 3540 3541 acceptData: function( elem ) { 3542 3543 // Do not set data on non-element because it will not be cleared (#8335). 3544 3545 if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) { 3546 3547 return false; 3548 3549 } 3550 3551 3552 3553 var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; 3554 3555 3556 3557 // nodes accept data unless otherwise specified; rejection can be conditional 3558 3559 return !noData || noData !== true && elem.getAttribute("classid") === noData; 3560 3561 } 3562 3563}); 3564 3565 3566 3567jQuery.fn.extend({ 3568 3569 data: function( key, value ) { 3570 3571 var attrs, name, 3572 3573 elem = this[0], 3574 3575 i = 0, 3576 3577 data = null; 3578 3579 3580 3581 // Gets all values 3582 3583 if ( key === undefined ) { 3584 3585 if ( this.length ) { 3586 3587 data = jQuery.data( elem ); 3588 3589 3590 3591 if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { 3592 3593 attrs = elem.attributes; 3594 3595 for ( ; i < attrs.length; i++ ) { 3596 3597 name = attrs[i].name; 3598 3599 3600 3601 if ( !name.indexOf( "data-" ) ) { 3602 3603 name = jQuery.camelCase( name.slice(5) ); 3604 3605 3606 3607 dataAttr( elem, name, data[ name ] ); 3608 3609 } 3610 3611 } 3612 3613 jQuery._data( elem, "parsedAttrs", true ); 3614 3615 } 3616 3617 } 3618 3619 3620 3621 return data; 3622 3623 } 3624 3625 3626 3627 // Sets multiple values 3628 3629 if ( typeof key === "object" ) { 3630 3631 return this.each(function() { 3632 3633 jQuery.data( this, key ); 3634 3635 }); 3636 3637 } 3638 3639 3640 3641 return jQuery.access( this, function( value ) { 3642 3643 3644 3645 if ( value === undefined ) { 3646 3647 // Try to fetch any internally stored data first 3648 3649 return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null; 3650 3651 } 3652 3653 3654 3655 this.each(function() { 3656 3657 jQuery.data( this, key, value ); 3658 3659 }); 3660 3661 }, null, value, arguments.length > 1, null, true ); 3662 3663 }, 3664 3665 3666 3667 removeData: function( key ) { 3668 3669 return this.each(function() { 3670 3671 jQuery.removeData( this, key ); 3672 3673 }); 3674 3675 } 3676 3677}); 3678 3679 3680 3681function dataAttr( elem, key, data ) { 3682 3683 // If nothing was found internally, try to fetch any 3684 3685 // data from the HTML5 data-* attribute 3686 3687 if ( data === undefined && elem.nodeType === 1 ) { 3688 3689 3690 3691 var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); 3692 3693 3694 3695 data = elem.getAttribute( name ); 3696 3697 3698 3699 if ( typeof data === "string" ) { 3700 3701 try { 3702 3703 data = data === "true" ? true : 3704 3705 data === "false" ? false : 3706 3707 data === "null" ? null : 3708 3709 // Only convert to a number if it doesn't change the string 3710 3711 +data + "" === data ? +data : 3712 3713 rbrace.test( data ) ? jQuery.parseJSON( data ) : 3714 3715 data; 3716 3717 } catch( e ) {} 3718 3719 3720 3721 // Make sure we set the data so it isn't changed later 3722 3723 jQuery.data( elem, key, data ); 3724 3725 3726 3727 } else { 3728 3729 data = undefined; 3730 3731 } 3732 3733 } 3734 3735 3736 3737 return data; 3738 3739} 3740 3741 3742 3743// checks a cache object for emptiness 3744 3745function isEmptyDataObject( obj ) { 3746 3747 var name; 3748 3749 for ( name in obj ) { 3750 3751 3752 3753 // if the public data object is empty, the private is still empty 3754 3755 if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { 3756 3757 continue; 3758 3759 } 3760 3761 if ( name !== "toJSON" ) { 3762 3763 return false;
vendor: 6,377 bytes, lines 3764-4268
3764 3765 } 3766 3767 } 3768 3769 3770 3771 return true; 3772 3773} 3774 3775jQuery.extend({ 3776 3777 queue: function( elem, type, data ) { 3778 3779 var queue; 3780 3781 3782 3783 if ( elem ) { 3784 3785 type = ( type || "fx" ) + "queue"; 3786 3787 queue = jQuery._data( elem, type ); 3788 3789 3790 3791 // Speed up dequeue by getting out quickly if this is just a lookup 3792 3793 if ( data ) { 3794 3795 if ( !queue || jQuery.isArray(data) ) { 3796 3797 queue = jQuery._data( elem, type, jQuery.makeArray(data) ); 3798 3799 } else { 3800 3801 queue.push( data ); 3802 3803 } 3804 3805 } 3806 3807 return queue || []; 3808 3809 } 3810 3811 }, 3812 3813 3814 3815 dequeue: function( elem, type ) { 3816 3817 type = type || "fx"; 3818 3819 3820 3821 var queue = jQuery.queue( elem, type ), 3822 3823 startLength = queue.length, 3824 3825 fn = queue.shift(), 3826 3827 hooks = jQuery._queueHooks( elem, type ), 3828 3829 next = function() { 3830 3831 jQuery.dequeue( elem, type ); 3832 3833 }; 3834 3835 3836 3837 // If the fx queue is dequeued, always remove the progress sentinel 3838 3839 if ( fn === "inprogress" ) { 3840 3841 fn = queue.shift(); 3842 3843 startLength--; 3844 3845 } 3846 3847 3848 3849 hooks.cur = fn; 3850 3851 if ( fn ) { 3852 3853 3854 3855 // Add a progress sentinel to prevent the fx queue from being 3856 3857 // automatically dequeued 3858 3859 if ( type === "fx" ) { 3860 3861 queue.unshift( "inprogress" ); 3862 3863 } 3864 3865 3866 3867 // clear up the last queue stop function 3868 3869 delete hooks.stop; 3870 3871 fn.call( elem, next, hooks ); 3872 3873 } 3874 3875 3876 3877 if ( !startLength && hooks ) { 3878 3879 hooks.empty.fire(); 3880 3881 } 3882 3883 }, 3884 3885 3886 3887 // not intended for public consumption - generates a queueHooks object, or returns the current one 3888 3889 _queueHooks: function( elem, type ) { 3890 3891 var key = type + "queueHooks"; 3892 3893 return jQuery._data( elem, key ) || jQuery._data( elem, key, { 3894 3895 empty: jQuery.Callbacks("once memory").add(function() { 3896 3897 jQuery._removeData( elem, type + "queue" ); 3898 3899 jQuery._removeData( elem, key ); 3900 3901 }) 3902 3903 }); 3904 3905 } 3906 3907}); 3908 3909 3910 3911jQuery.fn.extend({ 3912 3913 queue: function( type, data ) { 3914 3915 var setter = 2; 3916 3917 3918 3919 if ( typeof type !== "string" ) { 3920 3921 data = type; 3922 3923 type = "fx"; 3924 3925 setter--; 3926 3927 } 3928 3929 3930 3931 if ( arguments.length < setter ) { 3932 3933 return jQuery.queue( this[0], type ); 3934 3935 } 3936 3937 3938 3939 return data === undefined ? 3940 3941 this : 3942 3943 this.each(function() { 3944 3945 var queue = jQuery.queue( this, type, data ); 3946 3947 3948 3949 // ensure a hooks for this queue 3950 3951 jQuery._queueHooks( this, type ); 3952 3953 3954 3955 if ( type === "fx" && queue[0] !== "inprogress" ) { 3956 3957 jQuery.dequeue( this, type ); 3958 3959 } 3960 3961 }); 3962 3963 }, 3964 3965 dequeue: function( type ) { 3966 3967 return this.each(function() { 3968 3969 jQuery.dequeue( this, type ); 3970 3971 }); 3972 3973 }, 3974 3975 // Based off of the plugin by Clint Helfers, with permission. 3976 3977 // http://blindsignals.com/index.php/2009/07/jquery-delay/ 3978 3979 delay: function( time, type ) { 3980 3981 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 3982 3983 type = type || "fx"; 3984 3985 3986 3987 return this.queue( type, function( next, hooks ) { 3988 3989 var timeout = setTimeout( next, time ); 3990 3991 hooks.stop = function() { 3992 3993 clearTimeout( timeout ); 3994 3995 }; 3996 3997 }); 3998 3999 }, 4000 4001 clearQueue: function( type ) { 4002 4003 return this.queue( type || "fx", [] ); 4004 4005 }, 4006 4007 // Get a promise resolved when queues of a certain type 4008 4009 // are emptied (fx is the type by default) 4010 4011 promise: function( type, obj ) { 4012 4013 var tmp, 4014 4015 count = 1, 4016 4017 defer = jQuery.Deferred(), 4018 4019 elements = this, 4020 4021 i = this.length, 4022 4023 resolve = function() { 4024 4025 if ( !( --count ) ) { 4026 4027 defer.resolveWith( elements, [ elements ] ); 4028 4029 } 4030 4031 }; 4032 4033 4034 4035 if ( typeof type !== "string" ) { 4036 4037 obj = type; 4038 4039 type = undefined; 4040 4041 } 4042 4043 type = type || "fx"; 4044 4045 4046 4047 while( i-- ) { 4048 4049 tmp = jQuery._data( elements[ i ], type + "queueHooks" ); 4050 4051 if ( tmp && tmp.empty ) { 4052 4053 count++; 4054 4055 tmp.empty.add( resolve ); 4056 4057 } 4058 4059 } 4060 4061 resolve(); 4062 4063 return defer.promise( obj ); 4064 4065 } 4066 4067}); 4068 4069var nodeHook, boolHook, 4070 4071 rclass = /[\t\r\n]/g, 4072 4073 rreturn = /\r/g, 4074 4075 rfocusable = /^(?:input|select|textarea|button|object)$/i, 4076 4077 rclickable = /^(?:a|area)$/i, 4078 4079 rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i, 4080 4081 ruseDefault = /^(?:checked|selected)$/i, 4082 4083 getSetAttribute = jQuery.support.getSetAttribute, 4084 4085 getSetInput = jQuery.support.input; 4086 4087 4088 4089jQuery.fn.extend({ 4090 4091 attr: function( name, value ) { 4092 4093 return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); 4094 4095 }, 4096 4097 4098 4099 removeAttr: function( name ) { 4100 4101 return this.each(function() { 4102 4103 jQuery.removeAttr( this, name ); 4104 4105 }); 4106 4107 }, 4108 4109 4110 4111 prop: function( name, value ) { 4112 4113 return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); 4114 4115 }, 4116 4117 4118 4119 removeProp: function( name ) { 4120 4121 name = jQuery.propFix[ name ] || name; 4122 4123 return this.each(function() { 4124 4125 // try/catch handles cases where IE balks (such as removing a property on window) 4126 4127 try { 4128 4129 this[ name ] = undefined; 4130 4131 delete this[ name ]; 4132 4133 } catch( e ) {} 4134 4135 }); 4136 4137 }, 4138 4139 4140 4141 addClass: function( value ) { 4142 4143 var classes, elem, cur, clazz, j, 4144 4145 i = 0, 4146 4147 len = this.length, 4148 4149 proceed = typeof value === "string" && value; 4150 4151 4152 4153 if ( jQuery.isFunction( value ) ) { 4154 4155 return this.each(function( j ) { 4156 4157 jQuery( this ).addClass( value.call( this, j, this.className ) ); 4158 4159 }); 4160 4161 } 4162 4163 4164 4165 if ( proceed ) { 4166 4167 // The disjunction here is for better compressibility (see removeClass) 4168 4169 classes = ( value || "" ).match( core_rnotwhite ) || []; 4170 4171 4172 4173 for ( ; i < len; i++ ) { 4174 4175 elem = this[ i ]; 4176 4177 cur = elem.nodeType === 1 && ( elem.className ? 4178 4179 ( " " + elem.className + " " ).replace( rclass, " " ) : 4180 4181 " " 4182 4183 ); 4184 4185 4186 4187 if ( cur ) { 4188 4189 j = 0; 4190 4191 while ( (clazz = classes[j++]) ) { 4192 4193 if ( cur.indexOf( " " + clazz + " " ) < 0 ) { 4194 4195 cur += clazz + " "; 4196 4197 } 4198 4199 } 4200 4201 elem.className = jQuery.trim( cur ); 4202 4203 4204 4205 } 4206 4207 } 4208 4209 } 4210 4211 4212 4213 return this; 4214 4215 }, 4216 4217 4218 4219 removeClass: function( value ) { 4220 4221 var classes, elem, cur, clazz, j, 4222 4223 i = 0, 4224 4225 len = this.length, 4226 4227 proceed = arguments.length === 0 || typeof value === "string" && value; 4228 4229 4230 4231 if ( jQuery.isFunction( value ) ) { 4232 4233 return this.each(function( j ) { 4234 4235 jQuery( this ).removeClass( value.call( this, j, this.className ) ); 4236 4237 }); 4238 4239 } 4240 4241 if ( proceed ) { 4242 4243 classes = ( value || "" ).match( core_rnotwhite ) || []; 4244 4245 4246 4247 for ( ; i < len; i++ ) { 4248 4249 elem = this[ i ]; 4250 4251 // This expression is here for better compressibility (see addClass) 4252 4253 cur = elem.nodeType === 1 && ( elem.className ? 4254 4255 ( " " + elem.className + " " ).replace( rclass, " " ) : 4256 4257 "" 4258 4259 ); 4260 4261 4262 4263 if ( cur ) { 4264 4265 j = 0; 4266 4267 while ( (clazz = classes[j++]) ) { 4268
vendor: 6,405 bytes, lines 4269-4734
4269 // Remove *all* instances 4270 4271 while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { 4272 4273 cur = cur.replace( " " + clazz + " ", " " ); 4274 4275 } 4276 4277 } 4278 4279 elem.className = value ? jQuery.trim( cur ) : ""; 4280 4281 } 4282 4283 } 4284 4285 } 4286 4287 4288 4289 return this; 4290 4291 }, 4292 4293 4294 4295 toggleClass: function( value, stateVal ) { 4296 4297 var type = typeof value, 4298 4299 isBool = typeof stateVal === "boolean"; 4300 4301 4302 4303 if ( jQuery.isFunction( value ) ) { 4304 4305 return this.each(function( i ) { 4306 4307 jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); 4308 4309 }); 4310 4311 } 4312 4313 4314 4315 return this.each(function() { 4316 4317 if ( type === "string" ) { 4318 4319 // toggle individual class names 4320 4321 var className, 4322 4323 i = 0, 4324 4325 self = jQuery( this ), 4326 4327 state = stateVal, 4328 4329 classNames = value.match( core_rnotwhite ) || []; 4330 4331 4332 4333 while ( (className = classNames[ i++ ]) ) { 4334 4335 // check each className given, space separated list 4336 4337 state = isBool ? state : !self.hasClass( className ); 4338 4339 self[ state ? "addClass" : "removeClass" ]( className ); 4340 4341 } 4342 4343 4344 4345 // Toggle whole class name 4346 4347 } else if ( type === core_strundefined || type === "boolean" ) { 4348 4349 if ( this.className ) { 4350 4351 // store className if set 4352 4353 jQuery._data( this, "__className__", this.className ); 4354 4355 } 4356 4357 4358 4359 // If the element has a class name or if we're passed "false", 4360 4361 // then remove the whole classname (if there was one, the above saved it). 4362 4363 // Otherwise bring back whatever was previously saved (if anything), 4364 4365 // falling back to the empty string if nothing was stored. 4366 4367 this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; 4368 4369 } 4370 4371 }); 4372 4373 }, 4374 4375 4376 4377 hasClass: function( selector ) { 4378 4379 var className = " " + selector + " ", 4380 4381 i = 0, 4382 4383 l = this.length; 4384 4385 for ( ; i < l; i++ ) { 4386 4387 if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { 4388 4389 return true; 4390 4391 } 4392 4393 } 4394 4395 4396 4397 return false; 4398 4399 }, 4400 4401 4402 4403 val: function( value ) { 4404 4405 var ret, hooks, isFunction, 4406 4407 elem = this[0]; 4408 4409 4410 4411 if ( !arguments.length ) { 4412 4413 if ( elem ) { 4414 4415 hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; 4416 4417 4418 4419 if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { 4420 4421 return ret; 4422 4423 } 4424 4425 4426 4427 ret = elem.value; 4428 4429 4430 4431 return typeof ret === "string" ? 4432 4433 // handle most common string cases 4434 4435 ret.replace(rreturn, "") : 4436 4437 // handle cases where value is null/undef or number 4438 4439 ret == null ? "" : ret; 4440 4441 } 4442 4443 4444 4445 return; 4446 4447 } 4448 4449 4450 4451 isFunction = jQuery.isFunction( value ); 4452 4453 4454 4455 return this.each(function( i ) { 4456 4457 var val, 4458 4459 self = jQuery(this); 4460 4461 4462 4463 if ( this.nodeType !== 1 ) { 4464 4465 return; 4466 4467 } 4468 4469 4470 4471 if ( isFunction ) { 4472 4473 val = value.call( this, i, self.val() ); 4474 4475 } else { 4476 4477 val = value; 4478 4479 } 4480 4481 4482 4483 // Treat null/undefined as ""; convert numbers to string 4484 4485 if ( val == null ) { 4486 4487 val = ""; 4488 4489 } else if ( typeof val === "number" ) { 4490 4491 val += ""; 4492 4493 } else if ( jQuery.isArray( val ) ) { 4494 4495 val = jQuery.map(val, function ( value ) { 4496 4497 return value == null ? "" : value + ""; 4498 4499 }); 4500 4501 } 4502 4503 4504 4505 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; 4506 4507 4508 4509 // If set returns undefined, fall back to normal setting 4510 4511 if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { 4512 4513 this.value = val; 4514 4515 } 4516 4517 }); 4518 4519 } 4520 4521}); 4522 4523 4524 4525jQuery.extend({ 4526 4527 valHooks: { 4528 4529 option: { 4530 4531 get: function( elem ) { 4532 4533 // attributes.value is undefined in Blackberry 4.7 but 4534 4535 // uses .value. See #6932 4536 4537 var val = elem.attributes.value; 4538 4539 return !val || val.specified ? elem.value : elem.text; 4540 4541 } 4542 4543 }, 4544 4545 select: { 4546 4547 get: function( elem ) { 4548 4549 var value, option, 4550 4551 options = elem.options, 4552 4553 index = elem.selectedIndex, 4554 4555 one = elem.type === "select-one" || index < 0, 4556 4557 values = one ? null : [], 4558 4559 max = one ? index + 1 : options.length, 4560 4561 i = index < 0 ? 4562 4563 max : 4564 4565 one ? index : 0; 4566 4567 4568 4569 // Loop through all the selected options 4570 4571 for ( ; i < max; i++ ) { 4572 4573 option = options[ i ]; 4574 4575 4576 4577 // oldIE doesn't update selected after form reset (#2551) 4578 4579 if ( ( option.selected || i === index ) && 4580 4581 // Don't return options that are disabled or in a disabled optgroup 4582 4583 ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && 4584 4585 ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { 4586 4587 4588 4589 // Get the specific value for the option 4590 4591 value = jQuery( option ).val(); 4592 4593 4594 4595 // We don't need an array for one selects 4596 4597 if ( one ) { 4598 4599 return value; 4600 4601 } 4602 4603 4604 4605 // Multi-Selects return an array 4606 4607 values.push( value ); 4608 4609 } 4610 4611 } 4612 4613 4614 4615 return values; 4616 4617 }, 4618 4619 4620 4621 set: function( elem, value ) { 4622 4623 var values = jQuery.makeArray( value ); 4624 4625 4626 4627 jQuery(elem).find("option").each(function() { 4628 4629 this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; 4630 4631 }); 4632 4633 4634 4635 if ( !values.length ) { 4636 4637 elem.selectedIndex = -1; 4638 4639 } 4640 4641 return values; 4642 4643 } 4644 4645 } 4646 4647 }, 4648 4649 4650 4651 attr: function( elem, name, value ) { 4652 4653 var hooks, notxml, ret, 4654 4655 nType = elem.nodeType; 4656 4657 4658 4659 // don't get/set attributes on text, comment and attribute nodes 4660 4661 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { 4662 4663 return; 4664 4665 } 4666 4667 4668 4669 // Fallback to prop when attributes are not supported 4670 4671 if ( typeof elem.getAttribute === core_strundefined ) { 4672 4673 return jQuery.prop( elem, name, value ); 4674 4675 } 4676 4677 4678 4679 notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); 4680 4681 4682 4683 // All attributes are lowercase 4684 4685 // Grab necessary hook if one is defined 4686 4687 if ( notxml ) { 4688 4689 name = name.toLowerCase(); 4690 4691 hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); 4692 4693 } 4694 4695 4696 4697 if ( value !== undefined ) { 4698 4699 4700 4701 if ( value === null ) { 4702 4703 jQuery.removeAttr( elem, name ); 4704 4705 4706 4707 } else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { 4708 4709 return ret; 4710 4711 4712 4713 } else { 4714 4715 elem.setAttribute( name, value + "" ); 4716 4717 return value; 4718 4719 } 4720 4721 4722 4723 } else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { 4724 4725 return ret; 4726 4727 4728 4729 } else { 4730 4731 4732 4733 // In IE9+, Flash objects don't have .getAttribute (#12945) 4734
4735 // Support: IE9+ 4736 4737 if ( typeof elem.getAttribute !== core_strundefined ) { 4738 4739 ret = elem.getAttribute( name ); 4740 4741 } 4742 4743 4744 4745 // Non-existent attributes return null, we normalize to undefined 4746 4747 return ret == null ? 4748 4749 undefined : 4750 4751 ret; 4752 4753 } 4754 4755 }, 4756 4757 4758 4759 removeAttr: function( elem, value ) { 4760 4761 var name, propName, 4762 4763 i = 0, 4764 4765 attrNames = value && value.match( core_rnotwhite ); 4766 4767 4768 4769 if ( attrNames && elem.nodeType === 1 ) { 4770 4771 while ( (name = attrNames[i++]) ) { 4772 4773 propName = jQuery.propFix[ name ] || name; 4774 4775 4776 4777 // Boolean attributes get special treatment (#10870) 4778 4779 if ( rboolean.test( name ) ) { 4780 4781 // Set corresponding property to false for boolean attributes 4782 4783 // Also clear defaultChecked/defaultSelected (if appropriate) for IE<8 4784 4785 if ( !getSetAttribute && ruseDefault.test( name ) ) { 4786 4787 elem[ jQuery.camelCase( "default-" + name ) ] = 4788 4789 elem[ propName ] = false; 4790 4791 } else { 4792 4793 elem[ propName ] = false; 4794 4795 } 4796 4797 4798 4799 // See #9699 for explanation of this approach (setting first, then removal) 4800 4801 } else { 4802 4803 jQuery.attr( elem, name, "" ); 4804 4805 } 4806 4807 4808 4809 elem.removeAttribute( getSetAttribute ? name : propName ); 4810 4811 } 4812 4813 } 4814 4815 }, 4816 4817 4818 4819 attrHooks: { 4820 4821 type: { 4822 4823 set: function( elem, value ) { 4824 4825 if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { 4826 4827 // Setting the type on a radio button after the value resets the value in IE6-9 4828 4829 // Reset value to default in case type is set after value during creation 4830 4831 var val = elem.value; 4832 4833 elem.setAttribute( "type", value ); 4834 4835 if ( val ) { 4836 4837 elem.value = val; 4838 4839 } 4840 4841 return value; 4842 4843 } 4844 4845 } 4846 4847 } 4848 4849 }, 4850 4851 4852 4853 propFix: { 4854 4855 tabindex: "tabIndex", 4856 4857 readonly: "readOnly", 4858 4859 "for": "htmlFor", 4860 4861 "class": "className", 4862 4863 maxlength: "maxLength", 4864 4865 cellspacing: "cellSpacing", 4866 4867 cellpadding: "cellPadding", 4868 4869 rowspan: "rowSpan", 4870 4871 colspan: "colSpan", 4872 4873 usemap: "useMap", 4874 4875 frameborder: "frameBorder", 4876 4877 contenteditable: "contentEditable" 4878 4879 }, 4880 4881 4882 4883 prop: function( elem, name, value ) { 4884 4885 var ret, hooks, notxml, 4886 4887 nType = elem.nodeType; 4888 4889 4890 4891 // don't get/set properties on text, comment and attribute nodes 4892 4893 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { 4894 4895 return; 4896 4897 } 4898 4899 4900 4901 notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); 4902 4903 4904 4905 if ( notxml ) { 4906 4907 // Fix name and attach hooks 4908 4909 name = jQuery.propFix[ name ] || name; 4910 4911 hooks = jQuery.propHooks[ name ]; 4912 4913 } 4914 4915 4916 4917 if ( value !== undefined ) { 4918 4919 if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { 4920 4921 return ret; 4922 4923 4924 4925 } else { 4926 4927 return ( elem[ name ] = value ); 4928 4929 } 4930 4931 4932 4933 } else { 4934 4935 if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { 4936 4937 return ret; 4938 4939 4940 4941 } else { 4942 4943 return elem[ name ]; 4944 4945 } 4946 4947 } 4948 4949 }, 4950 4951 4952 4953 propHooks: { 4954 4955 tabIndex: { 4956 4957 get: function( elem ) { 4958 4959 // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set 4960 4961 // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ 4962 4963 var attributeNode = elem.getAttributeNode("tabindex"); 4964 4965 4966 4967 return attributeNode && attributeNode.specified ? 4968 4969 parseInt( attributeNode.value, 10 ) : 4970 4971 rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 4972 4973 0 : 4974 4975 undefined; 4976 4977 } 4978 4979 } 4980 4981 } 4982 4983}); 4984 4985 4986 4987// Hook for boolean attributes 4988 4989boolHook = { 4990 4991 get: function( elem, name ) { 4992 4993 var 4994 4995 // Use .prop to determine if this attribute is understood as boolean 4996 4997 prop = jQuery.prop( elem, name ), 4998 4999 5000 5001 // Fetch it accordingly 5002 5003 attr = typeof prop === "boolean" && elem.getAttribute( name ), 5004 5005 detail = typeof prop === "boolean" ? 5006 5007 5008 5009 getSetInput && getSetAttribute ? 5010 5011 attr != null : 5012 5013 // oldIE fabricates an empty string for missing boolean attributes 5014 5015 // and conflates checked/selected into attroperties 5016 5017 ruseDefault.test( name ) ? 5018 5019 elem[ jQuery.camelCase( "default-" + name ) ] : 5020 5021 !!attr : 5022 5023 5024 5025 // fetch an attribute node for properties not recognized as boolean 5026 5027 elem.getAttributeNode( name ); 5028 5029 5030 5031 return detail && detail.value !== false ? 5032 5033 name.toLowerCase() : 5034 5035 undefined; 5036 5037 }, 5038 5039 set: function( elem, value, name ) { 5040 5041 if ( value === false ) { 5042 5043 // Remove boolean attributes when set to false 5044 5045 jQuery.removeAttr( elem, name ); 5046 5047 } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { 5048
5049 // IE<8 needs the *property* name 5050 5051 elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); 5052 5053 5054 5055 // Use defaultChecked and defaultSelected for oldIE 5056 5057 } else { 5058 5059 elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; 5060 5061 } 5062 5063 5064 5065 return name; 5066 5067 } 5068 5069}; 5070 5071 5072 5073// fix oldIE value attroperty 5074 5075if ( !getSetInput || !getSetAttribute ) { 5076 5077 jQuery.attrHooks.value = { 5078 5079 get: function( elem, name ) { 5080 5081 var ret = elem.getAttributeNode( name ); 5082 5083 return jQuery.nodeName( elem, "input" ) ? 5084 5085 5086 5087 // Ignore the value *property* by using defaultValue 5088 5089 elem.defaultValue : 5090 5091 5092 5093 ret && ret.specified ? ret.value : undefined; 5094 5095 }, 5096 5097 set: function( elem, value, name ) { 5098 5099 if ( jQuery.nodeName( elem, "input" ) ) { 5100 5101 // Does not return so that setAttribute is also used 5102 5103 elem.defaultValue = value; 5104 5105 } else { 5106 5107 // Use nodeHook if defined (#1954); otherwise setAttribute is fine 5108 5109 return nodeHook && nodeHook.set( elem, value, name ); 5110 5111 } 5112 5113 } 5114 5115 }; 5116 5117} 5118 5119 5120 5121// IE6/7 do not support getting/setting some attributes with get/setAttribute 5122 5123if ( !getSetAttribute ) { 5124 5125 5126 5127 // Use this for any attribute in IE6/7 5128 5129 // This fixes almost every IE6/7 issue 5130 5131 nodeHook = jQuery.valHooks.button = { 5132 5133 get: function( elem, name ) { 5134 5135 var ret = elem.getAttributeNode( name ); 5136 5137 return ret && ( name === "id" || name === "name" || name === "coords" ? ret.value !== "" : ret.specified ) ? 5138 5139 ret.value : 5140 5141 undefined; 5142 5143 }, 5144 5145 set: function( elem, value, name ) { 5146 5147 // Set the existing or create a new attribute node 5148 5149 var ret = elem.getAttributeNode( name ); 5150 5151 if ( !ret ) { 5152 5153 elem.setAttributeNode( 5154 5155 (ret = elem.ownerDocument.createAttribute( name )) 5156 5157 ); 5158 5159 } 5160 5161 5162 5163 ret.value = value += ""; 5164 5165 5166 5167 // Break association with cloned elements by also using setAttribute (#9646) 5168 5169 return name === "value" || value === elem.getAttribute( name ) ? 5170 5171 value : 5172 5173 undefined; 5174 5175 } 5176 5177 }; 5178 5179 5180 5181 // Set contenteditable to false on removals(#10429) 5182 5183 // Setting to empty string throws an error as an invalid value 5184 5185 jQuery.attrHooks.contenteditable = { 5186 5187 get: nodeHook.get, 5188 5189 set: function( elem, value, name ) { 5190 5191 nodeHook.set( elem, value === "" ? false : value, name ); 5192 5193 } 5194 5195 }; 5196 5197 5198 5199 // Set width and height to auto instead of 0 on empty string( Bug #8150 ) 5200 5201 // This is for removals 5202 5203 jQuery.each([ "width", "height" ], function( i, name ) { 5204 5205 jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { 5206 5207 set: function( elem, value ) { 5208 5209 if ( value === "" ) { 5210 5211 elem.setAttribute( name, "auto" ); 5212 5213 return value; 5214 5215 } 5216 5217 } 5218 5219 }); 5220 5221 }); 5222 5223} 5224 5225 5226 5227 5228 5229// Some attributes require a special call on IE 5230 5231// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx 5232 5233if ( !jQuery.support.hrefNormalized ) { 5234 5235 jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { 5236 5237 jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { 5238 5239 get: function( elem ) { 5240 5241 var ret = elem.getAttribute( name, 2 ); 5242 5243 return ret == null ? undefined : ret; 5244 5245 } 5246 5247 }); 5248 5249 }); 5250 5251 5252 5253 // href/src property should get the full normalized URL (#10299/#12915) 5254 5255 jQuery.each([ "href", "src" ], function( i, name ) { 5256 5257 jQuery.propHooks[ name ] = { 5258 5259 get: function( elem ) { 5260 5261 return elem.getAttribute( name, 4 ); 5262 5263 } 5264 5265 }; 5266 5267 }); 5268 5269} 5270 5271 5272 5273if ( !jQuery.support.style ) { 5274 5275 jQuery.attrHooks.style = { 5276 5277 get: function( elem ) { 5278 5279 // Return undefined in the case of empty string 5280 5281 // Note: IE uppercases css property names, but if we were to .toLowerCase() 5282 5283 // .cssText, that would destroy case senstitivity in URL's, like in "background" 5284 5285 return elem.style.cssText || undefined; 5286 5287 }, 5288 5289 set: function( elem, value ) { 5290 5291 return ( elem.style.cssText = value + "" ); 5292 5293 } 5294 5295 }; 5296 5297} 5298 5299 5300 5301// Safari mis-reports the default selected property of an option 5302 5303// Accessing the parent's selectedIndex property fixes it 5304 5305if ( !jQuery.support.optSelected ) { 5306 5307 jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { 5308 5309 get: function( elem ) { 5310 5311 var parent = elem.parentNode; 5312 5313 5314 5315 if ( parent ) { 5316 5317 parent.selectedIndex; 5318 5319 5320 5321 // Make sure that it also works with optgroups, see #5701 5322 5323 if ( parent.parentNode ) { 5324 5325 parent.parentNode.selectedIndex; 5326 5327 } 5328 5329 } 5330 5331 return null; 5332 5333 } 5334 5335 }); 5336 5337} 5338 5339 5340 5341// IE6/7 call enctype encoding 5342 5343if ( !jQuery.support.enctype ) { 5344 5345 jQuery.propFix.enctype = "encoding"; 5346 5347} 5348 5349 5350 5351// Radios and checkboxes getter/setter 5352 5353if ( !jQuery.support.checkOn ) { 5354 5355 jQuery.each([ "radio", "checkbox" ], function() { 5356 5357 jQuery.valHooks[ this ] = { 5358 5359 get: function( elem ) { 5360 5361 // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified 5362 5363 return elem.getAttribute("value") === null ? "on" : elem.value; 5364 5365 } 5366 5367 }; 5368 5369 }); 5370 5371} 5372 5373jQuery.each([ "radio", "checkbox" ], function() { 5374 5375 jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { 5376 5377 set: function( elem, value ) { 5378 5379 if ( jQuery.isArray( value ) ) { 5380 5381 return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); 5382 5383 } 5384 5385 } 5386 5387 }); 5388 5389}); 5390 5391var rformElems = /^(?:input|select|textarea)$/i, 5392 5393 rkeyEvent = /^key/, 5394 5395 rmouseEvent = /^(?:mouse|contextmenu)|click/, 5396
vendor: 23,004 bytes, lines 5397-6891
5397 rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, 5398 5399 rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; 5400 5401 5402 5403function returnTrue() { 5404 5405 return true; 5406 5407} 5408 5409 5410 5411function returnFalse() { 5412 5413 return false; 5414 5415} 5416 5417 5418 5419/* 5420 5421 * Helper functions for managing events -- not part of the public interface. 5422 5423 * Props to Dean Edwards' addEvent library for many of the ideas. 5424 5425 */ 5426 5427jQuery.event = { 5428 5429 5430 5431 global: {}, 5432 5433 5434 5435 add: function( elem, types, handler, data, selector ) { 5436 5437 var tmp, events, t, handleObjIn, 5438 5439 special, eventHandle, handleObj, 5440 5441 handlers, type, namespaces, origType, 5442 5443 elemData = jQuery._data( elem ); 5444 5445 5446 5447 // Don't attach events to noData or text/comment nodes (but allow plain objects) 5448 5449 if ( !elemData ) { 5450 5451 return; 5452 5453 } 5454 5455 5456 5457 // Caller can pass in an object of custom data in lieu of the handler 5458 5459 if ( handler.handler ) { 5460 5461 handleObjIn = handler; 5462 5463 handler = handleObjIn.handler; 5464 5465 selector = handleObjIn.selector; 5466 5467 } 5468 5469 5470 5471 // Make sure that the handler has a unique ID, used to find/remove it later 5472 5473 if ( !handler.guid ) { 5474 5475 handler.guid = jQuery.guid++; 5476 5477 } 5478 5479 5480 5481 // Init the element's event structure and main handler, if this is the first 5482 5483 if ( !(events = elemData.events) ) { 5484 5485 events = elemData.events = {}; 5486 5487 } 5488 5489 if ( !(eventHandle = elemData.handle) ) { 5490 5491 eventHandle = elemData.handle = function( e ) { 5492 5493 // Discard the second event of a jQuery.event.trigger() and 5494 5495 // when an event is called after a page has unloaded 5496 5497 return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ? 5498 5499 jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : 5500 5501 undefined; 5502 5503 }; 5504 5505 // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events 5506 5507 eventHandle.elem = elem; 5508 5509 } 5510 5511 5512 5513 // Handle multiple events separated by a space 5514 5515 // jQuery(...).bind("mouseover mouseout", fn); 5516 5517 types = ( types || "" ).match( core_rnotwhite ) || [""]; 5518 5519 t = types.length; 5520 5521 while ( t-- ) { 5522 5523 tmp = rtypenamespace.exec( types[t] ) || []; 5524 5525 type = origType = tmp[1]; 5526 5527 namespaces = ( tmp[2] || "" ).split( "." ).sort(); 5528 5529 5530 5531 // If event changes its type, use the special event handlers for the changed type 5532 5533 special = jQuery.event.special[ type ] || {}; 5534 5535 5536 5537 // If selector defined, determine special event api type, otherwise given type 5538 5539 type = ( selector ? special.delegateType : special.bindType ) || type; 5540 5541 5542 5543 // Update special based on newly reset type 5544 5545 special = jQuery.event.special[ type ] || {}; 5546 5547 5548 5549 // handleObj is passed to all event handlers 5550 5551 handleObj = jQuery.extend({ 5552 5553 type: type, 5554 5555 origType: origType, 5556 5557 data: data, 5558 5559 handler: handler, 5560 5561 guid: handler.guid, 5562 5563 selector: selector, 5564 5565 needsContext: selector && jQuery.expr.match.needsContext.test( selector ), 5566 5567 namespace: namespaces.join(".") 5568 5569 }, handleObjIn ); 5570 5571 5572 5573 // Init the event handler queue if we're the first 5574 5575 if ( !(handlers = events[ type ]) ) { 5576 5577 handlers = events[ type ] = []; 5578 5579 handlers.delegateCount = 0; 5580 5581 5582 5583 // Only use addEventListener/attachEvent if the special events handler returns false 5584 5585 if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { 5586 5587 // Bind the global event handler to the element 5588 5589 if ( elem.addEventListener ) { 5590 5591 elem.addEventListener( type, eventHandle, false ); 5592 5593 5594 5595 } else if ( elem.attachEvent ) { 5596 5597 elem.attachEvent( "on" + type, eventHandle ); 5598 5599 } 5600 5601 } 5602 5603 } 5604 5605 5606 5607 if ( special.add ) { 5608 5609 special.add.call( elem, handleObj ); 5610 5611 5612 5613 if ( !handleObj.handler.guid ) { 5614 5615 handleObj.handler.guid = handler.guid; 5616 5617 } 5618 5619 } 5620 5621 5622 5623 // Add to the element's handler list, delegates in front 5624 5625 if ( selector ) { 5626 5627 handlers.splice( handlers.delegateCount++, 0, handleObj ); 5628 5629 } else { 5630 5631 handlers.push( handleObj ); 5632 5633 } 5634 5635 5636 5637 // Keep track of which events have ever been used, for event optimization 5638 5639 jQuery.event.global[ type ] = true; 5640 5641 } 5642 5643 5644 5645 // Nullify elem to prevent memory leaks in IE 5646 5647 elem = null; 5648 5649 }, 5650 5651 5652 5653 // Detach an event or set of events from an element 5654 5655 remove: function( elem, types, handler, selector, mappedTypes ) { 5656 5657 var j, handleObj, tmp, 5658 5659 origCount, t, events, 5660 5661 special, handlers, type, 5662 5663 namespaces, origType, 5664 5665 elemData = jQuery.hasData( elem ) && jQuery._data( elem ); 5666 5667 5668 5669 if ( !elemData || !(events = elemData.events) ) { 5670 5671 return; 5672 5673 } 5674 5675 5676 5677 // Once for each type.namespace in types; type may be omitted 5678 5679 types = ( types || "" ).match( core_rnotwhite ) || [""]; 5680 5681 t = types.length; 5682 5683 while ( t-- ) { 5684 5685 tmp = rtypenamespace.exec( types[t] ) || []; 5686 5687 type = origType = tmp[1]; 5688 5689 namespaces = ( tmp[2] || "" ).split( "." ).sort(); 5690 5691 5692 5693 // Unbind all events (on this namespace, if provided) for the element 5694 5695 if ( !type ) { 5696 5697 for ( type in events ) { 5698 5699 jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); 5700 5701 } 5702 5703 continue; 5704 5705 } 5706 5707 5708 5709 special = jQuery.event.special[ type ] || {}; 5710 5711 type = ( selector ? special.delegateType : special.bindType ) || type; 5712 5713 handlers = events[ type ] || []; 5714 5715 tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); 5716 5717 5718 5719 // Remove matching events 5720 5721 origCount = j = handlers.length; 5722 5723 while ( j-- ) { 5724 5725 handleObj = handlers[ j ]; 5726 5727 5728 5729 if ( ( mappedTypes || origType === handleObj.origType ) && 5730 5731 ( !handler || handler.guid === handleObj.guid ) && 5732 5733 ( !tmp || tmp.test( handleObj.namespace ) ) && 5734 5735 ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { 5736 5737 handlers.splice( j, 1 ); 5738 5739 5740 5741 if ( handleObj.selector ) { 5742 5743 handlers.delegateCount--; 5744 5745 } 5746 5747 if ( special.remove ) { 5748 5749 special.remove.call( elem, handleObj ); 5750 5751 } 5752 5753 } 5754 5755 } 5756 5757 5758 5759 // Remove generic event handler if we removed something and no more handlers exist 5760 5761 // (avoids potential for endless recursion during removal of special event handlers) 5762 5763 if ( origCount && !handlers.length ) { 5764 5765 if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { 5766 5767 jQuery.removeEvent( elem, type, elemData.handle ); 5768 5769 } 5770 5771 5772 5773 delete events[ type ]; 5774 5775 } 5776 5777 } 5778 5779 5780 5781 // Remove the expando if it's no longer used 5782 5783 if ( jQuery.isEmptyObject( events ) ) { 5784 5785 delete elemData.handle; 5786 5787 5788 5789 // removeData also checks for emptiness and clears the expando if empty 5790 5791 // so use it instead of delete 5792 5793 jQuery._removeData( elem, "events" ); 5794 5795 } 5796 5797 }, 5798 5799 5800 5801 trigger: function( event, data, elem, onlyHandlers ) { 5802 5803 var handle, ontype, cur, 5804 5805 bubbleType, special, tmp, i, 5806 5807 eventPath = [ elem || document ], 5808 5809 type = core_hasOwn.call( event, "type" ) ? event.type : event, 5810 5811 namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; 5812 5813 5814 5815 cur = tmp = elem = elem || document; 5816 5817 5818 5819 // Don't do events on text and comment nodes 5820 5821 if ( elem.nodeType === 3 || elem.nodeType === 8 ) { 5822 5823 return; 5824 5825 } 5826 5827 5828 5829 // focus/blur morphs to focusin/out; ensure we're not firing them right now 5830 5831 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { 5832 5833 return; 5834 5835 } 5836 5837 5838 5839 if ( type.indexOf(".") >= 0 ) { 5840 5841 // Namespaced trigger; create a regexp to match event type in handle() 5842 5843 namespaces = type.split("."); 5844 5845 type = namespaces.shift(); 5846 5847 namespaces.sort(); 5848 5849 } 5850 5851 ontype = type.indexOf(":") < 0 && "on" + type; 5852 5853 5854 5855 // Caller can pass in a jQuery.Event object, Object, or just an event type string 5856 5857 event = event[ jQuery.expando ] ? 5858 5859 event : 5860 5861 new jQuery.Event( type, typeof event === "object" && event ); 5862 5863 5864 5865 event.isTrigger = true; 5866 5867 event.namespace = namespaces.join("."); 5868 5869 event.namespace_re = event.namespace ? 5870 5871 new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : 5872 5873 null; 5874 5875 5876 5877 // Clean up the event in case it is being reused 5878 5879 event.result = undefined; 5880 5881 if ( !event.target ) { 5882 5883 event.target = elem; 5884 5885 } 5886 5887 5888 5889 // Clone any incoming data and prepend the event, creating the handler arg list 5890 5891 data = data == null ? 5892 5893 [ event ] : 5894 5895 jQuery.makeArray( data, [ event ] ); 5896 5897 5898 5899 // Allow special events to draw outside the lines 5900 5901 special = jQuery.event.special[ type ] || {}; 5902 5903 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { 5904 5905 return; 5906 5907 } 5908 5909 5910 5911 // Determine event propagation path in advance, per W3C events spec (#9951) 5912 5913 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) 5914 5915 if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { 5916 5917 5918 5919 bubbleType = special.delegateType || type; 5920 5921 if ( !rfocusMorph.test( bubbleType + type ) ) { 5922 5923 cur = cur.parentNode; 5924 5925 } 5926 5927 for ( ; cur; cur = cur.parentNode ) { 5928 5929 eventPath.push( cur ); 5930 5931 tmp = cur; 5932 5933 } 5934 5935 5936 5937 // Only add window if we got to document (e.g., not plain obj or detached DOM) 5938 5939 if ( tmp === (elem.ownerDocument || document) ) { 5940 5941 eventPath.push( tmp.defaultView || tmp.parentWindow || window ); 5942 5943 } 5944 5945 } 5946 5947 5948 5949 // Fire handlers on the event path 5950 5951 i = 0; 5952 5953 while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { 5954 5955 5956 5957 event.type = i > 1 ? 5958 5959 bubbleType : 5960 5961 special.bindType || type; 5962 5963 5964 5965 // jQuery handler 5966 5967 handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); 5968 5969 if ( handle ) { 5970 5971 handle.apply( cur, data ); 5972 5973 } 5974 5975 5976 5977 // Native handler 5978 5979 handle = ontype && cur[ ontype ]; 5980 5981 if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { 5982 5983 event.preventDefault(); 5984 5985 } 5986 5987 } 5988 5989 event.type = type; 5990 5991 5992 5993 // If nobody prevented the default action, do it now 5994 5995 if ( !onlyHandlers && !event.isDefaultPrevented() ) { 5996 5997 5998 5999 if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) && 6000 6001 !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { 6002 6003 6004 6005 // Call a native DOM method on the target with the same name name as the event. 6006 6007 // Can't use an .isFunction() check here because IE6/7 fails that test. 6008 6009 // Don't do default actions on window, that's where global variables be (#6170) 6010 6011 if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { 6012 6013 6014 6015 // Don't re-trigger an onFOO event when we call its FOO() method 6016 6017 tmp = elem[ ontype ]; 6018 6019 6020 6021 if ( tmp ) { 6022 6023 elem[ ontype ] = null; 6024 6025 } 6026 6027 6028 6029 // Prevent re-triggering of the same event, since we already bubbled it above 6030 6031 jQuery.event.triggered = type; 6032 6033 try { 6034 6035 elem[ type ](); 6036 6037 } catch ( e ) { 6038 6039 // IE<9 dies on focus/blur to hidden element (#1486,#12518) 6040 6041 // only reproducible on winXP IE8 native, not IE9 in IE8 mode 6042 6043 } 6044 6045 jQuery.event.triggered = undefined; 6046 6047 6048 6049 if ( tmp ) { 6050 6051 elem[ ontype ] = tmp; 6052 6053 } 6054 6055 } 6056 6057 } 6058 6059 } 6060 6061 6062 6063 return event.result; 6064 6065 }, 6066 6067 6068 6069 dispatch: function( event ) { 6070 6071 6072 6073 // Make a writable jQuery.Event from the native event object 6074 6075 event = jQuery.event.fix( event ); 6076 6077 6078 6079 var i, ret, handleObj, matched, j, 6080 6081 handlerQueue = [], 6082 6083 args = core_slice.call( arguments ), 6084 6085 handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], 6086 6087 special = jQuery.event.special[ event.type ] || {}; 6088 6089 6090 6091 // Use the fix-ed jQuery.Event rather than the (read-only) native event 6092 6093 args[0] = event; 6094 6095 event.delegateTarget = this; 6096 6097 6098 6099 // Call the preDispatch hook for the mapped type, and let it bail if desired 6100 6101 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { 6102 6103 return; 6104 6105 } 6106 6107 6108 6109 // Determine handlers 6110 6111 handlerQueue = jQuery.event.handlers.call( this, event, handlers ); 6112 6113 6114 6115 // Run delegates first; they may want to stop propagation beneath us 6116 6117 i = 0; 6118 6119 while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { 6120 6121 event.currentTarget = matched.elem; 6122 6123 6124 6125 j = 0; 6126 6127 while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { 6128 6129 6130 6131 // Triggered event must either 1) have no namespace, or 6132 6133 // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). 6134 6135 if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { 6136 6137 6138 6139 event.handleObj = handleObj; 6140 6141 event.data = handleObj.data; 6142 6143 6144 6145 ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) 6146 6147 .apply( matched.elem, args ); 6148 6149 6150 6151 if ( ret !== undefined ) { 6152 6153 if ( (event.result = ret) === false ) { 6154 6155 event.preventDefault(); 6156 6157 event.stopPropagation(); 6158 6159 } 6160 6161 } 6162 6163 } 6164 6165 } 6166 6167 } 6168 6169 6170 6171 // Call the postDispatch hook for the mapped type 6172 6173 if ( special.postDispatch ) { 6174 6175 special.postDispatch.call( this, event ); 6176 6177 } 6178 6179 6180 6181 return event.result; 6182 6183 }, 6184 6185 6186 6187 handlers: function( event, handlers ) { 6188 6189 var sel, handleObj, matches, i, 6190 6191 handlerQueue = [], 6192 6193 delegateCount = handlers.delegateCount, 6194 6195 cur = event.target; 6196 6197 6198 6199 // Find delegate handlers 6200 6201 // Black-hole SVG <use> instance trees (#13180) 6202 6203 // Avoid non-left-click bubbling in Firefox (#3861) 6204 6205 if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { 6206 6207 6208 6209 for ( ; cur != this; cur = cur.parentNode || this ) { 6210 6211 6212 6213 // Don't check non-elements (#13208) 6214 6215 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) 6216 6217 if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { 6218 6219 matches = []; 6220 6221 for ( i = 0; i < delegateCount; i++ ) { 6222 6223 handleObj = handlers[ i ]; 6224 6225 6226 6227 // Don't conflict with Object.prototype properties (#13203) 6228 6229 sel = handleObj.selector + " "; 6230 6231 6232 6233 if ( matches[ sel ] === undefined ) { 6234 6235 matches[ sel ] = handleObj.needsContext ? 6236 6237 jQuery( sel, this ).index( cur ) >= 0 : 6238 6239 jQuery.find( sel, this, null, [ cur ] ).length; 6240 6241 } 6242 6243 if ( matches[ sel ] ) { 6244 6245 matches.push( handleObj ); 6246 6247 } 6248 6249 } 6250 6251 if ( matches.length ) { 6252 6253 handlerQueue.push({ elem: cur, handlers: matches }); 6254 6255 } 6256 6257 } 6258 6259 } 6260 6261 } 6262 6263 6264 6265 // Add the remaining (directly-bound) handlers 6266 6267 if ( delegateCount < handlers.length ) { 6268 6269 handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); 6270 6271 } 6272 6273 6274 6275 return handlerQueue; 6276 6277 }, 6278 6279 6280 6281 fix: function( event ) { 6282 6283 if ( event[ jQuery.expando ] ) { 6284 6285 return event; 6286 6287 } 6288 6289 6290 6291 // Create a writable copy of the event object and normalize some properties 6292 6293 var i, prop, copy, 6294 6295 type = event.type, 6296 6297 originalEvent = event, 6298 6299 fixHook = this.fixHooks[ type ]; 6300 6301 6302 6303 if ( !fixHook ) { 6304 6305 this.fixHooks[ type ] = fixHook = 6306 6307 rmouseEvent.test( type ) ? this.mouseHooks : 6308 6309 rkeyEvent.test( type ) ? this.keyHooks : 6310 6311 {}; 6312 6313 } 6314 6315 copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; 6316 6317 6318 6319 event = new jQuery.Event( originalEvent ); 6320 6321 6322 6323 i = copy.length; 6324 6325 while ( i-- ) { 6326 6327 prop = copy[ i ]; 6328 6329 event[ prop ] = originalEvent[ prop ]; 6330 6331 } 6332 6333 6334 6335 // Support: IE<9 6336 6337 // Fix target property (#1925) 6338 6339 if ( !event.target ) { 6340 6341 event.target = originalEvent.srcElement || document; 6342 6343 } 6344 6345 6346 6347 // Support: Chrome 23+, Safari? 6348 6349 // Target should not be a text node (#504, #13143) 6350 6351 if ( event.target.nodeType === 3 ) { 6352 6353 event.target = event.target.parentNode; 6354 6355 } 6356 6357 6358 6359 // Support: IE<9 6360 6361 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) 6362 6363 event.metaKey = !!event.metaKey; 6364 6365 6366 6367 return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; 6368 6369 }, 6370 6371 6372 6373 // Includes some event props shared by KeyEvent and MouseEvent 6374 6375 props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), 6376 6377 6378 6379 fixHooks: {}, 6380 6381 6382 6383 keyHooks: { 6384 6385 props: "char charCode key keyCode".split(" "), 6386 6387 filter: function( event, original ) { 6388 6389 6390 6391 // Add which for key events 6392 6393 if ( event.which == null ) { 6394 6395 event.which = original.charCode != null ? original.charCode : original.keyCode; 6396 6397 } 6398 6399 6400 6401 return event; 6402 6403 } 6404 6405 }, 6406 6407 6408 6409 mouseHooks: { 6410 6411 props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), 6412 6413 filter: function( event, original ) { 6414 6415 var body, eventDoc, doc, 6416 6417 button = original.button, 6418 6419 fromElement = original.fromElement; 6420 6421 6422 6423 // Calculate pageX/Y if missing and clientX/Y available 6424 6425 if ( event.pageX == null && original.clientX != null ) { 6426 6427 eventDoc = event.target.ownerDocument || document; 6428 6429 doc = eventDoc.documentElement; 6430 6431 body = eventDoc.body; 6432 6433 6434 6435 event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); 6436 6437 event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); 6438 6439 } 6440 6441 6442 6443 // Add relatedTarget, if necessary 6444 6445 if ( !event.relatedTarget && fromElement ) { 6446 6447 event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; 6448 6449 } 6450 6451 6452 6453 // Add which for click: 1 === left; 2 === middle; 3 === right 6454 6455 // Note: button is not normalized, so don't use it 6456 6457 if ( !event.which && button !== undefined ) { 6458 6459 event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); 6460 6461 } 6462 6463 6464 6465 return event; 6466 6467 } 6468 6469 }, 6470 6471 6472 6473 special: { 6474 6475 load: { 6476 6477 // Prevent triggered image.load events from bubbling to window.load 6478 6479 noBubble: true 6480 6481 }, 6482 6483 click: { 6484 6485 // For checkbox, fire native event so checked state will be right 6486 6487 trigger: function() { 6488 6489 if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { 6490 6491 this.click(); 6492 6493 return false; 6494 6495 } 6496 6497 } 6498 6499 }, 6500 6501 focus: { 6502 6503 // Fire native event if possible so blur/focus sequence is correct 6504 6505 trigger: function() { 6506 6507 if ( this !== document.activeElement && this.focus ) { 6508 6509 try { 6510 6511 this.focus(); 6512 6513 return false; 6514 6515 } catch ( e ) { 6516 6517 // Support: IE<9 6518 6519 // If we error on focus to hidden element (#1486, #12518), 6520 6521 // let .trigger() run the handlers 6522 6523 } 6524 6525 } 6526 6527 }, 6528 6529 delegateType: "focusin" 6530 6531 }, 6532 6533 blur: { 6534 6535 trigger: function() { 6536 6537 if ( this === document.activeElement && this.blur ) { 6538 6539 this.blur(); 6540 6541 return false; 6542 6543 } 6544 6545 }, 6546 6547 delegateType: "focusout" 6548 6549 }, 6550 6551 6552 6553 beforeunload: { 6554 6555 postDispatch: function( event ) { 6556 6557 6558 6559 // Even when returnValue equals to undefined Firefox will still show alert 6560 6561 if ( event.result !== undefined ) { 6562 6563 event.originalEvent.returnValue = event.result; 6564 6565 } 6566 6567 } 6568 6569 } 6570 6571 }, 6572 6573 6574 6575 simulate: function( type, elem, event, bubble ) { 6576 6577 // Piggyback on a donor event to simulate a different one. 6578 6579 // Fake originalEvent to avoid donor's stopPropagation, but if the 6580 6581 // simulated event prevents default then we do the same on the donor. 6582 6583 var e = jQuery.extend( 6584 6585 new jQuery.Event(), 6586 6587 event, 6588 6589 { type: type, 6590 6591 isSimulated: true, 6592 6593 originalEvent: {} 6594 6595 } 6596 6597 ); 6598 6599 if ( bubble ) { 6600 6601 jQuery.event.trigger( e, null, elem ); 6602 6603 } else { 6604 6605 jQuery.event.dispatch.call( elem, e ); 6606 6607 } 6608 6609 if ( e.isDefaultPrevented() ) { 6610 6611 event.preventDefault(); 6612 6613 } 6614 6615 } 6616 6617}; 6618 6619 6620 6621jQuery.removeEvent = document.removeEventListener ? 6622 6623 function( elem, type, handle ) { 6624 6625 if ( elem.removeEventListener ) { 6626 6627 elem.removeEventListener( type, handle, false ); 6628 6629 } 6630 6631 } : 6632 6633 function( elem, type, handle ) { 6634 6635 var name = "on" + type; 6636 6637 6638 6639 if ( elem.detachEvent ) { 6640 6641 6642 6643 // #8545, #7054, preventing memory leaks for custom events in IE6-8 6644 6645 // detachEvent needed property on element, by name of that event, to properly expose it to GC 6646 6647 if ( typeof elem[ name ] === core_strundefined ) { 6648 6649 elem[ name ] = null; 6650 6651 } 6652 6653 6654 6655 elem.detachEvent( name, handle ); 6656 6657 } 6658 6659 }; 6660 6661 6662 6663jQuery.Event = function( src, props ) { 6664 6665 // Allow instantiation without the 'new' keyword 6666 6667 if ( !(this instanceof jQuery.Event) ) { 6668 6669 return new jQuery.Event( src, props ); 6670 6671 } 6672 6673 6674 6675 // Event object 6676 6677 if ( src && src.type ) { 6678 6679 this.originalEvent = src; 6680 6681 this.type = src.type; 6682 6683 6684 6685 // Events bubbling up the document may have been marked as prevented 6686 6687 // by a handler lower down the tree; reflect the correct value. 6688 6689 this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || 6690 6691 src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; 6692 6693 6694 6695 // Event type 6696 6697 } else { 6698 6699 this.type = src; 6700 6701 } 6702 6703 6704 6705 // Put explicitly provided properties onto the event object 6706 6707 if ( props ) { 6708 6709 jQuery.extend( this, props ); 6710 6711 } 6712 6713 6714 6715 // Create a timestamp if incoming event doesn't have one 6716 6717 this.timeStamp = src && src.timeStamp || jQuery.now(); 6718 6719 6720 6721 // Mark it as fixed 6722 6723 this[ jQuery.expando ] = true; 6724 6725}; 6726 6727 6728 6729// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 6730 6731// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 6732 6733jQuery.Event.prototype = { 6734 6735 isDefaultPrevented: returnFalse, 6736 6737 isPropagationStopped: returnFalse, 6738 6739 isImmediatePropagationStopped: returnFalse, 6740 6741 6742 6743 preventDefault: function() { 6744 6745 var e = this.originalEvent; 6746 6747 6748 6749 this.isDefaultPrevented = returnTrue; 6750 6751 if ( !e ) { 6752 6753 return; 6754 6755 } 6756 6757 6758 6759 // If preventDefault exists, run it on the original event 6760 6761 if ( e.preventDefault ) { 6762 6763 e.preventDefault(); 6764 6765 6766 6767 // Support: IE 6768 6769 // Otherwise set the returnValue property of the original event to false 6770 6771 } else { 6772 6773 e.returnValue = false; 6774 6775 } 6776 6777 }, 6778 6779 stopPropagation: function() { 6780 6781 var e = this.originalEvent; 6782 6783 6784 6785 this.isPropagationStopped = returnTrue; 6786 6787 if ( !e ) { 6788 6789 return; 6790 6791 } 6792 6793 // If stopPropagation exists, run it on the original event 6794 6795 if ( e.stopPropagation ) { 6796 6797 e.stopPropagation(); 6798 6799 } 6800 6801 6802 6803 // Support: IE 6804 6805 // Set the cancelBubble property of the original event to true 6806 6807 e.cancelBubble = true; 6808 6809 }, 6810 6811 stopImmediatePropagation: function() { 6812 6813 this.isImmediatePropagationStopped = returnTrue; 6814 6815 this.stopPropagation(); 6816 6817 } 6818 6819}; 6820 6821 6822 6823// Create mouseenter/leave events using mouseover/out and event-time checks 6824 6825jQuery.each({ 6826 6827 mouseenter: "mouseover", 6828 6829 mouseleave: "mouseout" 6830 6831}, function( orig, fix ) { 6832 6833 jQuery.event.special[ orig ] = { 6834 6835 delegateType: fix, 6836 6837 bindType: fix, 6838 6839 6840 6841 handle: function( event ) { 6842 6843 var ret, 6844 6845 target = this, 6846 6847 related = event.relatedTarget, 6848 6849 handleObj = event.handleObj; 6850 6851 6852 6853 // For mousenter/leave call the handler if related is outside the target. 6854 6855 // NB: No relatedTarget if the mouse left/entered the browser window 6856 6857 if ( !related || (related !== target && !jQuery.contains( target, related )) ) { 6858 6859 event.type = handleObj.origType; 6860 6861 ret = handleObj.handler.apply( this, arguments ); 6862 6863 event.type = fix; 6864 6865 } 6866 6867 return ret; 6868 6869 } 6870 6871 }; 6872 6873}); 6874 6875 6876 6877// IE submit delegation 6878 6879if ( !jQuery.support.submitBubbles ) { 6880 6881 6882 6883 jQuery.event.special.submit = { 6884 6885 setup: function() { 6886 6887 // Only need this for delegated form submit events 6888 6889 if ( jQuery.nodeName( this, "form" ) ) { 6890 6891 return false;
vendor: 11,156 bytes, lines 6892-7604
6892 6893 } 6894 6895 6896 6897 // Lazy-add a submit handler when a descendant form may potentially be submitted 6898 6899 jQuery.event.add( this, "click._submit keypress._submit", function( e ) { 6900 6901 // Node name check avoids a VML-related crash in IE (#9807) 6902 6903 var elem = e.target, 6904 6905 form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; 6906 6907 if ( form && !jQuery._data( form, "submitBubbles" ) ) { 6908 6909 jQuery.event.add( form, "submit._submit", function( event ) { 6910 6911 event._submit_bubble = true; 6912 6913 }); 6914 6915 jQuery._data( form, "submitBubbles", true ); 6916 6917 } 6918 6919 }); 6920 6921 // return undefined since we don't need an event listener 6922 6923 }, 6924 6925 6926 6927 postDispatch: function( event ) { 6928 6929 // If form was submitted by the user, bubble the event up the tree 6930 6931 if ( event._submit_bubble ) { 6932 6933 delete event._submit_bubble; 6934 6935 if ( this.parentNode && !event.isTrigger ) { 6936 6937 jQuery.event.simulate( "submit", this.parentNode, event, true ); 6938 6939 } 6940 6941 } 6942 6943 }, 6944 6945 6946 6947 teardown: function() { 6948 6949 // Only need this for delegated form submit events 6950 6951 if ( jQuery.nodeName( this, "form" ) ) { 6952 6953 return false; 6954 6955 } 6956 6957 6958 6959 // Remove delegated handlers; cleanData eventually reaps submit handlers attached above 6960 6961 jQuery.event.remove( this, "._submit" ); 6962 6963 } 6964 6965 }; 6966 6967} 6968 6969 6970 6971// IE change delegation and checkbox/radio fix 6972 6973if ( !jQuery.support.changeBubbles ) { 6974 6975 6976 6977 jQuery.event.special.change = { 6978 6979 6980 6981 setup: function() { 6982 6983 6984 6985 if ( rformElems.test( this.nodeName ) ) { 6986 6987 // IE doesn't fire change on a check/radio until blur; trigger it on click 6988 6989 // after a propertychange. Eat the blur-change in special.change.handle. 6990 6991 // This still fires onchange a second time for check/radio after blur. 6992 6993 if ( this.type === "checkbox" || this.type === "radio" ) { 6994 6995 jQuery.event.add( this, "propertychange._change", function( event ) { 6996 6997 if ( event.originalEvent.propertyName === "checked" ) { 6998 6999 this._just_changed = true; 7000 7001 } 7002 7003 }); 7004 7005 jQuery.event.add( this, "click._change", function( event ) { 7006 7007 if ( this._just_changed && !event.isTrigger ) { 7008 7009 this._just_changed = false; 7010 7011 } 7012 7013 // Allow triggered, simulated change events (#11500) 7014 7015 jQuery.event.simulate( "change", this, event, true ); 7016 7017 }); 7018 7019 } 7020 7021 return false; 7022 7023 } 7024 7025 // Delegated event; lazy-add a change handler on descendant inputs 7026 7027 jQuery.event.add( this, "beforeactivate._change", function( e ) { 7028 7029 var elem = e.target; 7030 7031 7032 7033 if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { 7034 7035 jQuery.event.add( elem, "change._change", function( event ) { 7036 7037 if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { 7038 7039 jQuery.event.simulate( "change", this.parentNode, event, true ); 7040 7041 } 7042 7043 }); 7044 7045 jQuery._data( elem, "changeBubbles", true ); 7046 7047 } 7048 7049 }); 7050 7051 }, 7052 7053 7054 7055 handle: function( event ) { 7056 7057 var elem = event.target; 7058 7059 7060 7061 // Swallow native change events from checkbox/radio, we already triggered them above 7062 7063 if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { 7064 7065 return event.handleObj.handler.apply( this, arguments ); 7066 7067 } 7068 7069 }, 7070 7071 7072 7073 teardown: function() { 7074 7075 jQuery.event.remove( this, "._change" ); 7076 7077 7078 7079 return !rformElems.test( this.nodeName ); 7080 7081 } 7082 7083 }; 7084 7085} 7086 7087 7088 7089// Create "bubbling" focus and blur events 7090 7091if ( !jQuery.support.focusinBubbles ) { 7092 7093 jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { 7094 7095 7096 7097 // Attach a single capturing handler while someone wants focusin/focusout 7098 7099 var attaches = 0, 7100 7101 handler = function( event ) { 7102 7103 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); 7104 7105 }; 7106 7107 7108 7109 jQuery.event.special[ fix ] = { 7110 7111 setup: function() { 7112 7113 if ( attaches++ === 0 ) { 7114 7115 document.addEventListener( orig, handler, true ); 7116 7117 } 7118 7119 }, 7120 7121 teardown: function() { 7122 7123 if ( --attaches === 0 ) { 7124 7125 document.removeEventListener( orig, handler, true ); 7126 7127 } 7128 7129 } 7130 7131 }; 7132 7133 }); 7134 7135} 7136 7137 7138 7139jQuery.fn.extend({ 7140 7141 7142 7143 on: function( types, selector, data, fn, /*INTERNAL*/ one ) { 7144 7145 var type, origFn; 7146 7147 7148 7149 // Types can be a map of types/handlers 7150 7151 if ( typeof types === "object" ) { 7152 7153 // ( types-Object, selector, data ) 7154 7155 if ( typeof selector !== "string" ) { 7156 7157 // ( types-Object, data ) 7158 7159 data = data || selector; 7160 7161 selector = undefined; 7162 7163 } 7164 7165 for ( type in types ) { 7166 7167 this.on( type, selector, data, types[ type ], one ); 7168 7169 } 7170 7171 return this; 7172 7173 } 7174 7175 7176 7177 if ( data == null && fn == null ) { 7178 7179 // ( types, fn ) 7180 7181 fn = selector; 7182 7183 data = selector = undefined; 7184 7185 } else if ( fn == null ) { 7186 7187 if ( typeof selector === "string" ) { 7188 7189 // ( types, selector, fn ) 7190 7191 fn = data; 7192 7193 data = undefined; 7194 7195 } else { 7196 7197 // ( types, data, fn ) 7198 7199 fn = data; 7200 7201 data = selector; 7202 7203 selector = undefined; 7204 7205 } 7206 7207 } 7208 7209 if ( fn === false ) { 7210 7211 fn = returnFalse; 7212 7213 } else if ( !fn ) { 7214 7215 return this; 7216 7217 } 7218 7219 7220 7221 if ( one === 1 ) { 7222 7223 origFn = fn; 7224 7225 fn = function( event ) { 7226 7227 // Can use an empty set, since event contains the info 7228 7229 jQuery().off( event ); 7230 7231 return origFn.apply( this, arguments ); 7232 7233 }; 7234 7235 // Use same guid so caller can remove using origFn 7236 7237 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); 7238 7239 } 7240 7241 return this.each( function() { 7242 7243 jQuery.event.add( this, types, fn, data, selector ); 7244 7245 }); 7246 7247 }, 7248 7249 one: function( types, selector, data, fn ) { 7250 7251 return this.on( types, selector, data, fn, 1 ); 7252 7253 }, 7254 7255 off: function( types, selector, fn ) { 7256 7257 var handleObj, type; 7258 7259 if ( types && types.preventDefault && types.handleObj ) { 7260 7261 // ( event ) dispatched jQuery.Event 7262 7263 handleObj = types.handleObj; 7264 7265 jQuery( types.delegateTarget ).off( 7266 7267 handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, 7268 7269 handleObj.selector, 7270 7271 handleObj.handler 7272 7273 ); 7274 7275 return this; 7276 7277 } 7278 7279 if ( typeof types === "object" ) { 7280 7281 // ( types-object [, selector] ) 7282 7283 for ( type in types ) { 7284 7285 this.off( type, selector, types[ type ] ); 7286 7287 } 7288 7289 return this; 7290 7291 } 7292 7293 if ( selector === false || typeof selector === "function" ) { 7294 7295 // ( types [, fn] ) 7296 7297 fn = selector; 7298 7299 selector = undefined; 7300 7301 } 7302 7303 if ( fn === false ) { 7304 7305 fn = returnFalse; 7306 7307 } 7308 7309 return this.each(function() { 7310 7311 jQuery.event.remove( this, types, fn, selector ); 7312 7313 }); 7314 7315 }, 7316 7317 7318 7319 bind: function( types, data, fn ) { 7320 7321 return this.on( types, null, data, fn ); 7322 7323 }, 7324 7325 unbind: function( types, fn ) { 7326 7327 return this.off( types, null, fn ); 7328 7329 }, 7330 7331 7332 7333 delegate: function( selector, types, data, fn ) { 7334 7335 return this.on( types, selector, data, fn ); 7336 7337 }, 7338 7339 undelegate: function( selector, types, fn ) { 7340 7341 // ( namespace ) or ( selector, types [, fn] ) 7342 7343 return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); 7344 7345 }, 7346 7347 7348 7349 trigger: function( type, data ) { 7350 7351 return this.each(function() { 7352 7353 jQuery.event.trigger( type, data, this ); 7354 7355 }); 7356 7357 }, 7358 7359 triggerHandler: function( type, data ) { 7360 7361 var elem = this[0]; 7362 7363 if ( elem ) { 7364 7365 return jQuery.event.trigger( type, data, elem, true ); 7366 7367 } 7368 7369 } 7370 7371}); 7372 7373/*! 7374 7375 * Sizzle CSS Selector Engine 7376 7377 * Copyright 2012 jQuery Foundation and other contributors 7378 7379 * Released under the MIT license 7380 7381 * http://sizzlejs.com/ 7382 7383 */ 7384 7385(function( window, undefined ) { 7386 7387 7388 7389var i, 7390 7391 cachedruns, 7392 7393 Expr, 7394 7395 getText, 7396 7397 isXML, 7398 7399 compile, 7400 7401 hasDuplicate, 7402 7403 outermostContext, 7404 7405 7406 7407 // Local document vars 7408 7409 setDocument, 7410 7411 document, 7412 7413 docElem, 7414 7415 documentIsXML, 7416 7417 rbuggyQSA, 7418 7419 rbuggyMatches, 7420 7421 matches, 7422 7423 contains, 7424 7425 sortOrder, 7426 7427 7428 7429 // Instance-specific data 7430 7431 expando = "sizzle" + -(new Date()), 7432 7433 preferredDoc = window.document, 7434 7435 support = {}, 7436 7437 dirruns = 0, 7438 7439 done = 0, 7440 7441 classCache = createCache(), 7442 7443 tokenCache = createCache(), 7444 7445 compilerCache = createCache(), 7446 7447 7448 7449 // General-purpose constants 7450 7451 strundefined = typeof undefined, 7452 7453 MAX_NEGATIVE = 1 << 31, 7454 7455 7456 7457 // Array methods 7458 7459 arr = [], 7460 7461 pop = arr.pop, 7462 7463 push = arr.push, 7464 7465 slice = arr.slice, 7466 7467 // Use a stripped-down indexOf if we can't use a native one 7468 7469 indexOf = arr.indexOf || function( elem ) { 7470 7471 var i = 0, 7472 7473 len = this.length; 7474 7475 for ( ; i < len; i++ ) { 7476 7477 if ( this[i] === elem ) { 7478 7479 return i; 7480 7481 } 7482 7483 } 7484 7485 return -1; 7486 7487 }, 7488 7489 7490 7491 7492 7493 // Regular expressions 7494 7495 7496 7497 // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace 7498 7499 whitespace = "[\\x20\\t\\r\\n\\f]", 7500 7501 // http://www.w3.org/TR/css3-syntax/#characters 7502 7503 characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", 7504 7505 7506 7507 // Loosely modeled on CSS identifier characters 7508 7509 // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors 7510 7511 // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier 7512 7513 identifier = characterEncoding.replace( "w", "w#" ), 7514 7515 7516 7517 // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors 7518 7519 operators = "([*^$|!~]?=)", 7520 7521 attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + 7522 7523 "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", 7524 7525 7526 7527 // Prefer arguments quoted, 7528 7529 // then not containing pseudos/brackets, 7530 7531 // then attribute selectors/non-parenthetical expressions, 7532 7533 // then anything else 7534 7535 // These preferences are here to reduce the number of selectors 7536 7537 // needing tokenize in the PSEUDO preFilter 7538 7539 pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", 7540 7541 7542 7543 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter 7544 7545 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), 7546 7547 7548 7549 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), 7550 7551 rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ), 7552 7553 rpseudo = new RegExp( pseudos ), 7554 7555 ridentifier = new RegExp( "^" + identifier + "$" ), 7556 7557 7558 7559 matchExpr = { 7560 7561 "ID": new RegExp( "^#(" + characterEncoding + ")" ), 7562 7563 "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), 7564 7565 "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ), 7566 7567 "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), 7568 7569 "ATTR": new RegExp( "^" + attributes ), 7570 7571 "PSEUDO": new RegExp( "^" + pseudos ), 7572 7573 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + 7574 7575 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + 7576 7577 "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), 7578 7579 // For use in libraries implementing .is() 7580 7581 // We use this for POS matching in `select` 7582 7583 "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + 7584 7585 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) 7586 7587 }, 7588 7589 7590 7591 rsibling = /[\x20\t\r\n\f]*[+~]/, 7592 7593 7594 7595 rnative = /^[^{]+\{\s*\[native code/, 7596 7597 7598 7599 // Easily-parseable/retrievable ID or TAG or CLASS selectors 7600 7601 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 7602 7603 7604
7605 rinputs = /^(?:input|select|textarea|button)$/i, 7606 7607 rheader = /^h\d$/i, 7608 7609 7610 7611 rescape = /'|\\/g, 7612 7613 rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, 7614 7615 7616 7617 // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters 7618 7619 runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g, 7620 7621 funescape = function( _, escaped ) { 7622 7623 var high = "0x" + escaped - 0x10000; 7624 7625 // NaN means non-codepoint 7626 7627 return high !== high ? 7628 7629 escaped : 7630 7631 // BMP codepoint 7632 7633 high < 0 ? 7634 7635 String.fromCharCode( high + 0x10000 ) : 7636 7637 // Supplemental Plane codepoint (surrogate pair) 7638 7639 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); 7640 7641 }; 7642 7643 7644 7645// Use a stripped-down slice if we can't use a native one 7646 7647try { 7648 7649 slice.call( preferredDoc.documentElement.childNodes, 0 )[0].nodeType; 7650 7651} catch ( e ) { 7652 7653 slice = function( i ) { 7654 7655 var elem, 7656 7657 results = []; 7658 7659 while ( (elem = this[i++]) ) { 7660 7661 results.push( elem ); 7662 7663 } 7664 7665 return results; 7666 7667 }; 7668 7669} 7670 7671 7672/** 7673 7674 * For feature detection 7675 7676 * @param {Function} fn The function to test for native support 7677 7678 */ 7679 7680function isNative( fn ) { 7681 7682 return rnative.test( fn + "" ); 7683 7684} 7685 7686 7687 7688/** 7689 7690 * Create key-value caches of limited size 7691 7692 * @returns {Function(string, Object)} Returns the Object data after storing it on itself with 7693 7694 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 7695 7696 * deleting the oldest entry 7697 7698 */ 7699 7700function createCache() { 7701 7702 var cache, 7703 7704 keys = []; 7705 7706 7707 7708 return (cache = function( key, value ) { 7709 7710 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) 7711 7712 if ( keys.push( key += " " ) > Expr.cacheLength ) { 7713 7714 // Only keep the most recent entries 7715 7716 delete cache[ keys.shift() ]; 7717 7718 } 7719 7720 return (cache[ key ] = value); 7721 7722 }); 7723 7724} 7725 7726 7727 7728/** 7729 7730 * Mark a function for special use by Sizzle 7731 7732 * @param {Function} fn The function to mark 7733 7734 */ 7735 7736function markFunction( fn ) { 7737 7738 fn[ expando ] = true; 7739 7740 return fn; 7741 7742} 7743 7744 7745 7746/** 7747 7748 * Support testing using an element 7749 7750 * @param {Function} fn Passed the created div and expects a boolean result 7751 7752 */ 7753 7754function assert( fn ) { 7755 7756 var div = document.createElement("div"); 7757 7758 7759 7760 try { 7761 7762 return fn( div ); 7763 7764 } catch (e) { 7765 7766 return false; 7767 7768 } finally { 7769 7770 // release memory in IE 7771 7772 div = null; 7773 7774 } 7775 7776} 7777 7778 7779 7780function Sizzle( selector, context, results, seed ) { 7781 7782 var match, elem, m, nodeType, 7783 7784 // QSA vars 7785 7786 i, groups, old, nid, newContext, newSelector; 7787 7788 7789 7790 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { 7791 7792 setDocument( context ); 7793 7794 } 7795 7796 7797 7798 context = context || document; 7799 7800 results = results || []; 7801 7802 7803 7804 if ( !selector || typeof selector !== "string" ) { 7805 7806 return results; 7807 7808 } 7809 7810 7811 7812 if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { 7813 7814 return []; 7815 7816 } 7817 7818 7819 7820 if ( !documentIsXML && !seed ) { 7821 7822 7823 7824 // Shortcuts 7825 7826 if ( (match = rquickExpr.exec( selector )) ) { 7827 7828 // Speed-up: Sizzle("#ID") 7829 7830 if ( (m = match[1]) ) { 7831 7832 if ( nodeType === 9 ) { 7833 7834 elem = context.getElementById( m ); 7835 7836 // Check parentNode to catch when Blackberry 4.6 returns 7837 7838 // nodes that are no longer in the document #6963 7839 7840 if ( elem && elem.parentNode ) { 7841 7842 // Handle the case where IE, Opera, and Webkit return items 7843 7844 // by name instead of ID 7845 7846 if ( elem.id === m ) { 7847 7848 results.push( elem ); 7849 7850 return results; 7851 7852 } 7853 7854 } else { 7855 7856 return results; 7857 7858 } 7859 7860 } else { 7861 7862 // Context is not a document 7863 7864 if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && 7865 7866 contains( context, elem ) && elem.id === m ) { 7867 7868 results.push( elem ); 7869 7870 return results; 7871 7872 } 7873 7874 } 7875 7876 7877 7878 // Speed-up: Sizzle("TAG") 7879 7880 } else if ( match[2] ) { 7881 7882 push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) ); 7883 7884 return results; 7885 7886 7887 7888 // Speed-up: Sizzle(".CLASS") 7889 7890 } else if ( (m = match[3]) && support.getByClassName && context.getElementsByClassName ) { 7891 7892 push.apply( results, slice.call(context.getElementsByClassName( m ), 0) ); 7893 7894 return results; 7895 7896 } 7897 7898 } 7899 7900 7901 7902 // QSA path 7903 7904 if ( support.qsa && !rbuggyQSA.test(selector) ) { 7905 7906 old = true; 7907 7908 nid = expando; 7909 7910 newContext = context; 7911 7912 newSelector = nodeType === 9 && selector; 7913 7914 7915 7916 // qSA works strangely on Element-rooted queries 7917 7918 // We can work around this by specifying an extra ID on the root 7919 7920 // and working up from there (Thanks to Andrew Dupont for the technique) 7921 7922 // IE 8 doesn't work on object elements 7923 7924 if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { 7925 7926 groups = tokenize( selector ); 7927 7928 7929 7930 if ( (old = context.getAttribute("id")) ) { 7931 7932 nid = old.replace( rescape, "\\$&" ); 7933 7934 } else { 7935 7936 context.setAttribute( "id", nid ); 7937 7938 } 7939 7940 nid = "[id='" + nid + "'] "; 7941 7942 7943 7944 i = groups.length; 7945 7946 while ( i-- ) { 7947 7948 groups[i] = nid + toSelector( groups[i] ); 7949 7950 } 7951 7952 newContext = rsibling.test( selector ) && context.parentNode || context; 7953 7954 newSelector = groups.join(","); 7955 7956 } 7957 7958 7959 7960 if ( newSelector ) { 7961 7962 try { 7963 7964 push.apply( results, slice.call( newContext.querySelectorAll( 7965 7966 newSelector 7967 7968 ), 0 ) ); 7969 7970 return results; 7971 7972 } catch(qsaError) { 7973 7974 } finally { 7975 7976 if ( !old ) { 7977 7978 context.removeAttribute("id"); 7979 7980 } 7981 7982 } 7983 7984 } 7985 7986 } 7987 7988 } 7989 7990 7991 7992 // All others 7993 7994 return select( selector.replace( rtrim, "$1" ), context, results, seed ); 7995 7996} 7997 7998 7999 8000/** 8001 8002 * Detect xml 8003
8004 * @param {Element|Object} elem An element or a document 8005 8006 */ 8007 8008isXML = Sizzle.isXML = function( elem ) { 8009 8010 // documentElement is verified for cases where it doesn't yet exist 8011 8012 // (such as loading iframes in IE - #4833) 8013 8014 var documentElement = elem && (elem.ownerDocument || elem).documentElement; 8015 8016 return documentElement ? documentElement.nodeName !== "HTML" : false; 8017 8018}; 8019 8020 8021 8022/** 8023 8024 * Sets document-related variables once based on the current document 8025 8026 * @param {Element|Object} [doc] An element or document object to use to set the document 8027 8028 * @returns {Object} Returns the current document 8029 8030 */ 8031 8032setDocument = Sizzle.setDocument = function( node ) { 8033 8034 var doc = node ? node.ownerDocument || node : preferredDoc; 8035 8036 8037 8038 // If no document and documentElement is available, return 8039 8040 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { 8041 8042 return document; 8043 8044 } 8045 8046 8047 8048 // Set our document 8049 8050 document = doc; 8051 8052 docElem = doc.documentElement; 8053 8054 8055 8056 // Support tests 8057 8058 documentIsXML = isXML( doc ); 8059 8060 8061 8062 // Check if getElementsByTagName("*") returns only elements 8063 8064 support.tagNameNoComments = assert(function( div ) { 8065 8066 div.appendChild( doc.createComment("") ); 8067 8068 return !div.getElementsByTagName("*").length; 8069 8070 }); 8071 8072 8073 8074 // Check if attributes should be retrieved by attribute nodes 8075 8076 support.attributes = assert(function( div ) { 8077 8078 div.innerHTML = "<select></select>"; 8079
8080 var type = typeof div.lastChild.getAttribute("multiple"); 8081 8082 // IE8 returns a string for some attributes even when not present 8083 8084 return type !== "boolean" && type !== "string"; 8085 8086 }); 8087 8088 8089 8090 // Check if getElementsByClassName can be trusted 8091 8092 support.getByClassName = assert(function( div ) { 8093 8094 // Opera can't find a second classname (in 9.6) 8095 8096 div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>"; 8097 8098 if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) { 8099 8100 return false; 8101 8102 } 8103 8104 8105 8106 // Safari 3.2 caches class attributes and doesn't catch changes 8107 8108 div.lastChild.className = "e"; 8109 8110 return div.getElementsByClassName("e").length === 2; 8111 8112 }); 8113 8114 8115 8116 // Check if getElementById returns elements by name 8117 8118 // Check if getElementsByName privileges form controls or returns elements by ID 8119 8120 support.getByName = assert(function( div ) { 8121 8122 // Inject content 8123 8124 div.id = expando + 0; 8125 8126 div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>"; 8127 8128 docElem.insertBefore( div, docElem.firstChild ); 8129 8130 8131 8132 // Test 8133 8134 var pass = doc.getElementsByName && 8135 8136 // buggy browsers will return fewer than the correct 2 8137 8138 doc.getElementsByName( expando ).length === 2 + 8139 8140 // buggy browsers will return more than the correct 0 8141 8142 doc.getElementsByName( expando + 0 ).length; 8143 8144 support.getIdNotName = !doc.getElementById( expando ); 8145 8146 8147 8148 // Cleanup 8149 8150 docElem.removeChild( div ); 8151 8152 8153 8154 return pass; 8155 8156 }); 8157 8158 8159 8160 // IE6/7 return modified attributes 8161 8162 Expr.attrHandle = assert(function( div ) { 8163 8164 div.innerHTML = "<a href='#'></a>"; 8165 8166 return div.firstChild && typeof div.firstChild.getAttribute !== strundefined && 8167 8168 div.firstChild.getAttribute("href") === "#"; 8169 8170 }) ? 8171 8172 {} : 8173 8174 { 8175 8176 "href": function( elem ) { 8177 8178 return elem.getAttribute( "href", 2 ); 8179 8180 }, 8181 8182 "type": function( elem ) { 8183 8184 return elem.getAttribute("type"); 8185 8186 } 8187 8188 }; 8189 8190 8191 8192 // ID find and filter 8193 8194 if ( support.getIdNotName ) { 8195 8196 Expr.find["ID"] = function( id, context ) { 8197 8198 if ( typeof context.getElementById !== strundefined && !documentIsXML ) { 8199 8200 var m = context.getElementById( id ); 8201 8202 // Check parentNode to catch when Blackberry 4.6 returns 8203 8204 // nodes that are no longer in the document #6963 8205 8206 return m && m.parentNode ? [m] : []; 8207 8208 } 8209 8210 }; 8211 8212 Expr.filter["ID"] = function( id ) { 8213 8214 var attrId = id.replace( runescape, funescape ); 8215 8216 return function( elem ) { 8217 8218 return elem.getAttribute("id") === attrId; 8219 8220 }; 8221 8222 }; 8223 8224 } else { 8225 8226 Expr.find["ID"] = function( id, context ) { 8227 8228 if ( typeof context.getElementById !== strundefined && !documentIsXML ) { 8229 8230 var m = context.getElementById( id ); 8231 8232 8233 8234 return m ? 8235 8236 m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ? 8237 8238 [m] : 8239 8240 undefined : 8241 8242 []; 8243 8244 } 8245 8246 }; 8247 8248 Expr.filter["ID"] = function( id ) { 8249 8250 var attrId = id.replace( runescape, funescape ); 8251 8252 return function( elem ) { 8253 8254 var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); 8255 8256 return node && node.value === attrId; 8257 8258 }; 8259 8260 }; 8261 8262 } 8263 8264 8265 8266 // Tag 8267 8268 Expr.find["TAG"] = support.tagNameNoComments ? 8269 8270 function( tag, context ) { 8271 8272 if ( typeof context.getElementsByTagName !== strundefined ) { 8273 8274 return context.getElementsByTagName( tag ); 8275 8276 } 8277 8278 } : 8279 8280 function( tag, context ) { 8281 8282 var elem, 8283 8284 tmp = [], 8285 8286 i = 0, 8287 8288 results = context.getElementsByTagName( tag ); 8289 8290 8291 8292 // Filter out possible comments 8293 8294 if ( tag === "*" ) { 8295 8296 while ( (elem = results[i++]) ) { 8297 8298 if ( elem.nodeType === 1 ) { 8299 8300 tmp.push( elem ); 8301 8302 } 8303 8304 } 8305 8306 8307 8308 return tmp; 8309 8310 } 8311 8312 return results; 8313 8314 }; 8315 8316 8317 8318 // Name 8319 8320 Expr.find["NAME"] = support.getByName && function( tag, context ) { 8321 8322 if ( typeof context.getElementsByName !== strundefined ) { 8323 8324 return context.getElementsByName( name ); 8325 8326 } 8327 8328 }; 8329 8330 8331 8332 // Class 8333 8334 Expr.find["CLASS"] = support.getByClassName && function( className, context ) { 8335 8336 if ( typeof context.getElementsByClassName !== strundefined && !documentIsXML ) { 8337 8338 return context.getElementsByClassName( className ); 8339 8340 } 8341 8342 }; 8343 8344 8345 8346 // QSA and matchesSelector support 8347 8348 8349 8350 // matchesSelector(:active) reports false when true (IE9/Opera 11.5) 8351 8352 rbuggyMatches = []; 8353 8354 8355 8356 // qSa(:focus) reports false when true (Chrome 21), 8357
8358 // no need to also add to buggyMatches since matches checks buggyQSA 8359 8360 // A support test would require too much code (would include document ready) 8361 8362 rbuggyQSA = [ ":focus" ]; 8363 8364 8365 8366 if ( (support.qsa = isNative(doc.querySelectorAll)) ) { 8367 8368 // Build QSA regex 8369 8370 // Regex strategy adopted from Diego Perini 8371 8372 assert(function( div ) { 8373 8374 // Select is set to empty string on purpose 8375 8376 // This is to test IE's treatment of not explictly 8377 8378 // setting a boolean content attribute, 8379 8380 // since its presence should be enough 8381 8382 // http://bugs.jquery.com/ticket/12359 8383 8384 div.innerHTML = "<select><option selected=''></option></select>"; 8385 8386 8387 8388 // IE8 - Some boolean attributes are not treated correctly 8389 8390 if ( !div.querySelectorAll("[selected]").length ) { 8391 8392 rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" ); 8393 8394 } 8395 8396 8397 8398 // Webkit/Opera - :checked should return selected option elements 8399 8400 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 8401 8402 // IE8 throws error here and will not see later tests 8403 8404 if ( !div.querySelectorAll(":checked").length ) { 8405 8406 rbuggyQSA.push(":checked"); 8407 8408 } 8409 8410 }); 8411 8412 8413 8414 assert(function( div ) { 8415 8416 8417 8418 // Opera 10-12/IE8 - ^= $= *= and empty values 8419 8420 // Should not select anything 8421 8422 div.innerHTML = "<input type='hidden' i=''/>"; 8423 8424 if ( div.querySelectorAll("[i^='']").length ) { 8425 8426 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" ); 8427 8428 } 8429 8430 8431 8432 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) 8433 8434 // IE8 throws error here and will not see later tests 8435 8436 if ( !div.querySelectorAll(":enabled").length ) { 8437 8438 rbuggyQSA.push( ":enabled", ":disabled" ); 8439 8440 } 8441 8442 8443 8444 // Opera 10-11 does not throw on post-comma invalid pseudos 8445 8446 div.querySelectorAll("*,:x"); 8447 8448 rbuggyQSA.push(",.*:"); 8449 8450 }); 8451 8452 } 8453 8454 8455 8456 if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector || 8457 8458 docElem.mozMatchesSelector || 8459 8460 docElem.webkitMatchesSelector || 8461 8462 docElem.oMatchesSelector || 8463 8464 docElem.msMatchesSelector) )) ) { 8465 8466 8467 8468 assert(function( div ) { 8469 8470 // Check to see if it's possible to do matchesSelector 8471 8472 // on a disconnected node (IE 9) 8473 8474 support.disconnectedMatch = matches.call( div, "div" ); 8475 8476 8477 8478 // This should fail with an exception 8479 8480 // Gecko does not error, returns false instead 8481 8482 matches.call( div, "[s!='']:x" ); 8483 8484 rbuggyMatches.push( "!=", pseudos ); 8485 8486 }); 8487 8488 } 8489 8490 8491 8492 rbuggyQSA = new RegExp( rbuggyQSA.join("|") ); 8493 8494 rbuggyMatches = new RegExp( rbuggyMatches.join("|") ); 8495 8496 8497 8498 // Element contains another 8499 8500 // Purposefully does not implement inclusive descendent 8501 8502 // As in, an element does not contain itself 8503 8504 contains = isNative(docElem.contains) || docElem.compareDocumentPosition ? 8505 8506 function( a, b ) { 8507 8508 var adown = a.nodeType === 9 ? a.documentElement : a, 8509 8510 bup = b && b.parentNode; 8511 8512 return a === bup || !!( bup && bup.nodeType === 1 && ( 8513 8514 adown.contains ? 8515 8516 adown.contains( bup ) : 8517 8518 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 8519 8520 )); 8521 8522 } : 8523 8524 function( a, b ) { 8525 8526 if ( b ) { 8527 8528 while ( (b = b.parentNode) ) { 8529 8530 if ( b === a ) { 8531 8532 return true; 8533 8534 } 8535 8536 } 8537 8538 } 8539 8540 return false; 8541 8542 }; 8543 8544 8545 8546 // Document order sorting 8547 8548 sortOrder = docElem.compareDocumentPosition ? 8549 8550 function( a, b ) { 8551 8552 var compare; 8553 8554 8555 8556 if ( a === b ) { 8557 8558 hasDuplicate = true; 8559 8560 return 0; 8561 8562 } 8563 8564 8565 8566 if ( (compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b )) ) { 8567 8568 if ( compare & 1 || a.parentNode && a.parentNode.nodeType === 11 ) { 8569 8570 if ( a === doc || contains( preferredDoc, a ) ) { 8571 8572 return -1; 8573 8574 } 8575 8576 if ( b === doc || contains( preferredDoc, b ) ) { 8577 8578 return 1; 8579 8580 } 8581 8582 return 0; 8583 8584 } 8585 8586 return compare & 4 ? -1 : 1; 8587 8588 } 8589 8590 8591 8592 return a.compareDocumentPosition ? -1 : 1; 8593 8594 } : 8595 8596 function( a, b ) { 8597 8598 var cur, 8599 8600 i = 0, 8601 8602 aup = a.parentNode, 8603 8604 bup = b.parentNode, 8605 8606 ap = [ a ], 8607 8608 bp = [ b ]; 8609 8610 8611 8612 // Exit early if the nodes are identical 8613 8614 if ( a === b ) { 8615 8616 hasDuplicate = true; 8617 8618 return 0; 8619 8620 8621 8622 // Parentless nodes are either documents or disconnected 8623 8624 } else if ( !aup || !bup ) { 8625 8626 return a === doc ? -1 : 8627 8628 b === doc ? 1 : 8629 8630 aup ? -1 : 8631 8632 bup ? 1 : 8633 8634 0; 8635 8636 8637 8638 // If the nodes are siblings, we can do a quick check 8639 8640 } else if ( aup === bup ) { 8641 8642 return siblingCheck( a, b ); 8643 8644 } 8645 8646 8647 8648 // Otherwise we need full lists of their ancestors for comparison 8649 8650 cur = a; 8651 8652 while ( (cur = cur.parentNode) ) { 8653 8654 ap.unshift( cur ); 8655 8656 } 8657 8658 cur = b; 8659 8660 while ( (cur = cur.parentNode) ) { 8661 8662 bp.unshift( cur ); 8663 8664 } 8665 8666 8667 8668 // Walk down the tree looking for a discrepancy 8669 8670 while ( ap[i] === bp[i] ) { 8671 8672 i++; 8673 8674 } 8675 8676 8677 8678 return i ? 8679 8680 // Do a sibling check if the nodes have a common ancestor 8681 8682 siblingCheck( ap[i], bp[i] ) : 8683 8684 8685 8686 // Otherwise nodes in our document sort first 8687 8688 ap[i] === preferredDoc ? -1 : 8689 8690 bp[i] === preferredDoc ? 1 : 8691 8692 0; 8693 8694 }; 8695 8696 8697 8698 // Always assume the presence of duplicates if sort doesn't 8699 8700 // pass them to our comparison function (as in Google Chrome). 8701 8702 hasDuplicate = false;
8703 8704 [0, 0].sort( sortOrder ); 8705 8706 support.detectDuplicates = hasDuplicate; 8707 8708 8709 8710 return document; 8711 8712}; 8713 8714 8715 8716Sizzle.matches = function( expr, elements ) { 8717 8718 return Sizzle( expr, null, null, elements ); 8719 8720}; 8721 8722 8723 8724Sizzle.matchesSelector = function( elem, expr ) { 8725 8726 // Set document vars if needed 8727 8728 if ( ( elem.ownerDocument || elem ) !== document ) { 8729 8730 setDocument( elem ); 8731 8732 } 8733 8734 8735 8736 // Make sure that attribute selectors are quoted 8737 8738 expr = expr.replace( rattributeQuotes, "='$1']" ); 8739 8740 8741 8742 // rbuggyQSA always contains :focus, so no need for an existence check 8743 8744 if ( support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) { 8745 8746 try { 8747 8748 var ret = matches.call( elem, expr ); 8749 8750 8751 8752 // IE 9's matchesSelector returns false on disconnected nodes 8753 8754 if ( ret || support.disconnectedMatch || 8755 8756 // As well, disconnected nodes are said to be in a document 8757 8758 // fragment in IE 9 8759 8760 elem.document && elem.document.nodeType !== 11 ) { 8761 8762 return ret; 8763 8764 } 8765 8766 } catch(e) {} 8767 8768 } 8769 8770 8771 8772 return Sizzle( expr, document, null, [elem] ).length > 0; 8773 8774}; 8775 8776 8777 8778Sizzle.contains = function( context, elem ) { 8779 8780 // Set document vars if needed 8781 8782 if ( ( context.ownerDocument || context ) !== document ) { 8783 8784 setDocument( context ); 8785 8786 } 8787 8788 return contains( context, elem ); 8789 8790}; 8791 8792 8793 8794Sizzle.attr = function( elem, name ) { 8795 8796 var val; 8797 8798 8799 8800 // Set document vars if needed 8801 8802 if ( ( elem.ownerDocument || elem ) !== document ) { 8803 8804 setDocument( elem ); 8805 8806 } 8807 8808 8809 8810 if ( !documentIsXML ) { 8811 8812 name = name.toLowerCase(); 8813 8814 } 8815 8816 if ( (val = Expr.attrHandle[ name ]) ) { 8817 8818 return val( elem ); 8819 8820 } 8821 8822 if ( documentIsXML || support.attributes ) { 8823 8824 return elem.getAttribute( name ); 8825 8826 } 8827 8828 return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ? 8829 8830 name : 8831 8832 val && val.specified ? val.value : null; 8833 8834}; 8835 8836 8837 8838Sizzle.error = function( msg ) { 8839 8840 throw new Error( "Syntax error, unrecognized expression: " + msg ); 8841 8842}; 8843 8844 8845 8846// Document sorting and removing duplicates 8847 8848Sizzle.uniqueSort = function( results ) { 8849 8850 var elem, 8851 8852 duplicates = [], 8853 8854 i = 1, 8855 8856 j = 0; 8857 8858 8859 8860 // Unless we *know* we can detect duplicates, assume their presence 8861 8862 hasDuplicate = !support.detectDuplicates; 8863 8864 results.sort( sortOrder ); 8865 8866 8867 8868 if ( hasDuplicate ) { 8869 8870 for ( ; (elem = results[i]); i++ ) { 8871 8872 if ( elem === results[ i - 1 ] ) { 8873 8874 j = duplicates.push( i ); 8875 8876 } 8877 8878 } 8879 8880 while ( j-- ) { 8881 8882 results.splice( duplicates[ j ], 1 ); 8883 8884 } 8885 8886 } 8887 8888 8889 8890 return results; 8891 8892}; 8893 8894 8895 8896function siblingCheck( a, b ) { 8897 8898 var cur = b && a, 8899 8900 diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); 8901 8902 8903 8904 // Use IE sourceIndex if available on both nodes 8905 8906 if ( diff ) { 8907 8908 return diff; 8909 8910 } 8911 8912 8913 8914 // Check if b follows a 8915 8916 if ( cur ) { 8917 8918 while ( (cur = cur.nextSibling) ) { 8919 8920 if ( cur === b ) { 8921 8922 return -1; 8923 8924 } 8925 8926 } 8927 8928 } 8929 8930 8931 8932 return a ? 1 : -1; 8933 8934} 8935 8936 8937 8938// Returns a function to use in pseudos for input types 8939 8940function createInputPseudo( type ) { 8941 8942 return function( elem ) { 8943 8944 var name = elem.nodeName.toLowerCase(); 8945 8946 return name === "input" && elem.type === type; 8947 8948 }; 8949 8950} 8951 8952 8953 8954// Returns a function to use in pseudos for buttons 8955 8956function createButtonPseudo( type ) { 8957 8958 return function( elem ) { 8959 8960 var name = elem.nodeName.toLowerCase(); 8961 8962 return (name === "input" || name === "button") && elem.type === type; 8963 8964 }; 8965 8966} 8967 8968 8969 8970// Returns a function to use in pseudos for positionals 8971 8972function createPositionalPseudo( fn ) { 8973 8974 return markFunction(function( argument ) { 8975 8976 argument = +argument; 8977 8978 return markFunction(function( seed, matches ) { 8979 8980 var j, 8981 8982 matchIndexes = fn( [], seed.length, argument ), 8983 8984 i = matchIndexes.length; 8985 8986 8987 8988 // Match elements found at the specified indexes 8989 8990 while ( i-- ) { 8991 8992 if ( seed[ (j = matchIndexes[i]) ] ) { 8993 8994 seed[j] = !(matches[j] = seed[j]); 8995 8996 } 8997 8998 } 8999 9000 }); 9001 9002 }); 9003 9004} 9005 9006 9007 9008/** 9009 9010 * Utility function for retrieving the text value of an array of DOM nodes 9011 9012 * @param {Array|Element} elem 9013 9014 */ 9015 9016getText = Sizzle.getText = function( elem ) { 9017 9018 var node, 9019 9020 ret = "", 9021 9022 i = 0, 9023 9024 nodeType = elem.nodeType; 9025 9026 9027 9028 if ( !nodeType ) { 9029 9030 // If no nodeType, this is expected to be an array 9031 9032 for ( ; (node = elem[i]); i++ ) { 9033
vendor: 22,010 bytes, lines 9034-10544
9034 // Do not traverse comment nodes 9035 9036 ret += getText( node ); 9037 9038 } 9039 9040 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { 9041 9042 // Use textContent for elements 9043 9044 // innerText usage removed for consistency of new lines (see #11153) 9045 9046 if ( typeof elem.textContent === "string" ) { 9047 9048 return elem.textContent; 9049 9050 } else { 9051 9052 // Traverse its children 9053 9054 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 9055 9056 ret += getText( elem ); 9057 9058 } 9059 9060 } 9061 9062 } else if ( nodeType === 3 || nodeType === 4 ) { 9063 9064 return elem.nodeValue; 9065 9066 } 9067 9068 // Do not include comment or processing instruction nodes 9069 9070 9071 9072 return ret; 9073 9074}; 9075 9076 9077 9078Expr = Sizzle.selectors = { 9079 9080 9081 9082 // Can be adjusted by the user 9083 9084 cacheLength: 50, 9085 9086 9087 9088 createPseudo: markFunction, 9089 9090 9091 9092 match: matchExpr, 9093 9094 9095 9096 find: {}, 9097 9098 9099 9100 relative: { 9101 9102 ">": { dir: "parentNode", first: true }, 9103 9104 " ": { dir: "parentNode" }, 9105 9106 "+": { dir: "previousSibling", first: true }, 9107 9108 "~": { dir: "previousSibling" } 9109 9110 }, 9111 9112 9113 9114 preFilter: { 9115 9116 "ATTR": function( match ) { 9117 9118 match[1] = match[1].replace( runescape, funescape ); 9119 9120 9121 9122 // Move the given value to match[3] whether quoted or unquoted 9123 9124 match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); 9125 9126 9127 9128 if ( match[2] === "~=" ) { 9129 9130 match[3] = " " + match[3] + " "; 9131 9132 } 9133 9134 9135 9136 return match.slice( 0, 4 ); 9137 9138 }, 9139 9140 9141 9142 "CHILD": function( match ) { 9143 9144 /* matches from matchExpr["CHILD"] 9145 9146 1 type (only|nth|...) 9147 9148 2 what (child|of-type) 9149 9150 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 9151 9152 4 xn-component of xn+y argument ([+-]?\d*n|) 9153 9154 5 sign of xn-component 9155 9156 6 x of xn-component 9157 9158 7 sign of y-component 9159 9160 8 y of y-component 9161 9162 */ 9163 9164 match[1] = match[1].toLowerCase(); 9165 9166 9167 9168 if ( match[1].slice( 0, 3 ) === "nth" ) { 9169 9170 // nth-* requires argument 9171 9172 if ( !match[3] ) { 9173 9174 Sizzle.error( match[0] ); 9175 9176 } 9177 9178 9179 9180 // numeric x and y parameters for Expr.filter.CHILD 9181 9182 // remember that false/true cast respectively to 0/1 9183 9184 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); 9185 9186 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); 9187 9188 9189 9190 // other types prohibit arguments 9191 9192 } else if ( match[3] ) { 9193 9194 Sizzle.error( match[0] ); 9195 9196 } 9197 9198 9199 9200 return match; 9201 9202 }, 9203 9204 9205 9206 "PSEUDO": function( match ) { 9207 9208 var excess, 9209 9210 unquoted = !match[5] && match[2]; 9211 9212 9213 9214 if ( matchExpr["CHILD"].test( match[0] ) ) { 9215 9216 return null; 9217 9218 } 9219 9220 9221 9222 // Accept quoted arguments as-is 9223 9224 if ( match[4] ) { 9225 9226 match[2] = match[4]; 9227 9228 9229 9230 // Strip excess characters from unquoted arguments 9231 9232 } else if ( unquoted && rpseudo.test( unquoted ) && 9233 9234 // Get excess from tokenize (recursively) 9235 9236 (excess = tokenize( unquoted, true )) && 9237 9238 // advance to the next closing parenthesis 9239 9240 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { 9241 9242 9243 9244 // excess is a negative index 9245 9246 match[0] = match[0].slice( 0, excess ); 9247 9248 match[2] = unquoted.slice( 0, excess ); 9249 9250 } 9251 9252 9253 9254 // Return only captures needed by the pseudo filter method (type and argument) 9255 9256 return match.slice( 0, 3 ); 9257 9258 } 9259 9260 }, 9261 9262 9263 9264 filter: { 9265 9266 9267 9268 "TAG": function( nodeName ) { 9269 9270 if ( nodeName === "*" ) { 9271 9272 return function() { return true; }; 9273 9274 } 9275 9276 9277 9278 nodeName = nodeName.replace( runescape, funescape ).toLowerCase(); 9279 9280 return function( elem ) { 9281 9282 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; 9283 9284 }; 9285 9286 }, 9287 9288 9289 9290 "CLASS": function( className ) { 9291 9292 var pattern = classCache[ className + " " ]; 9293 9294 9295 9296 return pattern || 9297 9298 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && 9299 9300 classCache( className, function( elem ) { 9301 9302 return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" ); 9303 9304 }); 9305 9306 }, 9307 9308 9309 9310 "ATTR": function( name, operator, check ) { 9311 9312 return function( elem ) { 9313 9314 var result = Sizzle.attr( elem, name ); 9315 9316 9317 9318 if ( result == null ) { 9319 9320 return operator === "!="; 9321 9322 } 9323 9324 if ( !operator ) { 9325 9326 return true; 9327 9328 } 9329 9330 9331 9332 result += ""; 9333 9334 9335 9336 return operator === "=" ? result === check : 9337 9338 operator === "!=" ? result !== check : 9339 9340 operator === "^=" ? check && result.indexOf( check ) === 0 : 9341 9342 operator === "*=" ? check && result.indexOf( check ) > -1 : 9343 9344 operator === "$=" ? check && result.slice( -check.length ) === check : 9345 9346 operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : 9347 9348 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : 9349 9350 false; 9351 9352 }; 9353 9354 }, 9355 9356 9357 9358 "CHILD": function( type, what, argument, first, last ) { 9359 9360 var simple = type.slice( 0, 3 ) !== "nth", 9361 9362 forward = type.slice( -4 ) !== "last", 9363 9364 ofType = what === "of-type"; 9365 9366 9367 9368 return first === 1 && last === 0 ? 9369 9370 9371 9372 // Shortcut for :nth-*(n) 9373 9374 function( elem ) { 9375 9376 return !!elem.parentNode; 9377 9378 } : 9379 9380 9381 9382 function( elem, context, xml ) { 9383 9384 var cache, outerCache, node, diff, nodeIndex, start, 9385 9386 dir = simple !== forward ? "nextSibling" : "previousSibling", 9387 9388 parent = elem.parentNode, 9389 9390 name = ofType && elem.nodeName.toLowerCase(), 9391 9392 useCache = !xml && !ofType; 9393 9394 9395 9396 if ( parent ) { 9397 9398 9399 9400 // :(first|last|only)-(child|of-type) 9401 9402 if ( simple ) { 9403 9404 while ( dir ) { 9405 9406 node = elem; 9407 9408 while ( (node = node[ dir ]) ) { 9409 9410 if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { 9411 9412 return false; 9413 9414 } 9415 9416 } 9417 9418 // Reverse direction for :only-* (if we haven't yet done so) 9419 9420 start = dir = type === "only" && !start && "nextSibling"; 9421 9422 } 9423 9424 return true; 9425 9426 } 9427 9428 9429 9430 start = [ forward ? parent.firstChild : parent.lastChild ]; 9431 9432 9433 9434 // non-xml :nth-child(...) stores cache data on `parent` 9435 9436 if ( forward && useCache ) { 9437 9438 // Seek `elem` from a previously-cached index 9439 9440 outerCache = parent[ expando ] || (parent[ expando ] = {}); 9441 9442 cache = outerCache[ type ] || []; 9443 9444 nodeIndex = cache[0] === dirruns && cache[1]; 9445 9446 diff = cache[0] === dirruns && cache[2]; 9447 9448 node = nodeIndex && parent.childNodes[ nodeIndex ]; 9449 9450 9451 9452 while ( (node = ++nodeIndex && node && node[ dir ] || 9453 9454 9455 9456 // Fallback to seeking `elem` from the start 9457 9458 (diff = nodeIndex = 0) || start.pop()) ) { 9459 9460 9461 9462 // When found, cache indexes on `parent` and break 9463 9464 if ( node.nodeType === 1 && ++diff && node === elem ) { 9465 9466 outerCache[ type ] = [ dirruns, nodeIndex, diff ]; 9467 9468 break; 9469 9470 } 9471 9472 } 9473 9474 9475 9476 // Use previously-cached element index if available 9477 9478 } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { 9479 9480 diff = cache[1]; 9481 9482 9483 9484 // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) 9485 9486 } else { 9487 9488 // Use the same loop as above to seek `elem` from the start 9489 9490 while ( (node = ++nodeIndex && node && node[ dir ] || 9491 9492 (diff = nodeIndex = 0) || start.pop()) ) { 9493 9494 9495 9496 if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { 9497 9498 // Cache the index of each encountered element 9499 9500 if ( useCache ) { 9501 9502 (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; 9503 9504 } 9505 9506 9507 9508 if ( node === elem ) { 9509 9510 break; 9511 9512 } 9513 9514 } 9515 9516 } 9517 9518 } 9519 9520 9521 9522 // Incorporate the offset, then check against cycle size 9523 9524 diff -= last; 9525 9526 return diff === first || ( diff % first === 0 && diff / first >= 0 ); 9527 9528 } 9529 9530 }; 9531 9532 }, 9533 9534 9535 9536 "PSEUDO": function( pseudo, argument ) { 9537 9538 // pseudo-class names are case-insensitive 9539 9540 // http://www.w3.org/TR/selectors/#pseudo-classes 9541 9542 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters 9543 9544 // Remember that setFilters inherits from pseudos 9545 9546 var args, 9547 9548 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || 9549 9550 Sizzle.error( "unsupported pseudo: " + pseudo ); 9551 9552 9553 9554 // The user may use createPseudo to indicate that 9555 9556 // arguments are needed to create the filter function 9557 9558 // just as Sizzle does 9559 9560 if ( fn[ expando ] ) { 9561 9562 return fn( argument ); 9563 9564 } 9565 9566 9567 9568 // But maintain support for old signatures 9569 9570 if ( fn.length > 1 ) { 9571 9572 args = [ pseudo, pseudo, "", argument ]; 9573 9574 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? 9575 9576 markFunction(function( seed, matches ) { 9577 9578 var idx, 9579 9580 matched = fn( seed, argument ), 9581 9582 i = matched.length; 9583 9584 while ( i-- ) { 9585 9586 idx = indexOf.call( seed, matched[i] ); 9587 9588 seed[ idx ] = !( matches[ idx ] = matched[i] ); 9589 9590 } 9591 9592 }) : 9593 9594 function( elem ) { 9595 9596 return fn( elem, 0, args ); 9597 9598 }; 9599 9600 } 9601 9602 9603 9604 return fn; 9605 9606 } 9607 9608 }, 9609 9610 9611 9612 pseudos: { 9613 9614 // Potentially complex pseudos 9615 9616 "not": markFunction(function( selector ) { 9617 9618 // Trim the selector passed to compile 9619 9620 // to avoid treating leading and trailing 9621 9622 // spaces as combinators 9623 9624 var input = [], 9625 9626 results = [], 9627 9628 matcher = compile( selector.replace( rtrim, "$1" ) ); 9629 9630 9631 9632 return matcher[ expando ] ? 9633 9634 markFunction(function( seed, matches, context, xml ) { 9635 9636 var elem, 9637 9638 unmatched = matcher( seed, null, xml, [] ), 9639 9640 i = seed.length; 9641 9642 9643 9644 // Match elements unmatched by `matcher` 9645 9646 while ( i-- ) { 9647 9648 if ( (elem = unmatched[i]) ) { 9649 9650 seed[i] = !(matches[i] = elem); 9651 9652 } 9653 9654 } 9655 9656 }) : 9657 9658 function( elem, context, xml ) { 9659 9660 input[0] = elem; 9661 9662 matcher( input, null, xml, results ); 9663 9664 return !results.pop(); 9665 9666 }; 9667 9668 }), 9669 9670 9671 9672 "has": markFunction(function( selector ) { 9673 9674 return function( elem ) { 9675 9676 return Sizzle( selector, elem ).length > 0; 9677 9678 }; 9679 9680 }), 9681 9682 9683 9684 "contains": markFunction(function( text ) { 9685 9686 return function( elem ) { 9687 9688 return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; 9689 9690 }; 9691 9692 }), 9693 9694 9695 9696 // "Whether an element is represented by a :lang() selector 9697 9698 // is based solely on the element's language value 9699 9700 // being equal to the identifier C, 9701 9702 // or beginning with the identifier C immediately followed by "-". 9703 9704 // The matching of C against the element's language value is performed case-insensitively. 9705 9706 // The identifier C does not have to be a valid language name." 9707 9708 // http://www.w3.org/TR/selectors/#lang-pseudo 9709 9710 "lang": markFunction( function( lang ) { 9711 9712 // lang value must be a valid identifider 9713 9714 if ( !ridentifier.test(lang || "") ) { 9715 9716 Sizzle.error( "unsupported lang: " + lang ); 9717 9718 } 9719 9720 lang = lang.replace( runescape, funescape ).toLowerCase(); 9721 9722 return function( elem ) { 9723 9724 var elemLang; 9725 9726 do { 9727 9728 if ( (elemLang = documentIsXML ? 9729 9730 elem.getAttribute("xml:lang") || elem.getAttribute("lang") : 9731 9732 elem.lang) ) { 9733 9734 9735 9736 elemLang = elemLang.toLowerCase(); 9737 9738 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; 9739 9740 } 9741 9742 } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); 9743 9744 return false; 9745 9746 }; 9747 9748 }), 9749 9750 9751 9752 // Miscellaneous 9753 9754 "target": function( elem ) { 9755 9756 var hash = window.location && window.location.hash; 9757 9758 return hash && hash.slice( 1 ) === elem.id; 9759 9760 }, 9761 9762 9763 9764 "root": function( elem ) { 9765 9766 return elem === docElem; 9767 9768 }, 9769 9770 9771 9772 "focus": function( elem ) { 9773 9774 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); 9775 9776 }, 9777 9778 9779 9780 // Boolean properties 9781 9782 "enabled": function( elem ) { 9783 9784 return elem.disabled === false; 9785 9786 }, 9787 9788 9789 9790 "disabled": function( elem ) { 9791 9792 return elem.disabled === true; 9793 9794 }, 9795 9796 9797 9798 "checked": function( elem ) { 9799 9800 // In CSS3, :checked should return both checked and selected elements 9801 9802 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 9803 9804 var nodeName = elem.nodeName.toLowerCase(); 9805 9806 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); 9807 9808 }, 9809 9810 9811 9812 "selected": function( elem ) { 9813 9814 // Accessing this property makes selected-by-default 9815 9816 // options in Safari work properly 9817 9818 if ( elem.parentNode ) { 9819 9820 elem.parentNode.selectedIndex; 9821 9822 } 9823 9824 9825 9826 return elem.selected === true; 9827 9828 }, 9829 9830 9831 9832 // Contents 9833 9834 "empty": function( elem ) { 9835 9836 // http://www.w3.org/TR/selectors/#empty-pseudo 9837 9838 // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), 9839 9840 // not comment, processing instructions, or others 9841 9842 // Thanks to Diego Perini for the nodeName shortcut 9843 9844 // Greater than "@" means alpha characters (specifically not starting with "#" or "?") 9845 9846 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 9847 9848 if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { 9849 9850 return false; 9851 9852 } 9853 9854 } 9855 9856 return true; 9857 9858 }, 9859 9860 9861 9862 "parent": function( elem ) { 9863 9864 return !Expr.pseudos["empty"]( elem ); 9865 9866 }, 9867 9868 9869 9870 // Element/input types 9871 9872 "header": function( elem ) { 9873 9874 return rheader.test( elem.nodeName ); 9875 9876 }, 9877 9878 9879 9880 "input": function( elem ) { 9881 9882 return rinputs.test( elem.nodeName ); 9883 9884 }, 9885 9886 9887 9888 "button": function( elem ) { 9889 9890 var name = elem.nodeName.toLowerCase(); 9891 9892 return name === "input" && elem.type === "button" || name === "button"; 9893 9894 }, 9895 9896 9897 9898 "text": function( elem ) { 9899 9900 var attr; 9901 9902 // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) 9903 9904 // use getAttribute instead to test this case 9905 9906 return elem.nodeName.toLowerCase() === "input" && 9907 9908 elem.type === "text" && 9909 9910 ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); 9911 9912 }, 9913 9914 9915 9916 // Position-in-collection 9917 9918 "first": createPositionalPseudo(function() { 9919 9920 return [ 0 ]; 9921 9922 }), 9923 9924 9925 9926 "last": createPositionalPseudo(function( matchIndexes, length ) { 9927 9928 return [ length - 1 ]; 9929 9930 }), 9931 9932 9933 9934 "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { 9935 9936 return [ argument < 0 ? argument + length : argument ]; 9937 9938 }), 9939 9940 9941 9942 "even": createPositionalPseudo(function( matchIndexes, length ) { 9943 9944 var i = 0; 9945 9946 for ( ; i < length; i += 2 ) { 9947 9948 matchIndexes.push( i ); 9949 9950 } 9951 9952 return matchIndexes; 9953 9954 }), 9955 9956 9957 9958 "odd": createPositionalPseudo(function( matchIndexes, length ) { 9959 9960 var i = 1; 9961 9962 for ( ; i < length; i += 2 ) { 9963 9964 matchIndexes.push( i ); 9965 9966 } 9967 9968 return matchIndexes; 9969 9970 }), 9971 9972 9973 9974 "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { 9975 9976 var i = argument < 0 ? argument + length : argument; 9977 9978 for ( ; --i >= 0; ) { 9979 9980 matchIndexes.push( i ); 9981 9982 } 9983 9984 return matchIndexes; 9985 9986 }), 9987 9988 9989 9990 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { 9991 9992 var i = argument < 0 ? argument + length : argument; 9993 9994 for ( ; ++i < length; ) { 9995 9996 matchIndexes.push( i ); 9997 9998 } 9999 10000 return matchIndexes; 10001 10002 }) 10003 10004 } 10005 10006}; 10007 10008 10009 10010// Add button/input type pseudos 10011 10012for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { 10013 10014 Expr.pseudos[ i ] = createInputPseudo( i ); 10015 10016} 10017 10018for ( i in { submit: true, reset: true } ) { 10019 10020 Expr.pseudos[ i ] = createButtonPseudo( i ); 10021 10022} 10023 10024 10025 10026function tokenize( selector, parseOnly ) { 10027 10028 var matched, match, tokens, type, 10029 10030 soFar, groups, preFilters, 10031 10032 cached = tokenCache[ selector + " " ]; 10033 10034 10035 10036 if ( cached ) { 10037 10038 return parseOnly ? 0 : cached.slice( 0 ); 10039 10040 } 10041 10042 10043 10044 soFar = selector; 10045 10046 groups = []; 10047 10048 preFilters = Expr.preFilter; 10049 10050 10051 10052 while ( soFar ) { 10053 10054 10055 10056 // Comma and first run 10057 10058 if ( !matched || (match = rcomma.exec( soFar )) ) { 10059 10060 if ( match ) { 10061 10062 // Don't consume trailing commas as valid 10063 10064 soFar = soFar.slice( match[0].length ) || soFar; 10065 10066 } 10067 10068 groups.push( tokens = [] ); 10069 10070 } 10071 10072 10073 10074 matched = false; 10075 10076 10077 10078 // Combinators 10079 10080 if ( (match = rcombinators.exec( soFar )) ) { 10081 10082 matched = match.shift(); 10083 10084 tokens.push( { 10085 10086 value: matched, 10087 10088 // Cast descendant combinators to space 10089 10090 type: match[0].replace( rtrim, " " ) 10091 10092 } ); 10093 10094 soFar = soFar.slice( matched.length ); 10095 10096 } 10097 10098 10099 10100 // Filters 10101 10102 for ( type in Expr.filter ) { 10103 10104 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || 10105 10106 (match = preFilters[ type ]( match ))) ) { 10107 10108 matched = match.shift(); 10109 10110 tokens.push( { 10111 10112 value: matched, 10113 10114 type: type, 10115 10116 matches: match 10117 10118 } ); 10119 10120 soFar = soFar.slice( matched.length ); 10121 10122 } 10123 10124 } 10125 10126 10127 10128 if ( !matched ) { 10129 10130 break; 10131 10132 } 10133 10134 } 10135 10136 10137 10138 // Return the length of the invalid excess 10139 10140 // if we're just parsing 10141 10142 // Otherwise, throw an error or return tokens 10143 10144 return parseOnly ? 10145 10146 soFar.length : 10147 10148 soFar ? 10149 10150 Sizzle.error( selector ) : 10151 10152 // Cache the tokens 10153 10154 tokenCache( selector, groups ).slice( 0 ); 10155 10156} 10157 10158 10159 10160function toSelector( tokens ) { 10161 10162 var i = 0, 10163 10164 len = tokens.length, 10165 10166 selector = ""; 10167 10168 for ( ; i < len; i++ ) { 10169 10170 selector += tokens[i].value; 10171 10172 } 10173 10174 return selector; 10175 10176} 10177 10178 10179 10180function addCombinator( matcher, combinator, base ) { 10181 10182 var dir = combinator.dir, 10183 10184 checkNonElements = base && dir === "parentNode", 10185 10186 doneName = done++; 10187 10188 10189 10190 return combinator.first ? 10191 10192 // Check against closest ancestor/preceding element 10193 10194 function( elem, context, xml ) { 10195 10196 while ( (elem = elem[ dir ]) ) { 10197 10198 if ( elem.nodeType === 1 || checkNonElements ) { 10199 10200 return matcher( elem, context, xml ); 10201 10202 } 10203 10204 } 10205 10206 } : 10207 10208 10209 10210 // Check against all ancestor/preceding elements 10211 10212 function( elem, context, xml ) { 10213 10214 var data, cache, outerCache, 10215 10216 dirkey = dirruns + " " + doneName; 10217 10218 10219 10220 // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching 10221 10222 if ( xml ) { 10223 10224 while ( (elem = elem[ dir ]) ) { 10225 10226 if ( elem.nodeType === 1 || checkNonElements ) { 10227 10228 if ( matcher( elem, context, xml ) ) { 10229 10230 return true; 10231 10232 } 10233 10234 } 10235 10236 } 10237 10238 } else { 10239 10240 while ( (elem = elem[ dir ]) ) { 10241 10242 if ( elem.nodeType === 1 || checkNonElements ) { 10243 10244 outerCache = elem[ expando ] || (elem[ expando ] = {}); 10245 10246 if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { 10247 10248 if ( (data = cache[1]) === true || data === cachedruns ) { 10249 10250 return data === true; 10251 10252 } 10253 10254 } else { 10255 10256 cache = outerCache[ dir ] = [ dirkey ]; 10257 10258 cache[1] = matcher( elem, context, xml ) || cachedruns; 10259 10260 if ( cache[1] === true ) { 10261 10262 return true; 10263 10264 } 10265 10266 } 10267 10268 } 10269 10270 } 10271 10272 } 10273 10274 }; 10275 10276} 10277 10278 10279 10280function elementMatcher( matchers ) { 10281 10282 return matchers.length > 1 ? 10283 10284 function( elem, context, xml ) { 10285 10286 var i = matchers.length; 10287 10288 while ( i-- ) { 10289 10290 if ( !matchers[i]( elem, context, xml ) ) { 10291 10292 return false; 10293 10294 } 10295 10296 } 10297 10298 return true; 10299 10300 } : 10301 10302 matchers[0]; 10303 10304} 10305 10306 10307 10308function condense( unmatched, map, filter, context, xml ) { 10309 10310 var elem, 10311 10312 newUnmatched = [], 10313 10314 i = 0, 10315 10316 len = unmatched.length, 10317 10318 mapped = map != null; 10319 10320 10321 10322 for ( ; i < len; i++ ) { 10323 10324 if ( (elem = unmatched[i]) ) { 10325 10326 if ( !filter || filter( elem, context, xml ) ) { 10327 10328 newUnmatched.push( elem ); 10329 10330 if ( mapped ) { 10331 10332 map.push( i ); 10333 10334 } 10335 10336 } 10337 10338 } 10339 10340 } 10341 10342 10343 10344 return newUnmatched; 10345 10346} 10347 10348 10349 10350function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { 10351 10352 if ( postFilter && !postFilter[ expando ] ) { 10353 10354 postFilter = setMatcher( postFilter ); 10355 10356 } 10357 10358 if ( postFinder && !postFinder[ expando ] ) { 10359 10360 postFinder = setMatcher( postFinder, postSelector ); 10361 10362 } 10363 10364 return markFunction(function( seed, results, context, xml ) { 10365 10366 var temp, i, elem, 10367 10368 preMap = [], 10369 10370 postMap = [], 10371 10372 preexisting = results.length, 10373 10374 10375 10376 // Get initial elements from seed or context 10377 10378 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), 10379 10380 10381 10382 // Prefilter to get matcher input, preserving a map for seed-results synchronization 10383 10384 matcherIn = preFilter && ( seed || !selector ) ? 10385 10386 condense( elems, preMap, preFilter, context, xml ) : 10387 10388 elems, 10389 10390 10391 10392 matcherOut = matcher ? 10393 10394 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, 10395 10396 postFinder || ( seed ? preFilter : preexisting || postFilter ) ? 10397 10398 10399 10400 // ...intermediate processing is necessary 10401 10402 [] : 10403 10404 10405 10406 // ...otherwise use results directly 10407 10408 results : 10409 10410 matcherIn; 10411 10412 10413 10414 // Find primary matches 10415 10416 if ( matcher ) { 10417 10418 matcher( matcherIn, matcherOut, context, xml ); 10419 10420 } 10421 10422 10423 10424 // Apply postFilter 10425 10426 if ( postFilter ) { 10427 10428 temp = condense( matcherOut, postMap ); 10429 10430 postFilter( temp, [], context, xml ); 10431 10432 10433 10434 // Un-match failing elements by moving them back to matcherIn 10435 10436 i = temp.length; 10437 10438 while ( i-- ) { 10439 10440 if ( (elem = temp[i]) ) { 10441 10442 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); 10443 10444 } 10445 10446 } 10447 10448 } 10449 10450 10451 10452 if ( seed ) { 10453 10454 if ( postFinder || preFilter ) { 10455 10456 if ( postFinder ) { 10457 10458 // Get the final matcherOut by condensing this intermediate into postFinder contexts 10459 10460 temp = []; 10461 10462 i = matcherOut.length; 10463 10464 while ( i-- ) { 10465 10466 if ( (elem = matcherOut[i]) ) { 10467 10468 // Restore matcherIn since elem is not yet a final match 10469 10470 temp.push( (matcherIn[i] = elem) ); 10471 10472 } 10473 10474 } 10475 10476 postFinder( null, (matcherOut = []), temp, xml ); 10477 10478 } 10479 10480 10481 10482 // Move matched elements from seed to results to keep them synchronized 10483 10484 i = matcherOut.length; 10485 10486 while ( i-- ) { 10487 10488 if ( (elem = matcherOut[i]) && 10489 10490 (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { 10491 10492 10493 10494 seed[temp] = !(results[temp] = elem); 10495 10496 } 10497 10498 } 10499 10500 } 10501 10502 10503 10504 // Add elements to results, through postFinder if defined 10505 10506 } else { 10507 10508 matcherOut = condense( 10509 10510 matcherOut === results ? 10511 10512 matcherOut.splice( preexisting, matcherOut.length ) : 10513 10514 matcherOut 10515 10516 ); 10517 10518 if ( postFinder ) { 10519 10520 postFinder( null, results, matcherOut, xml ); 10521 10522 } else { 10523 10524 push.apply( results, matcherOut ); 10525 10526 } 10527 10528 } 10529 10530 }); 10531 10532} 10533 10534 10535 10536function matcherFromTokens( tokens ) { 10537 10538 var checkContext, matcher, j, 10539 10540 len = tokens.length, 10541 10542 leadingRelative = Expr.relative[ tokens[0].type ], 10543 10544 implicitRelative = leadingRelative || Expr.relative[" "],
vendor: 15,973 bytes, lines 10545-11683
10545 10546 i = leadingRelative ? 1 : 0, 10547 10548 10549 10550 // The foundational matcher ensures that elements are reachable from top-level context(s) 10551 10552 matchContext = addCombinator( function( elem ) { 10553 10554 return elem === checkContext; 10555 10556 }, implicitRelative, true ), 10557 10558 matchAnyContext = addCombinator( function( elem ) { 10559 10560 return indexOf.call( checkContext, elem ) > -1; 10561 10562 }, implicitRelative, true ), 10563 10564 matchers = [ function( elem, context, xml ) { 10565 10566 return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( 10567 10568 (checkContext = context).nodeType ? 10569 10570 matchContext( elem, context, xml ) : 10571 10572 matchAnyContext( elem, context, xml ) ); 10573 10574 } ]; 10575 10576 10577 10578 for ( ; i < len; i++ ) { 10579 10580 if ( (matcher = Expr.relative[ tokens[i].type ]) ) { 10581 10582 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; 10583 10584 } else { 10585 10586 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); 10587 10588 10589 10590 // Return special upon seeing a positional matcher 10591 10592 if ( matcher[ expando ] ) { 10593 10594 // Find the next relative operator (if any) for proper handling 10595 10596 j = ++i; 10597 10598 for ( ; j < len; j++ ) { 10599 10600 if ( Expr.relative[ tokens[j].type ] ) { 10601 10602 break; 10603 10604 } 10605 10606 } 10607 10608 return setMatcher( 10609 10610 i > 1 && elementMatcher( matchers ), 10611 10612 i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ), 10613 10614 matcher, 10615 10616 i < j && matcherFromTokens( tokens.slice( i, j ) ), 10617 10618 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), 10619 10620 j < len && toSelector( tokens ) 10621 10622 ); 10623 10624 } 10625 10626 matchers.push( matcher ); 10627 10628 } 10629 10630 } 10631 10632 10633 10634 return elementMatcher( matchers ); 10635 10636} 10637 10638 10639 10640function matcherFromGroupMatchers( elementMatchers, setMatchers ) { 10641 10642 // A counter to specify which element is currently being matched 10643 10644 var matcherCachedRuns = 0, 10645 10646 bySet = setMatchers.length > 0, 10647 10648 byElement = elementMatchers.length > 0, 10649 10650 superMatcher = function( seed, context, xml, results, expandContext ) { 10651 10652 var elem, j, matcher, 10653 10654 setMatched = [], 10655 10656 matchedCount = 0, 10657 10658 i = "0", 10659 10660 unmatched = seed && [], 10661 10662 outermost = expandContext != null, 10663 10664 contextBackup = outermostContext, 10665 10666 // We must always have either seed elements or context 10667 10668 elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), 10669 10670 // Use integer dirruns iff this is the outermost matcher 10671 10672 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); 10673 10674 10675 10676 if ( outermost ) { 10677 10678 outermostContext = context !== document && context; 10679 10680 cachedruns = matcherCachedRuns; 10681 10682 } 10683 10684 10685 10686 // Add elements passing elementMatchers directly to results 10687 10688 // Keep `i` a string if there are no elements so `matchedCount` will be "00" below 10689 10690 for ( ; (elem = elems[i]) != null; i++ ) { 10691 10692 if ( byElement && elem ) { 10693 10694 j = 0; 10695 10696 while ( (matcher = elementMatchers[j++]) ) { 10697 10698 if ( matcher( elem, context, xml ) ) { 10699 10700 results.push( elem ); 10701 10702 break; 10703 10704 } 10705 10706 } 10707 10708 if ( outermost ) { 10709 10710 dirruns = dirrunsUnique; 10711 10712 cachedruns = ++matcherCachedRuns; 10713 10714 } 10715 10716 } 10717 10718 10719 10720 // Track unmatched elements for set filters 10721 10722 if ( bySet ) { 10723 10724 // They will have gone through all possible matchers 10725 10726 if ( (elem = !matcher && elem) ) { 10727 10728 matchedCount--; 10729 10730 } 10731 10732 10733 10734 // Lengthen the array for every element, matched or not 10735 10736 if ( seed ) { 10737 10738 unmatched.push( elem ); 10739 10740 } 10741 10742 } 10743 10744 } 10745 10746 10747 10748 // Apply set filters to unmatched elements 10749 10750 matchedCount += i; 10751 10752 if ( bySet && i !== matchedCount ) { 10753 10754 j = 0; 10755 10756 while ( (matcher = setMatchers[j++]) ) { 10757 10758 matcher( unmatched, setMatched, context, xml ); 10759 10760 } 10761 10762 10763 10764 if ( seed ) { 10765 10766 // Reintegrate element matches to eliminate the need for sorting 10767 10768 if ( matchedCount > 0 ) { 10769 10770 while ( i-- ) { 10771 10772 if ( !(unmatched[i] || setMatched[i]) ) { 10773 10774 setMatched[i] = pop.call( results ); 10775 10776 } 10777 10778 } 10779 10780 } 10781 10782 10783 10784 // Discard index placeholder values to get only actual matches 10785 10786 setMatched = condense( setMatched ); 10787 10788 } 10789 10790 10791 10792 // Add matches to results 10793 10794 push.apply( results, setMatched ); 10795 10796 10797 10798 // Seedless set matches succeeding multiple successful matchers stipulate sorting 10799 10800 if ( outermost && !seed && setMatched.length > 0 && 10801 10802 ( matchedCount + setMatchers.length ) > 1 ) { 10803 10804 10805 10806 Sizzle.uniqueSort( results ); 10807 10808 } 10809 10810 } 10811 10812 10813 10814 // Override manipulation of globals by nested matchers 10815 10816 if ( outermost ) { 10817 10818 dirruns = dirrunsUnique; 10819 10820 outermostContext = contextBackup; 10821 10822 } 10823 10824 10825 10826 return unmatched; 10827 10828 }; 10829 10830 10831 10832 return bySet ? 10833 10834 markFunction( superMatcher ) : 10835 10836 superMatcher; 10837 10838} 10839 10840 10841 10842compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { 10843 10844 var i, 10845 10846 setMatchers = [], 10847 10848 elementMatchers = [], 10849 10850 cached = compilerCache[ selector + " " ]; 10851 10852 10853 10854 if ( !cached ) { 10855 10856 // Generate a function of recursive functions that can be used to check each element 10857 10858 if ( !group ) { 10859 10860 group = tokenize( selector ); 10861 10862 } 10863 10864 i = group.length; 10865 10866 while ( i-- ) { 10867 10868 cached = matcherFromTokens( group[i] ); 10869 10870 if ( cached[ expando ] ) { 10871 10872 setMatchers.push( cached ); 10873 10874 } else { 10875 10876 elementMatchers.push( cached ); 10877 10878 } 10879 10880 } 10881 10882 10883 10884 // Cache the compiled function 10885 10886 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); 10887 10888 } 10889 10890 return cached; 10891 10892}; 10893 10894 10895 10896function multipleContexts( selector, contexts, results ) { 10897 10898 var i = 0, 10899 10900 len = contexts.length; 10901 10902 for ( ; i < len; i++ ) { 10903 10904 Sizzle( selector, contexts[i], results ); 10905 10906 } 10907 10908 return results; 10909 10910} 10911 10912 10913 10914function select( selector, context, results, seed ) { 10915 10916 var i, tokens, token, type, find, 10917 10918 match = tokenize( selector ); 10919 10920 10921 10922 if ( !seed ) { 10923 10924 // Try to minimize operations if there is only one group 10925 10926 if ( match.length === 1 ) { 10927 10928 10929 10930 // Take a shortcut and set the context if the root selector is an ID 10931 10932 tokens = match[0] = match[0].slice( 0 ); 10933 10934 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && 10935 10936 context.nodeType === 9 && !documentIsXML && 10937 10938 Expr.relative[ tokens[1].type ] ) { 10939 10940 10941 10942 context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0]; 10943 10944 if ( !context ) { 10945 10946 return results; 10947 10948 } 10949 10950 10951 10952 selector = selector.slice( tokens.shift().value.length ); 10953 10954 } 10955 10956 10957 10958 // Fetch a seed set for right-to-left matching 10959 10960 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; 10961 10962 while ( i-- ) { 10963 10964 token = tokens[i]; 10965 10966 10967 10968 // Abort if we hit a combinator 10969 10970 if ( Expr.relative[ (type = token.type) ] ) { 10971 10972 break; 10973 10974 } 10975 10976 if ( (find = Expr.find[ type ]) ) { 10977 10978 // Search, expanding context for leading sibling combinators 10979 10980 if ( (seed = find( 10981 10982 token.matches[0].replace( runescape, funescape ), 10983 10984 rsibling.test( tokens[0].type ) && context.parentNode || context 10985 10986 )) ) { 10987 10988 10989 10990 // If seed is empty or no tokens remain, we can return early 10991 10992 tokens.splice( i, 1 ); 10993 10994 selector = seed.length && toSelector( tokens ); 10995 10996 if ( !selector ) { 10997 10998 push.apply( results, slice.call( seed, 0 ) ); 10999 11000 return results; 11001 11002 } 11003 11004 11005 11006 break; 11007 11008 } 11009 11010 } 11011 11012 } 11013 11014 } 11015 11016 } 11017 11018 11019 11020 // Compile and execute a filtering function 11021 11022 // Provide `match` to avoid retokenization if we modified the selector above 11023 11024 compile( selector, match )( 11025 11026 seed, 11027 11028 context, 11029 11030 documentIsXML, 11031 11032 results, 11033 11034 rsibling.test( selector ) 11035 11036 ); 11037 11038 return results; 11039 11040} 11041 11042 11043 11044// Deprecated 11045 11046Expr.pseudos["nth"] = Expr.pseudos["eq"]; 11047 11048 11049 11050// Easy API for creating new setFilters 11051 11052function setFilters() {} 11053 11054Expr.filters = setFilters.prototype = Expr.pseudos; 11055 11056Expr.setFilters = new setFilters(); 11057 11058 11059 11060// Initialize with the default document 11061 11062setDocument(); 11063 11064 11065 11066// Override sizzle attribute retrieval 11067 11068Sizzle.attr = jQuery.attr; 11069 11070jQuery.find = Sizzle; 11071 11072jQuery.expr = Sizzle.selectors; 11073 11074jQuery.expr[":"] = jQuery.expr.pseudos; 11075 11076jQuery.unique = Sizzle.uniqueSort; 11077 11078jQuery.text = Sizzle.getText; 11079 11080jQuery.isXMLDoc = Sizzle.isXML; 11081 11082jQuery.contains = Sizzle.contains; 11083 11084 11085 11086 11087 11088})( window ); 11089 11090var runtil = /Until$/, 11091 11092 rparentsprev = /^(?:parents|prev(?:Until|All))/, 11093 11094 isSimple = /^.[^:#\[\.,]*$/, 11095 11096 rneedsContext = jQuery.expr.match.needsContext, 11097 11098 // methods guaranteed to produce a unique set when starting from a unique set 11099 11100 guaranteedUnique = { 11101 11102 children: true, 11103 11104 contents: true, 11105 11106 next: true, 11107 11108 prev: true 11109 11110 }; 11111 11112 11113 11114jQuery.fn.extend({ 11115 11116 find: function( selector ) { 11117 11118 var i, ret, self, 11119 11120 len = this.length; 11121 11122 11123 11124 if ( typeof selector !== "string" ) { 11125 11126 self = this; 11127 11128 return this.pushStack( jQuery( selector ).filter(function() { 11129 11130 for ( i = 0; i < len; i++ ) { 11131 11132 if ( jQuery.contains( self[ i ], this ) ) { 11133 11134 return true; 11135 11136 } 11137 11138 } 11139 11140 }) ); 11141 11142 } 11143 11144 11145 11146 ret = []; 11147 11148 for ( i = 0; i < len; i++ ) { 11149 11150 jQuery.find( selector, this[ i ], ret ); 11151 11152 } 11153 11154 11155 11156 // Needed because $( selector, context ) becomes $( context ).find( selector ) 11157 11158 ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); 11159 11160 ret.selector = ( this.selector ? this.selector + " " : "" ) + selector; 11161 11162 return ret; 11163 11164 }, 11165 11166 11167 11168 has: function( target ) { 11169 11170 var i, 11171 11172 targets = jQuery( target, this ), 11173 11174 len = targets.length; 11175 11176 11177 11178 return this.filter(function() { 11179 11180 for ( i = 0; i < len; i++ ) { 11181 11182 if ( jQuery.contains( this, targets[i] ) ) { 11183 11184 return true; 11185 11186 } 11187 11188 } 11189 11190 }); 11191 11192 }, 11193 11194 11195 11196 not: function( selector ) { 11197 11198 return this.pushStack( winnow(this, selector, false) ); 11199 11200 }, 11201 11202 11203 11204 filter: function( selector ) { 11205 11206 return this.pushStack( winnow(this, selector, true) ); 11207 11208 }, 11209 11210 11211 11212 is: function( selector ) { 11213 11214 return !!selector && ( 11215 11216 typeof selector === "string" ? 11217 11218 // If this is a positional/relative selector, check membership in the returned set 11219 11220 // so $("p:first").is("p:last") won't return true for a doc with two "p". 11221 11222 rneedsContext.test( selector ) ? 11223 11224 jQuery( selector, this.context ).index( this[0] ) >= 0 : 11225 11226 jQuery.filter( selector, this ).length > 0 : 11227 11228 this.filter( selector ).length > 0 ); 11229 11230 }, 11231 11232 11233 11234 closest: function( selectors, context ) { 11235 11236 var cur, 11237 11238 i = 0, 11239 11240 l = this.length, 11241 11242 ret = [], 11243 11244 pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? 11245 11246 jQuery( selectors, context || this.context ) : 11247 11248 0; 11249 11250 11251 11252 for ( ; i < l; i++ ) { 11253 11254 cur = this[i]; 11255 11256 11257 11258 while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) { 11259 11260 if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { 11261 11262 ret.push( cur ); 11263 11264 break; 11265 11266 } 11267 11268 cur = cur.parentNode; 11269 11270 } 11271 11272 } 11273 11274 11275 11276 return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret ); 11277 11278 }, 11279 11280 11281 11282 // Determine the position of an element within 11283 11284 // the matched set of elements 11285 11286 index: function( elem ) { 11287 11288 11289 11290 // No argument, return index in parent 11291 11292 if ( !elem ) { 11293 11294 return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; 11295 11296 } 11297 11298 11299 11300 // index in selector 11301 11302 if ( typeof elem === "string" ) { 11303 11304 return jQuery.inArray( this[0], jQuery( elem ) ); 11305 11306 } 11307 11308 11309 11310 // Locate the position of the desired element 11311 11312 return jQuery.inArray( 11313 11314 // If it receives a jQuery object, the first element is used 11315 11316 elem.jquery ? elem[0] : elem, this ); 11317 11318 }, 11319 11320 11321 11322 add: function( selector, context ) { 11323 11324 var set = typeof selector === "string" ? 11325 11326 jQuery( selector, context ) : 11327 11328 jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), 11329 11330 all = jQuery.merge( this.get(), set ); 11331 11332 11333 11334 return this.pushStack( jQuery.unique(all) ); 11335 11336 }, 11337 11338 11339 11340 addBack: function( selector ) { 11341 11342 return this.add( selector == null ? 11343 11344 this.prevObject : this.prevObject.filter(selector) 11345 11346 ); 11347 11348 } 11349 11350}); 11351 11352 11353 11354jQuery.fn.andSelf = jQuery.fn.addBack; 11355 11356 11357 11358function sibling( cur, dir ) { 11359 11360 do { 11361 11362 cur = cur[ dir ]; 11363 11364 } while ( cur && cur.nodeType !== 1 ); 11365 11366 11367 11368 return cur; 11369 11370} 11371 11372 11373 11374jQuery.each({ 11375 11376 parent: function( elem ) { 11377 11378 var parent = elem.parentNode; 11379 11380 return parent && parent.nodeType !== 11 ? parent : null; 11381 11382 }, 11383 11384 parents: function( elem ) { 11385 11386 return jQuery.dir( elem, "parentNode" ); 11387 11388 }, 11389 11390 parentsUntil: function( elem, i, until ) { 11391 11392 return jQuery.dir( elem, "parentNode", until ); 11393 11394 }, 11395 11396 next: function( elem ) { 11397 11398 return sibling( elem, "nextSibling" ); 11399 11400 }, 11401 11402 prev: function( elem ) { 11403 11404 return sibling( elem, "previousSibling" ); 11405 11406 }, 11407 11408 nextAll: function( elem ) { 11409 11410 return jQuery.dir( elem, "nextSibling" ); 11411 11412 }, 11413 11414 prevAll: function( elem ) { 11415 11416 return jQuery.dir( elem, "previousSibling" ); 11417 11418 }, 11419 11420 nextUntil: function( elem, i, until ) { 11421 11422 return jQuery.dir( elem, "nextSibling", until ); 11423 11424 }, 11425 11426 prevUntil: function( elem, i, until ) { 11427 11428 return jQuery.dir( elem, "previousSibling", until ); 11429 11430 }, 11431 11432 siblings: function( elem ) { 11433 11434 return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); 11435 11436 }, 11437 11438 children: function( elem ) { 11439 11440 return jQuery.sibling( elem.firstChild ); 11441 11442 }, 11443 11444 contents: function( elem ) { 11445 11446 return jQuery.nodeName( elem, "iframe" ) ? 11447 11448 elem.contentDocument || elem.contentWindow.document : 11449 11450 jQuery.merge( [], elem.childNodes ); 11451 11452 } 11453 11454}, function( name, fn ) { 11455 11456 jQuery.fn[ name ] = function( until, selector ) { 11457 11458 var ret = jQuery.map( this, fn, until ); 11459 11460 11461 11462 if ( !runtil.test( name ) ) { 11463 11464 selector = until; 11465 11466 } 11467 11468 11469 11470 if ( selector && typeof selector === "string" ) { 11471 11472 ret = jQuery.filter( selector, ret ); 11473 11474 } 11475 11476 11477 11478 ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; 11479 11480 11481 11482 if ( this.length > 1 && rparentsprev.test( name ) ) { 11483 11484 ret = ret.reverse(); 11485 11486 } 11487 11488 11489 11490 return this.pushStack( ret ); 11491 11492 }; 11493 11494}); 11495 11496 11497 11498jQuery.extend({ 11499 11500 filter: function( expr, elems, not ) { 11501 11502 if ( not ) { 11503 11504 expr = ":not(" + expr + ")"; 11505 11506 } 11507 11508 11509 11510 return elems.length === 1 ? 11511 11512 jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : 11513 11514 jQuery.find.matches(expr, elems); 11515 11516 }, 11517 11518 11519 11520 dir: function( elem, dir, until ) { 11521 11522 var matched = [], 11523 11524 cur = elem[ dir ]; 11525 11526 11527 11528 while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { 11529 11530 if ( cur.nodeType === 1 ) { 11531 11532 matched.push( cur ); 11533 11534 } 11535 11536 cur = cur[dir]; 11537 11538 } 11539 11540 return matched; 11541 11542 }, 11543 11544 11545 11546 sibling: function( n, elem ) { 11547 11548 var r = []; 11549 11550 11551 11552 for ( ; n; n = n.nextSibling ) { 11553 11554 if ( n.nodeType === 1 && n !== elem ) { 11555 11556 r.push( n ); 11557 11558 } 11559 11560 } 11561 11562 11563 11564 return r; 11565 11566 } 11567 11568}); 11569 11570 11571 11572// Implement the identical functionality for filter and not 11573 11574function winnow( elements, qualifier, keep ) { 11575 11576 11577 11578 // Can't pass null or undefined to indexOf in Firefox 4 11579 11580 // Set to 0 to skip string check 11581 11582 qualifier = qualifier || 0; 11583 11584 11585 11586 if ( jQuery.isFunction( qualifier ) ) { 11587 11588 return jQuery.grep(elements, function( elem, i ) { 11589 11590 var retVal = !!qualifier.call( elem, i, elem ); 11591 11592 return retVal === keep; 11593 11594 }); 11595 11596 11597 11598 } else if ( qualifier.nodeType ) { 11599 11600 return jQuery.grep(elements, function( elem ) { 11601 11602 return ( elem === qualifier ) === keep; 11603 11604 }); 11605 11606 11607 11608 } else if ( typeof qualifier === "string" ) { 11609 11610 var filtered = jQuery.grep(elements, function( elem ) { 11611 11612 return elem.nodeType === 1; 11613 11614 }); 11615 11616 11617 11618 if ( isSimple.test( qualifier ) ) { 11619 11620 return jQuery.filter(qualifier, filtered, !keep); 11621 11622 } else { 11623 11624 qualifier = jQuery.filter( qualifier, filtered ); 11625 11626 } 11627 11628 } 11629 11630 11631 11632 return jQuery.grep(elements, function( elem ) { 11633 11634 return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; 11635 11636 }); 11637 11638} 11639 11640function createSafeFragment( document ) { 11641 11642 var list = nodeNames.split( "|" ), 11643 11644 safeFrag = document.createDocumentFragment(); 11645 11646 11647 11648 if ( safeFrag.createElement ) { 11649 11650 while ( list.length ) { 11651 11652 safeFrag.createElement( 11653 11654 list.pop() 11655 11656 ); 11657 11658 } 11659 11660 } 11661 11662 return safeFrag; 11663 11664} 11665 11666 11667 11668var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + 11669 11670 "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", 11671 11672 rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, 11673 11674 rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), 11675 11676 rleadingWhitespace = /^\s+/, 11677 11678 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, 11679 11680 rtagName = /<([\w:]+)/, 11681 11682 rtbody = /<tbody/i, 11683
vendor: 60,645 bytes, lines 11684-15791
11684 rhtml = /<|&#?\w+;/, 11685 11686 rnoInnerhtml = /<(?:script|style|link)/i, 11687 11688 manipulation_rcheckableType = /^(?:checkbox|radio)$/i, 11689 11690 // checked="checked" or checked 11691 11692 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 11693 11694 rscriptType = /^$|\/(?:java|ecma)script/i, 11695 11696 rscriptTypeMasked = /^true\/(.*)/, 11697 11698 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, 11699 11700 11701 11702 // We have to close these tags to support XHTML (#13200) 11703 11704 wrapMap = { 11705 11706 option: [ 1, "<select multiple='multiple'>", "</select>" ], 11707 11708 legend: [ 1, "<fieldset>", "</fieldset>" ], 11709 11710 area: [ 1, "<map>", "</map>" ], 11711 11712 param: [ 1, "<object>", "</object>" ], 11713 11714 thead: [ 1, "<table>", "</table>" ], 11715 11716 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 11717 11718 col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], 11719 11720 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 11721 11722 11723 11724 // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, 11725 11726 // unless wrapped in a div with non-breaking characters in front of it. 11727 11728 _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ] 11729 11730 }, 11731 11732 safeFragment = createSafeFragment( document ), 11733 11734 fragmentDiv = safeFragment.appendChild( document.createElement("div") ); 11735 11736 11737 11738wrapMap.optgroup = wrapMap.option; 11739 11740wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 11741 11742wrapMap.th = wrapMap.td; 11743 11744 11745 11746jQuery.fn.extend({ 11747 11748 text: function( value ) { 11749 11750 return jQuery.access( this, function( value ) { 11751 11752 return value === undefined ? 11753 11754 jQuery.text( this ) : 11755 11756 this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); 11757 11758 }, null, value, arguments.length ); 11759 11760 }, 11761 11762 11763 11764 wrapAll: function( html ) { 11765 11766 if ( jQuery.isFunction( html ) ) { 11767 11768 return this.each(function(i) { 11769 11770 jQuery(this).wrapAll( html.call(this, i) ); 11771 11772 }); 11773 11774 } 11775 11776 11777 11778 if ( this[0] ) { 11779 11780 // The elements to wrap the target around 11781 11782 var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); 11783 11784 11785 11786 if ( this[0].parentNode ) { 11787 11788 wrap.insertBefore( this[0] ); 11789 11790 } 11791 11792 11793 11794 wrap.map(function() { 11795 11796 var elem = this; 11797 11798 11799 11800 while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { 11801 11802 elem = elem.firstChild; 11803 11804 } 11805 11806 11807 11808 return elem; 11809 11810 }).append( this ); 11811 11812 } 11813 11814 11815 11816 return this; 11817 11818 }, 11819 11820 11821 11822 wrapInner: function( html ) { 11823 11824 if ( jQuery.isFunction( html ) ) { 11825 11826 return this.each(function(i) { 11827 11828 jQuery(this).wrapInner( html.call(this, i) ); 11829 11830 }); 11831 11832 } 11833 11834 11835 11836 return this.each(function() { 11837 11838 var self = jQuery( this ), 11839 11840 contents = self.contents(); 11841 11842 11843 11844 if ( contents.length ) { 11845 11846 contents.wrapAll( html ); 11847 11848 11849 11850 } else { 11851 11852 self.append( html ); 11853 11854 } 11855 11856 }); 11857 11858 }, 11859 11860 11861 11862 wrap: function( html ) { 11863 11864 var isFunction = jQuery.isFunction( html ); 11865 11866 11867 11868 return this.each(function(i) { 11869 11870 jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); 11871 11872 }); 11873 11874 }, 11875 11876 11877 11878 unwrap: function() { 11879 11880 return this.parent().each(function() { 11881 11882 if ( !jQuery.nodeName( this, "body" ) ) { 11883 11884 jQuery( this ).replaceWith( this.childNodes ); 11885 11886 } 11887 11888 }).end(); 11889 11890 }, 11891 11892 11893 11894 append: function() { 11895 11896 return this.domManip(arguments, true, function( elem ) { 11897 11898 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 11899 11900 this.appendChild( elem ); 11901 11902 } 11903 11904 }); 11905 11906 }, 11907 11908 11909 11910 prepend: function() { 11911 11912 return this.domManip(arguments, true, function( elem ) { 11913 11914 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 11915 11916 this.insertBefore( elem, this.firstChild ); 11917 11918 } 11919 11920 }); 11921 11922 }, 11923 11924 11925 11926 before: function() { 11927 11928 return this.domManip( arguments, false, function( elem ) { 11929 11930 if ( this.parentNode ) { 11931 11932 this.parentNode.insertBefore( elem, this ); 11933 11934 } 11935 11936 }); 11937 11938 }, 11939 11940 11941 11942 after: function() { 11943 11944 return this.domManip( arguments, false, function( elem ) { 11945 11946 if ( this.parentNode ) { 11947 11948 this.parentNode.insertBefore( elem, this.nextSibling ); 11949 11950 } 11951 11952 }); 11953 11954 }, 11955 11956 11957 11958 // keepData is for internal use only--do not document 11959 11960 remove: function( selector, keepData ) { 11961 11962 var elem, 11963 11964 i = 0; 11965 11966 11967 11968 for ( ; (elem = this[i]) != null; i++ ) { 11969 11970 if ( !selector || jQuery.filter( selector, [ elem ] ).length > 0 ) { 11971 11972 if ( !keepData && elem.nodeType === 1 ) { 11973 11974 jQuery.cleanData( getAll( elem ) ); 11975 11976 } 11977 11978 11979 11980 if ( elem.parentNode ) { 11981 11982 if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { 11983 11984 setGlobalEval( getAll( elem, "script" ) ); 11985 11986 } 11987 11988 elem.parentNode.removeChild( elem ); 11989 11990 } 11991 11992 } 11993 11994 } 11995 11996 11997 11998 return this; 11999 12000 }, 12001 12002 12003 12004 empty: function() { 12005 12006 var elem, 12007 12008 i = 0; 12009 12010 12011 12012 for ( ; (elem = this[i]) != null; i++ ) { 12013 12014 // Remove element nodes and prevent memory leaks 12015 12016 if ( elem.nodeType === 1 ) { 12017 12018 jQuery.cleanData( getAll( elem, false ) ); 12019 12020 } 12021 12022 12023 12024 // Remove any remaining nodes 12025 12026 while ( elem.firstChild ) { 12027 12028 elem.removeChild( elem.firstChild ); 12029 12030 } 12031 12032 12033 12034 // If this is a select, ensure that it displays empty (#12336) 12035 12036 // Support: IE<9 12037 12038 if ( elem.options && jQuery.nodeName( elem, "select" ) ) { 12039 12040 elem.options.length = 0; 12041 12042 } 12043 12044 } 12045 12046 12047 12048 return this; 12049 12050 }, 12051 12052 12053 12054 clone: function( dataAndEvents, deepDataAndEvents ) { 12055 12056 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 12057 12058 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 12059 12060 12061 12062 return this.map( function () { 12063 12064 return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); 12065 12066 }); 12067 12068 }, 12069 12070 12071 12072 html: function( value ) { 12073 12074 return jQuery.access( this, function( value ) { 12075 12076 var elem = this[0] || {}, 12077 12078 i = 0, 12079 12080 l = this.length; 12081 12082 12083 12084 if ( value === undefined ) { 12085 12086 return elem.nodeType === 1 ? 12087 12088 elem.innerHTML.replace( rinlinejQuery, "" ) : 12089 12090 undefined; 12091 12092 } 12093 12094 12095 12096 // See if we can take a shortcut and just use innerHTML 12097 12098 if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 12099 12100 ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && 12101 12102 ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && 12103 12104 !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { 12105 12106 12107 12108 value = value.replace( rxhtmlTag, "<$1></$2>" ); 12109 12110 12111 12112 try { 12113 12114 for (; i < l; i++ ) { 12115 12116 // Remove element nodes and prevent memory leaks 12117 12118 elem = this[i] || {}; 12119 12120 if ( elem.nodeType === 1 ) { 12121 12122 jQuery.cleanData( getAll( elem, false ) ); 12123 12124 elem.innerHTML = value; 12125 12126 } 12127 12128 } 12129 12130 12131 12132 elem = 0; 12133 12134 12135 12136 // If using innerHTML throws an exception, use the fallback method 12137 12138 } catch(e) {} 12139 12140 } 12141 12142 12143 12144 if ( elem ) { 12145 12146 this.empty().append( value ); 12147 12148 } 12149 12150 }, null, value, arguments.length ); 12151 12152 }, 12153 12154 12155 12156 replaceWith: function( value ) { 12157 12158 var isFunc = jQuery.isFunction( value ); 12159 12160 12161 12162 // Make sure that the elements are removed from the DOM before they are inserted 12163 12164 // this can help fix replacing a parent with child elements 12165 12166 if ( !isFunc && typeof value !== "string" ) { 12167 12168 value = jQuery( value ).not( this ).detach(); 12169 12170 } 12171 12172 12173 12174 return this.domManip( [ value ], true, function( elem ) { 12175 12176 var next = this.nextSibling, 12177 12178 parent = this.parentNode; 12179 12180 12181 12182 if ( parent ) { 12183 12184 jQuery( this ).remove(); 12185 12186 parent.insertBefore( elem, next ); 12187 12188 } 12189 12190 }); 12191 12192 }, 12193 12194 12195 12196 detach: function( selector ) { 12197 12198 return this.remove( selector, true ); 12199 12200 }, 12201 12202 12203 12204 domManip: function( args, table, callback ) { 12205 12206 12207 12208 // Flatten any nested arrays 12209 12210 args = core_concat.apply( [], args ); 12211 12212 12213 12214 var first, node, hasScripts, 12215 12216 scripts, doc, fragment, 12217 12218 i = 0, 12219 12220 l = this.length, 12221 12222 set = this, 12223 12224 iNoClone = l - 1, 12225 12226 value = args[0], 12227 12228 isFunction = jQuery.isFunction( value ); 12229 12230 12231 12232 // We can't cloneNode fragments that contain checked, in WebKit 12233 12234 if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) { 12235 12236 return this.each(function( index ) { 12237 12238 var self = set.eq( index ); 12239 12240 if ( isFunction ) { 12241 12242 args[0] = value.call( this, index, table ? self.html() : undefined ); 12243 12244 } 12245 12246 self.domManip( args, table, callback ); 12247 12248 }); 12249 12250 } 12251 12252 12253 12254 if ( l ) { 12255 12256 fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); 12257 12258 first = fragment.firstChild; 12259 12260 12261 12262 if ( fragment.childNodes.length === 1 ) { 12263 12264 fragment = first; 12265 12266 } 12267 12268 12269 12270 if ( first ) { 12271 12272 table = table && jQuery.nodeName( first, "tr" ); 12273 12274 scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); 12275 12276 hasScripts = scripts.length; 12277 12278 12279 12280 // Use the original fragment for the last item instead of the first because it can end up 12281 12282 // being emptied incorrectly in certain situations (#8070). 12283 12284 for ( ; i < l; i++ ) { 12285 12286 node = fragment; 12287 12288 12289 12290 if ( i !== iNoClone ) { 12291 12292 node = jQuery.clone( node, true, true ); 12293 12294 12295 12296 // Keep references to cloned scripts for later restoration 12297 12298 if ( hasScripts ) { 12299 12300 jQuery.merge( scripts, getAll( node, "script" ) ); 12301 12302 } 12303 12304 } 12305 12306 12307 12308 callback.call( 12309 12310 table && jQuery.nodeName( this[i], "table" ) ? 12311 12312 findOrAppend( this[i], "tbody" ) : 12313 12314 this[i], 12315 12316 node, 12317 12318 i 12319 12320 ); 12321 12322 } 12323 12324 12325 12326 if ( hasScripts ) { 12327 12328 doc = scripts[ scripts.length - 1 ].ownerDocument; 12329 12330 12331 12332 // Reenable scripts 12333 12334 jQuery.map( scripts, restoreScript ); 12335 12336 12337 12338 // Evaluate executable scripts on first document insertion 12339 12340 for ( i = 0; i < hasScripts; i++ ) { 12341 12342 node = scripts[ i ]; 12343 12344 if ( rscriptType.test( node.type || "" ) && 12345 12346 !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { 12347 12348 12349 12350 if ( node.src ) { 12351 12352 // Hope ajax is available... 12353 12354 jQuery.ajax({ 12355 12356 url: node.src, 12357 12358 type: "GET", 12359 12360 dataType: "script", 12361 12362 async: false, 12363 12364 global: false, 12365 12366 "throws": true 12367 12368 }); 12369 12370 } else { 12371 12372 jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); 12373 12374 } 12375 12376 } 12377 12378 } 12379 12380 } 12381 12382 12383 12384 // Fix #11809: Avoid leaking memory 12385 12386 fragment = first = null; 12387 12388 } 12389 12390 } 12391 12392 12393 12394 return this; 12395 12396 } 12397 12398}); 12399 12400 12401 12402function findOrAppend( elem, tag ) { 12403 12404 return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) ); 12405 12406} 12407 12408 12409 12410// Replace/restore the type attribute of script elements for safe DOM manipulation 12411 12412function disableScript( elem ) { 12413 12414 var attr = elem.getAttributeNode("type"); 12415 12416 elem.type = ( attr && attr.specified ) + "/" + elem.type; 12417 12418 return elem; 12419 12420} 12421 12422function restoreScript( elem ) { 12423 12424 var match = rscriptTypeMasked.exec( elem.type ); 12425 12426 if ( match ) { 12427 12428 elem.type = match[1]; 12429 12430 } else { 12431 12432 elem.removeAttribute("type"); 12433 12434 } 12435 12436 return elem; 12437 12438} 12439 12440 12441 12442// Mark scripts as having already been evaluated 12443 12444function setGlobalEval( elems, refElements ) { 12445 12446 var elem, 12447 12448 i = 0; 12449 12450 for ( ; (elem = elems[i]) != null; i++ ) { 12451 12452 jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); 12453 12454 } 12455 12456} 12457 12458 12459 12460function cloneCopyEvent( src, dest ) { 12461 12462 12463 12464 if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { 12465 12466 return; 12467 12468 } 12469 12470 12471 12472 var type, i, l, 12473 12474 oldData = jQuery._data( src ), 12475 12476 curData = jQuery._data( dest, oldData ), 12477 12478 events = oldData.events; 12479 12480 12481 12482 if ( events ) { 12483 12484 delete curData.handle; 12485 12486 curData.events = {}; 12487 12488 12489 12490 for ( type in events ) { 12491 12492 for ( i = 0, l = events[ type ].length; i < l; i++ ) { 12493 12494 jQuery.event.add( dest, type, events[ type ][ i ] ); 12495 12496 } 12497 12498 } 12499 12500 } 12501 12502 12503 12504 // make the cloned public data object a copy from the original 12505 12506 if ( curData.data ) { 12507 12508 curData.data = jQuery.extend( {}, curData.data ); 12509 12510 } 12511 12512} 12513 12514 12515 12516function fixCloneNodeIssues( src, dest ) { 12517 12518 var nodeName, e, data; 12519 12520 12521 12522 // We do not need to do anything for non-Elements 12523 12524 if ( dest.nodeType !== 1 ) { 12525 12526 return; 12527 12528 } 12529 12530 12531 12532 nodeName = dest.nodeName.toLowerCase(); 12533 12534 12535 12536 // IE6-8 copies events bound via attachEvent when using cloneNode. 12537 12538 if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) { 12539 12540 data = jQuery._data( dest ); 12541 12542 12543 12544 for ( e in data.events ) { 12545 12546 jQuery.removeEvent( dest, e, data.handle ); 12547 12548 } 12549 12550 12551 12552 // Event data gets referenced instead of copied if the expando gets copied too 12553 12554 dest.removeAttribute( jQuery.expando ); 12555 12556 } 12557 12558 12559 12560 // IE blanks contents when cloning scripts, and tries to evaluate newly-set text 12561 12562 if ( nodeName === "script" && dest.text !== src.text ) { 12563 12564 disableScript( dest ).text = src.text; 12565 12566 restoreScript( dest ); 12567 12568 12569 12570 // IE6-10 improperly clones children of object elements using classid. 12571 12572 // IE10 throws NoModificationAllowedError if parent is null, #12132. 12573 12574 } else if ( nodeName === "object" ) { 12575 12576 if ( dest.parentNode ) { 12577 12578 dest.outerHTML = src.outerHTML; 12579 12580 } 12581 12582 12583 12584 // This path appears unavoidable for IE9. When cloning an object 12585 12586 // element in IE9, the outerHTML strategy above is not sufficient. 12587 12588 // If the src has innerHTML and the destination does not, 12589 12590 // copy the src.innerHTML into the dest.innerHTML. #10324 12591 12592 if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { 12593 12594 dest.innerHTML = src.innerHTML; 12595 12596 } 12597 12598 12599 12600 } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) { 12601 12602 // IE6-8 fails to persist the checked state of a cloned checkbox 12603 12604 // or radio button. Worse, IE6-7 fail to give the cloned element 12605 12606 // a checked appearance if the defaultChecked value isn't also set 12607 12608 12609 12610 dest.defaultChecked = dest.checked = src.checked; 12611 12612 12613 12614 // IE6-7 get confused and end up setting the value of a cloned 12615 12616 // checkbox/radio button to an empty string instead of "on" 12617 12618 if ( dest.value !== src.value ) { 12619 12620 dest.value = src.value; 12621 12622 } 12623 12624 12625 12626 // IE6-8 fails to return the selected option to the default selected 12627 12628 // state when cloning options 12629 12630 } else if ( nodeName === "option" ) { 12631 12632 dest.defaultSelected = dest.selected = src.defaultSelected; 12633 12634 12635 12636 // IE6-8 fails to set the defaultValue to the correct value when 12637 12638 // cloning other types of input fields 12639 12640 } else if ( nodeName === "input" || nodeName === "textarea" ) { 12641 12642 dest.defaultValue = src.defaultValue; 12643 12644 } 12645 12646} 12647 12648 12649 12650jQuery.each({ 12651 12652 appendTo: "append", 12653 12654 prependTo: "prepend", 12655 12656 insertBefore: "before", 12657 12658 insertAfter: "after", 12659 12660 replaceAll: "replaceWith" 12661 12662}, function( name, original ) { 12663 12664 jQuery.fn[ name ] = function( selector ) { 12665 12666 var elems, 12667 12668 i = 0, 12669 12670 ret = [], 12671 12672 insert = jQuery( selector ), 12673 12674 last = insert.length - 1; 12675 12676 12677 12678 for ( ; i <= last; i++ ) { 12679 12680 elems = i === last ? this : this.clone(true); 12681 12682 jQuery( insert[i] )[ original ]( elems ); 12683 12684 12685 12686 // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() 12687 12688 core_push.apply( ret, elems.get() ); 12689 12690 } 12691 12692 12693 12694 return this.pushStack( ret ); 12695 12696 }; 12697 12698}); 12699 12700 12701 12702function getAll( context, tag ) { 12703 12704 var elems, elem, 12705 12706 i = 0, 12707 12708 found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) : 12709 12710 typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) : 12711 12712 undefined; 12713 12714 12715 12716 if ( !found ) { 12717 12718 for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { 12719 12720 if ( !tag || jQuery.nodeName( elem, tag ) ) { 12721 12722 found.push( elem ); 12723 12724 } else { 12725 12726 jQuery.merge( found, getAll( elem, tag ) ); 12727 12728 } 12729 12730 } 12731 12732 } 12733 12734 12735 12736 return tag === undefined || tag && jQuery.nodeName( context, tag ) ? 12737 12738 jQuery.merge( [ context ], found ) : 12739 12740 found; 12741 12742} 12743 12744 12745 12746// Used in buildFragment, fixes the defaultChecked property 12747 12748function fixDefaultChecked( elem ) { 12749 12750 if ( manipulation_rcheckableType.test( elem.type ) ) { 12751 12752 elem.defaultChecked = elem.checked; 12753 12754 } 12755 12756} 12757 12758 12759 12760jQuery.extend({ 12761 12762 clone: function( elem, dataAndEvents, deepDataAndEvents ) { 12763 12764 var destElements, node, clone, i, srcElements, 12765 12766 inPage = jQuery.contains( elem.ownerDocument, elem ); 12767 12768 12769 12770 if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { 12771 12772 clone = elem.cloneNode( true ); 12773 12774 12775 12776 // IE<=8 does not properly clone detached, unknown element nodes 12777 12778 } else { 12779 12780 fragmentDiv.innerHTML = elem.outerHTML; 12781 12782 fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); 12783 12784 } 12785 12786 12787 12788 if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && 12789 12790 (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { 12791 12792 12793 12794 // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 12795 12796 destElements = getAll( clone ); 12797 12798 srcElements = getAll( elem ); 12799 12800 12801 12802 // Fix all IE cloning issues 12803 12804 for ( i = 0; (node = srcElements[i]) != null; ++i ) { 12805 12806 // Ensure that the destination node is not null; Fixes #9587 12807 12808 if ( destElements[i] ) { 12809 12810 fixCloneNodeIssues( node, destElements[i] ); 12811 12812 } 12813 12814 } 12815 12816 } 12817 12818 12819 12820 // Copy the events from the original to the clone 12821 12822 if ( dataAndEvents ) { 12823 12824 if ( deepDataAndEvents ) { 12825 12826 srcElements = srcElements || getAll( elem ); 12827 12828 destElements = destElements || getAll( clone ); 12829 12830 12831 12832 for ( i = 0; (node = srcElements[i]) != null; i++ ) { 12833 12834 cloneCopyEvent( node, destElements[i] ); 12835 12836 } 12837 12838 } else { 12839 12840 cloneCopyEvent( elem, clone ); 12841 12842 } 12843 12844 } 12845 12846 12847 12848 // Preserve script evaluation history 12849 12850 destElements = getAll( clone, "script" ); 12851 12852 if ( destElements.length > 0 ) { 12853 12854 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); 12855 12856 } 12857 12858 12859 12860 destElements = srcElements = node = null; 12861 12862 12863 12864 // Return the cloned set 12865 12866 return clone; 12867 12868 }, 12869 12870 12871 12872 buildFragment: function( elems, context, scripts, selection ) { 12873 12874 var j, elem, contains, 12875 12876 tmp, tag, tbody, wrap, 12877 12878 l = elems.length, 12879 12880 12881 12882 // Ensure a safe fragment 12883 12884 safe = createSafeFragment( context ), 12885 12886 12887 12888 nodes = [], 12889 12890 i = 0; 12891 12892 12893 12894 for ( ; i < l; i++ ) { 12895 12896 elem = elems[ i ]; 12897 12898 12899 12900 if ( elem || elem === 0 ) { 12901 12902 12903 12904 // Add nodes directly 12905 12906 if ( jQuery.type( elem ) === "object" ) { 12907 12908 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); 12909 12910 12911 12912 // Convert non-html into a text node 12913 12914 } else if ( !rhtml.test( elem ) ) { 12915 12916 nodes.push( context.createTextNode( elem ) ); 12917 12918 12919 12920 // Convert html into DOM nodes 12921 12922 } else { 12923 12924 tmp = tmp || safe.appendChild( context.createElement("div") ); 12925 12926 12927 12928 // Deserialize a standard representation 12929 12930 tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); 12931 12932 wrap = wrapMap[ tag ] || wrapMap._default; 12933 12934 12935 12936 tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2]; 12937 12938 12939 12940 // Descend through wrappers to the right content 12941 12942 j = wrap[0]; 12943 12944 while ( j-- ) { 12945 12946 tmp = tmp.lastChild; 12947 12948 } 12949 12950 12951 12952 // Manually add leading whitespace removed by IE 12953 12954 if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { 12955 12956 nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); 12957 12958 } 12959 12960 12961 12962 // Remove IE's autoinserted <tbody> from table fragments 12963 12964 if ( !jQuery.support.tbody ) { 12965 12966 12967 12968 // String was a <table>, *may* have spurious <tbody> 12969 12970 elem = tag === "table" && !rtbody.test( elem ) ? 12971 12972 tmp.firstChild : 12973 12974 12975 12976 // String was a bare <thead> or <tfoot> 12977 12978 wrap[1] === "<table>" && !rtbody.test( elem ) ? 12979 12980 tmp : 12981 12982 0; 12983 12984 12985 12986 j = elem && elem.childNodes.length; 12987 12988 while ( j-- ) { 12989 12990 if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { 12991 12992 elem.removeChild( tbody ); 12993 12994 } 12995 12996 } 12997 12998 } 12999 13000 13001 13002 jQuery.merge( nodes, tmp.childNodes ); 13003 13004 13005 13006 // Fix #12392 for WebKit and IE > 9 13007 13008 tmp.textContent = ""; 13009 13010 13011 13012 // Fix #12392 for oldIE 13013 13014 while ( tmp.firstChild ) { 13015 13016 tmp.removeChild( tmp.firstChild ); 13017 13018 } 13019 13020 13021 13022 // Remember the top-level container for proper cleanup 13023 13024 tmp = safe.lastChild; 13025 13026 } 13027 13028 } 13029 13030 } 13031 13032 13033 13034 // Fix #11356: Clear elements from fragment 13035 13036 if ( tmp ) { 13037 13038 safe.removeChild( tmp ); 13039 13040 } 13041 13042 13043 13044 // Reset defaultChecked for any radios and checkboxes 13045 13046 // about to be appended to the DOM in IE 6/7 (#8060) 13047 13048 if ( !jQuery.support.appendChecked ) { 13049 13050 jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); 13051 13052 } 13053 13054 13055 13056 i = 0; 13057 13058 while ( (elem = nodes[ i++ ]) ) { 13059 13060 13061 13062 // #4087 - If origin and destination elements are the same, and this is 13063 13064 // that element, do not do anything 13065 13066 if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { 13067 13068 continue; 13069 13070 } 13071 13072 13073 13074 contains = jQuery.contains( elem.ownerDocument, elem ); 13075 13076 13077 13078 // Append to fragment 13079 13080 tmp = getAll( safe.appendChild( elem ), "script" ); 13081 13082 13083 13084 // Preserve script evaluation history 13085 13086 if ( contains ) { 13087 13088 setGlobalEval( tmp ); 13089 13090 } 13091 13092 13093 13094 // Capture executables 13095 13096 if ( scripts ) { 13097 13098 j = 0; 13099 13100 while ( (elem = tmp[ j++ ]) ) { 13101 13102 if ( rscriptType.test( elem.type || "" ) ) { 13103 13104 scripts.push( elem ); 13105 13106 } 13107 13108 } 13109 13110 } 13111 13112 } 13113 13114 13115 13116 tmp = null; 13117 13118 13119 13120 return safe; 13121 13122 }, 13123 13124 13125 13126 cleanData: function( elems, /* internal */ acceptData ) { 13127 13128 var elem, type, id, data, 13129 13130 i = 0, 13131 13132 internalKey = jQuery.expando, 13133 13134 cache = jQuery.cache, 13135 13136 deleteExpando = jQuery.support.deleteExpando, 13137 13138 special = jQuery.event.special; 13139 13140 13141 13142 for ( ; (elem = elems[i]) != null; i++ ) { 13143 13144 13145 13146 if ( acceptData || jQuery.acceptData( elem ) ) { 13147 13148 13149 13150 id = elem[ internalKey ]; 13151 13152 data = id && cache[ id ]; 13153 13154 13155 13156 if ( data ) { 13157 13158 if ( data.events ) { 13159 13160 for ( type in data.events ) { 13161 13162 if ( special[ type ] ) { 13163 13164 jQuery.event.remove( elem, type ); 13165 13166 13167 13168 // This is a shortcut to avoid jQuery.event.remove's overhead 13169 13170 } else { 13171 13172 jQuery.removeEvent( elem, type, data.handle ); 13173 13174 } 13175 13176 } 13177 13178 } 13179 13180 13181 13182 // Remove cache only if it was not already removed by jQuery.event.remove 13183 13184 if ( cache[ id ] ) { 13185 13186 13187 13188 delete cache[ id ]; 13189 13190 13191 13192 // IE does not allow us to delete expando properties from nodes, 13193 13194 // nor does it have a removeAttribute function on Document nodes; 13195 13196 // we must handle all of these cases 13197 13198 if ( deleteExpando ) { 13199 13200 delete elem[ internalKey ]; 13201 13202 13203 13204 } else if ( typeof elem.removeAttribute !== core_strundefined ) { 13205 13206 elem.removeAttribute( internalKey ); 13207 13208 13209 13210 } else { 13211 13212 elem[ internalKey ] = null; 13213 13214 } 13215 13216 13217 13218 core_deletedIds.push( id ); 13219 13220 } 13221 13222 } 13223 13224 } 13225 13226 } 13227 13228 } 13229 13230}); 13231 13232var iframe, getStyles, curCSS, 13233 13234 ralpha = /alpha\([^)]*\)/i, 13235 13236 ropacity = /opacity\s*=\s*([^)]*)/, 13237 13238 rposition = /^(top|right|bottom|left)$/, 13239 13240 // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" 13241 13242 // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display 13243 13244 rdisplayswap = /^(none|table(?!-c[ea]).+)/, 13245 13246 rmargin = /^margin/, 13247 13248 rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), 13249 13250 rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), 13251 13252 rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ), 13253 13254 elemdisplay = { BODY: "block" }, 13255 13256 13257 13258 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 13259 13260 cssNormalTransform = { 13261 13262 letterSpacing: 0, 13263 13264 fontWeight: 400 13265 13266 }, 13267 13268 13269 13270 cssExpand = [ "Top", "Right", "Bottom", "Left" ], 13271 13272 cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; 13273 13274 13275 13276// return a css property mapped to a potentially vendor prefixed property 13277 13278function vendorPropName( style, name ) { 13279 13280 13281 13282 // shortcut for names that are not vendor prefixed 13283 13284 if ( name in style ) { 13285 13286 return name; 13287 13288 } 13289 13290 13291 13292 // check for vendor prefixed names 13293 13294 var capName = name.charAt(0).toUpperCase() + name.slice(1), 13295 13296 origName = name, 13297 13298 i = cssPrefixes.length; 13299 13300 13301 13302 while ( i-- ) { 13303 13304 name = cssPrefixes[ i ] + capName; 13305 13306 if ( name in style ) { 13307 13308 return name; 13309 13310 } 13311 13312 } 13313 13314 13315 13316 return origName; 13317 13318} 13319 13320 13321 13322function isHidden( elem, el ) { 13323 13324 // isHidden might be called from jQuery#filter function; 13325 13326 // in that case, element will be second argument 13327 13328 elem = el || elem; 13329 13330 return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); 13331 13332} 13333 13334 13335 13336function showHide( elements, show ) { 13337 13338 var display, elem, hidden, 13339 13340 values = [], 13341 13342 index = 0, 13343 13344 length = elements.length; 13345 13346 13347 13348 for ( ; index < length; index++ ) { 13349 13350 elem = elements[ index ]; 13351 13352 if ( !elem.style ) { 13353 13354 continue; 13355 13356 } 13357 13358 13359 13360 values[ index ] = jQuery._data( elem, "olddisplay" ); 13361 13362 display = elem.style.display; 13363 13364 if ( show ) { 13365 13366 // Reset the inline display of this element to learn if it is 13367 13368 // being hidden by cascaded rules or not 13369 13370 if ( !values[ index ] && display === "none" ) { 13371 13372 elem.style.display = ""; 13373 13374 } 13375 13376 13377 13378 // Set elements which have been overridden with display: none 13379 13380 // in a stylesheet to whatever the default browser style is 13381 13382 // for such an element 13383 13384 if ( elem.style.display === "" && isHidden( elem ) ) { 13385 13386 values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); 13387 13388 } 13389 13390 } else { 13391 13392 13393 13394 if ( !values[ index ] ) { 13395 13396 hidden = isHidden( elem ); 13397 13398 13399 13400 if ( display && display !== "none" || !hidden ) { 13401 13402 jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); 13403 13404 } 13405 13406 } 13407 13408 } 13409 13410 } 13411 13412 13413 13414 // Set the display of most of the elements in a second loop 13415 13416 // to avoid the constant reflow 13417 13418 for ( index = 0; index < length; index++ ) { 13419 13420 elem = elements[ index ]; 13421 13422 if ( !elem.style ) { 13423 13424 continue; 13425 13426 } 13427 13428 if ( !show || elem.style.display === "none" || elem.style.display === "" ) { 13429 13430 elem.style.display = show ? values[ index ] || "" : "none"; 13431 13432 } 13433 13434 } 13435 13436 13437 13438 return elements; 13439 13440} 13441 13442 13443 13444jQuery.fn.extend({ 13445 13446 css: function( name, value ) { 13447 13448 return jQuery.access( this, function( elem, name, value ) { 13449 13450 var len, styles, 13451 13452 map = {}, 13453 13454 i = 0; 13455 13456 13457 13458 if ( jQuery.isArray( name ) ) { 13459 13460 styles = getStyles( elem ); 13461 13462 len = name.length; 13463 13464 13465 13466 for ( ; i < len; i++ ) { 13467 13468 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); 13469 13470 } 13471 13472 13473 13474 return map; 13475 13476 } 13477 13478 13479 13480 return value !== undefined ? 13481 13482 jQuery.style( elem, name, value ) : 13483 13484 jQuery.css( elem, name ); 13485 13486 }, name, value, arguments.length > 1 ); 13487 13488 }, 13489 13490 show: function() { 13491 13492 return showHide( this, true ); 13493 13494 }, 13495 13496 hide: function() { 13497 13498 return showHide( this ); 13499 13500 }, 13501 13502 toggle: function( state ) { 13503 13504 var bool = typeof state === "boolean"; 13505 13506 13507 13508 return this.each(function() { 13509 13510 if ( bool ? state : isHidden( this ) ) { 13511 13512 jQuery( this ).show(); 13513 13514 } else { 13515 13516 jQuery( this ).hide(); 13517 13518 } 13519 13520 }); 13521 13522 } 13523 13524}); 13525 13526 13527 13528jQuery.extend({ 13529 13530 // Add in style property hooks for overriding the default 13531 13532 // behavior of getting and setting a style property 13533 13534 cssHooks: { 13535 13536 opacity: { 13537 13538 get: function( elem, computed ) { 13539 13540 if ( computed ) { 13541 13542 // We should always get a number back from opacity 13543 13544 var ret = curCSS( elem, "opacity" ); 13545 13546 return ret === "" ? "1" : ret; 13547 13548 } 13549 13550 } 13551 13552 } 13553 13554 }, 13555 13556 13557 13558 // Exclude the following css properties to add px 13559 13560 cssNumber: { 13561 13562 "columnCount": true, 13563 13564 "fillOpacity": true, 13565 13566 "fontWeight": true, 13567 13568 "lineHeight": true, 13569 13570 "opacity": true, 13571 13572 "orphans": true, 13573 13574 "widows": true, 13575 13576 "zIndex": true, 13577 13578 "zoom": true 13579 13580 }, 13581 13582 13583 13584 // Add in properties whose names you wish to fix before 13585 13586 // setting or getting the value 13587 13588 cssProps: { 13589 13590 // normalize float css property 13591 13592 "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" 13593 13594 }, 13595 13596 13597 13598 // Get and set the style property on a DOM Node 13599 13600 style: function( elem, name, value, extra ) { 13601 13602 // Don't set styles on text and comment nodes 13603 13604 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { 13605 13606 return; 13607 13608 } 13609 13610 13611 13612 // Make sure that we're working with the right name 13613 13614 var ret, type, hooks, 13615 13616 origName = jQuery.camelCase( name ), 13617 13618 style = elem.style; 13619 13620 13621 13622 name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); 13623 13624 13625 13626 // gets hook for the prefixed version 13627 13628 // followed by the unprefixed version 13629 13630 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 13631 13632 13633 13634 // Check if we're setting a value 13635 13636 if ( value !== undefined ) { 13637 13638 type = typeof value; 13639 13640 13641 13642 // convert relative number strings (+= or -=) to relative numbers. #7345 13643 13644 if ( type === "string" && (ret = rrelNum.exec( value )) ) { 13645 13646 value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); 13647 13648 // Fixes bug #9237 13649 13650 type = "number"; 13651 13652 } 13653 13654 13655 13656 // Make sure that NaN and null values aren't set. See: #7116 13657 13658 if ( value == null || type === "number" && isNaN( value ) ) { 13659 13660 return; 13661 13662 } 13663 13664 13665 13666 // If a number was passed in, add 'px' to the (except for certain CSS properties) 13667 13668 if ( type === "number" && !jQuery.cssNumber[ origName ] ) { 13669 13670 value += "px"; 13671 13672 } 13673 13674 13675 13676 // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, 13677 13678 // but it would mean to define eight (for every problematic property) identical functions 13679 13680 if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { 13681 13682 style[ name ] = "inherit"; 13683 13684 } 13685 13686 13687 13688 // If a hook was provided, use that value, otherwise just set the specified value 13689 13690 if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { 13691 13692 13693 13694 // Wrapped to prevent IE from throwing errors when 'invalid' values are provided 13695 13696 // Fixes bug #5509 13697 13698 try { 13699 13700 style[ name ] = value; 13701 13702 } catch(e) {} 13703 13704 } 13705 13706 13707 13708 } else { 13709 13710 // If a hook was provided get the non-computed value from there 13711 13712 if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { 13713 13714 return ret; 13715 13716 } 13717 13718 13719 13720 // Otherwise just get the value from the style object 13721 13722 return style[ name ]; 13723 13724 } 13725 13726 }, 13727 13728 13729 13730 css: function( elem, name, extra, styles ) { 13731 13732 var num, val, hooks, 13733 13734 origName = jQuery.camelCase( name ); 13735 13736 13737 13738 // Make sure that we're working with the right name 13739 13740 name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); 13741 13742 13743 13744 // gets hook for the prefixed version 13745 13746 // followed by the unprefixed version 13747 13748 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 13749 13750 13751 13752 // If a hook was provided get the computed value from there 13753 13754 if ( hooks && "get" in hooks ) { 13755 13756 val = hooks.get( elem, true, extra ); 13757 13758 } 13759 13760 13761 13762 // Otherwise, if a way to get the computed value exists, use that 13763 13764 if ( val === undefined ) { 13765 13766 val = curCSS( elem, name, styles ); 13767 13768 } 13769 13770 13771 13772 //convert "normal" to computed value 13773 13774 if ( val === "normal" && name in cssNormalTransform ) { 13775 13776 val = cssNormalTransform[ name ]; 13777 13778 } 13779 13780 13781 13782 // Return, converting to number if forced or a qualifier was provided and val looks numeric 13783 13784 if ( extra === "" || extra ) { 13785 13786 num = parseFloat( val ); 13787 13788 return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; 13789 13790 } 13791 13792 return val; 13793 13794 }, 13795 13796 13797 13798 // A method for quickly swapping in/out CSS properties to get correct calculations 13799 13800 swap: function( elem, options, callback, args ) { 13801 13802 var ret, name, 13803 13804 old = {}; 13805 13806 13807 13808 // Remember the old values, and insert the new ones 13809 13810 for ( name in options ) { 13811 13812 old[ name ] = elem.style[ name ]; 13813 13814 elem.style[ name ] = options[ name ]; 13815 13816 } 13817 13818 13819 13820 ret = callback.apply( elem, args || [] ); 13821 13822 13823 13824 // Revert the old values 13825 13826 for ( name in options ) { 13827 13828 elem.style[ name ] = old[ name ]; 13829 13830 } 13831 13832 13833 13834 return ret; 13835 13836 } 13837 13838}); 13839 13840 13841 13842// NOTE: we've included the "window" in window.getComputedStyle 13843 13844// because jsdom on node.js will break without it. 13845 13846if ( window.getComputedStyle ) { 13847 13848 getStyles = function( elem ) { 13849 13850 return window.getComputedStyle( elem, null ); 13851 13852 }; 13853 13854 13855 13856 curCSS = function( elem, name, _computed ) { 13857 13858 var width, minWidth, maxWidth, 13859 13860 computed = _computed || getStyles( elem ), 13861 13862 13863 13864 // getPropertyValue is only needed for .css('filter') in IE9, see #12537 13865 13866 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined, 13867 13868 style = elem.style; 13869 13870 13871 13872 if ( computed ) { 13873 13874 13875 13876 if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { 13877 13878 ret = jQuery.style( elem, name ); 13879 13880 } 13881 13882 13883 13884 // A tribute to the "awesome hack by Dean Edwards" 13885 13886 // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right 13887 13888 // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels 13889 13890 // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values 13891 13892 if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { 13893 13894 13895 13896 // Remember the original values 13897 13898 width = style.width; 13899 13900 minWidth = style.minWidth; 13901 13902 maxWidth = style.maxWidth; 13903 13904 13905 13906 // Put in the new values to get a computed value out 13907 13908 style.minWidth = style.maxWidth = style.width = ret; 13909 13910 ret = computed.width; 13911 13912 13913 13914 // Revert the changed values 13915 13916 style.width = width; 13917 13918 style.minWidth = minWidth; 13919 13920 style.maxWidth = maxWidth; 13921 13922 } 13923 13924 } 13925 13926 13927 13928 return ret; 13929 13930 }; 13931 13932} else if ( document.documentElement.currentStyle ) { 13933 13934 getStyles = function( elem ) { 13935 13936 return elem.currentStyle; 13937 13938 }; 13939 13940 13941 13942 curCSS = function( elem, name, _computed ) { 13943 13944 var left, rs, rsLeft, 13945 13946 computed = _computed || getStyles( elem ), 13947 13948 ret = computed ? computed[ name ] : undefined, 13949 13950 style = elem.style; 13951 13952 13953 13954 // Avoid setting ret to empty string here 13955 13956 // so we don't default to auto 13957 13958 if ( ret == null && style && style[ name ] ) { 13959 13960 ret = style[ name ]; 13961 13962 } 13963 13964 13965 13966 // From the awesome hack by Dean Edwards 13967 13968 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 13969 13970 13971 13972 // If we're not dealing with a regular pixel number 13973 13974 // but a number that has a weird ending, we need to convert it to pixels 13975 13976 // but not position css attributes, as those are proportional to the parent element instead 13977 13978 // and we can't measure the parent instead because it might trigger a "stacking dolls" problem 13979 13980 if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { 13981 13982 13983 13984 // Remember the original values 13985 13986 left = style.left; 13987 13988 rs = elem.runtimeStyle; 13989 13990 rsLeft = rs && rs.left; 13991 13992 13993 13994 // Put in the new values to get a computed value out 13995 13996 if ( rsLeft ) { 13997 13998 rs.left = elem.currentStyle.left; 13999 14000 } 14001 14002 style.left = name === "fontSize" ? "1em" : ret; 14003 14004 ret = style.pixelLeft + "px"; 14005 14006 14007 14008 // Revert the changed values 14009 14010 style.left = left; 14011 14012 if ( rsLeft ) { 14013 14014 rs.left = rsLeft; 14015 14016 } 14017 14018 } 14019 14020 14021 14022 return ret === "" ? "auto" : ret; 14023 14024 }; 14025 14026} 14027 14028 14029 14030function setPositiveNumber( elem, value, subtract ) { 14031 14032 var matches = rnumsplit.exec( value ); 14033 14034 return matches ? 14035 14036 // Guard against undefined "subtract", e.g., when used as in cssHooks 14037 14038 Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : 14039 14040 value; 14041 14042} 14043 14044 14045 14046function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { 14047 14048 var i = extra === ( isBorderBox ? "border" : "content" ) ? 14049 14050 // If we already have the right measurement, avoid augmentation 14051 14052 4 : 14053 14054 // Otherwise initialize for horizontal or vertical properties 14055 14056 name === "width" ? 1 : 0, 14057 14058 14059 14060 val = 0; 14061 14062 14063 14064 for ( ; i < 4; i += 2 ) { 14065 14066 // both box models exclude margin, so add it if we want it 14067 14068 if ( extra === "margin" ) { 14069 14070 val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); 14071 14072 } 14073 14074 14075 14076 if ( isBorderBox ) { 14077 14078 // border-box includes padding, so remove it if we want content 14079 14080 if ( extra === "content" ) { 14081 14082 val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 14083 14084 } 14085 14086 14087 14088 // at this point, extra isn't border nor margin, so remove border 14089 14090 if ( extra !== "margin" ) { 14091 14092 val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 14093 14094 } 14095 14096 } else { 14097 14098 // at this point, extra isn't content, so add padding 14099 14100 val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 14101 14102 14103 14104 // at this point, extra isn't content nor padding, so add border 14105 14106 if ( extra !== "padding" ) { 14107 14108 val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 14109 14110 } 14111 14112 } 14113 14114 } 14115 14116 14117 14118 return val; 14119 14120} 14121 14122 14123 14124function getWidthOrHeight( elem, name, extra ) { 14125 14126 14127 14128 // Start with offset property, which is equivalent to the border-box value 14129 14130 var valueIsBorderBox = true, 14131 14132 val = name === "width" ? elem.offsetWidth : elem.offsetHeight, 14133 14134 styles = getStyles( elem ), 14135 14136 isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; 14137 14138 14139 14140 // some non-html elements return undefined for offsetWidth, so check for null/undefined 14141 14142 // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 14143 14144 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 14145 14146 if ( val <= 0 || val == null ) { 14147 14148 // Fall back to computed then uncomputed css if necessary 14149 14150 val = curCSS( elem, name, styles ); 14151 14152 if ( val < 0 || val == null ) { 14153 14154 val = elem.style[ name ]; 14155 14156 } 14157 14158 14159 14160 // Computed unit is not pixels. Stop here and return. 14161 14162 if ( rnumnonpx.test(val) ) { 14163 14164 return val; 14165 14166 } 14167 14168 14169 14170 // we need the check for style in case a browser which returns unreliable values 14171 14172 // for getComputedStyle silently falls back to the reliable elem.style 14173 14174 valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); 14175 14176 14177 14178 // Normalize "", auto, and prepare for extra 14179 14180 val = parseFloat( val ) || 0; 14181 14182 } 14183 14184 14185 14186 // use the active box-sizing model to add/subtract irrelevant styles 14187 14188 return ( val + 14189 14190 augmentWidthOrHeight( 14191 14192 elem, 14193 14194 name, 14195 14196 extra || ( isBorderBox ? "border" : "content" ), 14197 14198 valueIsBorderBox, 14199 14200 styles 14201 14202 ) 14203 14204 ) + "px"; 14205 14206} 14207 14208 14209 14210// Try to determine the default display value of an element 14211 14212function css_defaultDisplay( nodeName ) { 14213 14214 var doc = document, 14215 14216 display = elemdisplay[ nodeName ]; 14217 14218 14219 14220 if ( !display ) { 14221 14222 display = actualDisplay( nodeName, doc ); 14223 14224 14225 14226 // If the simple way fails, read from inside an iframe 14227 14228 if ( display === "none" || !display ) { 14229 14230 // Use the already-created iframe if possible 14231 14232 iframe = ( iframe || 14233 14234 jQuery("<iframe frameborder='0' width='0' height='0'/>") 14235 14236 .css( "cssText", "display:block !important" ) 14237 14238 ).appendTo( doc.documentElement ); 14239 14240 14241 14242 // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse 14243 14244 doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document; 14245 14246 doc.write("<!doctype html><html><body>"); 14247 14248 doc.close(); 14249 14250 14251 14252 display = actualDisplay( nodeName, doc ); 14253 14254 iframe.detach(); 14255 14256 } 14257 14258 14259 14260 // Store the correct default display 14261 14262 elemdisplay[ nodeName ] = display; 14263 14264 } 14265 14266 14267 14268 return display; 14269 14270} 14271 14272 14273 14274// Called ONLY from within css_defaultDisplay 14275 14276function actualDisplay( name, doc ) { 14277 14278 var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), 14279 14280 display = jQuery.css( elem[0], "display" ); 14281 14282 elem.remove(); 14283 14284 return display; 14285 14286} 14287 14288 14289 14290jQuery.each([ "height", "width" ], function( i, name ) { 14291 14292 jQuery.cssHooks[ name ] = { 14293 14294 get: function( elem, computed, extra ) { 14295 14296 if ( computed ) { 14297 14298 // certain elements can have dimension info if we invisibly show them 14299 14300 // however, it must have a current display style that would benefit from this 14301 14302 return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ? 14303 14304 jQuery.swap( elem, cssShow, function() { 14305 14306 return getWidthOrHeight( elem, name, extra ); 14307 14308 }) : 14309 14310 getWidthOrHeight( elem, name, extra ); 14311 14312 } 14313 14314 }, 14315 14316 14317 14318 set: function( elem, value, extra ) { 14319 14320 var styles = extra && getStyles( elem ); 14321 14322 return setPositiveNumber( elem, value, extra ? 14323 14324 augmentWidthOrHeight( 14325 14326 elem, 14327 14328 name, 14329 14330 extra, 14331 14332 jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 14333 14334 styles 14335 14336 ) : 0 14337 14338 ); 14339 14340 } 14341 14342 }; 14343 14344}); 14345 14346 14347 14348if ( !jQuery.support.opacity ) { 14349 14350 jQuery.cssHooks.opacity = { 14351 14352 get: function( elem, computed ) { 14353 14354 // IE uses filters for opacity 14355 14356 return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? 14357 14358 ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : 14359 14360 computed ? "1" : ""; 14361 14362 }, 14363 14364 14365 14366 set: function( elem, value ) { 14367 14368 var style = elem.style, 14369 14370 currentStyle = elem.currentStyle, 14371 14372 opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", 14373 14374 filter = currentStyle && currentStyle.filter || style.filter || ""; 14375 14376 14377 14378 // IE has trouble with opacity if it does not have layout 14379 14380 // Force it by setting the zoom level 14381 14382 style.zoom = 1; 14383 14384 14385 14386 // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 14387 14388 // if value === "", then remove inline opacity #12685 14389 14390 if ( ( value >= 1 || value === "" ) && 14391 14392 jQuery.trim( filter.replace( ralpha, "" ) ) === "" && 14393 14394 style.removeAttribute ) { 14395 14396 14397 14398 // Setting style.filter to null, "" & " " still leave "filter:" in the cssText 14399 14400 // if "filter:" is present at all, clearType is disabled, we want to avoid this 14401 14402 // style.removeAttribute is IE Only, but so apparently is this code path... 14403 14404 style.removeAttribute( "filter" ); 14405 14406 14407 14408 // if there is no filter style applied in a css rule or unset inline opacity, we are done 14409 14410 if ( value === "" || currentStyle && !currentStyle.filter ) { 14411 14412 return; 14413 14414 } 14415 14416 } 14417 14418 14419 14420 // otherwise, set new filter values 14421 14422 style.filter = ralpha.test( filter ) ? 14423 14424 filter.replace( ralpha, opacity ) : 14425 14426 filter + " " + opacity; 14427 14428 } 14429 14430 }; 14431 14432} 14433 14434 14435 14436// These hooks cannot be added until DOM ready because the support test 14437 14438// for it is not run until after DOM ready 14439 14440jQuery(function() { 14441 14442 if ( !jQuery.support.reliableMarginRight ) { 14443 14444 jQuery.cssHooks.marginRight = { 14445 14446 get: function( elem, computed ) { 14447 14448 if ( computed ) { 14449 14450 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right 14451 14452 // Work around by temporarily setting element display to inline-block 14453 14454 return jQuery.swap( elem, { "display": "inline-block" }, 14455 14456 curCSS, [ elem, "marginRight" ] ); 14457 14458 } 14459 14460 } 14461 14462 }; 14463 14464 } 14465 14466 14467 14468 // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 14469 14470 // getComputedStyle returns percent when specified for top/left/bottom/right 14471 14472 // rather than make the css module depend on the offset module, we just check for it here 14473 14474 if ( !jQuery.support.pixelPosition && jQuery.fn.position ) { 14475 14476 jQuery.each( [ "top", "left" ], function( i, prop ) { 14477 14478 jQuery.cssHooks[ prop ] = { 14479 14480 get: function( elem, computed ) { 14481 14482 if ( computed ) { 14483 14484 computed = curCSS( elem, prop ); 14485 14486 // if curCSS returns percentage, fallback to offset 14487 14488 return rnumnonpx.test( computed ) ? 14489 14490 jQuery( elem ).position()[ prop ] + "px" : 14491 14492 computed; 14493 14494 } 14495 14496 } 14497 14498 }; 14499 14500 }); 14501 14502 } 14503 14504 14505 14506}); 14507 14508 14509 14510if ( jQuery.expr && jQuery.expr.filters ) { 14511 14512 jQuery.expr.filters.hidden = function( elem ) { 14513 14514 // Support: Opera <= 12.12 14515 14516 // Opera reports offsetWidths and offsetHeights less than zero on some elements 14517 14518 return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 || 14519 14520 (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); 14521 14522 }; 14523 14524 14525 14526 jQuery.expr.filters.visible = function( elem ) { 14527 14528 return !jQuery.expr.filters.hidden( elem ); 14529 14530 }; 14531 14532} 14533 14534 14535 14536// These hooks are used by animate to expand properties 14537 14538jQuery.each({ 14539 14540 margin: "", 14541 14542 padding: "", 14543 14544 border: "Width" 14545 14546}, function( prefix, suffix ) { 14547 14548 jQuery.cssHooks[ prefix + suffix ] = { 14549 14550 expand: function( value ) { 14551 14552 var i = 0, 14553 14554 expanded = {}, 14555 14556 14557 14558 // assumes a single number if not a string 14559 14560 parts = typeof value === "string" ? value.split(" ") : [ value ]; 14561 14562 14563 14564 for ( ; i < 4; i++ ) { 14565 14566 expanded[ prefix + cssExpand[ i ] + suffix ] = 14567 14568 parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; 14569 14570 } 14571 14572 14573 14574 return expanded; 14575 14576 } 14577 14578 }; 14579 14580 14581 14582 if ( !rmargin.test( prefix ) ) { 14583 14584 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; 14585 14586 } 14587 14588}); 14589 14590var r20 = /%20/g, 14591 14592 rbracket = /\[\]$/, 14593 14594 rCRLF = /\r?\n/g, 14595 14596 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 14597 14598 rsubmittable = /^(?:input|select|textarea|keygen)/i; 14599 14600 14601 14602jQuery.fn.extend({ 14603 14604 serialize: function() { 14605 14606 return jQuery.param( this.serializeArray() ); 14607 14608 }, 14609 14610 serializeArray: function() { 14611 14612 return this.map(function(){ 14613 14614 // Can add propHook for "elements" to filter or add form elements 14615 14616 var elements = jQuery.prop( this, "elements" ); 14617 14618 return elements ? jQuery.makeArray( elements ) : this; 14619 14620 }) 14621 14622 .filter(function(){ 14623 14624 var type = this.type; 14625 14626 // Use .is(":disabled") so that fieldset[disabled] works 14627 14628 return this.name && !jQuery( this ).is( ":disabled" ) && 14629 14630 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && 14631 14632 ( this.checked || !manipulation_rcheckableType.test( type ) ); 14633 14634 }) 14635 14636 .map(function( i, elem ){ 14637 14638 var val = jQuery( this ).val(); 14639 14640 14641 14642 return val == null ? 14643 14644 null : 14645 14646 jQuery.isArray( val ) ? 14647 14648 jQuery.map( val, function( val ){ 14649 14650 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 14651 14652 }) : 14653 14654 { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 14655 14656 }).get(); 14657 14658 } 14659 14660}); 14661 14662 14663 14664//Serialize an array of form elements or a set of 14665 14666//key/values into a query string 14667 14668jQuery.param = function( a, traditional ) { 14669 14670 var prefix, 14671 14672 s = [], 14673 14674 add = function( key, value ) { 14675 14676 // If value is a function, invoke it and return its value 14677 14678 value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); 14679 14680 s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); 14681 14682 }; 14683 14684 14685 14686 // Set traditional to true for jQuery <= 1.3.2 behavior. 14687 14688 if ( traditional === undefined ) { 14689 14690 traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; 14691 14692 } 14693 14694 14695 14696 // If an array was passed in, assume that it is an array of form elements. 14697 14698 if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { 14699 14700 // Serialize the form elements 14701 14702 jQuery.each( a, function() { 14703 14704 add( this.name, this.value ); 14705 14706 }); 14707 14708 14709 14710 } else { 14711 14712 // If traditional, encode the "old" way (the way 1.3.2 or older 14713 14714 // did it), otherwise encode params recursively. 14715 14716 for ( prefix in a ) { 14717 14718 buildParams( prefix, a[ prefix ], traditional, add ); 14719 14720 } 14721 14722 } 14723 14724 14725 14726 // Return the resulting serialization 14727 14728 return s.join( "&" ).replace( r20, "+" ); 14729 14730}; 14731 14732 14733 14734function buildParams( prefix, obj, traditional, add ) { 14735 14736 var name; 14737 14738 14739 14740 if ( jQuery.isArray( obj ) ) { 14741 14742 // Serialize array item. 14743 14744 jQuery.each( obj, function( i, v ) { 14745 14746 if ( traditional || rbracket.test( prefix ) ) { 14747 14748 // Treat each array item as a scalar. 14749 14750 add( prefix, v ); 14751 14752 14753 14754 } else { 14755 14756 // Item is non-scalar (array or object), encode its numeric index. 14757 14758 buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); 14759 14760 } 14761 14762 }); 14763 14764 14765 14766 } else if ( !traditional && jQuery.type( obj ) === "object" ) { 14767 14768 // Serialize object item. 14769 14770 for ( name in obj ) { 14771 14772 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); 14773 14774 } 14775 14776 14777 14778 } else { 14779 14780 // Serialize scalar item. 14781 14782 add( prefix, obj ); 14783 14784 } 14785 14786} 14787 14788jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + 14789 14790 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 14791 14792 "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { 14793 14794 14795 14796 // Handle event binding 14797 14798 jQuery.fn[ name ] = function( data, fn ) { 14799 14800 return arguments.length > 0 ? 14801 14802 this.on( name, null, data, fn ) : 14803 14804 this.trigger( name ); 14805 14806 }; 14807 14808}); 14809 14810 14811 14812jQuery.fn.hover = function( fnOver, fnOut ) { 14813 14814 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); 14815 14816}; 14817 14818var 14819 14820 // Document location 14821 14822 ajaxLocParts, 14823 14824 ajaxLocation, 14825 14826 ajax_nonce = jQuery.now(), 14827 14828 14829 14830 ajax_rquery = /\?/, 14831 14832 rhash = /#.*$/, 14833 14834 rts = /([?&])_=[^&]*/, 14835 14836 rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL 14837 14838 // #7653, #8125, #8152: local protocol detection 14839 14840 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, 14841 14842 rnoContent = /^(?:GET|HEAD)$/, 14843 14844 rprotocol = /^\/\//, 14845 14846 rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, 14847 14848 14849 14850 // Keep a copy of the old load method 14851 14852 _load = jQuery.fn.load, 14853 14854 14855 14856 /* Prefilters 14857 14858 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) 14859 14860 * 2) These are called: 14861 14862 * - BEFORE asking for a transport 14863 14864 * - AFTER param serialization (s.data is a string if s.processData is true) 14865 14866 * 3) key is the dataType 14867 14868 * 4) the catchall symbol "*" can be used 14869 14870 * 5) execution will start with transport dataType and THEN continue down to "*" if needed 14871 14872 */ 14873 14874 prefilters = {}, 14875 14876 14877 14878 /* Transports bindings 14879 14880 * 1) key is the dataType 14881 14882 * 2) the catchall symbol "*" can be used 14883 14884 * 3) selection will start with transport dataType and THEN go to "*" if needed 14885 14886 */ 14887 14888 transports = {}, 14889 14890 14891 14892 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression 14893 14894 allTypes = "*/".concat("*"); 14895 14896 14897 14898// #8138, IE may throw an exception when accessing 14899 14900// a field from window.location if document.domain has been set 14901 14902try { 14903 14904 ajaxLocation = location.href; 14905 14906} catch( e ) { 14907 14908 // Use the href attribute of an A element 14909 14910 // since IE will modify it given document.location 14911 14912 ajaxLocation = document.createElement( "a" ); 14913 14914 ajaxLocation.href = ""; 14915 14916 ajaxLocation = ajaxLocation.href; 14917 14918} 14919 14920 14921 14922// Segment location into parts 14923 14924ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; 14925 14926 14927 14928// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport 14929 14930function addToPrefiltersOrTransports( structure ) { 14931 14932 14933 14934 // dataTypeExpression is optional and defaults to "*" 14935 14936 return function( dataTypeExpression, func ) { 14937 14938 14939 14940 if ( typeof dataTypeExpression !== "string" ) { 14941 14942 func = dataTypeExpression; 14943 14944 dataTypeExpression = "*"; 14945 14946 } 14947 14948 14949 14950 var dataType, 14951 14952 i = 0, 14953 14954 dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || []; 14955 14956 14957 14958 if ( jQuery.isFunction( func ) ) { 14959 14960 // For each dataType in the dataTypeExpression 14961 14962 while ( (dataType = dataTypes[i++]) ) { 14963 14964 // Prepend if requested 14965 14966 if ( dataType[0] === "+" ) { 14967 14968 dataType = dataType.slice( 1 ) || "*"; 14969 14970 (structure[ dataType ] = structure[ dataType ] || []).unshift( func ); 14971 14972 14973 14974 // Otherwise append 14975 14976 } else { 14977 14978 (structure[ dataType ] = structure[ dataType ] || []).push( func ); 14979 14980 } 14981 14982 } 14983 14984 } 14985 14986 }; 14987 14988} 14989 14990 14991 14992// Base inspection function for prefilters and transports 14993 14994function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { 14995 14996 14997 14998 var inspected = {}, 14999 15000 seekingTransport = ( structure === transports ); 15001 15002 15003 15004 function inspect( dataType ) { 15005 15006 var selected; 15007 15008 inspected[ dataType ] = true; 15009 15010 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { 15011 15012 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); 15013 15014 if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { 15015 15016 options.dataTypes.unshift( dataTypeOrTransport ); 15017 15018 inspect( dataTypeOrTransport ); 15019 15020 return false; 15021 15022 } else if ( seekingTransport ) { 15023 15024 return !( selected = dataTypeOrTransport ); 15025 15026 } 15027 15028 }); 15029 15030 return selected; 15031 15032 } 15033 15034 15035 15036 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); 15037 15038} 15039 15040 15041 15042// A special extend for ajax options 15043 15044// that takes "flat" options (not to be deep extended) 15045 15046// Fixes #9887 15047 15048function ajaxExtend( target, src ) { 15049 15050 var deep, key, 15051 15052 flatOptions = jQuery.ajaxSettings.flatOptions || {}; 15053 15054 15055 15056 for ( key in src ) { 15057 15058 if ( src[ key ] !== undefined ) { 15059 15060 ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ]; 15061 15062 } 15063 15064 } 15065 15066 if ( deep ) { 15067 15068 jQuery.extend( true, target, deep ); 15069 15070 } 15071 15072 15073 15074 return target; 15075 15076} 15077 15078 15079 15080jQuery.fn.load = function( url, params, callback ) { 15081 15082 if ( typeof url !== "string" && _load ) { 15083 15084 return _load.apply( this, arguments ); 15085 15086 } 15087 15088 15089 15090 var selector, response, type, 15091 15092 self = this, 15093 15094 off = url.indexOf(" "); 15095 15096 15097 15098 if ( off >= 0 ) { 15099 15100 selector = url.slice( off, url.length ); 15101 15102 url = url.slice( 0, off ); 15103 15104 } 15105 15106 15107 15108 // If it's a function 15109 15110 if ( jQuery.isFunction( params ) ) { 15111 15112 15113 15114 // We assume that it's the callback 15115 15116 callback = params; 15117 15118 params = undefined; 15119 15120 15121 15122 // Otherwise, build a param string 15123 15124 } else if ( params && typeof params === "object" ) { 15125 15126 type = "POST"; 15127 15128 } 15129 15130 15131 15132 // If we have elements to modify, make the request 15133 15134 if ( self.length > 0 ) { 15135 15136 jQuery.ajax({ 15137 15138 url: url, 15139 15140 15141 15142 // if "type" variable is undefined, then "GET" method will be used 15143 15144 type: type, 15145 15146 dataType: "html", 15147 15148 data: params 15149 15150 }).done(function( responseText ) { 15151 15152 15153 15154 // Save response for use in complete callback 15155 15156 response = arguments; 15157 15158 15159 15160 self.html( selector ? 15161 15162 15163 15164 // If a selector was specified, locate the right elements in a dummy div 15165 15166 // Exclude scripts to avoid IE 'Permission Denied' errors 15167 15168 jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) : 15169 15170 15171 15172 // Otherwise use the full result 15173 15174 responseText ); 15175 15176 15177 15178 }).complete( callback && function( jqXHR, status ) { 15179 15180 self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); 15181 15182 }); 15183 15184 } 15185 15186 15187 15188 return this; 15189 15190}; 15191 15192 15193 15194// Attach a bunch of functions for handling common AJAX events 15195 15196jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){ 15197 15198 jQuery.fn[ type ] = function( fn ){ 15199 15200 return this.on( type, fn ); 15201 15202 }; 15203 15204}); 15205 15206 15207 15208jQuery.each( [ "get", "post" ], function( i, method ) { 15209 15210 jQuery[ method ] = function( url, data, callback, type ) { 15211 15212 // shift arguments if data argument was omitted 15213 15214 if ( jQuery.isFunction( data ) ) { 15215 15216 type = type || callback; 15217 15218 callback = data; 15219 15220 data = undefined; 15221 15222 } 15223 15224 15225 15226 return jQuery.ajax({ 15227 15228 url: url, 15229 15230 type: method, 15231 15232 dataType: type, 15233 15234 data: data, 15235 15236 success: callback 15237 15238 }); 15239 15240 }; 15241 15242}); 15243 15244 15245 15246jQuery.extend({ 15247 15248 15249 15250 // Counter for holding the number of active queries 15251 15252 active: 0, 15253 15254 15255 15256 // Last-Modified header cache for next request 15257 15258 lastModified: {}, 15259 15260 etag: {}, 15261 15262 15263 15264 ajaxSettings: { 15265 15266 url: ajaxLocation, 15267 15268 type: "GET", 15269 15270 isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), 15271 15272 global: true, 15273 15274 processData: true, 15275 15276 async: true, 15277 15278 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 15279 15280 /* 15281 15282 timeout: 0, 15283 15284 data: null, 15285 15286 dataType: null, 15287 15288 username: null, 15289 15290 password: null, 15291 15292 cache: null, 15293 15294 throws: false, 15295 15296 traditional: false, 15297 15298 headers: {}, 15299 15300 */ 15301 15302 15303 15304 accepts: { 15305 15306 "*": allTypes, 15307 15308 text: "text/plain", 15309 15310 html: "text/html", 15311 15312 xml: "application/xml, text/xml", 15313 15314 json: "application/json, text/javascript" 15315 15316 }, 15317 15318 15319 15320 contents: { 15321 15322 xml: /xml/, 15323 15324 html: /html/, 15325 15326 json: /json/ 15327 15328 }, 15329 15330 15331 15332 responseFields: { 15333 15334 xml: "responseXML", 15335 15336 text: "responseText" 15337 15338 }, 15339 15340 15341 15342 // Data converters 15343 15344 // Keys separate source (or catchall "*") and destination types with a single space 15345 15346 converters: { 15347 15348 15349 15350 // Convert anything to text 15351 15352 "* text": window.String, 15353 15354 15355 15356 // Text to html (true = no transformation) 15357 15358 "text html": true, 15359 15360 15361 15362 // Evaluate text as a json expression 15363 15364 "text json": jQuery.parseJSON, 15365 15366 15367 15368 // Parse text as xml 15369 15370 "text xml": jQuery.parseXML 15371 15372 }, 15373 15374 15375 15376 // For options that shouldn't be deep extended: 15377 15378 // you can add your own custom options here if 15379 15380 // and when you create one that shouldn't be 15381 15382 // deep extended (see ajaxExtend) 15383 15384 flatOptions: { 15385 15386 url: true, 15387 15388 context: true 15389 15390 } 15391 15392 }, 15393 15394 15395 15396 // Creates a full fledged settings object into target 15397 15398 // with both ajaxSettings and settings fields. 15399 15400 // If target is omitted, writes into ajaxSettings. 15401 15402 ajaxSetup: function( target, settings ) { 15403 15404 return settings ? 15405 15406 15407 15408 // Building a settings object 15409 15410 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : 15411 15412 15413 15414 // Extending ajaxSettings 15415 15416 ajaxExtend( jQuery.ajaxSettings, target ); 15417 15418 }, 15419 15420 15421 15422 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), 15423 15424 ajaxTransport: addToPrefiltersOrTransports( transports ), 15425 15426 15427 15428 // Main method 15429 15430 ajax: function( url, options ) { 15431 15432 15433 15434 // If url is an object, simulate pre-1.5 signature 15435 15436 if ( typeof url === "object" ) { 15437 15438 options = url; 15439 15440 url = undefined; 15441 15442 } 15443 15444 15445 15446 // Force options to be an object 15447 15448 options = options || {}; 15449 15450 15451 15452 var // Cross-domain detection vars 15453 15454 parts, 15455 15456 // Loop variable 15457 15458 i, 15459 15460 // URL without anti-cache param 15461 15462 cacheURL, 15463 15464 // Response headers as string 15465 15466 responseHeadersString, 15467 15468 // timeout handle 15469 15470 timeoutTimer, 15471 15472 15473 15474 // To know if global events are to be dispatched 15475 15476 fireGlobals, 15477 15478 15479 15480 transport, 15481 15482 // Response headers 15483 15484 responseHeaders, 15485 15486 // Create the final options object 15487 15488 s = jQuery.ajaxSetup( {}, options ), 15489 15490 // Callbacks context 15491 15492 callbackContext = s.context || s, 15493 15494 // Context for global events is callbackContext if it is a DOM node or jQuery collection 15495 15496 globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? 15497 15498 jQuery( callbackContext ) : 15499 15500 jQuery.event, 15501 15502 // Deferreds 15503 15504 deferred = jQuery.Deferred(), 15505 15506 completeDeferred = jQuery.Callbacks("once memory"), 15507 15508 // Status-dependent callbacks 15509 15510 statusCode = s.statusCode || {}, 15511 15512 // Headers (they are sent all at once) 15513 15514 requestHeaders = {}, 15515 15516 requestHeadersNames = {}, 15517 15518 // The jqXHR state 15519 15520 state = 0, 15521 15522 // Default abort message 15523 15524 strAbort = "canceled", 15525 15526 // Fake xhr 15527 15528 jqXHR = { 15529 15530 readyState: 0, 15531 15532 15533 15534 // Builds headers hashtable if needed 15535 15536 getResponseHeader: function( key ) { 15537 15538 var match; 15539 15540 if ( state === 2 ) { 15541 15542 if ( !responseHeaders ) { 15543 15544 responseHeaders = {}; 15545 15546 while ( (match = rheaders.exec( responseHeadersString )) ) { 15547 15548 responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; 15549 15550 } 15551 15552 } 15553 15554 match = responseHeaders[ key.toLowerCase() ]; 15555 15556 } 15557 15558 return match == null ? null : match; 15559 15560 }, 15561 15562 15563 15564 // Raw string 15565 15566 getAllResponseHeaders: function() { 15567 15568 return state === 2 ? responseHeadersString : null; 15569 15570 }, 15571 15572 15573 15574 // Caches the header 15575 15576 setRequestHeader: function( name, value ) { 15577 15578 var lname = name.toLowerCase(); 15579 15580 if ( !state ) { 15581 15582 name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; 15583 15584 requestHeaders[ name ] = value; 15585 15586 } 15587 15588 return this; 15589 15590 }, 15591 15592 15593 15594 // Overrides response content-type header 15595 15596 overrideMimeType: function( type ) { 15597 15598 if ( !state ) { 15599 15600 s.mimeType = type; 15601 15602 } 15603 15604 return this; 15605 15606 }, 15607 15608 15609 15610 // Status-dependent callbacks 15611 15612 statusCode: function( map ) { 15613 15614 var code; 15615 15616 if ( map ) { 15617 15618 if ( state < 2 ) { 15619 15620 for ( code in map ) { 15621 15622 // Lazy-add the new callback in a way that preserves old ones 15623 15624 statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; 15625 15626 } 15627 15628 } else { 15629 15630 // Execute the appropriate callbacks 15631 15632 jqXHR.always( map[ jqXHR.status ] ); 15633 15634 } 15635 15636 } 15637 15638 return this; 15639 15640 }, 15641 15642 15643 15644 // Cancel the request 15645 15646 abort: function( statusText ) { 15647 15648 var finalText = statusText || strAbort; 15649 15650 if ( transport ) { 15651 15652 transport.abort( finalText ); 15653 15654 } 15655 15656 done( 0, finalText ); 15657 15658 return this; 15659 15660 } 15661 15662 }; 15663 15664 15665 15666 // Attach deferreds 15667 15668 deferred.promise( jqXHR ).complete = completeDeferred.add; 15669 15670 jqXHR.success = jqXHR.done; 15671 15672 jqXHR.error = jqXHR.fail; 15673 15674 15675 15676 // Remove hash character (#7531: and string promotion) 15677 15678 // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) 15679 15680 // Handle falsy url in the settings object (#10093: consistency with old signature) 15681 15682 // We also use the url parameter if available 15683 15684 s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); 15685 15686 15687 15688 // Alias method option to type as per ticket #12004 15689 15690 s.type = options.method || options.type || s.method || s.type; 15691 15692 15693 15694 // Extract dataTypes list 15695 15696 s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""]; 15697 15698 15699 15700 // A cross-domain request is in order when we have a protocol:host:port mismatch 15701 15702 if ( s.crossDomain == null ) { 15703 15704 parts = rurl.exec( s.url.toLowerCase() ); 15705 15706 s.crossDomain = !!( parts && 15707 15708 ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || 15709 15710 ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) != 15711 15712 ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) ) 15713 15714 ); 15715 15716 } 15717 15718 15719 15720 // Convert data if not already a string 15721 15722 if ( s.data && s.processData && typeof s.data !== "string" ) { 15723 15724 s.data = jQuery.param( s.data, s.traditional ); 15725 15726 } 15727 15728 15729 15730 // Apply prefilters 15731 15732 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); 15733 15734 15735 15736 // If request was aborted inside a prefilter, stop there 15737 15738 if ( state === 2 ) { 15739 15740 return jqXHR; 15741 15742 } 15743 15744 15745 15746 // We can fire global events as of now if asked to 15747 15748 fireGlobals = s.global; 15749 15750 15751 15752 // Watch for a new set of requests 15753 15754 if ( fireGlobals && jQuery.active++ === 0 ) { 15755 15756 jQuery.event.trigger("ajaxStart"); 15757 15758 } 15759 15760 15761 15762 // Uppercase the type 15763 15764 s.type = s.type.toUpperCase(); 15765 15766 15767 15768 // Determine if request has content 15769 15770 s.hasContent = !rnoContent.test( s.type ); 15771 15772 15773 15774 // Save the URL in case we're toying with the If-Modified-Since 15775 15776 // and/or If-None-Match header later on 15777 15778 cacheURL = s.url; 15779 15780 15781 15782 // More options handling for requests with no content 15783 15784 if ( !s.hasContent ) { 15785 15786 15787 15788 // If data is available, append data to url 15789 15790 if ( s.data ) { 15791
vendor: 7,111 bytes, lines 15792-16301
15792 cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); 15793 15794 // #9682: remove data so that it's not used in an eventual retry 15795 15796 delete s.data; 15797 15798 } 15799 15800 15801 15802 // Add anti-cache in url if needed 15803 15804 if ( s.cache === false ) { 15805 15806 s.url = rts.test( cacheURL ) ? 15807 15808 15809 15810 // If there is already a '_' parameter, set its value 15811 15812 cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) : 15813 15814 15815 15816 // Otherwise add one to the end 15817 15818 cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++; 15819 15820 } 15821 15822 } 15823 15824 15825 15826 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 15827 15828 if ( s.ifModified ) { 15829 15830 if ( jQuery.lastModified[ cacheURL ] ) { 15831 15832 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); 15833 15834 } 15835 15836 if ( jQuery.etag[ cacheURL ] ) { 15837 15838 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); 15839 15840 } 15841 15842 } 15843 15844 15845 15846 // Set the correct header, if data is being sent 15847 15848 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { 15849 15850 jqXHR.setRequestHeader( "Content-Type", s.contentType ); 15851 15852 } 15853 15854 15855 15856 // Set the Accepts header for the server, depending on the dataType 15857 15858 jqXHR.setRequestHeader( 15859 15860 "Accept", 15861 15862 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? 15863 15864 s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : 15865 15866 s.accepts[ "*" ] 15867 15868 ); 15869 15870 15871 15872 // Check for headers option 15873 15874 for ( i in s.headers ) { 15875 15876 jqXHR.setRequestHeader( i, s.headers[ i ] ); 15877 15878 } 15879 15880 15881 15882 // Allow custom headers/mimetypes and early abort 15883 15884 if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { 15885 15886 // Abort if not done already and return 15887 15888 return jqXHR.abort(); 15889 15890 } 15891 15892 15893 15894 // aborting is no longer a cancellation 15895 15896 strAbort = "abort"; 15897 15898 15899 15900 // Install callbacks on deferreds 15901 15902 for ( i in { success: 1, error: 1, complete: 1 } ) { 15903 15904 jqXHR[ i ]( s[ i ] ); 15905 15906 } 15907 15908 15909 15910 // Get transport 15911 15912 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); 15913 15914 15915 15916 // If no transport, we auto-abort 15917 15918 if ( !transport ) { 15919 15920 done( -1, "No Transport" ); 15921 15922 } else { 15923 15924 jqXHR.readyState = 1; 15925 15926 15927 15928 // Send global event 15929 15930 if ( fireGlobals ) { 15931 15932 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); 15933 15934 } 15935 15936 // Timeout 15937 15938 if ( s.async && s.timeout > 0 ) { 15939 15940 timeoutTimer = setTimeout(function() { 15941 15942 jqXHR.abort("timeout"); 15943 15944 }, s.timeout ); 15945 15946 } 15947 15948 15949 15950 try { 15951 15952 state = 1; 15953 15954 transport.send( requestHeaders, done ); 15955 15956 } catch ( e ) { 15957 15958 // Propagate exception as error if not done 15959 15960 if ( state < 2 ) { 15961 15962 done( -1, e ); 15963 15964 // Simply rethrow otherwise 15965 15966 } else { 15967 15968 throw e; 15969 15970 } 15971 15972 } 15973 15974 } 15975 15976 15977 15978 // Callback for when everything is done 15979 15980 function done( status, nativeStatusText, responses, headers ) { 15981 15982 var isSuccess, success, error, response, modified, 15983 15984 statusText = nativeStatusText; 15985 15986 15987 15988 // Called once 15989 15990 if ( state === 2 ) { 15991 15992 return; 15993 15994 } 15995 15996 15997 15998 // State is "done" now 15999 16000 state = 2; 16001 16002 16003 16004 // Clear timeout if it exists 16005 16006 if ( timeoutTimer ) { 16007 16008 clearTimeout( timeoutTimer ); 16009 16010 } 16011 16012 16013 16014 // Dereference transport for early garbage collection 16015 16016 // (no matter how long the jqXHR object will be used) 16017 16018 transport = undefined; 16019 16020 16021 16022 // Cache response headers 16023 16024 responseHeadersString = headers || ""; 16025 16026 16027 16028 // Set readyState 16029 16030 jqXHR.readyState = status > 0 ? 4 : 0; 16031 16032 16033 16034 // Get response data 16035 16036 if ( responses ) { 16037 16038 response = ajaxHandleResponses( s, jqXHR, responses ); 16039 16040 } 16041 16042 16043 16044 // If successful, handle type chaining 16045 16046 if ( status >= 200 && status < 300 || status === 304 ) { 16047 16048 16049 16050 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 16051 16052 if ( s.ifModified ) { 16053 16054 modified = jqXHR.getResponseHeader("Last-Modified"); 16055 16056 if ( modified ) { 16057 16058 jQuery.lastModified[ cacheURL ] = modified; 16059 16060 } 16061 16062 modified = jqXHR.getResponseHeader("etag"); 16063 16064 if ( modified ) { 16065 16066 jQuery.etag[ cacheURL ] = modified; 16067 16068 } 16069 16070 } 16071 16072 16073 16074 // if no content 16075 16076 if ( status === 204 ) { 16077 16078 isSuccess = true; 16079 16080 statusText = "nocontent"; 16081 16082 16083 16084 // if not modified 16085 16086 } else if ( status === 304 ) { 16087 16088 isSuccess = true; 16089 16090 statusText = "notmodified"; 16091 16092 16093 16094 // If we have data, let's convert it 16095 16096 } else { 16097 16098 isSuccess = ajaxConvert( s, response ); 16099 16100 statusText = isSuccess.state; 16101 16102 success = isSuccess.data; 16103 16104 error = isSuccess.error; 16105 16106 isSuccess = !error; 16107 16108 } 16109 16110 } else { 16111 16112 // We extract error from statusText 16113 16114 // then normalize statusText and status for non-aborts 16115 16116 error = statusText; 16117 16118 if ( status || !statusText ) { 16119 16120 statusText = "error"; 16121 16122 if ( status < 0 ) { 16123 16124 status = 0; 16125 16126 } 16127 16128 } 16129 16130 } 16131 16132 16133 16134 // Set data for the fake xhr object 16135 16136 jqXHR.status = status; 16137 16138 jqXHR.statusText = ( nativeStatusText || statusText ) + ""; 16139 16140 16141 16142 // Success/Error 16143 16144 if ( isSuccess ) { 16145 16146 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); 16147 16148 } else { 16149 16150 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); 16151 16152 } 16153 16154 16155 16156 // Status-dependent callbacks 16157 16158 jqXHR.statusCode( statusCode ); 16159 16160 statusCode = undefined; 16161 16162 16163 16164 if ( fireGlobals ) { 16165 16166 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", 16167 16168 [ jqXHR, s, isSuccess ? success : error ] ); 16169 16170 } 16171 16172 16173 16174 // Complete 16175 16176 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); 16177 16178 16179 16180 if ( fireGlobals ) { 16181 16182 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); 16183 16184 // Handle the global AJAX counter 16185 16186 if ( !( --jQuery.active ) ) { 16187 16188 jQuery.event.trigger("ajaxStop"); 16189 16190 } 16191 16192 } 16193 16194 } 16195 16196 16197 16198 return jqXHR; 16199 16200 }, 16201 16202 16203 16204 getScript: function( url, callback ) { 16205 16206 return jQuery.get( url, undefined, callback, "script" ); 16207 16208 }, 16209 16210 16211 16212 getJSON: function( url, data, callback ) { 16213 16214 return jQuery.get( url, data, callback, "json" ); 16215 16216 } 16217 16218}); 16219 16220 16221 16222/* Handles responses to an ajax request: 16223 16224 * - sets all responseXXX fields accordingly 16225 16226 * - finds the right dataType (mediates between content-type and expected dataType) 16227 16228 * - returns the corresponding response 16229 16230 */ 16231 16232function ajaxHandleResponses( s, jqXHR, responses ) { 16233 16234 var firstDataType, ct, finalDataType, type, 16235 16236 contents = s.contents, 16237 16238 dataTypes = s.dataTypes, 16239 16240 responseFields = s.responseFields; 16241 16242 16243 16244 // Fill responseXXX fields 16245 16246 for ( type in responseFields ) { 16247 16248 if ( type in responses ) { 16249 16250 jqXHR[ responseFields[type] ] = responses[ type ]; 16251 16252 } 16253 16254 } 16255 16256 16257 16258 // Remove auto dataType and get content-type in the process 16259 16260 while( dataTypes[ 0 ] === "*" ) { 16261 16262 dataTypes.shift(); 16263 16264 if ( ct === undefined ) { 16265 16266 ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); 16267 16268 } 16269 16270 } 16271 16272 16273 16274 // Check if we're dealing with a known content-type 16275 16276 if ( ct ) { 16277 16278 for ( type in contents ) { 16279 16280 if ( contents[ type ] && contents[ type ].test( ct ) ) { 16281 16282 dataTypes.unshift( type ); 16283 16284 break; 16285 16286 } 16287 16288 } 16289 16290 } 16291 16292 16293 16294 // Check to see if we have a response for the expected dataType 16295 16296 if ( dataTypes[ 0 ] in responses ) { 16297 16298 finalDataType = dataTypes[ 0 ]; 16299 16300 } else { 16301
vendor: 7,690 bytes, lines 16302-16862
16302 // Try convertible dataTypes 16303 16304 for ( type in responses ) { 16305 16306 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { 16307 16308 finalDataType = type; 16309 16310 break; 16311 16312 } 16313 16314 if ( !firstDataType ) { 16315 16316 firstDataType = type; 16317 16318 } 16319 16320 } 16321 16322 // Or just use first one 16323 16324 finalDataType = finalDataType || firstDataType; 16325 16326 } 16327 16328 16329 16330 // If we found a dataType 16331 16332 // We add the dataType to the list if needed 16333 16334 // and return the corresponding response 16335 16336 if ( finalDataType ) { 16337 16338 if ( finalDataType !== dataTypes[ 0 ] ) { 16339 16340 dataTypes.unshift( finalDataType ); 16341 16342 } 16343 16344 return responses[ finalDataType ]; 16345 16346 } 16347 16348} 16349 16350 16351 16352// Chain conversions given the request and the original response 16353 16354function ajaxConvert( s, response ) { 16355 16356 var conv2, current, conv, tmp, 16357 16358 converters = {}, 16359 16360 i = 0, 16361 16362 // Work with a copy of dataTypes in case we need to modify it for conversion 16363 16364 dataTypes = s.dataTypes.slice(), 16365 16366 prev = dataTypes[ 0 ]; 16367 16368 16369 16370 // Apply the dataFilter if provided 16371 16372 if ( s.dataFilter ) { 16373 16374 response = s.dataFilter( response, s.dataType ); 16375 16376 } 16377 16378 16379 16380 // Create converters map with lowercased keys 16381 16382 if ( dataTypes[ 1 ] ) { 16383 16384 for ( conv in s.converters ) { 16385 16386 converters[ conv.toLowerCase() ] = s.converters[ conv ]; 16387 16388 } 16389 16390 } 16391 16392 16393 16394 // Convert to each sequential dataType, tolerating list modification 16395 16396 for ( ; (current = dataTypes[++i]); ) { 16397 16398 16399 16400 // There's only work to do if current dataType is non-auto 16401 16402 if ( current !== "*" ) { 16403 16404 16405 // Convert response if prev dataType is non-auto and differs from current 16406 16407 if ( prev !== "*" && prev !== current ) { 16408 16409 16410 16411 // Seek a direct converter 16412 16413 conv = converters[ prev + " " + current ] || converters[ "* " + current ]; 16414 16415 16416 16417 // If none found, seek a pair 16418 16419 if ( !conv ) { 16420 16421 for ( conv2 in converters ) { 16422 16423 16424 16425 // If conv2 outputs current 16426 16427 tmp = conv2.split(" "); 16428 16429 if ( tmp[ 1 ] === current ) { 16430 16431 16432 16433 // If prev can be converted to accepted input 16434 16435 conv = converters[ prev + " " + tmp[ 0 ] ] || 16436 16437 converters[ "* " + tmp[ 0 ] ]; 16438 16439 if ( conv ) { 16440 16441 // Condense equivalence converters 16442 16443 if ( conv === true ) { 16444 16445 conv = converters[ conv2 ]; 16446 16447 16448 16449 // Otherwise, insert the intermediate dataType 16450 16451 } else if ( converters[ conv2 ] !== true ) { 16452 16453 current = tmp[ 0 ]; 16454 16455 dataTypes.splice( i--, 0, current ); 16456 16457 } 16458 16459 16460 16461 break; 16462 16463 } 16464 16465 } 16466 16467 } 16468 16469 } 16470 16471 16472 16473 // Apply converter (if not an equivalence) 16474 16475 if ( conv !== true ) { 16476 16477 16478 16479 // Unless errors are allowed to bubble, catch and return them 16480 16481 if ( conv && s["throws"] ) { 16482 16483 response = conv( response ); 16484 16485 } else { 16486 16487 try { 16488 16489 response = conv( response ); 16490 16491 } catch ( e ) { 16492 16493 return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; 16494 16495 } 16496 16497 } 16498 16499 } 16500 16501 } 16502 16503 16504 16505 // Update prev for next iteration 16506 16507 prev = current; 16508 16509 } 16510 16511 } 16512 16513 16514 16515 return { state: "success", data: response }; 16516 16517} 16518 16519// Install script dataType 16520 16521jQuery.ajaxSetup({ 16522 16523 accepts: { 16524 16525 script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" 16526 16527 }, 16528 16529 contents: { 16530 16531 script: /(?:java|ecma)script/ 16532 16533 }, 16534 16535 converters: { 16536 16537 "text script": function( text ) { 16538 16539 jQuery.globalEval( text ); 16540 16541 return text; 16542 16543 } 16544 16545 } 16546 16547}); 16548 16549 16550 16551// Handle cache's special case and global 16552 16553jQuery.ajaxPrefilter( "script", function( s ) { 16554 16555 if ( s.cache === undefined ) { 16556 16557 s.cache = false; 16558 16559 } 16560 16561 if ( s.crossDomain ) { 16562 16563 s.type = "GET"; 16564 16565 s.global = false; 16566 16567 } 16568 16569}); 16570 16571 16572 16573// Bind script tag hack transport 16574 16575jQuery.ajaxTransport( "script", function(s) { 16576 16577 16578 16579 // This transport only deals with cross domain requests 16580 16581 if ( s.crossDomain ) { 16582 16583 16584 16585 var script, 16586 16587 head = document.head || jQuery("head")[0] || document.documentElement; 16588 16589 16590 16591 return { 16592 16593 16594 16595 send: function( _, callback ) { 16596 16597 16598 16599 script = document.createElement("script"); 16600 16601 16602 16603 script.async = true; 16604 16605 16606 16607 if ( s.scriptCharset ) { 16608 16609 script.charset = s.scriptCharset; 16610 16611 } 16612 16613 16614 16615 script.src = s.url; 16616 16617 16618 16619 // Attach handlers for all browsers 16620 16621 script.onload = script.onreadystatechange = function( _, isAbort ) { 16622 16623 16624 16625 if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { 16626 16627 16628 16629 // Handle memory leak in IE 16630 16631 script.onload = script.onreadystatechange = null; 16632 16633 16634 16635 // Remove the script 16636 16637 if ( script.parentNode ) { 16638 16639 script.parentNode.removeChild( script ); 16640 16641 } 16642 16643 16644 16645 // Dereference the script 16646 16647 script = null; 16648 16649 16650 16651 // Callback if not abort 16652 16653 if ( !isAbort ) { 16654 16655 callback( 200, "success" ); 16656 16657 } 16658 16659 } 16660 16661 }; 16662 16663 16664 16665 // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending 16666 16667 // Use native DOM manipulation to avoid our domManip AJAX trickery 16668 16669 head.insertBefore( script, head.firstChild ); 16670 16671 }, 16672 16673 16674 16675 abort: function() { 16676 16677 if ( script ) { 16678 16679 script.onload( undefined, true ); 16680 16681 } 16682 16683 } 16684 16685 }; 16686 16687 } 16688 16689}); 16690 16691var oldCallbacks = [], 16692 16693 rjsonp = /(=)\?(?=&|$)|\?\?/; 16694 16695 16696 16697// Default jsonp settings 16698 16699jQuery.ajaxSetup({ 16700 16701 jsonp: "callback", 16702 16703 jsonpCallback: function() { 16704 16705 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) ); 16706 16707 this[ callback ] = true; 16708 16709 return callback; 16710 16711 } 16712 16713}); 16714 16715 16716 16717// Detect, normalize options and install callbacks for jsonp requests 16718 16719jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 16720 16721 16722 16723 var callbackName, overwritten, responseContainer, 16724 16725 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? 16726 16727 "url" : 16728 16729 typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data" 16730 16731 ); 16732 16733 16734 16735 // Handle iff the expected data type is "jsonp" or we have a parameter to set 16736 16737 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { 16738 16739 16740 16741 // Get callback name, remembering preexisting value associated with it 16742 16743 callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? 16744 16745 s.jsonpCallback() : 16746 16747 s.jsonpCallback; 16748 16749 16750 16751 // Insert callback into url or form data 16752 16753 if ( jsonProp ) { 16754 16755 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); 16756 16757 } else if ( s.jsonp !== false ) { 16758 16759 s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; 16760 16761 } 16762 16763 16764 16765 // Use data converter to retrieve json after script execution 16766 16767 s.converters["script json"] = function() { 16768 16769 if ( !responseContainer ) { 16770 16771 jQuery.error( callbackName + " was not called" ); 16772 16773 } 16774 16775 return responseContainer[ 0 ]; 16776 16777 }; 16778 16779 16780 16781 // force json dataType 16782 16783 s.dataTypes[ 0 ] = "json"; 16784 16785 16786 16787 // Install callback 16788 16789 overwritten = window[ callbackName ]; 16790 16791 window[ callbackName ] = function() { 16792 16793 responseContainer = arguments; 16794 16795 }; 16796 16797 16798 16799 // Clean-up function (fires after converters) 16800 16801 jqXHR.always(function() { 16802 16803 // Restore preexisting value 16804 16805 window[ callbackName ] = overwritten; 16806 16807 16808 16809 // Save back as free 16810 16811 if ( s[ callbackName ] ) { 16812 16813 // make sure that re-using the options doesn't screw things around 16814 16815 s.jsonpCallback = originalSettings.jsonpCallback; 16816 16817 16818 16819 // save the callback name for future use 16820 16821 oldCallbacks.push( callbackName ); 16822 16823 } 16824 16825 16826 16827 // Call if it was a function and we have a response 16828 16829 if ( responseContainer && jQuery.isFunction( overwritten ) ) { 16830 16831 overwritten( responseContainer[ 0 ] ); 16832 16833 } 16834 16835 16836 16837 responseContainer = overwritten = undefined; 16838 16839 }); 16840 16841 16842 16843 // Delegate to script 16844 16845 return "script"; 16846 16847 } 16848 16849}); 16850 16851var xhrCallbacks, xhrSupported, 16852 16853 xhrId = 0, 16854 16855 // #5280: Internet Explorer will keep connections alive if we don't abort on unload 16856 16857 xhrOnUnloadAbort = window.ActiveXObject && function() { 16858 16859 // Abort all pending requests 16860 16861 var key; 16862
16863 for ( key in xhrCallbacks ) { 16864 16865 xhrCallbacks[ key ]( undefined, true ); 16866 16867 } 16868 16869 }; 16870 16871 16872 16873// Functions to create xhrs 16874 16875function createStandardXHR() { 16876 16877 try { 16878 16879 return new window.XMLHttpRequest(); 16880 16881 } catch( e ) {} 16882 16883} 16884 16885 16886 16887function createActiveXHR() { 16888 16889 try { 16890 16891 return new window.ActiveXObject("Microsoft.XMLHTTP"); 16892 16893 } catch( e ) {} 16894 16895} 16896 16897 16898 16899// Create the request object 16900 16901// (This is still attached to ajaxSettings for backward compatibility) 16902 16903jQuery.ajaxSettings.xhr = window.ActiveXObject ? 16904 16905 /* Microsoft failed to properly 16906 16907 * implement the XMLHttpRequest in IE7 (can't request local files), 16908 16909 * so we use the ActiveXObject when it is available 16910 16911 * Additionally XMLHttpRequest can be disabled in IE7/IE8 so 16912 16913 * we need a fallback. 16914 16915 */ 16916 16917 function() { 16918 16919 return !this.isLocal && createStandardXHR() || createActiveXHR(); 16920 16921 } : 16922 16923 // For all other browsers, use the standard XMLHttpRequest object 16924 16925 createStandardXHR; 16926 16927 16928 16929// Determine support properties 16930 16931xhrSupported = jQuery.ajaxSettings.xhr(); 16932 16933jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); 16934 16935xhrSupported = jQuery.support.ajax = !!xhrSupported; 16936 16937 16938 16939// Create transport if the browser can provide an xhr 16940 16941if ( xhrSupported ) { 16942 16943 16944 16945 jQuery.ajaxTransport(function( s ) { 16946 16947 // Cross domain only allowed if supported through XMLHttpRequest 16948 16949 if ( !s.crossDomain || jQuery.support.cors ) { 16950 16951 16952 16953 var callback; 16954 16955 16956 16957 return { 16958 16959 send: function( headers, complete ) { 16960 16961 16962 16963 // Get a new xhr 16964 16965 var handle, i, 16966 16967 xhr = s.xhr(); 16968 16969 16970 16971 // Open the socket 16972 16973 // Passing null username, generates a login popup on Opera (#2865) 16974 16975 if ( s.username ) { 16976 16977 xhr.open( s.type, s.url, s.async, s.username, s.password ); 16978 16979 } else { 16980 16981 xhr.open( s.type, s.url, s.async ); 16982 16983 } 16984 16985 16986 16987 // Apply custom fields if provided 16988 16989 if ( s.xhrFields ) { 16990 16991 for ( i in s.xhrFields ) { 16992 16993 xhr[ i ] = s.xhrFields[ i ]; 16994 16995 } 16996 16997 } 16998 16999 17000 17001 // Override mime type if needed 17002 17003 if ( s.mimeType && xhr.overrideMimeType ) { 17004 17005 xhr.overrideMimeType( s.mimeType ); 17006 17007 } 17008 17009 17010 17011 // X-Requested-With header 17012 17013 // For cross-domain requests, seeing as conditions for a preflight are 17014 17015 // akin to a jigsaw puzzle, we simply never set it to be sure. 17016 17017 // (it can always be set on a per-request basis or even using ajaxSetup) 17018
vendor: 16,699 bytes, lines 17019-18170
17019 // For same-domain requests, won't change header if already provided. 17020 17021 if ( !s.crossDomain && !headers["X-Requested-With"] ) { 17022 17023 headers["X-Requested-With"] = "XMLHttpRequest"; 17024 17025 } 17026 17027 17028 17029 // Need an extra try/catch for cross domain requests in Firefox 3 17030 17031 try { 17032 17033 for ( i in headers ) { 17034 17035 xhr.setRequestHeader( i, headers[ i ] ); 17036 17037 } 17038 17039 } catch( err ) {} 17040 17041 17042 17043 // Do send the request 17044 17045 // This may raise an exception which is actually 17046 17047 // handled in jQuery.ajax (so no try/catch here) 17048 17049 xhr.send( ( s.hasContent && s.data ) || null ); 17050 17051 17052 17053 // Listener 17054 17055 callback = function( _, isAbort ) { 17056 17057 var status, responseHeaders, statusText, responses; 17058 17059 17060 17061 // Firefox throws exceptions when accessing properties 17062 17063 // of an xhr when a network error occurred 17064 17065 // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) 17066 17067 try { 17068 17069 17070 17071 // Was never called and is aborted or complete 17072 17073 if ( callback && ( isAbort || xhr.readyState === 4 ) ) { 17074 17075 17076 17077 // Only called once 17078 17079 callback = undefined; 17080 17081 17082 17083 // Do not keep as active anymore 17084 17085 if ( handle ) { 17086 17087 xhr.onreadystatechange = jQuery.noop; 17088 17089 if ( xhrOnUnloadAbort ) { 17090 17091 delete xhrCallbacks[ handle ]; 17092 17093 } 17094 17095 } 17096 17097 17098 17099 // If it's an abort 17100 17101 if ( isAbort ) { 17102 17103 // Abort it manually if needed 17104 17105 if ( xhr.readyState !== 4 ) { 17106 17107 xhr.abort(); 17108 17109 } 17110 17111 } else { 17112 17113 responses = {}; 17114 17115 status = xhr.status; 17116 17117 responseHeaders = xhr.getAllResponseHeaders(); 17118 17119 17120 17121 // When requesting binary data, IE6-9 will throw an exception 17122 17123 // on any attempt to access responseText (#11426) 17124 17125 if ( typeof xhr.responseText === "string" ) { 17126 17127 responses.text = xhr.responseText; 17128 17129 } 17130 17131 17132 17133 // Firefox throws an exception when accessing 17134 17135 // statusText for faulty cross-domain requests 17136 17137 try { 17138 17139 statusText = xhr.statusText; 17140 17141 } catch( e ) { 17142 17143 // We normalize with Webkit giving an empty statusText 17144 17145 statusText = ""; 17146 17147 } 17148 17149 17150 17151 // Filter status for non standard behaviors 17152 17153 17154 17155 // If the request is local and we have data: assume a success 17156 17157 // (success with no data won't get notified, that's the best we 17158 17159 // can do given current implementations) 17160 17161 if ( !status && s.isLocal && !s.crossDomain ) { 17162 17163 status = responses.text ? 200 : 404; 17164 17165 // IE - #1450: sometimes returns 1223 when it should be 204 17166 17167 } else if ( status === 1223 ) { 17168 17169 status = 204; 17170 17171 } 17172 17173 } 17174 17175 } 17176 17177 } catch( firefoxAccessException ) { 17178 17179 if ( !isAbort ) { 17180 17181 complete( -1, firefoxAccessException ); 17182 17183 } 17184 17185 } 17186 17187 17188 17189 // Call complete if needed 17190 17191 if ( responses ) { 17192 17193 complete( status, statusText, responses, responseHeaders ); 17194 17195 } 17196 17197 }; 17198 17199 17200 17201 if ( !s.async ) { 17202 17203 // if we're in sync mode we fire the callback 17204 17205 callback(); 17206 17207 } else if ( xhr.readyState === 4 ) { 17208 17209 // (IE6 & IE7) if it's in cache and has been 17210 17211 // retrieved directly we need to fire the callback 17212 17213 setTimeout( callback ); 17214 17215 } else { 17216 17217 handle = ++xhrId; 17218 17219 if ( xhrOnUnloadAbort ) { 17220 17221 // Create the active xhrs callbacks list if needed 17222 17223 // and attach the unload handler 17224 17225 if ( !xhrCallbacks ) { 17226 17227 xhrCallbacks = {}; 17228 17229 jQuery( window ).unload( xhrOnUnloadAbort ); 17230 17231 } 17232 17233 // Add to list of active xhrs callbacks 17234 17235 xhrCallbacks[ handle ] = callback; 17236 17237 } 17238 17239 xhr.onreadystatechange = callback; 17240 17241 } 17242 17243 }, 17244 17245 17246 17247 abort: function() { 17248 17249 if ( callback ) { 17250 17251 callback( undefined, true ); 17252 17253 } 17254 17255 } 17256 17257 }; 17258 17259 } 17260 17261 }); 17262 17263} 17264 17265var fxNow, timerId, 17266 17267 rfxtypes = /^(?:toggle|show|hide)$/, 17268 17269 rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ), 17270 17271 rrun = /queueHooks$/, 17272 17273 animationPrefilters = [ defaultPrefilter ], 17274 17275 tweeners = { 17276 17277 "*": [function( prop, value ) { 17278 17279 var end, unit, 17280 17281 tween = this.createTween( prop, value ), 17282 17283 parts = rfxnum.exec( value ), 17284 17285 target = tween.cur(), 17286 17287 start = +target || 0, 17288 17289 scale = 1, 17290 17291 maxIterations = 20; 17292 17293 17294 17295 if ( parts ) { 17296 17297 end = +parts[2]; 17298 17299 unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" ); 17300 17301 17302 17303 // We need to compute starting value 17304 17305 if ( unit !== "px" && start ) { 17306 17307 // Iteratively approximate from a nonzero starting point 17308 17309 // Prefer the current property, because this process will be trivial if it uses the same units 17310 17311 // Fallback to end or a simple constant 17312 17313 start = jQuery.css( tween.elem, prop, true ) || end || 1; 17314 17315 17316 17317 do { 17318 17319 // If previous iteration zeroed out, double until we get *something* 17320 17321 // Use a string for doubling factor so we don't accidentally see scale as unchanged below 17322 17323 scale = scale || ".5"; 17324 17325 17326 17327 // Adjust and apply 17328 17329 start = start / scale; 17330 17331 jQuery.style( tween.elem, prop, start + unit ); 17332 17333 17334 17335 // Update scale, tolerating zero or NaN from tween.cur() 17336 17337 // And breaking the loop if scale is unchanged or perfect, or if we've just had enough 17338 17339 } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations ); 17340 17341 } 17342 17343 17344 17345 tween.unit = unit; 17346 17347 tween.start = start; 17348 17349 // If a +=/-= token was provided, we're doing a relative animation 17350 17351 tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end; 17352 17353 } 17354 17355 return tween; 17356 17357 }] 17358 17359 }; 17360 17361 17362 17363// Animations created synchronously will run synchronously 17364 17365function createFxNow() { 17366 17367 setTimeout(function() { 17368 17369 fxNow = undefined; 17370 17371 }); 17372 17373 return ( fxNow = jQuery.now() ); 17374 17375} 17376 17377 17378 17379function createTweens( animation, props ) { 17380 17381 jQuery.each( props, function( prop, value ) { 17382 17383 var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ), 17384 17385 index = 0, 17386 17387 length = collection.length; 17388 17389 for ( ; index < length; index++ ) { 17390 17391 if ( collection[ index ].call( animation, prop, value ) ) { 17392 17393 17394 17395 // we're done with this property 17396 17397 return; 17398 17399 } 17400 17401 } 17402 17403 }); 17404 17405} 17406 17407 17408 17409function Animation( elem, properties, options ) { 17410 17411 var result, 17412 17413 stopped, 17414 17415 index = 0, 17416 17417 length = animationPrefilters.length, 17418 17419 deferred = jQuery.Deferred().always( function() { 17420 17421 // don't match elem in the :animated selector 17422 17423 delete tick.elem; 17424 17425 }), 17426 17427 tick = function() { 17428 17429 if ( stopped ) { 17430 17431 return false; 17432 17433 } 17434 17435 var currentTime = fxNow || createFxNow(), 17436 17437 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), 17438 17439 // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497) 17440 17441 temp = remaining / animation.duration || 0, 17442 17443 percent = 1 - temp, 17444 17445 index = 0, 17446 17447 length = animation.tweens.length; 17448 17449 17450 17451 for ( ; index < length ; index++ ) { 17452 17453 animation.tweens[ index ].run( percent ); 17454 17455 } 17456 17457 17458 17459 deferred.notifyWith( elem, [ animation, percent, remaining ]); 17460 17461 17462 17463 if ( percent < 1 && length ) { 17464 17465 return remaining; 17466 17467 } else { 17468 17469 deferred.resolveWith( elem, [ animation ] ); 17470 17471 return false; 17472 17473 } 17474 17475 }, 17476 17477 animation = deferred.promise({ 17478 17479 elem: elem, 17480 17481 props: jQuery.extend( {}, properties ), 17482 17483 opts: jQuery.extend( true, { specialEasing: {} }, options ), 17484 17485 originalProperties: properties, 17486 17487 originalOptions: options, 17488 17489 startTime: fxNow || createFxNow(), 17490 17491 duration: options.duration, 17492 17493 tweens: [], 17494 17495 createTween: function( prop, end ) { 17496 17497 var tween = jQuery.Tween( elem, animation.opts, prop, end, 17498 17499 animation.opts.specialEasing[ prop ] || animation.opts.easing ); 17500 17501 animation.tweens.push( tween ); 17502 17503 return tween; 17504 17505 }, 17506 17507 stop: function( gotoEnd ) { 17508 17509 var index = 0, 17510 17511 // if we are going to the end, we want to run all the tweens 17512 17513 // otherwise we skip this part 17514 17515 length = gotoEnd ? animation.tweens.length : 0; 17516 17517 if ( stopped ) { 17518 17519 return this; 17520 17521 } 17522 17523 stopped = true; 17524 17525 for ( ; index < length ; index++ ) { 17526 17527 animation.tweens[ index ].run( 1 ); 17528 17529 } 17530 17531 17532 17533 // resolve when we played the last frame 17534 17535 // otherwise, reject 17536 17537 if ( gotoEnd ) { 17538 17539 deferred.resolveWith( elem, [ animation, gotoEnd ] ); 17540 17541 } else { 17542 17543 deferred.rejectWith( elem, [ animation, gotoEnd ] ); 17544 17545 } 17546 17547 return this; 17548 17549 } 17550 17551 }), 17552 17553 props = animation.props; 17554 17555 17556 17557 propFilter( props, animation.opts.specialEasing ); 17558 17559 17560 17561 for ( ; index < length ; index++ ) { 17562 17563 result = animationPrefilters[ index ].call( animation, elem, props, animation.opts ); 17564 17565 if ( result ) { 17566 17567 return result; 17568 17569 } 17570 17571 } 17572 17573 17574 17575 createTweens( animation, props ); 17576 17577 17578 17579 if ( jQuery.isFunction( animation.opts.start ) ) { 17580 17581 animation.opts.start.call( elem, animation ); 17582 17583 } 17584 17585 17586 17587 jQuery.fx.timer( 17588 17589 jQuery.extend( tick, { 17590 17591 elem: elem, 17592 17593 anim: animation, 17594 17595 queue: animation.opts.queue 17596 17597 }) 17598 17599 ); 17600 17601 17602 17603 // attach callbacks from options 17604 17605 return animation.progress( animation.opts.progress ) 17606 17607 .done( animation.opts.done, animation.opts.complete ) 17608 17609 .fail( animation.opts.fail ) 17610 17611 .always( animation.opts.always ); 17612 17613} 17614 17615 17616 17617function propFilter( props, specialEasing ) { 17618 17619 var value, name, index, easing, hooks; 17620 17621 17622 17623 // camelCase, specialEasing and expand cssHook pass 17624 17625 for ( index in props ) { 17626 17627 name = jQuery.camelCase( index ); 17628 17629 easing = specialEasing[ name ]; 17630 17631 value = props[ index ]; 17632 17633 if ( jQuery.isArray( value ) ) { 17634 17635 easing = value[ 1 ]; 17636 17637 value = props[ index ] = value[ 0 ]; 17638 17639 } 17640 17641 17642 17643 if ( index !== name ) { 17644 17645 props[ name ] = value; 17646 17647 delete props[ index ]; 17648 17649 } 17650 17651 17652 17653 hooks = jQuery.cssHooks[ name ]; 17654 17655 if ( hooks && "expand" in hooks ) { 17656 17657 value = hooks.expand( value ); 17658 17659 delete props[ name ]; 17660 17661 17662 17663 // not quite $.extend, this wont overwrite keys already present. 17664 17665 // also - reusing 'index' from above because we have the correct "name" 17666 17667 for ( index in value ) { 17668 17669 if ( !( index in props ) ) { 17670 17671 props[ index ] = value[ index ]; 17672 17673 specialEasing[ index ] = easing; 17674 17675 } 17676 17677 } 17678 17679 } else { 17680 17681 specialEasing[ name ] = easing; 17682 17683 } 17684 17685 } 17686 17687} 17688 17689 17690 17691jQuery.Animation = jQuery.extend( Animation, { 17692 17693 17694 17695 tweener: function( props, callback ) { 17696 17697 if ( jQuery.isFunction( props ) ) { 17698 17699 callback = props; 17700 17701 props = [ "*" ]; 17702 17703 } else { 17704 17705 props = props.split(" "); 17706 17707 } 17708 17709 17710 17711 var prop, 17712 17713 index = 0, 17714 17715 length = props.length; 17716 17717 17718 17719 for ( ; index < length ; index++ ) { 17720 17721 prop = props[ index ]; 17722 17723 tweeners[ prop ] = tweeners[ prop ] || []; 17724 17725 tweeners[ prop ].unshift( callback ); 17726 17727 } 17728 17729 }, 17730 17731 17732 17733 prefilter: function( callback, prepend ) { 17734 17735 if ( prepend ) { 17736 17737 animationPrefilters.unshift( callback ); 17738 17739 } else { 17740 17741 animationPrefilters.push( callback ); 17742 17743 } 17744 17745 } 17746 17747}); 17748 17749 17750 17751function defaultPrefilter( elem, props, opts ) { 17752 17753 /*jshint validthis:true */ 17754 17755 var prop, index, length, 17756 17757 value, dataShow, toggle, 17758 17759 tween, hooks, oldfire, 17760 17761 anim = this, 17762 17763 style = elem.style, 17764 17765 orig = {}, 17766 17767 handled = [], 17768 17769 hidden = elem.nodeType && isHidden( elem ); 17770 17771 17772 17773 // handle queue: false promises 17774 17775 if ( !opts.queue ) { 17776 17777 hooks = jQuery._queueHooks( elem, "fx" ); 17778 17779 if ( hooks.unqueued == null ) { 17780 17781 hooks.unqueued = 0; 17782 17783 oldfire = hooks.empty.fire; 17784 17785 hooks.empty.fire = function() { 17786 17787 if ( !hooks.unqueued ) { 17788 17789 oldfire(); 17790 17791 } 17792 17793 }; 17794 17795 } 17796 17797 hooks.unqueued++; 17798 17799 17800 17801 anim.always(function() { 17802 17803 // doing this makes sure that the complete handler will be called 17804 17805 // before this completes 17806 17807 anim.always(function() { 17808 17809 hooks.unqueued--; 17810 17811 if ( !jQuery.queue( elem, "fx" ).length ) { 17812 17813 hooks.empty.fire(); 17814 17815 } 17816 17817 }); 17818 17819 }); 17820 17821 } 17822 17823 17824 17825 // height/width overflow pass 17826 17827 if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { 17828 17829 // Make sure that nothing sneaks out 17830 17831 // Record all 3 overflow attributes because IE does not 17832 17833 // change the overflow attribute when overflowX and 17834 17835 // overflowY are set to the same value 17836 17837 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; 17838 17839 17840 17841 // Set display property to inline-block for height/width 17842 17843 // animations on inline elements that are having width/height animated 17844 17845 if ( jQuery.css( elem, "display" ) === "inline" && 17846 17847 jQuery.css( elem, "float" ) === "none" ) { 17848 17849 17850 17851 // inline-level elements accept inline-block; 17852 17853 // block-level elements need to be inline with layout 17854 17855 if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) { 17856 17857 style.display = "inline-block"; 17858 17859 17860 17861 } else { 17862 17863 style.zoom = 1; 17864 17865 } 17866 17867 } 17868 17869 } 17870 17871 17872 17873 if ( opts.overflow ) { 17874 17875 style.overflow = "hidden"; 17876 17877 if ( !jQuery.support.shrinkWrapBlocks ) { 17878 17879 anim.always(function() { 17880 17881 style.overflow = opts.overflow[ 0 ]; 17882 17883 style.overflowX = opts.overflow[ 1 ]; 17884 17885 style.overflowY = opts.overflow[ 2 ]; 17886 17887 }); 17888 17889 } 17890 17891 } 17892 17893 17894 17895 17896 17897 // show/hide pass 17898 17899 for ( index in props ) { 17900 17901 value = props[ index ]; 17902 17903 if ( rfxtypes.exec( value ) ) { 17904 17905 delete props[ index ]; 17906 17907 toggle = toggle || value === "toggle"; 17908 17909 if ( value === ( hidden ? "hide" : "show" ) ) { 17910 17911 continue; 17912 17913 } 17914 17915 handled.push( index ); 17916 17917 } 17918 17919 } 17920 17921 17922 17923 length = handled.length; 17924 17925 if ( length ) { 17926 17927 dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} ); 17928 17929 if ( "hidden" in dataShow ) { 17930 17931 hidden = dataShow.hidden; 17932 17933 } 17934 17935 17936 17937 // store state if its toggle - enables .stop().toggle() to "reverse" 17938 17939 if ( toggle ) { 17940 17941 dataShow.hidden = !hidden; 17942 17943 } 17944 17945 if ( hidden ) { 17946 17947 jQuery( elem ).show(); 17948 17949 } else { 17950 17951 anim.done(function() { 17952 17953 jQuery( elem ).hide(); 17954 17955 }); 17956 17957 } 17958 17959 anim.done(function() { 17960 17961 var prop; 17962 17963 jQuery._removeData( elem, "fxshow" ); 17964 17965 for ( prop in orig ) { 17966 17967 jQuery.style( elem, prop, orig[ prop ] ); 17968 17969 } 17970 17971 }); 17972 17973 for ( index = 0 ; index < length ; index++ ) { 17974 17975 prop = handled[ index ]; 17976 17977 tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 ); 17978 17979 orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop ); 17980 17981 17982 17983 if ( !( prop in dataShow ) ) { 17984 17985 dataShow[ prop ] = tween.start; 17986 17987 if ( hidden ) { 17988 17989 tween.end = tween.start; 17990 17991 tween.start = prop === "width" || prop === "height" ? 1 : 0; 17992 17993 } 17994 17995 } 17996 17997 } 17998 17999 } 18000 18001} 18002 18003 18004 18005function Tween( elem, options, prop, end, easing ) { 18006 18007 return new Tween.prototype.init( elem, options, prop, end, easing ); 18008 18009} 18010 18011jQuery.Tween = Tween; 18012 18013 18014 18015Tween.prototype = { 18016 18017 constructor: Tween, 18018 18019 init: function( elem, options, prop, end, easing, unit ) { 18020 18021 this.elem = elem; 18022 18023 this.prop = prop; 18024 18025 this.easing = easing || "swing"; 18026 18027 this.options = options; 18028 18029 this.start = this.now = this.cur(); 18030 18031 this.end = end; 18032 18033 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); 18034 18035 }, 18036 18037 cur: function() { 18038 18039 var hooks = Tween.propHooks[ this.prop ]; 18040 18041 18042 18043 return hooks && hooks.get ? 18044 18045 hooks.get( this ) : 18046 18047 Tween.propHooks._default.get( this ); 18048 18049 }, 18050 18051 run: function( percent ) { 18052 18053 var eased, 18054 18055 hooks = Tween.propHooks[ this.prop ]; 18056 18057 18058 18059 if ( this.options.duration ) { 18060 18061 this.pos = eased = jQuery.easing[ this.easing ]( 18062 18063 percent, this.options.duration * percent, 0, 1, this.options.duration 18064 18065 ); 18066 18067 } else { 18068 18069 this.pos = eased = percent; 18070 18071 } 18072 18073 this.now = ( this.end - this.start ) * eased + this.start; 18074 18075 18076 18077 if ( this.options.step ) { 18078 18079 this.options.step.call( this.elem, this.now, this ); 18080 18081 } 18082 18083 18084 18085 if ( hooks && hooks.set ) { 18086 18087 hooks.set( this ); 18088 18089 } else { 18090 18091 Tween.propHooks._default.set( this ); 18092 18093 } 18094 18095 return this; 18096 18097 } 18098 18099}; 18100 18101 18102 18103Tween.prototype.init.prototype = Tween.prototype; 18104 18105 18106 18107Tween.propHooks = { 18108 18109 _default: { 18110 18111 get: function( tween ) { 18112 18113 var result; 18114 18115 18116 18117 if ( tween.elem[ tween.prop ] != null && 18118 18119 (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { 18120 18121 return tween.elem[ tween.prop ]; 18122 18123 } 18124 18125 18126 18127 // passing an empty string as a 3rd parameter to .css will automatically 18128 18129 // attempt a parseFloat and fallback to a string if the parse fails 18130 18131 // so, simple values such as "10px" are parsed to Float. 18132 18133 // complex values such as "rotate(1rad)" are returned as is. 18134 18135 result = jQuery.css( tween.elem, tween.prop, "" ); 18136 18137 // Empty strings, null, undefined and "auto" are converted to 0. 18138 18139 return !result || result === "auto" ? 0 : result; 18140 18141 }, 18142 18143 set: function( tween ) { 18144 18145 // use step hook for back compat - use cssHook if its there - use .style if its 18146 18147 // available and use plain properties where available 18148 18149 if ( jQuery.fx.step[ tween.prop ] ) { 18150 18151 jQuery.fx.step[ tween.prop ]( tween ); 18152 18153 } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { 18154 18155 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); 18156 18157 } else { 18158 18159 tween.elem[ tween.prop ] = tween.now; 18160 18161 } 18162 18163 } 18164 18165 } 18166 18167}; 18168 18169 18170
vendor: 12,310 bytes, lines 18171-19066
18171// Remove in 2.0 - this supports IE8's panic based approach 18172 18173// to setting things on disconnected nodes 18174 18175 18176 18177Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 18178 18179 set: function( tween ) { 18180 18181 if ( tween.elem.nodeType && tween.elem.parentNode ) { 18182 18183 tween.elem[ tween.prop ] = tween.now; 18184 18185 } 18186 18187 } 18188 18189}; 18190 18191 18192 18193jQuery.each([ "toggle", "show", "hide" ], function( i, name ) { 18194 18195 var cssFn = jQuery.fn[ name ]; 18196 18197 jQuery.fn[ name ] = function( speed, easing, callback ) { 18198 18199 return speed == null || typeof speed === "boolean" ? 18200 18201 cssFn.apply( this, arguments ) : 18202 18203 this.animate( genFx( name, true ), speed, easing, callback ); 18204 18205 }; 18206 18207}); 18208 18209 18210 18211jQuery.fn.extend({ 18212 18213 fadeTo: function( speed, to, easing, callback ) { 18214 18215 18216 18217 // show any hidden elements after setting opacity to 0 18218 18219 return this.filter( isHidden ).css( "opacity", 0 ).show() 18220 18221 18222 18223 // animate to the value specified 18224 18225 .end().animate({ opacity: to }, speed, easing, callback ); 18226 18227 }, 18228 18229 animate: function( prop, speed, easing, callback ) { 18230 18231 var empty = jQuery.isEmptyObject( prop ), 18232 18233 optall = jQuery.speed( speed, easing, callback ), 18234 18235 doAnimation = function() { 18236 18237 // Operate on a copy of prop so per-property easing won't be lost 18238 18239 var anim = Animation( this, jQuery.extend( {}, prop ), optall ); 18240 18241 doAnimation.finish = function() { 18242 18243 anim.stop( true ); 18244 18245 }; 18246 18247 // Empty animations, or finishing resolves immediately 18248 18249 if ( empty || jQuery._data( this, "finish" ) ) { 18250 18251 anim.stop( true ); 18252 18253 } 18254 18255 }; 18256 18257 doAnimation.finish = doAnimation; 18258 18259 18260 18261 return empty || optall.queue === false ? 18262 18263 this.each( doAnimation ) : 18264 18265 this.queue( optall.queue, doAnimation ); 18266 18267 }, 18268 18269 stop: function( type, clearQueue, gotoEnd ) { 18270 18271 var stopQueue = function( hooks ) { 18272 18273 var stop = hooks.stop; 18274 18275 delete hooks.stop; 18276 18277 stop( gotoEnd ); 18278 18279 }; 18280 18281 18282 18283 if ( typeof type !== "string" ) { 18284 18285 gotoEnd = clearQueue; 18286 18287 clearQueue = type; 18288 18289 type = undefined; 18290 18291 } 18292 18293 if ( clearQueue && type !== false ) { 18294 18295 this.queue( type || "fx", [] ); 18296 18297 } 18298 18299 18300 18301 return this.each(function() { 18302 18303 var dequeue = true, 18304 18305 index = type != null && type + "queueHooks", 18306 18307 timers = jQuery.timers, 18308 18309 data = jQuery._data( this ); 18310 18311 18312 18313 if ( index ) { 18314 18315 if ( data[ index ] && data[ index ].stop ) { 18316 18317 stopQueue( data[ index ] ); 18318 18319 } 18320 18321 } else { 18322 18323 for ( index in data ) { 18324 18325 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { 18326 18327 stopQueue( data[ index ] ); 18328 18329 } 18330 18331 } 18332 18333 } 18334 18335 18336 18337 for ( index = timers.length; index--; ) { 18338 18339 if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { 18340 18341 timers[ index ].anim.stop( gotoEnd ); 18342 18343 dequeue = false; 18344 18345 timers.splice( index, 1 ); 18346 18347 } 18348 18349 } 18350 18351 18352 18353 // start the next in the queue if the last step wasn't forced 18354 18355 // timers currently will call their complete callbacks, which will dequeue 18356 18357 // but only if they were gotoEnd 18358 18359 if ( dequeue || !gotoEnd ) { 18360 18361 jQuery.dequeue( this, type ); 18362 18363 } 18364 18365 }); 18366 18367 }, 18368 18369 finish: function( type ) { 18370 18371 if ( type !== false ) { 18372 18373 type = type || "fx"; 18374 18375 } 18376 18377 return this.each(function() { 18378 18379 var index, 18380 18381 data = jQuery._data( this ), 18382 18383 queue = data[ type + "queue" ], 18384 18385 hooks = data[ type + "queueHooks" ], 18386 18387 timers = jQuery.timers, 18388 18389 length = queue ? queue.length : 0; 18390 18391 18392 18393 // enable finishing flag on private data 18394 18395 data.finish = true; 18396 18397 18398 18399 // empty the queue first 18400 18401 jQuery.queue( this, type, [] ); 18402 18403 18404 18405 if ( hooks && hooks.cur && hooks.cur.finish ) { 18406 18407 hooks.cur.finish.call( this ); 18408 18409 } 18410 18411 18412 18413 // look for any active animations, and finish them 18414 18415 for ( index = timers.length; index--; ) { 18416 18417 if ( timers[ index ].elem === this && timers[ index ].queue === type ) { 18418 18419 timers[ index ].anim.stop( true ); 18420 18421 timers.splice( index, 1 ); 18422 18423 } 18424 18425 } 18426 18427 18428 18429 // look for any animations in the old queue and finish them 18430 18431 for ( index = 0; index < length; index++ ) { 18432 18433 if ( queue[ index ] && queue[ index ].finish ) { 18434 18435 queue[ index ].finish.call( this ); 18436 18437 } 18438 18439 } 18440 18441 18442 18443 // turn off finishing flag 18444 18445 delete data.finish; 18446 18447 }); 18448 18449 } 18450 18451}); 18452 18453 18454 18455// Generate parameters to create a standard animation 18456 18457function genFx( type, includeWidth ) { 18458 18459 var which, 18460 18461 attrs = { height: type }, 18462 18463 i = 0; 18464 18465 18466 18467 // if we include width, step value is 1 to do all cssExpand values, 18468 18469 // if we don't include width, step value is 2 to skip over Left and Right 18470 18471 includeWidth = includeWidth? 1 : 0; 18472 18473 for( ; i < 4 ; i += 2 - includeWidth ) { 18474 18475 which = cssExpand[ i ]; 18476 18477 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; 18478 18479 } 18480 18481 18482 18483 if ( includeWidth ) { 18484 18485 attrs.opacity = attrs.width = type; 18486 18487 } 18488 18489 18490 18491 return attrs; 18492 18493} 18494 18495 18496 18497// Generate shortcuts for custom animations 18498 18499jQuery.each({ 18500 18501 slideDown: genFx("show"), 18502 18503 slideUp: genFx("hide"), 18504 18505 slideToggle: genFx("toggle"), 18506 18507 fadeIn: { opacity: "show" }, 18508 18509 fadeOut: { opacity: "hide" }, 18510 18511 fadeToggle: { opacity: "toggle" } 18512 18513}, function( name, props ) { 18514 18515 jQuery.fn[ name ] = function( speed, easing, callback ) { 18516 18517 return this.animate( props, speed, easing, callback ); 18518 18519 }; 18520 18521}); 18522 18523 18524 18525jQuery.speed = function( speed, easing, fn ) { 18526 18527 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { 18528 18529 complete: fn || !fn && easing || 18530 18531 jQuery.isFunction( speed ) && speed, 18532 18533 duration: speed, 18534 18535 easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing 18536 18537 }; 18538 18539 18540 18541 opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : 18542 18543 opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; 18544 18545 18546 18547 // normalize opt.queue - true/undefined/null -> "fx" 18548 18549 if ( opt.queue == null || opt.queue === true ) { 18550 18551 opt.queue = "fx"; 18552 18553 } 18554 18555 18556 18557 // Queueing 18558 18559 opt.old = opt.complete; 18560 18561 18562 18563 opt.complete = function() { 18564 18565 if ( jQuery.isFunction( opt.old ) ) { 18566 18567 opt.old.call( this ); 18568 18569 } 18570 18571 18572 18573 if ( opt.queue ) { 18574 18575 jQuery.dequeue( this, opt.queue ); 18576 18577 } 18578 18579 }; 18580 18581 18582 18583 return opt; 18584 18585}; 18586 18587 18588 18589jQuery.easing = { 18590 18591 linear: function( p ) { 18592 18593 return p; 18594 18595 }, 18596 18597 swing: function( p ) { 18598 18599 return 0.5 - Math.cos( p*Math.PI ) / 2; 18600 18601 } 18602 18603}; 18604 18605 18606 18607jQuery.timers = []; 18608 18609jQuery.fx = Tween.prototype.init; 18610 18611jQuery.fx.tick = function() { 18612 18613 var timer, 18614 18615 timers = jQuery.timers, 18616 18617 i = 0; 18618 18619 18620 18621 fxNow = jQuery.now(); 18622 18623 18624 18625 for ( ; i < timers.length; i++ ) { 18626 18627 timer = timers[ i ]; 18628 18629 // Checks the timer has not already been removed 18630 18631 if ( !timer() && timers[ i ] === timer ) { 18632 18633 timers.splice( i--, 1 ); 18634 18635 } 18636 18637 } 18638 18639 18640 18641 if ( !timers.length ) { 18642 18643 jQuery.fx.stop(); 18644 18645 } 18646 18647 fxNow = undefined; 18648 18649}; 18650 18651 18652 18653jQuery.fx.timer = function( timer ) { 18654 18655 if ( timer() && jQuery.timers.push( timer ) ) { 18656 18657 jQuery.fx.start(); 18658 18659 } 18660 18661}; 18662 18663 18664 18665jQuery.fx.interval = 13; 18666 18667 18668 18669jQuery.fx.start = function() { 18670 18671 if ( !timerId ) { 18672 18673 timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval ); 18674 18675 } 18676 18677}; 18678 18679 18680 18681jQuery.fx.stop = function() { 18682 18683 clearInterval( timerId ); 18684 18685 timerId = null; 18686 18687}; 18688 18689 18690 18691jQuery.fx.speeds = { 18692 18693 slow: 600, 18694 18695 fast: 200, 18696 18697 // Default speed 18698 18699 _default: 400 18700 18701}; 18702 18703 18704 18705// Back Compat <1.8 extension point 18706 18707jQuery.fx.step = {}; 18708 18709 18710 18711if ( jQuery.expr && jQuery.expr.filters ) { 18712 18713 jQuery.expr.filters.animated = function( elem ) { 18714 18715 return jQuery.grep(jQuery.timers, function( fn ) { 18716 18717 return elem === fn.elem; 18718 18719 }).length; 18720 18721 }; 18722 18723} 18724 18725jQuery.fn.offset = function( options ) { 18726 18727 if ( arguments.length ) { 18728 18729 return options === undefined ? 18730 18731 this : 18732 18733 this.each(function( i ) { 18734 18735 jQuery.offset.setOffset( this, options, i ); 18736 18737 }); 18738 18739 } 18740 18741 18742 18743 var docElem, win, 18744 18745 box = { top: 0, left: 0 }, 18746 18747 elem = this[ 0 ], 18748 18749 doc = elem && elem.ownerDocument; 18750 18751 18752 18753 if ( !doc ) { 18754 18755 return; 18756 18757 } 18758 18759 18760 18761 docElem = doc.documentElement; 18762 18763 18764 18765 // Make sure it's not a disconnected DOM node 18766 18767 if ( !jQuery.contains( docElem, elem ) ) { 18768 18769 return box; 18770 18771 } 18772 18773 18774 18775 // If we don't have gBCR, just use 0,0 rather than error 18776 18777 // BlackBerry 5, iOS 3 (original iPhone) 18778 18779 if ( typeof elem.getBoundingClientRect !== core_strundefined ) { 18780 18781 box = elem.getBoundingClientRect(); 18782 18783 } 18784 18785 win = getWindow( doc ); 18786 18787 return { 18788 18789 top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ), 18790 18791 left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 ) 18792 18793 }; 18794 18795}; 18796 18797 18798 18799jQuery.offset = { 18800 18801 18802 18803 setOffset: function( elem, options, i ) { 18804 18805 var position = jQuery.css( elem, "position" ); 18806 18807 18808 18809 // set position first, in-case top/left are set even on static elem 18810 18811 if ( position === "static" ) { 18812 18813 elem.style.position = "relative"; 18814 18815 } 18816 18817 18818 18819 var curElem = jQuery( elem ), 18820 18821 curOffset = curElem.offset(), 18822 18823 curCSSTop = jQuery.css( elem, "top" ), 18824 18825 curCSSLeft = jQuery.css( elem, "left" ), 18826 18827 calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, 18828 18829 props = {}, curPosition = {}, curTop, curLeft; 18830 18831 18832 18833 // need to be able to calculate position if either top or left is auto and position is either absolute or fixed 18834 18835 if ( calculatePosition ) { 18836 18837 curPosition = curElem.position(); 18838 18839 curTop = curPosition.top; 18840 18841 curLeft = curPosition.left; 18842 18843 } else { 18844 18845 curTop = parseFloat( curCSSTop ) || 0; 18846 18847 curLeft = parseFloat( curCSSLeft ) || 0; 18848 18849 } 18850 18851 18852 18853 if ( jQuery.isFunction( options ) ) { 18854 18855 options = options.call( elem, i, curOffset ); 18856 18857 } 18858 18859 18860 18861 if ( options.top != null ) { 18862 18863 props.top = ( options.top - curOffset.top ) + curTop; 18864 18865 } 18866 18867 if ( options.left != null ) { 18868 18869 props.left = ( options.left - curOffset.left ) + curLeft; 18870 18871 } 18872 18873 18874 18875 if ( "using" in options ) { 18876 18877 options.using.call( elem, props ); 18878 18879 } else { 18880 18881 curElem.css( props ); 18882 18883 } 18884 18885 } 18886 18887}; 18888 18889 18890 18891 18892 18893jQuery.fn.extend({ 18894 18895 18896 18897 position: function() { 18898 18899 if ( !this[ 0 ] ) { 18900 18901 return; 18902 18903 } 18904 18905 18906 18907 var offsetParent, offset, 18908 18909 parentOffset = { top: 0, left: 0 }, 18910 18911 elem = this[ 0 ]; 18912 18913 18914 18915 // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent 18916 18917 if ( jQuery.css( elem, "position" ) === "fixed" ) { 18918 18919 // we assume that getBoundingClientRect is available when computed position is fixed 18920 18921 offset = elem.getBoundingClientRect(); 18922 18923 } else { 18924 18925 // Get *real* offsetParent 18926 18927 offsetParent = this.offsetParent(); 18928 18929 18930 18931 // Get correct offsets 18932 18933 offset = this.offset(); 18934 18935 if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { 18936 18937 parentOffset = offsetParent.offset(); 18938 18939 } 18940 18941 18942 18943 // Add offsetParent borders 18944 18945 parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); 18946 18947 parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); 18948 18949 } 18950 18951 18952 18953 // Subtract parent offsets and element margins 18954 18955 // note: when an element has margin: auto the offsetLeft and marginLeft 18956 18957 // are the same in Safari causing offset.left to incorrectly be 0 18958 18959 return { 18960 18961 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), 18962 18963 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true) 18964 18965 }; 18966 18967 }, 18968 18969 18970 18971 offsetParent: function() { 18972 18973 return this.map(function() { 18974 18975 var offsetParent = this.offsetParent || document.documentElement; 18976 18977 while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) { 18978 18979 offsetParent = offsetParent.offsetParent; 18980 18981 } 18982 18983 return offsetParent || document.documentElement; 18984 18985 }); 18986 18987 } 18988 18989}); 18990 18991 18992 18993 18994 18995// Create scrollLeft and scrollTop methods 18996 18997jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) { 18998 18999 var top = /Y/.test( prop ); 19000 19001 19002 19003 jQuery.fn[ method ] = function( val ) { 19004 19005 return jQuery.access( this, function( elem, method, val ) { 19006 19007 var win = getWindow( elem ); 19008 19009 19010 19011 if ( val === undefined ) { 19012 19013 return win ? (prop in win) ? win[ prop ] : 19014 19015 win.document.documentElement[ method ] : 19016 19017 elem[ method ]; 19018 19019 } 19020 19021 19022 19023 if ( win ) { 19024 19025 win.scrollTo( 19026 19027 !top ? val : jQuery( win ).scrollLeft(), 19028 19029 top ? val : jQuery( win ).scrollTop() 19030 19031 ); 19032 19033 19034 19035 } else { 19036 19037 elem[ method ] = val; 19038 19039 } 19040 19041 }, method, val, arguments.length, null ); 19042 19043 }; 19044 19045}); 19046 19047 19048 19049function getWindow( elem ) { 19050 19051 return jQuery.isWindow( elem ) ? 19052 19053 elem : 19054 19055 elem.nodeType === 9 ? 19056 19057 elem.defaultView || elem.parentWindow : 19058 19059 false; 19060 19061} 19062 19063// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 19064 19065jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { 19066
vendor: 2,815 bytes, lines 19067-19192
19067 jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { 19068 19069 // margin is only for outerHeight, outerWidth 19070 19071 jQuery.fn[ funcName ] = function( margin, value ) { 19072 19073 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), 19074 19075 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); 19076 19077 19078 19079 return jQuery.access( this, function( elem, type, value ) { 19080 19081 var doc; 19082 19083 19084 19085 if ( jQuery.isWindow( elem ) ) { 19086 19087 // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there 19088 19089 // isn't a whole lot we can do. See pull request at this URL for discussion: 19090 19091 // https://github.com/jquery/jquery/pull/764 19092 19093 return elem.document.documentElement[ "client" + name ]; 19094 19095 } 19096 19097 19098 19099 // Get document width or height 19100 19101 if ( elem.nodeType === 9 ) { 19102 19103 doc = elem.documentElement; 19104 19105 19106 19107 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest 19108 19109 // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it. 19110 19111 return Math.max( 19112 19113 elem.body[ "scroll" + name ], doc[ "scroll" + name ], 19114 19115 elem.body[ "offset" + name ], doc[ "offset" + name ], 19116 19117 doc[ "client" + name ] 19118 19119 ); 19120 19121 } 19122 19123 19124 19125 return value === undefined ? 19126 19127 // Get width or height on the element, requesting but not forcing parseFloat 19128 19129 jQuery.css( elem, type, extra ) : 19130 19131 19132 19133 // Set width or height on the element 19134 19135 jQuery.style( elem, type, value, extra ); 19136 19137 }, type, chainable ? margin : undefined, chainable, null ); 19138 19139 }; 19140 19141 }); 19142 19143}); 19144 19145// Limit scope pollution from any deprecated API 19146 19147// (function() { 19148 19149 19150 19151// })(); 19152 19153// Expose jQuery to the global object 19154 19155window.jQuery = window.$ = jQuery; 19156 19157 19158 19159// Expose jQuery as an AMD module, but only for AMD loaders that 19160 19161// understand the issues with loading multiple versions of jQuery 19162 19163// in a page that all might call define(). The loader will indicate 19164 19165// they have special allowances for multiple jQuery versions by 19166 19167// specifying define.amd.jQuery = true. Register as a named module, 19168 19169// since jQuery can be concatenated with other files that may use define, 19170 19171// but not use a proper concatenation script that understands anonymous 19172 19173// AMD modules. A named AMD is safest and most robust way to register. 19174 19175// Lowercase jquery is used because AMD module names are derived from 19176 19177// file names, and jQuery is normally delivered in a lowercase file name. 19178 19179// Do this after creating the global so that if an AMD module wants to call 19180 19181// noConflict to hide this version of jQuery, it will work. 19182 19183if ( typeof define === "function" && define.amd && define.amd.jQuery ) { 19184 19185 define( "jquery", [], function () { return jQuery; } ); 19186 19187} 19188 19189 19190 19191})( window ); 19192
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.