1/*! 2 * jQuery JavaScript Library v1.7.1 3 * http://jquery.com/ 4 * 5 * Copyright 2011, John Resig 6 * Dual licensed under the MIT or GPL Version 2 licenses. 7 * http://jquery.org/license 8 * 9 * Includes Sizzle.js 10 * http://sizzlejs.com/ 11 * Copyright 2011, The Dojo Foundation 12 * Released under the MIT, BSD, and GPL Licenses. 13 * 14 * Date: Mon Nov 21 21:11:03 2011 -0500 15 */ 16(function( window, undefined ) { 17 18// Use the correct document accordingly with window argument (sandbox) 19var document = window.document, 20 navigator = window.navigator, 21 location = window.location; 22var jQuery = (function() { 23 24// Define a local copy of jQuery 25var jQuery = function( selector, context ) { 26 // The jQuery object is actually just the init constructor 'enhanced' 27 return new jQuery.fn.init( selector, context, rootjQuery ); 28 }, 29 30 // Map over jQuery in case of overwrite 31 _jQuery = window.jQuery, 32 33 // Map over the $ in case of overwrite 34 _$ = window.$, 35 36 // A central reference to the root jQuery(document) 37 rootjQuery, 38 39 // A simple way to check for HTML strings or ID strings 40 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) 41 quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, 42 43 // Check if a string has a non-whitespace character in it 44 rnotwhite = /\S/, 45 46 // Used for trimming whitespace 47 trimLeft = /^\s+/, 48 trimRight = /\s+$/, 49 50 // Match a standalone tag 51 rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, 52 53 // JSON RegExp 54 rvalidchars = /^[\],:{}\s]*$/, 55 rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, 56 rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, 57 rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, 58 59 // Useragent RegExp 60 rwebkit = /(webkit)[ \/]([\w.]+)/, 61 ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, 62 rmsie = /(msie) ([\w.]+)/, 63 rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, 64 65 // Matches dashed string for camelizing 66 rdashAlpha = /-([a-z]|[0-9])/ig, 67 rmsPrefix = /^-ms-/, 68 69 // Used by jQuery.camelCase as callback to replace() 70 fcamelCase = function( all, letter ) { 71 return ( letter + "" ).toUpperCase(); 72 }, 73 74 // Keep a UserAgent string for use with jQuery.browser 75 userAgent = navigator.userAgent, 76 77 // For matching the engine and version of the browser 78 browserMatch, 79 80 // The deferred used on DOM ready 81 readyList, 82 83 // The ready event handler 84 DOMContentLoaded, 85 86 // Save a reference to some core methods 87 toString = Object.prototype.toString, 88 hasOwn = Object.prototype.hasOwnProperty, 89 push = Array.prototype.push, 90 slice = Array.prototype.slice, 91 trim = String.prototype.trim, 92 indexOf = Array.prototype.indexOf, 93 94 // [[Class]] -> type pairs 95 class2type = {}; 96 97jQuery.fn = jQuery.prototype = { 98 constructor: jQuery, 99 init: function( selector, context, rootjQuery ) { 100 var match, elem, ret, doc; 101 102 // Handle $(""), $(null), or $(undefined) 103 if ( !selector ) { 104 return this; 105 } 106 107 // Handle $(DOMElement) 108 if ( selector.nodeType ) { 109 this.context = this[0] = selector; 110 this.length = 1; 111 return this; 112 } 113 114 // The body element only exists once, optimize finding it 115 if ( selector === "body" && !context && document.body ) { 116 this.context = document; 117 this[0] = document.body; 118 this.selector = selector; 119 this.length = 1; 120 return this; 121 } 122 123 // Handle HTML strings 124 if ( typeof selector === "string" ) { 125 // Are we dealing with HTML string or an ID? 126 if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { 127 // Assume that strings that start and end with <> are HTML and skip the regex check 128 match = [ null, selector, null ]; 129 130 } else { 131 match = quickExpr.exec( selector ); 132 } 133 134 // Verify a match, and that no context was specified for #id 135 if ( match && (match[1] || !context) ) { 136 137 // HANDLE: $(html) -> $(array) 138 if ( match[1] ) { 139 context = context instanceof jQuery ? context[0] : context; 140 doc = ( context ? context.ownerDocument || context : document ); 141 142 // If a single string is passed in and it's a single tag 143 // just do a createElement and skip the rest 144 ret = rsingleTag.exec( selector ); 145 146 if ( ret ) { 147 if ( jQuery.isPlainObject( context ) ) { 148 selector = [ document.createElement( ret[1] ) ]; 149 jQuery.fn.attr.call( selector, context, true ); 150 151 } else { 152 selector = [ doc.createElement( ret[1] ) ]; 153 } 154 155 } else { 156 ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); 157 selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes; 158 } 159 160 return jQuery.merge( this, selector ); 161 162 // HANDLE: $("#id") 163 } else { 164 elem = document.getElementById( match[2] ); 165 166 // Check parentNode to catch when Blackberry 4.6 returns 167 // nodes that are no longer in the document #6963 168 if ( elem && elem.parentNode ) { 169 // Handle the case where IE and Opera return items 170 // by name instead of ID 171 if ( elem.id !== match[2] ) { 172 return rootjQuery.find( selector ); 173 } 174 175 // Otherwise, we inject the element directly into the jQuery object 176 this.length = 1; 177 this[0] = elem; 178 } 179 180 this.context = document; 181 this.selector = selector; 182 return this; 183 } 184 185 // HANDLE: $(expr, $(...)) 186 } else if ( !context || context.jquery ) { 187 return ( context || rootjQuery ).find( selector ); 188 189 // HANDLE: $(expr, context) 190 // (which is just equivalent to: $(context).find(expr) 191 } else { 192 return this.constructor( context ).find( selector ); 193 } 194 195 // HANDLE: $(function) 196 // Shortcut for document ready 197 } else if ( jQuery.isFunction( selector ) ) { 198 return rootjQuery.ready( selector ); 199 } 200 201 if ( selector.selector !== undefined ) { 202 this.selector = selector.selector; 203 this.context = selector.context; 204 } 205 206 return jQuery.makeArray( selector, this ); 207 }, 208 209 // Start with an empty selector 210 selector: "", 211 212 // The current version of jQuery being used 213 jquery: "1.7.1", 214 215 // The default length of a jQuery object is 0 216 length: 0, 217 218 // The number of elements contained in the matched element set 219 size: function() { 220 return this.length; 221 }, 222 223 toArray: function() { 224 return slice.call( this, 0 ); 225 }, 226 227 // Get the Nth element in the matched element set OR 228 // Get the whole matched element set as a clean array 229 get: function( num ) { 230 return num == null ? 231 232 // Return a 'clean' array 233 this.toArray() : 234 235 // Return just the object 236 ( num < 0 ? this[ this.length + num ] : this[ num ] ); 237 }, 238 239 // Take an array of elements and push it onto the stack 240 // (returning the new matched element set) 241 pushStack: function( elems, name, selector ) { 242 // Build a new jQuery matched element set 243 var ret = this.constructor(); 244 245 if ( jQuery.isArray( elems ) ) { 246 push.apply( ret, elems ); 247 248 } else { 249 jQuery.merge( ret, elems ); 250 } 251 252 // Add the old object onto the stack (as a reference)
vendor: 4,209 bytes, lines 253-433
253 ret.prevObject = this; 254 255 ret.context = this.context; 256 257 if ( name === "find" ) { 258 ret.selector = this.selector + ( this.selector ? " " : "" ) + selector; 259 } else if ( name ) { 260 ret.selector = this.selector + "." + name + "(" + selector + ")"; 261 } 262 263 // Return the newly-formed element set 264 return ret; 265 }, 266 267 // Execute a callback for every element in the matched set. 268 // (You can seed the arguments with an array of args, but this is 269 // only used internally.) 270 each: function( callback, args ) { 271 return jQuery.each( this, callback, args ); 272 }, 273 274 ready: function( fn ) { 275 // Attach the listeners 276 jQuery.bindReady(); 277 278 // Add the callback 279 readyList.add( fn ); 280 281 return this; 282 }, 283 284 eq: function( i ) { 285 i = +i; 286 return i === -1 ? 287 this.slice( i ) : 288 this.slice( i, i + 1 ); 289 }, 290 291 first: function() { 292 return this.eq( 0 ); 293 }, 294 295 last: function() { 296 return this.eq( -1 ); 297 }, 298 299 slice: function() { 300 return this.pushStack( slice.apply( this, arguments ), 301 "slice", slice.call(arguments).join(",") ); 302 }, 303 304 map: function( callback ) { 305 return this.pushStack( jQuery.map(this, function( elem, i ) { 306 return callback.call( elem, i, elem ); 307 })); 308 }, 309 310 end: function() { 311 return this.prevObject || this.constructor(null); 312 }, 313 314 // For internal use only. 315 // Behaves like an Array's method, not like a jQuery method. 316 push: push, 317 sort: [].sort, 318 splice: [].splice 319}; 320 321// Give the init function the jQuery prototype for later instantiation 322jQuery.fn.init.prototype = jQuery.fn; 323 324jQuery.extend = jQuery.fn.extend = function() { 325 var options, name, src, copy, copyIsArray, clone, 326 target = arguments[0] || {}, 327 i = 1, 328 length = arguments.length, 329 deep = false; 330 331 // Handle a deep copy situation 332 if ( typeof target === "boolean" ) { 333 deep = target; 334 target = arguments[1] || {}; 335 // skip the boolean and the target 336 i = 2; 337 } 338 339 // Handle case when target is a string or something (possible in deep copy) 340 if ( typeof target !== "object" && !jQuery.isFunction(target) ) { 341 target = {}; 342 } 343 344 // extend jQuery itself if only one argument is passed 345 if ( length === i ) { 346 target = this; 347 --i; 348 } 349 350 for ( ; i < length; i++ ) { 351 // Only deal with non-null/undefined values 352 if ( (options = arguments[ i ]) != null ) { 353 // Extend the base object 354 for ( name in options ) { 355 src = target[ name ]; 356 copy = options[ name ]; 357 358 // Prevent never-ending loop 359 if ( target === copy ) { 360 continue; 361 } 362 363 // Recurse if we're merging plain objects or arrays 364 if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { 365 if ( copyIsArray ) { 366 copyIsArray = false; 367 clone = src && jQuery.isArray(src) ? src : []; 368 369 } else { 370 clone = src && jQuery.isPlainObject(src) ? src : {}; 371 } 372 373 // Never move original objects, clone them 374 target[ name ] = jQuery.extend( deep, clone, copy ); 375 376 // Don't bring in undefined values 377 } else if ( copy !== undefined ) { 378 target[ name ] = copy; 379 } 380 } 381 } 382 } 383 384 // Return the modified object 385 return target; 386}; 387 388jQuery.extend({ 389 noConflict: function( deep ) { 390 if ( window.$ === jQuery ) { 391 window.$ = _$; 392 } 393 394 if ( deep && window.jQuery === jQuery ) { 395 window.jQuery = _jQuery; 396 } 397 398 return jQuery; 399 }, 400 401 // Is the DOM ready to be used? Set to true once it occurs. 402 isReady: false, 403 404 // A counter to track how many items to wait for before 405 // the ready event fires. See #6781 406 readyWait: 1, 407 408 // Hold (or release) the ready event 409 holdReady: function( hold ) { 410 if ( hold ) { 411 jQuery.readyWait++; 412 } else { 413 jQuery.ready( true ); 414 } 415 }, 416 417 // Handle when the DOM is ready 418 ready: function( wait ) { 419 // Either a released hold or an DOMready/load event and not yet ready 420 if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) { 421 // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). 422 if ( !document.body ) { 423 return setTimeout( jQuery.ready, 1 ); 424 } 425 426 // Remember that the DOM is ready 427 jQuery.isReady = true; 428 429 // If a normal DOM Ready event fired, decrement, and wait if need be 430 if ( wait !== true && --jQuery.readyWait > 0 ) { 431 return; 432 } 433
434 // If there are functions bound, to execute 435 readyList.fireWith( document, [ jQuery ] ); 436 437 // Trigger any bound ready events 438 if ( jQuery.fn.trigger ) { 439 jQuery( document ).trigger( "ready" ).off( "ready" ); 440 } 441 } 442 }, 443 444 bindReady: function() { 445 if ( readyList ) { 446 return; 447 } 448 449 readyList = jQuery.Callbacks( "once memory" ); 450 451 // Catch cases where $(document).ready() is called after the 452 // browser event has already occurred. 453 if ( document.readyState === "complete" ) { 454 // Handle it asynchronously to allow scripts the opportunity to delay ready 455 return setTimeout( jQuery.ready, 1 ); 456 } 457 458 // Mozilla, Opera and webkit nightlies currently support this event 459 if ( document.addEventListener ) { 460 // Use the handy event callback 461 document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); 462 463 // A fallback to window.onload, that will always work 464 window.addEventListener( "load", jQuery.ready, false ); 465 466 // If IE event model is used 467 } else if ( document.attachEvent ) { 468 // ensure firing before onload, 469 // maybe late but safe also for iframes 470 document.attachEvent( "onreadystatechange", DOMContentLoaded ); 471 472 // A fallback to window.onload, that will always work 473 window.attachEvent( "onload", jQuery.ready ); 474 475 // If IE and not a frame 476 // continually check to see if the document is ready 477 var toplevel = false; 478 479 try { 480 toplevel = window.frameElement == null; 481 } catch(e) {} 482 483 if ( document.documentElement.doScroll && toplevel ) { 484 doScrollCheck(); 485 } 486 } 487 }, 488 489 // See test/unit/core.js for details concerning isFunction. 490 // Since version 1.3, DOM methods and functions like alert 491 // aren't supported. They return false on IE (#2968). 492 isFunction: function( obj ) { 493 return jQuery.type(obj) === "function"; 494 }, 495 496 isArray: Array.isArray || function( obj ) { 497 return jQuery.type(obj) === "array"; 498 }, 499 500 // A crude way of determining if an object is a window 501 isWindow: function( obj ) { 502 return obj && typeof obj === "object" && "setInterval" in obj; 503 }, 504 505 isNumeric: function( obj ) { 506 return !isNaN( parseFloat(obj) ) && isFinite( obj ); 507 }, 508 509 type: function( obj ) { 510 return obj == null ? 511 String( obj ) : 512 class2type[ toString.call(obj) ] || "object"; 513 }, 514 515 isPlainObject: function( obj ) { 516 // Must be an Object. 517 // Because of IE, we also have to check the presence of the constructor property. 518 // Make sure that DOM nodes and window objects don't pass through, as well 519 if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { 520 return false; 521 } 522 523 try { 524 // Not own constructor property must be Object 525 if ( obj.constructor && 526 !hasOwn.call(obj, "constructor") && 527 !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { 528 return false; 529 } 530 } catch ( e ) { 531 // IE8,9 Will throw exceptions on certain host objects #9897 532 return false; 533 } 534 535 // Own properties are enumerated firstly, so to speed up, 536 // if last one is own, then all properties are own. 537 538 var key; 539 for ( key in obj ) {} 540 541 return key === undefined || hasOwn.call( obj, key ); 542 }, 543 544 isEmptyObject: function( obj ) { 545 for ( var name in obj ) { 546 return false; 547 } 548 return true; 549 }, 550 551 error: function( msg ) { 552 throw new Error( msg ); 553 }, 554 555 parseJSON: function( data ) { 556 if ( typeof data !== "string" || !data ) { 557 return null; 558 } 559 560 // Make sure leading/trailing whitespace is removed (IE can't handle it) 561 data = jQuery.trim( data ); 562 563 // Attempt to parse using the native JSON parser first 564 if ( window.JSON && window.JSON.parse ) { 565 return window.JSON.parse( data ); 566 } 567 568 // Make sure the incoming data is actual JSON 569 // Logic borrowed from http://json.org/json2.js 570 if ( rvalidchars.test( data.replace( rvalidescape, "@" ) 571 .replace( rvalidtokens, "]" ) 572 .replace( rvalidbraces, "")) ) { 573 574 return ( new Function( "return " + data ) )(); 575 576 } 577 jQuery.error( "Invalid JSON: " + data ); 578 }, 579 580 // Cross-browser xml parsing 581 parseXML: function( data ) { 582 var xml, tmp; 583 try { 584 if ( window.DOMParser ) { // Standard 585 tmp = new DOMParser(); 586 xml = tmp.parseFromString( data , "text/xml" ); 587 } else { // IE 588 xml = new ActiveXObject( "Microsoft.XMLDOM" ); 589 xml.async = "false"; 590 xml.loadXML( data ); 591 } 592 } catch( e ) { 593 xml = undefined; 594 } 595 if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { 596 jQuery.error( "Invalid XML: " + data ); 597 } 598 return xml; 599 }, 600 601 noop: function() {}, 602 603 // Evaluates a script in a global context 604 // Workarounds based on findings by Jim Driscoll 605 // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context 606 globalEval: function( data ) { 607 if ( data && rnotwhite.test( data ) ) { 608 // We use execScript on Internet Explorer 609 // We use an anonymous function so that context is window 610 // rather than jQuery in Firefox 611 ( window.execScript || function( data ) { 612 window[ "eval" ].call( window, data ); 613 } )( data ); 614 } 615 }, 616 617 // Convert dashed to camelCase; used by the css and data modules 618 // Microsoft forgot to hump their vendor prefix (#9572) 619 camelCase: function( string ) { 620 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 621 }, 622
623 nodeName: function( elem, name ) { 624 return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); 625 }, 626 627 // args is for internal usage only 628 each: function( object, callback, args ) { 629 var name, i = 0, 630 length = object.length, 631 isObj = length === undefined || jQuery.isFunction( object ); 632 633 if ( args ) { 634 if ( isObj ) { 635 for ( name in object ) { 636 if ( callback.apply( object[ name ], args ) === false ) { 637 break; 638 } 639 } 640 } else { 641 for ( ; i < length; ) { 642 if ( callback.apply( object[ i++ ], args ) === false ) { 643 break; 644 } 645 } 646 } 647 648 // A special, fast, case for the most common use of each 649 } else { 650 if ( isObj ) { 651 for ( name in object ) { 652 if ( callback.call( object[ name ], name, object[ name ] ) === false ) { 653 break; 654 } 655 } 656 } else { 657 for ( ; i < length; ) { 658 if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) { 659 break; 660 } 661 } 662 } 663 } 664 665 return object; 666 }, 667 668 // Use native String.trim function wherever possible 669 trim: trim ? 670 function( text ) { 671 return text == null ? 672 "" : 673 trim.call( text ); 674 } : 675 676 // Otherwise use our own trimming functionality 677 function( text ) { 678 return text == null ? 679 "" : 680 text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); 681 }, 682 683 // results is for internal usage only 684 makeArray: function( array, results ) { 685 var ret = results || []; 686 687 if ( array != null ) { 688 // The window, strings (and functions) also have 'length' 689 // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 690 var type = jQuery.type( array ); 691 692 if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { 693 push.call( ret, array ); 694 } else { 695 jQuery.merge( ret, array ); 696 } 697 } 698 699 return ret; 700 }, 701 702 inArray: function( elem, array, i ) { 703 var len; 704 705 if ( array ) { 706 if ( indexOf ) { 707 return indexOf.call( array, elem, i ); 708 } 709 710 len = array.length; 711 i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; 712 713 for ( ; i < len; i++ ) { 714 // Skip accessing in sparse arrays 715 if ( i in array && array[ i ] === elem ) { 716 return i; 717 } 718 } 719 } 720 721 return -1; 722 }, 723 724 merge: function( first, second ) { 725 var i = first.length, 726 j = 0; 727 728 if ( typeof second.length === "number" ) { 729 for ( var l = second.length; j < l; j++ ) { 730 first[ i++ ] = second[ j ]; 731 } 732 733 } else { 734 while ( second[j] !== undefined ) { 735 first[ i++ ] = second[ j++ ]; 736 } 737 } 738 739 first.length = i; 740 741 return first; 742 }, 743 744 grep: function( elems, callback, inv ) { 745 var ret = [], retVal; 746 inv = !!inv; 747 748 // Go through the array, only saving the items 749 // that pass the validator function 750 for ( var i = 0, length = elems.length; i < length; i++ ) { 751 retVal = !!callback( elems[ i ], i ); 752 if ( inv !== retVal ) { 753 ret.push( elems[ i ] ); 754 } 755 } 756 757 return ret; 758 }, 759 760 // arg is for internal usage only 761 map: function( elems, callback, arg ) { 762 var value, key, ret = [], 763 i = 0, 764 length = elems.length, 765 // jquery objects are treated as arrays 766 isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ; 767 768 // Go through the array, translating each of the items to their 769 if ( isArray ) { 770 for ( ; i < length; i++ ) { 771 value = callback( elems[ i ], i, arg ); 772 773 if ( value != null ) { 774 ret[ ret.length ] = value; 775 } 776 } 777 778 // Go through every key on the object, 779 } else { 780 for ( key in elems ) { 781 value = callback( elems[ key ], key, arg ); 782 783 if ( value != null ) { 784 ret[ ret.length ] = value; 785 } 786 } 787 } 788 789 // Flatten any nested arrays 790 return ret.concat.apply( [], ret ); 791 }, 792 793 // A global GUID counter for objects 794 guid: 1, 795 796 // Bind a function to a context, optionally partially applying any 797 // arguments. 798 proxy: function( fn, context ) { 799 if ( typeof context === "string" ) { 800 var tmp = fn[ context ]; 801 context = fn; 802 fn = tmp; 803 } 804 805 // Quick check to determine if target is callable, in the spec 806 // this throws a TypeError, but we will just return undefined. 807 if ( !jQuery.isFunction( fn ) ) { 808 return undefined; 809 } 810 811 // Simulated bind 812 var args = slice.call( arguments, 2 ), 813 proxy = function() { 814 return fn.apply( context, args.concat( slice.call( arguments ) ) ); 815 }; 816 817 // Set the guid of unique handler to the same of original handler, so it can be removed 818 proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; 819 820 return proxy; 821 }, 822 823 // Mutifunctional method to get and set values to a collection 824 // The value/s can optionally be executed if it's a function 825 access: function( elems, key, value, exec, fn, pass ) { 826 var length = elems.length; 827 828 // Setting many attributes 829 if ( typeof key === "object" ) { 830 for ( var k in key ) { 831 jQuery.access( elems, k, key[k], exec, fn, value ); 832 } 833 return elems; 834 } 835 836 // Setting one attribute 837 if ( value !== undefined ) { 838 // Optionally, function values get executed if exec is true 839 exec = !pass && exec && jQuery.isFunction(value); 840 841 for ( var i = 0; i < length; i++ ) { 842 fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); 843 } 844 845 return elems; 846 } 847 848 // Getting an attribute 849 return length ? fn( elems[0], key ) : undefined; 850 }, 851 852 now: function() { 853 return ( new Date() ).getTime(); 854 }, 855 856 // Use of jQuery.browser is frowned upon. 857 // More details: http://docs.jquery.com/Utilities/jQuery.browser 858 uaMatch: function( ua ) { 859 ua = ua.toLowerCase(); 860 861 var match = rwebkit.exec( ua ) || 862 ropera.exec( ua ) || 863 rmsie.exec( ua ) || 864 ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || 865 []; 866 867 return { browser: match[1] || "", version: match[2] || "0" }; 868 }, 869 870 sub: function() { 871 function jQuerySub( selector, context ) { 872 return new jQuerySub.fn.init( selector, context ); 873 } 874 jQuery.extend( true, jQuerySub, this ); 875 jQuerySub.superclass = this; 876 jQuerySub.fn = jQuerySub.prototype = this(); 877 jQuerySub.fn.constructor = jQuerySub; 878 jQuerySub.sub = this.sub; 879 jQuerySub.fn.init = function init( selector, context ) { 880 if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { 881 context = jQuerySub( context ); 882 } 883 884 return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); 885 }; 886 jQuerySub.fn.init.prototype = jQuerySub.fn; 887 var rootjQuerySub = jQuerySub(document); 888 return jQuerySub; 889 }, 890 891 browser: {} 892}); 893 894// Populate the class2type map 895jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { 896 class2type[ "[object " + name + "]" ] = name.toLowerCase(); 897}); 898 899browserMatch = jQuery.uaMatch( userAgent ); 900if ( browserMatch.browser ) { 901 jQuery.browser[ browserMatch.browser ] = true; 902 jQuery.browser.version = browserMatch.version; 903} 904 905// Deprecated, use jQuery.browser.webkit instead 906if ( jQuery.browser.webkit ) { 907 jQuery.browser.safari = true; 908} 909
910// IE doesn't match non-breaking spaces with \s 911if ( rnotwhite.test( "\xA0" ) ) { 912 trimLeft = /^[\s\xA0]+/; 913 trimRight = /[\s\xA0]+$/; 914} 915 916// All jQuery objects should point back to these 917rootjQuery = jQuery(document); 918 919// Cleanup functions for the document ready method 920if ( document.addEventListener ) { 921 DOMContentLoaded = function() { 922 document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); 923 jQuery.ready(); 924 }; 925 926} else if ( document.attachEvent ) { 927 DOMContentLoaded = function() { 928 // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). 929 if ( document.readyState === "complete" ) { 930 document.detachEvent( "onreadystatechange", DOMContentLoaded ); 931 jQuery.ready(); 932 } 933 }; 934} 935 936// The DOM ready check for Internet Explorer 937function doScrollCheck() { 938 if ( jQuery.isReady ) { 939 return; 940 } 941 942 try { 943 // If IE is used, use the trick by Diego Perini 944 // http://javascript.nwbox.com/IEContentLoaded/ 945 document.documentElement.doScroll("left"); 946 } catch(e) { 947 setTimeout( doScrollCheck, 1 ); 948 return; 949 } 950 951 // and execute any waiting functions 952 jQuery.ready(); 953} 954 955return jQuery; 956 957})(); 958 959 960// String to Object flags format cache 961var flagsCache = {}; 962 963// Convert String-formatted flags into Object-formatted ones and store in cache 964function createFlags( flags ) { 965 var object = flagsCache[ flags ] = {}, 966 i, length; 967 flags = flags.split( /\s+/ ); 968 for ( i = 0, length = flags.length; i < length; i++ ) { 969 object[ flags[i] ] = true; 970 } 971 return object; 972} 973 974/* 975 * Create a callback list using the following parameters: 976 * 977 * flags: an optional list of space-separated flags that will change how 978 * the callback list behaves 979 * 980 * By default a callback list will act like an event callback list and can be 981 * "fired" multiple times. 982 * 983 * Possible flags: 984 * 985 * once: will ensure the callback list can only be fired once (like a Deferred) 986 * 987 * memory: will keep track of previous values and will call any callback added 988 * after the list has been fired right away with the latest "memorized" 989 * values (like a Deferred) 990 * 991 * unique: will ensure a callback can only be added once (no duplicate in the list) 992 * 993 * stopOnFalse: interrupt callings when a callback returns false 994 * 995 */ 996jQuery.Callbacks = function( flags ) { 997 998 // Convert flags from String-formatted to Object-formatted 999 // (we check in cache first) 1000 flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {}; 1001 1002 var // Actual callback list 1003 list = [], 1004 // Stack of fire calls for repeatable lists 1005 stack = [], 1006 // Last fire value (for non-forgettable lists) 1007 memory, 1008 // Flag to know if list is currently firing 1009 firing, 1010 // First callback to fire (used internally by add and fireWith) 1011 firingStart, 1012 // End of the loop when firing 1013 firingLength, 1014 // Index of currently firing callback (modified by remove if needed) 1015 firingIndex, 1016 // Add one or several callbacks to the list 1017 add = function( args ) { 1018 var i, 1019 length, 1020 elem, 1021 type, 1022 actual; 1023 for ( i = 0, length = args.length; i < length; i++ ) { 1024 elem = args[ i ]; 1025 type = jQuery.type( elem ); 1026 if ( type === "array" ) { 1027 // Inspect recursively 1028 add( elem ); 1029 } else if ( type === "function" ) { 1030 // Add if not in unique mode and callback is not in 1031 if ( !flags.unique || !self.has( elem ) ) { 1032 list.push( elem ); 1033 } 1034 } 1035 } 1036 }, 1037 // Fire callbacks 1038 fire = function( context, args ) { 1039 args = args || []; 1040 memory = !flags.memory || [ context, args ]; 1041 firing = true; 1042 firingIndex = firingStart || 0; 1043 firingStart = 0; 1044 firingLength = list.length; 1045 for ( ; list && firingIndex < firingLength; firingIndex++ ) { 1046 if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) { 1047 memory = true; // Mark as halted 1048 break; 1049 } 1050 } 1051 firing = false; 1052 if ( list ) { 1053 if ( !flags.once ) { 1054 if ( stack && stack.length ) { 1055 memory = stack.shift(); 1056 self.fireWith( memory[ 0 ], memory[ 1 ] ); 1057 } 1058 } else if ( memory === true ) { 1059 self.disable(); 1060 } else { 1061 list = []; 1062 } 1063 } 1064 }, 1065 // Actual Callbacks object 1066 self = { 1067 // Add a callback or a collection of callbacks to the list 1068 add: function() { 1069 if ( list ) { 1070 var length = list.length; 1071 add( arguments ); 1072 // Do we need to add the callbacks to the 1073 // current firing batch? 1074 if ( firing ) { 1075 firingLength = list.length; 1076 // With memory, if we're not firing then 1077 // we should call right away, unless previous 1078 // firing was halted (stopOnFalse) 1079 } else if ( memory && memory !== true ) { 1080 firingStart = length; 1081 fire( memory[ 0 ], memory[ 1 ] ); 1082 } 1083 } 1084 return this; 1085 }, 1086 // Remove a callback from the list 1087 remove: function() { 1088 if ( list ) { 1089 var args = arguments, 1090 argIndex = 0, 1091 argLength = args.length; 1092 for ( ; argIndex < argLength ; argIndex++ ) { 1093 for ( var i = 0; i < list.length; i++ ) { 1094 if ( args[ argIndex ] === list[ i ] ) { 1095 // Handle firingIndex and firingLength 1096 if ( firing ) { 1097 if ( i <= firingLength ) { 1098 firingLength--; 1099 if ( i <= firingIndex ) { 1100 firingIndex--; 1101 } 1102 } 1103 } 1104 // Remove the element 1105 list.splice( i--, 1 ); 1106 // If we have some unicity property then 1107 // we only need to do this once 1108 if ( flags.unique ) { 1109 break; 1110 } 1111 } 1112 } 1113 } 1114 } 1115 return this; 1116 }, 1117 // Control if a given callback is in the list 1118 has: function( fn ) { 1119 if ( list ) { 1120 var i = 0, 1121 length = list.length; 1122 for ( ; i < length; i++ ) { 1123 if ( fn === list[ i ] ) { 1124 return true; 1125 } 1126 } 1127 } 1128 return false;
1129 }, 1130 // Remove all callbacks from the list 1131 empty: function() { 1132 list = []; 1133 return this; 1134 }, 1135 // Have the list do nothing anymore 1136 disable: function() { 1137 list = stack = memory = undefined; 1138 return this; 1139 }, 1140 // Is it disabled? 1141 disabled: function() { 1142 return !list; 1143 }, 1144 // Lock the list in its current state 1145 lock: function() { 1146 stack = undefined; 1147 if ( !memory || memory === true ) { 1148 self.disable(); 1149 } 1150 return this; 1151 }, 1152 // Is it locked? 1153 locked: function() { 1154 return !stack; 1155 }, 1156 // Call all callbacks with the given context and arguments 1157 fireWith: function( context, args ) { 1158 if ( stack ) { 1159 if ( firing ) { 1160 if ( !flags.once ) { 1161 stack.push( [ context, args ] ); 1162 } 1163 } else if ( !( flags.once && memory ) ) { 1164 fire( context, args ); 1165 } 1166 } 1167 return this; 1168 }, 1169 // Call all the callbacks with the given arguments 1170 fire: function() { 1171 self.fireWith( this, arguments ); 1172 return this; 1173 }, 1174 // To know if the callbacks have already been called at least once 1175 fired: function() { 1176 return !!memory; 1177 } 1178 }; 1179 1180 return self; 1181}; 1182 1183 1184 1185 1186var // Static reference to slice 1187 sliceDeferred = [].slice; 1188 1189jQuery.extend({ 1190 1191 Deferred: function( func ) { 1192 var doneList = jQuery.Callbacks( "once memory" ), 1193 failList = jQuery.Callbacks( "once memory" ), 1194 progressList = jQuery.Callbacks( "memory" ), 1195 state = "pending", 1196 lists = { 1197 resolve: doneList, 1198 reject: failList, 1199 notify: progressList 1200 }, 1201 promise = { 1202 done: doneList.add, 1203 fail: failList.add, 1204 progress: progressList.add, 1205 1206 state: function() { 1207 return state; 1208 }, 1209 1210 // Deprecated 1211 isResolved: doneList.fired, 1212 isRejected: failList.fired, 1213 1214 then: function( doneCallbacks, failCallbacks, progressCallbacks ) { 1215 deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks ); 1216 return this; 1217 }, 1218 always: function() { 1219 deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments ); 1220 return this; 1221 }, 1222 pipe: function( fnDone, fnFail, fnProgress ) { 1223 return jQuery.Deferred(function( newDefer ) { 1224 jQuery.each( { 1225 done: [ fnDone, "resolve" ], 1226 fail: [ fnFail, "reject" ], 1227 progress: [ fnProgress, "notify" ] 1228 }, function( handler, data ) { 1229 var fn = data[ 0 ], 1230 action = data[ 1 ], 1231 returned; 1232 if ( jQuery.isFunction( fn ) ) { 1233 deferred[ handler ](function() { 1234 returned = fn.apply( this, arguments ); 1235 if ( returned && jQuery.isFunction( returned.promise ) ) { 1236 returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify ); 1237 } else { 1238 newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] ); 1239 } 1240 }); 1241 } else { 1242 deferred[ handler ]( newDefer[ action ] ); 1243 } 1244 }); 1245 }).promise(); 1246 }, 1247 // Get a promise for this deferred 1248 // If obj is provided, the promise aspect is added to the object 1249 promise: function( obj ) { 1250 if ( obj == null ) { 1251 obj = promise; 1252 } else { 1253 for ( var key in promise ) { 1254 obj[ key ] = promise[ key ]; 1255 } 1256 } 1257 return obj; 1258 } 1259 }, 1260 deferred = promise.promise({}), 1261 key; 1262 1263 for ( key in lists ) { 1264 deferred[ key ] = lists[ key ].fire; 1265 deferred[ key + "With" ] = lists[ key ].fireWith; 1266 } 1267 1268 // Handle state 1269 deferred.done( function() { 1270 state = "resolved"; 1271 }, failList.disable, progressList.lock ).fail( function() { 1272 state = "rejected"; 1273 }, doneList.disable, progressList.lock ); 1274 1275 // Call given func if any 1276 if ( func ) { 1277 func.call( deferred, deferred ); 1278 } 1279 1280 // All done! 1281 return deferred; 1282 }, 1283 1284 // Deferred helper 1285 when: function( firstParam ) { 1286 var args = sliceDeferred.call( arguments, 0 ), 1287 i = 0, 1288 length = args.length, 1289 pValues = new Array( length ), 1290 count = length, 1291 pCount = length, 1292 deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ? 1293 firstParam : 1294 jQuery.Deferred(), 1295 promise = deferred.promise(); 1296 function resolveFunc( i ) { 1297 return function( value ) { 1298 args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; 1299 if ( !( --count ) ) { 1300 deferred.resolveWith( deferred, args ); 1301 } 1302 }; 1303 } 1304 function progressFunc( i ) { 1305 return function( value ) { 1306 pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; 1307 deferred.notifyWith( promise, pValues ); 1308 }; 1309 } 1310 if ( length > 1 ) { 1311 for ( ; i < length; i++ ) { 1312 if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) { 1313 args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) ); 1314 } else { 1315 --count; 1316 } 1317 } 1318 if ( !count ) { 1319 deferred.resolveWith( deferred, args ); 1320 } 1321 } else if ( deferred !== firstParam ) { 1322 deferred.resolveWith( deferred, length ? [ firstParam ] : [] ); 1323 } 1324 return promise; 1325 } 1326}); 1327 1328 1329 1330 1331jQuery.support = (function() { 1332 1333 var support, 1334 all, 1335 a, 1336 select, 1337 opt, 1338 input, 1339 marginDiv, 1340 fragment, 1341 tds, 1342 events, 1343 eventName, 1344 i, 1345 isSupported, 1346 div = document.createElement( "div" ), 1347 documentElement = document.documentElement; 1348 1349 // Preliminary tests 1350 div.setAttribute("className", "t"); 1351 div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a>
1351<input type='checkbox'/>"; 1352 1353 all = div.getElementsByTagName( "*" ); 1354 a = div.getElementsByTagName( "a" )[ 0 ]; 1355 1356 // Can't get basic test support 1357 if ( !all || !all.length || !a ) { 1358 return {}; 1359 } 1360 1361 // First batch of supports tests 1362 select = document.createElement( "select" ); 1363 opt = select.appendChild( document.createElement("option") ); 1364 input = div.getElementsByTagName( "input" )[ 0 ]; 1365 1366 support = { 1367 // IE strips leading whitespace when .innerHTML is used 1368 leadingWhitespace: ( div.firstChild.nodeType === 3 ), 1369 1370 // Make sure that tbody elements aren't automatically inserted 1371 // IE will insert them into empty tables 1372 tbody: !div.getElementsByTagName("tbody").length, 1373 1374 // Make sure that link elements get serialized correctly by innerHTML 1375 // This requires a wrapper element in IE 1376 htmlSerialize: !!div.getElementsByTagName("link").length, 1377 1378 // Get the style information from getAttribute 1379 // (IE uses .cssText instead) 1380 style: /top/.test( a.getAttribute("style") ), 1381 1382 // Make sure that URLs aren't manipulated 1383 // (IE normalizes it by default) 1384 hrefNormalized: ( a.getAttribute("href") === "/a" ), 1385 1386 // Make sure that element opacity exists 1387 // (IE uses filter instead) 1388 // Use a regex to work around a WebKit issue. See #5145 1389 opacity: /^0.55/.test( a.style.opacity ), 1390 1391 // Verify style float existence 1392 // (IE uses styleFloat instead of cssFloat) 1393 cssFloat: !!a.style.cssFloat, 1394 1395 // Make sure that if no value is specified for a checkbox 1396 // that it defaults to "on". 1397 // (WebKit defaults to "" instead) 1398 checkOn: ( input.value === "on" ), 1399 1400 // Make sure that a selected-by-default option has a working selected property. 1401 // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) 1402 optSelected: opt.selected, 1403 1404 // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) 1405 getSetAttribute: div.className !== "t", 1406 1407 // Tests for enctype support on a form(#6743) 1408 enctype: !!document.createElement("form").enctype, 1409 1410 // Makes sure cloning an html5 element does not cause problems 1411 // Where outerHTML is undefined, this still works 1412 html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>", 1413 1414 // Will be defined later 1415 submitBubbles: true, 1416 changeBubbles: true, 1417 focusinBubbles: false, 1418 deleteExpando: true, 1419 noCloneEvent: true, 1420 inlineBlockNeedsLayout: false, 1421 shrinkWrapBlocks: false, 1422 reliableMarginRight: true 1423 }; 1424 1425 // Make sure checked status is properly cloned 1426 input.checked = true; 1427 support.noCloneChecked = input.cloneNode( true ).checked; 1428 1429 // Make sure that the options inside disabled selects aren't marked as disabled 1430 // (WebKit marks them as disabled) 1431 select.disabled = true; 1432 support.optDisabled = !opt.disabled; 1433 1434 // Test to see if it's possible to delete an expando from an element 1435 // Fails in Internet Explorer 1436 try { 1437 delete div.test; 1438 } catch( e ) { 1439 support.deleteExpando = false; 1440 } 1441 1442 if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { 1443 div.attachEvent( "onclick", function() { 1444 // Cloning a node shouldn't copy over any 1445 // bound event handlers (IE does this) 1446 support.noCloneEvent = false; 1447 }); 1448 div.cloneNode( true ).fireEvent( "onclick" ); 1449 } 1450 1451 // Check if a radio maintains its value 1452 // after being appended to the DOM 1453 input = document.createElement("input"); 1454 input.value = "t"; 1455 input.setAttribute("type", "radio"); 1456 support.radioValue = input.value === "t"; 1457 1458 input.setAttribute("checked", "checked"); 1459 div.appendChild( input ); 1460 fragment = document.createDocumentFragment(); 1461 fragment.appendChild( div.lastChild ); 1462 1463 // WebKit doesn't clone checked state correctly in fragments 1464 support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; 1465 1466 // Check if a disconnected checkbox will retain its checked 1467 // value of true after appended to the DOM (IE6/7) 1468 support.appendChecked = input.checked; 1469 1470 fragment.removeChild( input ); 1471 fragment.appendChild( div ); 1472 1473 div.innerHTML = ""; 1474 1475 // Check if div with explicit width and no margin-right incorrectly 1476 // gets computed margin-right based on width of container. For more 1477 // info see bug #3333 1478 // Fails in WebKit before Feb 2011 nightlies 1479 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right 1480 if ( window.getComputedStyle ) { 1481 marginDiv = document.createElement( "div" ); 1482 marginDiv.style.width = "0"; 1483 marginDiv.style.marginRight = "0"; 1484 div.style.width = "2px"; 1485 div.appendChild( marginDiv ); 1486 support.reliableMarginRight = 1487 ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0; 1488 } 1489 1490 // Technique from Juriy Zaytsev 1491 // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/ 1492 // We only care about the case where non-standard event systems 1493 // are used, namely in IE. Short-circuiting here helps us to 1494 // avoid an eval call (in setAttribute) which can cause CSP 1495 // to go haywire. See: https://developer.mozilla.org/en/Security/CSP 1496 if ( div.attachEvent ) { 1497 for( i in { 1498 submit: 1, 1499 change: 1, 1500 focusin: 1 1501 }) { 1502 eventName = "on" + i; 1503 isSupported = ( eventName in div ); 1504 if ( !isSupported ) { 1505 div.setAttribute( eventName, "return;" ); 1506 isSupported = ( typeof div[ eventName ] === "function" ); 1507 } 1508 support[ i + "Bubbles" ] = isSupported; 1509 } 1510 } 1511 1512 fragment.removeChild( div ); 1513 1514 // Null elements to avoid leaks in IE 1515 fragment = select = opt = marginDiv = div = input = null; 1516 1517 // Run tests that need a body at doc ready 1518 jQuery(function() { 1519 var container, outer, inner, table, td, offsetSupport, 1520 conMarginTop, ptlm, vb, style, html, 1521 body = document.getElementsByTagName("body")[0]; 1522 1523 if ( !body ) { 1524 // Return for frameset docs that don't have a body 1525 return; 1526 } 1527 1528 conMarginTop = 1; 1529 ptlm = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;"; 1530 vb = "visibility:hidden;border:0;"; 1531 style = "style='" + ptlm + "border:5px solid #000;padding:0;'"; 1532 html = "<div " + style + "><div></div></div>" + 1533 "<table " + style + " cellpadding='0' cellspacing='0'>" + 1534 "<tr><td></td></tr></table>"; 1535 1536 container = document.createElement("div"); 1537 container.style.cssText = vb + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px"; 1538 body.insertBefore( container, body.firstChild ); 1539 1540 // Construct the test element 1541 div = document.createElement("div"); 1542 container.appendChild( div ); 1543 1544 // Check if table cells still have offsetWidth/Height when they are set 1545 // to display:none and there are still other visible table cells in a 1546 // table row; if so, offsetWidth/Height are not reliable for use when 1547 // determining if an element has been hidden directly using 1548 // display:none (it is still safe to use offsets if a parent element is 1549 // hidden; don safety goggles and see bug #4512 for more information). 1550 // (only IE 8 fails this test) 1551 div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>"; 1552 tds = div.getElementsByTagName( "td" ); 1553 isSupported = ( tds[ 0 ].offsetHeight === 0 ); 1554 1555 tds[ 0 ].style.display = ""; 1556 tds[ 1 ].style.display = "none"; 1557 1558 // Check if empty table cells still have offsetWidth/Height 1559 // (IE <= 8 fail this test) 1560 support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); 1561 1562 // Figure out if the W3C box model works as expected 1563 div.innerHTML = ""; 1564 div.style.width = div.style.paddingLeft = "1px"; 1565 jQuery.boxModel = support.boxModel = div.offsetWidth === 2; 1566 1567 if ( typeof div.style.zoom !== "undefined" ) { 1568 // Check if natively block-level elements act like inline-block 1569 // elements when setting their display to 'inline' and giving 1570 // them layout 1571 // (IE < 8 does this) 1572 div.style.display = "inline"; 1573 div.style.zoom = 1; 1574 support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 ); 1575 1576 // Check if elements with layout shrink-wrap their children 1577 // (IE 6 does this) 1578 div.style.display = ""; 1579 div.innerHTML = "<div style='width:4px;'></div>"; 1580 support.shrinkWrapBlocks = ( div.offsetWidth !== 2 ); 1581 } 1582 1583 div.style.cssText = ptlm + vb; 1584 div.innerHTML = html; 1585 1586 outer = div.firstChild; 1587 inner = outer.firstChild; 1588 td = outer.nextSibling.firstChild.firstChild; 1589 1590 offsetSupport = { 1591 doesNotAddBorder: ( inner.offsetTop !== 5 ), 1592 doesAddBorderForTableAndCells: ( td.offsetTop === 5 ) 1593 }; 1594 1595 inner.style.position = "fixed"; 1596 inner.style.top = "20px"; 1597 1598 // safari subtracts parent border width here which is 5px 1599 offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 ); 1600 inner.style.position = inner.style.top = ""; 1601 1602 outer.style.overflow = "hidden"; 1603 outer.style.position = "relative"; 1604 1605 offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 ); 1606 offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop ); 1607 1608 body.removeChild( container ); 1609 div = container = null; 1610 1611 jQuery.extend( support, offsetSupport ); 1612 }); 1613 1614 return support; 1615})(); 1616 1617 1618 1619 1620var rbrace = /^(?:\{.*\}|\[.*\])$/, 1621 rmultiDash = /([A-Z])/g; 1622 1623jQuery.extend({ 1624 cache: {}, 1625 1626 // Please use with caution 1627 uuid: 0, 1628 1629 // Unique for each copy of jQuery on the page 1630 // Non-digits removed to match rinlinejQuery 1631 expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), 1632 1633 // The following elements throw uncatchable exceptions if you 1634 // attempt to add expando properties to them. 1635 noData: { 1636 "embed": true, 1637 // Ban all objects except for Flash (which handle expandos) 1638 "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", 1639 "applet": true 1640 }, 1641 1642 hasData: function( elem ) { 1643 elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; 1644 return !!elem && !isEmptyDataObject( elem ); 1645 }, 1646 1647 data: function( elem, name, data, pvt /* Internal Use Only */ ) { 1648 if ( !jQuery.acceptData( elem ) ) { 1649 return; 1650 } 1651 1652 var privateCache, thisCache, ret, 1653 internalKey = jQuery.expando, 1654 getByName = typeof name === "string", 1655 1656 // We have to handle DOM nodes and JS objects differently because IE6-7 1657 // can't GC object references properly across the DOM-JS boundary 1658 isNode = elem.nodeType, 1659 1660 // Only DOM nodes need the global jQuery cache; JS object data is 1661 // attached directly to the object so GC can occur automatically 1662 cache = isNode ? jQuery.cache : elem, 1663 1664 // Only defining an ID for JS objects if its cache already exists allows 1665 // the code to shortcut on the same path as a DOM node with no cache 1666 id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey, 1667 isEvents = name === "events"; 1668 1669 // Avoid doing any more work than we need to when trying to get data on an 1670 // object that has no data at all 1671 if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) { 1672 return; 1673 } 1674 1675 if ( !id ) { 1676 // Only DOM nodes need a new unique ID for each element since their data 1677 // ends up in the global cache 1678 if ( isNode ) { 1679 elem[ internalKey ] = id = ++jQuery.uuid; 1680 } else { 1681 id = internalKey; 1682 } 1683 } 1684 1685 if ( !cache[ id ] ) { 1686 cache[ id ] = {}; 1687 1688 // Avoids exposing jQuery metadata on plain JS objects when the object 1689 // is serialized using JSON.stringify 1690 if ( !isNode ) { 1691 cache[ id ].toJSON = jQuery.noop; 1692 } 1693 } 1694
1695 // An object can be passed to jQuery.data instead of a key/value pair; this gets 1696 // shallow copied over onto the existing cache 1697 if ( typeof name === "object" || typeof name === "function" ) { 1698 if ( pvt ) { 1699 cache[ id ] = jQuery.extend( cache[ id ], name ); 1700 } else { 1701 cache[ id ].data = jQuery.extend( cache[ id ].data, name ); 1702 } 1703 } 1704 1705 privateCache = thisCache = cache[ id ]; 1706 1707 // jQuery data() is stored in a separate object inside the object's internal data 1708 // cache in order to avoid key collisions between internal data and user-defined 1709 // data. 1710 if ( !pvt ) { 1711 if ( !thisCache.data ) { 1712 thisCache.data = {}; 1713 } 1714 1715 thisCache = thisCache.data; 1716 } 1717 1718 if ( data !== undefined ) { 1719 thisCache[ jQuery.camelCase( name ) ] = data; 1720 } 1721 1722 // Users should not attempt to inspect the internal events object using jQuery.data, 1723 // it is undocumented and subject to change. But does anyone listen? No. 1724 if ( isEvents && !thisCache[ name ] ) { 1725 return privateCache.events; 1726 } 1727 1728 // Check for both converted-to-camel and non-converted data property names 1729 // If a data property was specified 1730 if ( getByName ) { 1731 1732 // First Try to find as-is property data 1733 ret = thisCache[ name ]; 1734 1735 // Test for null|undefined property data 1736 if ( ret == null ) { 1737 1738 // Try to find the camelCased property 1739 ret = thisCache[ jQuery.camelCase( name ) ]; 1740 } 1741 } else { 1742 ret = thisCache; 1743 } 1744 1745 return ret; 1746 }, 1747 1748 removeData: function( elem, name, pvt /* Internal Use Only */ ) { 1749 if ( !jQuery.acceptData( elem ) ) { 1750 return; 1751 } 1752 1753 var thisCache, i, l, 1754 1755 // Reference to internal data cache key 1756 internalKey = jQuery.expando, 1757 1758 isNode = elem.nodeType, 1759 1760 // See jQuery.data for more information 1761 cache = isNode ? jQuery.cache : elem, 1762 1763 // See jQuery.data for more information 1764 id = isNode ? elem[ internalKey ] : internalKey; 1765 1766 // If there is already no cache entry for this object, there is no 1767 // purpose in continuing 1768 if ( !cache[ id ] ) { 1769 return; 1770 } 1771 1772 if ( name ) { 1773 1774 thisCache = pvt ? cache[ id ] : cache[ id ].data; 1775 1776 if ( thisCache ) { 1777 1778 // Support array or space separated string names for data keys 1779 if ( !jQuery.isArray( name ) ) { 1780 1781 // try the string as a key before any manipulation 1782 if ( name in thisCache ) { 1783 name = [ name ]; 1784 } else { 1785 1786 // split the camel cased version by spaces unless a key with the spaces exists 1787 name = jQuery.camelCase( name ); 1788 if ( name in thisCache ) { 1789 name = [ name ]; 1790 } else { 1791 name = name.split( " " ); 1792 } 1793 } 1794 } 1795 1796 for ( i = 0, l = name.length; i < l; i++ ) { 1797 delete thisCache[ name[i] ]; 1798 } 1799 1800 // If there is no data left in the cache, we want to continue 1801 // and let the cache object itself get destroyed 1802 if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) { 1803 return; 1804 } 1805 } 1806 } 1807 1808 // See jQuery.data for more information 1809 if ( !pvt ) { 1810 delete cache[ id ].data; 1811 1812 // Don't destroy the parent cache unless the internal data object 1813 // had been the only thing left in it 1814 if ( !isEmptyDataObject(cache[ id ]) ) { 1815 return; 1816 } 1817 } 1818 1819 // Browsers that fail expando deletion also refuse to delete expandos on 1820 // the window, but it will allow it on all other JS objects; other browsers 1821 // don't care 1822 // Ensure that `cache` is not a window object #10080 1823 if ( jQuery.support.deleteExpando || !cache.setInterval ) { 1824 delete cache[ id ]; 1825 } else { 1826 cache[ id ] = null; 1827 } 1828 1829 // We destroyed the cache and need to eliminate the expando on the node to avoid 1830 // false lookups in the cache for entries that no longer exist 1831 if ( isNode ) { 1832 // IE does not allow us to delete expando properties from nodes, 1833 // nor does it have a removeAttribute function on Document nodes; 1834 // we must handle all of these cases 1835 if ( jQuery.support.deleteExpando ) { 1836 delete elem[ internalKey ]; 1837 } else if ( elem.removeAttribute ) { 1838 elem.removeAttribute( internalKey ); 1839 } else { 1840 elem[ internalKey ] = null; 1841 } 1842 } 1843 }, 1844 1845 // For internal use only. 1846 _data: function( elem, name, data ) { 1847 return jQuery.data( elem, name, data, true ); 1848 }, 1849 1850 // A method for determining if a DOM node can handle the data expando 1851 acceptData: function( elem ) { 1852 if ( elem.nodeName ) { 1853 var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; 1854 1855 if ( match ) { 1856 return !(match === true || elem.getAttribute("classid") !== match); 1857 } 1858 } 1859 1860 return true; 1861 } 1862}); 1863 1864jQuery.fn.extend({ 1865 data: function( key, value ) { 1866 var parts, attr, name, 1867 data = null; 1868 1869 if ( typeof key === "undefined" ) { 1870 if ( this.length ) { 1871 data = jQuery.data( this[0] ); 1872 1873 if ( this[0].nodeType === 1 && !jQuery._data( this[0], "parsedAttrs" ) ) { 1874 attr = this[0].attributes; 1875 for ( var i = 0, l = attr.length; i < l; i++ ) { 1876 name = attr[i].name; 1877
1878 if ( name.indexOf( "data-" ) === 0 ) { 1879 name = jQuery.camelCase( name.substring(5) ); 1880 1881 dataAttr( this[0], name, data[ name ] ); 1882 } 1883 } 1884 jQuery._data( this[0], "parsedAttrs", true ); 1885 } 1886 } 1887 1888 return data; 1889 1890 } else if ( typeof key === "object" ) { 1891 return this.each(function() { 1892 jQuery.data( this, key ); 1893 }); 1894 } 1895 1896 parts = key.split("."); 1897 parts[1] = parts[1] ? "." + parts[1] : ""; 1898 1899 if ( value === undefined ) { 1900 data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); 1901 1902 // Try to fetch any internally stored data first 1903 if ( data === undefined && this.length ) { 1904 data = jQuery.data( this[0], key ); 1905 data = dataAttr( this[0], key, data ); 1906 } 1907 1908 return data === undefined && parts[1] ? 1909 this.data( parts[0] ) : 1910 data; 1911 1912 } else { 1913 return this.each(function() { 1914 var self = jQuery( this ), 1915 args = [ parts[0], value ]; 1916 1917 self.triggerHandler( "setData" + parts[1] + "!", args ); 1918 jQuery.data( this, key, value ); 1919 self.triggerHandler( "changeData" + parts[1] + "!", args ); 1920 }); 1921 } 1922 }, 1923 1924 removeData: function( key ) { 1925 return this.each(function() { 1926 jQuery.removeData( this, key ); 1927 }); 1928 } 1929}); 1930 1931function dataAttr( elem, key, data ) { 1932 // If nothing was found internally, try to fetch any 1933 // data from the HTML5 data-* attribute 1934 if ( data === undefined && elem.nodeType === 1 ) { 1935 1936 var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); 1937 1938 data = elem.getAttribute( name ); 1939 1940 if ( typeof data === "string" ) { 1941 try { 1942 data = data === "true" ? true : 1943 data === "false" ? false : 1944 data === "null" ? null : 1945 jQuery.isNumeric( data ) ? parseFloat( data ) : 1946 rbrace.test( data ) ? jQuery.parseJSON( data ) : 1947 data; 1948 } catch( e ) {} 1949 1950 // Make sure we set the data so it isn't changed later 1951 jQuery.data( elem, key, data ); 1952 1953 } else { 1954 data = undefined; 1955 } 1956 } 1957 1958 return data; 1959} 1960 1961// checks a cache object for emptiness 1962function isEmptyDataObject( obj ) { 1963 for ( var name in obj ) { 1964 1965 // if the public data object is empty, the private is still empty 1966 if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { 1967 continue; 1968 } 1969 if ( name !== "toJSON" ) { 1970 return false; 1971 } 1972 } 1973 1974 return true; 1975} 1976 1977 1978 1979 1980function handleQueueMarkDefer( elem, type, src ) { 1981 var deferDataKey = type + "defer", 1982 queueDataKey = type + "queue", 1983 markDataKey = type + "mark", 1984 defer = jQuery._data( elem, deferDataKey ); 1985 if ( defer && 1986 ( src === "queue" || !jQuery._data(elem, queueDataKey) ) && 1987 ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) { 1988 // Give room for hard-coded callbacks to fire first 1989 // and eventually mark/queue something else on the element 1990 setTimeout( function() { 1991 if ( !jQuery._data( elem, queueDataKey ) && 1992 !jQuery._data( elem, markDataKey ) ) { 1993 jQuery.removeData( elem, deferDataKey, true ); 1994 defer.fire(); 1995 } 1996 }, 0 ); 1997 } 1998} 1999 2000jQuery.extend({ 2001 2002 _mark: function( elem, type ) { 2003 if ( elem ) { 2004 type = ( type || "fx" ) + "mark"; 2005 jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 ); 2006 } 2007 }, 2008 2009 _unmark: function( force, elem, type ) { 2010 if ( force !== true ) { 2011 type = elem; 2012 elem = force; 2013 force = false; 2014 } 2015 if ( elem ) { 2016 type = type || "fx"; 2017 var key = type + "mark", 2018 count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 ); 2019 if ( count ) { 2020 jQuery._data( elem, key, count ); 2021 } else { 2022 jQuery.removeData( elem, key, true ); 2023 handleQueueMarkDefer( elem, type, "mark" ); 2024 } 2025 } 2026 }, 2027 2028 queue: function( elem, type, data ) { 2029 var q; 2030 if ( elem ) { 2031 type = ( type || "fx" ) + "queue"; 2032 q = jQuery._data( elem, type ); 2033 2034 // Speed up dequeue by getting out quickly if this is just a lookup 2035 if ( data ) { 2036 if ( !q || jQuery.isArray(data) ) { 2037 q = jQuery._data( elem, type, jQuery.makeArray(data) ); 2038 } else { 2039 q.push( data ); 2040 } 2041 } 2042 return q || []; 2043 } 2044 }, 2045 2046 dequeue: function( elem, type ) { 2047 type = type || "fx"; 2048 2049 var queue = jQuery.queue( elem, type ), 2050 fn = queue.shift(), 2051 hooks = {}; 2052 2053 // If the fx queue is dequeued, always remove the progress sentinel 2054 if ( fn === "inprogress" ) { 2055 fn = queue.shift(); 2056 } 2057 2058 if ( fn ) { 2059 // Add a progress sentinel to prevent the fx queue from being 2060 // automatically dequeued 2061 if ( type === "fx" ) { 2062 queue.unshift( "inprogress" ); 2063 } 2064 2065 jQuery._data( elem, type + ".run", hooks ); 2066 fn.call( elem, function() { 2067 jQuery.dequeue( elem, type ); 2068 }, hooks ); 2069 } 2070 2071 if ( !queue.length ) { 2072 jQuery.removeData( elem, type + "queue " + type + ".run", true ); 2073 handleQueueMarkDefer( elem, type, "queue" ); 2074 } 2075 } 2076}); 2077 2078jQuery.fn.extend({ 2079 queue: function( type, data ) { 2080 if ( typeof type !== "string" ) { 2081 data = type; 2082 type = "fx"; 2083 } 2084 2085 if ( data === undefined ) { 2086 return jQuery.queue( this[0], type ); 2087 } 2088 return this.each(function() { 2089 var queue = jQuery.queue( this, type, data ); 2090 2091 if ( type === "fx" && queue[0] !== "inprogress" ) { 2092 jQuery.dequeue( this, type ); 2093 } 2094 }); 2095 }, 2096 dequeue: function( type ) { 2097 return this.each(function() { 2098 jQuery.dequeue( this, type ); 2099 }); 2100 }, 2101 // Based off of the plugin by Clint Helfers, with permission. 2102 // http://blindsignals.com/index.php/2009/07/jquery-delay/ 2103 delay: function( time, type ) { 2104 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 2105 type = type || "fx"; 2106 2107 return this.queue( type, function( next, hooks ) { 2108 var timeout = setTimeout( next, time ); 2109 hooks.stop = function() { 2110 clearTimeout( timeout ); 2111 }; 2112 }); 2113 }, 2114 clearQueue: function( type ) { 2115 return this.queue( type || "fx", [] ); 2116 }, 2117 // Get a promise resolved when queues of a certain type 2118 // are emptied (fx is the type by default) 2119 promise: function( type, object ) { 2120 if ( typeof type !== "string" ) { 2121 object = type; 2122 type = undefined; 2123 } 2124 type = type || "fx"; 2125 var defer = jQuery.Deferred(), 2126 elements = this, 2127 i = elements.length, 2128 count = 1, 2129 deferDataKey = type + "defer", 2130 queueDataKey = type + "queue", 2131 markDataKey = type + "mark", 2132 tmp; 2133 function resolve() { 2134 if ( !( --count ) ) { 2135 defer.resolveWith( elements, [ elements ] ); 2136 } 2137 } 2138 while( i-- ) { 2139 if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) || 2140 ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) || 2141 jQuery.data( elements[ i ], markDataKey, undefined, true ) ) && 2142 jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) { 2143 count++; 2144 tmp.add( resolve ); 2145 } 2146 } 2147 resolve(); 2148 return defer.promise(); 2149 } 2150}); 2151 2152 2153 2154 2155var rclass = /[\n\t\r]/g, 2156 rspace = /\s+/, 2157 rreturn = /\r/g, 2158 rtype = /^(?:button|input)$/i, 2159 rfocusable = /^(?:button|input|object|select|textarea)$/i, 2160 rclickable = /^a(?:rea)?$/i, 2161 rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, 2162 getSetAttribute = jQuery.support.getSetAttribute, 2163 nodeHook, boolHook, fixSpecified; 2164 2165jQuery.fn.extend({ 2166 attr: function( name, value ) { 2167 return jQuery.access( this, name, value, true, jQuery.attr ); 2168 }, 2169 2170 removeAttr: function( name ) { 2171 return this.each(function() { 2172 jQuery.removeAttr( this, name ); 2173 }); 2174 }, 2175 2176 prop: function( name, value ) { 2177 return jQuery.access( this, name, value, true, jQuery.prop ); 2178 }, 2179 2180 removeProp: function( name ) { 2181 name = jQuery.propFix[ name ] || name; 2182 return this.each(function() { 2183 // try/catch handles cases where IE balks (such as removing a property on window) 2184 try { 2185 this[ name ] = undefined; 2186 delete this[ name ]; 2187 } catch( e ) {} 2188 }); 2189 }, 2190 2191 addClass: function( value ) { 2192 var classNames, i, l, elem, 2193 setClass, c, cl; 2194 2195 if ( jQuery.isFunction( value ) ) { 2196 return this.each(function( j ) { 2197 jQuery( this ).addClass( value.call(this, j, this.className) ); 2198 }); 2199 } 2200 2201 if ( value && typeof value === "string" ) { 2202 classNames = value.split( rspace ); 2203 2204 for ( i = 0, l = this.length; i < l; i++ ) { 2205 elem = this[ i ]; 2206 2207 if ( elem.nodeType === 1 ) { 2208 if ( !elem.className && classNames.length === 1 ) { 2209 elem.className = value; 2210 2211 } else { 2212 setClass = " " + elem.className + " "; 2213 2214 for ( c = 0, cl = classNames.length; c < cl; c++ ) { 2215 if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) { 2216 setClass += classNames[ c ] + " "; 2217 } 2218 } 2219 elem.className = jQuery.trim( setClass ); 2220 } 2221 } 2222 } 2223 } 2224 2225 return this; 2226 }, 2227 2228 removeClass: function( value ) { 2229 var classNames, i, l, elem, className, c, cl; 2230 2231 if ( jQuery.isFunction( value ) ) { 2232 return this.each(function( j ) { 2233 jQuery( this ).removeClass( value.call(this, j, this.className) ); 2234 }); 2235 } 2236 2237 if ( (value && typeof value === "string") || value === undefined ) { 2238 classNames = ( value || "" ).split( rspace ); 2239 2240 for ( i = 0, l = this.length; i < l; i++ ) { 2241 elem = this[ i ]; 2242 2243 if ( elem.nodeType === 1 && elem.className ) { 2244 if ( value ) { 2245 className = (" " + elem.className + " ").replace( rclass, " " ); 2246 for ( c = 0, cl = classNames.length; c < cl; c++ ) { 2247 className = className.replace(" " + classNames[ c ] + " ", " "); 2248 } 2249 elem.className = jQuery.trim( className ); 2250 2251 } else { 2252 elem.className = ""; 2253 } 2254 } 2255 } 2256 } 2257 2258 return this; 2259 }, 2260 2261 toggleClass: function( value, stateVal ) { 2262 var type = typeof value, 2263 isBool = typeof stateVal === "boolean"; 2264 2265 if ( jQuery.isFunction( value ) ) { 2266 return this.each(function( i ) { 2267 jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); 2268 }); 2269 } 2270 2271 return this.each(function() { 2272 if ( type === "string" ) { 2273 // toggle individual class names 2274 var className, 2275 i = 0, 2276 self = jQuery( this ), 2277 state = stateVal, 2278 classNames = value.split( rspace ); 2279 2280 while ( (className = classNames[ i++ ]) ) { 2281 // check each className given, space seperated list 2282 state = isBool ? state : !self.hasClass( className ); 2283 self[ state ? "addClass" : "removeClass" ]( className ); 2284 } 2285 2286 } else if ( type === "undefined" || type === "boolean" ) { 2287 if ( this.className ) { 2288 // store className if set 2289 jQuery._data( this, "__className__", this.className ); 2290 } 2291 2292 // toggle whole className 2293 this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; 2294 } 2295 }); 2296 }, 2297 2298 hasClass: function( selector ) { 2299 var className = " " + selector + " ", 2300 i = 0, 2301 l = this.length; 2302 for ( ; i < l; i++ ) { 2303 if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { 2304 return true; 2305 } 2306 } 2307 2308 return false;
2309 }, 2310 2311 val: function( value ) { 2312 var hooks, ret, isFunction, 2313 elem = this[0]; 2314 2315 if ( !arguments.length ) { 2316 if ( elem ) { 2317 hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ]; 2318 2319 if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { 2320 return ret; 2321 } 2322 2323 ret = elem.value; 2324 2325 return typeof ret === "string" ? 2326 // handle most common string cases 2327 ret.replace(rreturn, "") : 2328 // handle cases where value is null/undef or number 2329 ret == null ? "" : ret; 2330 } 2331 2332 return; 2333 } 2334 2335 isFunction = jQuery.isFunction( value ); 2336 2337 return this.each(function( i ) { 2338 var self = jQuery(this), val; 2339 2340 if ( this.nodeType !== 1 ) { 2341 return; 2342 } 2343 2344 if ( isFunction ) { 2345 val = value.call( this, i, self.val() ); 2346 } else { 2347 val = value; 2348 } 2349 2350 // Treat null/undefined as ""; convert numbers to string 2351 if ( val == null ) { 2352 val = ""; 2353 } else if ( typeof val === "number" ) { 2354 val += ""; 2355 } else if ( jQuery.isArray( val ) ) { 2356 val = jQuery.map(val, function ( value ) { 2357 return value == null ? "" : value + ""; 2358 }); 2359 } 2360 2361 hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ]; 2362 2363 // If set returns undefined, fall back to normal setting 2364 if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { 2365 this.value = val; 2366 } 2367 }); 2368 } 2369}); 2370 2371jQuery.extend({ 2372 valHooks: { 2373 option: { 2374 get: function( elem ) { 2375 // attributes.value is undefined in Blackberry 4.7 but 2376 // uses .value. See #6932 2377 var val = elem.attributes.value; 2378 return !val || val.specified ? elem.value : elem.text; 2379 } 2380 }, 2381 select: { 2382 get: function( elem ) { 2383 var value, i, max, option, 2384 index = elem.selectedIndex, 2385 values = [], 2386 options = elem.options, 2387 one = elem.type === "select-one"; 2388 2389 // Nothing was selected 2390 if ( index < 0 ) { 2391 return null; 2392 } 2393 2394 // Loop through all the selected options 2395 i = one ? index : 0; 2396 max = one ? index + 1 : options.length; 2397 for ( ; i < max; i++ ) { 2398 option = options[ i ]; 2399 2400 // Don't return options that are disabled or in a disabled optgroup 2401 if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && 2402 (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { 2403 2404 // Get the specific value for the option 2405 value = jQuery( option ).val(); 2406 2407 // We don't need an array for one selects 2408 if ( one ) { 2409 return value; 2410 } 2411 2412 // Multi-Selects return an array 2413 values.push( value ); 2414 } 2415 } 2416 2417 // Fixes Bug #2551 -- select.val() broken in IE after form.reset() 2418 if ( one && !values.length && options.length ) { 2419 return jQuery( options[ index ] ).val(); 2420 } 2421 2422 return values; 2423 }, 2424 2425 set: function( elem, value ) { 2426 var values = jQuery.makeArray( value ); 2427 2428 jQuery(elem).find("option").each(function() { 2429 this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; 2430 }); 2431 2432 if ( !values.length ) { 2433 elem.selectedIndex = -1; 2434 } 2435 return values; 2436 } 2437 } 2438 }, 2439 2440 attrFn: { 2441 val: true, 2442 css: true, 2443 html: true, 2444 text: true, 2445 data: true, 2446 width: true, 2447 height: true, 2448 offset: true 2449 }, 2450 2451 attr: function( elem, name, value, pass ) { 2452 var ret, hooks, notxml, 2453 nType = elem.nodeType; 2454 2455 // don't get/set attributes on text, comment and attribute nodes 2456 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { 2457 return; 2458 } 2459 2460 if ( pass && name in jQuery.attrFn ) { 2461 return jQuery( elem )[ name ]( value ); 2462 } 2463 2464 // Fallback to prop when attributes are not supported 2465 if ( typeof elem.getAttribute === "undefined" ) { 2466 return jQuery.prop( elem, name, value ); 2467 } 2468 2469 notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); 2470 2471 // All attributes are lowercase 2472 // Grab necessary hook if one is defined 2473 if ( notxml ) { 2474 name = name.toLowerCase(); 2475 hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); 2476 } 2477 2478 if ( value !== undefined ) { 2479 2480 if ( value === null ) { 2481 jQuery.removeAttr( elem, name ); 2482 return; 2483 2484 } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) { 2485 return ret; 2486 2487 } else { 2488 elem.setAttribute( name, "" + value ); 2489 return value; 2490 } 2491 2492 } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) { 2493 return ret; 2494 2495 } else { 2496 2497 ret = elem.getAttribute( name ); 2498 2499 // Non-existent attributes return null, we normalize to undefined 2500 return ret === null ? 2501 undefined : 2502 ret; 2503 } 2504 }, 2505 2506 removeAttr: function( elem, value ) { 2507 var propName, attrNames, name, l, 2508 i = 0; 2509 2510 if ( value && elem.nodeType === 1 ) { 2511 attrNames = value.toLowerCase().split( rspace ); 2512 l = attrNames.length; 2513 2514 for ( ; i < l; i++ ) { 2515 name = attrNames[ i ]; 2516
vendor: 5,612 bytes, lines 2517-2709
2517 if ( name ) { 2518 propName = jQuery.propFix[ name ] || name; 2519 2520 // See #9699 for explanation of this approach (setting first, then removal) 2521 jQuery.attr( elem, name, "" ); 2522 elem.removeAttribute( getSetAttribute ? name : propName ); 2523 2524 // Set corresponding property to false for boolean attributes 2525 if ( rboolean.test( name ) && propName in elem ) { 2526 elem[ propName ] = false; 2527 } 2528 } 2529 } 2530 } 2531 }, 2532 2533 attrHooks: { 2534 type: { 2535 set: function( elem, value ) { 2536 // We can't allow the type property to be changed (since it causes problems in IE) 2537 if ( rtype.test( elem.nodeName ) && elem.parentNode ) { 2538 jQuery.error( "type property can't be changed" ); 2539 } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { 2540 // Setting the type on a radio button after the value resets the value in IE6-9 2541 // Reset value to it's default in case type is set after value 2542 // This is for element creation 2543 var val = elem.value; 2544 elem.setAttribute( "type", value ); 2545 if ( val ) { 2546 elem.value = val; 2547 } 2548 return value; 2549 } 2550 } 2551 }, 2552 // Use the value property for back compat 2553 // Use the nodeHook for button elements in IE6/7 (#1954) 2554 value: { 2555 get: function( elem, name ) { 2556 if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { 2557 return nodeHook.get( elem, name ); 2558 } 2559 return name in elem ? 2560 elem.value : 2561 null; 2562 }, 2563 set: function( elem, value, name ) { 2564 if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { 2565 return nodeHook.set( elem, value, name ); 2566 } 2567 // Does not return so that setAttribute is also used 2568 elem.value = value; 2569 } 2570 } 2571 }, 2572 2573 propFix: { 2574 tabindex: "tabIndex", 2575 readonly: "readOnly", 2576 "for": "htmlFor", 2577 "class": "className", 2578 maxlength: "maxLength", 2579 cellspacing: "cellSpacing", 2580 cellpadding: "cellPadding", 2581 rowspan: "rowSpan", 2582 colspan: "colSpan", 2583 usemap: "useMap", 2584 frameborder: "frameBorder", 2585 contenteditable: "contentEditable" 2586 }, 2587 2588 prop: function( elem, name, value ) { 2589 var ret, hooks, notxml, 2590 nType = elem.nodeType; 2591 2592 // don't get/set properties on text, comment and attribute nodes 2593 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { 2594 return; 2595 } 2596 2597 notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); 2598 2599 if ( notxml ) { 2600 // Fix name and attach hooks 2601 name = jQuery.propFix[ name ] || name; 2602 hooks = jQuery.propHooks[ name ]; 2603 } 2604 2605 if ( value !== undefined ) { 2606 if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { 2607 return ret; 2608 2609 } else { 2610 return ( elem[ name ] = value ); 2611 } 2612 2613 } else { 2614 if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { 2615 return ret; 2616 2617 } else { 2618 return elem[ name ]; 2619 } 2620 } 2621 }, 2622 2623 propHooks: { 2624 tabIndex: { 2625 get: function( elem ) { 2626 // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set 2627 // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ 2628 var attributeNode = elem.getAttributeNode("tabindex"); 2629 2630 return attributeNode && attributeNode.specified ? 2631 parseInt( attributeNode.value, 10 ) : 2632 rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 2633 0 : 2634 undefined; 2635 } 2636 } 2637 } 2638}); 2639 2640// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional) 2641jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex; 2642 2643// Hook for boolean attributes 2644boolHook = { 2645 get: function( elem, name ) { 2646 // Align boolean attributes with corresponding properties 2647 // Fall back to attribute presence where some booleans are not supported 2648 var attrNode, 2649 property = jQuery.prop( elem, name ); 2650 return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ? 2651 name.toLowerCase() : 2652 undefined; 2653 }, 2654 set: function( elem, value, name ) { 2655 var propName; 2656 if ( value === false ) { 2657 // Remove boolean attributes when set to false 2658 jQuery.removeAttr( elem, name ); 2659 } else { 2660 // value is true since we know at this point it's type boolean and not false 2661 // Set boolean attributes to the same name and set the DOM property 2662 propName = jQuery.propFix[ name ] || name; 2663 if ( propName in elem ) { 2664 // Only set the IDL specifically if it already exists on the element 2665 elem[ propName ] = true; 2666 } 2667 2668 elem.setAttribute( name, name.toLowerCase() ); 2669 } 2670 return name; 2671 } 2672}; 2673 2674// IE6/7 do not support getting/setting some attributes with get/setAttribute 2675if ( !getSetAttribute ) { 2676 2677 fixSpecified = { 2678 name: true, 2679 id: true 2680 }; 2681 2682 // Use this for any attribute in IE6/7 2683 // This fixes almost every IE6/7 issue 2684 nodeHook = jQuery.valHooks.button = { 2685 get: function( elem, name ) { 2686 var ret; 2687 ret = elem.getAttributeNode( name ); 2688 return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ? 2689 ret.nodeValue : 2690 undefined; 2691 }, 2692 set: function( elem, value, name ) { 2693 // Set the existing or create a new attribute node 2694 var ret = elem.getAttributeNode( name ); 2695 if ( !ret ) { 2696 ret = document.createAttribute( name ); 2697 elem.setAttributeNode( ret ); 2698 } 2699 return ( ret.nodeValue = value + "" ); 2700 } 2701 }; 2702 2703 // Apply the nodeHook to tabindex 2704 jQuery.attrHooks.tabindex.set = nodeHook.set; 2705 2706 // Set width and height to auto instead of 0 on empty string( Bug #8150 ) 2707 // This is for removals 2708 jQuery.each([ "width", "height" ], function( i, name ) { 2709 jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
2710 set: function( elem, value ) { 2711 if ( value === "" ) { 2712 elem.setAttribute( name, "auto" ); 2713 return value; 2714 } 2715 } 2716 }); 2717 }); 2718 2719 // Set contenteditable to false on removals(#10429) 2720 // Setting to empty string throws an error as an invalid value 2721 jQuery.attrHooks.contenteditable = { 2722 get: nodeHook.get, 2723 set: function( elem, value, name ) { 2724 if ( value === "" ) { 2725 value = "false"; 2726 } 2727 nodeHook.set( elem, value, name ); 2728 } 2729 }; 2730} 2731 2732 2733// Some attributes require a special call on IE 2734if ( !jQuery.support.hrefNormalized ) { 2735 jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { 2736 jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { 2737 get: function( elem ) { 2738 var ret = elem.getAttribute( name, 2 ); 2739 return ret === null ? undefined : ret; 2740 } 2741 }); 2742 }); 2743} 2744 2745if ( !jQuery.support.style ) { 2746 jQuery.attrHooks.style = { 2747 get: function( elem ) { 2748 // Return undefined in the case of empty string 2749 // Normalize to lowercase since IE uppercases css property names 2750 return elem.style.cssText.toLowerCase() || undefined; 2751 }, 2752 set: function( elem, value ) { 2753 return ( elem.style.cssText = "" + value ); 2754 } 2755 }; 2756} 2757 2758// Safari mis-reports the default selected property of an option 2759// Accessing the parent's selectedIndex property fixes it 2760if ( !jQuery.support.optSelected ) { 2761 jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { 2762 get: function( elem ) { 2763 var parent = elem.parentNode; 2764 2765 if ( parent ) { 2766 parent.selectedIndex; 2767 2768 // Make sure that it also works with optgroups, see #5701 2769 if ( parent.parentNode ) { 2770 parent.parentNode.selectedIndex; 2771 } 2772 } 2773 return null; 2774 } 2775 }); 2776} 2777 2778// IE6/7 call enctype encoding 2779if ( !jQuery.support.enctype ) { 2780 jQuery.propFix.enctype = "encoding"; 2781} 2782 2783// Radios and checkboxes getter/setter 2784if ( !jQuery.support.checkOn ) { 2785 jQuery.each([ "radio", "checkbox" ], function() { 2786 jQuery.valHooks[ this ] = { 2787 get: function( elem ) { 2788 // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified 2789 return elem.getAttribute("value") === null ? "on" : elem.value; 2790 } 2791 }; 2792 }); 2793} 2794jQuery.each([ "radio", "checkbox" ], function() { 2795 jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { 2796 set: function( elem, value ) { 2797 if ( jQuery.isArray( value ) ) { 2798 return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); 2799 } 2800 } 2801 }); 2802}); 2803 2804 2805 2806 2807var rformElems = /^(?:textarea|input|select)$/i, 2808 rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/, 2809 rhoverHack = /\bhover(\.\S+)?\b/, 2810 rkeyEvent = /^key/, 2811 rmouseEvent = /^(?:mouse|contextmenu)|click/, 2812 rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, 2813 rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/, 2814 quickParse = function( selector ) { 2815 var quick = rquickIs.exec( selector ); 2816 if ( quick ) { 2817 // 0 1 2 3 2818 // [ _, tag, id, class ] 2819 quick[1] = ( quick[1] || "" ).toLowerCase(); 2820 quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" ); 2821 } 2822 return quick; 2823 }, 2824 quickIs = function( elem, m ) { 2825 var attrs = elem.attributes || {}; 2826 return ( 2827 (!m[1] || elem.nodeName.toLowerCase() === m[1]) && 2828 (!m[2] || (attrs.id || {}).value === m[2]) && 2829 (!m[3] || m[3].test( (attrs[ "class" ] || {}).value )) 2830 ); 2831 }, 2832 hoverHack = function( events ) { 2833 return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" ); 2834 }; 2835 2836/* 2837 * Helper functions for managing events -- not part of the public interface. 2838 * Props to Dean Edwards' addEvent library for many of the ideas. 2839 */ 2840jQuery.event = { 2841 2842 add: function( elem, types, handler, data, selector ) { 2843 2844 var elemData, eventHandle, events, 2845 t, tns, type, namespaces, handleObj, 2846 handleObjIn, quick, handlers, special; 2847 2848 // Don't attach events to noData or text/comment nodes (allow plain objects tho) 2849 if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) { 2850 return; 2851 } 2852 2853 // Caller can pass in an object of custom data in lieu of the handler 2854 if ( handler.handler ) { 2855 handleObjIn = handler; 2856 handler = handleObjIn.handler; 2857 } 2858 2859 // Make sure that the handler has a unique ID, used to find/remove it later 2860 if ( !handler.guid ) { 2861 handler.guid = jQuery.guid++; 2862 } 2863 2864 // Init the element's event structure and main handler, if this is the first 2865 events = elemData.events; 2866 if ( !events ) { 2867 elemData.events = events = {}; 2868 } 2869 eventHandle = elemData.handle; 2870 if ( !eventHandle ) { 2871 elemData.handle = eventHandle = function( e ) { 2872 // Discard the second event of a jQuery.event.trigger() and 2873 // when an event is called after a page has unloaded 2874 return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? 2875 jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : 2876 undefined; 2877 }; 2878 // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events 2879 eventHandle.elem = elem; 2880 } 2881 2882 // Handle multiple events separated by a space 2883 // jQuery(...).bind("mouseover mouseout", fn); 2884 types = jQuery.trim( hoverHack(types) ).split( " " ); 2885 for ( t = 0; t < types.length; t++ ) { 2886 2887 tns = rtypenamespace.exec( types[t] ) || []; 2888 type = tns[1];
vendor: 4,277 bytes, lines 2889-3023
2889 namespaces = ( tns[2] || "" ).split( "." ).sort(); 2890 2891 // If event changes its type, use the special event handlers for the changed type 2892 special = jQuery.event.special[ type ] || {}; 2893 2894 // If selector defined, determine special event api type, otherwise given type 2895 type = ( selector ? special.delegateType : special.bindType ) || type; 2896 2897 // Update special based on newly reset type 2898 special = jQuery.event.special[ type ] || {}; 2899 2900 // handleObj is passed to all event handlers 2901 handleObj = jQuery.extend({ 2902 type: type, 2903 origType: tns[1], 2904 data: data, 2905 handler: handler, 2906 guid: handler.guid, 2907 selector: selector, 2908 quick: quickParse( selector ), 2909 namespace: namespaces.join(".") 2910 }, handleObjIn ); 2911 2912 // Init the event handler queue if we're the first 2913 handlers = events[ type ]; 2914 if ( !handlers ) { 2915 handlers = events[ type ] = []; 2916 handlers.delegateCount = 0; 2917 2918 // Only use addEventListener/attachEvent if the special events handler returns false 2919 if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { 2920 // Bind the global event handler to the element 2921 if ( elem.addEventListener ) { 2922 elem.addEventListener( type, eventHandle, false ); 2923 2924 } else if ( elem.attachEvent ) { 2925 elem.attachEvent( "on" + type, eventHandle ); 2926 } 2927 } 2928 } 2929 2930 if ( special.add ) { 2931 special.add.call( elem, handleObj ); 2932 2933 if ( !handleObj.handler.guid ) { 2934 handleObj.handler.guid = handler.guid; 2935 } 2936 } 2937 2938 // Add to the element's handler list, delegates in front 2939 if ( selector ) { 2940 handlers.splice( handlers.delegateCount++, 0, handleObj ); 2941 } else { 2942 handlers.push( handleObj ); 2943 } 2944 2945 // Keep track of which events have ever been used, for event optimization 2946 jQuery.event.global[ type ] = true; 2947 } 2948 2949 // Nullify elem to prevent memory leaks in IE 2950 elem = null; 2951 }, 2952 2953 global: {}, 2954 2955 // Detach an event or set of events from an element 2956 remove: function( elem, types, handler, selector, mappedTypes ) { 2957 2958 var elemData = jQuery.hasData( elem ) && jQuery._data( elem ), 2959 t, tns, type, origType, namespaces, origCount, 2960 j, events, special, handle, eventType, handleObj; 2961 2962 if ( !elemData || !(events = elemData.events) ) { 2963 return; 2964 } 2965 2966 // Once for each type.namespace in types; type may be omitted 2967 types = jQuery.trim( hoverHack( types || "" ) ).split(" "); 2968 for ( t = 0; t < types.length; t++ ) { 2969 tns = rtypenamespace.exec( types[t] ) || []; 2970 type = origType = tns[1]; 2971 namespaces = tns[2]; 2972 2973 // Unbind all events (on this namespace, if provided) for the element 2974 if ( !type ) { 2975 for ( type in events ) { 2976 jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); 2977 } 2978 continue; 2979 } 2980 2981 special = jQuery.event.special[ type ] || {}; 2982 type = ( selector? special.delegateType : special.bindType ) || type; 2983 eventType = events[ type ] || []; 2984 origCount = eventType.length; 2985 namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null; 2986 2987 // Remove matching events 2988 for ( j = 0; j < eventType.length; j++ ) { 2989 handleObj = eventType[ j ]; 2990 2991 if ( ( mappedTypes || origType === handleObj.origType ) && 2992 ( !handler || handler.guid === handleObj.guid ) && 2993 ( !namespaces || namespaces.test( handleObj.namespace ) ) && 2994 ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { 2995 eventType.splice( j--, 1 ); 2996 2997 if ( handleObj.selector ) { 2998 eventType.delegateCount--; 2999 } 3000 if ( special.remove ) { 3001 special.remove.call( elem, handleObj ); 3002 } 3003 } 3004 } 3005 3006 // Remove generic event handler if we removed something and no more handlers exist 3007 // (avoids potential for endless recursion during removal of special event handlers) 3008 if ( eventType.length === 0 && origCount !== eventType.length ) { 3009 if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { 3010 jQuery.removeEvent( elem, type, elemData.handle ); 3011 } 3012 3013 delete events[ type ]; 3014 } 3015 } 3016 3017 // Remove the expando if it's no longer used 3018 if ( jQuery.isEmptyObject( events ) ) { 3019 handle = elemData.handle; 3020 if ( handle ) { 3021 handle.elem = null; 3022 } 3023
3024 // removeData also checks for emptiness and clears the expando if empty 3025 // so use it instead of delete 3026 jQuery.removeData( elem, [ "events", "handle" ], true ); 3027 } 3028 }, 3029 3030 // Events that are safe to short-circuit if no handlers are attached. 3031 // Native DOM events should not be added, they may have inline handlers. 3032 customEvent: { 3033 "getData": true, 3034 "setData": true, 3035 "changeData": true 3036 }, 3037 3038 trigger: function( event, data, elem, onlyHandlers ) { 3039 // Don't do events on text and comment nodes 3040 if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) { 3041 return; 3042 } 3043 3044 // Event object or event type 3045 var type = event.type || event, 3046 namespaces = [], 3047 cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType; 3048 3049 // focus/blur morphs to focusin/out; ensure we're not firing them right now 3050 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { 3051 return; 3052 } 3053 3054 if ( type.indexOf( "!" ) >= 0 ) { 3055 // Exclusive events trigger only for the exact event (no namespaces) 3056 type = type.slice(0, -1); 3057 exclusive = true; 3058 } 3059 3060 if ( type.indexOf( "." ) >= 0 ) { 3061 // Namespaced trigger; create a regexp to match event type in handle() 3062 namespaces = type.split("."); 3063 type = namespaces.shift(); 3064 namespaces.sort(); 3065 } 3066 3067 if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) { 3068 // No jQuery handlers for this event type, and it can't have inline handlers 3069 return; 3070 } 3071 3072 // Caller can pass in an Event, Object, or just an event type string 3073 event = typeof event === "object" ? 3074 // jQuery.Event object 3075 event[ jQuery.expando ] ? event : 3076 // Object literal 3077 new jQuery.Event( type, event ) : 3078 // Just the event type (string) 3079 new jQuery.Event( type ); 3080 3081 event.type = type; 3082 event.isTrigger = true; 3083 event.exclusive = exclusive; 3084 event.namespace = namespaces.join( "." ); 3085 event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null; 3086 ontype = type.indexOf( ":" ) < 0 ? "on" + type : ""; 3087 3088 // Handle a global trigger 3089 if ( !elem ) { 3090 3091 // TODO: Stop taunting the data cache; remove global events and always attach to document 3092 cache = jQuery.cache; 3093 for ( i in cache ) { 3094 if ( cache[ i ].events && cache[ i ].events[ type ] ) { 3095 jQuery.event.trigger( event, data, cache[ i ].handle.elem, true ); 3096 } 3097 } 3098 return; 3099 } 3100 3101 // Clean up the event in case it is being reused 3102 event.result = undefined; 3103 if ( !event.target ) { 3104 event.target = elem; 3105 } 3106 3107 // Clone any incoming data and prepend the event, creating the handler arg list 3108 data = data != null ? jQuery.makeArray( data ) : []; 3109 data.unshift( event ); 3110 3111 // Allow special events to draw outside the lines 3112 special = jQuery.event.special[ type ] || {}; 3113 if ( special.trigger && special.trigger.apply( elem, data ) === false ) { 3114 return; 3115 } 3116 3117 // Determine event propagation path in advance, per W3C events spec (#9951) 3118 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) 3119 eventPath = [[ elem, special.bindType || type ]]; 3120 if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { 3121 3122 bubbleType = special.delegateType || type; 3123 cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode; 3124 old = null; 3125 for ( ; cur; cur = cur.parentNode ) { 3126 eventPath.push([ cur, bubbleType ]); 3127 old = cur; 3128 } 3129 3130 // Only add window if we got to document (e.g., not plain obj or detached DOM) 3131 if ( old && old === elem.ownerDocument ) { 3132 eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]); 3133 } 3134 } 3135 3136 // Fire handlers on the event path 3137 for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) { 3138 3139 cur = eventPath[i][0]; 3140 event.type = eventPath[i][1]; 3141 3142 handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); 3143 if ( handle ) { 3144 handle.apply( cur, data ); 3145 } 3146 // Note that this is a bare JS function and not a jQuery handler 3147 handle = ontype && cur[ ontype ]; 3148 if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) { 3149 event.preventDefault(); 3150 } 3151 } 3152 event.type = type; 3153 3154 // If nobody prevented the default action, do it now 3155 if ( !onlyHandlers && !event.isDefaultPrevented() ) { 3156 3157 if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) && 3158 !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { 3159 3160 // Call a native DOM method on the target with the same name name as the event. 3161 // Can't use an .isFunction() check here because IE6/7 fails that test. 3162 // Don't do default actions on window, that's where global variables be (#6170) 3163 // IE<9 dies on focus/blur to hidden element (#1486) 3164 if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) { 3165 3166 // Don't re-trigger an onFOO event when we call its FOO() method 3167 old = elem[ ontype ]; 3168 3169 if ( old ) { 3170 elem[ ontype ] = null; 3171 } 3172 3173 // Prevent re-triggering of the same event, since we already bubbled it above 3174 jQuery.event.triggered = type; 3175 elem[ type ](); 3176 jQuery.event.triggered = undefined; 3177 3178 if ( old ) { 3179 elem[ ontype ] = old; 3180 } 3181 } 3182 } 3183 } 3184 3185 return event.result; 3186 }, 3187 3188 dispatch: function( event ) { 3189 3190 // Make a writable jQuery.Event from the native event object 3191 event = jQuery.event.fix( event || window.event ); 3192 3193 var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []), 3194 delegateCount = handlers.delegateCount, 3195 args = [].slice.call( arguments, 0 ), 3196 run_all = !event.exclusive && !event.namespace, 3197 handlerQueue = [], 3198 i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related; 3199 3200 // Use the fix-ed jQuery.Event rather than the (read-only) native event 3201 args[0] = event; 3202 event.delegateTarget = this; 3203 3204 // Determine handlers that should run if there are delegated events 3205 // Avoid disabled elements in IE (#6911) and non-left-click bubbling in Firefox (#3861) 3206 if ( delegateCount && !event.target.disabled && !(event.button && event.type === "click") ) { 3207 3208 // Pregenerate a single jQuery object for reuse with .is() 3209 jqcur = jQuery(this); 3210 jqcur.context = this.ownerDocument || this; 3211 3212 for ( cur = event.target; cur != this; cur = cur.parentNode || this ) { 3213 selMatch = {}; 3214 matches = []; 3215 jqcur[0] = cur; 3216 for ( i = 0; i < delegateCount; i++ ) { 3217 handleObj = handlers[ i ]; 3218 sel = handleObj.selector; 3219 3220 if ( selMatch[ sel ] === undefined ) { 3221 selMatch[ sel ] = ( 3222 handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel ) 3223 ); 3224 } 3225 if ( selMatch[ sel ] ) { 3226 matches.push( handleObj ); 3227 } 3228 } 3229 if ( matches.length ) { 3230 handlerQueue.push({ elem: cur, matches: matches }); 3231 } 3232 } 3233 } 3234 3235 // Add the remaining (directly-bound) handlers 3236 if ( handlers.length > delegateCount ) { 3237 handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) }); 3238 } 3239 3240 // Run delegates first; they may want to stop propagation beneath us 3241 for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) { 3242 matched = handlerQueue[ i ]; 3243 event.currentTarget = matched.elem; 3244 3245 for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) { 3246 handleObj = matched.matches[ j ]; 3247 3248 // Triggered event must either 1) be non-exclusive and have no namespace, or 3249 // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). 3250 if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) { 3251 3252 event.data = handleObj.data; 3253 event.handleObj = handleObj; 3254 3255 ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) 3256 .apply( matched.elem, args ); 3257 3258 if ( ret !== undefined ) { 3259 event.result = ret; 3260 if ( ret === false ) { 3261 event.preventDefault(); 3262 event.stopPropagation(); 3263 } 3264 } 3265 } 3266 } 3267 } 3268 3269 return event.result; 3270 }, 3271 3272 // Includes some event props shared by KeyEvent and MouseEvent 3273 // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 *** 3274 props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), 3275 3276 fixHooks: {}, 3277 3278 keyHooks: {
vendor: 15,758 bytes, lines 3279-3840
3279 props: "char charCode key keyCode".split(" "), 3280 filter: function( event, original ) { 3281 3282 // Add which for key events 3283 if ( event.which == null ) { 3284 event.which = original.charCode != null ? original.charCode : original.keyCode; 3285 } 3286 3287 return event; 3288 } 3289 }, 3290 3291 mouseHooks: { 3292 props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), 3293 filter: function( event, original ) { 3294 var eventDoc, doc, body, 3295 button = original.button, 3296 fromElement = original.fromElement; 3297 3298 // Calculate pageX/Y if missing and clientX/Y available 3299 if ( event.pageX == null && original.clientX != null ) { 3300 eventDoc = event.target.ownerDocument || document; 3301 doc = eventDoc.documentElement; 3302 body = eventDoc.body; 3303 3304 event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); 3305 event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); 3306 } 3307 3308 // Add relatedTarget, if necessary 3309 if ( !event.relatedTarget && fromElement ) { 3310 event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; 3311 } 3312 3313 // Add which for click: 1 === left; 2 === middle; 3 === right 3314 // Note: button is not normalized, so don't use it 3315 if ( !event.which && button !== undefined ) { 3316 event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); 3317 } 3318 3319 return event; 3320 } 3321 }, 3322 3323 fix: function( event ) { 3324 if ( event[ jQuery.expando ] ) { 3325 return event; 3326 } 3327 3328 // Create a writable copy of the event object and normalize some properties 3329 var i, prop, 3330 originalEvent = event, 3331 fixHook = jQuery.event.fixHooks[ event.type ] || {}, 3332 copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; 3333 3334 event = jQuery.Event( originalEvent ); 3335 3336 for ( i = copy.length; i; ) { 3337 prop = copy[ --i ]; 3338 event[ prop ] = originalEvent[ prop ]; 3339 } 3340 3341 // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2) 3342 if ( !event.target ) { 3343 event.target = originalEvent.srcElement || document; 3344 } 3345 3346 // Target should not be a text node (#504, Safari) 3347 if ( event.target.nodeType === 3 ) { 3348 event.target = event.target.parentNode; 3349 } 3350 3351 // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8) 3352 if ( event.metaKey === undefined ) { 3353 event.metaKey = event.ctrlKey; 3354 } 3355 3356 return fixHook.filter? fixHook.filter( event, originalEvent ) : event; 3357 }, 3358 3359 special: { 3360 ready: { 3361 // Make sure the ready event is setup 3362 setup: jQuery.bindReady 3363 }, 3364 3365 load: { 3366 // Prevent triggered image.load events from bubbling to window.load 3367 noBubble: true 3368 }, 3369 3370 focus: { 3371 delegateType: "focusin" 3372 }, 3373 blur: { 3374 delegateType: "focusout" 3375 }, 3376 3377 beforeunload: { 3378 setup: function( data, namespaces, eventHandle ) { 3379 // We only want to do this special case on windows 3380 if ( jQuery.isWindow( this ) ) { 3381 this.onbeforeunload = eventHandle; 3382 } 3383 }, 3384 3385 teardown: function( namespaces, eventHandle ) { 3386 if ( this.onbeforeunload === eventHandle ) { 3387 this.onbeforeunload = null; 3388 } 3389 } 3390 } 3391 }, 3392 3393 simulate: function( type, elem, event, bubble ) { 3394 // Piggyback on a donor event to simulate a different one. 3395 // Fake originalEvent to avoid donor's stopPropagation, but if the 3396 // simulated event prevents default then we do the same on the donor. 3397 var e = jQuery.extend( 3398 new jQuery.Event(), 3399 event, 3400 { type: type, 3401 isSimulated: true, 3402 originalEvent: {} 3403 } 3404 ); 3405 if ( bubble ) { 3406 jQuery.event.trigger( e, null, elem ); 3407 } else { 3408 jQuery.event.dispatch.call( elem, e ); 3409 } 3410 if ( e.isDefaultPrevented() ) { 3411 event.preventDefault(); 3412 } 3413 } 3414}; 3415 3416// Some plugins are using, but it's undocumented/deprecated and will be removed. 3417// The 1.7 special event interface should provide all the hooks needed now. 3418jQuery.event.handle = jQuery.event.dispatch; 3419 3420jQuery.removeEvent = document.removeEventListener ? 3421 function( elem, type, handle ) { 3422 if ( elem.removeEventListener ) { 3423 elem.removeEventListener( type, handle, false ); 3424 } 3425 } : 3426 function( elem, type, handle ) { 3427 if ( elem.detachEvent ) { 3428 elem.detachEvent( "on" + type, handle ); 3429 } 3430 }; 3431 3432jQuery.Event = function( src, props ) { 3433 // Allow instantiation without the 'new' keyword 3434 if ( !(this instanceof jQuery.Event) ) { 3435 return new jQuery.Event( src, props ); 3436 } 3437 3438 // Event object 3439 if ( src && src.type ) { 3440 this.originalEvent = src; 3441 this.type = src.type; 3442 3443 // Events bubbling up the document may have been marked as prevented 3444 // by a handler lower down the tree; reflect the correct value. 3445 this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || 3446 src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; 3447 3448 // Event type 3449 } else { 3450 this.type = src; 3451 } 3452 3453 // Put explicitly provided properties onto the event object 3454 if ( props ) { 3455 jQuery.extend( this, props ); 3456 } 3457 3458 // Create a timestamp if incoming event doesn't have one 3459 this.timeStamp = src && src.timeStamp || jQuery.now(); 3460 3461 // Mark it as fixed 3462 this[ jQuery.expando ] = true; 3463}; 3464 3465function returnFalse() { 3466 return false; 3467} 3468function returnTrue() { 3469 return true; 3470} 3471 3472// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 3473// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 3474jQuery.Event.prototype = { 3475 preventDefault: function() { 3476 this.isDefaultPrevented = returnTrue; 3477 3478 var e = this.originalEvent; 3479 if ( !e ) { 3480 return; 3481 } 3482 3483 // if preventDefault exists run it on the original event 3484 if ( e.preventDefault ) { 3485 e.preventDefault(); 3486 3487 // otherwise set the returnValue property of the original event to false (IE) 3488 } else { 3489 e.returnValue = false; 3490 } 3491 }, 3492 stopPropagation: function() { 3493 this.isPropagationStopped = returnTrue; 3494 3495 var e = this.originalEvent; 3496 if ( !e ) { 3497 return; 3498 } 3499 // if stopPropagation exists run it on the original event 3500 if ( e.stopPropagation ) { 3501 e.stopPropagation(); 3502 } 3503 // otherwise set the cancelBubble property of the original event to true (IE) 3504 e.cancelBubble = true; 3505 }, 3506 stopImmediatePropagation: function() { 3507 this.isImmediatePropagationStopped = returnTrue; 3508 this.stopPropagation(); 3509 }, 3510 isDefaultPrevented: returnFalse, 3511 isPropagationStopped: returnFalse, 3512 isImmediatePropagationStopped: returnFalse 3513}; 3514 3515// Create mouseenter/leave events using mouseover/out and event-time checks 3516jQuery.each({ 3517 mouseenter: "mouseover", 3518 mouseleave: "mouseout" 3519}, function( orig, fix ) { 3520 jQuery.event.special[ orig ] = { 3521 delegateType: fix, 3522 bindType: fix, 3523 3524 handle: function( event ) { 3525 var target = this, 3526 related = event.relatedTarget, 3527 handleObj = event.handleObj, 3528 selector = handleObj.selector, 3529 ret; 3530 3531 // For mousenter/leave call the handler if related is outside the target. 3532 // NB: No relatedTarget if the mouse left/entered the browser window 3533 if ( !related || (related !== target && !jQuery.contains( target, related )) ) { 3534 event.type = handleObj.origType; 3535 ret = handleObj.handler.apply( this, arguments ); 3536 event.type = fix; 3537 } 3538 return ret; 3539 } 3540 }; 3541}); 3542 3543// IE submit delegation 3544if ( !jQuery.support.submitBubbles ) { 3545 3546 jQuery.event.special.submit = { 3547 setup: function() { 3548 // Only need this for delegated form submit events 3549 if ( jQuery.nodeName( this, "form" ) ) { 3550 return false; 3551 } 3552 3553 // Lazy-add a submit handler when a descendant form may potentially be submitted 3554 jQuery.event.add( this, "click._submit keypress._submit", function( e ) { 3555 // Node name check avoids a VML-related crash in IE (#9807) 3556 var elem = e.target, 3557 form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; 3558 if ( form && !form._submit_attached ) { 3559 jQuery.event.add( form, "submit._submit", function( event ) { 3560 // If form was submitted by the user, bubble the event up the tree 3561 if ( this.parentNode && !event.isTrigger ) { 3562 jQuery.event.simulate( "submit", this.parentNode, event, true ); 3563 } 3564 }); 3565 form._submit_attached = true; 3566 } 3567 }); 3568 // return undefined since we don't need an event listener 3569 }, 3570 3571 teardown: function() { 3572 // Only need this for delegated form submit events 3573 if ( jQuery.nodeName( this, "form" ) ) { 3574 return false; 3575 } 3576 3577 // Remove delegated handlers; cleanData eventually reaps submit handlers attached above 3578 jQuery.event.remove( this, "._submit" ); 3579 } 3580 }; 3581} 3582 3583// IE change delegation and checkbox/radio fix 3584if ( !jQuery.support.changeBubbles ) { 3585 3586 jQuery.event.special.change = { 3587 3588 setup: function() { 3589 3590 if ( rformElems.test( this.nodeName ) ) { 3591 // IE doesn't fire change on a check/radio until blur; trigger it on click 3592 // after a propertychange. Eat the blur-change in special.change.handle. 3593 // This still fires onchange a second time for check/radio after blur. 3594 if ( this.type === "checkbox" || this.type === "radio" ) { 3595 jQuery.event.add( this, "propertychange._change", function( event ) { 3596 if ( event.originalEvent.propertyName === "checked" ) { 3597 this._just_changed = true; 3598 } 3599 }); 3600 jQuery.event.add( this, "click._change", function( event ) { 3601 if ( this._just_changed && !event.isTrigger ) { 3602 this._just_changed = false; 3603 jQuery.event.simulate( "change", this, event, true ); 3604 } 3605 }); 3606 } 3607 return false; 3608 } 3609 // Delegated event; lazy-add a change handler on descendant inputs 3610 jQuery.event.add( this, "beforeactivate._change", function( e ) { 3611 var elem = e.target; 3612 3613 if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) { 3614 jQuery.event.add( elem, "change._change", function( event ) { 3615 if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { 3616 jQuery.event.simulate( "change", this.parentNode, event, true ); 3617 } 3618 }); 3619 elem._change_attached = true; 3620 } 3621 }); 3622 }, 3623 3624 handle: function( event ) { 3625 var elem = event.target; 3626 3627 // Swallow native change events from checkbox/radio, we already triggered them above 3628 if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { 3629 return event.handleObj.handler.apply( this, arguments ); 3630 } 3631 }, 3632 3633 teardown: function() { 3634 jQuery.event.remove( this, "._change" ); 3635 3636 return rformElems.test( this.nodeName ); 3637 } 3638 }; 3639} 3640 3641// Create "bubbling" focus and blur events 3642if ( !jQuery.support.focusinBubbles ) { 3643 jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { 3644 3645 // Attach a single capturing handler while someone wants focusin/focusout 3646 var attaches = 0, 3647 handler = function( event ) { 3648 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); 3649 }; 3650 3651 jQuery.event.special[ fix ] = { 3652 setup: function() { 3653 if ( attaches++ === 0 ) { 3654 document.addEventListener( orig, handler, true ); 3655 } 3656 }, 3657 teardown: function() { 3658 if ( --attaches === 0 ) { 3659 document.removeEventListener( orig, handler, true ); 3660 } 3661 } 3662 }; 3663 }); 3664} 3665 3666jQuery.fn.extend({ 3667 3668 on: function( types, selector, data, fn, /*INTERNAL*/ one ) { 3669 var origFn, type; 3670 3671 // Types can be a map of types/handlers 3672 if ( typeof types === "object" ) { 3673 // ( types-Object, selector, data ) 3674 if ( typeof selector !== "string" ) { 3675 // ( types-Object, data ) 3676 data = selector; 3677 selector = undefined; 3678 } 3679 for ( type in types ) { 3680 this.on( type, selector, data, types[ type ], one ); 3681 } 3682 return this; 3683 } 3684 3685 if ( data == null && fn == null ) { 3686 // ( types, fn ) 3687 fn = selector; 3688 data = selector = undefined; 3689 } else if ( fn == null ) { 3690 if ( typeof selector === "string" ) { 3691 // ( types, selector, fn ) 3692 fn = data; 3693 data = undefined; 3694 } else { 3695 // ( types, data, fn ) 3696 fn = data; 3697 data = selector; 3698 selector = undefined; 3699 } 3700 } 3701 if ( fn === false ) { 3702 fn = returnFalse; 3703 } else if ( !fn ) { 3704 return this; 3705 } 3706 3707 if ( one === 1 ) { 3708 origFn = fn; 3709 fn = function( event ) { 3710 // Can use an empty set, since event contains the info 3711 jQuery().off( event ); 3712 return origFn.apply( this, arguments ); 3713 }; 3714 // Use same guid so caller can remove using origFn 3715 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); 3716 } 3717 return this.each( function() { 3718 jQuery.event.add( this, types, fn, data, selector ); 3719 }); 3720 }, 3721 one: function( types, selector, data, fn ) { 3722 return this.on.call( this, types, selector, data, fn, 1 ); 3723 }, 3724 off: function( types, selector, fn ) { 3725 if ( types && types.preventDefault && types.handleObj ) { 3726 // ( event ) dispatched jQuery.Event 3727 var handleObj = types.handleObj; 3728 jQuery( types.delegateTarget ).off( 3729 handleObj.namespace? handleObj.type + "." + handleObj.namespace : handleObj.type, 3730 handleObj.selector, 3731 handleObj.handler 3732 ); 3733 return this; 3734 } 3735 if ( typeof types === "object" ) { 3736 // ( types-object [, selector] ) 3737 for ( var type in types ) { 3738 this.off( type, selector, types[ type ] ); 3739 } 3740 return this; 3741 } 3742 if ( selector === false || typeof selector === "function" ) { 3743 // ( types [, fn] ) 3744 fn = selector; 3745 selector = undefined; 3746 } 3747 if ( fn === false ) { 3748 fn = returnFalse; 3749 } 3750 return this.each(function() { 3751 jQuery.event.remove( this, types, fn, selector ); 3752 }); 3753 }, 3754 3755 bind: function( types, data, fn ) { 3756 return this.on( types, null, data, fn ); 3757 }, 3758 unbind: function( types, fn ) { 3759 return this.off( types, null, fn ); 3760 }, 3761 3762 live: function( types, data, fn ) { 3763 jQuery( this.context ).on( types, this.selector, data, fn ); 3764 return this; 3765 }, 3766 die: function( types, fn ) { 3767 jQuery( this.context ).off( types, this.selector || "**", fn ); 3768 return this; 3769 }, 3770 3771 delegate: function( selector, types, data, fn ) { 3772 return this.on( types, selector, data, fn ); 3773 }, 3774 undelegate: function( selector, types, fn ) { 3775 // ( namespace ) or ( selector, types [, fn] ) 3776 return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn ); 3777 }, 3778 3779 trigger: function( type, data ) { 3780 return this.each(function() { 3781 jQuery.event.trigger( type, data, this ); 3782 }); 3783 }, 3784 triggerHandler: function( type, data ) { 3785 if ( this[0] ) { 3786 return jQuery.event.trigger( type, data, this[0], true ); 3787 } 3788 }, 3789 3790 toggle: function( fn ) { 3791 // Save reference to arguments for access in closure 3792 var args = arguments, 3793 guid = fn.guid || jQuery.guid++, 3794 i = 0, 3795 toggler = function( event ) { 3796 // Figure out which function to execute 3797 var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i; 3798 jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 ); 3799 3800 // Make sure that clicks stop 3801 event.preventDefault(); 3802 3803 // and execute the function 3804 return args[ lastToggle ].apply( this, arguments ) || false; 3805 }; 3806 3807 // link all the functions, so any of them can unbind this click handler 3808 toggler.guid = guid; 3809 while ( i < args.length ) { 3810 args[ i++ ].guid = guid; 3811 } 3812 3813 return this.click( toggler ); 3814 }, 3815 3816 hover: function( fnOver, fnOut ) { 3817 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); 3818 } 3819}); 3820 3821jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + 3822 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 3823 "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { 3824 3825 // Handle event binding 3826 jQuery.fn[ name ] = function( data, fn ) { 3827 if ( fn == null ) { 3828 fn = data; 3829 data = null; 3830 } 3831 3832 return arguments.length > 0 ? 3833 this.on( name, null, data, fn ) : 3834 this.trigger( name ); 3835 }; 3836 3837 if ( jQuery.attrFn ) { 3838 jQuery.attrFn[ name ] = true; 3839 } 3840
3841 if ( rkeyEvent.test( name ) ) { 3842 jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks; 3843 } 3844 3845 if ( rmouseEvent.test( name ) ) { 3846 jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks; 3847 } 3848}); 3849 3850 3851 3852/*! 3853 * Sizzle CSS Selector Engine 3854 * Copyright 2011, The Dojo Foundation 3855 * Released under the MIT, BSD, and GPL Licenses. 3856 * More information: http://sizzlejs.com/ 3857 */ 3858(function(){ 3859 3860var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, 3861 expando = "sizcache" + (Math.random() + '').replace('.', ''), 3862 done = 0, 3863 toString = Object.prototype.toString, 3864 hasDuplicate = false, 3865 baseHasDuplicate = true, 3866 rBackslash = /\\/g, 3867 rReturn = /\r\n/g, 3868 rNonWord = /\W/; 3869 3870// Here we check if the JavaScript engine is using some sort of 3871// optimization where it does not always call our comparision 3872// function. If that is the case, discard the hasDuplicate value. 3873// Thus far that includes Google Chrome. 3874[0, 0].sort(function() { 3875 baseHasDuplicate = false; 3876 return 0; 3877}); 3878 3879var Sizzle = function( selector, context, results, seed ) { 3880 results = results || []; 3881 context = context || document; 3882 3883 var origContext = context; 3884 3885 if ( context.nodeType !== 1 && context.nodeType !== 9 ) { 3886 return []; 3887 } 3888 3889 if ( !selector || typeof selector !== "string" ) { 3890 return results; 3891 } 3892 3893 var m, set, checkSet, extra, ret, cur, pop, i, 3894 prune = true, 3895 contextXML = Sizzle.isXML( context ), 3896 parts = [], 3897 soFar = selector; 3898 3899 // Reset the position of the chunker regexp (start from head) 3900 do { 3901 chunker.exec( "" ); 3902 m = chunker.exec( soFar ); 3903 3904 if ( m ) { 3905 soFar = m[3]; 3906 3907 parts.push( m[1] ); 3908 3909 if ( m[2] ) { 3910 extra = m[3]; 3911 break; 3912 } 3913 } 3914 } while ( m ); 3915 3916 if ( parts.length > 1 && origPOS.exec( selector ) ) { 3917 3918 if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { 3919 set = posProcess( parts[0] + parts[1], context, seed ); 3920 3921 } else { 3922 set = Expr.relative[ parts[0] ] ? 3923 [ context ] : 3924 Sizzle( parts.shift(), context ); 3925 3926 while ( parts.length ) { 3927 selector = parts.shift(); 3928 3929 if ( Expr.relative[ selector ] ) { 3930 selector += parts.shift(); 3931 } 3932 3933 set = posProcess( selector, set, seed ); 3934 } 3935 } 3936 3937 } else { 3938 // Take a shortcut and set the context if the root selector is an ID 3939 // (but not if it'll be faster if the inner selector is an ID) 3940 if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && 3941 Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { 3942 3943 ret = Sizzle.find( parts.shift(), context, contextXML ); 3944 context = ret.expr ? 3945 Sizzle.filter( ret.expr, ret.set )[0] : 3946 ret.set[0]; 3947 } 3948 3949 if ( context ) { 3950 ret = seed ? 3951 { expr: parts.pop(), set: makeArray(seed) } : 3952 Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); 3953 3954 set = ret.expr ? 3955 Sizzle.filter( ret.expr, ret.set ) : 3956 ret.set; 3957 3958 if ( parts.length > 0 ) { 3959 checkSet = makeArray( set ); 3960 3961 } else { 3962 prune = false;
3963 } 3964 3965 while ( parts.length ) { 3966 cur = parts.pop(); 3967 pop = cur; 3968 3969 if ( !Expr.relative[ cur ] ) { 3970 cur = ""; 3971 } else { 3972 pop = parts.pop(); 3973 } 3974 3975 if ( pop == null ) { 3976 pop = context; 3977 } 3978 3979 Expr.relative[ cur ]( checkSet, pop, contextXML ); 3980 } 3981 3982 } else { 3983 checkSet = parts = []; 3984 } 3985 } 3986 3987 if ( !checkSet ) { 3988 checkSet = set; 3989 } 3990 3991 if ( !checkSet ) { 3992 Sizzle.error( cur || selector ); 3993 } 3994 3995 if ( toString.call(checkSet) === "[object Array]" ) { 3996 if ( !prune ) { 3997 results.push.apply( results, checkSet ); 3998 3999 } else if ( context && context.nodeType === 1 ) { 4000 for ( i = 0; checkSet[i] != null; i++ ) { 4001 if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { 4002 results.push( set[i] ); 4003 } 4004 } 4005 4006 } else { 4007 for ( i = 0; checkSet[i] != null; i++ ) { 4008 if ( checkSet[i] && checkSet[i].nodeType === 1 ) { 4009 results.push( set[i] ); 4010 } 4011 } 4012 } 4013 4014 } else { 4015 makeArray( checkSet, results ); 4016 } 4017 4018 if ( extra ) { 4019 Sizzle( extra, origContext, results, seed ); 4020 Sizzle.uniqueSort( results ); 4021 } 4022 4023 return results; 4024}; 4025 4026Sizzle.uniqueSort = function( results ) { 4027 if ( sortOrder ) { 4028 hasDuplicate = baseHasDuplicate; 4029 results.sort( sortOrder ); 4030 4031 if ( hasDuplicate ) { 4032 for ( var i = 1; i < results.length; i++ ) { 4033 if ( results[i] === results[ i - 1 ] ) { 4034 results.splice( i--, 1 ); 4035 } 4036 } 4037 } 4038 } 4039 4040 return results; 4041}; 4042 4043Sizzle.matches = function( expr, set ) { 4044 return Sizzle( expr, null, null, set ); 4045}; 4046 4047Sizzle.matchesSelector = function( node, expr ) { 4048 return Sizzle( expr, null, null, [node] ).length > 0; 4049}; 4050 4051Sizzle.find = function( expr, context, isXML ) { 4052 var set, i, len, match, type, left; 4053 4054 if ( !expr ) { 4055 return []; 4056 } 4057 4058 for ( i = 0, len = Expr.order.length; i < len; i++ ) { 4059 type = Expr.order[i]; 4060 4061 if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { 4062 left = match[1]; 4063 match.splice( 1, 1 ); 4064 4065 if ( left.substr( left.length - 1 ) !== "\\" ) { 4066 match[1] = (match[1] || "").replace( rBackslash, "" ); 4067 set = Expr.find[ type ]( match, context, isXML ); 4068 4069 if ( set != null ) { 4070 expr = expr.replace( Expr.match[ type ], "" ); 4071 break; 4072 } 4073 } 4074 } 4075 } 4076 4077 if ( !set ) { 4078 set = typeof context.getElementsByTagName !== "undefined" ? 4079 context.getElementsByTagName( "*" ) : 4080 []; 4081 } 4082 4083 return { set: set, expr: expr }; 4084}; 4085 4086Sizzle.filter = function( expr, set, inplace, not ) { 4087 var match, anyFound, 4088 type, found, item, filter, left, 4089 i, pass, 4090 old = expr, 4091 result = [], 4092 curLoop = set, 4093 isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); 4094 4095 while ( expr && set.length ) { 4096 for ( type in Expr.filter ) { 4097 if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { 4098 filter = Expr.filter[ type ]; 4099 left = match[1]; 4100 4101 anyFound = false; 4102 4103 match.splice(1,1); 4104 4105 if ( left.substr( left.length - 1 ) === "\\" ) { 4106 continue; 4107 } 4108 4109 if ( curLoop === result ) { 4110 result = []; 4111 } 4112 4113 if ( Expr.preFilter[ type ] ) { 4114 match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); 4115 4116 if ( !match ) { 4117 anyFound = found = true; 4118 4119 } else if ( match === true ) { 4120 continue; 4121 } 4122 } 4123 4124 if ( match ) { 4125 for ( i = 0; (item = curLoop[i]) != null; i++ ) { 4126 if ( item ) { 4127 found = filter( item, match, i, curLoop ); 4128 pass = not ^ found; 4129 4130 if ( inplace && found != null ) { 4131 if ( pass ) { 4132 anyFound = true; 4133 4134 } else { 4135 curLoop[i] = false; 4136 } 4137 4138 } else if ( pass ) { 4139 result.push( item ); 4140 anyFound = true; 4141 } 4142 } 4143 } 4144 } 4145 4146 if ( found !== undefined ) { 4147 if ( !inplace ) { 4148 curLoop = result; 4149 } 4150 4151 expr = expr.replace( Expr.match[ type ], "" ); 4152 4153 if ( !anyFound ) { 4154 return []; 4155 } 4156 4157 break; 4158 } 4159 } 4160 } 4161 4162 // Improper expression 4163 if ( expr === old ) { 4164 if ( anyFound == null ) { 4165 Sizzle.error( expr ); 4166 4167 } else { 4168 break; 4169 } 4170 } 4171 4172 old = expr; 4173 } 4174 4175 return curLoop; 4176}; 4177 4178Sizzle.error = function( msg ) { 4179 throw new Error( "Syntax error, unrecognized expression: " + msg ); 4180}; 4181 4182/** 4183 * Utility function for retreiving the text value of an array of DOM nodes 4184 * @param {Array|Element} elem 4185 */ 4186var getText = Sizzle.getText = function( elem ) { 4187 var i, node, 4188 nodeType = elem.nodeType, 4189 ret = ""; 4190 4191 if ( nodeType ) { 4192 if ( nodeType === 1 || nodeType === 9 ) { 4193 // Use textContent || innerText for elements 4194 if ( typeof elem.textContent === 'string' ) { 4195 return elem.textContent; 4196 } else if ( typeof elem.innerText === 'string' ) { 4197 // Replace IE's carriage returns 4198 return elem.innerText.replace( rReturn, '' ); 4199 } else { 4200 // Traverse it's children 4201 for ( elem = elem.firstChild; elem; elem = elem.nextSibling) { 4202 ret += getText( elem ); 4203 } 4204 } 4205 } else if ( nodeType === 3 || nodeType === 4 ) { 4206 return elem.nodeValue; 4207 } 4208 } else { 4209 4210 // If no nodeType, this is expected to be an array 4211 for ( i = 0; (node = elem[i]); i++ ) {
4212 // Do not traverse comment nodes 4213 if ( node.nodeType !== 8 ) { 4214 ret += getText( node ); 4215 } 4216 } 4217 } 4218 return ret; 4219}; 4220 4221var Expr = Sizzle.selectors = { 4222 order: [ "ID", "NAME", "TAG" ], 4223 4224 match: { 4225 ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, 4226 CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, 4227 NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, 4228 ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, 4229 TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, 4230 CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, 4231 POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, 4232 PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ 4233 }, 4234 4235 leftMatch: {}, 4236 4237 attrMap: { 4238 "class": "className", 4239 "for": "htmlFor" 4240 }, 4241 4242 attrHandle: { 4243 href: function( elem ) { 4244 return elem.getAttribute( "href" ); 4245 }, 4246 type: function( elem ) { 4247 return elem.getAttribute( "type" ); 4248 } 4249 }, 4250 4251 relative: { 4252 "+": function(checkSet, part){ 4253 var isPartStr = typeof part === "string", 4254 isTag = isPartStr && !rNonWord.test( part ), 4255 isPartStrNotTag = isPartStr && !isTag; 4256 4257 if ( isTag ) { 4258 part = part.toLowerCase(); 4259 } 4260 4261 for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { 4262 if ( (elem = checkSet[i]) ) { 4263 while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} 4264 4265 checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? 4266 elem || false : 4267 elem === part; 4268 } 4269 } 4270 4271 if ( isPartStrNotTag ) { 4272 Sizzle.filter( part, checkSet, true ); 4273 } 4274 }, 4275 4276 ">": function( checkSet, part ) { 4277 var elem, 4278 isPartStr = typeof part === "string", 4279 i = 0, 4280 l = checkSet.length; 4281 4282 if ( isPartStr && !rNonWord.test( part ) ) { 4283 part = part.toLowerCase(); 4284 4285 for ( ; i < l; i++ ) { 4286 elem = checkSet[i]; 4287 4288 if ( elem ) { 4289 var parent = elem.parentNode; 4290 checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; 4291 } 4292 } 4293 4294 } else { 4295 for ( ; i < l; i++ ) { 4296 elem = checkSet[i]; 4297 4298 if ( elem ) { 4299 checkSet[i] = isPartStr ? 4300 elem.parentNode : 4301 elem.parentNode === part; 4302 } 4303 } 4304 4305 if ( isPartStr ) { 4306 Sizzle.filter( part, checkSet, true ); 4307 } 4308 } 4309 }, 4310 4311 "": function(checkSet, part, isXML){ 4312 var nodeCheck, 4313 doneName = done++, 4314 checkFn = dirCheck; 4315 4316 if ( typeof part === "string" && !rNonWord.test( part ) ) { 4317 part = part.toLowerCase(); 4318 nodeCheck = part; 4319 checkFn = dirNodeCheck; 4320 } 4321 4322 checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); 4323 }, 4324 4325 "~": function( checkSet, part, isXML ) { 4326 var nodeCheck, 4327 doneName = done++, 4328 checkFn = dirCheck; 4329 4330 if ( typeof part === "string" && !rNonWord.test( part ) ) { 4331 part = part.toLowerCase(); 4332 nodeCheck = part; 4333 checkFn = dirNodeCheck; 4334 } 4335 4336 checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); 4337 } 4338 }, 4339 4340 find: { 4341 ID: function( match, context, isXML ) { 4342 if ( typeof context.getElementById !== "undefined" && !isXML ) { 4343 var m = context.getElementById(match[1]); 4344 // Check parentNode to catch when Blackberry 4.6 returns 4345 // nodes that are no longer in the document #6963 4346 return m && m.parentNode ? [m] : []; 4347 } 4348 }, 4349 4350 NAME: function( match, context ) { 4351 if ( typeof context.getElementsByName !== "undefined" ) { 4352 var ret = [], 4353 results = context.getElementsByName( match[1] ); 4354 4355 for ( var i = 0, l = results.length; i < l; i++ ) { 4356 if ( results[i].getAttribute("name") === match[1] ) { 4357 ret.push( results[i] ); 4358 } 4359 } 4360 4361 return ret.length === 0 ? null : ret; 4362 } 4363 }, 4364 4365 TAG: function( match, context ) { 4366 if ( typeof context.getElementsByTagName !== "undefined" ) { 4367 return context.getElementsByTagName( match[1] ); 4368 } 4369 } 4370 }, 4371 preFilter: { 4372 CLASS: function( match, curLoop, inplace, result, not, isXML ) { 4373 match = " " + match[1].replace( rBackslash, "" ) + " "; 4374 4375 if ( isXML ) { 4376 return match; 4377 } 4378 4379 for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { 4380 if ( elem ) { 4381 if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) { 4382 if ( !inplace ) { 4383 result.push( elem ); 4384 } 4385 4386 } else if ( inplace ) { 4387 curLoop[i] = false;
4388 } 4389 } 4390 } 4391 4392 return false; 4393 }, 4394 4395 ID: function( match ) { 4396 return match[1].replace( rBackslash, "" ); 4397 }, 4398 4399 TAG: function( match, curLoop ) { 4400 return match[1].replace( rBackslash, "" ).toLowerCase(); 4401 }, 4402 4403 CHILD: function( match ) { 4404 if ( match[1] === "nth" ) { 4405 if ( !match[2] ) { 4406 Sizzle.error( match[0] ); 4407 } 4408 4409 match[2] = match[2].replace(/^\+|\s*/g, ''); 4410 4411 // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' 4412 var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( 4413 match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || 4414 !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); 4415 4416 // calculate the numbers (first)n+(last) including if they are negative 4417 match[2] = (test[1] + (test[2] || 1)) - 0; 4418 match[3] = test[3] - 0; 4419 } 4420 else if ( match[2] ) { 4421 Sizzle.error( match[0] ); 4422 } 4423 4424 // TODO: Move to normal caching system 4425 match[0] = done++; 4426 4427 return match; 4428 }, 4429 4430 ATTR: function( match, curLoop, inplace, result, not, isXML ) { 4431 var name = match[1] = match[1].replace( rBackslash, "" ); 4432 4433 if ( !isXML && Expr.attrMap[name] ) { 4434 match[1] = Expr.attrMap[name]; 4435 } 4436 4437 // Handle if an un-quoted value was used 4438 match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" ); 4439 4440 if ( match[2] === "~=" ) { 4441 match[4] = " " + match[4] + " "; 4442 } 4443 4444 return match; 4445 }, 4446 4447 PSEUDO: function( match, curLoop, inplace, result, not ) { 4448 if ( match[1] === "not" ) { 4449 // If we're dealing with a complex expression, or a simple one 4450 if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { 4451 match[3] = Sizzle(match[3], null, null, curLoop); 4452 4453 } else { 4454 var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); 4455 4456 if ( !inplace ) { 4457 result.push.apply( result, ret ); 4458 } 4459 4460 return false; 4461 } 4462 4463 } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { 4464 return true; 4465 } 4466 4467 return match; 4468 }, 4469 4470 POS: function( match ) { 4471 match.unshift( true ); 4472 4473 return match; 4474 } 4475 }, 4476 4477 filters: { 4478 enabled: function( elem ) { 4479 return elem.disabled === false && elem.type !== "hidden"; 4480 }, 4481 4482 disabled: function( elem ) { 4483 return elem.disabled === true; 4484 }, 4485 4486 checked: function( elem ) { 4487 return elem.checked === true; 4488 }, 4489 4490 selected: function( elem ) { 4491 // Accessing this property makes selected-by-default 4492 // options in Safari work properly 4493 if ( elem.parentNode ) { 4494 elem.parentNode.selectedIndex; 4495 } 4496 4497 return elem.selected === true; 4498 }, 4499 4500 parent: function( elem ) { 4501 return !!elem.firstChild; 4502 }, 4503 4504 empty: function( elem ) { 4505 return !elem.firstChild; 4506 }, 4507 4508 has: function( elem, i, match ) { 4509 return !!Sizzle( match[3], elem ).length; 4510 }, 4511 4512 header: function( elem ) { 4513 return (/h\d/i).test( elem.nodeName ); 4514 }, 4515 4516 text: function( elem ) { 4517 var attr = elem.getAttribute( "type" ), type = elem.type; 4518 // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) 4519 // use getAttribute instead to test this case 4520 return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); 4521 }, 4522 4523 radio: function( elem ) { 4524 return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type; 4525 }, 4526 4527 checkbox: function( elem ) { 4528 return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type; 4529 }, 4530 4531 file: function( elem ) { 4532 return elem.nodeName.toLowerCase() === "input" && "file" === elem.type; 4533 }, 4534 4535 password: function( elem ) { 4536 return elem.nodeName.toLowerCase() === "input" && "password" === elem.type; 4537 }, 4538 4539 submit: function( elem ) { 4540 var name = elem.nodeName.toLowerCase(); 4541 return (name === "input" || name === "button") && "submit" === elem.type; 4542 }, 4543 4544 image: function( elem ) { 4545 return elem.nodeName.toLowerCase() === "input" && "image" === elem.type; 4546 }, 4547 4548 reset: function( elem ) { 4549 var name = elem.nodeName.toLowerCase(); 4550 return (name === "input" || name === "button") && "reset" === elem.type; 4551 }, 4552 4553 button: function( elem ) { 4554 var name = elem.nodeName.toLowerCase(); 4555 return name === "input" && "button" === elem.type || name === "button"; 4556 }, 4557 4558 input: function( elem ) { 4559 return (/input|select|textarea|button/i).test( elem.nodeName ); 4560 }, 4561 4562 focus: function( elem ) { 4563 return elem === elem.ownerDocument.activeElement; 4564 } 4565 }, 4566 setFilters: { 4567 first: function( elem, i ) { 4568 return i === 0; 4569 }, 4570 4571 last: function( elem, i, match, array ) { 4572 return i === array.length - 1; 4573 }, 4574 4575 even: function( elem, i ) { 4576 return i % 2 === 0; 4577 }, 4578 4579 odd: function( elem, i ) { 4580 return i % 2 === 1; 4581 }, 4582 4583 lt: function( elem, i, match ) { 4584 return i < match[3] - 0; 4585 }, 4586 4587 gt: function( elem, i, match ) { 4588 return i > match[3] - 0; 4589 }, 4590 4591 nth: function( elem, i, match ) { 4592 return match[3] - 0 === i; 4593 }, 4594 4595 eq: function( elem, i, match ) { 4596 return match[3] - 0 === i; 4597 } 4598 }, 4599 filter: { 4600 PSEUDO: function( elem, match, i, array ) { 4601 var name = match[1], 4602 filter = Expr.filters[ name ]; 4603 4604 if ( filter ) { 4605 return filter( elem, i, match, array ); 4606 4607 } else if ( name === "contains" ) { 4608 return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0; 4609 4610 } else if ( name === "not" ) { 4611 var not = match[3]; 4612 4613 for ( var j = 0, l = not.length; j < l; j++ ) { 4614 if ( not[j] === elem ) { 4615 return false;
4616 } 4617 } 4618 4619 return true; 4620 4621 } else { 4622 Sizzle.error( name ); 4623 } 4624 }, 4625 4626 CHILD: function( elem, match ) { 4627 var first, last, 4628 doneName, parent, cache, 4629 count, diff, 4630 type = match[1], 4631 node = elem; 4632 4633 switch ( type ) { 4634 case "only": 4635 case "first": 4636 while ( (node = node.previousSibling) ) { 4637 if ( node.nodeType === 1 ) { 4638 return false; 4639 } 4640 } 4641 4642 if ( type === "first" ) { 4643 return true; 4644 } 4645 4646 node = elem; 4647 4648 case "last": 4649 while ( (node = node.nextSibling) ) { 4650 if ( node.nodeType === 1 ) { 4651 return false; 4652 } 4653 } 4654 4655 return true; 4656 4657 case "nth": 4658 first = match[2]; 4659 last = match[3]; 4660 4661 if ( first === 1 && last === 0 ) { 4662 return true; 4663 } 4664 4665 doneName = match[0]; 4666 parent = elem.parentNode; 4667 4668 if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) { 4669 count = 0; 4670 4671 for ( node = parent.firstChild; node; node = node.nextSibling ) { 4672 if ( node.nodeType === 1 ) { 4673 node.nodeIndex = ++count; 4674 } 4675 } 4676 4677 parent[ expando ] = doneName; 4678 } 4679 4680 diff = elem.nodeIndex - last; 4681 4682 if ( first === 0 ) { 4683 return diff === 0; 4684 4685 } else { 4686 return ( diff % first === 0 && diff / first >= 0 ); 4687 } 4688 } 4689 }, 4690 4691 ID: function( elem, match ) { 4692 return elem.nodeType === 1 && elem.getAttribute("id") === match; 4693 }, 4694 4695 TAG: function( elem, match ) { 4696 return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match; 4697 }, 4698 4699 CLASS: function( elem, match ) { 4700 return (" " + (elem.className || elem.getAttribute("class")) + " ") 4701 .indexOf( match ) > -1; 4702 }, 4703 4704 ATTR: function( elem, match ) { 4705 var name = match[1], 4706 result = Sizzle.attr ? 4707 Sizzle.attr( elem, name ) : 4708 Expr.attrHandle[ name ] ? 4709 Expr.attrHandle[ name ]( elem ) : 4710 elem[ name ] != null ? 4711 elem[ name ] : 4712 elem.getAttribute( name ), 4713 value = result + "", 4714 type = match[2], 4715 check = match[4]; 4716 4717 return result == null ? 4718 type === "!=" : 4719 !type && Sizzle.attr ? 4720 result != null : 4721 type === "=" ? 4722 value === check : 4723 type === "*=" ? 4724 value.indexOf(check) >= 0 : 4725 type === "~=" ? 4726 (" " + value + " ").indexOf(check) >= 0 : 4727 !check ? 4728 value && result !== false : 4729 type === "!=" ? 4730 value !== check : 4731 type === "^=" ? 4732 value.indexOf(check) === 0 : 4733 type === "$=" ? 4734 value.substr(value.length - check.length) === check : 4735 type === "|=" ? 4736 value === check || value.substr(0, check.length + 1) === check + "-" : 4737 false; 4738 }, 4739 4740 POS: function( elem, match, i, array ) { 4741 var name = match[2], 4742 filter = Expr.setFilters[ name ]; 4743 4744 if ( filter ) { 4745 return filter( elem, i, match, array ); 4746 } 4747 } 4748 } 4749}; 4750 4751var origPOS = Expr.match.POS, 4752 fescape = function(all, num){ 4753 return "\\" + (num - 0 + 1); 4754 }; 4755 4756for ( var type in Expr.match ) { 4757 Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); 4758 Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); 4759} 4760 4761var makeArray = function( array, results ) { 4762 array = Array.prototype.slice.call( array, 0 ); 4763 4764 if ( results ) { 4765 results.push.apply( results, array ); 4766 return results; 4767 } 4768 4769 return array; 4770}; 4771 4772// Perform a simple check to determine if the browser is capable of 4773// converting a NodeList to an array using builtin methods. 4774// Also verifies that the returned array holds DOM nodes 4775// (which is not the case in the Blackberry browser) 4776try { 4777 Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; 4778 4779// Provide a fallback method if it does not work 4780} catch( e ) { 4781 makeArray = function( array, results ) { 4782 var i = 0, 4783 ret = results || []; 4784 4785 if ( toString.call(array) === "[object Array]" ) { 4786 Array.prototype.push.apply( ret, array ); 4787 4788 } else { 4789 if ( typeof array.length === "number" ) { 4790 for ( var l = array.length; i < l; i++ ) { 4791 ret.push( array[i] ); 4792 } 4793 4794 } else { 4795 for ( ; array[i]; i++ ) {
4796 ret.push( array[i] ); 4797 } 4798 } 4799 } 4800 4801 return ret; 4802 }; 4803} 4804 4805var sortOrder, siblingCheck; 4806 4807if ( document.documentElement.compareDocumentPosition ) { 4808 sortOrder = function( a, b ) { 4809 if ( a === b ) { 4810 hasDuplicate = true; 4811 return 0; 4812 } 4813 4814 if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { 4815 return a.compareDocumentPosition ? -1 : 1; 4816 } 4817 4818 return a.compareDocumentPosition(b) & 4 ? -1 : 1; 4819 }; 4820 4821} else { 4822 sortOrder = function( a, b ) { 4823 // The nodes are identical, we can exit early 4824 if ( a === b ) { 4825 hasDuplicate = true; 4826 return 0; 4827 4828 // Fallback to using sourceIndex (in IE) if it's available on both nodes 4829 } else if ( a.sourceIndex && b.sourceIndex ) { 4830 return a.sourceIndex - b.sourceIndex; 4831 } 4832 4833 var al, bl, 4834 ap = [], 4835 bp = [], 4836 aup = a.parentNode, 4837 bup = b.parentNode, 4838 cur = aup; 4839 4840 // If the nodes are siblings (or identical) we can do a quick check 4841 if ( aup === bup ) { 4842 return siblingCheck( a, b ); 4843 4844 // If no parents were found then the nodes are disconnected 4845 } else if ( !aup ) { 4846 return -1; 4847 4848 } else if ( !bup ) { 4849 return 1; 4850 } 4851 4852 // Otherwise they're somewhere else in the tree so we need 4853 // to build up a full list of the parentNodes for comparison 4854 while ( cur ) { 4855 ap.unshift( cur ); 4856 cur = cur.parentNode; 4857 } 4858 4859 cur = bup; 4860 4861 while ( cur ) { 4862 bp.unshift( cur ); 4863 cur = cur.parentNode; 4864 } 4865 4866 al = ap.length; 4867 bl = bp.length; 4868 4869 // Start walking down the tree looking for a discrepancy 4870 for ( var i = 0; i < al && i < bl; i++ ) { 4871 if ( ap[i] !== bp[i] ) { 4872 return siblingCheck( ap[i], bp[i] ); 4873 } 4874 } 4875 4876 // We ended someplace up the tree so do a sibling check 4877 return i === al ? 4878 siblingCheck( a, bp[i], -1 ) : 4879 siblingCheck( ap[i], b, 1 ); 4880 }; 4881 4882 siblingCheck = function( a, b, ret ) { 4883 if ( a === b ) { 4884 return ret; 4885 } 4886 4887 var cur = a.nextSibling; 4888 4889 while ( cur ) { 4890 if ( cur === b ) { 4891 return -1; 4892 } 4893 4894 cur = cur.nextSibling; 4895 } 4896 4897 return 1; 4898 }; 4899} 4900 4901// Check to see if the browser returns elements by name when 4902// querying by getElementById (and provide a workaround) 4903(function(){ 4904 // We're going to inject a fake input element with a specified name 4905 var form = document.createElement("div"), 4906 id = "script" + (new Date()).getTime(), 4907 root = document.documentElement; 4908 4909 form.innerHTML = "<a name='" + id + "'/>"; 4910 4911 // Inject it into the root element, check its status, and remove it quickly 4912 root.insertBefore( form, root.firstChild ); 4913 4914 // The workaround has to do additional checks after a getElementById 4915 // Which slows things down for other browsers (hence the branching) 4916 if ( document.getElementById( id ) ) { 4917 Expr.find.ID = function( match, context, isXML ) { 4918 if ( typeof context.getElementById !== "undefined" && !isXML ) { 4919 var m = context.getElementById(match[1]); 4920 4921 return m ? 4922 m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? 4923 [m] : 4924 undefined : 4925 []; 4926 } 4927 }; 4928 4929 Expr.filter.ID = function( elem, match ) { 4930 var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); 4931 4932 return elem.nodeType === 1 && node && node.nodeValue === match; 4933 }; 4934 } 4935 4936 root.removeChild( form ); 4937 4938 // release memory in IE 4939 root = form = null; 4940})(); 4941 4942(function(){ 4943 // Check to see if the browser returns only elements 4944 // when doing getElementsByTagName("*") 4945 4946 // Create a fake element 4947 var div = document.createElement("div"); 4948 div.appendChild( document.createComment("") ); 4949 4950 // Make sure no comments are found 4951 if ( div.getElementsByTagName("*").length > 0 ) { 4952 Expr.find.TAG = function( match, context ) { 4953 var results = context.getElementsByTagName( match[1] ); 4954 4955 // Filter out possible comments 4956 if ( match[1] === "*" ) { 4957 var tmp = []; 4958 4959 for ( var i = 0; results[i]; i++ ) { 4960 if ( results[i].nodeType === 1 ) { 4961 tmp.push( results[i] ); 4962 } 4963 } 4964 4965 results = tmp; 4966 } 4967 4968 return results; 4969 }; 4970 } 4971 4972 // Check to see if an attribute returns normalized href attributes 4973 div.innerHTML = "<a href='#'></a>"; 4974 4975 if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && 4976 div.firstChild.getAttribute("href") !== "#" ) { 4977 4978 Expr.attrHandle.href = function( elem ) { 4979 return elem.getAttribute( "href", 2 ); 4980 }; 4981 } 4982 4983 // release memory in IE 4984 div = null; 4985})(); 4986 4987if ( document.querySelectorAll ) { 4988 (function(){
4989 var oldSizzle = Sizzle, 4990 div = document.createElement("div"), 4991 id = "__sizzle__"; 4992 4993 div.innerHTML = "<p class='TEST'></p>"; 4994 4995 // Safari can't handle uppercase or unicode characters when 4996 // in quirks mode. 4997 if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { 4998 return; 4999 } 5000 5001 Sizzle = function( query, context, extra, seed ) { 5002 context = context || document; 5003 5004 // Only use querySelectorAll on non-XML documents 5005 // (ID selectors don't work in non-HTML documents) 5006 if ( !seed && !Sizzle.isXML(context) ) { 5007 // See if we find a selector to speed up 5008 var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); 5009 5010 if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { 5011 // Speed-up: Sizzle("TAG") 5012 if ( match[1] ) { 5013 return makeArray( context.getElementsByTagName( query ), extra ); 5014 5015 // Speed-up: Sizzle(".CLASS") 5016 } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { 5017 return makeArray( context.getElementsByClassName( match[2] ), extra ); 5018 } 5019 } 5020 5021 if ( context.nodeType === 9 ) { 5022 // Speed-up: Sizzle("body") 5023 // The body element only exists once, optimize finding it 5024 if ( query === "body" && context.body ) { 5025 return makeArray( [ context.body ], extra ); 5026 5027 // Speed-up: Sizzle("#ID") 5028 } else if ( match && match[3] ) { 5029 var elem = context.getElementById( match[3] ); 5030 5031 // Check parentNode to catch when Blackberry 4.6 returns 5032 // nodes that are no longer in the document #6963 5033 if ( elem && elem.parentNode ) { 5034 // Handle the case where IE and Opera return items 5035 // by name instead of ID 5036 if ( elem.id === match[3] ) { 5037 return makeArray( [ elem ], extra ); 5038 } 5039 5040 } else { 5041 return makeArray( [], extra ); 5042 } 5043 } 5044 5045 try { 5046 return makeArray( context.querySelectorAll(query), extra ); 5047 } catch(qsaError) {} 5048 5049 // qSA works strangely on Element-rooted queries 5050 // We can work around this by specifying an extra ID on the root 5051 // and working up from there (Thanks to Andrew Dupont for the technique) 5052 // IE 8 doesn't work on object elements 5053 } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { 5054 var oldContext = context, 5055 old = context.getAttribute( "id" ), 5056 nid = old || id, 5057 hasParent = context.parentNode, 5058 relativeHierarchySelector = /^\s*[+~]/.test( query ); 5059 5060 if ( !old ) { 5061 context.setAttribute( "id", nid ); 5062 } else { 5063 nid = nid.replace( /'/g, "\\$&" ); 5064 } 5065 if ( relativeHierarchySelector && hasParent ) { 5066 context = context.parentNode; 5067 } 5068 5069 try { 5070 if ( !relativeHierarchySelector || hasParent ) { 5071 return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra ); 5072 } 5073 5074 } catch(pseudoError) { 5075 } finally { 5076 if ( !old ) { 5077 oldContext.removeAttribute( "id" ); 5078 } 5079 } 5080 } 5081 } 5082 5083 return oldSizzle(query, context, extra, seed); 5084 }; 5085 5086 for ( var prop in oldSizzle ) { 5087 Sizzle[ prop ] = oldSizzle[ prop ]; 5088 } 5089 5090 // release memory in IE 5091 div = null; 5092 })(); 5093} 5094 5095(function(){ 5096 var html = document.documentElement, 5097 matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector; 5098 5099 if ( matches ) { 5100 // Check to see if it's possible to do matchesSelector 5101 // on a disconnected node (IE 9 fails this) 5102 var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ), 5103 pseudoWorks = false; 5104 5105 try { 5106 // This should fail with an exception 5107 // Gecko does not error, returns false instead
5108 matches.call( document.documentElement, "[test!='']:sizzle" ); 5109 5110 } catch( pseudoError ) { 5111 pseudoWorks = true; 5112 } 5113 5114 Sizzle.matchesSelector = function( node, expr ) { 5115 // Make sure that attribute selectors are quoted 5116 expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); 5117 5118 if ( !Sizzle.isXML( node ) ) { 5119 try { 5120 if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { 5121 var ret = matches.call( node, expr ); 5122 5123 // IE 9's matchesSelector returns false on disconnected nodes 5124 if ( ret || !disconnectedMatch || 5125 // As well, disconnected nodes are said to be in a document 5126 // fragment in IE 9, so check for that 5127 node.document && node.document.nodeType !== 11 ) { 5128 return ret; 5129 } 5130 } 5131 } catch(e) {} 5132 } 5133 5134 return Sizzle(expr, null, null, [node]).length > 0; 5135 }; 5136 } 5137})(); 5138 5139(function(){ 5140 var div = document.createElement("div"); 5141 5142 div.innerHTML = "<div class='test e'></div><div class='test'></div>"; 5143 5144 // Opera can't find a second classname (in 9.6) 5145 // Also, make sure that getElementsByClassName actually exists 5146 if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { 5147 return; 5148 } 5149 5150 // Safari caches class attributes, doesn't catch changes (in 3.2) 5151 div.lastChild.className = "e"; 5152 5153 if ( div.getElementsByClassName("e").length === 1 ) { 5154 return; 5155 } 5156 5157 Expr.order.splice(1, 0, "CLASS"); 5158 Expr.find.CLASS = function( match, context, isXML ) { 5159 if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { 5160 return context.getElementsByClassName(match[1]); 5161 } 5162 }; 5163 5164 // release memory in IE 5165 div = null; 5166})(); 5167 5168function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { 5169 for ( var i = 0, l = checkSet.length; i < l; i++ ) { 5170 var elem = checkSet[i]; 5171 5172 if ( elem ) { 5173 var match = false; 5174 5175 elem = elem[dir]; 5176 5177 while ( elem ) { 5178 if ( elem[ expando ] === doneName ) { 5179 match = checkSet[elem.sizset]; 5180 break; 5181 } 5182 5183 if ( elem.nodeType === 1 && !isXML ){ 5184 elem[ expando ] = doneName; 5185 elem.sizset = i; 5186 } 5187 5188 if ( elem.nodeName.toLowerCase() === cur ) { 5189 match = elem; 5190 break; 5191 } 5192 5193 elem = elem[dir]; 5194 } 5195 5196 checkSet[i] = match; 5197 } 5198 } 5199} 5200 5201function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { 5202 for ( var i = 0, l = checkSet.length; i < l; i++ ) { 5203 var elem = checkSet[i]; 5204 5205 if ( elem ) { 5206 var match = false; 5207 5208 elem = elem[dir]; 5209 5210 while ( elem ) { 5211 if ( elem[ expando ] === doneName ) { 5212 match = checkSet[elem.sizset]; 5213 break; 5214 } 5215 5216 if ( elem.nodeType === 1 ) { 5217 if ( !isXML ) { 5218 elem[ expando ] = doneName; 5219 elem.sizset = i; 5220 } 5221 5222 if ( typeof cur !== "string" ) { 5223 if ( elem === cur ) { 5224 match = true; 5225 break; 5226 } 5227 5228 } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { 5229 match = elem; 5230 break; 5231 } 5232 } 5233 5234 elem = elem[dir]; 5235 } 5236 5237 checkSet[i] = match; 5238 } 5239 } 5240} 5241 5242if ( document.documentElement.contains ) { 5243 Sizzle.contains = function( a, b ) { 5244 return a !== b && (a.contains ? a.contains(b) : true); 5245 }; 5246 5247} else if ( document.documentElement.compareDocumentPosition ) { 5248 Sizzle.contains = function( a, b ) { 5249 return !!(a.compareDocumentPosition(b) & 16); 5250 }; 5251 5252} else { 5253 Sizzle.contains = function() { 5254 return false; 5255 }; 5256} 5257 5258Sizzle.isXML = function( elem ) { 5259 // documentElement is verified for cases where it doesn't yet exist 5260 // (such as loading iframes in IE - #4833) 5261 var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; 5262 5263 return documentElement ? documentElement.nodeName !== "HTML" : false; 5264}; 5265 5266var posProcess = function( selector, context, seed ) { 5267 var match, 5268 tmpSet = [], 5269 later = "", 5270 root = context.nodeType ? [context] : context; 5271 5272 // Position selectors must be done after the filter 5273 // And so must :not(positional) so we move all PSEUDOs to the end 5274 while ( (match = Expr.match.PSEUDO.exec( selector )) ) { 5275 later += match[0]; 5276 selector = selector.replace( Expr.match.PSEUDO, "" ); 5277 } 5278 5279 selector = Expr.relative[selector] ? selector + "*" : selector; 5280 5281 for ( var i = 0, l = root.length; i < l; i++ ) { 5282 Sizzle( selector, root[i], tmpSet, seed ); 5283 } 5284 5285 return Sizzle.filter( later, tmpSet ); 5286}; 5287 5288// EXPOSE 5289// Override sizzle attribute retrieval 5290Sizzle.attr = jQuery.attr; 5291Sizzle.selectors.attrMap = {}; 5292jQuery.find = Sizzle; 5293jQuery.expr = Sizzle.selectors; 5294jQuery.expr[":"] = jQuery.expr.filters; 5295jQuery.unique = Sizzle.uniqueSort; 5296jQuery.text = Sizzle.getText; 5297jQuery.isXMLDoc = Sizzle.isXML; 5298jQuery.contains = Sizzle.contains; 5299 5300 5301})(); 5302 5303 5304var runtil = /Until$/, 5305 rparentsprev = /^(?:parents|prevUntil|prevAll)/, 5306 // Note: This RegExp should be improved, or likely pulled from Sizzle 5307 rmultiselector = /,/, 5308 isSimple = /^.[^:#\[\.,]*$/, 5309 slice = Array.prototype.slice, 5310 POS = jQuery.expr.match.POS, 5311 // methods guaranteed to produce a unique set when starting from a unique set 5312 guaranteedUnique = { 5313 children: true, 5314 contents: true, 5315 next: true, 5316 prev: true 5317 }; 5318 5319jQuery.fn.extend({ 5320 find: function( selector ) { 5321 var self = this, 5322 i, l; 5323 5324 if ( typeof selector !== "string" ) {
5325 return jQuery( selector ).filter(function() { 5326 for ( i = 0, l = self.length; i < l; i++ ) { 5327 if ( jQuery.contains( self[ i ], this ) ) { 5328 return true; 5329 } 5330 } 5331 }); 5332 } 5333 5334 var ret = this.pushStack( "", "find", selector ), 5335 length, n, r; 5336 5337 for ( i = 0, l = this.length; i < l; i++ ) { 5338 length = ret.length; 5339 jQuery.find( selector, this[i], ret ); 5340 5341 if ( i > 0 ) { 5342 // Make sure that the results are unique 5343 for ( n = length; n < ret.length; n++ ) { 5344 for ( r = 0; r < length; r++ ) { 5345 if ( ret[r] === ret[n] ) { 5346 ret.splice(n--, 1); 5347 break; 5348 } 5349 } 5350 } 5351 } 5352 } 5353 5354 return ret; 5355 }, 5356 5357 has: function( target ) { 5358 var targets = jQuery( target ); 5359 return this.filter(function() { 5360 for ( var i = 0, l = targets.length; i < l; i++ ) { 5361 if ( jQuery.contains( this, targets[i] ) ) { 5362 return true; 5363 } 5364 } 5365 }); 5366 }, 5367 5368 not: function( selector ) { 5369 return this.pushStack( winnow(this, selector, false), "not", selector); 5370 }, 5371 5372 filter: function( selector ) { 5373 return this.pushStack( winnow(this, selector, true), "filter", selector ); 5374 }, 5375 5376 is: function( selector ) { 5377 return !!selector && ( 5378 typeof selector === "string" ? 5379 // If this is a positional selector, check membership in the returned set 5380 // so $("p:first").is("p:last") won't return true for a doc with two "p". 5381 POS.test( selector ) ? 5382 jQuery( selector, this.context ).index( this[0] ) >= 0 : 5383 jQuery.filter( selector, this ).length > 0 : 5384 this.filter( selector ).length > 0 ); 5385 }, 5386 5387 closest: function( selectors, context ) { 5388 var ret = [], i, l, cur = this[0]; 5389 5390 // Array (deprecated as of jQuery 1.7) 5391 if ( jQuery.isArray( selectors ) ) { 5392 var level = 1; 5393 5394 while ( cur && cur.ownerDocument && cur !== context ) { 5395 for ( i = 0; i < selectors.length; i++ ) { 5396 5397 if ( jQuery( cur ).is( selectors[ i ] ) ) { 5398 ret.push({ selector: selectors[ i ], elem: cur, level: level }); 5399 } 5400 } 5401 5402 cur = cur.parentNode; 5403 level++; 5404 } 5405 5406 return ret; 5407 } 5408 5409 // String 5410 var pos = POS.test( selectors ) || typeof selectors !== "string" ? 5411 jQuery( selectors, context || this.context ) : 5412 0; 5413 5414 for ( i = 0, l = this.length; i < l; i++ ) { 5415 cur = this[i]; 5416 5417 while ( cur ) { 5418 if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { 5419 ret.push( cur ); 5420 break; 5421 5422 } else { 5423 cur = cur.parentNode; 5424 if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) { 5425 break; 5426 } 5427 } 5428 } 5429 } 5430 5431 ret = ret.length > 1 ? jQuery.unique( ret ) : ret; 5432 5433 return this.pushStack( ret, "closest", selectors ); 5434 }, 5435 5436 // Determine the position of an element within 5437 // the matched set of elements 5438 index: function( elem ) { 5439 5440 // No argument, return index in parent 5441 if ( !elem ) { 5442 return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1; 5443 } 5444 5445 // index in selector 5446 if ( typeof elem === "string" ) { 5447 return jQuery.inArray( this[0], jQuery( elem ) ); 5448 } 5449 5450 // Locate the position of the desired element 5451 return jQuery.inArray( 5452 // If it receives a jQuery object, the first element is used 5453 elem.jquery ? elem[0] : elem, this ); 5454 }, 5455 5456 add: function( selector, context ) { 5457 var set = typeof selector === "string" ? 5458 jQuery( selector, context ) : 5459 jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), 5460 all = jQuery.merge( this.get(), set ); 5461 5462 return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? 5463 all : 5464 jQuery.unique( all ) ); 5465 }, 5466 5467 andSelf: function() { 5468 return this.add( this.prevObject ); 5469 } 5470}); 5471 5472// A painfully simple check to see if an element is disconnected 5473// from a document (should be improved, where feasible). 5474function isDisconnected( node ) { 5475 return !node || !node.parentNode || node.parentNode.nodeType === 11; 5476} 5477 5478jQuery.each({ 5479 parent: function( elem ) { 5480 var parent = elem.parentNode; 5481 return parent && parent.nodeType !== 11 ? parent : null; 5482 }, 5483 parents: function( elem ) { 5484 return jQuery.dir( elem, "parentNode" ); 5485 }, 5486 parentsUntil: function( elem, i, until ) { 5487 return jQuery.dir( elem, "parentNode", until ); 5488 }, 5489 next: function( elem ) { 5490 return jQuery.nth( elem, 2, "nextSibling" ); 5491 }, 5492 prev: function( elem ) { 5493 return jQuery.nth( elem, 2, "previousSibling" ); 5494 }, 5495 nextAll: function( elem ) { 5496 return jQuery.dir( elem, "nextSibling" ); 5497 }, 5498 prevAll: function( elem ) { 5499 return jQuery.dir( elem, "previousSibling" ); 5500 }, 5501 nextUntil: function( elem, i, until ) { 5502 return jQuery.dir( elem, "nextSibling", until ); 5503 }, 5504 prevUntil: function( elem, i, until ) { 5505 return jQuery.dir( elem, "previousSibling", until ); 5506 }, 5507 siblings: function( elem ) { 5508 return jQuery.sibling( elem.parentNode.firstChild, elem ); 5509 }, 5510 children: function( elem ) { 5511 return jQuery.sibling( elem.firstChild ); 5512 }, 5513 contents: function( elem ) { 5514 return jQuery.nodeName( elem, "iframe" ) ? 5515 elem.contentDocument || elem.contentWindow.document : 5516 jQuery.makeArray( elem.childNodes ); 5517 } 5518}, function( name, fn ) { 5519 jQuery.fn[ name ] = function( until, selector ) { 5520 var ret = jQuery.map( this, fn, until ); 5521 5522 if ( !runtil.test( name ) ) { 5523 selector = until; 5524 } 5525 5526 if ( selector && typeof selector === "string" ) { 5527 ret = jQuery.filter( selector, ret ); 5528 } 5529 5530 ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; 5531 5532 if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { 5533 ret = ret.reverse(); 5534 } 5535 5536 return this.pushStack( ret, name, slice.call( arguments ).join(",") ); 5537 }; 5538}); 5539 5540jQuery.extend({ 5541 filter: function( expr, elems, not ) { 5542 if ( not ) { 5543 expr = ":not(" + expr + ")"; 5544 } 5545 5546 return elems.length === 1 ? 5547 jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : 5548 jQuery.find.matches(expr, elems); 5549 }, 5550 5551 dir: function( elem, dir, until ) { 5552 var matched = [], 5553 cur = elem[ dir ]; 5554 5555 while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { 5556 if ( cur.nodeType === 1 ) { 5557 matched.push( cur ); 5558 } 5559 cur = cur[dir]; 5560 } 5561 return matched; 5562 }, 5563 5564 nth: function( cur, result, dir, elem ) { 5565 result = result || 1; 5566 var num = 0; 5567 5568 for ( ; cur; cur = cur[dir] ) { 5569 if ( cur.nodeType === 1 && ++num === result ) { 5570 break; 5571 } 5572 } 5573 5574 return cur; 5575 }, 5576 5577 sibling: function( n, elem ) { 5578 var r = []; 5579 5580 for ( ; n; n = n.nextSibling ) { 5581 if ( n.nodeType === 1 && n !== elem ) { 5582 r.push( n ); 5583 } 5584 } 5585 5586 return r; 5587 } 5588}); 5589 5590// Implement the identical functionality for filter and not 5591function winnow( elements, qualifier, keep ) { 5592 5593 // Can't pass null or undefined to indexOf in Firefox 4 5594 // Set to 0 to skip string check 5595 qualifier = qualifier || 0; 5596 5597 if ( jQuery.isFunction( qualifier ) ) { 5598 return jQuery.grep(elements, function( elem, i ) { 5599 var retVal = !!qualifier.call( elem, i, elem ); 5600 return retVal === keep; 5601 }); 5602 5603 } else if ( qualifier.nodeType ) { 5604 return jQuery.grep(elements, function( elem, i ) { 5605 return ( elem === qualifier ) === keep; 5606 }); 5607 5608 } else if ( typeof qualifier === "string" ) { 5609 var filtered = jQuery.grep(elements, function( elem ) { 5610 return elem.nodeType === 1; 5611 }); 5612 5613 if ( isSimple.test( qualifier ) ) { 5614 return jQuery.filter(qualifier, filtered, !keep); 5615 } else { 5616 qualifier = jQuery.filter( qualifier, filtered ); 5617 } 5618 } 5619 5620 return jQuery.grep(elements, function( elem, i ) { 5621 return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; 5622 }); 5623} 5624 5625 5626 5627 5628function createSafeFragment( document ) { 5629 var list = nodeNames.split( "|" ),
vendor: 3,540 bytes, lines 5630-5767
5630 safeFrag = document.createDocumentFragment(); 5631 5632 if ( safeFrag.createElement ) { 5633 while ( list.length ) { 5634 safeFrag.createElement( 5635 list.pop() 5636 ); 5637 } 5638 } 5639 return safeFrag; 5640} 5641 5642var nodeNames = "abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|" + 5643 "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", 5644 rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, 5645 rleadingWhitespace = /^\s+/, 5646 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, 5647 rtagName = /<([\w:]+)/, 5648 rtbody = /<tbody/i, 5649 rhtml = /<|&#?\w+;/, 5650 rnoInnerhtml = /<(?:script|style)/i, 5651 rnocache = /<(?:script|object|embed|option|style)/i, 5652 rnoshimcache = new RegExp("<(?:" + nodeNames + ")", "i"), 5653 // checked="checked" or checked 5654 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 5655 rscriptType = /\/(java|ecma)script/i, 5656 rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/, 5657 wrapMap = { 5658 option: [ 1, "<select multiple='multiple'>", "</select>" ], 5659 legend: [ 1, "<fieldset>", "</fieldset>" ], 5660 thead: [ 1, "<table>", "</table>" ], 5661 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 5662 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 5663 col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], 5664 area: [ 1, "<map>", "</map>" ], 5665 _default: [ 0, "", "" ] 5666 }, 5667 safeFragment = createSafeFragment( document ); 5668 5669wrapMap.optgroup = wrapMap.option; 5670wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 5671wrapMap.th = wrapMap.td; 5672 5673// IE can't serialize <link> and <script> tags normally 5674if ( !jQuery.support.htmlSerialize ) { 5675 wrapMap._default = [ 1, "div<div>", "</div>" ]; 5676} 5677 5678jQuery.fn.extend({ 5679 text: function( text ) { 5680 if ( jQuery.isFunction(text) ) { 5681 return this.each(function(i) { 5682 var self = jQuery( this ); 5683 5684 self.text( text.call(this, i, self.text()) ); 5685 }); 5686 } 5687 5688 if ( typeof text !== "object" && text !== undefined ) { 5689 return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); 5690 } 5691 5692 return jQuery.text( this ); 5693 }, 5694 5695 wrapAll: function( html ) { 5696 if ( jQuery.isFunction( html ) ) { 5697 return this.each(function(i) { 5698 jQuery(this).wrapAll( html.call(this, i) ); 5699 }); 5700 } 5701 5702 if ( this[0] ) { 5703 // The elements to wrap the target around 5704 var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); 5705 5706 if ( this[0].parentNode ) { 5707 wrap.insertBefore( this[0] ); 5708 } 5709 5710 wrap.map(function() { 5711 var elem = this; 5712 5713 while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { 5714 elem = elem.firstChild; 5715 } 5716 5717 return elem; 5718 }).append( this ); 5719 } 5720 5721 return this; 5722 }, 5723 5724 wrapInner: function( html ) { 5725 if ( jQuery.isFunction( html ) ) { 5726 return this.each(function(i) { 5727 jQuery(this).wrapInner( html.call(this, i) ); 5728 }); 5729 } 5730 5731 return this.each(function() { 5732 var self = jQuery( this ), 5733 contents = self.contents(); 5734 5735 if ( contents.length ) { 5736 contents.wrapAll( html ); 5737 5738 } else { 5739 self.append( html ); 5740 } 5741 }); 5742 }, 5743 5744 wrap: function( html ) { 5745 var isFunction = jQuery.isFunction( html ); 5746 5747 return this.each(function(i) { 5748 jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); 5749 }); 5750 }, 5751 5752 unwrap: function() { 5753 return this.parent().each(function() { 5754 if ( !jQuery.nodeName( this, "body" ) ) { 5755 jQuery( this ).replaceWith( this.childNodes ); 5756 } 5757 }).end(); 5758 }, 5759 5760 append: function() { 5761 return this.domManip(arguments, true, function( elem ) { 5762 if ( this.nodeType === 1 ) { 5763 this.appendChild( elem ); 5764 } 5765 }); 5766 }, 5767
5768 prepend: function() { 5769 return this.domManip(arguments, true, function( elem ) { 5770 if ( this.nodeType === 1 ) { 5771 this.insertBefore( elem, this.firstChild ); 5772 } 5773 }); 5774 }, 5775 5776 before: function() { 5777 if ( this[0] && this[0].parentNode ) { 5778 return this.domManip(arguments, false, function( elem ) { 5779 this.parentNode.insertBefore( elem, this ); 5780 }); 5781 } else if ( arguments.length ) { 5782 var set = jQuery.clean( arguments ); 5783 set.push.apply( set, this.toArray() ); 5784 return this.pushStack( set, "before", arguments ); 5785 } 5786 }, 5787 5788 after: function() { 5789 if ( this[0] && this[0].parentNode ) { 5790 return this.domManip(arguments, false, function( elem ) { 5791 this.parentNode.insertBefore( elem, this.nextSibling ); 5792 }); 5793 } else if ( arguments.length ) { 5794 var set = this.pushStack( this, "after", arguments ); 5795 set.push.apply( set, jQuery.clean(arguments) ); 5796 return set; 5797 } 5798 }, 5799 5800 // keepData is for internal use only--do not document 5801 remove: function( selector, keepData ) { 5802 for ( var i = 0, elem; (elem = this[i]) != null; i++ ) { 5803 if ( !selector || jQuery.filter( selector, [ elem ] ).length ) { 5804 if ( !keepData && elem.nodeType === 1 ) { 5805 jQuery.cleanData( elem.getElementsByTagName("*") ); 5806 jQuery.cleanData( [ elem ] ); 5807 } 5808 5809 if ( elem.parentNode ) { 5810 elem.parentNode.removeChild( elem ); 5811 } 5812 } 5813 } 5814 5815 return this; 5816 }, 5817 5818 empty: function() { 5819 for ( var i = 0, elem; (elem = this[i]) != null; i++ ) { 5820 // Remove element nodes and prevent memory leaks 5821 if ( elem.nodeType === 1 ) { 5822 jQuery.cleanData( elem.getElementsByTagName("*") ); 5823 } 5824 5825 // Remove any remaining nodes 5826 while ( elem.firstChild ) { 5827 elem.removeChild( elem.firstChild ); 5828 } 5829 } 5830 5831 return this; 5832 }, 5833 5834 clone: function( dataAndEvents, deepDataAndEvents ) { 5835 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 5836 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 5837 5838 return this.map( function () { 5839 return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); 5840 }); 5841 }, 5842 5843 html: function( value ) { 5844 if ( value === undefined ) { 5845 return this[0] && this[0].nodeType === 1 ? 5846 this[0].innerHTML.replace(rinlinejQuery, "") : 5847 null; 5848 5849 // See if we can take a shortcut and just use innerHTML 5850 } else if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 5851 (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) && 5852 !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) { 5853 5854 value = value.replace(rxhtmlTag, "<$1></$2>"); 5855 5856 try { 5857 for ( var i = 0, l = this.length; i < l; i++ ) { 5858 // Remove element nodes and prevent memory leaks 5859 if ( this[i].nodeType === 1 ) { 5860 jQuery.cleanData( this[i].getElementsByTagName("*") ); 5861 this[i].innerHTML = value; 5862 } 5863 } 5864 5865 // If using innerHTML throws an exception, use the fallback method 5866 } catch(e) { 5867 this.empty().append( value ); 5868 } 5869 5870 } else if ( jQuery.isFunction( value ) ) { 5871 this.each(function(i){ 5872 var self = jQuery( this ); 5873 5874 self.html( value.call(this, i, self.html()) ); 5875 }); 5876 5877 } else { 5878 this.empty().append( value ); 5879 } 5880 5881 return this; 5882 }, 5883 5884 replaceWith: function( value ) { 5885 if ( this[0] && this[0].parentNode ) { 5886 // Make sure that the elements are removed from the DOM before they are inserted 5887 // this can help fix replacing a parent with child elements 5888 if ( jQuery.isFunction( value ) ) { 5889 return this.each(function(i) { 5890 var self = jQuery(this), old = self.html(); 5891 self.replaceWith( value.call( this, i, old ) ); 5892 }); 5893 } 5894 5895 if ( typeof value !== "string" ) { 5896 value = jQuery( value ).detach(); 5897 } 5898 5899 return this.each(function() { 5900 var next = this.nextSibling, 5901 parent = this.parentNode; 5902 5903 jQuery( this ).remove(); 5904 5905 if ( next ) { 5906 jQuery(next).before( value ); 5907 } else { 5908 jQuery(parent).append( value ); 5909 } 5910 }); 5911 } else { 5912 return this.length ? 5913 this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) : 5914 this; 5915 } 5916 }, 5917 5918 detach: function( selector ) { 5919 return this.remove( selector, true ); 5920 }, 5921 5922 domManip: function( args, table, callback ) { 5923 var results, first, fragment, parent, 5924 value = args[0], 5925 scripts = []; 5926 5927 // We can't cloneNode fragments that contain checked, in WebKit 5928 if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) { 5929 return this.each(function() { 5930 jQuery(this).domManip( args, table, callback, true ); 5931 }); 5932 } 5933 5934 if ( jQuery.isFunction(value) ) { 5935 return this.each(function(i) { 5936 var self = jQuery(this); 5937 args[0] = value.call(this, i, table ? self.html() : undefined); 5938 self.domManip( args, table, callback ); 5939 }); 5940 } 5941 5942 if ( this[0] ) { 5943 parent = value && value.parentNode; 5944 5945 // If we're in a fragment, just use that instead of building a new one 5946 if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) { 5947 results = { fragment: parent }; 5948 5949 } else { 5950 results = jQuery.buildFragment( args, this, scripts ); 5951 } 5952 5953 fragment = results.fragment; 5954 5955 if ( fragment.childNodes.length === 1 ) { 5956 first = fragment = fragment.firstChild; 5957 } else { 5958 first = fragment.firstChild; 5959 } 5960 5961 if ( first ) { 5962 table = table && jQuery.nodeName( first, "tr" ); 5963 5964 for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) { 5965 callback.call( 5966 table ? 5967 root(this[i], first) : 5968 this[i], 5969 // Make sure that we do not leak memory by inadvertently discarding 5970 // the original fragment (which might have attached data) instead of 5971 // using it; in addition, use the original fragment object for the last 5972 // item instead of first because it can end up being emptied incorrectly 5973 // in certain situations (Bug #8070). 5974 // Fragments from the fragment cache must always be cloned and never used 5975 // in place. 5976 results.cacheable || ( l > 1 && i < lastIndex ) ? 5977 jQuery.clone( fragment, true, true ) : 5978 fragment 5979 ); 5980 } 5981 } 5982 5983 if ( scripts.length ) { 5984 jQuery.each( scripts, evalScript ); 5985 } 5986 } 5987 5988 return this; 5989 } 5990}); 5991 5992function root( elem, cur ) { 5993 return jQuery.nodeName(elem, "table") ? 5994 (elem.getElementsByTagName("tbody")[0] || 5995 elem.appendChild(elem.ownerDocument.createElement("tbody"))) : 5996 elem; 5997} 5998 5999function cloneCopyEvent( src, dest ) { 6000
6001 if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { 6002 return; 6003 } 6004 6005 var type, i, l, 6006 oldData = jQuery._data( src ), 6007 curData = jQuery._data( dest, oldData ), 6008 events = oldData.events; 6009 6010 if ( events ) { 6011 delete curData.handle; 6012 curData.events = {}; 6013 6014 for ( type in events ) { 6015 for ( i = 0, l = events[ type ].length; i < l; i++ ) { 6016 jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data ); 6017 } 6018 } 6019 } 6020 6021 // make the cloned public data object a copy from the original 6022 if ( curData.data ) { 6023 curData.data = jQuery.extend( {}, curData.data ); 6024 } 6025} 6026 6027function cloneFixAttributes( src, dest ) { 6028 var nodeName; 6029 6030 // We do not need to do anything for non-Elements 6031 if ( dest.nodeType !== 1 ) { 6032 return; 6033 } 6034 6035 // clearAttributes removes the attributes, which we don't want, 6036 // but also removes the attachEvent events, which we *do* want 6037 if ( dest.clearAttributes ) { 6038 dest.clearAttributes(); 6039 } 6040 6041 // mergeAttributes, in contrast, only merges back on the 6042 // original attributes, not the events 6043 if ( dest.mergeAttributes ) { 6044 dest.mergeAttributes( src ); 6045 } 6046 6047 nodeName = dest.nodeName.toLowerCase(); 6048 6049 // IE6-8 fail to clone children inside object elements that use 6050 // the proprietary classid attribute value (rather than the type 6051 // attribute) to identify the type of content to display 6052 if ( nodeName === "object" ) { 6053 dest.outerHTML = src.outerHTML; 6054 6055 } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) { 6056 // IE6-8 fails to persist the checked state of a cloned checkbox 6057 // or radio button. Worse, IE6-7 fail to give the cloned element 6058 // a checked appearance if the defaultChecked value isn't also set 6059 if ( src.checked ) { 6060 dest.defaultChecked = dest.checked = src.checked; 6061 } 6062 6063 // IE6-7 get confused and end up setting the value of a cloned 6064 // checkbox/radio button to an empty string instead of "on" 6065 if ( dest.value !== src.value ) { 6066 dest.value = src.value; 6067 } 6068 6069 // IE6-8 fails to return the selected option to the default selected 6070 // state when cloning options 6071 } else if ( nodeName === "option" ) { 6072 dest.selected = src.defaultSelected; 6073 6074 // IE6-8 fails to set the defaultValue to the correct value when 6075 // cloning other types of input fields 6076 } else if ( nodeName === "input" || nodeName === "textarea" ) { 6077 dest.defaultValue = src.defaultValue; 6078 } 6079 6080 // Event data gets referenced instead of copied if the expando 6081 // gets copied too 6082 dest.removeAttribute( jQuery.expando ); 6083} 6084 6085jQuery.buildFragment = function( args, nodes, scripts ) { 6086 var fragment, cacheable, cacheresults, doc, 6087 first = args[ 0 ]; 6088 6089 // nodes may contain either an explicit document object, 6090 // a jQuery collection or context object. 6091 // If nodes[0] contains a valid object to assign to doc 6092 if ( nodes && nodes[0] ) { 6093 doc = nodes[0].ownerDocument || nodes[0]; 6094 } 6095 6096 // Ensure that an attr object doesn't incorrectly stand in as a document object 6097 // Chrome and Firefox seem to allow this to occur and will throw exception 6098 // Fixes #8950 6099 if ( !doc.createDocumentFragment ) { 6100 doc = document; 6101 } 6102 6103 // Only cache "small" (1/2 KB) HTML strings that are associated with the main document 6104 // Cloning options loses the selected state, so don't cache them 6105 // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment 6106 // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache 6107 // Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501 6108 if ( args.length === 1 && typeof first === "string" && first.length < 512 && doc === document && 6109 first.charAt(0) === "<" && !rnocache.test( first ) && 6110 (jQuery.support.checkClone || !rchecked.test( first )) && 6111 (jQuery.support.html5Clone || !rnoshimcache.test( first )) ) { 6112 6113 cacheable = true; 6114 6115 cacheresults = jQuery.fragments[ first ]; 6116 if ( cacheresults && cacheresults !== 1 ) { 6117 fragment = cacheresults; 6118 } 6119 } 6120 6121 if ( !fragment ) { 6122 fragment = doc.createDocumentFragment(); 6123 jQuery.clean( args, doc, fragment, scripts ); 6124 } 6125 6126 if ( cacheable ) {
6127 jQuery.fragments[ first ] = cacheresults ? fragment : 1; 6128 } 6129 6130 return { fragment: fragment, cacheable: cacheable }; 6131}; 6132 6133jQuery.fragments = {}; 6134 6135jQuery.each({ 6136 appendTo: "append", 6137 prependTo: "prepend", 6138 insertBefore: "before", 6139 insertAfter: "after", 6140 replaceAll: "replaceWith" 6141}, function( name, original ) { 6142 jQuery.fn[ name ] = function( selector ) { 6143 var ret = [], 6144 insert = jQuery( selector ), 6145 parent = this.length === 1 && this[0].parentNode; 6146 6147 if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) { 6148 insert[ original ]( this[0] ); 6149 return this; 6150 6151 } else { 6152 for ( var i = 0, l = insert.length; i < l; i++ ) { 6153 var elems = ( i > 0 ? this.clone(true) : this ).get(); 6154 jQuery( insert[i] )[ original ]( elems ); 6155 ret = ret.concat( elems ); 6156 } 6157 6158 return this.pushStack( ret, name, insert.selector ); 6159 } 6160 }; 6161}); 6162 6163function getAll( elem ) { 6164 if ( typeof elem.getElementsByTagName !== "undefined" ) { 6165 return elem.getElementsByTagName( "*" ); 6166 6167 } else if ( typeof elem.querySelectorAll !== "undefined" ) { 6168 return elem.querySelectorAll( "*" ); 6169 6170 } else { 6171 return []; 6172 } 6173} 6174 6175// Used in clean, fixes the defaultChecked property 6176function fixDefaultChecked( elem ) { 6177 if ( elem.type === "checkbox" || elem.type === "radio" ) { 6178 elem.defaultChecked = elem.checked; 6179 } 6180} 6181// Finds all inputs and passes them to fixDefaultChecked 6182function findInputs( elem ) { 6183 var nodeName = ( elem.nodeName || "" ).toLowerCase(); 6184 if ( nodeName === "input" ) { 6185 fixDefaultChecked( elem ); 6186 // Skip scripts, get other children 6187 } else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) { 6188 jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked ); 6189 } 6190} 6191 6192// Derived From: http://www.iecss.com/shimprove/javascript/shimprove.1-0-1.js 6193function shimCloneNode( elem ) { 6194 var div = document.createElement( "div" ); 6195 safeFragment.appendChild( div ); 6196 6197 div.innerHTML = elem.outerHTML; 6198 return div.firstChild; 6199} 6200 6201jQuery.extend({ 6202 clone: function( elem, dataAndEvents, deepDataAndEvents ) { 6203 var srcElements, 6204 destElements, 6205 i, 6206 // IE<=8 does not properly clone detached, unknown element nodes 6207 clone = jQuery.support.html5Clone || !rnoshimcache.test( "<" + elem.nodeName ) ? 6208 elem.cloneNode( true ) : 6209 shimCloneNode( elem ); 6210 6211 if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && 6212 (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { 6213 // IE copies events bound via attachEvent when using cloneNode. 6214 // Calling detachEvent on the clone will also remove the events 6215 // from the original. In order to get around this, we use some 6216 // proprietary methods to clear the events. Thanks to MooTools 6217 // guys for this hotness. 6218 6219 cloneFixAttributes( elem, clone ); 6220 6221 // Using Sizzle here is crazy slow, so we use getElementsByTagName instead 6222 srcElements = getAll( elem ); 6223 destElements = getAll( clone ); 6224 6225 // Weird iteration because IE will replace the length property 6226 // with an element if you are cloning the body and one of the 6227 // elements on the page has a name or id of "length" 6228 for ( i = 0; srcElements[i]; ++i ) { 6229 // Ensure that the destination node is not null; Fixes #9587 6230 if ( destElements[i] ) { 6231 cloneFixAttributes( srcElements[i], destElements[i] ); 6232 } 6233 } 6234 } 6235 6236 // Copy the events from the original to the clone 6237 if ( dataAndEvents ) { 6238 cloneCopyEvent( elem, clone ); 6239 6240 if ( deepDataAndEvents ) { 6241 srcElements = getAll( elem ); 6242 destElements = getAll( clone ); 6243 6244 for ( i = 0; srcElements[i]; ++i ) { 6245 cloneCopyEvent( srcElements[i], destElements[i] ); 6246 } 6247 } 6248 } 6249 6250 srcElements = destElements = null; 6251 6252 // Return the cloned set 6253 return clone; 6254 }, 6255 6256 clean: function( elems, context, fragment, scripts ) { 6257 var checkScriptType; 6258 6259 context = context || document; 6260 6261 // !context.createElement fails in IE with an error but returns typeof 'object' 6262 if ( typeof context.createElement === "undefined" ) { 6263 context = context.ownerDocument || context[0] && context[0].ownerDocument || document; 6264 } 6265 6266 var ret = [], j; 6267 6268 for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { 6269 if ( typeof elem === "number" ) { 6270 elem += ""; 6271 } 6272 6273 if ( !elem ) { 6274 continue; 6275 } 6276 6277 // Convert html string into DOM nodes 6278 if ( typeof elem === "string" ) { 6279 if ( !rhtml.test( elem ) ) { 6280 elem = context.createTextNode( elem ); 6281 } else { 6282 // Fix "XHTML"-style tags in all browsers 6283 elem = elem.replace(rxhtmlTag, "<$1></$2>"); 6284 6285 // Trim whitespace, otherwise indexOf won't work as expected 6286 var tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(), 6287 wrap = wrapMap[ tag ] || wrapMap._default, 6288 depth = wrap[0], 6289 div = context.createElement("div"); 6290 6291 // Append wrapper element to unknown element safe doc fragment 6292 if ( context === document ) { 6293 // Use the fragment we've already created for this document 6294 safeFragment.appendChild( div ); 6295 } else { 6296 // Use a fragment created with the owner document 6297 createSafeFragment( context ).appendChild( div ); 6298 } 6299 6300 // Go to html and back, then peel off extra wrappers 6301 div.innerHTML = wrap[1] + elem + wrap[2]; 6302 6303 // Move to the right depth 6304 while ( depth-- ) {
6305 div = div.lastChild; 6306 } 6307 6308 // Remove IE's autoinserted <tbody> from table fragments 6309 if ( !jQuery.support.tbody ) { 6310 6311 // String was a <table>, *may* have spurious <tbody> 6312 var hasBody = rtbody.test(elem), 6313 tbody = tag === "table" && !hasBody ? 6314 div.firstChild && div.firstChild.childNodes : 6315 6316 // String was a bare <thead> or <tfoot> 6317 wrap[1] === "<table>" && !hasBody ? 6318 div.childNodes : 6319 []; 6320 6321 for ( j = tbody.length - 1; j >= 0 ; --j ) { 6322 if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) { 6323 tbody[ j ].parentNode.removeChild( tbody[ j ] ); 6324 } 6325 } 6326 } 6327 6328 // IE completely kills leading whitespace when innerHTML is used 6329 if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { 6330 div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild ); 6331 } 6332 6333 elem = div.childNodes; 6334 } 6335 } 6336 6337 // Resets defaultChecked for any radios and checkboxes 6338 // about to be appended to the DOM in IE 6/7 (#8060) 6339 var len; 6340 if ( !jQuery.support.appendChecked ) { 6341 if ( elem[0] && typeof (len = elem.length) === "number" ) { 6342 for ( j = 0; j < len; j++ ) { 6343 findInputs( elem[j] ); 6344 } 6345 } else { 6346 findInputs( elem ); 6347 } 6348 } 6349 6350 if ( elem.nodeType ) { 6351 ret.push( elem ); 6352 } else { 6353 ret = jQuery.merge( ret, elem ); 6354 } 6355 } 6356 6357 if ( fragment ) { 6358 checkScriptType = function( elem ) { 6359 return !elem.type || rscriptType.test( elem.type ); 6360 }; 6361 for ( i = 0; ret[i]; i++ ) { 6362 if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) { 6363 scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] ); 6364 6365 } else { 6366 if ( ret[i].nodeType === 1 ) { 6367 var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType ); 6368 6369 ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) ); 6370 } 6371 fragment.appendChild( ret[i] ); 6372 } 6373 } 6374 } 6375 6376 return ret; 6377 }, 6378 6379 cleanData: function( elems ) { 6380 var data, id, 6381 cache = jQuery.cache, 6382 special = jQuery.event.special, 6383 deleteExpando = jQuery.support.deleteExpando; 6384 6385 for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { 6386 if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) { 6387 continue; 6388 } 6389 6390 id = elem[ jQuery.expando ]; 6391 6392 if ( id ) { 6393 data = cache[ id ]; 6394 6395 if ( data && data.events ) { 6396 for ( var type in data.events ) { 6397 if ( special[ type ] ) { 6398 jQuery.event.remove( elem, type ); 6399 6400 // This is a shortcut to avoid jQuery.event.remove's overhead 6401 } else { 6402 jQuery.removeEvent( elem, type, data.handle ); 6403 } 6404 } 6405 6406 // Null the DOM reference to avoid IE6/7/8 leak (#7054) 6407 if ( data.handle ) { 6408 data.handle.elem = null; 6409 } 6410 } 6411 6412 if ( deleteExpando ) { 6413 delete elem[ jQuery.expando ]; 6414 6415 } else if ( elem.removeAttribute ) { 6416 elem.removeAttribute( jQuery.expando ); 6417 } 6418 6419 delete cache[ id ]; 6420 } 6421 } 6422 } 6423}); 6424 6425function evalScript( i, elem ) { 6426 if ( elem.src ) { 6427 jQuery.ajax({ 6428 url: elem.src, 6429 async: false, 6430 dataType: "script" 6431 }); 6432 } else { 6433 jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) ); 6434 } 6435 6436 if ( elem.parentNode ) { 6437 elem.parentNode.removeChild( elem ); 6438 } 6439} 6440 6441 6442 6443 6444var ralpha = /alpha\([^)]*\)/i, 6445 ropacity = /opacity=([^)]*)/, 6446 // fixed for IE9, see #8346 6447 rupper = /([A-Z]|^ms)/g, 6448 rnumpx = /^-?\d+(?:px)?$/i, 6449 rnum = /^-?\d/, 6450 rrelNum = /^([\-+])=([\-+.\de]+)/, 6451 6452 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 6453 cssWidth = [ "Left", "Right" ], 6454 cssHeight = [ "Top", "Bottom" ], 6455 curCSS, 6456 6457 getComputedStyle, 6458 currentStyle; 6459 6460jQuery.fn.css = function( name, value ) { 6461 // Setting 'undefined' is a no-op 6462 if ( arguments.length === 2 && value === undefined ) { 6463 return this; 6464 } 6465 6466 return jQuery.access( this, name, value, true, function( elem, name, value ) { 6467 return value !== undefined ? 6468 jQuery.style( elem, name, value ) : 6469 jQuery.css( elem, name ); 6470 }); 6471}; 6472 6473jQuery.extend({ 6474 // Add in style property hooks for overriding the default 6475 // behavior of getting and setting a style property 6476 cssHooks: { 6477 opacity: { 6478 get: function( elem, computed ) { 6479 if ( computed ) { 6480 // We should always get a number back from opacity 6481 var ret = curCSS( elem, "opacity", "opacity" ); 6482 return ret === "" ? "1" : ret; 6483 6484 } else { 6485 return elem.style.opacity; 6486 } 6487 } 6488 } 6489 }, 6490 6491 // Exclude the following css properties to add px 6492 cssNumber: { 6493 "fillOpacity": true, 6494 "fontWeight": true, 6495 "lineHeight": true, 6496 "opacity": true, 6497 "orphans": true, 6498 "widows": true, 6499 "zIndex": true, 6500 "zoom": true 6501 }, 6502 6503 // Add in properties whose names you wish to fix before 6504 // setting or getting the value 6505 cssProps: { 6506 // normalize float css property 6507 "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" 6508 }, 6509 6510 // Get and set the style property on a DOM Node 6511 style: function( elem, name, value, extra ) { 6512 // Don't set styles on text and comment nodes 6513 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { 6514 return; 6515 } 6516 6517 // Make sure that we're working with the right name 6518 var ret, type, origName = jQuery.camelCase( name ), 6519 style = elem.style, hooks = jQuery.cssHooks[ origName ]; 6520 6521 name = jQuery.cssProps[ origName ] || origName; 6522 6523 // Check if we're setting a value 6524 if ( value !== undefined ) { 6525 type = typeof value; 6526 6527 // convert relative number strings (+= or -=) to relative numbers. #7345 6528 if ( type === "string" && (ret = rrelNum.exec( value )) ) { 6529 value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) ); 6530 // Fixes bug #9237 6531 type = "number"; 6532 } 6533 6534 // Make sure that NaN and null values aren't set. See: #7116 6535 if ( value == null || type === "number" && isNaN( value ) ) { 6536 return; 6537 } 6538 6539 // If a number was passed in, add 'px' to the (except for certain CSS properties) 6540 if ( type === "number" && !jQuery.cssNumber[ origName ] ) { 6541 value += "px"; 6542 } 6543 6544 // If a hook was provided, use that value, otherwise just set the specified value 6545 if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
6546 // Wrapped to prevent IE from throwing errors when 'invalid' values are provided 6547 // Fixes bug #5509 6548 try { 6549 style[ name ] = value; 6550 } catch(e) {} 6551 } 6552 6553 } else { 6554 // If a hook was provided get the non-computed value from there 6555 if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { 6556 return ret; 6557 } 6558 6559 // Otherwise just get the value from the style object 6560 return style[ name ]; 6561 } 6562 }, 6563 6564 css: function( elem, name, extra ) { 6565 var ret, hooks; 6566 6567 // Make sure that we're working with the right name 6568 name = jQuery.camelCase( name ); 6569 hooks = jQuery.cssHooks[ name ]; 6570 name = jQuery.cssProps[ name ] || name; 6571 6572 // cssFloat needs a special treatment 6573 if ( name === "cssFloat" ) { 6574 name = "float"; 6575 } 6576 6577 // If a hook was provided get the computed value from there 6578 if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) { 6579 return ret; 6580 6581 // Otherwise, if a way to get the computed value exists, use that 6582 } else if ( curCSS ) { 6583 return curCSS( elem, name ); 6584 } 6585 }, 6586 6587 // A method for quickly swapping in/out CSS properties to get correct calculations 6588 swap: function( elem, options, callback ) { 6589 var old = {}; 6590 6591 // Remember the old values, and insert the new ones 6592 for ( var name in options ) { 6593 old[ name ] = elem.style[ name ]; 6594 elem.style[ name ] = options[ name ]; 6595 } 6596 6597 callback.call( elem ); 6598 6599 // Revert the old values 6600 for ( name in options ) { 6601 elem.style[ name ] = old[ name ]; 6602 } 6603 } 6604}); 6605 6606// DEPRECATED, Use jQuery.css() instead 6607jQuery.curCSS = jQuery.css; 6608 6609jQuery.each(["height", "width"], function( i, name ) { 6610 jQuery.cssHooks[ name ] = { 6611 get: function( elem, computed, extra ) { 6612 var val; 6613 6614 if ( computed ) { 6615 if ( elem.offsetWidth !== 0 ) { 6616 return getWH( elem, name, extra ); 6617 } else { 6618 jQuery.swap( elem, cssShow, function() { 6619 val = getWH( elem, name, extra ); 6620 }); 6621 } 6622 6623 return val; 6624 } 6625 }, 6626 6627 set: function( elem, value ) { 6628 if ( rnumpx.test( value ) ) { 6629 // ignore negative width and height values #1599 6630 value = parseFloat( value ); 6631 6632 if ( value >= 0 ) { 6633 return value + "px"; 6634 } 6635 6636 } else { 6637 return value; 6638 } 6639 } 6640 }; 6641}); 6642 6643if ( !jQuery.support.opacity ) { 6644 jQuery.cssHooks.opacity = { 6645 get: function( elem, computed ) { 6646 // IE uses filters for opacity 6647 return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? 6648 ( parseFloat( RegExp.$1 ) / 100 ) + "" : 6649 computed ? "1" : ""; 6650 }, 6651 6652 set: function( elem, value ) { 6653 var style = elem.style, 6654 currentStyle = elem.currentStyle, 6655 opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", 6656 filter = currentStyle && currentStyle.filter || style.filter || ""; 6657 6658 // IE has trouble with opacity if it does not have layout 6659 // Force it by setting the zoom level 6660 style.zoom = 1; 6661 6662 // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 6663 if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) { 6664 6665 // Setting style.filter to null, "" & " " still leave "filter:" in the cssText 6666 // if "filter:" is present at all, clearType is disabled, we want to avoid this 6667 // style.removeAttribute is IE Only, but so apparently is this code path... 6668 style.removeAttribute( "filter" ); 6669 6670 // if there there is no filter style applied in a css rule, we are done 6671 if ( currentStyle && !currentStyle.filter ) { 6672 return; 6673 } 6674 } 6675 6676 // otherwise, set new filter values 6677 style.filter = ralpha.test( filter ) ? 6678 filter.replace( ralpha, opacity ) : 6679 filter + " " + opacity; 6680 } 6681 }; 6682} 6683 6684jQuery(function() { 6685 // This hook cannot be added until DOM ready because the support test 6686 // for it is not run until after DOM ready 6687 if ( !jQuery.support.reliableMarginRight ) { 6688 jQuery.cssHooks.marginRight = { 6689 get: function( elem, computed ) { 6690 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right 6691 // Work around by temporarily setting element display to inline-block 6692 var ret; 6693 jQuery.swap( elem, { "display": "inline-block" }, function() { 6694 if ( computed ) { 6695 ret = curCSS( elem, "margin-right", "marginRight" ); 6696 } else { 6697 ret = elem.style.marginRight; 6698 } 6699 }); 6700 return ret; 6701 } 6702 }; 6703 } 6704}); 6705 6706if ( document.defaultView && document.defaultView.getComputedStyle ) { 6707 getComputedStyle = function( elem, name ) { 6708 var ret, defaultView, computedStyle; 6709 6710 name = name.replace( rupper, "-$1" ).toLowerCase(); 6711 6712 if ( (defaultView = elem.ownerDocument.defaultView) && 6713 (computedStyle = defaultView.getComputedStyle( elem, null )) ) { 6714 ret = computedStyle.getPropertyValue( name ); 6715 if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) { 6716 ret = jQuery.style( elem, name ); 6717 } 6718 } 6719 6720 return ret; 6721 }; 6722} 6723 6724if ( document.documentElement.currentStyle ) { 6725 currentStyle = function( elem, name ) { 6726 var left, rsLeft, uncomputed, 6727 ret = elem.currentStyle && elem.currentStyle[ name ], 6728 style = elem.style; 6729 6730 // Avoid setting ret to empty string here 6731 // so we don't default to auto 6732 if ( ret === null && style && (uncomputed = style[ name ]) ) { 6733 ret = uncomputed; 6734 } 6735 6736 // From the awesome hack by Dean Edwards 6737 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 6738 6739 // If we're not dealing with a regular pixel number 6740 // but a number that has a weird ending, we need to convert it to pixels 6741 if ( !rnumpx.test( ret ) && rnum.test( ret ) ) { 6742 6743 // Remember the original values 6744 left = style.left; 6745 rsLeft = elem.runtimeStyle && elem.runtimeStyle.left; 6746 6747 // Put in the new values to get a computed value out 6748 if ( rsLeft ) { 6749 elem.runtimeStyle.left = elem.currentStyle.left; 6750 } 6751 style.left = name === "fontSize" ? "1em" : ( ret || 0 ); 6752 ret = style.pixelLeft + "px"; 6753 6754 // Revert the changed values 6755 style.left = left; 6756 if ( rsLeft ) { 6757 elem.runtimeStyle.left = rsLeft; 6758 } 6759 } 6760 6761 return ret === "" ? "auto" : ret; 6762 }; 6763} 6764 6765curCSS = getComputedStyle || currentStyle; 6766 6767function getWH( elem, name, extra ) { 6768 6769 // Start with offset property 6770 var val = name === "width" ? elem.offsetWidth : elem.offsetHeight, 6771 which = name === "width" ? cssWidth : cssHeight, 6772 i = 0, 6773 len = which.length; 6774 6775 if ( val > 0 ) { 6776 if ( extra !== "border" ) { 6777 for ( ; i < len; i++ ) { 6778 if ( !extra ) { 6779 val -= parseFloat( jQuery.css( elem, "padding" + which[ i ] ) ) || 0; 6780 } 6781 if ( extra === "margin" ) { 6782 val += parseFloat( jQuery.css( elem, extra + which[ i ] ) ) || 0; 6783 } else { 6784 val -= parseFloat( jQuery.css( elem, "border" + which[ i ] + "Width" ) ) || 0; 6785 } 6786 } 6787 } 6788 6789 return val + "px"; 6790 } 6791 6792 // Fall back to computed then uncomputed css if necessary 6793 val = curCSS( elem, name, name ); 6794 if ( val < 0 || val == null ) { 6795 val = elem.style[ name ] || 0; 6796 } 6797 // Normalize "", auto, and prepare for extra 6798 val = parseFloat( val ) || 0; 6799 6800 // Add padding, border, margin 6801 if ( extra ) { 6802 for ( ; i < len; i++ ) { 6803 val += parseFloat( jQuery.css( elem, "padding" + which[ i ] ) ) || 0; 6804 if ( extra !== "padding" ) { 6805 val += parseFloat( jQuery.css( elem, "border" + which[ i ] + "Width" ) ) || 0; 6806 } 6807 if ( extra === "margin" ) { 6808 val += parseFloat( jQuery.css( elem, extra + which[ i ] ) ) || 0; 6809 } 6810 } 6811 } 6812 6813 return val + "px"; 6814} 6815 6816if ( jQuery.expr && jQuery.expr.filters ) { 6817 jQuery.expr.filters.hidden = function( elem ) { 6818 var width = elem.offsetWidth, 6819 height = elem.offsetHeight; 6820 6821 return ( width === 0 && height === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "dis
6821play" )) === "none"); 6822 }; 6823 6824 jQuery.expr.filters.visible = function( elem ) { 6825 return !jQuery.expr.filters.hidden( elem ); 6826 }; 6827} 6828 6829 6830 6831 6832var r20 = /%20/g, 6833 rbracket = /\[\]$/, 6834 rCRLF = /\r?\n/g, 6835 rhash = /#.*$/, 6836 rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL 6837 rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, 6838 // #7653, #8125, #8152: local protocol detection 6839 rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/, 6840 rnoContent = /^(?:GET|HEAD)$/, 6841 rprotocol = /^\/\//, 6842 rquery = /\?/, 6843 rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, 6844 rselectTextarea = /^(?:select|textarea)/i, 6845 rspacesAjax = /\s+/, 6846 rts = /([?&])_=[^&]*/, 6847 rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/, 6848 6849 // Keep a copy of the old load method 6850 _load = jQuery.fn.load, 6851 6852 /* Prefilters 6853 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) 6854 * 2) These are called: 6855 * - BEFORE asking for a transport 6856 * - AFTER param serialization (s.data is a string if s.processData is true) 6857 * 3) key is the dataType 6858 * 4) the catchall symbol "*" can be used 6859 * 5) execution will start with transport dataType and THEN continue down to "*" if needed 6860 */ 6861 prefilters = {}, 6862 6863 /* Transports bindings 6864 * 1) key is the dataType 6865 * 2) the catchall symbol "*" can be used 6866 * 3) selection will start with transport dataType and THEN go to "*" if needed 6867 */ 6868 transports = {}, 6869 6870 // Document location 6871 ajaxLocation, 6872 6873 // Document location segments 6874 ajaxLocParts, 6875 6876 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression 6877 allTypes = ["*/"] + ["*"]; 6878 6879// #8138, IE may throw an exception when accessing 6880// a field from window.location if document.domain has been set 6881try { 6882 ajaxLocation = location.href; 6883} catch( e ) { 6884 // Use the href attribute of an A element 6885 // since IE will modify it given document.location 6886 ajaxLocation = document.createElement( "a" ); 6887 ajaxLocation.href = ""; 6888 ajaxLocation = ajaxLocation.href; 6889} 6890 6891// Segment location into parts 6892ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; 6893 6894// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport 6895function addToPrefiltersOrTransports( structure ) { 6896 6897 // dataTypeExpression is optional and defaults to "*" 6898 return function( dataTypeExpression, func ) { 6899 6900 if ( typeof dataTypeExpression !== "string" ) { 6901 func = dataTypeExpression; 6902 dataTypeExpression = "*"; 6903 } 6904 6905 if ( jQuery.isFunction( func ) ) { 6906 var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ), 6907 i = 0, 6908 length = dataTypes.length, 6909 dataType, 6910 list, 6911 placeBefore; 6912 6913 // For each dataType in the dataTypeExpression 6914 for ( ; i < length; i++ ) { 6915 dataType = dataTypes[ i ]; 6916 // We control if we're asked to add before 6917 // any existing element 6918 placeBefore = /^\+/.test( dataType ); 6919 if ( placeBefore ) { 6920 dataType = dataType.substr( 1 ) || "*"; 6921 } 6922 list = structure[ dataType ] = structure[ dataType ] || []; 6923 // then we add to the structure accordingly 6924 list[ placeBefore ? "unshift" : "push" ]( func ); 6925 } 6926 } 6927 }; 6928} 6929 6930// Base inspection function for prefilters and transports 6931function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR, 6932 dataType /* internal */, inspected /* internal */ ) { 6933 6934 dataType = dataType || options.dataTypes[ 0 ]; 6935 inspected = inspected || {}; 6936 6937 inspected[ dataType ] = true; 6938 6939 var list = structure[ dataType ], 6940 i = 0, 6941 length = list ? list.length : 0, 6942 executeOnly = ( structure === prefilters ), 6943 selection; 6944 6945 for ( ; i < length && ( executeOnly || !selection ); i++ ) { 6946 selection = list[ i ]( options, originalOptions, jqXHR ); 6947 // If we got redirected to another dataType 6948 // we try there if executing only and not done already 6949 if ( typeof selection === "string" ) { 6950 if ( !executeOnly || inspected[ selection ] ) { 6951 selection = undefined; 6952 } else { 6953 options.dataTypes.unshift( selection ); 6954 selection = inspectPrefiltersOrTransports( 6955 structure, options, originalOptions, jqXHR, selection, inspected ); 6956 } 6957 } 6958 } 6959 // If we're only executing or nothing was selected 6960 // we try the catchall dataType if not done already 6961 if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) { 6962 selection = inspectPrefiltersOrTransports( 6963 structure, options, originalOptions, jqXHR, "*", inspected ); 6964 } 6965 // unnecessary when only executing (prefilters) 6966 // but it'll be ignored by the caller in that case 6967 return selection; 6968} 6969 6970// A special extend for ajax options 6971// that takes "flat" options (not to be deep extended) 6972// Fixes #9887 6973function ajaxExtend( target, src ) { 6974 var key, deep, 6975 flatOptions = jQuery.ajaxSettings.flatOptions || {}; 6976 for ( key in src ) { 6977 if ( src[ key ] !== undefined ) { 6978 ( flatOptions[ key ] ? target : ( deep || ( deep = {}
vendor: 12,773 bytes, lines 6978-7475
6978 ) ) )[ key ] = src[ key ]; 6979 } 6980 } 6981 if ( deep ) { 6982 jQuery.extend( true, target, deep ); 6983 } 6984} 6985 6986jQuery.fn.extend({ 6987 load: function( url, params, callback ) { 6988 if ( typeof url !== "string" && _load ) { 6989 return _load.apply( this, arguments ); 6990 6991 // Don't do a request if no elements are being requested 6992 } else if ( !this.length ) { 6993 return this; 6994 } 6995 6996 var off = url.indexOf( " " ); 6997 if ( off >= 0 ) { 6998 var selector = url.slice( off, url.length ); 6999 url = url.slice( 0, off ); 7000 } 7001 7002 // Default to a GET request 7003 var type = "GET"; 7004 7005 // If the second parameter was provided 7006 if ( params ) { 7007 // If it's a function 7008 if ( jQuery.isFunction( params ) ) { 7009 // We assume that it's the callback 7010 callback = params; 7011 params = undefined; 7012 7013 // Otherwise, build a param string 7014 } else if ( typeof params === "object" ) { 7015 params = jQuery.param( params, jQuery.ajaxSettings.traditional ); 7016 type = "POST"; 7017 } 7018 } 7019 7020 var self = this; 7021 7022 // Request the remote document 7023 jQuery.ajax({ 7024 url: url, 7025 type: type, 7026 dataType: "html", 7027 data: params, 7028 // Complete callback (responseText is used internally) 7029 complete: function( jqXHR, status, responseText ) { 7030 // Store the response as specified by the jqXHR object 7031 responseText = jqXHR.responseText; 7032 // If successful, inject the HTML into all the matched elements 7033 if ( jqXHR.isResolved() ) { 7034 // #4825: Get the actual response in case 7035 // a dataFilter is present in ajaxSettings 7036 jqXHR.done(function( r ) { 7037 responseText = r; 7038 }); 7039 // See if a selector was specified 7040 self.html( selector ? 7041 // Create a dummy div to hold the results 7042 jQuery("<div>") 7043 // inject the contents of the document in, removing the scripts 7044 // to avoid any 'Permission Denied' errors in IE 7045 .append(responseText.replace(rscript, "")) 7046 7047 // Locate the specified elements 7048 .find(selector) : 7049 7050 // If not, just inject the full result 7051 responseText ); 7052 } 7053 7054 if ( callback ) { 7055 self.each( callback, [ responseText, status, jqXHR ] ); 7056 } 7057 } 7058 }); 7059 7060 return this; 7061 }, 7062 7063 serialize: function() { 7064 return jQuery.param( this.serializeArray() ); 7065 }, 7066 7067 serializeArray: function() { 7068 return this.map(function(){ 7069 return this.elements ? jQuery.makeArray( this.elements ) : this; 7070 }) 7071 .filter(function(){ 7072 return this.name && !this.disabled && 7073 ( this.checked || rselectTextarea.test( this.nodeName ) || 7074 rinput.test( this.type ) ); 7075 }) 7076 .map(function( i, elem ){ 7077 var val = jQuery( this ).val(); 7078 7079 return val == null ? 7080 null : 7081 jQuery.isArray( val ) ? 7082 jQuery.map( val, function( val, i ){ 7083 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 7084 }) : 7085 { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 7086 }).get(); 7087 } 7088}); 7089 7090// Attach a bunch of functions for handling common AJAX events 7091jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){ 7092 jQuery.fn[ o ] = function( f ){ 7093 return this.on( o, f ); 7094 }; 7095}); 7096 7097jQuery.each( [ "get", "post" ], function( i, method ) { 7098 jQuery[ method ] = function( url, data, callback, type ) { 7099 // shift arguments if data argument was omitted 7100 if ( jQuery.isFunction( data ) ) { 7101 type = type || callback; 7102 callback = data; 7103 data = undefined; 7104 } 7105 7106 return jQuery.ajax({ 7107 type: method, 7108 url: url, 7109 data: data, 7110 success: callback, 7111 dataType: type 7112 }); 7113 }; 7114}); 7115 7116jQuery.extend({ 7117 7118 getScript: function( url, callback ) { 7119 return jQuery.get( url, undefined, callback, "script" ); 7120 }, 7121 7122 getJSON: function( url, data, callback ) { 7123 return jQuery.get( url, data, callback, "json" ); 7124 }, 7125 7126 // Creates a full fledged settings object into target 7127 // with both ajaxSettings and settings fields. 7128 // If target is omitted, writes into ajaxSettings. 7129 ajaxSetup: function( target, settings ) { 7130 if ( settings ) { 7131 // Building a settings object 7132 ajaxExtend( target, jQuery.ajaxSettings ); 7133 } else { 7134 // Extending ajaxSettings 7135 settings = target; 7136 target = jQuery.ajaxSettings; 7137 } 7138 ajaxExtend( target, settings ); 7139 return target; 7140 }, 7141 7142 ajaxSettings: { 7143 url: ajaxLocation, 7144 isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), 7145 global: true, 7146 type: "GET", 7147 contentType: "application/x-www-form-urlencoded", 7148 processData: true, 7149 async: true, 7150 /* 7151 timeout: 0, 7152 data: null, 7153 dataType: null, 7154 username: null, 7155 password: null, 7156 cache: null, 7157 traditional: false, 7158 headers: {}, 7159 */ 7160 7161 accepts: { 7162 xml: "application/xml, text/xml", 7163 html: "text/html", 7164 text: "text/plain", 7165 json: "application/json, text/javascript", 7166 "*": allTypes 7167 }, 7168 7169 contents: { 7170 xml: /xml/, 7171 html: /html/, 7172 json: /json/ 7173 }, 7174 7175 responseFields: { 7176 xml: "responseXML", 7177 text: "responseText" 7178 }, 7179 7180 // List of data converters 7181 // 1) key format is "source_type destination_type" (a single space in-between) 7182 // 2) the catchall symbol "*" can be used for source_type 7183 converters: { 7184 7185 // Convert anything to text 7186 "* text": window.String, 7187 7188 // Text to html (true = no transformation) 7189 "text html": true, 7190 7191 // Evaluate text as a json expression 7192 "text json": jQuery.parseJSON, 7193 7194 // Parse text as xml 7195 "text xml": jQuery.parseXML 7196 }, 7197 7198 // For options that shouldn't be deep extended: 7199 // you can add your own custom options here if 7200 // and when you create one that shouldn't be 7201 // deep extended (see ajaxExtend) 7202 flatOptions: { 7203 context: true, 7204 url: true 7205 } 7206 }, 7207 7208 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), 7209 ajaxTransport: addToPrefiltersOrTransports( transports ), 7210 7211 // Main method 7212 ajax: function( url, options ) { 7213 7214 // If url is an object, simulate pre-1.5 signature 7215 if ( typeof url === "object" ) { 7216 options = url; 7217 url = undefined; 7218 } 7219 7220 // Force options to be an object 7221 options = options || {}; 7222 7223 var // Create the final options object 7224 s = jQuery.ajaxSetup( {}, options ), 7225 // Callbacks context 7226 callbackContext = s.context || s, 7227 // Context for global events 7228 // It's the callbackContext if one was provided in the options 7229 // and if it's a DOM node or a jQuery collection 7230 globalEventContext = callbackContext !== s && 7231 ( callbackContext.nodeType || callbackContext instanceof jQuery ) ? 7232 jQuery( callbackContext ) : jQuery.event, 7233 // Deferreds 7234 deferred = jQuery.Deferred(), 7235 completeDeferred = jQuery.Callbacks( "once memory" ), 7236 // Status-dependent callbacks 7237 statusCode = s.statusCode || {}, 7238 // ifModified key 7239 ifModifiedKey, 7240 // Headers (they are sent all at once) 7241 requestHeaders = {}, 7242 requestHeadersNames = {}, 7243 // Response headers 7244 responseHeadersString, 7245 responseHeaders, 7246 // transport 7247 transport, 7248 // timeout handle 7249 timeoutTimer, 7250 // Cross-domain detection vars 7251 parts, 7252 // The jqXHR state 7253 state = 0, 7254 // To know if global events are to be dispatched 7255 fireGlobals, 7256 // Loop variable 7257 i, 7258 // Fake xhr 7259 jqXHR = { 7260 7261 readyState: 0, 7262 7263 // Caches the header 7264 setRequestHeader: function( name, value ) { 7265 if ( !state ) { 7266 var lname = name.toLowerCase(); 7267 name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; 7268 requestHeaders[ name ] = value; 7269 } 7270 return this; 7271 }, 7272 7273 // Raw string 7274 getAllResponseHeaders: function() { 7275 return state === 2 ? responseHeadersString : null; 7276 }, 7277 7278 // Builds headers hashtable if needed 7279 getResponseHeader: function( key ) { 7280 var match; 7281 if ( state === 2 ) { 7282 if ( !responseHeaders ) { 7283 responseHeaders = {}; 7284 while( ( match = rheaders.exec( responseHeadersString ) ) ) { 7285 responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; 7286 } 7287 } 7288 match = responseHeaders[ key.toLowerCase() ]; 7289 } 7290 return match === undefined ? null : match; 7291 }, 7292 7293 // Overrides response content-type header 7294 overrideMimeType: function( type ) { 7295 if ( !state ) { 7296 s.mimeType = type; 7297 } 7298 return this; 7299 }, 7300 7301 // Cancel the request 7302 abort: function( statusText ) { 7303 statusText = statusText || "abort"; 7304 if ( transport ) { 7305 transport.abort( statusText ); 7306 } 7307 done( 0, statusText ); 7308 return this; 7309 } 7310 }; 7311 7312 // Callback for when everything is done 7313 // It is defined here because jslint complains if it is declared 7314 // at the end of the function (which would be more logical and readable) 7315 function done( status, nativeStatusText, responses, headers ) { 7316 7317 // Called once 7318 if ( state === 2 ) { 7319 return; 7320 } 7321 7322 // State is "done" now 7323 state = 2; 7324 7325 // Clear timeout if it exists 7326 if ( timeoutTimer ) { 7327 clearTimeout( timeoutTimer ); 7328 } 7329 7330 // Dereference transport for early garbage collection 7331 // (no matter how long the jqXHR object will be used) 7332 transport = undefined; 7333 7334 // Cache response headers 7335 responseHeadersString = headers || ""; 7336 7337 // Set readyState 7338 jqXHR.readyState = status > 0 ? 4 : 0; 7339 7340 var isSuccess, 7341 success, 7342 error, 7343 statusText = nativeStatusText, 7344 response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined, 7345 lastModified, 7346 etag; 7347 7348 // If successful, handle type chaining 7349 if ( status >= 200 && status < 300 || status === 304 ) { 7350 7351 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 7352 if ( s.ifModified ) { 7353 7354 if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) { 7355 jQuery.lastModified[ ifModifiedKey ] = lastModified; 7356 } 7357 if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) { 7358 jQuery.etag[ ifModifiedKey ] = etag; 7359 } 7360 } 7361 7362 // If not modified 7363 if ( status === 304 ) { 7364 7365 statusText = "notmodified"; 7366 isSuccess = true; 7367 7368 // If we have data 7369 } else { 7370 7371 try { 7372 success = ajaxConvert( s, response ); 7373 statusText = "success"; 7374 isSuccess = true; 7375 } catch(e) { 7376 // We have a parsererror 7377 statusText = "parsererror"; 7378 error = e; 7379 } 7380 } 7381 } else { 7382 // We extract error from statusText 7383 // then normalize statusText and status for non-aborts 7384 error = statusText; 7385 if ( !statusText || status ) { 7386 statusText = "error"; 7387 if ( status < 0 ) { 7388 status = 0; 7389 } 7390 } 7391 } 7392 7393 // Set data for the fake xhr object 7394 jqXHR.status = status; 7395 jqXHR.statusText = "" + ( nativeStatusText || statusText ); 7396 7397 // Success/Error 7398 if ( isSuccess ) { 7399 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); 7400 } else { 7401 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); 7402 } 7403 7404 // Status-dependent callbacks 7405 jqXHR.statusCode( statusCode ); 7406 statusCode = undefined; 7407 7408 if ( fireGlobals ) { 7409 globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ), 7410 [ jqXHR, s, isSuccess ? success : error ] ); 7411 } 7412 7413 // Complete 7414 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); 7415 7416 if ( fireGlobals ) { 7417 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); 7418 // Handle the global AJAX counter 7419 if ( !( --jQuery.active ) ) { 7420 jQuery.event.trigger( "ajaxStop" ); 7421 } 7422 } 7423 } 7424 7425 // Attach deferreds 7426 deferred.promise( jqXHR ); 7427 jqXHR.success = jqXHR.done; 7428 jqXHR.error = jqXHR.fail; 7429 jqXHR.complete = completeDeferred.add; 7430 7431 // Status-dependent callbacks 7432 jqXHR.statusCode = function( map ) { 7433 if ( map ) { 7434 var tmp; 7435 if ( state < 2 ) { 7436 for ( tmp in map ) { 7437 statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ]; 7438 } 7439 } else { 7440 tmp = map[ jqXHR.status ]; 7441 jqXHR.then( tmp, tmp ); 7442 } 7443 } 7444 return this; 7445 }; 7446 7447 // Remove hash character (#7531: and string promotion) 7448 // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) 7449 // We also use the url parameter if available 7450 s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); 7451 7452 // Extract dataTypes list 7453 s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax ); 7454 7455 // Determine if a cross-domain request is in order 7456 if ( s.crossDomain == null ) { 7457 parts = rurl.exec( s.url.toLowerCase() ); 7458 s.crossDomain = !!( parts && 7459 ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] || 7460 ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) != 7461 ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) ) 7462 ); 7463 } 7464 7465 // Convert data if not already a string 7466 if ( s.data && s.processData && typeof s.data !== "string" ) { 7467 s.data = jQuery.param( s.data, s.traditional ); 7468 } 7469 7470 // Apply prefilters 7471 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); 7472 7473 // If request was aborted inside a prefiler, stop there 7474 if ( state === 2 ) { 7475 return false;
7476 } 7477 7478 // We can fire global events as of now if asked to 7479 fireGlobals = s.global; 7480 7481 // Uppercase the type 7482 s.type = s.type.toUpperCase(); 7483 7484 // Determine if request has content 7485 s.hasContent = !rnoContent.test( s.type ); 7486 7487 // Watch for a new set of requests 7488 if ( fireGlobals && jQuery.active++ === 0 ) { 7489 jQuery.event.trigger( "ajaxStart" ); 7490 } 7491 7492 // More options handling for requests with no content 7493 if ( !s.hasContent ) { 7494 7495 // If data is available, append data to url 7496 if ( s.data ) { 7497 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data; 7498 // #9682: remove data so that it's not used in an eventual retry 7499 delete s.data; 7500 } 7501 7502 // Get ifModifiedKey before adding the anti-cache parameter 7503 ifModifiedKey = s.url; 7504 7505 // Add anti-cache in url if needed 7506 if ( s.cache === false ) { 7507 7508 var ts = jQuery.now(), 7509 // try replacing _= if it is there 7510 ret = s.url.replace( rts, "$1_=" + ts ); 7511 7512 // if nothing was replaced, add timestamp to the end 7513 s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" ); 7514 } 7515 } 7516 7517 // Set the correct header, if data is being sent 7518 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { 7519 jqXHR.setRequestHeader( "Content-Type", s.contentType ); 7520 } 7521 7522 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 7523 if ( s.ifModified ) { 7524 ifModifiedKey = ifModifiedKey || s.url; 7525 if ( jQuery.lastModified[ ifModifiedKey ] ) { 7526 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] ); 7527 } 7528 if ( jQuery.etag[ ifModifiedKey ] ) { 7529 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] ); 7530 } 7531 } 7532 7533 // Set the Accepts header for the server, depending on the dataType 7534 jqXHR.setRequestHeader( 7535 "Accept", 7536 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? 7537 s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : 7538 s.accepts[ "*" ] 7539 ); 7540 7541 // Check for headers option 7542 for ( i in s.headers ) { 7543 jqXHR.setRequestHeader( i, s.headers[ i ] ); 7544 } 7545 7546 // Allow custom headers/mimetypes and early abort 7547 if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { 7548 // Abort if not done already 7549 jqXHR.abort(); 7550 return false; 7551 7552 } 7553 7554 // Install callbacks on deferreds 7555 for ( i in { success: 1, error: 1, complete: 1 } ) { 7556 jqXHR[ i ]( s[ i ] ); 7557 } 7558 7559 // Get transport 7560 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); 7561 7562 // If no transport, we auto-abort 7563 if ( !transport ) { 7564 done( -1, "No Transport" ); 7565 } else { 7566 jqXHR.readyState = 1; 7567 // Send global event 7568 if ( fireGlobals ) { 7569 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); 7570 } 7571 // Timeout 7572 if ( s.async && s.timeout > 0 ) { 7573 timeoutTimer = setTimeout( function(){ 7574 jqXHR.abort( "timeout" ); 7575 }, s.timeout ); 7576 } 7577 7578 try { 7579 state = 1; 7580 transport.send( requestHeaders, done ); 7581 } catch (e) { 7582 // Propagate exception as error if not done 7583 if ( state < 2 ) { 7584 done( -1, e ); 7585 // Simply rethrow otherwise 7586 } else { 7587 throw e; 7588 } 7589 } 7590 } 7591 7592 return jqXHR; 7593 }, 7594 7595 // Serialize an array of form elements or a set of 7596 // key/values into a query string 7597 param: function( a, traditional ) { 7598 var s = [], 7599 add = function( key, value ) { 7600 // If value is a function, invoke it and return its value 7601 value = jQuery.isFunction( value ) ? value() : value; 7602 s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); 7603 }; 7604 7605 // Set traditional to true for jQuery <= 1.3.2 behavior. 7606 if ( traditional === undefined ) { 7607 traditional = jQuery.ajaxSettings.traditional; 7608 } 7609 7610 // If an array was passed in, assume that it is an array of form elements. 7611 if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { 7612 // Serialize the form elements 7613 jQuery.each( a, function() { 7614 add( this.name, this.value ); 7615 }); 7616 7617 } else { 7618 // If traditional, encode the "old" way (the way 1.3.2 or older 7619 // did it), otherwise encode params recursively. 7620 for ( var prefix in a ) { 7621 buildParams( prefix, a[ prefix ], traditional, add ); 7622 } 7623 } 7624 7625 // Return the resulting serialization 7626 return s.join( "&" ).replace( r20, "+" ); 7627 } 7628}); 7629 7630function buildParams( prefix, obj, traditional, add ) { 7631 if ( jQuery.isArray( obj ) ) { 7632 // Serialize array item. 7633 jQuery.each( obj, function( i, v ) { 7634 if ( traditional || rbracket.test( prefix ) ) { 7635 // Treat each array item as a scalar. 7636 add( prefix, v ); 7637 7638 } else { 7639 // If array item is non-scalar (array or object), encode its 7640 // numeric index to resolve deserialization ambiguity issues. 7641 // Note that rack (as of 1.0.0) can't currently deserialize 7642 // nested arrays properly, and attempting to do so may cause 7643 // a server error. Possible fixes are to modify rack's 7644 // deserialization algorithm or to provide an option or flag 7645 // to force array serialization to be shallow. 7646 buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add ); 7647 } 7648 }); 7649 7650 } else if ( !traditional && obj != null && typeof obj === "object" ) { 7651 // Serialize object item. 7652 for ( var name in obj ) { 7653 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); 7654 } 7655 7656 } else { 7657 // Serialize scalar item. 7658 add( prefix, obj ); 7659 } 7660} 7661 7662// This is still on the jQuery object... for now 7663// Want to move this to jQuery.ajax some day 7664jQuery.extend({ 7665 7666 // Counter for holding the number of active queries 7667 active: 0, 7668 7669 // Last-Modified header cache for next request 7670 lastModified: {}, 7671 etag: {} 7672 7673}
7673); 7674 7675/* Handles responses to an ajax request: 7676 * - sets all responseXXX fields accordingly 7677 * - finds the right dataType (mediates between content-type and expected dataType) 7678 * - returns the corresponding response 7679 */ 7680function ajaxHandleResponses( s, jqXHR, responses ) { 7681 7682 var contents = s.contents, 7683 dataTypes = s.dataTypes, 7684 responseFields = s.responseFields, 7685 ct, 7686 type, 7687 finalDataType, 7688 firstDataType; 7689 7690 // Fill responseXXX fields 7691 for ( type in responseFields ) { 7692 if ( type in responses ) { 7693 jqXHR[ responseFields[type] ] = responses[ type ]; 7694 } 7695 } 7696 7697 // Remove auto dataType and get content-type in the process 7698 while( dataTypes[ 0 ] === "*" ) { 7699 dataTypes.shift(); 7700 if ( ct === undefined ) { 7701 ct = s.mimeType || jqXHR.getResponseHeader( "content-type" ); 7702 } 7703 } 7704 7705 // Check if we're dealing with a known content-type 7706 if ( ct ) { 7707 for ( type in contents ) { 7708 if ( contents[ type ] && contents[ type ].test( ct ) ) { 7709 dataTypes.unshift( type ); 7710 break; 7711 } 7712 } 7713 } 7714 7715 // Check to see if we have a response for the expected dataType 7716 if ( dataTypes[ 0 ] in responses ) { 7717 finalDataType = dataTypes[ 0 ]; 7718 } else { 7719 // Try convertible dataTypes 7720 for ( type in responses ) { 7721 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { 7722 finalDataType = type; 7723 break; 7724 } 7725 if ( !firstDataType ) { 7726 firstDataType = type; 7727 } 7728 } 7729 // Or just use first one 7730 finalDataType = finalDataType || firstDataType; 7731 } 7732 7733 // If we found a dataType 7734 // We add the dataType to the list if needed 7735 // and return the corresponding response 7736 if ( finalDataType ) { 7737 if ( finalDataType !== dataTypes[ 0 ] ) { 7738 dataTypes.unshift( finalDataType ); 7739 } 7740 return responses[ finalDataType ]; 7741 } 7742} 7743 7744// Chain conversions given the request and the original response 7745function ajaxConvert( s, response ) { 7746 7747 // Apply the dataFilter if provided 7748 if ( s.dataFilter ) { 7749 response = s.dataFilter( response, s.dataType ); 7750 } 7751 7752 var dataTypes = s.dataTypes, 7753 converters = {}, 7754 i, 7755 key, 7756 length = dataTypes.length, 7757 tmp, 7758 // Current and previous dataTypes 7759 current = dataTypes[ 0 ], 7760 prev, 7761 // Conversion expression 7762 conversion, 7763 // Conversion function 7764 conv, 7765 // Conversion functions (transitive conversion) 7766 conv1, 7767 conv2; 7768 7769 // For each dataType in the chain 7770 for ( i = 1; i < length; i++ ) { 7771 7772 // Create converters map 7773 // with lowercased keys 7774 if ( i === 1 ) { 7775 for ( key in s.converters ) { 7776 if ( typeof key === "string" ) { 7777 converters[ key.toLowerCase() ] = s.converters[ key ]; 7778 } 7779 } 7780 } 7781 7782 // Get the dataTypes 7783 prev = current; 7784 current = dataTypes[ i ]; 7785 7786 // If current is auto dataType, update it to prev 7787 if ( current === "*" ) { 7788 current = prev; 7789 // If no auto and dataTypes are actually different 7790 } else if ( prev !== "*" && prev !== current ) { 7791 7792 // Get the converter 7793 conversion = prev + " " + current; 7794 conv = converters[ conversion ] || converters[ "* " + current ]; 7795 7796 // If there is no direct converter, search transitively 7797 if ( !conv ) { 7798 conv2 = undefined; 7799 for ( conv1 in converters ) { 7800 tmp = conv1.split( " " ); 7801 if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) { 7802 conv2 = converters[ tmp[1] + " " + current ]; 7803 if ( conv2 ) { 7804 conv1 = converters[ conv1 ]; 7805 if ( conv1 === true ) { 7806 conv = conv2; 7807 } else if ( conv2 === true ) { 7808 conv = conv1; 7809 } 7810 break; 7811 } 7812 } 7813 } 7814 } 7815 // If we found no converter, dispatch an error 7816 if ( !( conv || conv2 ) ) { 7817 jQuery.error( "No conversion from " + conversion.replace(" "," to ") ); 7818 } 7819 // If found converter is not an equivalence 7820 if ( conv !== true ) { 7821 // Convert with 1 or 2 converters accordingly 7822 response = conv ? conv( response ) : conv2( conv1(response) ); 7823 } 7824 } 7825 } 7826 return response; 7827} 7828 7829 7830 7831 7832var jsc = jQuery.now(), 7833 jsre = /(\=)\?(&|$)|\?\?/i; 7834 7835// Default jsonp settings 7836jQuery.ajaxSetup({ 7837 jsonp: "callback", 7838 jsonpCallback: function() { 7839 return jQuery.expando + "_" + ( jsc++ ); 7840 } 7841}); 7842 7843// Detect, normalize options and install callbacks for jsonp requests 7844jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 7845 7846 var inspectData = s.contentType === "application/x-www-form-urlencoded" && 7847 ( typeof s.data === "string" ); 7848 7849 if ( s.dataTypes[ 0 ] === "jsonp" || 7850 s.jsonp !== false && ( jsre.test( s.url ) || 7851 inspectData && jsre.test( s.data ) ) ) { 7852 7853 var responseContainer, 7854 jsonpCallback = s.jsonpCallback = 7855 jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback, 7856 previous = window[ jsonpCallback ], 7857 url = s.url, 7858 data = s.data, 7859 replace = "$1" + jsonpCallback + "$2"; 7860 7861 if ( s.jsonp !== false ) { 7862 url = url.replace( jsre, replace ); 7863 if ( s.url === url ) { 7864 if ( inspectData ) { 7865 data = data.replace( jsre, replace ); 7866 } 7867 if ( s.data === data ) { 7868 // Add callback manually 7869 url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback; 7870 } 7871 } 7872 } 7873 7874 s.url = url; 7875 s.data = data; 7876 7877 // Install callback 7878 window[ jsonpCallback ] = function( response ) { 7879 responseContainer = [ response ]; 7880 }; 7881 7882 // Clean-up function 7883 jqXHR.always(function() { 7884 // Set callback back to previous value 7885 window[ jsonpCallback ] = previous; 7886 // Call if it was a function and we have a response 7887 if ( responseContainer && jQuery.isFunction( previous ) ) { 7888 window[ jsonpCallback ]( responseContainer[ 0 ] ); 7889 } 7890 }); 7891 7892 // Use data converter to retrieve json after script execution 7893 s.converters["script json"] = function() { 7894 if ( !responseContainer ) { 7895 jQuery.error( jsonpCallback + " was not called" ); 7896 } 7897 return responseContainer[ 0 ]; 7898 }; 7899 7900 // force json dataType 7901 s.dataTypes[ 0 ] = "json"; 7902 7903 // Delegate to script 7904 return "script"; 7905 } 7906}); 7907 7908 7909 7910 7911// Install script dataType 7912jQuery.ajaxSetup({ 7913 accepts: { 7914 script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" 7915 }, 7916 contents: { 7917 script: /javascript|ecmascript/ 7918 }, 7919 converters: { 7920 "text script": function( text ) { 7921 jQuery.globalEval( text ); 7922 return text; 7923 } 7924 } 7925}); 7926 7927// Handle cache's special case and global 7928jQuery.ajaxPrefilter( "script", function( s ) { 7929 if ( s.cache === undefined ) { 7930 s.cache = false;
vendor: 3,904 bytes, lines 7931-8086
7931 } 7932 if ( s.crossDomain ) { 7933 s.type = "GET"; 7934 s.global = false; 7935 } 7936}); 7937 7938// Bind script tag hack transport 7939jQuery.ajaxTransport( "script", function(s) { 7940 7941 // This transport only deals with cross domain requests 7942 if ( s.crossDomain ) { 7943 7944 var script, 7945 head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement; 7946 7947 return { 7948 7949 send: function( _, callback ) { 7950 7951 script = document.createElement( "script" ); 7952 7953 script.async = "async"; 7954 7955 if ( s.scriptCharset ) { 7956 script.charset = s.scriptCharset; 7957 } 7958 7959 script.src = s.url; 7960 7961 // Attach handlers for all browsers 7962 script.onload = script.onreadystatechange = function( _, isAbort ) { 7963 7964 if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { 7965 7966 // Handle memory leak in IE 7967 script.onload = script.onreadystatechange = null; 7968 7969 // Remove the script 7970 if ( head && script.parentNode ) { 7971 head.removeChild( script ); 7972 } 7973 7974 // Dereference the script 7975 script = undefined; 7976 7977 // Callback if not abort 7978 if ( !isAbort ) { 7979 callback( 200, "success" ); 7980 } 7981 } 7982 }; 7983 // Use insertBefore instead of appendChild to circumvent an IE6 bug. 7984 // This arises when a base node is used (#2709 and #4378). 7985 head.insertBefore( script, head.firstChild ); 7986 }, 7987 7988 abort: function() { 7989 if ( script ) { 7990 script.onload( 0, 1 ); 7991 } 7992 } 7993 }; 7994 } 7995}); 7996 7997 7998 7999 8000var // #5280: Internet Explorer will keep connections alive if we don't abort on unload 8001 xhrOnUnloadAbort = window.ActiveXObject ? function() { 8002 // Abort all pending requests 8003 for ( var key in xhrCallbacks ) { 8004 xhrCallbacks[ key ]( 0, 1 ); 8005 } 8006 } : false, 8007 xhrId = 0, 8008 xhrCallbacks; 8009 8010// Functions to create xhrs 8011function createStandardXHR() { 8012 try { 8013 return new window.XMLHttpRequest(); 8014 } catch( e ) {} 8015} 8016 8017function createActiveXHR() { 8018 try { 8019 return new window.ActiveXObject( "Microsoft.XMLHTTP" ); 8020 } catch( e ) {} 8021} 8022 8023// Create the request object 8024// (This is still attached to ajaxSettings for backward compatibility) 8025jQuery.ajaxSettings.xhr = window.ActiveXObject ? 8026 /* Microsoft failed to properly 8027 * implement the XMLHttpRequest in IE7 (can't request local files), 8028 * so we use the ActiveXObject when it is available 8029 * Additionally XMLHttpRequest can be disabled in IE7/IE8 so 8030 * we need a fallback. 8031 */ 8032 function() { 8033 return !this.isLocal && createStandardXHR() || createActiveXHR(); 8034 } : 8035 // For all other browsers, use the standard XMLHttpRequest object 8036 createStandardXHR; 8037 8038// Determine support properties 8039(function( xhr ) { 8040 jQuery.extend( jQuery.support, { 8041 ajax: !!xhr, 8042 cors: !!xhr && ( "withCredentials" in xhr ) 8043 }); 8044})( jQuery.ajaxSettings.xhr() ); 8045 8046// Create transport if the browser can provide an xhr 8047if ( jQuery.support.ajax ) { 8048 8049 jQuery.ajaxTransport(function( s ) { 8050 // Cross domain only allowed if supported through XMLHttpRequest 8051 if ( !s.crossDomain || jQuery.support.cors ) { 8052 8053 var callback; 8054 8055 return { 8056 send: function( headers, complete ) { 8057 8058 // Get a new xhr 8059 var xhr = s.xhr(), 8060 handle, 8061 i; 8062 8063 // Open the socket 8064 // Passing null username, generates a login popup on Opera (#2865) 8065 if ( s.username ) { 8066 xhr.open( s.type, s.url, s.async, s.username, s.password ); 8067 } else { 8068 xhr.open( s.type, s.url, s.async ); 8069 } 8070 8071 // Apply custom fields if provided 8072 if ( s.xhrFields ) { 8073 for ( i in s.xhrFields ) { 8074 xhr[ i ] = s.xhrFields[ i ]; 8075 } 8076 } 8077 8078 // Override mime type if needed 8079 if ( s.mimeType && xhr.overrideMimeType ) { 8080 xhr.overrideMimeType( s.mimeType ); 8081 } 8082 8083 // X-Requested-With header 8084 // For cross-domain requests, seeing as conditions for a preflight are 8085 // akin to a jigsaw puzzle, we simply never set it to be sure. 8086 // (it can always be set on a per-request basis or even using ajaxSetup)
8087 // For same-domain requests, won't change header if already provided. 8088 if ( !s.crossDomain && !headers["X-Requested-With"] ) { 8089 headers[ "X-Requested-With" ] = "XMLHttpRequest"; 8090 } 8091 8092 // Need an extra try/catch for cross domain requests in Firefox 3 8093 try { 8094 for ( i in headers ) { 8095 xhr.setRequestHeader( i, headers[ i ] ); 8096 } 8097 } catch( _ ) {} 8098 8099 // Do send the request 8100 // This may raise an exception which is actually 8101 // handled in jQuery.ajax (so no try/catch here) 8102 xhr.send( ( s.hasContent && s.data ) || null ); 8103 8104 // Listener 8105 callback = function( _, isAbort ) { 8106 8107 var status, 8108 statusText, 8109 responseHeaders, 8110 responses, 8111 xml; 8112 8113 // Firefox throws exceptions when accessing properties 8114 // of an xhr when a network error occured 8115 // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) 8116 try { 8117 8118 // Was never called and is aborted or complete 8119 if ( callback && ( isAbort || xhr.readyState === 4 ) ) { 8120 8121 // Only called once 8122 callback = undefined; 8123 8124 // Do not keep as active anymore 8125 if ( handle ) { 8126 xhr.onreadystatechange = jQuery.noop; 8127 if ( xhrOnUnloadAbort ) { 8128 delete xhrCallbacks[ handle ]; 8129 } 8130 } 8131 8132 // If it's an abort 8133 if ( isAbort ) { 8134 // Abort it manually if needed 8135 if ( xhr.readyState !== 4 ) { 8136 xhr.abort(); 8137 } 8138 } else { 8139 status = xhr.status; 8140 responseHeaders = xhr.getAllResponseHeaders(); 8141 responses = {}; 8142 xml = xhr.responseXML; 8143 8144 // Construct response list 8145 if ( xml && xml.documentElement /* #4958 */ ) { 8146 responses.xml = xml; 8147 } 8148 responses.text = xhr.responseText; 8149 8150 // Firefox throws an exception when accessing 8151 // statusText for faulty cross-domain requests 8152 try { 8153 statusText = xhr.statusText; 8154 } catch( e ) { 8155 // We normalize with Webkit giving an empty statusText 8156 statusText = ""; 8157 } 8158 8159 // Filter status for non standard behaviors 8160 8161 // If the request is local and we have data: assume a success 8162 // (success with no data won't get notified, that's the best we 8163 // can do given current implementations) 8164 if ( !status && s.isLocal && !s.crossDomain ) { 8165 status = responses.text ? 200 : 404; 8166 // IE - #1450: sometimes returns 1223 when it should be 204 8167 } else if ( status === 1223 ) { 8168 status = 204; 8169 } 8170 } 8171 } 8172 } catch( firefoxAccessException ) { 8173 if ( !isAbort ) { 8174 complete( -1, firefoxAccessException ); 8175 } 8176 } 8177 8178 // Call complete if needed 8179 if ( responses ) { 8180 complete( status, statusText, responses, responseHeaders ); 8181 } 8182 }; 8183 8184 // if we're in sync mode or it's in cache 8185 // and has been retrieved directly (IE6 & IE7) 8186 // we need to manually fire the callback 8187 if ( !s.async || xhr.readyState === 4 ) { 8188 callback(); 8189 } else { 8190 handle = ++xhrId; 8191 if ( xhrOnUnloadAbort ) { 8192 // Create the active xhrs callbacks list if needed 8193 // and attach the unload handler 8194 if ( !xhrCallbacks ) { 8195 xhrCallbacks = {}; 8196 jQuery( window ).unload( xhrOnUnloadAbort ); 8197 } 8198 // Add to list of active xhrs callbacks 8199 xhrCallbacks[ handle ] = callback; 8200 } 8201 xhr.onreadystatechange = callback; 8202 } 8203 }, 8204 8205 abort: function() { 8206 if ( callback ) { 8207 callback(0,1); 8208 } 8209 } 8210 }; 8211 } 8212 }); 8213} 8214 8215 8216 8217 8218var elemdisplay = {}, 8219 iframe, iframeDoc, 8220 rfxtypes = /^(?:toggle|show|hide)$/, 8221 rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i, 8222 timerId, 8223 fxAttrs = [ 8224 // height animations 8225 [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ], 8226 // width animations 8227 [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ], 8228 // opacity animations 8229 [ "opacity" ] 8230 ], 8231 fxNow; 8232 8233jQuery.fn.extend({ 8234 show: function( speed, easing, callback ) { 8235 var elem, display; 8236 8237 if ( speed || speed === 0 ) { 8238 return this.animate( genFx("show", 3), speed, easing, callback ); 8239 8240 } else { 8241 for ( var i = 0, j = this.length; i < j; i++ ) { 8242 elem = this[ i ]; 8243 8244 if ( elem.style ) { 8245 display = elem.style.display; 8246 8247 // Reset the inline display of this element to learn if it is 8248 // being hidden by cascaded rules or not 8249 if ( !jQuery._data(elem, "olddisplay") && display === "none" ) { 8250 display = elem.style.display = ""; 8251 } 8252 8253 // Set elements which have been overridden with display: none 8254 // in a stylesheet to whatever the default browser style is 8255 // for such an element
8256 if ( display === "" && jQuery.css(elem, "display") === "none" ) { 8257 jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) ); 8258 } 8259 } 8260 } 8261 8262 // Set the display of most of the elements in a second loop 8263 // to avoid the constant reflow 8264 for ( i = 0; i < j; i++ ) { 8265 elem = this[ i ]; 8266 8267 if ( elem.style ) { 8268 display = elem.style.display; 8269 8270 if ( display === "" || display === "none" ) { 8271 elem.style.display = jQuery._data( elem, "olddisplay" ) || ""; 8272 } 8273 } 8274 } 8275 8276 return this; 8277 } 8278 }, 8279 8280 hide: function( speed, easing, callback ) { 8281 if ( speed || speed === 0 ) { 8282 return this.animate( genFx("hide", 3), speed, easing, callback); 8283 8284 } else { 8285 var elem, display, 8286 i = 0, 8287 j = this.length; 8288 8289 for ( ; i < j; i++ ) { 8290 elem = this[i]; 8291 if ( elem.style ) { 8292 display = jQuery.css( elem, "display" ); 8293 8294 if ( display !== "none" && !jQuery._data( elem, "olddisplay" ) ) { 8295 jQuery._data( elem, "olddisplay", display ); 8296 } 8297 } 8298 } 8299 8300 // Set the display of the elements in a second loop 8301 // to avoid the constant reflow 8302 for ( i = 0; i < j; i++ ) { 8303 if ( this[i].style ) { 8304 this[i].style.display = "none"; 8305 } 8306 } 8307 8308 return this; 8309 } 8310 }, 8311 8312 // Save the old toggle function 8313 _toggle: jQuery.fn.toggle, 8314 8315 toggle: function( fn, fn2, callback ) { 8316 var bool = typeof fn === "boolean"; 8317 8318 if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) { 8319 this._toggle.apply( this, arguments ); 8320 8321 } else if ( fn == null || bool ) { 8322 this.each(function() { 8323 var state = bool ? fn : jQuery(this).is(":hidden"); 8324 jQuery(this)[ state ? "show" : "hide" ](); 8325 }); 8326 8327 } else { 8328 this.animate(genFx("toggle", 3), fn, fn2, callback); 8329 } 8330 8331 return this; 8332 }, 8333 8334 fadeTo: function( speed, to, easing, callback ) { 8335 return this.filter(":hidden").css("opacity", 0).show().end() 8336 .animate({opacity: to}, speed, easing, callback); 8337 }, 8338 8339 animate: function( prop, speed, easing, callback ) { 8340 var optall = jQuery.speed( speed, easing, callback ); 8341 8342 if ( jQuery.isEmptyObject( prop ) ) { 8343 return this.each( optall.complete, [ false ] ); 8344 } 8345 8346 // Do not change referenced properties as per-property easing will be lost 8347 prop = jQuery.extend( {}, prop ); 8348 8349 function doAnimation() { 8350 // XXX 'this' does not always have a nodeName when running the 8351 // test suite 8352 8353 if ( optall.queue === false ) { 8354 jQuery._mark( this ); 8355 } 8356 8357 var opt = jQuery.extend( {}, optall ), 8358 isElement = this.nodeType === 1, 8359 hidden = isElement && jQuery(this).is(":hidden"), 8360 name, val, p, e, 8361 parts, start, end, unit, 8362 method; 8363 8364 // will store per property easing and be used to determine when an animation is complete 8365 opt.animatedProperties = {}; 8366 8367 for ( p in prop ) { 8368 8369 // property name normalization 8370 name = jQuery.camelCase( p ); 8371 if ( p !== name ) { 8372 prop[ name ] = prop[ p ]; 8373 delete prop[ p ]; 8374 } 8375 8376 val = prop[ name ]; 8377 8378 // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default) 8379 if ( jQuery.isArray( val ) ) { 8380 opt.animatedProperties[ name ] = val[ 1 ]; 8381 val = prop[ name ] = val[ 0 ]; 8382 } else { 8383 opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing'; 8384 } 8385 8386 if ( val === "hide" && hidden || val === "show" && !hidden ) { 8387 return opt.complete.call( this ); 8388 } 8389 8390 if ( isElement && ( name === "height" || name === "width" ) ) { 8391 // Make sure that nothing sneaks out 8392 // Record all 3 overflow attributes because IE does not 8393 // change the overflow attribute when overflowX and 8394 // overflowY are set to the same value 8395 opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ]; 8396 8397 // Set display property to inline-block for height/width 8398 // animations on inline elements that are having width/height animated 8399 if ( jQuery.css( this, "display" ) === "inline" && 8400 jQuery.css( this, "float" ) === "none" ) { 8401 8402 // inline-level elements accept inline-block; 8403 // block-level elements need to be inline with layout 8404 if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) { 8405 this.style.display = "inline-block"; 8406 8407 } else { 8408 this.style.zoom = 1; 8409 } 8410 } 8411 } 8412 } 8413 8414 if ( opt.overflow != null ) { 8415 this.style.overflow = "hidden"; 8416 } 8417 8418 for ( p in prop ) { 8419 e = new jQuery.fx( this, opt, p ); 8420 val = prop[ p ]; 8421 8422 if ( rfxtypes.test( val ) ) { 8423 8424 // Tracks whether to show or hide based on private 8425 // data attached to the element 8426 method = jQuery._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 ); 8427 if ( method ) { 8428 jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" ); 8429 e[ method ](); 8430 } else { 8431 e[ val ](); 8432 } 8433 8434 } else { 8435 parts = rfxnum.exec( val ); 8436 start = e.cur(); 8437 8438 if ( parts ) { 8439 end = parseFloat( parts[2] ); 8440 unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" ); 8441 8442 // We need to compute starting value 8443 if ( unit !== "px" ) {
8444 jQuery.style( this, p, (end || 1) + unit); 8445 start = ( (end || 1) / e.cur() ) * start; 8446 jQuery.style( this, p, start + unit); 8447 } 8448 8449 // If a +=/-= token was provided, we're doing a relative animation 8450 if ( parts[1] ) { 8451 end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start; 8452 } 8453 8454 e.custom( start, end, unit ); 8455 8456 } else { 8457 e.custom( start, val, "" ); 8458 } 8459 } 8460 } 8461 8462 // For JS strict compliance 8463 return true; 8464 } 8465 8466 return optall.queue === false ? 8467 this.each( doAnimation ) : 8468 this.queue( optall.queue, doAnimation ); 8469 }, 8470 8471 stop: function( type, clearQueue, gotoEnd ) { 8472 if ( typeof type !== "string" ) { 8473 gotoEnd = clearQueue; 8474 clearQueue = type; 8475 type = undefined; 8476 } 8477 if ( clearQueue && type !== false ) { 8478 this.queue( type || "fx", [] ); 8479 } 8480 8481 return this.each(function() { 8482 var index, 8483 hadTimers = false, 8484 timers = jQuery.timers, 8485 data = jQuery._data( this ); 8486 8487 // clear marker counters if we know they won't be 8488 if ( !gotoEnd ) { 8489 jQuery._unmark( true, this ); 8490 } 8491 8492 function stopQueue( elem, data, index ) { 8493 var hooks = data[ index ]; 8494 jQuery.removeData( elem, index, true ); 8495 hooks.stop( gotoEnd ); 8496 } 8497 8498 if ( type == null ) { 8499 for ( index in data ) { 8500 if ( data[ index ] && data[ index ].stop && index.indexOf(".run") === index.length - 4 ) { 8501 stopQueue( this, data, index ); 8502 } 8503 } 8504 } else if ( data[ index = type + ".run" ] && data[ index ].stop ){ 8505 stopQueue( this, data, index ); 8506 } 8507 8508 for ( index = timers.length; index--; ) { 8509 if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { 8510 if ( gotoEnd ) { 8511 8512 // force the next step to be the last 8513 timers[ index ]( true ); 8514 } else { 8515 timers[ index ].saveState(); 8516 } 8517 hadTimers = true; 8518 timers.splice( index, 1 ); 8519 } 8520 } 8521 8522 // start the next in the queue if the last step wasn't forced 8523 // timers currently will call their complete callbacks, which will dequeue 8524 // but only if they were gotoEnd 8525 if ( !( gotoEnd && hadTimers ) ) { 8526 jQuery.dequeue( this, type ); 8527 } 8528 }); 8529 } 8530 8531}); 8532 8533// Animations created synchronously will run synchronously 8534function createFxNow() { 8535 setTimeout( clearFxNow, 0 ); 8536 return ( fxNow = jQuery.now() ); 8537} 8538 8539function clearFxNow() { 8540 fxNow = undefined; 8541} 8542 8543// Generate parameters to create a standard animation 8544function genFx( type, num ) { 8545 var obj = {}; 8546 8547 jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice( 0, num )), function() { 8548 obj[ this ] = type; 8549 }); 8550 8551 return obj; 8552} 8553 8554// Generate shortcuts for custom animations 8555jQuery.each({ 8556 slideDown: genFx( "show", 1 ), 8557 slideUp: genFx( "hide", 1 ), 8558 slideToggle: genFx( "toggle", 1 ), 8559 fadeIn: { opacity: "show" }, 8560 fadeOut: { opacity: "hide" }, 8561 fadeToggle: { opacity: "toggle" } 8562}, function( name, props ) { 8563 jQuery.fn[ name ] = function( speed, easing, callback ) { 8564 return this.animate( props, speed, easing, callback ); 8565 }; 8566}); 8567 8568jQuery.extend({ 8569 speed: function( speed, easing, fn ) { 8570 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { 8571 complete: fn || !fn && easing || 8572 jQuery.isFunction( speed ) && speed, 8573 duration: speed, 8574 easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing 8575 }; 8576 8577 opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : 8578 opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; 8579 8580 // normalize opt.queue - true/undefined/null -> "fx" 8581 if ( opt.queue == null || opt.queue === true ) { 8582 opt.queue = "fx"; 8583 } 8584 8585 // Queueing 8586 opt.old = opt.complete; 8587 8588 opt.complete = function( noUnmark ) { 8589 if ( jQuery.isFunction( opt.old ) ) { 8590 opt.old.call( this ); 8591 } 8592 8593 if ( opt.queue ) { 8594 jQuery.dequeue( this, opt.queue ); 8595 } else if ( noUnmark !== false ) { 8596 jQuery._unmark( this ); 8597 } 8598 }; 8599 8600 return opt; 8601 }, 8602 8603 easing: { 8604 linear: function( p, n, firstNum, diff ) { 8605 return firstNum + diff * p; 8606 }, 8607 swing: function( p, n, firstNum, diff ) { 8608 return ( ( -Math.cos( p*Math.PI ) / 2 ) + 0.5 ) * diff + firstNum; 8609 } 8610 }, 8611 8612 timers: [], 8613 8614 fx: function( elem, options, prop ) { 8615 this.options = options; 8616 this.elem = elem; 8617 this.prop = prop; 8618 8619 options.orig = options.orig || {}; 8620 } 8621 8622}); 8623 8624jQuery.fx.prototype = { 8625 // Simple function for setting a style value 8626 update: function() { 8627 if ( this.options.step ) { 8628 this.options.step.call( this.elem, this.now, this ); 8629 } 8630 8631 ( jQuery.fx.step[ this.prop ] || jQuery.fx.step._default )( this ); 8632 }, 8633 8634 // Get the current size 8635 cur: function() { 8636 if ( this.elem[ this.prop ] != null && (!this.elem.style || this.elem.style[ this.prop ] == null) ) { 8637 return this.elem[ this.prop ]; 8638 } 8639 8640 var parsed, 8641 r = jQuery.css( this.elem, this.prop ); 8642 // Empty strings, null, undefined and "auto" are converted to 0, 8643 // complex values such as "rotate(1rad)" are returned as is, 8644 // simple values such as "10px" are parsed to Float. 8645 return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed; 8646 }, 8647 8648 // Start an animation from one number to another 8649 custom: function( from, to, unit ) { 8650 var self = this, 8651 fx = jQuery.fx; 8652 8653 this.startTime = fxNow || createFxNow(); 8654 this.end = to; 8655 this.now = this.start = from; 8656 this.pos = this.state = 0; 8657 this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" ); 8658 8659 function t( gotoEnd ) { 8660 return self.step( gotoEnd ); 8661 } 8662 8663 t.queue = this.options.queue; 8664 t.elem = this.elem;
8665 t.saveState = function() { 8666 if ( self.options.hide && jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) { 8667 jQuery._data( self.elem, "fxshow" + self.prop, self.start ); 8668 } 8669 }; 8670 8671 if ( t() && jQuery.timers.push(t) && !timerId ) { 8672 timerId = setInterval( fx.tick, fx.interval ); 8673 } 8674 }, 8675 8676 // Simple 'show' function 8677 show: function() { 8678 var dataShow = jQuery._data( this.elem, "fxshow" + this.prop ); 8679 8680 // Remember where we started, so that we can go back to it later 8681 this.options.orig[ this.prop ] = dataShow || jQuery.style( this.elem, this.prop ); 8682 this.options.show = true; 8683 8684 // Begin the animation 8685 // Make sure that we start at a small width/height to avoid any flash of content 8686 if ( dataShow !== undefined ) { 8687 // This show is picking up where a previous hide or show left off 8688 this.custom( this.cur(), dataShow ); 8689 } else { 8690 this.custom( this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur() ); 8691 } 8692 8693 // Start by showing the element 8694 jQuery( this.elem ).show(); 8695 }, 8696 8697 // Simple 'hide' function 8698 hide: function() { 8699 // Remember where we started, so that we can go back to it later 8700 this.options.orig[ this.prop ] = jQuery._data( this.elem, "fxshow" + this.prop ) || jQuery.style( this.elem, this.prop ); 8701 this.options.hide = true; 8702 8703 // Begin the animation 8704 this.custom( this.cur(), 0 ); 8705 }, 8706 8707 // Each step of an animation 8708 step: function( gotoEnd ) { 8709 var p, n, complete, 8710 t = fxNow || createFxNow(), 8711 done = true, 8712 elem = this.elem, 8713 options = this.options; 8714 8715 if ( gotoEnd || t >= options.duration + this.startTime ) { 8716 this.now = this.end; 8717 this.pos = this.state = 1; 8718 this.update(); 8719 8720 options.animatedProperties[ this.prop ] = true; 8721 8722 for ( p in options.animatedProperties ) { 8723 if ( options.animatedProperties[ p ] !== true ) { 8724 done = false; 8725 } 8726 } 8727 8728 if ( done ) { 8729 // Reset the overflow 8730 if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) { 8731 8732 jQuery.each( [ "", "X", "Y" ], function( index, value ) { 8733 elem.style[ "overflow" + value ] = options.overflow[ index ]; 8734 }); 8735 } 8736 8737 // Hide the element if the "hide" operation was done 8738 if ( options.hide ) { 8739 jQuery( elem ).hide(); 8740 } 8741 8742 // Reset the properties, if the item has been hidden or shown 8743 if ( options.hide || options.show ) { 8744 for ( p in options.animatedProperties ) { 8745 jQuery.style( elem, p, options.orig[ p ] ); 8746 jQuery.removeData( elem, "fxshow" + p, true ); 8747 // Toggle data is no longer needed 8748 jQuery.removeData( elem, "toggle" + p, true ); 8749 } 8750 } 8751 8752 // Execute the complete function 8753 // in the event that the complete function throws an exception 8754 // we must ensure it won't be called twice. #5684 8755 8756 complete = options.complete; 8757 if ( complete ) { 8758 8759 options.complete = false; 8760 complete.call( elem ); 8761 } 8762 } 8763 8764 return false; 8765 8766 } else { 8767 // classical easing cannot be used with an Infinity duration 8768 if ( options.duration == Infinity ) { 8769 this.now = t; 8770 } else { 8771 n = t - this.startTime; 8772 this.state = n / options.duration; 8773 8774 // Perform the easing function, defaults to swing 8775 this.pos = jQuery.easing[ options.animatedProperties[this.prop] ]( this.state, n, 0, 1, options.duration ); 8776 this.now = this.start + ( (this.end - this.start) * this.pos ); 8777 } 8778 // Perform the next step of the animation 8779 this.update(); 8780 } 8781 8782 return true; 8783 } 8784}; 8785 8786jQuery.extend( jQuery.fx, { 8787 tick: function() { 8788 var timer, 8789 timers = jQuery.timers, 8790 i = 0; 8791 8792 for ( ; i < timers.length; i++ ) { 8793 timer = timers[ i ]; 8794 // Checks the timer has not already been removed 8795 if ( !timer() && timers[ i ] === timer ) { 8796 timers.splice( i--, 1 ); 8797 } 8798 } 8799 8800 if ( !timers.length ) { 8801 jQuery.fx.stop(); 8802 } 8803 }, 8804 8805 interval: 13, 8806 8807 stop: function() { 8808 clearInterval( timerId ); 8809 timerId = null; 8810 }, 8811 8812 speeds: { 8813 slow: 600, 8814 fast: 200, 8815 // Default speed 8816 _default: 400 8817 }, 8818 8819 step: { 8820 opacity: function( fx ) { 8821 jQuery.style( fx.elem, "opacity", fx.now ); 8822 }, 8823 8824 _default: function( fx ) { 8825 if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) { 8826 fx.elem.style[ fx.prop ] = fx.now + fx.unit; 8827 } else { 8828 fx.elem[ fx.prop ] = fx.now; 8829 } 8830 } 8831 } 8832}); 8833 8834// Adds width/height step functions 8835// Do not set anything below 0 8836jQuery.each([ "width", "height" ], function( i, prop ) { 8837 jQuery.fx.step[ prop ] = function( fx ) { 8838 jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit ); 8839 }; 8840}); 8841 8842if ( jQuery.expr && jQuery.expr.filters ) { 8843 jQuery.expr.filters.animated = function( elem ) { 8844 return jQuery.grep(jQuery.timers, function( fn ) { 8845 return elem === fn.elem; 8846 }).length; 8847 }; 8848} 8849 8850// Try to restore the default display value of an element 8851function defaultDisplay( nodeName ) { 8852 8853 if ( !elemdisplay[ nodeName ] ) { 8854 8855 var body = document.body, 8856 elem = jQuery( "<" + nodeName + ">" ).appendTo( body ), 8857 display = elem.css( "display" ); 8858 elem.remove(); 8859 8860 // If the simple way fails, 8861 // get element's real default display by attaching it to a temp iframe 8862 if ( display === "none" || display === "" ) { 8863 // No iframe to use yet, so create it 8864 if ( !iframe ) { 8865 iframe = document.createElement( "iframe" ); 8866 iframe.frameBorder = iframe.width = iframe.height = 0; 8867 } 8868 8869 body.appendChild( iframe ); 8870 8871 // Create a cacheable copy of the iframe document on first call. 8872 // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML 8873 // document to it; WebKit & Firefox won't allow reusing the iframe document. 8874 if ( !iframeDoc || !iframe.createElement ) { 8875 iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document; 8876 iframeDoc.write( ( document.compatMode === "CSS1Compat" ? "<!doctype html>" : "" ) + "<html><body>" ); 8877 iframeDoc.close(); 8878 } 8879 8880 elem = iframeDoc.createElement( nodeName ); 8881 8882 iframeDoc.body.appendChild( elem ); 8883
8884 display = jQuery.css( elem, "display" ); 8885 body.removeChild( iframe ); 8886 } 8887 8888 // Store the correct default display 8889 elemdisplay[ nodeName ] = display; 8890 } 8891 8892 return elemdisplay[ nodeName ]; 8893} 8894 8895 8896 8897 8898var rtable = /^t(?:able|d|h)$/i, 8899 rroot = /^(?:body|html)$/i; 8900 8901if ( "getBoundingClientRect" in document.documentElement ) { 8902 jQuery.fn.offset = function( options ) { 8903 var elem = this[0], box; 8904 8905 if ( options ) { 8906 return this.each(function( i ) { 8907 jQuery.offset.setOffset( this, options, i ); 8908 }); 8909 } 8910 8911 if ( !elem || !elem.ownerDocument ) { 8912 return null; 8913 } 8914 8915 if ( elem === elem.ownerDocument.body ) { 8916 return jQuery.offset.bodyOffset( elem ); 8917 } 8918 8919 try { 8920 box = elem.getBoundingClientRect(); 8921 } catch(e) {} 8922 8923 var doc = elem.ownerDocument, 8924 docElem = doc.documentElement; 8925 8926 // Make sure we're not dealing with a disconnected DOM node 8927 if ( !box || !jQuery.contains( docElem, elem ) ) { 8928 return box ? { top: box.top, left: box.left } : { top: 0, left: 0 }; 8929 } 8930 8931 var body = doc.body, 8932 win = getWindow(doc), 8933 clientTop = docElem.clientTop || body.clientTop || 0, 8934 clientLeft = docElem.clientLeft || body.clientLeft || 0, 8935 scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop, 8936 scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft, 8937 top = box.top + scrollTop - clientTop, 8938 left = box.left + scrollLeft - clientLeft; 8939 8940 return { top: top, left: left }; 8941 }; 8942 8943} else { 8944 jQuery.fn.offset = function( options ) { 8945 var elem = this[0]; 8946 8947 if ( options ) { 8948 return this.each(function( i ) { 8949 jQuery.offset.setOffset( this, options, i ); 8950 }); 8951 } 8952 8953 if ( !elem || !elem.ownerDocument ) { 8954 return null; 8955 } 8956 8957 if ( elem === elem.ownerDocument.body ) { 8958 return jQuery.offset.bodyOffset( elem ); 8959 } 8960 8961 var computedStyle, 8962 offsetParent = elem.offsetParent, 8963 prevOffsetParent = elem, 8964 doc = elem.ownerDocument, 8965 docElem = doc.documentElement, 8966 body = doc.body, 8967 defaultView = doc.defaultView, 8968 prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle, 8969 top = elem.offsetTop, 8970 left = elem.offsetLeft; 8971 8972 while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) { 8973 if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) { 8974 break; 8975 } 8976 8977 computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle; 8978 top -= elem.scrollTop; 8979 left -= elem.scrollLeft; 8980 8981 if ( elem === offsetParent ) { 8982 top += elem.offsetTop; 8983 left += elem.offsetLeft; 8984 8985 if ( jQuery.support.doesNotAddBorder && !(jQuery.support.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) { 8986 top += parseFloat( computedStyle.borderTopWidth ) || 0; 8987 left += parseFloat( computedStyle.borderLeftWidth ) || 0; 8988 } 8989 8990 prevOffsetParent = offsetParent; 8991 offsetParent = elem.offsetParent; 8992 } 8993 8994 if ( jQuery.support.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) { 8995 top += parseFloat( computedStyle.borderTopWidth ) || 0; 8996 left += parseFloat( computedStyle.borderLeftWidth ) || 0; 8997 } 8998 8999 prevComputedStyle = computedStyle; 9000 } 9001 9002 if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) { 9003 top += body.offsetTop; 9004 left += body.offsetLeft; 9005 } 9006 9007 if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) { 9008 top += Math.max( docElem.scrollTop, body.scrollTop ); 9009 left += Math.max( docElem.scrollLeft, body.scrollLeft ); 9010 } 9011 9012 return { top: top, left: left }; 9013 }; 9014} 9015 9016jQuery.offset = { 9017 9018 bodyOffset: function( body ) { 9019 var top = body.offsetTop, 9020 left = body.offsetLeft; 9021 9022 if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) { 9023 top += parseFloat( jQuery.css(body, "marginTop") ) || 0; 9024 left += parseFloat( jQuery.css(body, "marginLeft") ) || 0; 9025 } 9026 9027 return { top: top, left: left }; 9028 }, 9029 9030 setOffset: function( elem, options, i ) { 9031 var position = jQuery.css( elem, "position" ); 9032 9033 // set position first, in-case top/left are set even on static elem 9034 if ( position === "static" ) { 9035 elem.style.position = "relative"; 9036 } 9037 9038 var curElem = jQuery( elem ), 9039 curOffset = curElem.offset(), 9040 curCSSTop = jQuery.css( elem, "top" ), 9041 curCSSLeft = jQuery.css( elem, "left" ), 9042 calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, 9043 props = {}, curPosition = {}, curTop, curLeft; 9044 9045 // need to be able to calculate position if either top or left is auto and position is either absolute or fixed 9046 if ( calculatePosition ) { 9047 curPosition = curElem.position(); 9048 curTop = curPosition.top; 9049 curLeft = curPosition.left; 9050 } else { 9051 curTop = parseFloat( curCSSTop ) || 0; 9052 curLeft = parseFloat( curCSSLeft ) || 0; 9053 } 9054 9055 if ( jQuery.isFunction( options ) ) { 9056 options = options.call( elem, i, curOffset ); 9057 } 9058 9059 if ( options.top != null ) { 9060 props.top = ( options.top - curOffset.top ) + curTop; 9061 } 9062 if ( options.left != null ) { 9063 props.left = ( options.left - curOffset.left ) + curLeft; 9064 } 9065 9066 if ( "using" in options ) { 9067 options.using.call( elem, props ); 9068 } else { 9069 curElem.css( props ); 9070 } 9071 } 9072}; 9073 9074 9075jQuery.fn.extend({ 9076 9077 position: function() { 9078 if ( !this[0] ) { 9079 return null; 9080 } 9081 9082 var elem = this[0], 9083 9084 // Get *real* offsetParent 9085 offsetParent = this.offsetParent(), 9086 9087 // Get correct offsets 9088 offset = this.offset(), 9089 parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset(); 9090 9091 // Subtract element margins 9092 // note: when an element has margin: auto the offsetLeft and marginLeft 9093 // are the same in Safari causing offset.left to incorrectly be 0 9094 offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0; 9095 offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0; 9096 9097 // Add offsetParent borders 9098 parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0; 9099 parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0; 9100 9101 // Subtract the two offsets 9102 return { 9103 top: offset.top - parentOffset.top, 9104 left: offset.left - parentOffset.left 9105 }; 9106 }, 9107 9108 offsetParent: function() { 9109 return this.map(function() { 9110 var offsetParent = this.offsetParent || document.body;
9111 while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) { 9112 offsetParent = offsetParent.offsetParent; 9113 } 9114 return offsetParent; 9115 }); 9116 } 9117}); 9118 9119 9120// Create scrollLeft and scrollTop methods 9121jQuery.each( ["Left", "Top"], function( i, name ) { 9122 var method = "scroll" + name; 9123 9124 jQuery.fn[ method ] = function( val ) { 9125 var elem, win; 9126 9127 if ( val === undefined ) { 9128 elem = this[ 0 ]; 9129 9130 if ( !elem ) { 9131 return null; 9132 } 9133 9134 win = getWindow( elem ); 9135 9136 // Return the scroll offset 9137 return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] : 9138 jQuery.support.boxModel && win.document.documentElement[ method ] || 9139 win.document.body[ method ] : 9140 elem[ method ]; 9141 } 9142 9143 // Set the scroll offset 9144 return this.each(function() { 9145 win = getWindow( this ); 9146 9147 if ( win ) { 9148 win.scrollTo( 9149 !i ? val : jQuery( win ).scrollLeft(), 9150 i ? val : jQuery( win ).scrollTop() 9151 ); 9152 9153 } else { 9154 this[ method ] = val; 9155 } 9156 }); 9157 }; 9158}); 9159 9160function getWindow( elem ) { 9161 return jQuery.isWindow( elem ) ? 9162 elem : 9163 elem.nodeType === 9 ? 9164 elem.defaultView || elem.parentWindow : 9165 false; 9166} 9167 9168 9169 9170 9171// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods 9172jQuery.each([ "Height", "Width" ], function( i, name ) { 9173 9174 var type = name.toLowerCase(); 9175 9176 // innerHeight and innerWidth 9177 jQuery.fn[ "inner" + name ] = function() { 9178 var elem = this[0]; 9179 return elem ? 9180 elem.style ? 9181 parseFloat( jQuery.css( elem, type, "padding" ) ) : 9182 this[ type ]() : 9183 null; 9184 }; 9185 9186 // outerHeight and outerWidth 9187 jQuery.fn[ "outer" + name ] = function( margin ) { 9188 var elem = this[0]; 9189 return elem ? 9190 elem.style ? 9191 parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) : 9192 this[ type ]() : 9193 null; 9194 }; 9195 9196 jQuery.fn[ type ] = function( size ) { 9197 // Get window width or height 9198 var elem = this[0]; 9199 if ( !elem ) { 9200 return size == null ? null : this; 9201 } 9202 9203 if ( jQuery.isFunction( size ) ) { 9204 return this.each(function( i ) { 9205 var self = jQuery( this ); 9206 self[ type ]( size.call( this, i, self[ type ]() ) ); 9207 }); 9208 } 9209 9210 if ( jQuery.isWindow( elem ) ) { 9211 // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode 9212 // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat 9213 var docElemProp = elem.document.documentElement[ "client" + name ], 9214 body = elem.document.body; 9215 return elem.document.compatMode === "CSS1Compat" && docElemProp || 9216 body && body[ "client" + name ] || docElemProp; 9217 9218 // Get document width or height 9219 } else if ( elem.nodeType === 9 ) { 9220 // Either scroll[Width/Height] or offset[Width/Height], whichever is greater 9221 return Math.max( 9222 elem.documentElement["client" + name], 9223 elem.body["scroll" + name], elem.documentElement["scroll" + name], 9224 elem.body["offset" + name], elem.documentElement["offset" + name] 9225 ); 9226 9227 // Get or set width or height on the element 9228 } else if ( size === undefined ) { 9229 var orig = jQuery.css( elem, type ), 9230 ret = parseFloat( orig ); 9231 9232 return jQuery.isNumeric( ret ) ? ret : orig; 9233 9234 // Set the width or height on the element (default to pixels if value is unitless) 9235 } else { 9236 return this.css( type, typeof size === "string" ? size : size + "px" ); 9237 } 9238 }; 9239 9240}); 9241 9242 9243 9244 9245// Expose jQuery to the global object 9246window.jQuery = window.$ = jQuery; 9247 9248// Expose jQuery as an AMD module, but only for AMD loaders that 9249// understand the issues with loading multiple versions of jQuery 9250// in a page that all might call define(). The loader will indicate 9251// they have special allowances for multiple jQuery versions by 9252// specifying define.amd.jQuery = true. Register as a named module, 9253// since jQuery can be concatenated with other files that may use define, 9254// but not use a proper concatenation script that understands anonymous 9255// AMD modules. A named AMD is safest and most robust way to register. 9256// Lowercase jquery is used because AMD module names are derived from 9257// file names, and jQuery is normally delivered in a lowercase file name. 9258// Do this after creating the global so that if an AMD module wants to call
9259// noConflict to hide this version of jQuery, it will work. 9260if ( typeof define === "function" && define.amd && define.amd.jQuery ) { 9261 define( "jquery", [], function () { return jQuery; } ); 9262} 9263 9264 9265 9266})( window ); 9267; 9268 9269/** 9270 * Override jQuery.fn.init to guard against XSS attacks. 9271 * 9272 * See http://bugs.jquery.com/ticket/9521 9273 */ 9274(function () { 9275 var jquery_init = jQuery.fn.init; 9276 jQuery.fn.init = function (selector, context, rootjQuery) { 9277 // If the string contains a "#" before a "<", treat it as invalid HTML. 9278 if (selector && typeof selector === 'string') { 9279 var hash_position = selector.indexOf('#'); 9280 if (hash_position >= 0) { 9281 var bracket_position = selector.indexOf('<'); 9282 if (bracket_position > hash_position) { 9283 throw 'Syntax error, unrecognized expression: ' + selector; 9284 } 9285 } 9286 } 9287 return jquery_init.call(this, selector, context, rootjQuery); 9288 }; 9289 jQuery.fn.init.prototype = jquery_init.prototype; 9290})(); 9291 9292var Drupal = Drupal || { 'settings': {}, 'behaviors': {}, 'themes': {}, 'locale': {} }; 9293 9294/** 9295 * Set the variable that indicates if JavaScript behaviors should be applied 9296 */ 9297Drupal.jsEnabled = document.getElementsByTagName && document.createElement && document.createTextNode && document.documentElement && document.getElementById; 9298 9299/** 9300 * Attach all registered behaviors to a page element. 9301 * 9302 * Behaviors are event-triggered actions that attach to page elements, enhancing 9303 * default non-Javascript UIs. Behaviors are registered in the Drupal.behaviors 9304 * object as follows: 9305 * @code 9306 * Drupal.behaviors.behaviorName = function () { 9307 * ... 9308 * }; 9309 * @endcode 9310 * 9311 * Drupal.attachBehaviors is added below to the jQuery ready event and so 9312 * runs on initial page load. Developers implementing AHAH/AJAX in their 9313 * solutions should also call this function after new page content has been 9314 * loaded, feeding in an element to be processed, in order to attach all 9315 * behaviors to the new content. 9316 * 9317 * Behaviors should use a class in the form behaviorName-processed to ensure 9318 * the behavior is attached only once to a given element. (Doing so enables 9319 * the reprocessing of given elements, which may be needed on occasion despite 9320 * the ability to limit behavior attachment to a particular element.) 9321 * 9322 * @param context 9323 * An element to attach behaviors to. If none is given, the document element 9324 * is used. 9325 */ 9326Drupal.attachBehaviors = function(context) { 9327 context = context || document; 9328 if (Drupal.jsEnabled) { 9329 // Execute all of them. 9330 jQuery.each(Drupal.behaviors, function() { 9331 this(context); 9332 }); 9333 } 9334}; 9335 9336/** 9337 * Encode special characters in a plain-text string for display as HTML. 9338 */ 9339Drupal.checkPlain = function(str) { 9340 str = String(str); 9341 var replace = { '&': '&', '"': '"', '<': '<', '>': '>' }; 9342 for (var character in replace) { 9343 var regex = new RegExp(character, 'g'); 9344 str = str.replace(regex, replace[character]); 9345 } 9346 return str; 9347}; 9348 9349/** 9350 * Translate strings to the page language or a given language. 9351 * 9352 * See the documentation of the server-side t() function for further details. 9353 * 9354 * @param str 9355 * A string containing the English string to translate. 9356 * @param args 9357 * An object of replacements pairs to make after translation. Incidences 9358 * of any key in this array are replaced with the corresponding value. 9359 * Based on the first character of the key, the value is escaped and/or themed: 9360 * - !variable: inserted as is 9361 * - @variable: escape plain text to HTML (Drupal.checkPlain) 9362 * - %variable: escape text and theme as a placeholder for user-submitted 9363 * content (checkPlain + Drupal.theme('placeholder')) 9364 * @return 9365 * The translated string. 9366 */ 9367Drupal.t = function(str, args) { 9368 // Fetch the localized version of the string. 9369 if (Drupal.locale.strings && Drupal.locale.strings[str]) { 9370 str = Drupal.locale.strings[str]; 9371 } 9372 9373 if (args) { 9374 // Transform arguments before inserting them 9375 for (var key in args) { 9376 switch (key.charAt(0)) { 9377 // Escaped only 9378 case '@': 9379 args[key] = Drupal.checkPlain(args[key]); 9380 break; 9381 // Pass-through 9382 case '!': 9383 break; 9384 // Escaped and placeholder 9385 case '%': 9386 default: 9387 args[key] = Drupal.theme('placeholder', args[key]); 9388 break; 9389 } 9390 str = str.replace(key, args[key]); 9391 } 9392 } 9393 return str; 9394}; 9395 9396/** 9397 * Format a string containing a count of items. 9398 * 9399 * This function ensures that the string is pluralized correctly. Since Drupal.t() is 9400 * called by this function, make sure not to pass already-localized strings to it. 9401 * 9402 * See the documentation of the server-side format_plural() function for further details. 9403 * 9404 * @param count 9405 * The item count to display. 9406 * @param singular 9407 * The string for the singular case. Please make sure it is clear this is 9408 * singular, to ease translation (e.g. use "1 new comment" instead of "1 new"). 9409 * Do not use @count in the singular string. 9410 * @param plural 9411 * The string for the plural case. Please make sure it is clear this is plural, 9412 * to ease translation. Use @count in place of the item count, as in "@count 9413 * new comments". 9414 * @param args 9415 * An object of replacements pairs to make after translation. Incidences 9416 * of any key in this array are replaced with the corresponding value. 9417 * Based on the first character of the key, the value is escaped and/or themed: 9418 * - !variable: inserted as is 9419 * - @variable: escape plain text to HTML (Drupal.checkPlain) 9420 * - %variable: escape text and theme as a placeholder for user-submitted 9421 * content (checkPlain + Drupal.theme('placeholder')) 9422 * Note that you do not need to include @count in this array.
9423 * This replacement is done automatically for the plural case. 9424 * @return 9425 * A translated string. 9426 */ 9427Drupal.formatPlural = function(count, singular, plural, args) { 9428 var args = args || {}; 9429 args['@count'] = count; 9430 // Determine the index of the plural form. 9431 var index = Drupal.locale.pluralFormula ? Drupal.locale.pluralFormula(args['@count']) : ((args['@count'] == 1) ? 0 : 1); 9432 9433 if (index == 0) { 9434 return Drupal.t(singular, args); 9435 } 9436 else if (index == 1) { 9437 return Drupal.t(plural, args); 9438 } 9439 else { 9440 args['@count['+ index +']'] = args['@count']; 9441 delete args['@count']; 9442 return Drupal.t(plural.replace('@count', '@count['+ index +']'), args); 9443 } 9444}; 9445 9446/** 9447 * Generate the themed representation of a Drupal object. 9448 * 9449 * All requests for themed output must go through this function. It examines 9450 * the request and routes it to the appropriate theme function. If the current 9451 * theme does not provide an override function, the generic theme function is 9452 * called. 9453 * 9454 * For example, to retrieve the HTML that is output by theme_placeholder(text), 9455 * call Drupal.theme('placeholder', text). 9456 * 9457 * @param func 9458 * The name of the theme function to call. 9459 * @param ... 9460 * Additional arguments to pass along to the theme function. 9461 * @return 9462 * Any data the theme function returns. This could be a plain HTML string, 9463 * but also a complex object. 9464 */ 9465Drupal.theme = function(func) { 9466 for (var i = 1, args = []; i < arguments.length; i++) { 9467 args.push(arguments[i]); 9468 } 9469 9470 return (Drupal.theme[func] || Drupal.theme.prototype[func]).apply(this, args); 9471}; 9472 9473/** 9474 * Parse a JSON response. 9475 * 9476 * The result is either the JSON object, or an object with 'status' 0 and 'data' an error message. 9477 */ 9478Drupal.parseJson = function (data) { 9479 if ((data.substring(0, 1) != '{') && (data.substring(0, 1) != '[')) { 9480 return { status: 0, data: data.length ? data : Drupal.t('Unspecified error') }; 9481 } 9482 return eval('(' + data + ');'); 9483}; 9484 9485/** 9486 * Freeze the current body height (as minimum height). Used to prevent 9487 * unnecessary upwards scrolling when doing DOM manipulations. 9488 */ 9489Drupal.freezeHeight = function () { 9490 Drupal.unfreezeHeight(); 9491 var div = document.createElement('div'); 9492 $(div).css({ 9493 position: 'absolute', 9494 top: '0px', 9495 left: '0px', 9496 width: '1px', 9497 height: $('body').css('height') 9498 }).attr('id', 'freeze-height'); 9499 $('body').append(div); 9500}; 9501 9502/** 9503 * Unfreeze the body height 9504 */ 9505Drupal.unfreezeHeight = function () { 9506 $('#freeze-height').remove(); 9507}; 9508 9509/** 9510 * Wrapper around encodeURIComponent() which avoids Apache quirks (equivalent of 9511 * drupal_urlencode() in PHP). This function should only be used on paths, not 9512 * on query string arguments. 9513 */ 9514Drupal.encodeURIComponent = function (item, uri) { 9515 uri = uri || location.href; 9516 item = encodeURIComponent(item).replace(/%2F/g, '/'); 9517 return (uri.indexOf('?q=') != -1) ? item : item.replace(/%26/g, '%2526').replace(/%23/g, '%2523').replace(/\/\//g, '/%252F'); 9518}; 9519 9520/** 9521 * Get the text selection in a textarea. 9522 */ 9523Drupal.getSelection = function (element) { 9524 if (typeof(element.selectionStart) != 'number' && document.selection) { 9525 // The current selection 9526 var range1 = document.selection.createRange(); 9527 var range2 = range1.duplicate(); 9528 // Select all text. 9529 range2.moveToElementText(element); 9530 // Now move 'dummy' end point to end point of original range. 9531 range2.setEndPoint('EndToEnd', range1); 9532 // Now we can calculate start and end points. 9533 var start = range2.text.length - range1.text.length; 9534 var end = start + range1.text.length; 9535 return { 'start': start, 'end': end }; 9536 } 9537 return { 'start': element.selectionStart, 'end': element.selectionEnd }; 9538}; 9539 9540/** 9541 * Build an error message from ahah response. 9542 */ 9543Drupal.ahahError = function(xmlhttp, uri) { 9544 if (xmlhttp.status == 200) { 9545 if (jQuery.trim($(xmlhttp.responseText).text())) { 9546 var message = Drupal.t("An error occurred. \n@uri\n@text", {'@uri': uri, '@text': xmlhttp.responseText }); 9547 } 9548 else { 9549 var message = Drupal.t("An error occurred. \n@uri\n(no information available).", {'@uri': uri, '@text': xmlhttp.responseText }); 9550 } 9551 } 9552 else { 9553 var message = Drupal.t("An HTTP error @status occurred. \n@uri", {'@uri': uri, '@status': xmlhttp.status }); 9554 } 9555 return message; 9556} 9557 9558// Global Killswitch on the <html> element 9559if (Drupal.jsEnabled) { 9560 // Global Killswitch on the <html> element 9561 $(document.documentElement).addClass('js'); 9562 // 'js enabled' cookie 9563 document.cookie = 'has_js=1; path=/'; 9564 // Attach all behaviors. 9565 $(document).ready(function() { 9566 Drupal.attachBehaviors(this); 9567 }); 9568} 9569 9570/** 9571 * The default themes. 9572 */ 9573Drupal.theme.prototype = { 9574 9575 /** 9576 * Formats text for emphasized display in a placeholder inside a sentence. 9577 * 9578 * @param str 9579 * The text to format (plain-text). 9580 * @return 9581 * The formatted text (html). 9582 */ 9583 placeholder: function(str) { 9584 return '<em>' + Drupal.checkPlain(str) + '</em>'; 9585 } 9586}; 9587; 9588Drupal.locale = { 'pluralFormula': function($n) { return Number((((($n%10)==1)&&(($n%100)!=11))?(0):((((($n%10)>=2)&&(($n%10)<=4))&&((($n%100)<10)||(($n%100)>=20)))?(1):2))); }, 'strings': { "Unspecified error": "ÐеизвеÑÑÐ½Ð°Ñ Ð¾Ñибка", "Your server has been successfully tested to support this feature.": "ÐÐ°Ñ ÑеÑÐ²ÐµÑ Ð±Ñл ÑÑпеÑно пÑоÑеÑÑиÑован и Ð¼Ð¾Ð¶ÐµÑ Ð¸ÑполÑзоваÑÑ ÑÑÑ ÑÑнкÑиÑ", "Your system configuration does not currently support this feature. The \x3ca href=\"http://drupal.org/node/15365\"\x3ehandbook page on Clean URLs\x3c/a\x3e has additional troubleshooting information.": "ÐонÑигÑÑаÑÐ¸Ñ Ð²Ð°Ñей ÑиÑÑÐµÐ¼Ñ ÑейÑÐ°Ñ Ð½Ðµ поддеÑÐ¶Ð¸Ð²Ð°ÐµÑ ÑÑой ÑÑнкÑии. ÐополниÑелÑÐ½Ð°Ñ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð´Ð¾ÑÑÑпна в \x3ca href=\"http://drupal.org/node/15365\"\x3eдокÑменÑаÑии о ÑиÑÑÑÑ ÑÑÑÐ»ÐºÐ°Ñ \x3c/a\x3e.", "Testing clean URLs...": "ÐÑовеÑка ÑиÑÑÑÑ ÑÑÑлок...", "Select all rows in this table": "ÐÑмеÑиÑÑ Ð²Ñе ÑÑÑоки ÑаблиÑÑ", "Deselect all rows in this table": "СнÑÑÑ Ð¾ÑмеÑÐºÑ Ñо вÑÐµÑ ÐºÐ¾Ð»Ð¾Ð½Ð¾Ðº ÑаблиÑÑ", "Join
vendor: 15,288 bytes, lines 9588-9681
9588summary": "ÐбÑединиÑÑ", "Split summary at cursor": "ÐÑделиÑÑ Ð°Ð½Ð¾Ð½Ñ Ð¾Ñ Ð¾Ñновного ÑодеÑжимого", "Changes made in this table will not be saved until the form is submitted.": "СделаннÑе в ÑпиÑке Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð½Ðµ вÑÑÑпÑÑ Ð² ÑилÑ, пока Ð²Ñ Ð½Ðµ ÑÐ¾Ñ ÑаниÑе Ð¸Ñ .", "Drag to re-order": "ÐзмениÑÑ Ð¿Ð¾ÑÑдок можно, пеÑеÑаÑив пÑÐ½ÐºÑ Ð¼ÑÑкой.", "The changes to these blocks will not be saved until the \x3cem\x3eSave blocks\x3c/em\x3e button is clicked.": "ÐзменениÑ, ÑделаннÑе в Ð±Ð»Ð¾ÐºÐ°Ñ Ð½Ðµ вÑÑÑпÑÑ Ð² ÑÐ¸Ð»Ñ Ð¿Ð¾ÐºÐ° Ð²Ñ Ð½Ðµ нажмеÑе ÐºÐ½Ð¾Ð¿ÐºÑ \x3cem\x3eÐ¡Ð¾Ñ ÑаниÑÑ Ð±Ð»Ð¾ÐºÐ¸\x3c/em\x3e.", "Are you sure you want to remove this item?": "ÐÑ Ð´ÐµÐ¹ÑÑвиÑелÑно Ñ Ð¾ÑиÑе ÑдалиÑÑ Ð´Ð°Ð½Ð½Ñй ÑлеменÑ?" } };; 9589(function(t,e,i){function n(i,n,o){var r=e.createElement(i);return n&&(r.id=Z+n),o&&(r.style.cssText=o),t(r)}function o(){return i.innerHeight?i.innerHeight:t(i).height()}function r(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var n;return void 0===this.cache[e]&&(n=t(this.el).attr("data-cbox-"+e),void 0!==n?this.cache[e]=n:void 0!==i[e]?this.cache[e]=i[e]:void 0!==X[e]&&(this.cache[e]=X[e])),this.cache[e]},this.get=function(e){var i=this.value(e);return t.isFunction(i)?i.call(this.el,this):i}}function h(t){var e=W.length,i=(A+t)%e;return 0>i?e+i:i}function a(t,e){return Math.round((/%/.test(t)?("x"===e?E.width():o())/100:1)*parseInt(t,10))}function s(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function l(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function d(t){"contains"in x[0]&&!x[0].contains(t.target)&&t.target!==v[0]&&(t.stopPropagation(),x.focus())}function c(t){c.str!==t&&(x.add(v).removeClass(c.str).addClass(t),c.str=t)}function g(e){A=0,e&&e!==!1&&"nofollow"!==e?(W=t("."+te).filter(function(){var i=t.data(this,Y),n=new r(this,i);return n.get("rel")===e}),A=W.index(_.el),-1===A&&(W=W.add(_.el),A=W.length-1)):W=t(_.el)}function u(i){t(e).trigger(i),ae.triggerHandler(i)}function f(i){var o;if(!G){if(o=t(i).data(Y),_=new r(i,o),g(_.get("rel")),!U){U=$=!0,c(_.get("className")),x.css({visibility:"hidden",display:"block",opacity:""}),I=n(se,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),b.css({width:"",height:""}).append(I),j=T.height()+k.height()+b.outerHeight(!0)-b.height(),D=C.width()+H.width()+b.outerWidth(!0)-b.width(),N=I.outerHeight(!0),z=I.outerWidth(!0);var h=a(_.get("initialWidth"),"x"),s=a(_.get("initialHeight"),"y"),l=_.get("maxWidth"),f=_.get("maxHeight");_.w=Math.max((l!==!1?Math.min(h,a(l,"x")):h)-z-D,0),_.h=Math.max((f!==!1?Math.min(s,a(f,"y")):s)-N-j,0),I.css({width:"",height:_.h}),J.position(),u(ee),_.get("onOpen"),O.add(F).hide(),x.focus(),_.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",d,!0),ae.one(re,function(){e.removeEventListener("focus",d,!0)})),_.get("returnFocus")&&ae.one(re,function(){t(_.el).focus()})}var p=parseFloat(_.get("opacity"));v.css({opacity:p===p?p:"",cursor:_.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),_.get("closeButton")?B.html(_.get("close")).appendTo(b):B.appendTo("<div/>"),w()}}function p(){x||(V=!1,E=t(i),x=n(se).attr({id:Y,"class":t.support.opacity===!1?Z+"IE":"",role:"dialog",tabindex:"-1"}).hide(),v=n(se,"Overlay").hide(),L=t([n(se,"LoadingOverlay")[0],n(se,"LoadingGraphic")[0]]),y=n(se,"Wrapper"),b=n(se,"Content").append(F=n(se,"Title"),R=n(se,"Current"),P=t('<button type="button"/>').attr({id:Z+"Previous"}),K=t('<button type="button"/>').attr({id:Z+"Next"}),S=t('<button type="button"/>').attr({id:Z+"Slideshow"}),L),B=t('<button type="button"/>').attr({id:Z+"Close"}),y.append(n(se).append(n(se,"TopLeft"),T=n(se,"TopCenter"),n(se,"TopRight")),n(se,!1,"clear:left").append(C=n(se,"MiddleLeft"),b,H=n(se,"MiddleRight")),n(se,!1,"clear:left").append(n(se,"BottomLeft"),k=n(se,"BottomCenter"),n(se,"BottomRight"))).find("div div").css({"float":"left"}),M=n(se,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),O=K.add(P).add(R).add(S)),e.body&&!x.parent().length&&t(e.body).append(v,x.append(y,M))}function m(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.ctrlKey||(t.preventDefault(),f(this))}return x?(V||(V=!0,K.click(function(){J.next()}),P.click(function(){J.prev()}),B.click(function(){J.close()}),v.click(function(){_.get("overlayClose")&&J.close()}),t(e).bind("keydown."+Z,function(t){var e=t.keyCode;U&&_.get("escKey")&&27===e&&(t.preventDefault(),J.close()),U&&_.get("arrowKey")&&W[1]&&!t.altKey&&(37===e?(t.preventDefault(),P.click()):39===e&&(t.preventDefault(),K.click()))}),t.isFunction(t.fn.on)?t(e).on("click."+Z,"."+te,i):t("."+te).live("click."+Z,i)),!0):!1}function w(){var e,o,r,h=J.prep,d=++le;if($=!0,q=!1,u(he),u(ie),_.get("onLoad"),_.h=_.get("height")?a(_.get("height"),"y")-N-j:_.get("innerHeight")&&a(_.get("innerHeight"),"y"),_.w=_.get("width")?a(_.get("width"),"x")-z-D:_.get("innerWidth")&&a(_.get("innerWidth"),"x"),_.mw=_.w,_.mh=_.h,_.get("maxWidth")&&(_.mw=a(_.get("maxWidth"),"x")-z-D,_.mw=_.w&&_.w<_.mw?_.w:_.mw),_.get("maxHeight")&&(_.mh=a(_.get("maxHeight"),"y")-N-j,_.mh=_.h&&_.h<_.mh?_.h:_.mh),e=_.get("href"),Q=setTimeout(function(){L.show()},100),_.get("inline")){var c=t(e).eq(0);r=t("<div>").hide().insertBefore(c),ae.one(he,function(){r.replaceWith(c)}),h(c)}else _.get("iframe")?h(" "):_.get("html")?h(_.get("html")):s(_,e)?(e=l(_,e),q=_.get("createImg"),t(q).addClass(Z+"Photo").bind("error."+Z,function(){h(n(se,"Error").html(_.get("imgError")))}).one("load",function(){d===le&&setTimeout(function(){var e;_.get("retinaImage")&&i.devicePixelRatio>1&&(q.height=q.height/i.devicePixelRatio,q.width=q.width/i.devicePixelRatio),_.get("scalePhotos")&&(o=function(){q.height-=q.height*e,q.width-=q.width*e},_.mw&&q.width>_.mw&&(e=(q.width-_.mw)/q.width,o()),_.mh&&q.height>_.mh&&(e=(q.height-_.mh)/q.height,o())),_.h&&(q.style.marginTop=Math.max(_.mh-q.height,0)/2+"px"),W[1]&&(_.get("loop")||W[A+1])&&(q.style.cursor="pointer",t(q).bind("click."+Z,function(){J.next()})),q.style.width=q.width+"px",q.style.height=q.height+"px",h(q)},1)}),q.src=e):e&&M.load(e,_.get("data"),function(e,i){d===le&&h("error"===i?n(se,"Error").html(_.get("xhrError")):t(this).contents())})}var v,x,y,b,T,C,H,k,W,E,I,M,L,F,R,S,K,P,B,O,_,j,D,N,z,A,q,U,$,G,Q,J,V,X={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return t(this).attr("href")},title:function(){return this.title},createImg:function(){var e=new Image,i=t(this).data("cbox-img-attrs");return"object"==typeof i&&t.each(i,function(t,i){e[t]=i}),e},createIframe:function(){var i=e.createElement("iframe"),n=t(this).data("cbox-iframe-attrs");return"object"==typeof n&&t.each(n,function(t,e){i[t]=e}),"frameBorder"in i&&(i.frameBorder=0),"allowTransparency"in i&&(i.allowTransparency="true"),i.name=(new Date).getTime(),i.allowFullscreen=!0,i}},Y="colorbox",Z="cbox",te=Z+"Element",ee=Z+"_open",ie=Z+"_load",ne=Z+"_complete",oe=Z+"_cleanup",re=Z+"_closed",he=Z+"_purge",ae=t("<a/>"),se="div",le=0,de={},ce=function(){function t(){clearTimeout(h)}function e(){(_.get("loop")||W[A+1])&&(t(),h=setTimeout(J.next,_.get("slideshowSpeed")))}function i(){S.html(_.get("slideshowStop")).unbind(s).one(s,n),ae.bind(ne,e).bind(ie,t),x.removeClass(a+"off").addClass(a+"on")}function n(){t(),ae.unbind(ne,e).unbind(ie,t),S.html(_.get("slideshowStart")).unbind(s).one(s,function(){J.next(),i()}),x.removeClass(a+"on").addClass(a+"off")}function o(){r=!1,S.hide(),t(),ae.unbind(ne,e).unbind(ie,t),x.removeClass(a+"off "+a+"on")}var r,h,a=Z+"Slideshow_",s="click."+Z;return function(){r?_.get("slideshow")||(ae.unbind(oe,o),o()):_.get("slideshow")&&W[1]&&(r=!0,ae.one(oe,o),_.get("slideshowAuto")?i():n(),S.show())}}();t[Y]||(t(p),J=t.fn[Y]=t[Y]=function(e,i){var n,o=this;return e=e||{},t.isFunction(o)&&(o=t("<a/>"),e.open=!0),o[0]?(p(),m()&&(i&&(e.onComplete=i),o.each(function(){var i=t.data(this,Y)||{};t.data(this,Y,t.extend(i,e))}).addClass(te),n=new r(o[0],e),n.get("open")&&f(o[0])),o):o},J.position=function(e,i){function n(){T[0].style.width=k[0].style.width=b[0].style.width=parseInt(x[0].style.width,10)-D+"px",b[0].style.height=C[0].style.height=H[0].style.height=parseInt(x[0].style.height,10)-j+"px"}var r,h,s,l=0,d=0,c=x.offset();if(E.unbind("resize."+Z),x.css({top:-9e4,left:-9e4}),h=E.scrollTop(),s=E.scrollLeft(),_.get("fixed")?(c.top-=h,c.left-=s,x.css({position:"fixed"})):(l=h,d=s,x.css({position:"absolute"})),d+=_.get("right")!==!1?Math.max(E.width()-_.w-z-D-a(_.get("right"),"x"),0):_.get("left")!==!1?a(_.get("left"),"x"):Math.round(Math.max(E.width()-_.w-z-D,0)/2),l+=_.get("bottom")!==!1?Math.max(o()-_.h-N-j-a(_.get("bottom"),"y"),0):_.get("top")!==!1?a(_.get("top"),"y"):Math.round(Math.max(o()-_.h-N-j,0)/2),x.css({top:c.top,left:c.left,visibility:"visible"}),y[0].style.width=y[0].style.height="9999px",r={width:_.w+z+D,height:_.h+N+j,top:l,left:d},e){var g=0;t.each(r,function(t){return r[t]!==de[t]?(g=e,void 0):void 0}),e=g}de=r,e||x.css(r),x.dequeue().animate(r,{duration:e||0,complete:function(){n(),$=!1,y[0].style.width=_.w+z+D+"px",y[0].style.height=_.h+N+j+"px",_.get("reposition")&&setTimeout(function(){E.bind("resize."+Z,J.position)},1),t.isFunction(i)&&i()},step:n})},J.resize=function(t){var e;U&&(t=t||{},t.width&&(_.w=a(t.width,"x")-z-D),t.innerWidth&&(_.w=a(t.innerWidth,"x")),I.css({width:_.w}),t.height&&(_.h=a(t.height,"y")-N-j),t.innerHeight&&(_.h=a(t.innerHeight,"y")),t.innerHeight||t.height||(e=I.scrollTop(),I.css({height:"auto"}),_.h=I.height()),I.css({height:_.h}),e&&I.scrollTop(e),J.position("none"===_.get("transition")?0:_.get("speed")))},J.prep=function(i){function o(){return _.w=_.w||I.width(),_.w=_.mw&&_.mw<_.w?_.mw:_.w,_.w}function a(){return _.h=_.h||I.height(),_.h=_.mh&&_.mh<_.h?_.mh:_.h,_.h}if(U){var d,g="none"===_.get("transition")?0:_.get("speed");I.remove(),I=n(se,"LoadedContent").append(i),I.hide().appendTo(M.show()).css({width:o(),overflow:_.get("scrolling")?"auto":"hidden"}).css({height:a()}).prependTo(b),M.hide(),t(q).css({"float":"none"}),c(_.get("className")),d=function(){function i(){t.support.opacity===!1&&x[0].style.removeAttribute("filter")}var n,o,a=W.length;U&&(o=function(){clearTimeout(Q),L.hide(),u(ne),_.get("onComplete")},F.html(_.get("title")).show(),I.show(),a>1?("string"==typeof _.get("current")&&R.html(_.get("current").replace("{current}",A+1).replace("{total}",a)).show(),K[_.get("loop")||a-1>A?"show":"hide"]().html(_.get("next")),P[_.get("loop")||A?"show":"hide"]().html(_.get("previous")),ce(),_.get("preloading")&&t.each([h(-1),h(1)],function(){var i,n=W[this],o=new r(n,t.data(n,Y)),h=o.get("href");h&&s(o,h)&&(h=l(o,h),i=e.createElement("img"),i.src=h)})):O.hide(),_.get("iframe")?(n=_.get("createIframe"),_.get("scrolling")||(n.scrolling="no"),t(n).attr({src:_.get("href"),"class":Z+"Iframe"}).one("load",o).appendTo(I),ae.one(he,function(){n.src="//about:blank"}),_.get("fastIframe")&&t(n).trigger("load")):o(),"fade"===_.get("transition")?x.fadeTo(g,1,i):i())},"fade"===_.get("transition")?x.fadeTo(g,0,function(){J.position(0,d)}):J.position(g,d)}},J.next=function(){!$&&W[1]&&(_.get("loop")||W[A+1])&&(A=h(1),f(W[A]))},J.prev=function(){!$&&W[1]&&(_.get("loop")||A)&&(A=h(-1),f(W[A]))},J.close=function(){U&&!G&&(G=!0,U=!1,u(oe),_.get("onCleanup"),E.unbind("."+Z),v.fadeTo(_.get("fadeOut")||0,0),x.stop().fadeTo(_.get("fadeOut")||0,0,function(){x.hide(),v.hide(),u(he),I.remove(),setTimeout(function(){G=!1,u(re),_.get("onClosed")},1)}))},J.remove=function(){x&&(x.stop(),t[Y].close(),x.stop(!1,!0).remove(),v.remove(),G=!1,x=null,t("."+te).removeData(Y).removeClass(te),t(e).unbind("click."+Z).unbind("keydown."+Z))},J.element=function(){return t(_.el)},J.settings=X)})(jQuery,document,window);; 9590(function ($) { 9591 9592Drupal.behaviors.initColorbox = function (context) { 9593 if (!$.isFunction($.colorbox)) { 9594 return; 9595 } 9596 $('a, area, input', context) 9597 .filter('.colorbox:not(.initColorbox-processed)') 9598 .addClass('initColorbox-processed') 9599 .colorbox(Drupal.settings.colorbox); 9600}; 9601 9602{ 9603 $(document).bind('cbox_complete', function () { 9604 Drupal.attachBehaviors('#cboxLoadedContent'); 9605 }); 9606} 9607 9608})(jQuery); 9609; 9610(function ($) { 9611 9612Drupal.behaviors.initColorboxLoad = function (context) { 9613 if (!$.isFunction($.colorbox)) { 9614 return; 9615 } 9616 var settings = Drupal.settings.colorbox; 9617 $.urlParam = function(name, url){ 9618 var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(url); 9619 if (!results) { return ''; } 9620 return results[1] || ''; 9621 }; 9622 $('a, area, input', context).filter('.colorbox-load:not(.initColorboxLoad-processed)').addClass('initColorboxLoad-processed').colorbox({ 9623 transition:settings.transition, 9624 speed:settings.speed, 9625 opacity:settings.opacity, 9626 slideshowAuto:settings.slideshowAuto, 9627 slideshowSpeed:settings.slideshowSpeed, 9628 slideshowStart:settings.slideshowStart, 9629 slideshowStop:settings.slideshowStop, 9630 current:settings.current, 9631 previous:settings.previous, 9632 next:settings.next, 9633 close:settings.close, 9634 overlayClose:settings.overlayClose, 9635 maxWidth:settings.maxWidth, 9636 maxHeight:settings.maxHeight, 9637 innerWidth:function(){ 9638 return $.urlParam('width', $(this).attr('href')); 9639 }, 9640 innerHeight:function(){ 9641 return $.urlParam('height', $(this).attr('href')); 9642 }, 9643 iframe:function(){ 9644 return $.urlParam('iframe', $(this).attr('href')); 9645 }, 9646 slideshow:function(){ 9647 return $.urlParam('slideshow', $(this).attr('href')); 9648 } 9649 }); 9650}; 9651 9652})(jQuery); 9653; 9654/*! 9655 * jQuery Form Plugin 9656 * version: 2.93 (30-NOV-2011) 9657 * @requires jQuery v1.3.2 or later 9658 * 9659 * Examples and documentation at: http://malsup.com/jquery/form/ 9660 * Dual licensed under the MIT and GPL licenses: 9661 * http://www.opensource.org/licenses/mit-license.php 9662 * http://www.gnu.org/licenses/gpl.html 9663 */ 9664;(function($) { 9665 9666/* 9667 Usage Note: 9668 ----------- 9669 Do not use both ajaxSubmit and ajaxForm on the same form. These 9670 functions are intended to be exclusive. Use ajaxSubmit if you want 9671 to bind your own submit handler to the form. For example, 9672 9673 $(document).ready(function() { 9674 $('#myForm').bind('submit', function(e) { 9675 e.preventDefault(); // <-- important 9676 $(this).ajaxSubmit({ 9677 target: '#output' 9678 }); 9679 }); 9680 }); 9681
9682 Use ajaxForm when you want the plugin to manage all the event binding 9683 for you. For example, 9684 9685 $(document).ready(function() { 9686 $('#myForm').ajaxForm({ 9687 target: '#output' 9688 }); 9689 }); 9690 9691 When using ajaxForm, the ajaxSubmit function will be invoked for you 9692 at the appropriate time. 9693*/ 9694 9695/** 9696 * ajaxSubmit() provides a mechanism for immediately submitting 9697 * an HTML form using AJAX. 9698 */ 9699$.fn.ajaxSubmit = function(options) { 9700 // fast fail if nothing selected (http://dev.jquery.com/ticket/2752) 9701 if (!this.length) { 9702 log('ajaxSubmit: skipping submit process - no element selected'); 9703 return this; 9704 } 9705 9706 var method, action, url, $form = this; 9707 9708 if (typeof options == 'function') { 9709 options = { success: options }; 9710 } 9711 9712 method = this.attr('method'); 9713 action = this.attr('action'); 9714 url = (typeof action === 'string') ? $.trim(action) : ''; 9715 url = url || window.location.href || ''; 9716 if (url) { 9717 // clean url (don't include hash vaue) 9718 url = (url.match(/^([^#]+)/)||[])[1]; 9719 } 9720 9721 options = $.extend(true, { 9722 url: url, 9723 success: $.ajaxSettings.success, 9724 type: method || 'GET', 9725 iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank' 9726 }, options); 9727 9728 // hook for manipulating the form data before it is extracted; 9729 // convenient for use with rich editors like tinyMCE or FCKEditor 9730 var veto = {}; 9731 this.trigger('form-pre-serialize', [this, options, veto]); 9732 if (veto.veto) { 9733 log('ajaxSubmit: submit vetoed via form-pre-serialize trigger'); 9734 return this; 9735 } 9736 9737 // provide opportunity to alter form data before it is serialized 9738 if (options.beforeSerialize && options.beforeSerialize(this, options) === false) { 9739 log('ajaxSubmit: submit aborted via beforeSerialize callback'); 9740 return this; 9741 } 9742 9743 var traditional = options.traditional; 9744 if ( traditional === undefined ) { 9745 traditional = $.ajaxSettings.traditional; 9746 } 9747 9748 var qx,n,v,a = this.formToArray(options.semantic); 9749 if (options.data) { 9750 options.extraData = options.data; 9751 qx = $.param(options.data, traditional); 9752 } 9753 9754 // give pre-submit callback an opportunity to abort the submit 9755 if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) { 9756 log('ajaxSubmit: submit aborted via beforeSubmit callback'); 9757 return this; 9758 } 9759 9760 // fire vetoable 'validate' event 9761 this.trigger('form-submit-validate', [a, this, options, veto]); 9762 if (veto.veto) { 9763 log('ajaxSubmit: submit vetoed via form-submit-validate trigger'); 9764 return this; 9765 } 9766 9767 var q = $.param(a, traditional); 9768 if (qx) { 9769 q = ( q ? (q + '&' + qx) : qx ); 9770 } 9771 if (options.type.toUpperCase() == 'GET') { 9772 options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; 9773 options.data = null; // data is null for 'get' 9774 } 9775 else { 9776 options.data = q; // data is the query string for 'post' 9777 } 9778 9779 var callbacks = []; 9780 if (options.resetForm) { 9781 callbacks.push(function() { $form.resetForm(); }); 9782 } 9783 if (options.clearForm) { 9784 callbacks.push(function() { $form.clearForm(options.includeHidden); }); 9785 } 9786 9787 // perform a load on the target only if dataType is not provided 9788 if (!options.dataType && options.target) { 9789 var oldSuccess = options.success || function(){}; 9790 callbacks.push(function(data) { 9791 var fn = options.replaceTarget ? 'replaceWith' : 'html'; 9792 $(options.target)[fn](data).each(oldSuccess, arguments); 9793 }); 9794 } 9795 else if (options.success) { 9796 callbacks.push(options.success); 9797 } 9798 9799 options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg 9800 var context = options.context || options; // jQuery 1.4+ supports scope context 9801 for (var i=0, max=callbacks.length; i < max; i++) { 9802 callbacks[i].apply(context, [data, status, xhr || $form, $form]); 9803 } 9804 }; 9805 9806 // are there files to upload? 9807 var fileInputs = $('input:file:enabled[value]', this); // [value] (issue #113) 9808 var hasFileInputs = fileInputs.length > 0; 9809 var mp = 'multipart/form-data'; 9810 var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp); 9811 9812 var fileAPI = !!(hasFileInputs && fileInputs.get(0).files && window.FormData); 9813 log("fileAPI :" + fileAPI); 9814 var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI; 9815 9816 // options.iframe allows user to force iframe mode 9817 // 06-NOV-09: now defaulting to iframe mode if file input is detected 9818 if (options.iframe !== false && (options.iframe || shouldUseFrame)) { 9819 // hack to fix Safari hang (thanks to Tim Molendijk for this) 9820 // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d 9821 if (options.closeKeepAlive) { 9822 $.get(options.closeKeepAlive, function() { 9823 fileUploadIframe(a); 9824 }); 9825 } 9826 else { 9827 fileUploadIframe(a); 9828 } 9829 } 9830 else if ((hasFileInputs || multipart) && fileAPI) { 9831 options.progress = options.progress || $.noop; 9832 fileUploadXhr(a); 9833 } 9834 else { 9835 $.ajax(options); 9836 } 9837 9838 // fire 'notify' event 9839 this.trigger('form-submit-notify', [this, options]); 9840 return this; 9841 9842 // XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz) 9843 function fileUploadXhr(a) { 9844 var formdata = new FormData(); 9845 9846 for (var i=0; i < a.length; i++) { 9847 if (a[i].type == 'file') 9848 continue; 9849 formdata.append(a[i].name, a[i].value); 9850 } 9851
9852 $form.find('input:file:enabled').each(function(){ 9853 var name = $(this).attr('name'), files = this.files; 9854 if (name) { 9855 for (var i=0; i < files.length; i++) 9856 formdata.append(name, files[i]); 9857 } 9858 }); 9859 9860 if (options.extraData) { 9861 for (var k in options.extraData) 9862 formdata.append(k, options.extraData[k]) 9863 } 9864 9865 options.data = null; 9866 var _beforeSend = options.beforeSend; 9867 options.beforeSend = function(xhr, options) { 9868 options.data = formdata; 9869 if (xhr.upload) { // unfortunately, jQuery doesn't expose this prop (http://bugs.jquery.com/ticket/10190) 9870 xhr.upload.onprogress = function(event) { 9871 options.progress(event.position, event.total); 9872 } 9873 } 9874 if (_beforeSend) 9875 _beforeSend.call(options, xhr, options); 9876 } 9877 $.ajax(options); 9878 } 9879 9880 // private function for handling file uploads (hat tip to YAHOO!) 9881 function fileUploadIframe(a) { 9882 var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle; 9883 var useProp = !!$.fn.prop; 9884 9885 if (a) { 9886 if ( useProp ) { 9887 // ensure that every serialized input is still enabled 9888 for (i=0; i < a.length; i++) { 9889 el = $(form[a[i].name]); 9890 el.prop('disabled', false); 9891 } 9892 } else { 9893 for (i=0; i < a.length; i++) { 9894 el = $(form[a[i].name]); 9895 el.removeAttr('disabled'); 9896 } 9897 }; 9898 } 9899 9900 if ($(':input[name=submit],:input[id=submit]', form).length) { 9901 // if there is an input with a name or id of 'submit' then we won't be 9902 // able to invoke the submit fn on the form (at least not x-browser) 9903 alert('Error: Form elements must not have name or id of "submit".'); 9904 return; 9905 } 9906 9907 s = $.extend(true, {}, $.ajaxSettings, options); 9908 s.context = s.context || s; 9909 id = 'jqFormIO' + (new Date().getTime()); 9910 if (s.iframeTarget) { 9911 $io = $(s.iframeTarget); 9912 n = $io.attr('name'); 9913 if (n == null) 9914 $io.attr('name', id); 9915 else 9916 id = n; 9917 } 9918 else { 9919 $io = $('<iframe name="' + id + '" src="'+ s.iframeSrc +'" />'); 9920 $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' }); 9921 } 9922 io = $io[0]; 9923 9924 9925 xhr = { // mock object 9926 aborted: 0, 9927 responseText: null, 9928 responseXML: null, 9929 status: 0, 9930 statusText: 'n/a', 9931 getAllResponseHeaders: function() {}, 9932 getResponseHeader: function() {}, 9933 setRequestHeader: function() {}, 9934 abort: function(status) { 9935 var e = (status === 'timeout' ? 'timeout' : 'aborted'); 9936 log('aborting upload... ' + e); 9937 this.aborted = 1; 9938 $io.attr('src', s.iframeSrc); // abort op in progress 9939 xhr.error = e; 9940 s.error && s.error.call(s.context, xhr, e, status); 9941 g && $.event.trigger("ajaxError", [xhr, s, e]); 9942 s.complete && s.complete.call(s.context, xhr, e); 9943 } 9944 }; 9945 9946 g = s.global; 9947 // trigger ajax global events so that activity/block indicators work like normal 9948 if (g && ! $.active++) { 9949 $.event.trigger("ajaxStart"); 9950 } 9951 if (g) { 9952 $.event.trigger("ajaxSend", [xhr, s]); 9953 } 9954 9955 if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) { 9956 if (s.global) { 9957 $.active--; 9958 } 9959 return; 9960 } 9961 if (xhr.aborted) { 9962 return; 9963 } 9964 9965 // add submitting element to data if we know it 9966 sub = form.clk; 9967 if (sub) { 9968 n = sub.name; 9969 if (n && !sub.disabled) { 9970 s.extraData = s.extraData || {}; 9971 s.extraData[n] = sub.value; 9972 if (sub.type == "image") { 9973 s.extraData[n+'.x'] = form.clk_x; 9974 s.extraData[n+'.y'] = form.clk_y; 9975 } 9976 } 9977 } 9978 9979 var CLIENT_TIMEOUT_ABORT = 1; 9980 var SERVER_ABORT = 2; 9981 9982 function getDoc(frame) { 9983 var doc = frame.contentWindow ? frame.contentWindow.document : frame.contentDocument ? frame.contentDocument : frame.document; 9984 return doc; 9985 } 9986 9987 // Rails CSRF hack (thanks to Yvan BARTH�LEMY) 9988 var csrf_token = $('meta[name=csrf-token]').attr('content'); 9989 var csrf_param = $('meta[name=csrf-param]').attr('content'); 9990 if (csrf_param && csrf_token) { 9991 s.extraData = s.extraData || {}; 9992 s.extraData[csrf_param] = csrf_token; 9993 } 9994 9995 // take a breath so that pending repaints get some cpu time before the upload starts 9996 function doSubmit() { 9997 // make sure form attrs are set 9998 var t = $form.attr('target'), a = $form.attr('action'); 9999 10000 // update form attrs in IE friendly way 10001 form.setAttribute('target',id);
10002 if (!method) { 10003 form.setAttribute('method', 'POST'); 10004 } 10005 if (a != s.url) { 10006 form.setAttribute('action', s.url); 10007 } 10008 10009 // ie borks in some cases when setting encoding 10010 if (! s.skipEncodingOverride && (!method || /post/i.test(method))) { 10011 $form.attr({ 10012 encoding: 'multipart/form-data', 10013 enctype: 'multipart/form-data' 10014 }); 10015 } 10016 10017 // support timout 10018 if (s.timeout) { 10019 timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout); 10020 } 10021 10022 // look for server aborts 10023 function checkState() { 10024 try { 10025 var state = getDoc(io).readyState; 10026 log('state = ' + state); 10027 if (state.toLowerCase() == 'uninitialized') 10028 setTimeout(checkState,50); 10029 } 10030 catch(e) { 10031 log('Server abort: ' , e, ' (', e.name, ')'); 10032 cb(SERVER_ABORT); 10033 timeoutHandle && clearTimeout(timeoutHandle); 10034 timeoutHandle = undefined; 10035 } 10036 } 10037 10038 // add "extra" data to form if provided in options 10039 var extraInputs = []; 10040 try { 10041 if (s.extraData) { 10042 for (var n in s.extraData) { 10043 extraInputs.push( 10044 $('<input type="hidden" name="'+n+'">').attr('value',s.extraData[n]) 10045 .appendTo(form)[0]); 10046 } 10047 } 10048 10049 if (!s.iframeTarget) { 10050 // add iframe to doc and submit the form 10051 $io.appendTo('body'); 10052 io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false); 10053 } 10054 setTimeout(checkState,15); 10055 form.submit(); 10056 } 10057 finally { 10058 // reset attrs and remove "extra" input elements 10059 form.setAttribute('action',a); 10060 if(t) { 10061 form.setAttribute('target', t); 10062 } else { 10063 $form.removeAttr('target'); 10064 } 10065 $(extraInputs).remove(); 10066 } 10067 } 10068 10069 if (s.forceSync) { 10070 doSubmit(); 10071 } 10072 else { 10073 setTimeout(doSubmit, 10); // this lets dom updates render 10074 } 10075 10076 var data, doc, domCheckCount = 50, callbackProcessed; 10077 10078 function cb(e) { 10079 if (xhr.aborted || callbackProcessed) { 10080 return; 10081 } 10082 try { 10083 doc = getDoc(io); 10084 } 10085 catch(ex) { 10086 log('cannot access response document: ', ex); 10087 e = SERVER_ABORT; 10088 } 10089 if (e === CLIENT_TIMEOUT_ABORT && xhr) { 10090 xhr.abort('timeout'); 10091 return; 10092 } 10093 else if (e == SERVER_ABORT && xhr) { 10094 xhr.abort('server abort'); 10095 return; 10096 } 10097 10098 if (!doc || doc.location.href == s.iframeSrc) { 10099 // response not received yet 10100 if (!timedOut) 10101 return; 10102 } 10103 io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false); 10104 10105 var status = 'success', errMsg; 10106 try { 10107 if (timedOut) { 10108 throw 'timeout'; 10109 } 10110 10111 var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc); 10112 log('isXml='+isXml); 10113 if (!isXml && window.opera && (doc.body == null || doc.body.innerHTML == '')) { 10114 if (--domCheckCount) { 10115 // in some browsers (Opera) the iframe DOM is not always traversable when 10116 // the onload callback fires, so we loop a bit to accommodate 10117 log('requeing onLoad callback, DOM not available'); 10118 setTimeout(cb, 250); 10119 return; 10120 } 10121 // let this fall through because server response could be an empty document 10122 //log('Could not access iframe DOM after mutiple tries.'); 10123 //throw 'DOMException: not available'; 10124 } 10125 10126 //log('response detected'); 10127 var docRoot = doc.body ? doc.body : doc.documentElement; 10128 xhr.responseText = docRoot ? docRoot.innerHTML : null; 10129 xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc; 10130 if (isXml) 10131 s.dataType = 'xml'; 10132 xhr.getResponseHeader = function(header){ 10133 var headers = {'content-type': s.dataType}; 10134 return headers[header]; 10135 }; 10136 // support for XHR 'status' & 'statusText' emulation : 10137 if (docRoot) { 10138 xhr.status = Number( docRoot.getAttribute('status') ) || xhr.status; 10139 xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText; 10140 } 10141 10142 var dt = (s.dataType || '').toLowerCase(); 10143 var scr = /(json|script|text)/.test(dt); 10144 if (scr || s.textarea) { 10145 // see if user embedded response in textarea 10146 var ta = doc.getElementsByTagName('textarea')[0]; 10147 if (ta) { 10148 xhr.responseText = ta.value; 10149 // support for XHR 'status' & 'statusText' emulation : 10150 xhr.status = Number( ta.getAttribute('status') ) || xhr.status; 10151 xhr.statusText = ta.getAttribute('statusText') || xhr.statusText; 10152 } 10153 else if (scr) { 10154 // account for browsers injecting pre around json response 10155 var pre = doc.getElementsByTagName('pre')[0]; 10156 var b = doc.getElementsByTagName('body')[0]; 10157 if (pre) { 10158 xhr.responseText = pre.textContent ? pre.textContent : pre.innerText; 10159 } 10160 else if (b) { 10161 xhr.responseText = b.textContent ? b.textContent : b.innerText; 10162 } 10163 } 10164 } 10165 else if (dt == 'xml' && !xhr.responseXML && xhr.responseText != null) { 10166 xhr.responseXML = toXml(xhr.responseText); 10167 } 10168 10169 try { 10170 data = httpData(xhr, dt, s); 10171 } 10172 catch (e) { 10173 status = 'parsererror'; 10174 xhr.error = errMsg = (e || status); 10175 } 10176 } 10177 catch (e) { 10178 log('error caught: ',e); 10179 status = 'error'; 10180 xhr.error = errMsg = (e || status); 10181 } 10182 10183 if (xhr.aborted) { 10184 log('upload aborted'); 10185 status = null; 10186 } 10187 10188 if (xhr.status) { // we've set xhr.status 10189 status = (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) ? 'success' : 'error'; 10190 } 10191 10192 // ordering of these callbacks/triggers is odd, but that's how $.ajax does it 10193 if (status === 'success') { 10194 s.success && s.success.call(s.context, data, 'success', xhr); 10195 g && $.event.trigger("ajaxSuccess", [xhr, s]); 10196 } 10197 else if (status) { 10198 if (errMsg == undefined) 10199 errMsg = xhr.statusText; 10200 s.error && s.error.call(s.context, xhr, status, errMsg); 10201 g && $.event.trigger("ajaxError", [xhr, s, errMsg]); 10202 } 10203
10204 g && $.event.trigger("ajaxComplete", [xhr, s]); 10205 10206 if (g && ! --$.active) { 10207 $.event.trigger("ajaxStop"); 10208 } 10209 10210 s.complete && s.complete.call(s.context, xhr, status); 10211 10212 callbackProcessed = true; 10213 if (s.timeout) 10214 clearTimeout(timeoutHandle); 10215 10216 // clean up 10217 setTimeout(function() { 10218 if (!s.iframeTarget) 10219 $io.remove(); 10220 xhr.responseXML = null; 10221 }, 100); 10222 } 10223 10224 var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+) 10225 if (window.ActiveXObject) { 10226 doc = new ActiveXObject('Microsoft.XMLDOM'); 10227 doc.async = 'false'; 10228 doc.loadXML(s); 10229 } 10230 else { 10231 doc = (new DOMParser()).parseFromString(s, 'text/xml'); 10232 } 10233 return (doc && doc.documentElement && doc.documentElement.nodeName != 'parsererror') ? doc : null; 10234 }; 10235 var parseJSON = $.parseJSON || function(s) { 10236 return window['eval']('(' + s + ')'); 10237 }; 10238 10239 var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4 10240 10241 var ct = xhr.getResponseHeader('content-type') || '', 10242 xml = type === 'xml' || !type && ct.indexOf('xml') >= 0, 10243 data = xml ? xhr.responseXML : xhr.responseText; 10244 10245 if (xml && data.documentElement.nodeName === 'parsererror') { 10246 $.error && $.error('parsererror'); 10247 } 10248 if (s && s.dataFilter) { 10249 data = s.dataFilter(data, type); 10250 } 10251 if (typeof data === 'string') { 10252 if (type === 'json' || !type && ct.indexOf('json') >= 0) { 10253 data = parseJSON(data); 10254 } else if (type === "script" || !type && ct.indexOf("javascript") >= 0) { 10255 $.globalEval(data); 10256 } 10257 } 10258 return data; 10259 }; 10260 } 10261}; 10262 10263/** 10264 * ajaxForm() provides a mechanism for fully automating form submission. 10265 * 10266 * The advantages of using this method instead of ajaxSubmit() are: 10267 * 10268 * 1: This method will include coordinates for <input type="image" /> elements (if the element 10269 * is used to submit the form). 10270 * 2. This method will include the submit element's name/value data (for the element that was 10271 * used to submit the form). 10272 * 3. This method binds the submit() method to the form for you. 10273 * 10274 * The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely 10275 * passes the options argument along after properly binding events for submit elements and 10276 * the form itself. 10277 */ 10278$.fn.ajaxForm = function(options) { 10279 // in jQuery 1.3+ we can fix mistakes with the ready state 10280 if (this.length === 0) { 10281 var o = { s: this.selector, c: this.context }; 10282 if (!$.isReady && o.s) { 10283 log('DOM not ready, queuing ajaxForm'); 10284 $(function() { 10285 $(o.s,o.c).ajaxForm(options); 10286 }); 10287 return this; 10288 } 10289 // is your DOM ready? http://docs.jquery.com/Tutorials:Introducing_$(document).ready() 10290 log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)')); 10291 return this; 10292 } 10293 10294 return this.ajaxFormUnbind().bind('submit.form-plugin', function(e) { 10295 if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed 10296 e.preventDefault(); 10297 $(this).ajaxSubmit(options); 10298 } 10299 }).bind('click.form-plugin', function(e) { 10300 var target = e.target; 10301 var $el = $(target); 10302 if (!($el.is(":submit,input:image"))) { 10303 // is this a child element of the submit el? (ex: a span within a button) 10304 var t = $el.closest(':submit'); 10305 if (t.length == 0) { 10306 return; 10307 } 10308 target = t[0]; 10309 } 10310 var form = this; 10311 form.clk = target; 10312 if (target.type == 'image') { 10313 if (e.offsetX != undefined) { 10314 form.clk_x = e.offsetX; 10315 form.clk_y = e.offsetY; 10316 } else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin 10317 var offset = $el.offset(); 10318 form.clk_x = e.pageX - offset.left; 10319 form.clk_y = e.pageY - offset.top; 10320 } else { 10321 form.clk_x = e.pageX - target.offsetLeft; 10322 form.clk_y = e.pageY - target.offsetTop; 10323 } 10324 } 10325 // clear form vars 10326 setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100); 10327 }); 10328}; 10329 10330// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm 10331$.fn.ajaxFormUnbind = function() { 10332 return this.unbind('submit.form-plugin click.form-plugin'); 10333}; 10334 10335/** 10336 * formToArray() gathers form element data into an array of objects that can 10337 * be passed to any of the following ajax functions: $.get, $.post, or load. 10338 * Each object in the array has both a 'name' and 'value' property. An example of 10339 * an array for a simple login form might be: 10340 * 10341 * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ] 10342 * 10343 * It is this array that is passed to pre-submit callback functions provided to the 10344 * ajaxSubmit() and ajaxForm() methods. 10345 */ 10346$.fn.formToArray = function(semantic) { 10347 var a = []; 10348 if (this.length === 0) { 10349 return a; 10350 } 10351 10352 var form = this[0]; 10353 var els = semantic ? form.getElementsByTagName('*') : form.elements; 10354 if (!els) { 10355 return a; 10356 } 10357 10358 var i,j,n,v,el,max,jmax; 10359 for(i=0, max=els.length; i < max; i++) { 10360 el = els[i]; 10361 n = el.name; 10362 if (!n) { 10363 continue; 10364 } 10365 10366 if (semantic && form.clk && el.type == "image") { 10367 // handle image inputs on the fly when semantic == true 10368 if(!el.disabled && form.clk == el) { 10369 a.push({name: n, value: $(el).val(), type: el.type }); 10370 a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y}); 10371 } 10372 continue; 10373 } 10374 10375 v = $.fieldValue(el, true); 10376 if (v && v.constructor == Array) { 10377 for(j=0, jmax=v.length; j < jmax; j++) { 10378 a.push({name: n, value: v[j]}); 10379 } 10380 } 10381 else if (v !== null && typeof v != 'undefined') { 10382 a.push({name: n, value: v, type: el.type}); 10383 } 10384 } 10385 10386 if (!semantic && form.clk) { 10387 // input type=='image' are not found in elements array! handle it here 10388 var $input = $(form.clk), input = $input[0]; 10389 n = input.name; 10390 if (n && !input.disabled && input.type == 'image') { 10391 a.push({name: n, value: $input.val()}); 10392 a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y}); 10393 } 10394 } 10395 return a; 10396}; 10397 10398/** 10399 * Serializes form data into a 'submittable' string. This method will return a string 10400 * in the format: name1=value1&name2=value2 10401 */
10402$.fn.formSerialize = function(semantic) { 10403 //hand off to jQuery.param for proper encoding 10404 return $.param(this.formToArray(semantic)); 10405}; 10406 10407/** 10408 * Serializes all field elements in the jQuery object into a query string. 10409 * This method will return a string in the format: name1=value1&name2=value2 10410 */ 10411$.fn.fieldSerialize = function(successful) { 10412 var a = []; 10413 this.each(function() { 10414 var n = this.name; 10415 if (!n) { 10416 return; 10417 } 10418 var v = $.fieldValue(this, successful); 10419 if (v && v.constructor == Array) { 10420 for (var i=0,max=v.length; i < max; i++) { 10421 a.push({name: n, value: v[i]}); 10422 } 10423 } 10424 else if (v !== null && typeof v != 'undefined') { 10425 a.push({name: this.name, value: v}); 10426 } 10427 }); 10428 //hand off to jQuery.param for proper encoding 10429 return $.param(a); 10430}; 10431 10432/** 10433 * Returns the value(s) of the element in the matched set. For example, consider the following form: 10434 * 10435 * <form><fieldset> 10436 * <input name="A" type="text" /> 10437 * <input name="A" type="text" /> 10438 * <input name="B" type="checkbox" value="B1" /> 10439 * <input name="B" type="checkbox" value="B2"/> 10440 * <input name="C" type="radio" value="C1" /> 10441 * <input name="C" type="radio" value="C2" /> 10442 * </fieldset></form> 10443 * 10444 * var v = $(':text').fieldValue(); 10445 * // if no values are entered into the text inputs 10446 * v == ['',''] 10447 * // if values entered into the text inputs are 'foo' and 'bar' 10448 * v == ['foo','bar'] 10449 * 10450 * var v = $(':checkbox').fieldValue(); 10451 * // if neither checkbox is checked 10452 * v === undefined 10453 * // if both checkboxes are checked 10454 * v == ['B1', 'B2'] 10455 * 10456 * var v = $(':radio').fieldValue(); 10457 * // if neither radio is checked 10458 * v === undefined 10459 * // if first radio is checked 10460 * v == ['C1'] 10461 * 10462 * The successful argument controls whether or not the field element must be 'successful' 10463 * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls). 10464 * The default value of the successful argument is true. If this value is false the value(s) 10465 * for each element is returned. 10466 * 10467 * Note: This method *always* returns an array. If no valid value can be determined the 10468 * array will be empty, otherwise it will contain one or more values. 10469 */ 10470$.fn.fieldValue = function(successful) { 10471 for (var val=[], i=0, max=this.length; i < max; i++) { 10472 var el = this[i]; 10473 var v = $.fieldValue(el, successful); 10474 if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) { 10475 continue; 10476 } 10477 v.constructor == Array ? $.merge(val, v) : val.push(v); 10478 } 10479 return val; 10480}; 10481 10482/** 10483 * Returns the value of the field element. 10484 */ 10485$.fieldValue = function(el, successful) { 10486 var n = el.name, t = el.type, tag = el.tagName.toLowerCase(); 10487 if (successful === undefined) { 10488 successful = true; 10489 } 10490 10491 if (successful && (!n || el.disabled || t == 'reset' || t == 'button' || 10492 (t == 'checkbox' || t == 'radio') && !el.checked || 10493 (t == 'submit' || t == 'image') && el.form && el.form.clk != el || 10494 tag == 'select' && el.selectedIndex == -1)) { 10495 return null; 10496 } 10497 10498 if (tag == 'select') { 10499 var index = el.selectedIndex; 10500 if (index < 0) { 10501 return null; 10502 } 10503 var a = [], ops = el.options; 10504 var one = (t == 'select-one'); 10505 var max = (one ? index+1 : ops.length); 10506 for(var i=(one ? index : 0); i < max; i++) { 10507 var op = ops[i]; 10508 if (op.selected) { 10509 var v = op.value; 10510 if (!v) { // extra pain for IE... 10511 v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value; 10512 } 10513 if (one) { 10514 return v; 10515 } 10516 a.push(v); 10517 } 10518 } 10519 return a; 10520 } 10521 return $(el).val(); 10522}; 10523 10524/** 10525 * Clears the form data. Takes the following actions on the form's input fields: 10526 * - input text fields will have their 'value' property set to the empty string 10527 * - select elements will have their 'selectedIndex' property set to -1 10528 * - checkbox and radio inputs will have their 'checked' property set to false 10529 * - inputs of type submit, button, reset, and hidden will *not* be effected 10530 * - button elements will *not* be effected 10531 */ 10532$.fn.clearForm = function(includeHidden) { 10533 return this.each(function() { 10534 $('input,select,textarea', this).clearFields(includeHidden); 10535 }); 10536}; 10537 10538/** 10539 * Clears the selected form elements. 10540 */ 10541$.fn.clearFields = $.fn.clearInputs = function(includeHidden) { 10542 var re = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i; // 'hidden' is not in this list 10543 return this.each(function() { 10544 var t = this.type, tag = this.tagName.toLowerCase(); 10545 if (re.test(t) || tag == 'textarea' || (includeHidden && /hidden/.test(t)) ) { 10546 this.value = ''; 10547 } 10548 else if (t == 'checkbox' || t == 'radio') { 10549 this.checked = false;
10550 } 10551 else if (tag == 'select') { 10552 this.selectedIndex = -1; 10553 } 10554 }); 10555}; 10556 10557/** 10558 * Resets the form data. Causes all form elements to be reset to their original value. 10559 */ 10560$.fn.resetForm = function() { 10561 return this.each(function() { 10562 // guard against an input with the name of 'reset' 10563 // note that IE reports the reset function as an 'object' 10564 if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) { 10565 this.reset(); 10566 } 10567 }); 10568}; 10569 10570/** 10571 * Enables or disables any matching elements. 10572 */ 10573$.fn.enable = function(b) { 10574 if (b === undefined) { 10575 b = true; 10576 } 10577 return this.each(function() { 10578 this.disabled = !b; 10579 }); 10580}; 10581 10582/** 10583 * Checks/unchecks any matching checkboxes or radio buttons and 10584 * selects/deselects and matching option elements. 10585 */ 10586$.fn.selected = function(select) { 10587 if (select === undefined) { 10588 select = true; 10589 } 10590 return this.each(function() { 10591 var t = this.type; 10592 if (t == 'checkbox' || t == 'radio') { 10593 this.checked = select; 10594 } 10595 else if (this.tagName.toLowerCase() == 'option') { 10596 var $sel = $(this).parent('select'); 10597 if (select && $sel[0] && $sel[0].type == 'select-one') { 10598 // deselect all other options 10599 $sel.find('option').selected(false); 10600 } 10601 this.selected = select; 10602 } 10603 }); 10604}; 10605 10606// expose debug var 10607$.fn.ajaxSubmit.debug = false; 10608 10609// helper fn for console logging 10610function log() { 10611 if (!$.fn.ajaxSubmit.debug) 10612 return; 10613 var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,''); 10614 if (window.console && window.console.log) { 10615 window.console.log(msg); 10616 } 10617 else if (window.opera && window.opera.postError) { 10618 window.opera.postError(msg); 10619 } 10620}; 10621 10622})(jQuery);; 10623/*! 10624 * jQuery blockUI plugin 10625 * Version 2.26 (09-SEP-2009) 10626 * @requires jQuery v1.2.3 or later 10627 * 10628 * Examples at: http://malsup.com/jquery/block/ 10629 * Copyright (c) 2007-2008 M. Alsup 10630 * Dual licensed under the MIT and GPL licenses: 10631 * http://www.opensource.org/licenses/mit-license.php 10632 * http://www.gnu.org/licenses/gpl.html 10633 * 10634 * Thanks to Amir-Hossein Sobhi for some excellent contributions! 10635 */ 10636 10637;(function($) { 10638 10639if (/1\.(0|1|2)\.(0|1|2)/.test($.fn.jquery) || /^1.1/.test($.fn.jquery)) { 10640 alert('blockUI requires jQuery v1.2.3 or later! You are using v' + $.fn.jquery); 10641 return; 10642} 10643 10644$.fn._fadeIn = $.fn.fadeIn; 10645 10646// this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle 10647// retarded userAgent strings on Vista) 10648var mode = document.documentMode || 0; 10649var setExpr = $.browser.msie && (($.browser.version < 8 && !mode) || mode < 8); 10650var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent) && !mode; 10651 10652// global $ methods for blocking/unblocking the entire page 10653$.blockUI = function(opts) { install(window, opts); }; 10654$.unblockUI = function(opts) { remove(window, opts); }; 10655 10656// convenience method for quick growl-like notifications (http://www.google.com/search?q=growl) 10657$.growlUI = function(title, message, timeout, onClose) { 10658 var $m = $('<div class="growlUI"></div>'); 10659 if (title) $m.append('<h1>'+title+'</h1>'); 10660 if (message) $m.append('<h2>'+message+'</h2>'); 10661 if (timeout == undefined) timeout = 3000; 10662 $.blockUI({ 10663 message: $m, fadeIn: 700, fadeOut: 1000, centerY: false, 10664 timeout: timeout, showOverlay: false, 10665 onUnblock: onClose, 10666 css: $.blockUI.defaults.growlCSS 10667 }); 10668}; 10669 10670// plugin method for blocking element content 10671$.fn.block = function(opts) { 10672 return this.unblock({ fadeOut: 0 }).each(function() { 10673 if ($.css(this,'position') == 'static') 10674 this.style.position = 'relative'; 10675 if ($.browser.msie) 10676 this.style.zoom = 1; // force 'hasLayout' 10677 install(this, opts); 10678 }); 10679}; 10680 10681// plugin method for unblocking element content 10682$.fn.unblock = function(opts) { 10683 return this.each(function() { 10684 remove(this, opts); 10685 }); 10686}; 10687 10688$.blockUI.version = 2.26; // 2nd generation blocking at no extra cost! 10689 10690// override these in your code to change the default behavior and style 10691$.blockUI.defaults = { 10692 // message displayed when blocking (use null for no message) 10693 message: '<h1>Please wait...</h1>', 10694 10695 title: null, // title string; only used when theme == true 10696 draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded) 10697 10698 theme: false, // set to true to use with jQuery UI themes 10699 10700 // styles for the message when blocking; if you wish to disable 10701 // these and use an external stylesheet then do this in your code: 10702 // $.blockUI.defaults.css = {}; 10703 css: { 10704 padding: '20px', 10705 margin: 'auto', 10706 width: 'auto', 10707 top: '40%', 10708 left: 0, 10709 right: 0, 10710 textAlign: 'center', 10711 cursor: 'wait' 10712 }, 10713 10714 // minimal style set used when themes are used 10715 themedCSS: { 10716 width: '30%', 10717 top: '40%', 10718 left: '35%' 10719 }, 10720 10721 // styles for the overlay 10722 overlayCSS: { 10723 cursor: 'wait' 10724 }, 10725 10726 // styles applied when using $.growlUI 10727 growlCSS: { 10728 width: '350px', 10729 top: '10px', 10730 left: '', 10731 right: '10px', 10732 border: 'none', 10733 padding: '5px', 10734 opacity: 0.6, 10735 cursor: 'default', 10736 color: '#fff', 10737 backgroundColor: '#000', 10738 '-webkit-border-radius': '10px', 10739 '-moz-border-radius': '10px' 10740 }, 10741 10742 // IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w 10743 // (hat tip to Jorge H. N. de Vasconcelos) 10744 iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank', 10745 10746 // force usage of iframe in non-IE browsers (handy for blocking applets) 10747 forceIframe: false, 10748 10749 // z-index for the blocking overlay 10750 baseZ: 1000, 10751 10752 // set these to true to have the message automatically centered 10753 centerX: true, // <-- only effects element blocking (page block controlled via css above) 10754 centerY: true, 10755 10756 // allow body element to be stetched in ie6; this makes blocking look better 10757 // on "short" pages. disable if you wish to prevent changes to the body height 10758 allowBodyStretch: true, 10759 10760 // enable if you want key and mouse events to be disabled for content that is blocked 10761 bindEvents: true, 10762 10763 // be default blockUI will supress tab navigation from leaving blocking content 10764 // (if bindEvents is true) 10765 constrainTabKey: true, 10766 10767 // fadeIn time in millis; set to 0 to disable fadeIn on block 10768 fadeIn: 200, 10769 10770 // fadeOut time in millis; set to 0 to disable fadeOut on unblock 10771 fadeOut: 400, 10772 10773 // time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock
10774 timeout: 0, 10775 10776 // disable if you don't want to show the overlay 10777 showOverlay: true, 10778 10779 // if true, focus will be placed in the first available input field when 10780 // page blocking 10781 focusInput: true, 10782 10783 // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity) 10784 applyPlatformOpacityRules: true, 10785 10786 // callback method invoked when unblocking has completed; the callback is 10787 // passed the element that has been unblocked (which is the window object for page 10788 // blocks) and the options that were passed to the unblock call: 10789 // onUnblock(element, options) 10790 onUnblock: null, 10791 10792 // don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493 10793 quirksmodeOffsetHack: 4 10794}; 10795 10796// private data and functions follow... 10797 10798var pageBlock = null; 10799var pageBlockEls = []; 10800 10801function install(el, opts) { 10802 var full = (el == window); 10803 var msg = opts && opts.message !== undefined ? opts.message : undefined; 10804 opts = $.extend({}, $.blockUI.defaults, opts || {}); 10805 opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {}); 10806 var css = $.extend({}, $.blockUI.defaults.css, opts.css || {}); 10807 var themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {}); 10808 msg = msg === undefined ? opts.message : msg; 10809 10810 // remove the current block (if there is one) 10811 if (full && pageBlock) 10812 remove(window, {fadeOut:0}); 10813 10814 // if an existing element is being used as the blocking content then we capture 10815 // its current place in the DOM (and current display style) so we can restore 10816 // it when we unblock 10817 if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) { 10818 var node = msg.jquery ? msg[0] : msg; 10819 var data = {}; 10820 $(el).data('blockUI.history', data); 10821 data.el = node; 10822 data.parent = node.parentNode; 10823 data.display = node.style.display; 10824 data.position = node.style.position; 10825 if (data.parent) 10826 data.parent.removeChild(node); 10827 } 10828 10829 var z = opts.baseZ; 10830 10831 // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform; 10832 // layer1 is the iframe layer which is used to supress bleed through of underlying content 10833 // layer2 is the overlay layer which has opacity and a wait cursor (by default) 10834 // layer3 is the message content that is displayed while blocking 10835 10836 var lyr1 = ($.browser.msie || opts.forceIframe) 10837 ? $('<iframe class="blockUI" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>') 10838 : $('<div class="blockUI" style="display:none"></div>'); 10839 var lyr2 = $('<div class="blockUI blockOverlay" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>'); 10840 10841 var lyr3; 10842 if (opts.theme && full) { 10843 var s = '<div class="blockUI blockMsg blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+z+';display:none;position:fixed">' + 10844 '<div class="ui-widget-header ui-dialog-titlebar blockTitle">'+(opts.title || ' ')+'</div>' + 10845 '<div class="ui-widget-content ui-dialog-content"></div>' + 10846 '</div>'; 10847 lyr3 = $(s); 10848 } 10849 else { 10850 lyr3 = full ? $('<div class="blockUI blockMsg blockPage" style="z-index:'+z+';display:none;position:fixed"></div>') 10851 : $('<div class="blockUI blockMsg blockElement" style="z-index:'+z+';display:none;position:absolute"></div>'); 10852 } 10853 10854 // if we have a message, style it 10855 if (msg) { 10856 if (opts.theme) { 10857 lyr3.css(themedCSS); 10858 lyr3.addClass('ui-widget-content'); 10859 } 10860 else 10861 lyr3.css(css); 10862 } 10863 10864 // style the overlay 10865 if (!opts.applyPlatformOpacityRules || !($.browser.mozilla && /Linux/.test(navigator.platform))) 10866 lyr2.css(opts.overlayCSS); 10867 lyr2.css('position', full ? 'fixed' : 'absolute'); 10868 10869 // make iframe layer transparent in IE 10870 if ($.browser.msie || opts.forceIframe) 10871 lyr1.css('opacity',0.0); 10872 10873 $([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el); 10874 10875 if (opts.theme && opts.draggable && $.fn.draggable) { 10876 lyr3.draggable({ 10877 handle: '.ui-dialog-titlebar', 10878 cancel: 'li' 10879 }); 10880 } 10881 10882 // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling) 10883 var expr = setExpr && (!$.boxModel || $('object,embed', full ? null : el).length > 0); 10884 if (ie6 || expr) { 10885 // give body 100% height 10886 if (full && opts.allowBodyStretch && $.boxModel) 10887 $('html,body').css('height','100%'); 10888 10889 // fix ie6 issue when blocked element has a border width 10890 if ((ie6 || !$.boxModel) && !full) { 10891 var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth'); 10892 var fixT = t ? '(0 - '+t+')' : 0; 10893 var fixL = l ? '(0 - '+l+')' : 0; 10894 } 10895 10896 // simulate fixed position 10897 $.each([lyr1,lyr2,lyr3], function(i,o) { 10898 var s = o[0].style; 10899 s.position = 'absolute'; 10900 if (i < 2) { 10901 full ? s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:'+opts.quir
10901ksmodeOffsetHack+') + "px"') 10902 : s.setExpression('height','this.parentNode.offsetHeight + "px"'); 10903 full ? s.setExpression('width','jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"') 10904 : s.setExpression('width','this.parentNode.offsetWidth + "px"'); 10905 if (fixL) s.setExpression('left', fixL); 10906 if (fixT) s.setExpression('top', fixT); 10907 } 10908 else if (opts.centerY) { 10909 if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'); 10910 s.marginTop = 0; 10911 } 10912 else if (!opts.centerY && full) { 10913 var top = (opts.css && opts.css.top) ? parseInt(opts.css.top) : 0; 10914 var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"'; 10915 s.setExpression('top',expression); 10916 } 10917 }); 10918 } 10919 10920 // show the message 10921 if (msg) { 10922 if (opts.theme) 10923 lyr3.find('.ui-widget-content').append(msg); 10924 else 10925 lyr3.append(msg); 10926 if (msg.jquery || msg.nodeType) 10927 $(msg).show(); 10928 } 10929 10930 if (($.browser.msie || opts.forceIframe) && opts.showOverlay) 10931 lyr1.show(); // opacity is zero 10932 if (opts.fadeIn) { 10933 if (opts.showOverlay) 10934 lyr2._fadeIn(opts.fadeIn); 10935 if (msg) 10936 lyr3.fadeIn(opts.fadeIn); 10937 } 10938 else { 10939 if (opts.showOverlay) 10940 lyr2.show(); 10941 if (msg) 10942 lyr3.show(); 10943 } 10944 10945 // bind key and mouse events 10946 bind(1, el, opts); 10947 10948 if (full) { 10949 pageBlock = lyr3[0]; 10950 pageBlockEls = $(':input:enabled:visible',pageBlock); 10951 if (opts.focusInput) 10952 setTimeout(focus, 20); 10953 } 10954 else 10955 center(lyr3[0], opts.centerX, opts.centerY); 10956 10957 if (opts.timeout) { 10958 // auto-unblock 10959 var to = setTimeout(function() { 10960 full ? $.unblockUI(opts) : $(el).unblock(opts); 10961 }, opts.timeout); 10962 $(el).data('blockUI.timeout', to); 10963 } 10964}; 10965 10966// remove the block 10967function remove(el, opts) { 10968 var full = (el == window); 10969 var $el = $(el); 10970 var data = $el.data('blockUI.history'); 10971 var to = $el.data('blockUI.timeout'); 10972 if (to) { 10973 clearTimeout(to); 10974 $el.removeData('blockUI.timeout'); 10975 } 10976 opts = $.extend({}, $.blockUI.defaults, opts || {}); 10977 bind(0, el, opts); // unbind events 10978 10979 var els; 10980 if (full) // crazy selector to handle odd field errors in ie6/7 10981 els = $('body').children().filter('.blockUI').add('body > .blockUI'); 10982 else 10983 els = $('.blockUI', el); 10984 10985 if (full) 10986 pageBlock = pageBlockEls = null; 10987 10988 if (opts.fadeOut) { 10989 els.fadeOut(opts.fadeOut); 10990 setTimeout(function() { reset(els,data,opts,el); }, opts.fadeOut); 10991 } 10992 else 10993 reset(els, data, opts, el); 10994}; 10995 10996// move blocking element back into the DOM where it started 10997function reset(els,data,opts,el) { 10998 els.each(function(i,o) { 10999 // remove via DOM calls so we don't lose event handlers 11000 if (this.parentNode) 11001 this.parentNode.removeChild(this); 11002 }); 11003 11004 if (data && data.el) { 11005 data.el.style.display = data.display; 11006 data.el.style.position = data.position; 11007 if (data.parent) 11008 data.parent.appendChild(data.el); 11009 $(data.el).removeData('blockUI.history'); 11010 } 11011 11012 if (typeof opts.onUnblock == 'function') 11013 opts.onUnblock(el,opts); 11014}; 11015 11016// bind/unbind the handler 11017function bind(b, el, opts) { 11018 var full = el == window, $el = $(el); 11019 11020 // don't bother unbinding if there is nothing to unbind 11021 if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked'))) 11022 return; 11023 if (!full) 11024 $el.data('blockUI.isBlocked', b); 11025 11026 // don't bind events when overlay is not in use or if bindEvents is false 11027 if (!opts.bindEvents || (b && !opts.showOverlay)) 11028 return; 11029 11030 // bind anchors and inputs for mouse and key events 11031 var events = 'mousedown mouseup keydown keypress'; 11032 b ? $(document).bind(events, opts, handler) : $(document).unbind(events, handler); 11033 11034// former impl... 11035// var $e = $('a,:input'); 11036// b ? $e.bind(events, opts, handler) : $e.unbind(events, handler); 11037}; 11038 11039// event handler to suppress keyboard/mouse events when blocking 11040function handler(e) { 11041 // allow tab navigation (conditionally) 11042 if (e.keyCode && e.keyCode == 9) { 11043 if (pageBlock && e.data.constrainTabKey) { 11044 var els = pageBlockEls; 11045 var fwd = !e.shiftKey && e.target == els[els.length-1]; 11046 var back = e.shiftKey && e.target == els[0]; 11047 if (fwd || back) { 11048 setTimeout(function(){focus(back)},10); 11049 return false;
11050 } 11051 } 11052 } 11053 // allow events within the message content 11054 if ($(e.target).parents('div.blockMsg').length > 0) 11055 return true; 11056 11057 // allow events for content that is not being blocked 11058 return $(e.target).parents().children().filter('div.blockUI').length == 0; 11059}; 11060 11061function focus(back) { 11062 if (!pageBlockEls) 11063 return; 11064 var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0]; 11065 if (e) 11066 e.focus(); 11067}; 11068 11069function center(el, x, y) { 11070 var p = el.parentNode, s = el.style; 11071 var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth'); 11072 var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth'); 11073 if (x) s.left = l > 0 ? (l+'px') : '0'; 11074 if (y) s.top = t > 0 ? (t+'px') : '0'; 11075}; 11076 11077function sz(el, p) { 11078 return parseInt($.css(el,p))||0; 11079}; 11080 11081})(jQuery); 11082; 11083// $Id: uc_ajax_cart.js,v 1.1.2.11 2010/05/01 12:42:30 erikseifert Exp $ 11084 11085Drupal.behaviors.ucAjaxCart = function (context) { 11086 11087 if (!Drupal.uc_ajax_cart) { 11088 // First initialization. 11089 11090 // Set up UC Ajax Cart namespace. 11091 Drupal.uc_ajax_cart = {}; 11092 11093 // Populate namespace. 11094 Drupal.uc_ajax_cart.cart_open_state = true; 11095 Drupal.uc_ajax_cart.unblock_handler = function () {Drupal.uc_ajax_cart.blockUI_blocked -= 1;} 11096 Drupal.uc_ajax_cart.blockUI_blocked = 0; 11097 Drupal.uc_ajax_cart.cart_wrapper = jQuery('#block-uc_ajax_cart-0', context); 11098 Drupal.uc_ajax_cart.update_container = jQuery('#ajaxCartUpdate', context); 11099 11100 // BlockUI settings. 11101 jQuery.blockUI.defaults.growlCSS.opacity = 1; 11102 jQuery.blockUI.defaults.timeout = Drupal.settings.uc_ajax_cart.TIMEOUT; 11103 jQuery.blockUI.defaults.onUnblock = Drupal.uc_ajax_cart.unblock_handler; 11104 } 11105 11106 // Ubercart Cart links support. 11107 jQuery('a.ajax-cart-link', context).not('.ajax-cart-processed').each(function () { 11108 var $elem = $(this); 11109 // Check for ajaxify class. 11110 if (_checkAjaxify($elem)) { 11111 $elem.bind('click', function () { 11112 Drupal.theme('ajaxCartMessage', Drupal.settings.uc_ajax_cart.ADD_TITLE, '<span class="uc-ajax-cart-throbber">' + ajaxCartPickMessage(Drupal.settings.uc_ajax_cart.ADD_MESSAGES) + '</span>'); 11113 jQuery.get(Drupal.settings.uc_ajax_cart.CART_LINK_CALLBACK, 11114 {href: this.href}, 11115 ajaxCartFormSubmitted); 11116 return false; 11117 }) 11118 } 11119 }).addClass('ajax-cart-processed'); 11120 11121 // Ubercart submit. 11122 jQuery('form.ajax-cart-submit-form input.ajax-cart-submit-form-button', context).not('.ajax-cart-processed, #edit-update').each(function () { 11123 var $elem = $(this); 11124 // Check for ajaxify class. 11125 if (_checkAjaxify($elem)) { 11126 $elem.click(function () { 11127 var form = jQuery(this).parents('form').eq(0); 11128 form.ajaxSubmit({ 11129 url : Drupal.settings.uc_ajax_cart.CALLBACK, 11130 beforeSubmit : function () { 11131 Drupal.theme('ajaxCartMessage', Drupal.settings.uc_ajax_cart.ADD_TITLE, '<span class="uc-ajax-cart-throbber">' + ajaxCartPickMessage(Drupal.settings.uc_ajax_cart.ADD_MESSAGES) + '</span>'); 11132 }, 11133 success : ajaxCartFormSubmitted, 11134 type : 'post', 11135 data: {'op': $elem.val()} 11136 }); 11137 return false; 11138 }); 11139 } 11140 }).addClass('ajax-cart-processed'); 11141 11142 // Call behaviors over cart block. 11143 ajaxCartBlockBehaviors(context); 11144 11145 // Call behaviors over cart page. 11146 ajaxCartPageBehaviors(context); 11147 11148 // Check for autoupdate cart block. 11149 if (context == document) { 11150 if (Drupal.uc_ajax_cart.update_container.not('.ajax-cart-processed').hasClass('load-on-view')) { 11151 Drupal.uc_ajax_cart.update_container.html(Drupal.t('<center>ÐагÑÑзка коÑзинÑ...</center>')); 11152 Drupal.uc_ajax_cart.update_container.addClass('ajax-cart-processed'); 11153 ajaxCartUpdateBlockCart(); 11154 } 11155 } 11156} 11157 11158 11159 11160// Submits product changes using AJAX and updates cart and cart block accordingly. 11161function ajaxCartSubmit() { 11162 var button = jQuery(this); 11163 jQuery(this).parents('form').ajaxSubmit({ 11164 url: Drupal.settings.uc_ajax_cart.UPDATE_CALLBACK, 11165 success: ajaxCartFormSubmitted, 11166 beforeSubmit: function () { 11167 jQuery('#uc-cart-view-form input').attr('disabled', 'disabled'); 11168 Drupal.theme('ajaxCartMessage', Drupal.settings.uc_ajax_cart.UPDATE_TITLE, '<span class="uc-ajax-cart-throbber">' + ajaxCartPickMessage(Drupal.settings.uc_ajax_cart.UPDATE_MESSAGES) + '</span>'); 11169 }, 11170 data: {'op': button.val()} 11171 }); 11172 return false;
11173} 11174 11175// Triggers cart submit button. 11176function triggerCartSubmit() { 11177 jQuery('#uc-cart-view-form #edit-update:first').trigger('click'); 11178} 11179 11180 11181// Process behaviors for the cart from cart page. 11182function ajaxCartPageBehaviors(context) { 11183 // Hide update cart button if needed. 11184 jQuery('.uc-ajax-cart-hidden-update-bt', context).hide(); 11185 11186 if (Drupal.settings.uc_ajax_cart.AJAXIFY_CART_PAGE) { 11187 11188 // Set handler for cart submit button. 11189 jQuery('#uc-cart-view-form #edit-update', context).not('.ajax-cart-processed').bind('click', ajaxCartSubmit).addClass('ajax-cart-processed'); 11190 11191 // Trigger submit button when cart qty form input elements are changed. 11192 jQuery('#uc-cart-view-form .qty input', context).not('.ajax-cart-processed').bind('change', function (e) { 11193 triggerCartSubmit(); 11194 return false; 11195 }) 11196 .bind('keypress', function(e) { 11197 // Handle <Enter> keypress on some browsers - see #1493398 11198 if (e.keyCode && e.keyCode == '13') { 11199 triggerCartSubmit(); 11200 return false; 11201 } 11202 }) 11203 .addClass('ajax-cart-processed'); 11204 11205 // Ubercart has changed remove checkboxes to buttons above Ubercart 2.4. 11206 jQuery('#uc-cart-view-form .remove input', context).not('.ajax-cart-processed').each(function () { 11207 var elem = $(this); 11208 var is_button = false; 11209 if (elem.attr('type') != 'checkbox') { 11210 is_button = true; 11211 } 11212 elem.click(function (e) { 11213 if (is_button) { 11214 $(this).parents('tr').eq(0).find('td.qty input').val('0'); 11215 } 11216 triggerCartSubmit(); 11217 return false; 11218 }); 11219 elem.addClass('ajax-cart-processed'); 11220 }); 11221 } 11222} 11223 11224 11225// Process behaviors for the cart block. 11226function ajaxCartBlockBehaviors(context) { 11227 // Set up ajax-cart-view-handler if present. 11228 var cart_handler = $('#ajax-cart-view-handler', context); 11229 if (cart_handler.length) { 11230 var link = $('<a></a>'); 11231 cart_handler.html(link); 11232 link.attr('href', '#').click(ajaxCartUpdateBlockCart).text(Drupal.t('Click to load cart contents')); 11233 } 11234 // Is the cart in the received context? 11235 var cart_pane = jQuery('#cart-block-contents-ajax', context); 11236 if (cart_pane.length) { 11237 // Update internal variables 11238 Drupal.uc_ajax_cart.cart_pane = cart_pane; 11239 // Rendered HTML results in an open cart by default 11240 Drupal.uc_ajax_cart.cart_open_state = true; 11241 Drupal.uc_ajax_cart.cart_wrapper.addClass('cart-open'); 11242 if (Drupal.uc_ajax_cart.cart_wrapper) { 11243 if (Drupal.settings.uc_ajax_cart.COLLAPSIBLE_CART) { 11244 // Check open state tracking. 11245 if (Drupal.settings.uc_ajax_cart.TRACK_CLOSED_STATE) { 11246 ajaxCartCheckCookieCartState(); 11247 } 11248 else if (Drupal.settings.uc_ajax_cart.INITIAL_CLOSED_STATE) { 11249 // Close cart block. 11250 ajaxCartCloseCart(true); 11251 } 11252 } 11253 } 11254 11255 $('#ajaxCartToggleView', context).not('.ajax-cart-processed').click(function () { 11256 ajaxCartToggleView(); 11257 return false; 11258 }) 11259 .addClass('ajax-cart-processed'); 11260 } 11261} 11262 11263 11264// Opens cart block. 11265// Sets cookie if track open state enabled. 11266function ajaxCartOpenCart(instantly) { 11267 if (!Drupal.uc_ajax_cart.cart_open_state) { 11268 Drupal.uc_ajax_cart.cart_open_state = true; 11269 if ((!instantly) && (Drupal.settings.uc_ajax_cart.CART_PANE_EFFECT)) { 11270 Drupal.uc_ajax_cart.cart_pane.slideDown(Drupal.settings.uc_ajax_cart.CART_PANE_EFFECT_DURATION); 11271 } 11272 else { 11273 Drupal.uc_ajax_cart.cart_pane.show(); 11274 } 11275 Drupal.uc_ajax_cart.cart_wrapper.addClass('cart-open'); 11276 11277 if (Drupal.settings.uc_ajax_cart.TRACK_CLOSED_STATE) { 11278 jQuery.cookie('ajax-cart-visible', '1', {path: '/'}); 11279 } 11280 } 11281} 11282 11283 11284// Closes cart block. 11285// Sets cookie if track open state enabled. 11286function ajaxCartCloseCart(instantly) { 11287 if (Drupal.uc_ajax_cart.cart_open_state) { 11288 Drupal.uc_ajax_cart.cart_open_state = false; 11289 if ((!instantly) && (Drupal.settings.uc_ajax_cart.CART_PANE_EFFECT)) { 11290 Drupal.uc_ajax_cart.cart_pane.slideUp(Drupal.settings.uc_ajax_cart.CART_PANE_EFFECT_DURATION); 11291 } 11292 else { 11293 Drupal.uc_ajax_cart.cart_pane.hide(); 11294 } 11295 Drupal.uc_ajax_cart.cart_wrapper.removeClass('cart-open'); 11296 11297 if (Drupal.settings.uc_ajax_cart.TRACK_CLOSED_STATE && (jQuery.cookie('ajax-cart-visible') != '0')) { 11298 jQuery.cookie('ajax-cart-visible', '0', {path: '/'}); 11299 } 11300 } 11301} 11302 11303// Checks open state cookie and changes cart open state accordingly. 11304function ajaxCartCheckCookieCartState() { 11305 var cookie_state = jQuery.cookie('ajax-cart-visible'); 11306 11307 if (Drupal.uc_ajax_cart.cart_open_state != cookie_state) { 11308 if (cookie_state == true) { 11309 ajaxCartOpenCart(true); 11310 } 11311 else { 11312 ajaxCartCloseCart(true); 11313 } 11314 } 11315} 11316 11317// Toggle cart block. 11318function ajaxCartToggleView() { 11319 Drupal.uc_ajax_cart.cart_open_state ? ajaxCartCloseCart() : ajaxCartOpenCart(); 11320} 11321 11322 11323// Processes after cart form is submitted. 11324function ajaxCartFormSubmitted(e) { 11325 // Enable input elements from cart from cart page. 11326 jQuery('form.ajax-cart-submit-form input').attr('disabled', false); 11327 11328 // Update cart block. 11329 ajaxCartUpdateBlockCart(); 11330 11331 if (e) 11332 Drupal.theme('ajaxCartMessage', Drupal.settings.uc_ajax_cart.CART_OPERATION, e); 11333 11334 // Update the page if we're on it. 11335 ajaxCartReloadCartView(); 11336} 11337 11338/* 11339 * This function is used in uc_ajax_cart.theme.inc on an onclick= statement. 11340 * @TODO: Remove it from there and add it here. The main problem with it is 11341 * that when the products are added, we need to reattach Drupal behaviors 11342 * to the added elements. This has proven not to be that easy, we might a bit 11343 * of a rework and cleaning to do that. 11344 */ 11345function ajaxCartBlockUIRemove(url) { 11346 jQuery('#uc-cart-view-form input').attr('disabled', 'disabled'); 11347 Drupal.theme('ajaxCartMessage', Drupal.settings.uc_ajax_cart.REMOVE_TITLE, '<span class="uc-ajax-cart-throbber">' + ajaxCartPickMessage(Drupal.settings.uc_ajax_cart.REMOVE_MESSAGES) + '</span>');
11348 jQuery.post(url, ajaxCartFormSubmitted); 11349 return false; 11350} 11351 11352 11353// Loads cart block contents using ajax. 11354function ajaxCartUpdateBlockCart() { 11355 if (jQuery('#block-uc_ajax_cart-0').length) { 11356 Drupal.uc_ajax_cart.update_container.load(Drupal.settings.uc_ajax_cart.SHOW_CALLBACK, '', function() { 11357 var context = Drupal.uc_ajax_cart.update_container; 11358 Drupal.attachBehaviors(context); 11359 }); 11360 } 11361 return false; 11362} 11363 11364 11365// Reloads standard Ubercart cart form from cart page. 11366function ajaxCartReloadCartView() { 11367 if (jQuery('#cart-form-pane').length) { 11368 // When we get the new form, it is returned using AJAX callback as the 11369 // form's action URL. Workaround by storing and resetting on new DOM element 11370 var previous_action = jQuery('#uc-cart-view-form').attr('action'); 11371 jQuery('#cart-form-pane').parent().load(Drupal.settings.uc_ajax_cart.SHOW_VIEW_CALLBACK, function() { 11372 jQuery('#uc-cart-view-form').attr('action', previous_action); 11373 var context = jQuery('#cart-form-pane').parent(); 11374 Drupal.attachBehaviors(context); 11375 }); 11376 } 11377} 11378 11379/** 11380 * Checks if a add to cart input submit button element must be ajaxified. 11381 */ 11382function _checkAjaxify($elem) { 11383 var rc = true; 11384 if (Drupal.settings.uc_ajax_cart.AJAXIFY_CLASS) { 11385 rc = $elem.parents().add($elem).is('.' + Drupal.settings.uc_ajax_cart.AJAXIFY_CLASS); 11386 rc = Drupal.settings.uc_ajax_cart.AJAXIFY_CLASS_EXCLUDES ? !rc : rc; 11387 } 11388 return rc; 11389} 11390 11391Drupal.theme.prototype.ajaxCartMessage = function (title, message) { 11392 if (Drupal.settings.uc_ajax_cart.HIDE_CART_OPERATIONS) { 11393 return; 11394 } 11395 if (title) { 11396 title = '<h2 class="uc-ajax-cart-title">' + title + '</div>'; 11397 } 11398 11399 // Check if UI is blocked. Blocked UI implies no fader in to avoid flickering. 11400 var fadein = 0; 11401 if (!Drupal.uc_ajax_cart.blockUI_blocked) { 11402 fadein = 500; 11403 } 11404 11405 Drupal.uc_ajax_cart.blockUI_blocked += 1; 11406 if (Drupal.settings.uc_ajax_cart.BLOCK_UI == 1) { 11407 jQuery.blockUI({message : '<div class="uc-ajax-cart-blockui">' + title + message + '</div>', fadeIn: fadein}); 11408 } 11409 else { 11410 jQuery.blockUI({ 11411 message: '<div class="uc-ajax-cart-blockui-growlui">'+ title + message + '</div>', 11412 fadeIn: fadein, 11413 fadeOut: 700, 11414 showOverlay: false, 11415 centerY: false, 11416 css: { 11417 width: '350px', 11418 top: '10px', 11419 left: '', 11420 right: '10px', 11421 border: 'none', 11422 padding: '10px', 11423 backgroundColor: '#000',
11424 '-webkit-border-radius': '10px', 11425 '-moz-border-radius': '10px', 11426 'border-radius': '10px', 11427 color: '#fff', 11428 opacity: 1 11429 } 11430 }); 11431 } 11432} 11433 11434function ajaxCartPickMessage(messages) { 11435 return messages[Math.floor(Math.random() * messages.length)]; 11436} 11437 11438$(document).ready(function () { 11439$('.block-title').click(function () { 11440$('#cart-block-contents-ajax').slideToggle(0); });}); 11441 11442/** 11443 * @file 11444 * Adds effects and behaviors to the cart block. 11445 */ 11446 11447/** 11448 * Set the behavior to (un)collapse the cart block on a click 11449 */ 11450Drupal.behaviors.ucCollapseBlock = function(context) { 11451 $('.block-title:not(.ucCollapseBlock-processed)', context).addClass('ucCollapseBlock-processed').click( 11452 function() { 11453 cart_block_toggle(); 11454 } 11455 ); 11456} 11457 11458/** 11459 * Collapse the shopping cart block at page load. 11460 */ 11461$(document).ready( 11462 function() { 11463 if (Drupal.settings.ucCollapsedBlock == true) { 11464 // Add the appropriate title bar class. 11465 $('.block-title').addClass('cart-block-toggle'); 11466 11467 // Add the appropriate arrow class. 11468 $('.cart-block-arrow').removeClass('arrow-down').addClass('arrow-up'); 11469 } 11470 else { 11471 // Add the appropriate arrow class. 11472 $('.cart-block-arrow').removeClass('arrow-up').addClass('arrow-down'); 11473 } 11474 } 11475); 11476 11477/** 11478 * Toggle the shopping cart block open and closed. 11479 */ 11480function cart_block_toggle() { 11481 // Toggle the class of the cart block arrow. 11482 if ($('.cart-block-arrow').hasClass('arrow-up')) { 11483 $('.cart-block-arrow').removeClass('arrow-up').addClass('arrow-down'); 11484 } 11485 else { 11486 $('.cart-block-arrow').removeClass('arrow-down').addClass('arrow-up'); 11487 } 11488}; 11489/** 11490 * Cookie plugin 11491 * 11492 * Copyright (c) 2006 Klaus Hartl (stilbuero.de) 11493 * Dual licensed under the MIT and GPL licenses: 11494 * http://www.opensource.org/licenses/mit-license.php 11495 * http://www.gnu.org/licenses/gpl.html 11496 * 11497 */ 11498 11499/** 11500 * Create a cookie with the given name and value and other optional parameters. 11501 * 11502 * @example $.cookie('the_cookie', 'the_value'); 11503 * @desc Set the value of a cookie. 11504 * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true }); 11505 * @desc Create a cookie with all available options. 11506 * @example $.cookie('the_cookie', 'the_value'); 11507 * @desc Create a session cookie. 11508 * @example $.cookie('the_cookie', null); 11509 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain 11510 * used when the cookie was set. 11511 * 11512 * @param String name The name of the cookie. 11513 * @param String value The value of the cookie. 11514 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes. 11515 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. 11516 * If a negative value is specified (e.g. a date in the past), the cookie will be deleted. 11517 * If set to null or omitted, the cookie will be a session cookie and will not be retained 11518 * when the the browser exits. 11519 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). 11520 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). 11521 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will 11522 * require a secure protocol (like HTTPS). 11523 * @type undefined 11524 * 11525 * @name $.cookie 11526 * @cat Plugins/Cookie 11527 * @author Klaus Hartl/[email protected] 11528 */ 11529 11530/** 11531 * Get the value of a cookie with the given name. 11532 * 11533 * @example $.cookie('the_cookie'); 11534 * @desc Get the value of a cookie. 11535 * 11536 * @param String name The name of the cookie. 11537 * @return The value of the cookie. 11538 * @type String 11539 * 11540 * @name $.cookie 11541 * @cat Plugins/Cookie 11542 * @author Klaus Hartl/[email protected] 11543 */ 11544jQuery.cookie = function(name, value, options) { 11545 if (typeof value != 'undefined') { // name and value given, set cookie 11546 options = options || {}; 11547 if (value === null) { 11548 value = ''; 11549 options.expires = -1; 11550 } 11551 var expires = ''; 11552 if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { 11553 var date; 11554 if (typeof options.expires == 'number') { 11555 date = new Date(); 11556 date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); 11557 } else { 11558 date = options.expires; 11559 } 11560 expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE 11561 } 11562 // CAUTION: Needed to parenthesize options.path and options.domain 11563 // in the following expressions, otherwise they evaluate to undefined 11564 // in the packed version for some reason... 11565 var path = options.path ? '; path=' + (options.path) : ''; 11566 var domain = options.domain ? '; domain=' + (options.domain) : ''; 11567 var secure = options.secure ? '; secure' : ''; 11568 document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); 11569 } else { // only name given, get cookie 11570 var cookieValue = null; 11571 if (document.cookie && document.cookie != '') { 11572 var cookies = document.cookie.split(';'); 11573 for (var i = 0; i < cookies.length; i++) { 11574 var cookie = jQuery.trim(cookies[i]); 11575 // Does this cookie string begin with the name we want? 11576 if (cookie.substring(0, name.length + 1) == (name + '=')) { 11577 cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); 11578 break; 11579 } 11580 } 11581 } 11582 return cookieValue; 11583 } 11584};; 11585/* Created by YOHO */ 11586/*jshint forin:true, noarg:true, noempty:true, eqeqeq:true, bitwise:true, strict:true, undef:true, curly:false, browser:true, jquery:false */ 11587/*global jQuery */ 11588 11589// css helper 11590(function ($) { 11591 'use strict'; 11592 var data = [ 11593 { str: navigator.userAgent, sub: 'Chrome', ver: 'Chrome', name: 'chrome' }, 11594 { str: navigator.vendor, sub: 'Apple', ver: 'Version', name: 'safari' }, 11595 { prop: window.opera, ver: 'Opera', name: 'opera' }, 11596 { str: navigator.userAgent, sub: 'Firefox', ver: 'Firefox', name: 'firefox' }, 11597 { str: navigator.userAgent, sub: 'MSIE', ver: 'MSIE', name: 'ie' } 11598 ]; 11599 var v = function (s, n) { 11600 var i = s.indexOf(data[n].ver); 11601 return (i !== -1) ? parseInt(s.substring(i + data[n].ver.length + 1), 10) : ''; 11602 }; 11603 var html = $('html'); 11604 for (var n = 0; n < data.length; n++) { 11605 if ((data[n].str && (data[n].str.indexOf(data[n].sub) !== -1)) || data[n].prop
11605) { 11606 html.addClass(data[n].name + ' ' + data[n].name + v(navigator.userAgent, n) || v(navigator.appVersion, n)); 11607 break; 11608 } 11609 } 11610 11611 // 'desktop' class is used as responsive design initial value 11612 html.addClass('desktop'); 11613})(jQuery); 11614 11615jQuery(function ($) { 11616 'use strict'; 11617 var i, j, k, l, m; 11618 if (!$.browser.msie || parseInt($.browser.version, 10) !== 9) { 11619 return; 11620 } 11621 11622 var splitByTokens = function (str, startToken, endToken, last) { 11623 if (!last) { 11624 last = false; 11625 } 11626 var startPos = str.indexOf(startToken); 11627 if (startPos !== -1) { 11628 startPos += startToken.length; 11629 var endPos = last ? str.lastIndexOf(endToken) : str.indexOf(endToken, startPos); 11630 11631 if (endPos !== -1 && endPos > startPos) { 11632 return str.substr(startPos, endPos - startPos); 11633 } 11634 } 11635 return ''; 11636 }; 11637 11638 var splitWithBrackets = function (str, token, brackets) { 11639 /*jshint nonstandard:true */ 11640 if (!token) { 11641 token = ','; 11642 } 11643 if (!brackets) { 11644 brackets = '()'; 11645 } 11646 var bracket = 0; 11647 var startPos = 0; 11648 var result = []; 11649 if (brackets.lenght < 2) { 11650 return result; 11651 } 11652 var pos = 0; 11653 while (pos < str.length) { 11654 var ch = str[pos]; 11655 if (ch === brackets[0]) { 11656 bracket++; 11657 } 11658 if (ch === brackets[1]) { 11659 bracket--; 11660 } 11661 if (ch === token && bracket < 1) { 11662 result.push(str.substr(startPos, pos - startPos)); 11663 startPos = pos + token.length; 11664 } 11665 pos++; 11666 } 11667 result.push(str.substr(startPos, pos - startPos)); 11668 return result; 11669 }; 11670 11671 var byteToHex = function (d) { 11672 var hex = Number(d).toString(16); 11673 while (hex.length < 2) { 11674 hex = "0" + hex; 11675 } 11676 return hex; 11677 }; 11678 11679 for (i = 0; i < document.styleSheets.length; i++) { 11680 var s = document.styleSheets[i]; 11681 var r = [s]; 11682 for (j = 0; j < s.imports.length; j++) { 11683 r.push(s.imports[j]); 11684 } 11685 for (j = 0; j < r.length; j++) { 11686 s = r[j]; 11687 var n = []; 11688 for (k = 0; k < s.rules.length; k++) { 11689 var css = s.rules[k].cssText || s.rules[k].style.cssText; 11690 if (!css) { 11691 continue; 11692 } 11693 var value = splitByTokens(css, '-svg-background:', ';'); 11694 if (value === '') { 11695 continue; 11696 } 11697 var values = splitWithBrackets(value); 11698 for (l = 0; l < values.length; l++) { 11699 var g = splitByTokens(values[l], 'linear-gradient(', ')', true); 11700 if (g === '') { 11701 continue; 11702 } 11703 var args = splitWithBrackets(g); 11704 if (args.length < 3) { 11705 continue; 11706 } 11707 var maxOffset = 0; 11708 var stops = []; 11709 for (m = 1; m < args.length; m++) { 11710 var stopValues = splitWithBrackets(args[m].trim(), ' '); 11711 if (stopValues.length < 2) { 11712 continue; 11713 } 11714 var stopColor = stopValues[0].trim(); 11715 var stopOpacity = 1; 11716 var colorRgba = splitByTokens(stopColor, 'rgba(', ')', true); 11717 var stopOffset = stopValues[1].trim(); 11718 if (colorRgba !== "") { 11719 var rgba = colorRgba.split(','); 11720 if (rgba.length < 4) { 11721 continue; 11722 } 11723 stopColor = '#' + byteToHex(rgba[0]) + byteToHex(rgba[1]) + byteToHex(rgba[2]); 11724 stopOpacity = rgba[3]; 11725 } 11726 var isPx = stopOffset.indexOf('px') !== -1; 11727 if (isPx) { 11728 maxOffset = Math.max(maxOffset, parseInt(stopOffset, 10) || 0); 11729 } 11730 stops.push({ offset: stopOffset, color: stopColor, opacity: stopOpacity, isPx: isPx }); 11731 } 11732 var stopsXML = ''; 11733 var lastStop = null; 11734 for (m = 0; m < stops.length; m++) { 11735 if (stops[m].isPx) { 11736 stops[m].offset = ((parseInt(stops[m].offset, 10) || 0) / (maxOffset / 100)) + '%'; 11737 } 11738 stopsXML += '<stop offset="' + stops[m].offset + '" stop-color="' + stops[m].color + '" stop-opacity="' + stops[m].opacity + '"/>'; 11739 if (m === stops.length - 1) { 11740 lastStop = stops[m]; 11741 } 11742 } 11743 var isLeft = args[0].trim() === 'left'; 11744 var direction = 'x1="0%" y1="0%" ' + (isLeft ? 'x2="100%" y2="0%"' : 'x2="0%" y2="
11744100%"'); 11745 var gradientLength = '100%'; 11746 if (maxOffset > 0) { 11747 gradientLength = maxOffset + 'px'; 11748 } 11749 var size = (isLeft ? 'width="' + gradientLength + '" height="100%"' : 'width="100%" height="' + gradientLength + '"'); 11750 var last = ""; 11751 if (lastStop !== null && maxOffset > 0) { 11752 last = '<rect ' + 11753 (isLeft ? 11754 'x="' + maxOffset + '" y="0"' : 11755 'x="0" y="' + maxOffset + '"') + 11756 ' width="100%" height="100%" style="fill:' + lastStop.color + ';opacity:' + lastStop.opacity + ';"/>'; 11757 11758 } 11759 var svgGradient = '<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none"><linearGradient id="g" gradientUnits="objectBoundingBox" ' + direction + '>' + stopsXML + '</linearGradient><rect x="0" y="0" ' + size + ' fill="url(#g)" />' + last + '</svg>'; 11760 values[l] = values[l].replace('linear-gradient(' + g + ')', 'url(data:image/svg+xml,' + escape(svgGradient) + ')'); 11761 } 11762 n.push({ s: s.rules[k].selectorText, v: 'background: ' + values.join(",") }); 11763 } 11764 for (k = 0; k < n.length; k++) { 11765 s.addRule(n[k].s, n[k].v); 11766 } 11767 } 11768 } 11769}); 11770 11771jQuery(function ($) { 11772 'use strict'; 11773 // ie < 9 slider multiple background fix 11774 if (!jQuery.browser.msie || jQuery.browser.version > 8) return; 11775 11776 function split(str) { 11777 str = str.replace(/"/g, '').replace(/%20/g, ''); 11778 return str.split(/\s*,\s*/); 11779 } 11780 11781 $('.art-slider .art-slide-item').each(function () { 11782 var bgs = split($(this).css('background-image')); 11783 // needs to use the last image 11784 if (bgs.length > 1) { 11785 $(this).css("background-image", bgs[bgs.length - 1]); 11786 } 11787 }); 11788}); 11789jQuery(window).bind("resize", function () { 11790 /*global responsiveDesign */ 11791 'use strict'; 11792 if (typeof responsiveDesign !== "undefined" && responsiveDesign.isResponsive) 11793 return; 11794 var sheetLeft = jQuery(".art-sheet").offset().left; 11795 jQuery("header.art-header #art-flash-area").each(function () { 11796 var object = jQuery(this); 11797 object.css("left", sheetLeft + "px"); 11798 }); 11799}); 11800 11801jQuery(function($) { 11802 'use strict'; 11803 $('nav.art-nav').addClass("desktop-nav"); 11804}); 11805 11806 11807jQuery(function ($) { 11808 'use strict'; 11809 if (!$.browser.msie || parseInt($.browser.version, 10) > 7) { 11810 return; 11811 } 11812 $('ul.art-hmenu>li:not(:first-child)').each(function () { $(this).prepend('<span class="art-hmenu-separator"> </span>'); }); 11813}); 11814 11815jQuery(function ($) { 11816 'use strict'; 11817 $("ul.art-hmenu a:not([href])").attr('href', '#').click(function (e) { e.preventDefault(); }); 11818}); 11819 11820 11821jQuery(function ($) { 11822 'use strict'; 11823 11824 if ($.browser.msie && parseInt($.browser.version, 10) < 8) { 11825 $(window).bind('resize', function() { 11826 var c = $('div.art-content'); 11827 var s = c.parent().children('.art-layout-cell:not(.art-content)'); 11828 var w = 0; 11829 c.hide(); 11830 s.each(function() { w += $(this).outerWidth(true); }); 11831 c.w = c.parent().width(); c.css('width', c.w - w + 'px'); 11832 c.show(); 11833 }); 11834 } 11835 11836 $(window).trigger('resize'); 11837}); 11838 11839var artButtonSetup = (function ($) { 11840 'use strict'; 11841 return (function (className) { 11842 $.each($("a." + className + ", button." + className + ", input." + className), function (i, val) { 11843 var b = $(val); 11844 if (!b.hasClass('art-button')) { 11845 b.addClass('art-button'); 11846 } 11847 if (b.is('input')) { 11848 b.val(b.val().replace(/^\s*/, '')).css('zoom', '1'); 11849 } 11850 b.mousedown(function () { 11851 var b = $(this); 11852 b.addClass("active"); 11853 }); 11854 b.mouseup(function () { 11855 var b = $(this); 11856 if (b.hasClass('active')) { 11857 b.removeClass('active'); 11858 } 11859 }); 11860 b.mouseleave(function () { 11861 var b = $(this); 11862 if (b.hasClass('active')) { 11863 b.removeClass('active'); 11864 } 11865 }); 11866 }); 11867 });
11868})(jQuery); 11869jQuery(function () { 11870 'use strict'; 11871 artButtonSetup("art-button"); 11872}); 11873 11874jQuery(function($) { 11875 'use strict'; 11876 $('form.art-search>input[type="submit"]').attr('value', ''); 11877}); 11878 11879var Control = (function ($) { 11880 'use strict'; 11881 return (function () { 11882 this.init = function(label, type, callback) { 11883 var chAttr = label.find('input[type="' +type + '"]').attr('checked'); 11884 if (chAttr === 'checked') { 11885 label.addClass('art-checked'); 11886 } 11887 11888 label.mouseleave(function () { 11889 $(this).removeClass('hovered').removeClass('active'); 11890 }); 11891 label.mouseover(function () { 11892 $(this).addClass('hovered').removeClass('active'); 11893 }); 11894 label.mousedown(function (event) { 11895 if (event.which !== 1) { 11896 return; 11897 } 11898 $(this).addClass('active').removeClass('hovered'); 11899 }); 11900 label.mouseup(function (event) { 11901 if (event.which !== 1) { 11902 return; 11903 } 11904 callback.apply(this); 11905 $(this).removeClass('active').addClass('hovered'); 11906 }); 11907 }; 11908 }); 11909})(jQuery); 11910 11911 11912var fixRssIconLineHeight = (function (className) { 11913 'use strict'; 11914 jQuery("." + className).css("line-height", jQuery("." + className).height() + "px"); 11915}); 11916 11917jQuery(function ($) { 11918 'use strict'; 11919 var rssIcons = $(".art-rss-tag-icon"); 11920 if (rssIcons.length){ 11921 fixRssIconLineHeight("art-rss-tag-icon"); 11922 if ($.browser.msie && parseInt($.browser.version, 10) < 9) { 11923 rssIcons.each(function () { 11924 if ($.trim($(this).html()) === "") { 11925 $(this).css("vertical-align", "middle"); 11926 } 11927 }); 11928 } 11929 } 11930}); 11931/** 11932* @license 11933* jQuery Tools 1.2.6 Mousewheel 11934* 11935* NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE. 11936* 11937* http://flowplayer.org/tools/toolbox/mousewheel.html 11938* 11939* based on jquery.event.wheel.js ~ rev 1 ~ 11940* Copyright (c) 2008, Three Dub Media 11941* http://threedubmedia.com 11942* 11943* Since: Mar 2010 11944* Date: 11945*/ 11946(function ($) { 11947 'use strict'; 11948 $.fn.mousewheel = function (fn) { 11949 return this[fn ? "bind" : "trigger"]("wheel", fn); 11950 }; 11951 11952 // special event config 11953 $.event.special.wheel = { 11954 setup: function () { 11955 $.event.add(this, wheelEvents, wheelHandler, {}); 11956 }, 11957 teardown: function () { 11958 $.event.remove(this, wheelEvents, wheelHandler); 11959 } 11960 }; 11961 11962 // events to bind ( browser sniffed... ) 11963 var wheelEvents = !$.browser.mozilla ? "mousewheel" : // IE, opera, safari 11964 "DOMMouseScroll" + ($.browser.version < "1.9" ? " mousemove" : ""); // firefox 11965 11966 // shared event handler 11967 function wheelHandler(event) { 11968 /*jshint validthis:true*/ 11969 11970 switch (event.type) { 11971 11972 // FF2 has incorrect event positions 11973 case "mousemove": 11974 return $.extend(event.data, { // store the correct properties 11975 clientX: event.clientX, clientY: event.clientY, 11976 pageX: event.pageX, pageY: event.pageY 11977 }); 11978 11979 // firefox 11980 case "DOMMouseScroll": 11981 $.extend(event, event.data); // fix event properties in FF2 11982 event.delta = -event.detail / 3; // normalize delta 11983 break; 11984 11985 // IE, opera, safari 11986 case "mousewheel": 11987 event.delta = event.wheelDelta / 120; 11988 break; 11989 } 11990 11991 event.type = "wheel"; // hijack the event 11992 return $.event.handle.call(this, event, event.delta); 11993 } 11994 11995})(jQuery); 11996 11997 11998var ThemeLightbox = (function ($) { 11999 'use strict'; 12000 return (function () { 12001 var current; 12002 var images = $("img.art-lightbox"); 12003 12004 var b = $("body"); 12005 12006 this.init = function (ctrl) { 12007 $("img.art-lightbox").live("click", { _ctrl: ctrl }, function (e) { 12008 12009 if (e.data._ctrl === true && !e.ctrlKey) { 12010 return; 12011 } 12012 12013 reload(); 12014 current = images.index(this); 12015 show(this); 12016 }); 12017 12018 $(".arrow.left:not(.disabled)").live("click", function () { 12019 move(current - 1); 12020 }); 12021 12022 $(".arrow.right:not(.disabled)").live("click", function () { 12023 move(current + 1); 12024 }); 12025 12026 $("img.active").live("click", function () { 12027 move(current + 1); 12028 }); 12029 12030 $(".close").live("click", function () { 12031 close(); 12032 }); 12033 }; 12034 12035 function show(src) { 12036 var d = $('<div id="art-lightbox-bg"><div class="close"><div class="cw"> </div><div class="ccw"> </div><div class="close-alt">✗</div></div></div>'); 12037 12038 var img = $('<img class="art-lightbox-image active" alt="" src="' + getFullImgSrc($(src).attr("src")) + '" />'); 12039 12040 resizeOnLoad(img); 12041 img.appendTo(b); 12042 showArrows(); 12043 12044 showLoader(true); 12045 12046 img.load(function () { 12047 showLoader(false); 12048 d.appendTo(b).height(Math.max(document.documentElement.scrollHeight, document.body.scrollHeight)); 12049 }); 12050 12051 img.error(function () { 12052 showLoader(false); 12053 d.appendTo(b).height(Math.max(document.documentElement.scrollHeight, document.body.scrollHeight)); 12054 12055 //showError(true); 12056 img.attr("src", $(src).attr("src")); 12057 }); 12058 d.click(close); 12059 bindMouse($(".arrow").add(img).add(d)); 12060 } 12061 12062 function reload() { 12063 images = $("img.art-lightbox"); 12064 } 12065 12066 function move(index) { 12067 if (index < 0 || index >= images.length) { 12068 return; 12069 } 12070 12071 showError(false); 12072 12073 current = index; 12074 12075 $("img.art-lightbox-image:not(.active)").remove(); 12076 12077 var active = $("img.active"); 12078 12079 var target = $('<img class="art-lightbox-image" alt="" src="' + getFullImgSrc($(images[current]).attr("src")) + '" />'); 12080 12081 resizeOnLoad(target); 12082 active.after(target); 12083 12084 showArrows(); 12085 showLoader(true); 12086 12087 bindMouse($("#art-lightbox-bg").add(target)); 12088 12089 target.load(function () { 12090 showLoader(false); 12091 12092 active.removeClass("active"); 12093 target.addClass("active"); 12094 }); 12095 12096 target.error(function () { 12097 showLoader(false); 12098 12099 //showError(true); 12100 active.removeClass("active"); 12101 target.addClass("active"); 12102 target.attr("src", $(images[current]).attr("src")); 12103 }); 12104 } 12105 12106 function showArrows() { 12107 if ($(".arrow").length === 0) { 12108 b.append($('<div class="arrow left"><div class="arrow-t ccw"> </div><div class="arrow-b cw"> </div><div class="arrow-left-alt">←</div></div>').css("top", $(window).height() / 2 - 40)); 12109 12110 b.append($('<div class="arrow right"><div class="arrow-t cw"> </div><div class="arrow-b ccw"> </div><div class="arrow-right-alt">→</div></div>').css("top", $(window).height() / 2 - 40)); 12111 } 12112 12113 if (current === 0) { 12114 $(".arrow.left").addClass("disabled"); 12115 } else { 12116 $(".arrow.left").removeClass("disabled"); 12117 } 12118 12119 if (current === images.length - 1) { 12120 $(".arrow.right").addClass("disabled"); 12121 } else { 12122 $(".arrow.right").removeClass("disabled"); 12123 } 12124 } 12125 12126 function showError(enable) { 12127 if (enable) { 12128 b.append($('<div class="lightbox-error">ÐаннÑй конÑÐµÐ½Ñ Ð½ÐµÐ²Ð¾Ð·Ð¼Ð¾Ð¶Ð½Ð¾ загÑÑзиÑÑ.<br/>ÐожалÑйÑÑа, повÑоÑиÑе попÑÑÐºÑ Ð¿Ð¾Ð·Ð¶Ðµ.</div>') 12129 .css({ "top": $(window).height() / 2 - 60, "left": $(window).width() / 2 - 170 })); 12130 } else { 12131 $(".lightbox-error").remove(); 12132 } 12133 } 12134 12135 function showLoader(enable) { 12136 if (!enable) { 12137 $(".loading").remove(); 12138 } 12139 else { 12140 $('<div class="loading"> </div>').css({ "top": $(window).height() / 2 - 16, "left": $(window).width() / 2 - 16 }).appendTo(b); 12141 } 12142 } 12143 12144 var close = function () { 12145 $("#art-lightbox-bg, .art-lightbox-image, .arrow, .lightbox-error").remove(); 12146 }; 12147 12148 function resizeOnLoad(img) { 12149 var width = $(window).width(); 12150 var height = $(window).height(); 12151 12152 img.load(function () { 12153 var imgHeight = $(this).height(); 12154 var imgWidth = $(this).width(); 12155 12156 // additional space is needed for the next|prev items and border around the images 12157 if (height < (imgHeight + 10) || width < (imgWidth + 410)) { 12158 var hScale = Math.abs(imgWidth / (width - 410)); 12159 var vScale = Math.abs(imgHeight / (height - 100)); 12160 12161 var scale = Math.max(vScale, hScale); 12162 12163 imgWidth = imgWidth / scale; 12164 imgHeight = imgHeight / scale; 12165 12166 img.width(imgWidth);
12167 img.height(imgHeight); 12168 } 12169 12170 img.css({ "top": (height / 2 - imgHeight / 2) - 5, "left": (width / 2 - imgWidth / 2 - 5) }); 12171 }); 12172 12173 return img; 12174 } 12175 12176 function bindMouse(img) { 12177 img.unbind("wheel").mousewheel(function (event, delta) { 12178 delta = delta > 0 ? 1 : -1; 12179 move(current + delta); 12180 event.preventDefault(); 12181 }); 12182 12183 img.mousedown(function (e) { 12184 // close on middle button click 12185 if (e.which === 2) { 12186 close(); 12187 } 12188 e.preventDefault(); 12189 }); 12190 } 12191 12192 function getFullImgSrc(src) { 12193 var webArchiveRegex = new RegExp("http://www.[A-z0-9-]+-image.com/.webarchive/"); 12194 if ((src.indexOf("http://") === 0 || src.indexOf("https://") === 0) && !webArchiveRegex.test(src)) { 12195 return src; 12196 } 12197 12198 var fileName = src.substring(0, src.lastIndexOf('.')); 12199 var ext = src.substring(src.lastIndexOf('.')); 12200 src = fileName + "-large" + ext; 12201 12202 return src; 12203 } 12204 12205 }); 12206})(jQuery); 12207jQuery(function () { 12208 'use strict'; 12209 new ThemeLightbox().init(); 12210}); 12211(function($) { 12212 'use strict'; 12213 // transition && transitionEnd && browser prefix 12214 $.support.transition = (function() { 12215 var thisBody = document.body || document.documentElement, 12216 thisStyle = thisBody.style, 12217 support = thisStyle.transition !== undefined || 12218 thisStyle.WebkitTransition !== undefined || 12219 thisStyle.MozTransition !== undefined || 12220 thisStyle.MsTransition !== undefined || 12221 thisStyle.OTransition !== undefined; 12222 return support && { 12223 event: (function() { 12224 var e = "transitionend"; 12225 if ($.browser.opera) { 12226 var version = parseFloat($.browser.version); 12227 e = version >= 12 ? (version < 12.50 ? "otransitionend" : "transitionend") : "oTransitionEnd"; 12228 } else if ($.browser.webkit) { 12229 e = "webkitTransitionEnd"; 12230 } 12231 return e; 12232 })(), 12233 prefix: (function() { 12234 var result; 12235 $.each($.browser, function(key, value) { 12236 if (key === "version") { 12237 return true; 12238 } 12239 return (result = { 12240 opera: "-o-", 12241 mozilla: "-moz-", 12242 webkit: "-webkit-", 12243 msie: "-ms-" 12244 }[key]) ? false : true; 12245 }); 12246 return result || ""; 12247 })() 12248 }; 12249 })(); 12250 12251 window.BackgroundHelper = function () { 12252 var slides = []; 12253 var direction = "next"; 12254 var motion = "horizontal"; 12255 var width = 0; 12256 var height = 0; 12257 var transitionDuration = ""; 12258 12259 this.init = function(motionType, dir, duration) { 12260 direction = dir; 12261 motion = motionType; 12262 slides = []; 12263 width = 0; 12264 height = 0; 12265 transitionDuration = duration; 12266 }; 12267 12268 this.processSlide = function(element) { 12269 width = element.outerWidth(); 12270 height = element.outerHeight(); 12271 var pos = []; 12272 12273 var bgPosition = element.css("background-position"); 12274 var positions = bgPosition.split(","); 12275 $.each(positions, function (i) { 12276 var position = $.trim(this); 12277 var point = position.split(" "); 12278 if (point.length > 1) { 12279 var x = parseInt(point[0], 10); 12280 var y = parseInt(point[1], 10); 12281 pos.push({ x: x, y: y }); 12282 } 12283 }); 12284 12285 slides.push({ 12286 "images": element.css("background-image"), 12287 "positions": pos 12288 }); 12289 element.css("background-image", "none"); 12290 }; 12291
12292 this.setBackground = function(element, items) { 12293 var bg = []; 12294 $.each(items, function (i, o) { 12295 bg.push(o.images); 12296 }); 12297 element.css({ 12298 "background-image": bg.join(", "), 12299 "background-repeat": "no-repeat" 12300 }); 12301 }; 12302 12303 this.setPosition = function(element, items) { 12304 var pos = []; 12305 $.each(items, function(i, o) { 12306 pos.push(o.positions); 12307 }); 12308 element.css({ 12309 "background-position": pos.join(", ") 12310 }); 12311 }; 12312 12313 this.current = function(index) { 12314 return slides[index] || null; 12315 }; 12316 12317 this.next = function(index) { 12318 var next; 12319 if (direction === "next") { 12320 next = (index + 1) % slides.length; 12321 } else { 12322 next = index - 1; 12323 if (next < 0) { 12324 next = slides.length - 1; 12325 } 12326 } 12327 return slides[next]; 12328 }; 12329 12330 this.items = function(prev, next, move) { 12331 var prevItem = { x: 0, y: 0 }; 12332 var nextItem = { x: 0, y: 0 }; 12333 var isDirectionNext = direction === "next"; 12334 if (motion === "horizontal") { 12335 nextItem.x = isDirectionNext ? width : -width; 12336 nextItem.y = 0; 12337 if (move) { 12338 prevItem.x += isDirectionNext ? -width : width; 12339 nextItem.x += isDirectionNext ? -width : width; 12340 } 12341 } else if (motion === "vertical") { 12342 nextItem.x = 0; 12343 nextItem.y = isDirectionNext ? height : -height; 12344 if (move) { 12345 prevItem.y += isDirectionNext ? -height : height; 12346 nextItem.y += isDirectionNext ? -height : height; 12347 } 12348 } 12349 var result = [ ]; 12350 if (!!prev) { 12351 result.push({ images: prev.images, positions: getCssPositions(prev.positions, prevItem) }); 12352 } 12353 if (!!next) { 12354 result.push({ images: next.images, positions: getCssPositions(next.positions, nextItem) }); 12355 } 12356 12357 if (direction === "next") { 12358 result.reverse(); 12359 } 12360 12361 return result; 12362 }; 12363 12364 this.transition = function(container, on) { 12365 container.css($.support.transition.prefix + "transition", on ? transitionDuration + " ease-in-out background-position" : ""); 12366 }; 12367 12368 function getCssPositions(positions, offset) { 12369 var result = []; 12370 if (positions === undefined) { 12371 return ""; 12372 } 12373 offset.x = offset.x || 0; 12374 offset.y = offset.y || 0; 12375 for (var i = 0; i < positions.length; i++) { 12376 result.push((positions[i].x + offset.x) + "px " + (positions[i].y + offset.y) + "px"); 12377 } 12378 return result.join(", "); 12379 } 12380 }; 12381 12382 12383 var Slider = function (element, settings) { 12384 12385 var interval = null; 12386 var active = false; 12387 var children = element.find(".active").parent().children(); 12388 var last = false; 12389 var running = false; 12390 12391 this.settings = $.extend({ }, { 12392 "animation": "horizontal", 12393 "direction": "next", 12394 "speed": 600, 12395 "pause": 2500, 12396 "auto": true, 12397 "repeat": true, 12398 "navigator": null, 12399 "clickevents": true, 12400 "hover": true, 12401 "helper": null 12402 }, settings); 12403 12404 this.move = function (direction, next) { 12405 var activeItem = element.find(".active"), 12406 nextItem = next || activeItem[direction](), 12407 innerDirection = this.settings.direction === "next" ? "forward" : "back", 12408 reset = direction === "next" ? "first" : "last", 12409 moving = interval, 12410 slider = this, tmp; 12411 12412 active = true; 12413 12414 if (moving) { this.stop(true); } 12415 12416 if (!nextItem.length) { 12417 nextItem = element.find(".art-slide-item")[reset](); 12418 if (!this.settings.repeat) { last = true; active = false; return; } 12419 } 12420
12421 if ($.support.transition) { 12422 nextItem.addClass(this.settings.direction); 12423 tmp = nextItem.get(0).offsetHeight; 12424 12425 activeItem.addClass(innerDirection); 12426 nextItem.addClass(innerDirection); 12427 12428 element.trigger("beforeSlide", children.length); 12429 12430 element.one($.support.transition.event, function () { 12431 nextItem.removeClass(slider.settings.direction) 12432 .removeClass(innerDirection) 12433 .addClass("active"); 12434 activeItem.removeClass("active") 12435 .removeClass(innerDirection); 12436 active = false; 12437 setTimeout(function () { 12438 element.trigger("afterSlide", children.length); 12439 }, 0); 12440 }); 12441 } else { 12442 element.trigger("beforeSlide", children.length); 12443 12444 activeItem.removeClass("active"); 12445 nextItem.addClass("active"); 12446 active = false; 12447 12448 element.trigger("afterSlide", children.length); 12449 } 12450 12451 this.navigate(nextItem); 12452 12453 if (moving) { this.start(); } 12454 }; 12455 12456 this.navigate = function (position) { 12457 var index = children.index(position); 12458 $(this.settings.navigator).children().removeClass("active").eq(index).addClass("active"); 12459 }; 12460 12461 this.to = function (index) { 12462 var activeItem = element.find(".active"), 12463 children = activeItem.parent().children(), 12464 activeIndex = children.index(activeItem), 12465 slider = this; 12466 12467 if (index > (children.length - 1) || index < 0) { 12468 return; 12469 } 12470 12471 if (active) { 12472 return element.one("afterSlide", function () { 12473 slider.to(index); 12474 }); 12475 } 12476 12477 if (activeIndex === index) { 12478 return; 12479 } 12480 12481 this.move(index > activeIndex ? "next" : "prev", $(children[index])); 12482 }; 12483 12484 this.next = function () { 12485 if (!active) { 12486 if (last) { this.stop(); return; } 12487 this.move("next"); 12488 } 12489 }; 12490 12491 this.prev = function () { 12492 if (!active) { 12493 if (last) { this.stop(); return; } 12494 this.move("prev"); 12495 } 12496 }; 12497 12498 this.start = function (force) { 12499 if (!!force) { 12500 setTimeout($.proxy(this.next, this), 10); 12501 } 12502 interval = setInterval($.proxy(this.next, this), this.settings.pause); 12503 running = true; 12504 }; 12505 12506 this.stop = function (pause) { 12507 clearInterval(interval); 12508 interval = null; 12509 running = !!pause; 12510 active = false; 12511 }; 12512 12513 this.active = function () { 12514 return running; 12515 }; 12516 12517 this.moving = function () { 12518 return active; 12519 }; 12520 12521 this.navigate(children.filter(".active")); 12522 12523 if (this.settings.clickevents) { 12524 $(this.settings.navigator).on("click", "a", { slider: this }, function (event) { 12525 var activeIndex = children.index(children.filter(".active")); 12526 var index = $(this).parent().children().index($(this)); 12527 if (activeIndex !== index) { 12528 event.data.slider.to(index); 12529 } 12530 event.preventDefault(); 12531 }); 12532 } 12533 12534 if (this.settings.hover) { 12535 var slider = this; 12536 element.add(this.settings.navigator) 12537 .add(element.siblings(".art-shapes")).hover(function () { 12538 if (element.is(":visible") && !last) { slider.stop(true); } 12539 }, function () { 12540 if (element.is(":visible") && !last) { slider.start(); } 12541 }); 12542 } 12543 }; 12544 12545 $.fn.slider = function (arg) { 12546 return this.each(function () { 12547 var element = $(this), 12548 data = element.data("slider"), 12549 options = typeof arg === "object" && arg; 12550 12551 if (!data) { 12552 data = new Slider(element, options); 12553 element.data("slider", data); 12554 } 12555 12556 if (typeof arg === "string" && data[arg]) { 12557 data[arg](); 12558 } else if (data.settings.auto && element.is(":visible")) { 12559 data.start(); 12560 } 12561 }); 12562 }; 12563 12564})(jQuery); 12565 12566 12567 12568 12569jQuery(function ($) { 12570 "use strict"; 12571 if (!$.browser.msie || parseInt($.browser.version, 10) > 8) 12572 return; 12573 var path = ""; 12574 var scripts = $("script[src*='script.js']"); 12575 if (scripts.length > 0) { 12576 var src = scripts.get(0).src; 12577 path = src.substr(0, src.indexOf("script.js")); 12578 } 12579 var header = $(".art-header");
12580 var bgimages = "url('images/object1.png'),url('images/object2.png'), ".split(","); 12581 var bgpositions = "".split(","); 12582 for (var i = 0; i < bgimages.length; i++) { 12583 var bgimage = $.trim(bgimages[i]); 12584 if (bgimage === "") 12585 continue; 12586 if (path !== "") { 12587 bgimage = bgimage.replace(/(url\(['"]?)/i, "$1" + path); 12588 } 12589 header.find(".art-shapes").prepend("<div style=\"position:absolute;top:0;left:0;width:100%;height:100%;background:" + bgimage + " " + bgpositions[i] + " no-repeat\">"); 12590 } 12591 header.css('background-image', "url('')".replace(/(url\(['"]?)/i, "$1" + path)); 12592 header.css('background-position', "0 0"); 12593}); 12594jQuery(function () { 12595 'use strict'; 12596 jQuery.each(jQuery('button'), function (i, button) { 12597 button.buttonName = button.getAttribute('name'); 12598 button.buttonValue = button.getAttribute('value'); 12599 button.prevOnClick = button.onclick; 12600 if (button.outerHTML) { 12601 var re = /\bvalue="([^"]+)"/i; 12602 button.buttonValue = re.test(button.outerHTML) ? re.exec(button.outerHTML)[1] : button.buttonValue; 12603 } 12604 button.setAttribute("name", "_" + button.buttonName); 12605 button.onclick = function () { 12606 if (this.prevOnClick) { 12607 this.prevOnClick.apply(this); 12608 } 12609 var f = this; 12610 while (f.tagName.toLowerCase() !== "body") { 12611 if (f.tagName.toLowerCase() === "form") { 12612 var subButton = document.createElement("input"); 12613 subButton.setAttribute("type", "hidden"); 12614 subButton.setAttribute("name", this.buttonName); 12615 subButton.setAttribute("value", this.buttonValue); 12616 f.appendChild(subButton); 12617 return true; 12618 } 12619 f = f.parentNode; 12620 } 12621 return false; 12622 }; 12623 }); 12624}); 12625 12626/* Image Assist module support */ 12627jQuery(function () { 12628 'use strict'; 12629 var imgAssistElem = parent.document.getElementsByName("img_assist_header"); 12630 if (null !== imgAssistElem && imgAssistElem.length > 0) { 12631 imgAssistElem[0].scrolling = "no"; 12632 imgAssistElem[0].style.height = "150px"; 12633 } 12634}); 12635 12636 12637/* Theming Drupal search form */ 12638jQuery(function($) { 12639 'use strict'; 12640 var submit = $('form.art-search input[type="submit"]'); 12641 submit.removeClass('art-button'); 12642 if (submit.css('background-image') !== 'none') { 12643 submit.attr('value', ''); 12644 } 12645});; 12646/* Created by YOHO */ 12647/*jshint forin:true, noarg:true, noempty:true, eqeqeq:true, bitwise:true, strict:true, undef:true, curly:false, browser:true, jquery:false */ 12648/*global jQuery */ 12649 12650var responsiveDesign = { 12651 isResponsive: false, 12652 isDesktop: false, 12653 isTablet: false, 12654 isPhone: false, 12655 windowWidth: 0, 12656 responsive: function () { 12657 'use strict'; 12658 var html = jQuery("html"); 12659 this.windowWidth = jQuery(window).width(); 12660 var triggerEvent = false; 12661 12662 var isRespVisible = jQuery("#art-resp").is(":visible"); 12663 if (isRespVisible && !this.isResponsive) { 12664 html.addClass("responsive").removeClass("desktop"); 12665 this.isResponsive = true; 12666 this.isDesktop = false; 12667 triggerEvent = true; 12668 } else if (!isRespVisible && !this.isDesktop) { 12669 html.addClass("desktop").removeClass("responsive responsive-tablet responsive-phone"); 12670 this.isResponsive = this.isTablet = this.isPhone = false; 12671 this.isDesktop = true; 12672 triggerEvent = true; 12673 } 12674 12675 if (this.isResponsive) { 12676 if (jQuery("#art-resp-t").is(":visible") && !this.isTablet) { 12677 html.addClass("responsive-tablet").removeClass("responsive-phone"); 12678 this.isTablet = true; 12679 this.isPhone = false; 12680 triggerEvent = true; 12681 } else if (jQuery("#art-resp-m").is(":visible") && !this.isPhone) { 12682 html.addClass("responsive-phone").removeClass("responsive-tablet"); 12683 this.isTablet = false; 12684 this.isPhone = true; 12685 triggerEvent = true; 12686 } 12687 } 12688 12689 if (triggerEvent) { 12690 jQuery(window).trigger("responsive", this); 12691 } 12692 12693 jQuery(window).trigger("responsiveResize", this); 12694 }, 12695 initialize: function () { 12696 "use strict"; 12697 jQuery("<div id=\"art-resp\"><div id=\"art-resp-m\"></div><div id=\"art-resp-t\"></div></div>").appendTo("body"); 12698 jQuery(window).resize(function () { 12699 responsiveDesign.responsive(); 12700 }); 12701 jQuery(window).trigger("resize"); 12702 } 12703}; 12704 12705function responsiveAbsBg(responsiveDesign, el, bg) { 12706 "use strict"; 12707 if (bg.length === 0) 12708 return; 12709 12710 var desktopBgTop = bg.attr("data-bg-top"); 12711 var desktopBgHeight = bg.attr("data-bg-height"); 12712 12713 if (responsiveDesign.isResponsive) { 12714 if (typeof desktopBgTop === "undefined" || desktopBgTop === false) { 12715 bg.attr("data-bg-top", bg.css("top")); 12716 bg.attr("data-bg-height", bg.css("height")); 12717 } 12718 12719 var elTop = el.offset().top; 12720 var elHeight = el.outerHeight(); 12721 bg.css("top", elTop + "px"); 12722 bg.css("height", elHeight + "px"); 12723 } else if (typeof desktopBgTop !== "undefined" && desktopBgTop !== false) { 12724 bg.css("top", desktopBgTop); 12725 bg.css("height", desktopBgHeight); 12726 bg.removeAttr("data-bg-top"); 12727 bg.removeAttr("data-bg-height"); 12728 } 12729} 12730 12731jQuery(window).bind("responsive", function (event, responsiveDesign) { 12732 'use strict'; 12733 responsiveCollages(responsiveDesign); 12734 responsiveImages(responsiveDesign); 12735 responsiveVideos(responsiveDesign); 12736}); 12737 12738function responsiveImages(responsiveDesign) { 12739 'use strict'; 12740 jQuery("img[width]").each(function () { 12741 var img = jQuery(this), newWidth = "", newMaxWidth = "", newHeight = ""; 12742 if (responsiveDesign.isResponsive) { 12743 newWidth = "auto"; 12744 newHeight = "auto"; 12745 newMaxWidth = "100%"; 12746 12747 var widthAttr = img.attr("width"); 12748 if (widthAttr !== null && typeof(widthAttr) === "string" && widthAttr.indexOf("%") === -1) { 12749 newWidth = "100%";
12750 newMaxWidth = parseInt(jQuery.trim(widthAttr), 10) + "px"; 12751 } 12752 } 12753 img.css("width", newWidth).css("max-width", newMaxWidth).css("height", newHeight); 12754 }); 12755} 12756 12757function responsiveCollages(responsiveDesign) { 12758 'use strict'; 12759 if (jQuery.browser.msie && jQuery.browser.version <= 8) return; 12760 jQuery(".art-collage").each(function () { 12761 var collage = jQuery(this); 12762 var sliderObject = collage.find(".art-slider").data("slider"); 12763 var responsiveImage = jQuery("img#" + collage.attr("id")); 12764 12765 if (responsiveDesign.isResponsive) { 12766 if (responsiveImage.length) { return true; } 12767 if (jQuery.support.transition) { 12768 collage.find(".art-slider").trigger(jQuery.support.transition.event); 12769 } 12770 if (sliderObject) { 12771 sliderObject.stop(); 12772 } 12773 var activeSlide = collage.find(".art-slide-item.active"); 12774 if (!activeSlide.length) { 12775 var slides = collage.find(".art-slide-item"); 12776 if (slides.length) { 12777 activeSlide = jQuery(slides.get(0)); 12778 } 12779 } 12780 activeSlide.css("background-image", ""); 12781 var bg = activeSlide.css("background-image").replace(/url\(['"]?(.+?)['"]?\)/i, "$1"); 12782 jQuery("<img>").attr({ 12783 "src": bg, 12784 "id": collage.attr("id") 12785 }).insertBefore(collage); 12786 } else if (responsiveImage.length) { 12787 responsiveImage.remove(); 12788 if (sliderObject) { 12789 if (sliderObject.settings.animation !== "fade") { 12790 collage.find(".art-slide-item").css("background-image", "none"); 12791 } 12792 sliderObject.start(); 12793 } 12794 } 12795 }); 12796} 12797 12798function responsiveVideos(responsiveDesign) { 12799 "use strict"; 12800 jQuery("iframe,object,embed").each(function () { 12801 var obj = jQuery(this); 12802 var container = obj.parent(".art-responsive-embed"); 12803 if (responsiveDesign.isResponsive) { 12804 if (container.length !== 0) 12805 return; 12806 container = jQuery("<div class=\"art-responsive-embed\">").insertBefore(obj); 12807 obj.appendTo(container); 12808 } else if (container.length > 0) { 12809 obj.insertBefore(container); 12810 container.remove(); 12811 } 12812 }); 12813} 12814 12815jQuery(window).bind("responsiveResize", function (event, responsiveDesign) { 12816 "use strict"; 12817 responsiveAbsBg(responsiveDesign, jQuery(".art-header"), jQuery("#art-header-bg")); 12818}); 12819jQuery(window).bind("responsive", function (event, responsiveDesign) { 12820 "use strict"; 12821 if (jQuery.browser.msie && jQuery.browser.version <= 8) return; 12822 responsiveHeader(responsiveDesign); 12823}); 12824 12825function responsiveHeader(responsiveDesign) { 12826 "use strict"; 12827 var header = jQuery("header.art-header"); 12828 var headerShapes = header.find(".art-shapes"); 12829 var headerSlider = header.find(".art-slider"); 12830 12831 if (headerSlider.length) { 12832 var sliderObject = headerSlider.data("slider"); 12833 12834 var activeSlide = headerSlider.find(".art-slide-item.active"); 12835 if (!activeSlide.length) { 12836 var slides = headerSlider.find(".art-slide-item"); 12837 if (slides.length) { 12838 activeSlide = jQuery(slides.get(0)); 12839 } 12840 } 12841 12842 var textblock = headerSlider.find(".art-textblock").eq(0); 12843 12844 if (responsiveDesign.isResponsive) { 12845 if (header.attr("data-responsive")) return true; 12846 activeSlide.css("background-image", ""); 12847 header.attr("data-responsive", "true"); 12848 headerSlider.fadeOut(0); 12849 if (jQuery.support.transition) { 12850 headerSlider.trigger(jQuery.support.transition.event); 12851 } 12852 if (sliderObject) { 12853 sliderObject.stop(); 12854 } 12855 if (header.find(".art-slogan, .art-headline").length === 0) { 12856 var tb = textblock.clone(); 12857 tb.css("display", "block"); 12858 tb.children("div").css("display", "block"); 12859 tb.appendTo(headerShapes); 12860 } 12861 // activeslide background 12862 var bg = activeSlide.css("background-image").split(/\s*,\s*/); 12863 header.css("background-image", bg[bg.length - 1]); 12864 } else if (header.attr("data-responsive")) { 12865 header.removeAttr("data-responsive"); 12866 header.css("background-image", ""); 12867 if (sliderObject) { 12868 if (sliderObject.settings.animation !== "fade") { 12869 headerSlider.find(".art-slide-item").css("background-image", "none"); 12870 } 12871 headerShapes.find(".art-textblock").remove(); 12872 headerSlider.fadeIn(0); 12873 sliderObject.start(); 12874 } 12875 } 12876 } else if (header.find(".art-slogan, .art-headline").length === 0) { 12877 header.find(".art-textblock").each(function () { 12878 jQuery(this).add(jQuery(this).children("div")).css("display", responsiveDesign.isResponsive ? "inline-block" : ""); 12879 return false; // break 12880 }); 12881 jQuery(window).trigger("resize"); 12882 } 12883} 12884 12885jQuery(window).bind("responsiveResize", function (event, responsiveDesign) { 12886 "use strict"; 12887 responsiveAbsBg(responsiveDesign, jQuery("nav.art-nav"), jQuery("#art-hmenu-bg")); 12888 responsiveNavFit(responsiveDesign); 12889}); 12890 12891function responsiveNavFit(responsiveDesign) { 12892 'use strict'; 12893 var nav = jQuery("nav.art-nav"); 12894 var isDesktopNav = true; 12895 var isResponsiveNav = false; 12896 if (responsiveDesign.isResponsive) { 12897 if (!nav.hasClass("responsive-nav")) { 12898 var itemsWidth = 0; 12899 var menu = nav.find(".art-hmenu"); 12900 menu.children("li").each(function() { 12901 itemsWidth += jQuery(this).outerWidth(true); 12902 }); 12903 12904 if (menu.width() < itemsWidth || responsiveDesign.isPhone) { 12905 nav.attr("data-restore-width", responsiveDesign.windowWidth).addClass("responsive-nav").removeClass("desktop-nav"); 12906 isResponsiveNav = true; 12907 isDesktopNav = false; 12908 } 12909 } else { 12910 var desktopRestoreWidth = parseInt(nav.attr("data-restore-width"), 10) || 0; 12911 if (desktopRestoreWidth !== 0 && responsiveDesign.windowWidth <= desktopRestoreWidth) { 12912 isResponsiveNav = true; 12913 isDesktopNav = false; 12914 } 12915 } 12916 } 12917 12918 if (isDesktopNav) { 12919 nav.removeClass("responsive-nav").addClass("desktop-nav").removeAttr("data-restore-width"); 12920 } 12921 12922 jQuery(window).trigger("responsiveNav", {isDesktopNav: isDesktopNav, isResponsiveNav: isResponsiveNav}); 12923} 12924 12925 12926 12927jQuery(window).bind("responsive", function (event, responsiveDesign) { 12928 "use strict"; 12929 responsiveLayoutCell(responsiveDesign); 12930}); 12931 12932function responsiveLayoutCell(responsiveDesign) { 12933 "use strict"; 12934 jQuery(".art-content .art-content-layout-row,.art-footer .art-content-layout-row").each(function () { 12935 var row = jQuery(this); 12936 var rowChildren = row.children(".art-layout-cell"); 12937 if (rowChildren.length > 1) { 12938 if (responsiveDesign.isTablet) { 12939 rowChildren.addClass("responsive-tablet-layout-cell").each(function (i) { 12940 if ((i + 1) % 2 === 0) { 12941 jQuery(this).after("<div class=\"cleared responsive-cleared\">"); 12942 } 12943 }); 12944 } else { 12945 rowChildren.removeClass("responsive-tablet-layout-cell"); 12946 row.children(".responsive-cleared").remove(); 12947 } 12948 } 12949 });
12950} 12951 12952jQuery(window).bind("responsive", function (event, responsiveDesign) { 12953 "use strict"; 12954 responsiveLayoutCell(responsiveDesign); 12955}); 12956 12957function responsiveLayoutCell(responsiveDesign) { 12958 "use strict"; 12959 jQuery(".art-content .art-content-layout-row,.art-footer .art-content-layout-row").each(function () { 12960 var row = jQuery(this); 12961 var rowChildren = row.children(".art-layout-cell"); 12962 if (rowChildren.length > 1) { 12963 if (responsiveDesign.isTablet) { 12964 rowChildren.addClass("responsive-tablet-layout-cell").each(function (i) { 12965 if ((i + 1) % 2 === 0) { 12966 jQuery(this).after("<div class=\"cleared responsive-cleared\">"); 12967 } 12968 }); 12969 } else { 12970 rowChildren.removeClass("responsive-tablet-layout-cell"); 12971 row.children(".responsive-cleared").remove(); 12972 } 12973 } 12974 }); 12975} 12976 12977 12978 12979jQuery(responsiveDesign.initialize); 12980; 12981/* LEFT MENU */ 12982 12983$(document).ready(function () { 12984$('#menu').click(function () { 12985$('.menuleft').fadeIn(0); });}); 12986 12987$(document).ready(function () { 12988$('#close, #cat_menu, #search').click(function () { 12989$('.menuleft').fadeOut(0); });}); 12990 12991$(document).ready(function () { 12992$('.menuoverlay').click(function () { 12993$('.menuleft').fadeOut(0); });}); 12994 12995/* IN */ 12996 12997$(document).ready(function () { 12998$('#menu').click(function () { 12999$('.menuoverlay').fadeIn(0); });}); 13000 13001$(document).ready(function () { 13002$('.menuoverlay').click(function () { 13003$('#menu').fadeIn(0); });}); 13004 13005$(document).ready(function () { 13006$('#menu').click(function () { 13007$('#close').fadeIn(0); });}); 13008 13009$(document).ready(function () { 13010$('#close, #cat_menu, #search').click(function () { 13011$('#menu').fadeIn(0); });}); 13012 13013/* OUT */ 13014 13015$(document).ready(function () { 13016$('#menu').click(function () { 13017$('#menu').fadeOut(0); });}); 13018 13019$(document).ready(function () { 13020$('#close, #cat_menu, #search').click(function () { 13021$('#close').fadeOut(0); });}); 13022 13023$(document).ready(function () { 13024$('#close, #cat_menu_exit, #search_close').click(function () { 13025$('.menuoverlay').fadeOut(0); });}); 13026 13027$(document).ready(function () { 13028$('.menuoverlay').click(function () { 13029$('.menuoverlay').fadeOut(0); });}); 13030 13031$(document).ready(function () { 13032$('.menuoverlay').click(function () { 13033$('#close').fadeOut(0); });}); 13034 13035/* SCROLL MODAL */ 13036 13037$(document).bind('cbox_open', function () { 13038$('body').css({overflow: 'hidden'}); 13039}).bind('cbox_closed', function () { 13040$('body').css({overflow: 'auto'}); 13041}); 13042 13043$(document).ready(function () { 13044$('#menu, #cat_menu, #search').click(function () { 13045$('body').css('overflow', 'hidden'); });}); 13046 13047$(document).ready(function () { 13048$('#close, #cat_menu_exit, #search_close, .menuoverlay').click(function () { 13049$('body').css('overflow', 'auto'); });}); 13050 13051/* NICE MENU */ 13052 13053$(document).ready(function () { 13054$('#cat_menu').click(function () { 13055$('#nice-menu-tax-1').fadeIn(0); });}); 13056 13057$(document).ready(function () { 13058$('#cat_menu').click(function () { 13059$('#cat_menu_exit').fadeIn(0); });}); 13060 13061$(document).ready(function () { 13062$('#cat_menu_exit, #menu, #search').click(function () { 13063$('#cat_menu').fadeIn(0); });}); 13064 13065$(document).ready(function () { 13066$('#cat_menu').click(function () { 13067$('.menuoverlay').fadeIn(0); });}); 13068 13069$(document).ready(function () { 13070$('.menuoverlay').click(function () { 13071$('#cat_menu').fadeIn(0); });}); 13072 13073$(document).ready(function () { 13074$('#cat_menu').click(function () { 13075$('#cat_menu').fadeOut(0); });}); 13076 13077$(document).ready(function () { 13078$('#cat_menu_exit, #menu, #search').click(function () { 13079$('#cat_menu_exit').fadeOut(0); });}); 13080 13081$(document).ready(function () { 13082$('.menuoverlay').click(function () { 13083$('#cat_menu_exit').fadeOut(0); });}); 13084 13085$(document).ready(function () { 13086$('.menuoverlay').click(function () { 13087$('#nice-menu-tax-1').fadeOut(0); });}); 13088 13089$(document).ready(function () { 13090$('#cat_menu_exit, #menu, #search').click(function () { 13091$('#nice-menu-tax-1').fadeOut(0); });}); 13092 13093/* TABS */ 13094 13095$(document).ready(function () { 13096$('.content-middle').tabulous({effect: 'scale'});}); 13097 13098/* DOCS */ 13099 13100$(document).ready(function () { 13101$('#firstpane div.menu_head').click(function () { 13102$(this).next('div.menu_body').slideToggle(300).siblings('div.menu_body').slide
13102Up('slow'); });}); 13103 13104/* MCONTACT */ 13105 13106$(document).ready(function () { 13107$('#mbutton1').click(function () { 13108$('.mtable').slideToggle(0); });}); 13109 13110$(document).ready(function () { 13111$('#mbutton2').click(function () { 13112$('.mtable').slideToggle(0); });}); 13113 13114/* FORM SEARCH */ 13115 13116$(document).ready(function () { 13117$('#search').click(function () { 13118$('#block-search-0').fadeIn(0); });}); 13119 13120$(document).ready(function () { 13121$('#search_close, #cat_menu, #menu').click(function () { 13122$('#block-search-0').fadeOut(0); });}); 13123 13124$(document).ready(function () { 13125$('.menuoverlay').click(function () { 13126$('#block-search-0').fadeOut(0); });}); 13127 13128$(document).ready(function () { 13129$('#search').click(function () { 13130$('.menuoverlay').fadeIn(0); });}); 13131 13132$(document).ready(function () { 13133$('#search').click(function () { 13134$('#search_close').fadeIn(0); });}); 13135 13136$(document).ready(function () { 13137$('#search_close, #cat_menu, #menu').click(function () { 13138$('#search').fadeIn(0); });}) 13139 13140$(document).ready(function () { 13141$('.menuoverlay').click(function () { 13142$('#search').fadeIn(0); });}); 13143 13144$(document).ready(function () { 13145$('.menuoverlay').click(function () { 13146$('.menuoverlay').fadeOut(0); });}); 13147 13148$(document).ready(function () { 13149$('#search').click(function () { 13150$('#search').fadeOut(0); });}); 13151 13152$(document).ready(function () { 13153$('#search_close, #cat_menu, #menu').click(function () { 13154$('#search_close').fadeOut(0); });}); 13155 13156$(document).ready(function () { 13157$('.menuoverlay').click(function () { 13158$('#search_close').fadeOut(0); });}); 13159 13160/* STICKY */ 13161 13162$(window).load(function () { 13163$('#vk_groups').sticky({ 13164topSpacing: 53, 13165bottomSpacing: 573, 13166center: true 13167}); 13168}); 13169 13170/* ART MENU | SCROLL */ 13171 13172$(window).scroll(function () { 13173if ($(window).scrollTop() > 50) { 13174$('.art-map').addClass('active'); 13175} 13176else { 13177$('.art-map').removeClass('active'); 13178} 13179}); 13180 13181$(window).scroll(function arrowPages() { 13182 function e() { 13183 var e = $(window).scrollTop() / 150; 13184 i.css({ 13185 opacity: e, 13186 transform: "scale(" + e + ")" 13187 }); 13188 e > 1 && i.css({ 13189 opacity: 1, 13190 transform: "scale(1)" 13191 }) 13192 } 13193 var i = $("#back"), 13194 n = $(""); 13195 if(i.length){ 13196 i.on("click", function(e) { 13197 e.preventDefault(); 13198 $("html, body").animate({ 13199 scrollTop: 0 13200 }, 4e3, "easeInOutQuint"); 13201 n.removeClass("translate"); 13202 }); 13203 e(); 13204 $(window).on("scroll", e); 13205 } 13206}) 13207 13208/* IMAGES */ 13209 13210$(document).ready(function () { 13211$('#slide_show').fadeIn(500); }); 13212var imgs = ["images/slide_1.jpg","images/slide_2.jpg","images/slide_3.jpg","images/slide_4.jpg","images/slide_5.jpg","images/slide_6.jpg","images/slide_7.jpg","images/slide_8.jpg","images/slide_9.jpg","images/slide_10.jpg","images/slide_11.jpg","images/slide_12.jpg"]; 13213var n=0; 13214time=500; 13215play=setInterval("chgImg(0)", 5000); 13216function chgImg(number) { 13217if (number!=0) n=number-2; 13218$('#slide_show').fadeOut(time, function () { 13219$(this).attr('src', imgs[n]).fadeIn(time); }); 13220 13221n++; 13222if (n>=imgs.length) n=0; 13223} 13224 13225/* INPUT */ 13226 13227$(document).ready(function () { 13228var $inpt = $('#contact-mail-page input[type="text"], #contact-mail-page input[type="password"], #contact-mail-page input[type="email"], #contact-mail-page input[type="url"], #contact-mail-page textarea, #user-login input[type="text"], #user-login input[type="password"], #user-login input[type="email"], #user-login input[type="url"], #user-pass input[type="text"], #user-pass input[type="password"], #user-pass input[type="email"], #user-pass input[type="url"], #user-profile-form input[type="text"], #user-profile-form input[type="password"], #user-profile-form input[type="email"], #user-profile-form input[type="url"], #search-form input[type="text"]'); 13229$inpt.each(function () { 13230 if($(this).val()!==''){ 13231 $(this).addClass('filled'); 13232 } 13233 }); 13234 13235 $inpt.on('change', function () { 13236 if($(this).val()!==''){ 13237 $(this).addClass('filled'); 13238 }else{ 13239 $(this).removeClass('filled'); 13240 } 13241 }); 13242 }); 13243 13244/* EDIT NAME */ 13245 13246$(document).ready(function () { 13247var $inpt = $('#edit-name'); 13248$inpt.each(function () { 13249 if($(this).val()!==''){ 13250 $('label[for="edit-name"]').removeClass('filled_focus').addClass('filled_area'); 13251 } 13252 }); 13253 13254 $inpt.on('change', function () { 13255 if($(this).val()!==''){ 13256 $('label[for="edit-name"]').addClass('filled_area'); 13257 }else{ 13258 $('label[for="edit-name"]').removeClass('filled_area'); 13259 } 13260 }); 13261 }); 13262 13263$(document).ready(function () { 13264$('#edit-name').focus(function () { 13265$('label[for="edit-name"]').addClass('filled_focus'); 13266}); 13267$('#edit-name').blur(function () { 13268$('label[for="edit-name"]').removeClass('filled_focus'); });}); 13269 13270/* EDIT PASS */ 13271 13272$(document).ready(function () { 13273var $inpt = $('#edit-pass'); 13274$inpt.each(function () { 13275 if($(this).val()!==''){ 13276 $('label[for="edit-pass"]').removeClass('filled_focus').addClass('filled_area'); 13277 } 13278 }); 13279 13280 $inpt.on('change', function () { 13281 if($(this).val()!==''){ 13282 $('label[for="edit-pass"]').addClass('filled_area'); 13283 }else{ 13284 $('label[for="edit-pass"]').removeClass('filled_area'); 13285 } 13286 }); 13287 }); 13288 13289$(document).ready(function () { 13290$('#edit-pass').focus(function () { 13291$('label[for="edit-pass"]').addClass('filled_focus'); 13292}); 13293$('#edit-pass').blur(function () { 13294$('label[for="edit-pass"]').removeClass('filled_focus'); });}); 13295 13296/* EDIT RESPONSE */ 13297 13298$(document).ready(function () { 13299var $inpt = $('#edit-captcha-response'); 13300$inpt.each(function () { 13301 if($(this).val()!==''){ 13302 $('label[for="edit-captcha-response"]').removeClass('filled_focus').addClass('filled_area'); 13303 } 13304 }); 13305 13306 $inpt.on('change', function () { 13307 if($(this).val()!==''){ 13308 $('label[for="edit-captcha-response"]').addClass('filled_area'); 13309 }else{ 13310 $('label[for="edit-captcha-response"]').removeClass('filled_area'); 13311 } 13312 }); 13313 }); 13314 13315$(document).ready(function () { 13316$('#edit-captcha-response').focus(function () { 13317$('label[for="edit-captcha-response"]').addClass('filled_focus'); 13318}); 13319$('#edit-captcha-response').blur(function () { 13320$('label[for="edit-captcha-response"]').removeClass('filled_focus'); });}); 13321 13322/* EDIT MAIL */ 13323 13324$(document).ready(function () { 13325var $inpt = $('#edit-mail'); 13326$inpt.each(function () { 13327 if($(this).val()!==''){ 13328 $('label[for="edit-mail"]').removeClass('filled_focus').addClass('filled_area'); 13329 } 13330 }); 13331 13332 $inpt.on('change', function () { 13333 if($(this).val()!==''){ 13334 $('label[for="edit-mail"]').addClass('filled_area'); 13335 }else{ 13336 $('label[for="edit-mail"]').removeClass('filled_area'); 13337 } 13338 }); 13339 }); 13340 13341$(document).ready(function () { 13342$('#edit-mail').focus(function () { 13343$('label[for="edit-mail"]').addClass('filled_focus'); 13344}); 13345$('#edit-mail').blur(function () { 13346$('label[for="edit-mail"]').removeClass('filled_focus'); });}); 13347 13348/* EDIT SUBJECT */ 13349 13350$(document).ready(function () { 13351var $inpt = $('#edit-subject'); 13352$inpt.each(function () { 13353 if($(this).val()!==''){ 13354 $('label[for="edit-subject"]').removeClass('filled_focus').addClass('filled_area'); 13355 } 13356 }); 13357 13358 $inpt.on('change', function () { 13359 if($(this).val()!==''){ 13360 $('label[for="edit-subject"]').addClass('filled_area'); 13361 }else{ 13362 $('label[for="edit-subject"]').removeClass('filled_area'); 13363 } 13364 }); 13365 }); 13366 13367$(document).ready(function () { 13368$('#edit-subject').focus(function () { 13369$('label[for="edit-subject"]').addClass('filled_focus'); 13370}); 13371$('#edit-subject').blur(function () { 13372$('label[for="edit-subject"]').removeClass('filled_focus'); });}); 13373 13374/* EDIT MESSAGE */ 13375 13376$(document).ready(function () { 13377var $inpt = $('#edit-message'); 13378$inpt.each(function () { 13379 if($(this).val()!==''){ 13380 $('label[for="edit-message"]').removeClass('filled_focus_message').addClass('filled_area_message'); 13381 } 13382 }); 13383 13384 $inpt.on('change', function () { 13385 if($(this).val()!==''){ 13386 $('label[for="edit-message"]').addClass('filled_area_message'); 13387 }else{ 13388 $('label[for="edit-message"]').removeClass('filled_area_message'); 13389 } 13390 }); 13391 }); 13392 13393$(document).ready(function () { 13394$('#edit-message').focus(function () { 13395$('label[for="edit-message"]').addClass('filled_focus_message'); 13396}); 13397$('#edit-message').blur(function () { 13398$('label[for="edit-message"]').removeClass('filled_focus_message'); });}); 13399 13400/* EDIT KEYS */ 13401 13402$(document).ready(function () { 13403var $inpt = $('#edit-keys'); 13404$inpt.each(function () { 13405 if($(this).val()!==''){ 13406 $('label[for="edit-keys"]').removeClass('filled_focus').addClass('filled_area'); 13407 } 13408 }); 13409 13410 $inpt.on('change', function () { 13411 if($(this).val()!==''){ 13412 $('label[for="edit-keys"]').addClass('filled_area'); 13413 }else{ 13414 $('label[for="edit-keys"]').removeClass('filled_area'); 13415 } 13416 }); 13417 }); 13418 13419$(document).ready(function () { 13420$('#edit-keys').focus(function () { 13421$('label[for="edit-keys"]').addClass('filled_focus'); 13422}); 13423$('#edit-keys').blur(function () { 13424$('label[for="edit-keys"]').removeClass('filled_focus'); });}); 13425 13426/* EDIT PASS PASS1 */ 13427 13428$(document).ready(function () { 13429var $inpt = $('#edit-pass-pass1'); 13430$inpt.each(function () { 13431 if($(this).val()!==''){ 13432 $('label[for="edit-pass-pass1"]').removeClass('filled_focus').addClass('filled_area'); 13433 } 13434 }); 13435 13436 $inpt.on('change', function () { 13437 if($(this).val()!==''){ 13438 $('label[for="edit-pass-pass1"]').addClass('filled_area'); 13439 }else{ 13440 $('label[for="edit-pass-pass1"]').removeClass('filled_area'); 13441 } 13442 }); 13443 }); 13444 13445$(document).ready(function () { 13446$('#edit-pass-pass1').focus(function () { 13447$('label[for="edit-pass-pass1"]').addClass('filled_focus'); 13448}); 13449$('#edit-pass-pass1').blur(function () { 13450$('label[for="edit-pass-pass1"]').removeClass('filled_focus'); });}); 13451 13452/* EDIT PASS PASS2 */ 13453 13454$(document).ready(function () { 13455var $inpt = $('#edit-pass-pass2'); 13456$inpt.each(function () { 13457 if($(this).val()!==''){ 13458 $('label[for="edit-pass-pass2"]').removeClass('filled_focus').addClass('filled_area'); 13459 } 13460 }); 13461 13462 $inpt.on('change', function () { 13463 if($(this).val()!==''){ 13464 $('label[for="edit-pass-pass2"]').addClass('filled_area'); 13465 }else{ 13466 $('label[for="edit-pass-pass2"]').removeClass('filled_area'); 13467 } 13468 }); 13469 }); 13470 13471$(document).ready(function () { 13472$('#edit-pass-pass2').focus(function () { 13473$('label[for="edit-pass-pass2"]').addClass('filled_focus'); 13474}); 13475$('#edit-pass-pass2').blur(function () { 13476$('label[for="edit-pass-pass2"]').removeClass('filled_focus'); });});; 13477(function ( $, window, document, undefined ) { 13478 13479 var pluginName = "tabulous", 13480 defaults = { 13481 effect: 'scale' 13482 }; 13483 13484 function Plugin( element, options ) { 13485 this.element = element; 13486 this.$elem = $(this.element); 13487 this.options = $.extend( {}, defaults, options ); 13488 this._defaults = defaults; 13489 this._name = pluginName; 13490 this.init(); 13491 } 13492 13493 Plugin.prototype = { 13494 13495 init: function() { 13496 13497 var links = this.$elem.find('l>a'); 13498 var firstchild = this.$elem.find('l:first-child').find('l>a'); 13499 13500 if (this.options.effect == 'scale') { 13501 tab_content = this.$elem.find('div').not(':first').not(':nth-child(1)').addClass('hidescale'); 13502 } else if (this.options.effect == 'slideLeft') { 13503 tab_content = this.$elem.find('div').not(':first').not(':nth-child(1)').addClass('hideleft'); 13504 } else if (this.options.effect == 'scaleUp') { 13505 tab_content = this.$elem.find('div').not(':first').not(':nth-child(1)').addClass('hidescaleup'); 13506 } else if (this.options.effect == 'flip') { 13507 tab_content = this.$elem.find('div').not(':first').not(':nth-child(1)').addClass('hideflip'); 13508 } 13509 13510 var firstdiv = this.$elem.find('.tabset_content'); 13511 var firstdivheight = this.$elem.find('div'); 13512 13513 var alldivs = this.$elem.find('div:first').find('div'); 13514 13515 alldivs.css ({'position': 'absolute', 'width': '-webkit-fill-available'}) 13516 13517 firstdiv.css('height',firstdivheight+'px'); 13518 13519 firstchild.addClass('active'); 13520 13521 links.bind('click', {myOptions: this.options}, function(e) { 13522 e.preventDefault(); 13523 13524 var $options = e.data.myOptions; 13525 var effect = $options.effect; 13526 13527 var mythis = $(this); 13528 var thisform = mythis.parent().parent().parent(); 13529 var thislink = mythis.attr('href'); 13530 13531 13532 firstdiv.addClass('transition'); 13533 13534 links.removeClass('active'); 13535 mythis.addClass('active'); 13536 thisdivwidth = thisform.find('div'+thislink).height(); 13537 13538 if (effect == 'scale') { 13539 alldivs.removeClass('showscale').addClass('make_transist').addClass('hidescale'); 13540 thisform.find('div'+thislink).addClass('make_transist').addClass('showscale'); 13541 } else if (effect == 'slideLeft') { 13542 alldivs.removeClass('showleft').addClass('make_transist').addClass('hideleft'); 13543 thisform.find('div'+thislink).addClass('make_transist').addClass('showleft'); 13544 } else if (effect == 'scaleUp') { 13545 alldivs.removeClass('showscaleup').addClass('make_transist').addClass('hidescaleup'); 13546 thisform.find('div'+thislink).addClass('make_transist').addClass('showscaleup'); 13547 } else if (effect == 'flip') { 13548 alldivs.removeClass('showflip').addClass('make_transist').addClass('hideflip'); 13549 thisform.find('div'+thislink).addClass('make_transist').addClass('showflip'); 13550 } 13551 13552 13553 firstdiv.css('height',thisdivwidth+'px'); 13554 13555 13556 13557 13558 }); 13559 13560 13561 13562 13563 13564 13565 }, 13566 13567 yourOtherFunction: function(el, options) { 13568 // some logic 13569 } 13570 }; 13571 13572 // A really lightweight plugin wrapper around the constructor, 13573 // preventing against multiple instantiations 13574 $.fn[pluginName] = function ( options ) { 13575 return this.each(function () { 13576 new Plugin( this, options ); 13577 }); 13578 }; 13579 13580})( jQuery, window, document );; 13581$(function() { 13582 var scroll_timer; 13583 var displayed = false; 13584 var $message = $('#message'); 13585 var $messagedown = $('#messagedown'); 13586 var $window = $(window); 13587 var top = $(document.body).children(0).position().top; 13588 13589 $window.scroll(function () { 13590 window.clearTimeout(scroll_timer); 13591 scroll_timer = window.setTimeout(function () { // use a timer for performance 13592 if($window.scrollTop() <= top) // hide if at the top of the page 13593 { 13594 displayed = false; 13595 $message.fadeOut(0); 13596 $messagedown.fadeIn(0); 13597 } 13598 else if(displayed == false) // show if scrolling down 13599 { 13600 displayed = false; 13601 $message.fadeIn(0); 13602 $messagedown.fadeOut(0); 13603 } 13604 }); 13605 }); 13606 }); 13607 13608$(function() { 13609 var $elem = $('#art-main'); 13610 $('#messagedown').click( 13611 function (e) { 13612 $('html, body').animate({scrollTop: $elem.height()}, 800); 13613 } 13614 ); 13615 $('#message').click( 13616 function (e) { 13617 $('html, body').animate({scrollTop: '0px'}, 800); 13618 } 13619 ); 13620 });; 13621(function($) { 13622 var defaults = { 13623 topSpacing: 0, 13624 bottomSpacing: 0, 13625 className: 'is-sticky', 13626 wrapperClassName: 'sticky-wrapper', 13627 center: false, 13628 getWidthFrom: '' 13629 }, 13630 $window = $(window), 13631 $document = $(document), 13632 sticked = [], 13633 windowHeight = $window.height(), 13634 scroller = function() { 13635 var scrollTop = $window.scroll
13635Top(), 13636 documentHeight = $document.height(), 13637 dwh = documentHeight - windowHeight, 13638 extra = (scrollTop > dwh) ? dwh - scrollTop : 0; 13639 13640 for (var i = 0; i < sticked.length; i++) { 13641 var s = sticked[i], 13642 elementTop = s.stickyWrapper.offset().top, 13643 etse = elementTop - s.topSpacing - extra; 13644 13645 if (scrollTop <= etse) { 13646 if (s.currentTop !== null) { 13647 s.stickyElement 13648 .css('position', '') 13649 .css('top', ''); 13650 s.stickyElement.parent().removeClass(s.className); 13651 s.currentTop = null; 13652 } 13653 } 13654 else { 13655 var newTop = documentHeight - s.stickyElement.outerHeight() 13656 - s.topSpacing - s.bottomSpacing - scrollTop - extra; 13657 if (newTop < 0) { 13658 newTop = newTop + s.topSpacing; 13659 } else { 13660 newTop = s.topSpacing; 13661 } 13662 if (s.currentTop != newTop) { 13663 s.stickyElement 13664 .css('position', 'fixed') 13665 .css('top', newTop); 13666 13667 if (typeof s.getWidthFrom !== 'undefined') { 13668 s.stickyElement.css('width', $(s.getWidthFrom).width()); 13669 } 13670 13671 s.stickyElement.parent().addClass(s.className); 13672 s.currentTop = newTop; 13673 } 13674 } 13675 } 13676 }, 13677 resizer = function() { 13678 windowHeight = $window.height(); 13679 }, 13680 methods = { 13681 init: function(options) { 13682 var o = $.extend(defaults, options); 13683 return this.each(function() { 13684 var stickyElement = $(this); 13685 13686 var stickyId = stickyElement.attr('id'); 13687 var wrapper = $('<div></div>') 13688 .attr('id', stickyId + '-sticky-wrapper') 13689 .addClass(o.wrapperClassName); 13690 stickyElement.wrapAll(wrapper); 13691 13692 if (o.center) { 13693 stickyElement.parent().css({width:stickyElement.outerWidth(),marginLeft:"auto",marginRight:"auto"}); 13694 } 13695 13696 if (stickyElement.css("float") == "right") { 13697 stickyElement.css({"float":"none"}).parent().css({"float":"right"}); 13698 } 13699 13700 var stickyWrapper = stickyElement.parent(); 13701 stickyWrapper.css('height', stickyElement.outerHeight(true)); 13702 sticked.push({ 13703 topSpacing: o.topSpacing, 13704 bottomSpacing: o.bottomSpacing, 13705 stickyElement: stickyElement, 13706 currentTop: null, 13707 stickyWrapper: stickyWrapper, 13708 className: o.className, 13709 getWidthFrom: o.getWidthFrom 13710 }); 13711 }); 13712 }, 13713 update: scroller 13714 }; 13715 13716 // should be more efficient than using $window.scroll(scroller) and $window.resize(resizer): 13717 if (window.addEventListener) { 13718 window.addEventListener('scroll', scroller, false); 13719 window.addEventListener('resize', resizer, false); 13720 } else if (window.attachEvent) { 13721 window.attachEvent('onscroll', scroller); 13722 window.attachEvent('onresize', resizer); 13723 } 13724 13725 $.fn.sticky = function(method) { 13726 if (methods[method]) { 13727 return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); 13728 } else if (typeof method === 'object' || !method ) { 13729 return methods.init.apply( this, arguments ); 13730 } else { 13731 $.error('Method ' + method + ' does not exist on jQuery.sticky'); 13732 } 13733 }; 13734 $(function() { 13735 setTimeout(scroller, 0); 13736 }); 13737})(jQuery);;
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.