How to use jQuery.isFunction method in Cypress

Best JavaScript code snippet using cypress

jquery.js

Source:jquery.js Github

copy

Full Screen

1/*!2 * jquery javascript library v1.5.13 * http://jquery.com/4 *5 * copyright 2011, john resig6 * dual licensed under the mit or gpl version 2 licenses.7 * http://jquery.org/license8 *9 * includes sizzle.js10 * http://sizzlejs.com/11 * copyright 2011, the dojo foundation12 * released under the mit, bsd, and gpl licenses.13 *14 * date: wed feb 23 13:55:29 2011 -050015 */16(function( window, undefined ) {17// use the correct document accordingly with window argument (sandbox)18var document = window.document;19var jquery = (function() {20// define a local copy of jquery21var jquery = function( selector, context ) {22 // the jquery object is actually just the init constructor 'enhanced'23 return new jquery.fn.init( selector, context, rootjquery );24 },25 // map over jquery in case of overwrite26 _jquery = window.jquery,27 // map over the $ in case of overwrite28 _$ = window.$,29 // a central reference to the root jquery(document)30 rootjquery,31 // a simple way to check for html strings or id strings32 // (both of which we optimize for)33 quickexpr = /^(?:[^<]*(<[\w\w]+>)[^>]*$|#([\w\-]+)$)/,34 // check if a string has a non-whitespace character in it35 rnotwhite = /\s/,36 // used for trimming whitespace37 trimleft = /^\s+/,38 trimright = /\s+$/,39 // check for digits40 rdigit = /\d/,41 // match a standalone tag42 rsingletag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,43 // json regexp44 rvalidchars = /^[\],:{}\s]*$/,45 rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fa-f]{4})/g,46 rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[ee][+\-]?\d+)?/g,47 rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,48 // useragent regexp49 rwebkit = /(webkit)[ \/]([\w.]+)/,50 ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,51 rmsie = /(msie) ([\w.]+)/,52 rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,53 // keep a useragent string for use with jquery.browser54 useragent = navigator.useragent,55 // for matching the engine and version of the browser56 browsermatch,57 // has the ready events already been bound?58 readybound = false,59 // the deferred used on dom ready60 readylist,61 // promise methods62 promisemethods = "then done fail isresolved isrejected promise".split( " " ),63 // the ready event handler64 domcontentloaded,65 // save a reference to some core methods66 tostring = object.prototype.tostring,67 hasown = object.prototype.hasownproperty,68 push = array.prototype.push,69 slice = array.prototype.slice,70 trim = string.prototype.trim,71 indexof = array.prototype.indexof,72 // [[class]] -> type pairs73 class2type = {};74jquery.fn = jquery.prototype = {75 constructor: jquery,76 init: function( selector, context, rootjquery ) {77 var match, elem, ret, doc;78 // handle $(""), $(null), or $(undefined)79 if ( !selector ) {80 return this;81 }82 // handle $(domelement)83 if ( selector.nodetype ) {84 this.context = this[0] = selector;85 this.length = 1;86 return this;87 }88 // the body element only exists once, optimize finding it89 if ( selector === "body" && !context && document.body ) {90 this.context = document;91 this[0] = document.body;92 this.selector = "body";93 this.length = 1;94 return this;95 }96 // handle html strings97 if ( typeof selector === "string" ) {98 // are we dealing with html string or an id?99 match = quickexpr.exec( selector );100 // verify a match, and that no context was specified for #id101 if ( match && (match[1] || !context) ) {102 // handle: $(html) -> $(array)103 if ( match[1] ) {104 context = context instanceof jquery ? context[0] : context;105 doc = (context ? context.ownerdocument || context : document);106 // if a single string is passed in and it's a single tag107 // just do a createelement and skip the rest108 ret = rsingletag.exec( selector );109 if ( ret ) {110 if ( jquery.isplainobject( context ) ) {111 selector = [ document.createelement( ret[1] ) ];112 jquery.fn.attr.call( selector, context, true );113 } else {114 selector = [ doc.createelement( ret[1] ) ];115 }116 } else {117 ret = jquery.buildfragment( [ match[1] ], [ doc ] );118 selector = (ret.cacheable ? jquery.clone(ret.fragment) : ret.fragment).childnodes;119 }120 return jquery.merge( this, selector );121 // handle: $("#id")122 } else {123 elem = document.getelementbyid( match[2] );124 // check parentnode to catch when blackberry 4.6 returns125 // nodes that are no longer in the document #6963126 if ( elem && elem.parentnode ) {127 // handle the case where ie and opera return items128 // by name instead of id129 if ( elem.id !== match[2] ) {130 return rootjquery.find( selector );131 }132 // otherwise, we inject the element directly into the jquery object133 this.length = 1;134 this[0] = elem;135 }136 this.context = document;137 this.selector = selector;138 return this;139 }140 // handle: $(expr, $(...))141 } else if ( !context || context.jquery ) {142 return (context || rootjquery).find( selector );143 // handle: $(expr, context)144 // (which is just equivalent to: $(context).find(expr)145 } else {146 return this.constructor( context ).find( selector );147 }148 // handle: $(function)149 // shortcut for document ready150 } else if ( jquery.isfunction( selector ) ) {151 return rootjquery.ready( selector );152 }153 if (selector.selector !== undefined) {154 this.selector = selector.selector;155 this.context = selector.context;156 }157 return jquery.makearray( selector, this );158 },159 // start with an empty selector160 selector: "",161 // the current version of jquery being used162 jquery: "1.5.1",163 // the default length of a jquery object is 0164 length: 0,165 // the number of elements contained in the matched element set166 size: function() {167 return this.length;168 },169 toarray: function() {170 return slice.call( this, 0 );171 },172 // get the nth element in the matched element set or173 // get the whole matched element set as a clean array174 get: function( num ) {175 return num == null ?176 // return a 'clean' array177 this.toarray() :178 // return just the object179 ( num < 0 ? this[ this.length + num ] : this[ num ] );180 },181 // take an array of elements and push it onto the stack182 // (returning the new matched element set)183 pushstack: function( elems, name, selector ) {184 // build a new jquery matched element set185 var ret = this.constructor();186 if ( jquery.isarray( elems ) ) {187 push.apply( ret, elems );188 } else {189 jquery.merge( ret, elems );190 }191 // add the old object onto the stack (as a reference)192 ret.prevobject = this;193 ret.context = this.context;194 if ( name === "find" ) {195 ret.selector = this.selector + (this.selector ? " " : "") + selector;196 } else if ( name ) {197 ret.selector = this.selector + "." + name + "(" + selector + ")";198 }199 // return the newly-formed element set200 return ret;201 },202 // execute a callback for every element in the matched set.203 // (you can seed the arguments with an array of args, but this is204 // only used internally.)205 each: function( callback, args ) {206 return jquery.each( this, callback, args );207 },208 ready: function( fn ) {209 // attach the listeners210 jquery.bindready();211 // add the callback212 readylist.done( fn );213 return this;214 },215 eq: function( i ) {216 return i === -1 ?217 this.slice( i ) :218 this.slice( i, +i + 1 );219 },220 first: function() {221 return this.eq( 0 );222 },223 last: function() {224 return this.eq( -1 );225 },226 slice: function() {227 return this.pushstack( slice.apply( this, arguments ),228 "slice", slice.call(arguments).join(",") );229 },230 map: function( callback ) {231 return this.pushstack( jquery.map(this, function( elem, i ) {232 return callback.call( elem, i, elem );233 }));234 },235 end: function() {236 return this.prevobject || this.constructor(null);237 },238 // for internal use only.239 // behaves like an array's method, not like a jquery method.240 push: push,241 sort: [].sort,242 splice: [].splice243};244// give the init function the jquery prototype for later instantiation245jquery.fn.init.prototype = jquery.fn;246jquery.extend = jquery.fn.extend = function() {247 var options, name, src, copy, copyisarray, clone,248 target = arguments[0] || {},249 i = 1,250 length = arguments.length,251 deep = false;252 // handle a deep copy situation253 if ( typeof target === "boolean" ) {254 deep = target;255 target = arguments[1] || {};256 // skip the boolean and the target257 i = 2;258 }259 // handle case when target is a string or something (possible in deep copy)260 if ( typeof target !== "object" && !jquery.isfunction(target) ) {261 target = {};262 }263 // extend jquery itself if only one argument is passed264 if ( length === i ) {265 target = this;266 --i;267 }268 for ( ; i < length; i++ ) {269 // only deal with non-null/undefined values270 if ( (options = arguments[ i ]) != null ) {271 // extend the base object272 for ( name in options ) {273 src = target[ name ];274 copy = options[ name ];275 // prevent never-ending loop276 if ( target === copy ) {277 continue;278 }279 // recurse if we're merging plain objects or arrays280 if ( deep && copy && ( jquery.isplainobject(copy) || (copyisarray = jquery.isarray(copy)) ) ) {281 if ( copyisarray ) {282 copyisarray = false;283 clone = src && jquery.isarray(src) ? src : [];284 } else {285 clone = src && jquery.isplainobject(src) ? src : {};286 }287 // never move original objects, clone them288 target[ name ] = jquery.extend( deep, clone, copy );289 // don't bring in undefined values290 } else if ( copy !== undefined ) {291 target[ name ] = copy;292 }293 }294 }295 }296 // return the modified object297 return target;298};299jquery.extend({300 noconflict: function( deep ) {301 window.$ = _$;302 if ( deep ) {303 window.jquery = _jquery;304 }305 return jquery;306 },307 // is the dom ready to be used? set to true once it occurs.308 isready: false,309 // a counter to track how many items to wait for before310 // the ready event fires. see #6781311 readywait: 1,312 // handle when the dom is ready313 ready: function( wait ) {314 // a third-party is pushing the ready event forwards315 if ( wait === true ) {316 jquery.readywait--;317 }318 // make sure that the dom is not already loaded319 if ( !jquery.readywait || (wait !== true && !jquery.isready) ) {320 // make sure body exists, at least, in case ie gets a little overzealous (ticket #5443).321 if ( !document.body ) {322 return settimeout( jquery.ready, 1 );323 }324 // remember that the dom is ready325 jquery.isready = true;326 // if a normal dom ready event fired, decrement, and wait if need be327 if ( wait !== true && --jquery.readywait > 0 ) {328 return;329 }330 // if there are functions bound, to execute331 readylist.resolvewith( document, [ jquery ] );332 // trigger any bound ready events333 if ( jquery.fn.trigger ) {334 jquery( document ).trigger( "ready" ).unbind( "ready" );335 }336 }337 },338 bindready: function() {339 if ( readybound ) {340 return;341 }342 readybound = true;343 // catch cases where $(document).ready() is called after the344 // browser event has already occurred.345 if ( document.readystate === "complete" ) {346 // handle it asynchronously to allow scripts the opportunity to delay ready347 return settimeout( jquery.ready, 1 );348 }349 // mozilla, opera and webkit nightlies currently support this event350 if ( document.addeventlistener ) {351 // use the handy event callback352 document.addeventlistener( "domcontentloaded", domcontentloaded, false );353 // a fallback to window.onload, that will always work354 window.addeventlistener( "load", jquery.ready, false );355 // if ie event model is used356 } else if ( document.attachevent ) {357 // ensure firing before onload,358 // maybe late but safe also for iframes359 document.attachevent("onreadystatechange", domcontentloaded);360 // a fallback to window.onload, that will always work361 window.attachevent( "onload", jquery.ready );362 // if ie and not a frame363 // continually check to see if the document is ready364 var toplevel = false;365 try {366 toplevel = window.frameelement == null;367 } catch(e) {}368 if ( document.documentelement.doscroll && toplevel ) {369 doscrollcheck();370 }371 }372 },373 // see test/unit/core.js for details concerning isfunction.374 // since version 1.3, dom methods and functions like alert375 // aren't supported. they return false on ie (#2968).376 isfunction: function( obj ) {377 return jquery.type(obj) === "function";378 },379 isarray: array.isarray || function( obj ) {380 return jquery.type(obj) === "array";381 },382 // a crude way of determining if an object is a window383 iswindow: function( obj ) {384 return obj && typeof obj === "object" && "setinterval" in obj;385 },386 isnan: function( obj ) {387 return obj == null || !rdigit.test( obj ) || isnan( obj );388 },389 type: function( obj ) {390 return obj == null ?391 string( obj ) :392 class2type[ tostring.call(obj) ] || "object";393 },394 isplainobject: function( obj ) {395 // must be an object.396 // because of ie, we also have to check the presence of the constructor property.397 // make sure that dom nodes and window objects don't pass through, as well398 if ( !obj || jquery.type(obj) !== "object" || obj.nodetype || jquery.iswindow( obj ) ) {399 return false;400 }401 // not own constructor property must be object402 if ( obj.constructor &&403 !hasown.call(obj, "constructor") &&404 !hasown.call(obj.constructor.prototype, "isprototypeof") ) {405 return false;406 }407 // own properties are enumerated firstly, so to speed up,408 // if last one is own, then all properties are own.409 var key;410 for ( key in obj ) {}411 return key === undefined || hasown.call( obj, key );412 },413 isemptyobject: function( obj ) {414 for ( var name in obj ) {415 return false;416 }417 return true;418 },419 error: function( msg ) {420 throw msg;421 },422 parsejson: function( data ) {423 if ( typeof data !== "string" || !data ) {424 return null;425 }426 // make sure leading/trailing whitespace is removed (ie can't handle it)427 data = jquery.trim( data );428 // make sure the incoming data is actual json429 // logic borrowed from http://json.org/json2.js430 if ( rvalidchars.test(data.replace(rvalidescape, "@")431 .replace(rvalidtokens, "]")432 .replace(rvalidbraces, "")) ) {433 // try to use the native json parser first434 return window.json && window.json.parse ?435 window.json.parse( data ) :436 (new function("return " + data))();437 } else {438 jquery.error( "invalid json: " + data );439 }440 },441 // cross-browser xml parsing442 // (xml & tmp used internally)443 parsexml: function( data , xml , tmp ) {444 if ( window.domparser ) { // standard445 tmp = new domparser();446 xml = tmp.parsefromstring( data , "text/xml" );447 } else { // ie448 xml = new activexobject( "microsoft.xmldom" );449 xml.async = "false";450 xml.loadxml( data );451 }452 tmp = xml.documentelement;453 if ( ! tmp || ! tmp.nodename || tmp.nodename === "parsererror" ) {454 jquery.error( "invalid xml: " + data );455 }456 return xml;457 },458 noop: function() {},459 // evalulates a script in a global context460 globaleval: function( data ) {461 if ( data && rnotwhite.test(data) ) {462 // inspired by code by andrea giammarchi463 // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html464 var head = document.head || document.getelementsbytagname( "head" )[0] || document.documentelement,465 script = document.createelement( "script" );466 if ( jquery.support.scripteval() ) {467 script.appendchild( document.createtextnode( data ) );468 } else {469 script.text = data;470 }471 // use insertbefore instead of appendchild to circumvent an ie6 bug.472 // this arises when a base node is used (#2709).473 head.insertbefore( script, head.firstchild );474 head.removechild( script );475 }476 },477 nodename: function( elem, name ) {478 return elem.nodename && elem.nodename.touppercase() === name.touppercase();479 },480 // args is for internal usage only481 each: function( object, callback, args ) {482 var name, i = 0,483 length = object.length,484 isobj = length === undefined || jquery.isfunction(object);485 if ( args ) {486 if ( isobj ) {487 for ( name in object ) {488 if ( callback.apply( object[ name ], args ) === false ) {489 break;490 }491 }492 } else {493 for ( ; i < length; ) {494 if ( callback.apply( object[ i++ ], args ) === false ) {495 break;496 }497 }498 }499 // a special, fast, case for the most common use of each500 } else {501 if ( isobj ) {502 for ( name in object ) {503 if ( callback.call( object[ name ], name, object[ name ] ) === false ) {504 break;505 }506 }507 } else {508 for ( var value = object[0];509 i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}510 }511 }512 return object;513 },514 // use native string.trim function wherever possible515 trim: trim ?516 function( text ) {517 return text == null ?518 "" :519 trim.call( text );520 } :521 // otherwise use our own trimming functionality522 function( text ) {523 return text == null ?524 "" :525 text.tostring().replace( trimleft, "" ).replace( trimright, "" );526 },527 // results is for internal usage only528 makearray: function( array, results ) {529 var ret = results || [];530 if ( array != null ) {531 // the window, strings (and functions) also have 'length'532 // the extra typeof function check is to prevent crashes533 // in safari 2 (see: #3039)534 // tweaked logic slightly to handle blackberry 4.7 regexp issues #6930535 var type = jquery.type(array);536 if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jquery.iswindow( array ) ) {537 push.call( ret, array );538 } else {539 jquery.merge( ret, array );540 }541 }542 return ret;543 },544 inarray: function( elem, array ) {545 if ( array.indexof ) {546 return array.indexof( elem );547 }548 for ( var i = 0, length = array.length; i < length; i++ ) {549 if ( array[ i ] === elem ) {550 return i;551 }552 }553 return -1;554 },555 merge: function( first, second ) {556 var i = first.length,557 j = 0;558 if ( typeof second.length === "number" ) {559 for ( var l = second.length; j < l; j++ ) {560 first[ i++ ] = second[ j ];561 }562 } else {563 while ( second[j] !== undefined ) {564 first[ i++ ] = second[ j++ ];565 }566 }567 first.length = i;568 return first;569 },570 grep: function( elems, callback, inv ) {571 var ret = [], retval;572 inv = !!inv;573 // go through the array, only saving the items574 // that pass the validator function575 for ( var i = 0, length = elems.length; i < length; i++ ) {576 retval = !!callback( elems[ i ], i );577 if ( inv !== retval ) {578 ret.push( elems[ i ] );579 }580 }581 return ret;582 },583 // arg is for internal usage only584 map: function( elems, callback, arg ) {585 var ret = [], value;586 // go through the array, translating each of the items to their587 // new value (or values).588 for ( var i = 0, length = elems.length; i < length; i++ ) {589 value = callback( elems[ i ], i, arg );590 if ( value != null ) {591 ret[ ret.length ] = value;592 }593 }594 // flatten any nested arrays595 return ret.concat.apply( [], ret );596 },597 // a global guid counter for objects598 guid: 1,599 proxy: function( fn, proxy, thisobject ) {600 if ( arguments.length === 2 ) {601 if ( typeof proxy === "string" ) {602 thisobject = fn;603 fn = thisobject[ proxy ];604 proxy = undefined;605 } else if ( proxy && !jquery.isfunction( proxy ) ) {606 thisobject = proxy;607 proxy = undefined;608 }609 }610 if ( !proxy && fn ) {611 proxy = function() {612 return fn.apply( thisobject || this, arguments );613 };614 }615 // set the guid of unique handler to the same of original handler, so it can be removed616 if ( fn ) {617 proxy.guid = fn.guid = fn.guid || proxy.guid || jquery.guid++;618 }619 // so proxy can be declared as an argument620 return proxy;621 },622 // mutifunctional method to get and set values to a collection623 // the value/s can be optionally by executed if its a function624 access: function( elems, key, value, exec, fn, pass ) {625 var length = elems.length;626 // setting many attributes627 if ( typeof key === "object" ) {628 for ( var k in key ) {629 jquery.access( elems, k, key[k], exec, fn, value );630 }631 return elems;632 }633 // setting one attribute634 if ( value !== undefined ) {635 // optionally, function values get executed if exec is true636 exec = !pass && exec && jquery.isfunction(value);637 for ( var i = 0; i < length; i++ ) {638 fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );639 }640 return elems;641 }642 // getting an attribute643 return length ? fn( elems[0], key ) : undefined;644 },645 now: function() {646 return (new date()).gettime();647 },648 // create a simple deferred (one callbacks list)649 _deferred: function() {650 var // callbacks list651 callbacks = [],652 // stored [ context , args ]653 fired,654 // to avoid firing when already doing so655 firing,656 // flag to know if the deferred has been cancelled657 cancelled,658 // the deferred itself659 deferred = {660 // done( f1, f2, ...)661 done: function() {662 if ( !cancelled ) {663 var args = arguments,664 i,665 length,666 elem,667 type,668 _fired;669 if ( fired ) {670 _fired = fired;671 fired = 0;672 }673 for ( i = 0, length = args.length; i < length; i++ ) {674 elem = args[ i ];675 type = jquery.type( elem );676 if ( type === "array" ) {677 deferred.done.apply( deferred, elem );678 } else if ( type === "function" ) {679 callbacks.push( elem );680 }681 }682 if ( _fired ) {683 deferred.resolvewith( _fired[ 0 ], _fired[ 1 ] );684 }685 }686 return this;687 },688 // resolve with given context and args689 resolvewith: function( context, args ) {690 if ( !cancelled && !fired && !firing ) {691 firing = 1;692 try {693 while( callbacks[ 0 ] ) {694 callbacks.shift().apply( context, args );695 }696 }697 // we have to add a catch block for698 // ie prior to 8 or else the finally699 // block will never get executed700 catch (e) {701 throw e;702 }703 finally {704 fired = [ context, args ];705 firing = 0;706 }707 }708 return this;709 },710 // resolve with this as context and given arguments711 resolve: function() {712 deferred.resolvewith( jquery.isfunction( this.promise ) ? this.promise() : this, arguments );713 return this;714 },715 // has this deferred been resolved?716 isresolved: function() {717 return !!( firing || fired );718 },719 // cancel720 cancel: function() {721 cancelled = 1;722 callbacks = [];723 return this;724 }725 };726 return deferred;727 },728 // full fledged deferred (two callbacks list)729 deferred: function( func ) {730 var deferred = jquery._deferred(),731 faildeferred = jquery._deferred(),732 promise;733 // add errordeferred methods, then and promise734 jquery.extend( deferred, {735 then: function( donecallbacks, failcallbacks ) {736 deferred.done( donecallbacks ).fail( failcallbacks );737 return this;738 },739 fail: faildeferred.done,740 rejectwith: faildeferred.resolvewith,741 reject: faildeferred.resolve,742 isrejected: faildeferred.isresolved,743 // get a promise for this deferred744 // if obj is provided, the promise aspect is added to the object745 promise: function( obj ) {746 if ( obj == null ) {747 if ( promise ) {748 return promise;749 }750 promise = obj = {};751 }752 var i = promisemethods.length;753 while( i-- ) {754 obj[ promisemethods[i] ] = deferred[ promisemethods[i] ];755 }756 return obj;757 }758 } );759 // make sure only one callback list will be used760 deferred.done( faildeferred.cancel ).fail( deferred.cancel );761 // unexpose cancel762 delete deferred.cancel;763 // call given func if any764 if ( func ) {765 func.call( deferred, deferred );766 }767 return deferred;768 },769 // deferred helper770 when: function( object ) {771 var lastindex = arguments.length,772 deferred = lastindex <= 1 && object && jquery.isfunction( object.promise ) ?773 object :774 jquery.deferred(),775 promise = deferred.promise();776 if ( lastindex > 1 ) {777 var array = slice.call( arguments, 0 ),778 count = lastindex,779 icallback = function( index ) {780 return function( value ) {781 array[ index ] = arguments.length > 1 ? slice.call( arguments, 0 ) : value;782 if ( !( --count ) ) {783 deferred.resolvewith( promise, array );784 }785 };786 };787 while( ( lastindex-- ) ) {788 object = array[ lastindex ];789 if ( object && jquery.isfunction( object.promise ) ) {790 object.promise().then( icallback(lastindex), deferred.reject );791 } else {792 --count;793 }794 }795 if ( !count ) {796 deferred.resolvewith( promise, array );797 }798 } else if ( deferred !== object ) {799 deferred.resolve( object );800 }801 return promise;802 },803 // use of jquery.browser is frowned upon.804 // more details: http://docs.jquery.com/utilities/jquery.browser805 uamatch: function( ua ) {806 ua = ua.tolowercase();807 var match = rwebkit.exec( ua ) ||808 ropera.exec( ua ) ||809 rmsie.exec( ua ) ||810 ua.indexof("compatible") < 0 && rmozilla.exec( ua ) ||811 [];812 return { browser: match[1] || "", version: match[2] || "0" };813 },814 sub: function() {815 function jquerysubclass( selector, context ) {816 return new jquerysubclass.fn.init( selector, context );817 }818 jquery.extend( true, jquerysubclass, this );819 jquerysubclass.superclass = this;820 jquerysubclass.fn = jquerysubclass.prototype = this();821 jquerysubclass.fn.constructor = jquerysubclass;822 jquerysubclass.subclass = this.subclass;823 jquerysubclass.fn.init = function init( selector, context ) {824 if ( context && context instanceof jquery && !(context instanceof jquerysubclass) ) {825 context = jquerysubclass(context);826 }827 return jquery.fn.init.call( this, selector, context, rootjquerysubclass );828 };829 jquerysubclass.fn.init.prototype = jquerysubclass.fn;830 var rootjquerysubclass = jquerysubclass(document);831 return jquerysubclass;832 },833 browser: {}834});835// create readylist deferred836readylist = jquery._deferred();837// populate the class2type map838jquery.each("boolean number string function array date regexp object".split(" "), function(i, name) {839 class2type[ "[object " + name + "]" ] = name.tolowercase();840});841browsermatch = jquery.uamatch( useragent );842if ( browsermatch.browser ) {843 jquery.browser[ browsermatch.browser ] = true;844 jquery.browser.version = browsermatch.version;845}846// deprecated, use jquery.browser.webkit instead847if ( jquery.browser.webkit ) {848 jquery.browser.safari = true;849}850if ( indexof ) {851 jquery.inarray = function( elem, array ) {852 return indexof.call( array, elem );853 };854}855// ie doesn't match non-breaking spaces with \s856if ( rnotwhite.test( "\xa0" ) ) {857 trimleft = /^[\s\xa0]+/;858 trimright = /[\s\xa0]+$/;859}860// all jquery objects should point back to these861rootjquery = jquery(document);862// cleanup functions for the document ready method863if ( document.addeventlistener ) {864 domcontentloaded = function() {865 document.removeeventlistener( "domcontentloaded", domcontentloaded, false );866 jquery.ready();867 };868} else if ( document.attachevent ) {869 domcontentloaded = function() {870 // make sure body exists, at least, in case ie gets a little overzealous (ticket #5443).871 if ( document.readystate === "complete" ) {872 document.detachevent( "onreadystatechange", domcontentloaded );873 jquery.ready();874 }875 };876}877// the dom ready check for internet explorer878function doscrollcheck() {879 if ( jquery.isready ) {880 return;881 }882 try {883 // if ie is used, use the trick by diego perini884 // http://javascript.nwbox.com/iecontentloaded/885 document.documentelement.doscroll("left");886 } catch(e) {887 settimeout( doscrollcheck, 1 );888 return;889 }890 // and execute any waiting functions891 jquery.ready();892}893// expose jquery to the global object894return jquery;895})();896(function() {897 jquery.support = {};898 var div = document.createelement("div");899 div.style.display = "none";900 div.innerhtml = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";901 var all = div.getelementsbytagname("*"),902 a = div.getelementsbytagname("a")[0],903 select = document.createelement("select"),904 opt = select.appendchild( document.createelement("option") ),905 input = div.getelementsbytagname("input")[0];906 // can't get basic test support907 if ( !all || !all.length || !a ) {908 return;909 }910 jquery.support = {911 // ie strips leading whitespace when .innerhtml is used912 leadingwhitespace: div.firstchild.nodetype === 3,913 // make sure that tbody elements aren't automatically inserted914 // ie will insert them into empty tables915 tbody: !div.getelementsbytagname("tbody").length,916 // make sure that link elements get serialized correctly by innerhtml917 // this requires a wrapper element in ie918 htmlserialize: !!div.getelementsbytagname("link").length,919 // get the style information from getattribute920 // (ie uses .csstext insted)921 style: /red/.test( a.getattribute("style") ),922 // make sure that urls aren't manipulated923 // (ie normalizes it by default)924 hrefnormalized: a.getattribute("href") === "/a",925 // make sure that element opacity exists926 // (ie uses filter instead)927 // use a regex to work around a webkit issue. see #5145928 opacity: /^0.55$/.test( a.style.opacity ),929 // verify style float existence930 // (ie uses stylefloat instead of cssfloat)931 cssfloat: !!a.style.cssfloat,932 // make sure that if no value is specified for a checkbox933 // that it defaults to "on".934 // (webkit defaults to "" instead)935 checkon: input.value === "on",936 // make sure that a selected-by-default option has a working selected property.937 // (webkit defaults to false instead of true, ie too, if it's in an optgroup)938 optselected: opt.selected,939 // will be defined later940 deleteexpando: true,941 optdisabled: false,942 checkclone: false,943 nocloneevent: true,944 noclonechecked: true,945 boxmodel: null,946 inlineblockneedslayout: false,947 shrinkwrapblocks: false,948 reliablehiddenoffsets: true949 };950 input.checked = true;951 jquery.support.noclonechecked = input.clonenode( true ).checked;952 // make sure that the options inside disabled selects aren't marked as disabled953 // (webkit marks them as diabled)954 select.disabled = true;955 jquery.support.optdisabled = !opt.disabled;956 var _scripteval = null;957 jquery.support.scripteval = function() {958 if ( _scripteval === null ) {959 var root = document.documentelement,960 script = document.createelement("script"),961 id = "script" + jquery.now();962 try {963 script.appendchild( document.createtextnode( "window." + id + "=1;" ) );964 } catch(e) {}965 root.insertbefore( script, root.firstchild );966 // make sure that the execution of code works by injecting a script967 // tag with appendchild/createtextnode968 // (ie doesn't support this, fails, and uses .text instead)969 if ( window[ id ] ) {970 _scripteval = true;971 delete window[ id ];972 } else {973 _scripteval = false;974 }975 root.removechild( script );976 // release memory in ie977 root = script = id = null;978 }979 return _scripteval;980 };981 // test to see if it's possible to delete an expando from an element982 // fails in internet explorer983 try {984 delete div.test;985 } catch(e) {986 jquery.support.deleteexpando = false;987 }988 if ( !div.addeventlistener && div.attachevent && div.fireevent ) {989 div.attachevent("onclick", function click() {990 // cloning a node shouldn't copy over any991 // bound event handlers (ie does this)992 jquery.support.nocloneevent = false;993 div.detachevent("onclick", click);994 });995 div.clonenode(true).fireevent("onclick");996 }997 div = document.createelement("div");998 div.innerhtml = "<input type='radio' name='radiotest' checked='checked'/>";999 var fragment = document.createdocumentfragment();1000 fragment.appendchild( div.firstchild );1001 // webkit doesn't clone checked state correctly in fragments1002 jquery.support.checkclone = fragment.clonenode(true).clonenode(true).lastchild.checked;1003 // figure out if the w3c box model works as expected1004 // document.body must exist before we can do this1005 jquery(function() {1006 var div = document.createelement("div"),1007 body = document.getelementsbytagname("body")[0];1008 // frameset documents with no body should not run this code1009 if ( !body ) {1010 return;1011 }1012 div.style.width = div.style.paddingleft = "1px";1013 body.appendchild( div );1014 jquery.boxmodel = jquery.support.boxmodel = div.offsetwidth === 2;1015 if ( "zoom" in div.style ) {1016 // check if natively block-level elements act like inline-block1017 // elements when setting their display to 'inline' and giving1018 // them layout1019 // (ie < 8 does this)1020 div.style.display = "inline";1021 div.style.zoom = 1;1022 jquery.support.inlineblockneedslayout = div.offsetwidth === 2;1023 // check if elements with layout shrink-wrap their children1024 // (ie 6 does this)1025 div.style.display = "";1026 div.innerhtml = "<div style='width:4px;'></div>";1027 jquery.support.shrinkwrapblocks = div.offsetwidth !== 2;1028 }1029 div.innerhtml = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";1030 var tds = div.getelementsbytagname("td");1031 // check if table cells still have offsetwidth/height when they are set1032 // to display:none and there are still other visible table cells in a1033 // table row; if so, offsetwidth/height are not reliable for use when1034 // determining if an element has been hidden directly using1035 // display:none (it is still safe to use offsets if a parent element is1036 // hidden; don safety goggles and see bug #4512 for more information).1037 // (only ie 8 fails this test)1038 jquery.support.reliablehiddenoffsets = tds[0].offsetheight === 0;1039 tds[0].style.display = "";1040 tds[1].style.display = "none";1041 // check if empty table cells still have offsetwidth/height1042 // (ie < 8 fail this test)1043 jquery.support.reliablehiddenoffsets = jquery.support.reliablehiddenoffsets && tds[0].offsetheight === 0;1044 div.innerhtml = "";1045 body.removechild( div ).style.display = "none";1046 div = tds = null;1047 });1048 // technique from juriy zaytsev1049 // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/1050 var eventsupported = function( eventname ) {1051 var el = document.createelement("div");1052 eventname = "on" + eventname;1053 // we only care about the case where non-standard event systems1054 // are used, namely in ie. short-circuiting here helps us to1055 // avoid an eval call (in setattribute) which can cause csp1056 // to go haywire. see: https://developer.mozilla.org/en/security/csp1057 if ( !el.attachevent ) {1058 return true;1059 }1060 var issupported = (eventname in el);1061 if ( !issupported ) {1062 el.setattribute(eventname, "return;");1063 issupported = typeof el[eventname] === "function";1064 }1065 el = null;1066 return issupported;1067 };1068 jquery.support.submitbubbles = eventsupported("submit");1069 jquery.support.changebubbles = eventsupported("change");1070 // release memory in ie1071 div = all = a = null;1072})();1073var rbrace = /^(?:\{.*\}|\[.*\])$/;1074jquery.extend({1075 cache: {},1076 // please use with caution1077 uuid: 0,1078 // unique for each copy of jquery on the page1079 // non-digits removed to match rinlinejquery1080 expando: "jquery" + ( jquery.fn.jquery + math.random() ).replace( /\d/g, "" ),1081 // the following elements throw uncatchable exceptions if you1082 // attempt to add expando properties to them.1083 nodata: {1084 "embed": true,1085 // ban all objects except for flash (which handle expandos)1086 "object": "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000",1087 "applet": true1088 },1089 hasdata: function( elem ) {1090 elem = elem.nodetype ? jquery.cache[ elem[jquery.expando] ] : elem[ jquery.expando ];1091 return !!elem && !isemptydataobject( elem );1092 },1093 data: function( elem, name, data, pvt /* internal use only */ ) {1094 if ( !jquery.acceptdata( elem ) ) {1095 return;1096 }1097 var internalkey = jquery.expando, getbyname = typeof name === "string", thiscache,1098 // we have to handle dom nodes and js objects differently because ie6-71099 // can't gc object references properly across the dom-js boundary1100 isnode = elem.nodetype,1101 // only dom nodes need the global jquery cache; js object data is1102 // attached directly to the object so gc can occur automatically1103 cache = isnode ? jquery.cache : elem,1104 // only defining an id for js objects if its cache already exists allows1105 // the code to shortcut on the same path as a dom node with no cache1106 id = isnode ? elem[ jquery.expando ] : elem[ jquery.expando ] && jquery.expando;1107 // avoid doing any more work than we need to when trying to get data on an1108 // object that has no data at all1109 if ( (!id || (pvt && id && !cache[ id ][ internalkey ])) && getbyname && data === undefined ) {1110 return;1111 }1112 if ( !id ) {1113 // only dom nodes need a new unique id for each element since their data1114 // ends up in the global cache1115 if ( isnode ) {1116 elem[ jquery.expando ] = id = ++jquery.uuid;1117 } else {1118 id = jquery.expando;1119 }1120 }1121 if ( !cache[ id ] ) {1122 cache[ id ] = {};1123 // todo: this is a hack for 1.5 only. avoids exposing jquery1124 // metadata on plain js objects when the object is serialized using1125 // json.stringify1126 if ( !isnode ) {1127 cache[ id ].tojson = jquery.noop;1128 }1129 }1130 // an object can be passed to jquery.data instead of a key/value pair; this gets1131 // shallow copied over onto the existing cache1132 if ( typeof name === "object" || typeof name === "function" ) {1133 if ( pvt ) {1134 cache[ id ][ internalkey ] = jquery.extend(cache[ id ][ internalkey ], name);1135 } else {1136 cache[ id ] = jquery.extend(cache[ id ], name);1137 }1138 }1139 thiscache = cache[ id ];1140 // internal jquery data is stored in a separate object inside the object's data1141 // cache in order to avoid key collisions between internal data and user-defined1142 // data1143 if ( pvt ) {1144 if ( !thiscache[ internalkey ] ) {1145 thiscache[ internalkey ] = {};1146 }1147 thiscache = thiscache[ internalkey ];1148 }1149 if ( data !== undefined ) {1150 thiscache[ name ] = data;1151 }1152 // todo: this is a hack for 1.5 only. it will be removed in 1.6. users should1153 // not attempt to inspect the internal events object using jquery.data, as this1154 // internal data object is undocumented and subject to change.1155 if ( name === "events" && !thiscache[name] ) {1156 return thiscache[ internalkey ] && thiscache[ internalkey ].events;1157 }1158 return getbyname ? thiscache[ name ] : thiscache;1159 },1160 removedata: function( elem, name, pvt /* internal use only */ ) {1161 if ( !jquery.acceptdata( elem ) ) {1162 return;1163 }1164 var internalkey = jquery.expando, isnode = elem.nodetype,1165 // see jquery.data for more information1166 cache = isnode ? jquery.cache : elem,1167 // see jquery.data for more information1168 id = isnode ? elem[ jquery.expando ] : jquery.expando;1169 // if there is already no cache entry for this object, there is no1170 // purpose in continuing1171 if ( !cache[ id ] ) {1172 return;1173 }1174 if ( name ) {1175 var thiscache = pvt ? cache[ id ][ internalkey ] : cache[ id ];1176 if ( thiscache ) {1177 delete thiscache[ name ];1178 // if there is no data left in the cache, we want to continue1179 // and let the cache object itself get destroyed1180 if ( !isemptydataobject(thiscache) ) {1181 return;1182 }1183 }1184 }1185 // see jquery.data for more information1186 if ( pvt ) {1187 delete cache[ id ][ internalkey ];1188 // don't destroy the parent cache unless the internal data object1189 // had been the only thing left in it1190 if ( !isemptydataobject(cache[ id ]) ) {1191 return;1192 }1193 }1194 var internalcache = cache[ id ][ internalkey ];1195 // browsers that fail expando deletion also refuse to delete expandos on1196 // the window, but it will allow it on all other js objects; other browsers1197 // don't care1198 if ( jquery.support.deleteexpando || cache != window ) {1199 delete cache[ id ];1200 } else {1201 cache[ id ] = null;1202 }1203 // we destroyed the entire user cache at once because it's faster than1204 // iterating through each key, but we need to continue to persist internal1205 // data if it existed1206 if ( internalcache ) {1207 cache[ id ] = {};1208 // todo: this is a hack for 1.5 only. avoids exposing jquery1209 // metadata on plain js objects when the object is serialized using1210 // json.stringify1211 if ( !isnode ) {1212 cache[ id ].tojson = jquery.noop;1213 }1214 cache[ id ][ internalkey ] = internalcache;1215 // otherwise, we need to eliminate the expando on the node to avoid1216 // false lookups in the cache for entries that no longer exist1217 } else if ( isnode ) {1218 // ie does not allow us to delete expando properties from nodes,1219 // nor does it have a removeattribute function on document nodes;1220 // we must handle all of these cases1221 if ( jquery.support.deleteexpando ) {1222 delete elem[ jquery.expando ];1223 } else if ( elem.removeattribute ) {1224 elem.removeattribute( jquery.expando );1225 } else {1226 elem[ jquery.expando ] = null;1227 }1228 }1229 },1230 // for internal use only.1231 _data: function( elem, name, data ) {1232 return jquery.data( elem, name, data, true );1233 },1234 // a method for determining if a dom node can handle the data expando1235 acceptdata: function( elem ) {1236 if ( elem.nodename ) {1237 var match = jquery.nodata[ elem.nodename.tolowercase() ];1238 if ( match ) {1239 return !(match === true || elem.getattribute("classid") !== match);1240 }1241 }1242 return true;1243 }1244});1245jquery.fn.extend({1246 data: function( key, value ) {1247 var data = null;1248 if ( typeof key === "undefined" ) {1249 if ( this.length ) {1250 data = jquery.data( this[0] );1251 if ( this[0].nodetype === 1 ) {1252 var attr = this[0].attributes, name;1253 for ( var i = 0, l = attr.length; i < l; i++ ) {1254 name = attr[i].name;1255 if ( name.indexof( "data-" ) === 0 ) {1256 name = name.substr( 5 );1257 dataattr( this[0], name, data[ name ] );1258 }1259 }1260 }1261 }1262 return data;1263 } else if ( typeof key === "object" ) {1264 return this.each(function() {1265 jquery.data( this, key );1266 });1267 }1268 var parts = key.split(".");1269 parts[1] = parts[1] ? "." + parts[1] : "";1270 if ( value === undefined ) {1271 data = this.triggerhandler("getdata" + parts[1] + "!", [parts[0]]);1272 // try to fetch any internally stored data first1273 if ( data === undefined && this.length ) {1274 data = jquery.data( this[0], key );1275 data = dataattr( this[0], key, data );1276 }1277 return data === undefined && parts[1] ?1278 this.data( parts[0] ) :1279 data;1280 } else {1281 return this.each(function() {1282 var $this = jquery( this ),1283 args = [ parts[0], value ];1284 $this.triggerhandler( "setdata" + parts[1] + "!", args );1285 jquery.data( this, key, value );1286 $this.triggerhandler( "changedata" + parts[1] + "!", args );1287 });1288 }1289 },1290 removedata: function( key ) {1291 return this.each(function() {1292 jquery.removedata( this, key );1293 });1294 }1295});1296function dataattr( elem, key, data ) {1297 // if nothing was found internally, try to fetch any1298 // data from the html5 data-* attribute1299 if ( data === undefined && elem.nodetype === 1 ) {1300 data = elem.getattribute( "data-" + key );1301 if ( typeof data === "string" ) {1302 try {1303 data = data === "true" ? true :1304 data === "false" ? false :1305 data === "null" ? null :1306 !jquery.isnan( data ) ? parsefloat( data ) :1307 rbrace.test( data ) ? jquery.parsejson( data ) :1308 data;1309 } catch( e ) {}1310 // make sure we set the data so it isn't changed later1311 jquery.data( elem, key, data );1312 } else {1313 data = undefined;1314 }1315 }1316 return data;1317}1318// todo: this is a hack for 1.5 only to allow objects with a single tojson1319// property to be considered empty objects; this property always exists in1320// order to make sure json.stringify does not expose internal metadata1321function isemptydataobject( obj ) {1322 for ( var name in obj ) {1323 if ( name !== "tojson" ) {1324 return false;1325 }1326 }1327 return true;1328}1329jquery.extend({1330 queue: function( elem, type, data ) {1331 if ( !elem ) {1332 return;1333 }1334 type = (type || "fx") + "queue";1335 var q = jquery._data( elem, type );1336 // speed up dequeue by getting out quickly if this is just a lookup1337 if ( !data ) {1338 return q || [];1339 }1340 if ( !q || jquery.isarray(data) ) {1341 q = jquery._data( elem, type, jquery.makearray(data) );1342 } else {1343 q.push( data );1344 }1345 return q;1346 },1347 dequeue: function( elem, type ) {1348 type = type || "fx";1349 var queue = jquery.queue( elem, type ),1350 fn = queue.shift();1351 // if the fx queue is dequeued, always remove the progress sentinel1352 if ( fn === "inprogress" ) {1353 fn = queue.shift();1354 }1355 if ( fn ) {1356 // add a progress sentinel to prevent the fx queue from being1357 // automatically dequeued1358 if ( type === "fx" ) {1359 queue.unshift("inprogress");1360 }1361 fn.call(elem, function() {1362 jquery.dequeue(elem, type);1363 });1364 }1365 if ( !queue.length ) {1366 jquery.removedata( elem, type + "queue", true );1367 }1368 }1369});1370jquery.fn.extend({1371 queue: function( type, data ) {1372 if ( typeof type !== "string" ) {1373 data = type;1374 type = "fx";1375 }1376 if ( data === undefined ) {1377 return jquery.queue( this[0], type );1378 }1379 return this.each(function( i ) {1380 var queue = jquery.queue( this, type, data );1381 if ( type === "fx" && queue[0] !== "inprogress" ) {1382 jquery.dequeue( this, type );1383 }1384 });1385 },1386 dequeue: function( type ) {1387 return this.each(function() {1388 jquery.dequeue( this, type );1389 });1390 },1391 // based off of the plugin by clint helfers, with permission.1392 // http://blindsignals.com/index.php/2009/07/jquery-delay/1393 delay: function( time, type ) {1394 time = jquery.fx ? jquery.fx.speeds[time] || time : time;1395 type = type || "fx";1396 return this.queue( type, function() {1397 var elem = this;1398 settimeout(function() {1399 jquery.dequeue( elem, type );1400 }, time );1401 });1402 },1403 clearqueue: function( type ) {1404 return this.queue( type || "fx", [] );1405 }1406});1407var rclass = /[\n\t\r]/g,1408 rspaces = /\s+/,1409 rreturn = /\r/g,1410 rspecialurl = /^(?:href|src|style)$/,1411 rtype = /^(?:button|input)$/i,1412 rfocusable = /^(?:button|input|object|select|textarea)$/i,1413 rclickable = /^a(?:rea)?$/i,1414 rradiocheck = /^(?:radio|checkbox)$/i;1415jquery.props = {1416 "for": "htmlfor",1417 "class": "classname",1418 readonly: "readonly",1419 maxlength: "maxlength",1420 cellspacing: "cellspacing",1421 rowspan: "rowspan",1422 colspan: "colspan",1423 tabindex: "tabindex",1424 usemap: "usemap",1425 frameborder: "frameborder"1426};1427jquery.fn.extend({1428 attr: function( name, value ) {1429 return jquery.access( this, name, value, true, jquery.attr );1430 },1431 removeattr: function( name, fn ) {1432 return this.each(function(){1433 jquery.attr( this, name, "" );1434 if ( this.nodetype === 1 ) {1435 this.removeattribute( name );1436 }1437 });1438 },1439 addclass: function( value ) {1440 if ( jquery.isfunction(value) ) {1441 return this.each(function(i) {1442 var self = jquery(this);1443 self.addclass( value.call(this, i, self.attr("class")) );1444 });1445 }1446 if ( value && typeof value === "string" ) {1447 var classnames = (value || "").split( rspaces );1448 for ( var i = 0, l = this.length; i < l; i++ ) {1449 var elem = this[i];1450 if ( elem.nodetype === 1 ) {1451 if ( !elem.classname ) {1452 elem.classname = value;1453 } else {1454 var classname = " " + elem.classname + " ",1455 setclass = elem.classname;1456 for ( var c = 0, cl = classnames.length; c < cl; c++ ) {1457 if ( classname.indexof( " " + classnames[c] + " " ) < 0 ) {1458 setclass += " " + classnames[c];1459 }1460 }1461 elem.classname = jquery.trim( setclass );1462 }1463 }1464 }1465 }1466 return this;1467 },1468 removeclass: function( value ) {1469 if ( jquery.isfunction(value) ) {1470 return this.each(function(i) {1471 var self = jquery(this);1472 self.removeclass( value.call(this, i, self.attr("class")) );1473 });1474 }1475 if ( (value && typeof value === "string") || value === undefined ) {1476 var classnames = (value || "").split( rspaces );1477 for ( var i = 0, l = this.length; i < l; i++ ) {1478 var elem = this[i];1479 if ( elem.nodetype === 1 && elem.classname ) {1480 if ( value ) {1481 var classname = (" " + elem.classname + " ").replace(rclass, " ");1482 for ( var c = 0, cl = classnames.length; c < cl; c++ ) {1483 classname = classname.replace(" " + classnames[c] + " ", " ");1484 }1485 elem.classname = jquery.trim( classname );1486 } else {1487 elem.classname = "";1488 }1489 }1490 }1491 }1492 return this;1493 },1494 toggleclass: function( value, stateval ) {1495 var type = typeof value,1496 isbool = typeof stateval === "boolean";1497 if ( jquery.isfunction( value ) ) {1498 return this.each(function(i) {1499 var self = jquery(this);1500 self.toggleclass( value.call(this, i, self.attr("class"), stateval), stateval );1501 });1502 }1503 return this.each(function() {1504 if ( type === "string" ) {1505 // toggle individual class names1506 var classname,1507 i = 0,1508 self = jquery( this ),1509 state = stateval,1510 classnames = value.split( rspaces );1511 while ( (classname = classnames[ i++ ]) ) {1512 // check each classname given, space seperated list1513 state = isbool ? state : !self.hasclass( classname );1514 self[ state ? "addclass" : "removeclass" ]( classname );1515 }1516 } else if ( type === "undefined" || type === "boolean" ) {1517 if ( this.classname ) {1518 // store classname if set1519 jquery._data( this, "__classname__", this.classname );1520 }1521 // toggle whole classname1522 this.classname = this.classname || value === false ? "" : jquery._data( this, "__classname__" ) || "";1523 }1524 });1525 },1526 hasclass: function( selector ) {1527 var classname = " " + selector + " ";1528 for ( var i = 0, l = this.length; i < l; i++ ) {1529 if ( (" " + this[i].classname + " ").replace(rclass, " ").indexof( classname ) > -1 ) {1530 return true;1531 }1532 }1533 return false;1534 },1535 val: function( value ) {1536 if ( !arguments.length ) {1537 var elem = this[0];1538 if ( elem ) {1539 if ( jquery.nodename( elem, "option" ) ) {1540 // attributes.value is undefined in blackberry 4.7 but1541 // uses .value. see #69321542 var val = elem.attributes.value;1543 return !val || val.specified ? elem.value : elem.text;1544 }1545 // we need to handle select boxes special1546 if ( jquery.nodename( elem, "select" ) ) {1547 var index = elem.selectedindex,1548 values = [],1549 options = elem.options,1550 one = elem.type === "select-one";1551 // nothing was selected1552 if ( index < 0 ) {1553 return null;1554 }1555 // loop through all the selected options1556 for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {1557 var option = options[ i ];1558 // don't return options that are disabled or in a disabled optgroup1559 if ( option.selected && (jquery.support.optdisabled ? !option.disabled : option.getattribute("disabled") === null) &&1560 (!option.parentnode.disabled || !jquery.nodename( option.parentnode, "optgroup" )) ) {1561 // get the specific value for the option1562 value = jquery(option).val();1563 // we don't need an array for one selects1564 if ( one ) {1565 return value;1566 }1567 // multi-selects return an array1568 values.push( value );1569 }1570 }1571 // fixes bug #2551 -- select.val() broken in ie after form.reset()1572 if ( one && !values.length && options.length ) {1573 return jquery( options[ index ] ).val();1574 }1575 return values;1576 }1577 // handle the case where in webkit "" is returned instead of "on" if a value isn't specified1578 if ( rradiocheck.test( elem.type ) && !jquery.support.checkon ) {1579 return elem.getattribute("value") === null ? "on" : elem.value;1580 }1581 // everything else, we just grab the value1582 return (elem.value || "").replace(rreturn, "");1583 }1584 return undefined;1585 }1586 var isfunction = jquery.isfunction(value);1587 return this.each(function(i) {1588 var self = jquery(this), val = value;1589 if ( this.nodetype !== 1 ) {1590 return;1591 }1592 if ( isfunction ) {1593 val = value.call(this, i, self.val());1594 }1595 // treat null/undefined as ""; convert numbers to string1596 if ( val == null ) {1597 val = "";1598 } else if ( typeof val === "number" ) {1599 val += "";1600 } else if ( jquery.isarray(val) ) {1601 val = jquery.map(val, function (value) {1602 return value == null ? "" : value + "";1603 });1604 }1605 if ( jquery.isarray(val) && rradiocheck.test( this.type ) ) {1606 this.checked = jquery.inarray( self.val(), val ) >= 0;1607 } else if ( jquery.nodename( this, "select" ) ) {1608 var values = jquery.makearray(val);1609 jquery( "option", this ).each(function() {1610 this.selected = jquery.inarray( jquery(this).val(), values ) >= 0;1611 });1612 if ( !values.length ) {1613 this.selectedindex = -1;1614 }1615 } else {1616 this.value = val;1617 }1618 });1619 }1620});1621jquery.extend({1622 attrfn: {1623 val: true,1624 css: true,1625 html: true,1626 text: true,1627 data: true,1628 width: true,1629 height: true,1630 offset: true1631 },1632 attr: function( elem, name, value, pass ) {1633 // don't get/set attributes on text, comment and attribute nodes1634 if ( !elem || elem.nodetype === 3 || elem.nodetype === 8 || elem.nodetype === 2 ) {1635 return undefined;1636 }1637 if ( pass && name in jquery.attrfn ) {1638 return jquery(elem)[name](value);1639 }1640 var notxml = elem.nodetype !== 1 || !jquery.isxmldoc( elem ),1641 // whether we are setting (or getting)1642 set = value !== undefined;1643 // try to normalize/fix the name1644 name = notxml && jquery.props[ name ] || name;1645 // only do all the following if this is a node (faster for style)1646 if ( elem.nodetype === 1 ) {1647 // these attributes require special treatment1648 var special = rspecialurl.test( name );1649 // safari mis-reports the default selected property of an option1650 // accessing the parent's selectedindex property fixes it1651 if ( name === "selected" && !jquery.support.optselected ) {1652 var parent = elem.parentnode;1653 if ( parent ) {1654 parent.selectedindex;1655 // make sure that it also works with optgroups, see #57011656 if ( parent.parentnode ) {1657 parent.parentnode.selectedindex;1658 }1659 }1660 }1661 // if applicable, access the attribute via the dom 0 way1662 // 'in' checks fail in blackberry 4.7 #69311663 if ( (name in elem || elem[ name ] !== undefined) && notxml && !special ) {1664 if ( set ) {1665 // we can't allow the type property to be changed (since it causes problems in ie)1666 if ( name === "type" && rtype.test( elem.nodename ) && elem.parentnode ) {1667 jquery.error( "type property can't be changed" );1668 }1669 if ( value === null ) {1670 if ( elem.nodetype === 1 ) {1671 elem.removeattribute( name );1672 }1673 } else {1674 elem[ name ] = value;1675 }1676 }1677 // browsers index elements by id/name on forms, give priority to attributes.1678 if ( jquery.nodename( elem, "form" ) && elem.getattributenode(name) ) {1679 return elem.getattributenode( name ).nodevalue;1680 }1681 // elem.tabindex doesn't always return the correct value when it hasn't been explicitly set1682 // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/1683 if ( name === "tabindex" ) {1684 var attributenode = elem.getattributenode( "tabindex" );1685 return attributenode && attributenode.specified ?1686 attributenode.value :1687 rfocusable.test( elem.nodename ) || rclickable.test( elem.nodename ) && elem.href ?1688 0 :1689 undefined;1690 }1691 return elem[ name ];1692 }1693 if ( !jquery.support.style && notxml && name === "style" ) {1694 if ( set ) {1695 elem.style.csstext = "" + value;1696 }1697 return elem.style.csstext;1698 }1699 if ( set ) {1700 // convert the value to a string (all browsers do this but ie) see #10701701 elem.setattribute( name, "" + value );1702 }1703 // ensure that missing attributes return undefined1704 // blackberry 4.7 returns "" from getattribute #69381705 if ( !elem.attributes[ name ] && (elem.hasattribute && !elem.hasattribute( name )) ) {1706 return undefined;1707 }1708 var attr = !jquery.support.hrefnormalized && notxml && special ?1709 // some attributes require a special call on ie1710 elem.getattribute( name, 2 ) :1711 elem.getattribute( name );1712 // non-existent attributes return null, we normalize to undefined1713 return attr === null ? undefined : attr;1714 }1715 // handle everything which isn't a dom element node1716 if ( set ) {1717 elem[ name ] = value;1718 }1719 return elem[ name ];1720 }1721});1722var rnamespaces = /\.(.*)$/,1723 rformelems = /^(?:textarea|input|select)$/i,1724 rperiod = /\./g,1725 rspace = / /g,1726 rescape = /[^\w\s.|`]/g,1727 fcleanup = function( nm ) {1728 return nm.replace(rescape, "\\$&");1729 };1730/*1731 * a number of helper functions used for managing events.1732 * many of the ideas behind this code originated from1733 * dean edwards' addevent library.1734 */1735jquery.event = {1736 // bind an event to an element1737 // original by dean edwards1738 add: function( elem, types, handler, data ) {1739 if ( elem.nodetype === 3 || elem.nodetype === 8 ) {1740 return;1741 }1742 // todo :: use a try/catch until it's safe to pull this out (likely 1.6)1743 // minor release fix for bug #80181744 try {1745 // for whatever reason, ie has trouble passing the window object1746 // around, causing it to be cloned in the process1747 if ( jquery.iswindow( elem ) && ( elem !== window && !elem.frameelement ) ) {1748 elem = window;1749 }1750 }1751 catch ( e ) {}1752 if ( handler === false ) {1753 handler = returnfalse;1754 } else if ( !handler ) {1755 // fixes bug #7229. fix recommended by jdalton1756 return;1757 }1758 var handleobjin, handleobj;1759 if ( handler.handler ) {1760 handleobjin = handler;1761 handler = handleobjin.handler;1762 }1763 // make sure that the function being executed has a unique id1764 if ( !handler.guid ) {1765 handler.guid = jquery.guid++;1766 }1767 // init the element's event structure1768 var elemdata = jquery._data( elem );1769 // if no elemdata is found then we must be trying to bind to one of the1770 // banned nodata elements1771 if ( !elemdata ) {1772 return;1773 }1774 var events = elemdata.events,1775 eventhandle = elemdata.handle;1776 if ( !events ) {1777 elemdata.events = events = {};1778 }1779 if ( !eventhandle ) {1780 elemdata.handle = eventhandle = function() {1781 // handle the second event of a trigger and when1782 // an event is called after a page has unloaded1783 return typeof jquery !== "undefined" && !jquery.event.triggered ?1784 jquery.event.handle.apply( eventhandle.elem, arguments ) :1785 undefined;1786 };1787 }1788 // add elem as a property of the handle function1789 // this is to prevent a memory leak with non-native events in ie.1790 eventhandle.elem = elem;1791 // handle multiple events separated by a space1792 // jquery(...).bind("mouseover mouseout", fn);1793 types = types.split(" ");1794 var type, i = 0, namespaces;1795 while ( (type = types[ i++ ]) ) {1796 handleobj = handleobjin ?1797 jquery.extend({}, handleobjin) :1798 { handler: handler, data: data };1799 // namespaced event handlers1800 if ( type.indexof(".") > -1 ) {1801 namespaces = type.split(".");1802 type = namespaces.shift();1803 handleobj.namespace = namespaces.slice(0).sort().join(".");1804 } else {1805 namespaces = [];1806 handleobj.namespace = "";1807 }1808 handleobj.type = type;1809 if ( !handleobj.guid ) {1810 handleobj.guid = handler.guid;1811 }1812 // get the current list of functions bound to this event1813 var handlers = events[ type ],1814 special = jquery.event.special[ type ] || {};1815 // init the event handler queue1816 if ( !handlers ) {1817 handlers = events[ type ] = [];1818 // check for a special event handler1819 // only use addeventlistener/attachevent if the special1820 // events handler returns false1821 if ( !special.setup || special.setup.call( elem, data, namespaces, eventhandle ) === false ) {1822 // bind the global event handler to the element1823 if ( elem.addeventlistener ) {1824 elem.addeventlistener( type, eventhandle, false );1825 } else if ( elem.attachevent ) {1826 elem.attachevent( "on" + type, eventhandle );1827 }1828 }1829 }1830 if ( special.add ) {1831 special.add.call( elem, handleobj );1832 if ( !handleobj.handler.guid ) {1833 handleobj.handler.guid = handler.guid;1834 }1835 }1836 // add the function to the element's handler list1837 handlers.push( handleobj );1838 // keep track of which events have been used, for global triggering1839 jquery.event.global[ type ] = true;1840 }1841 // nullify elem to prevent memory leaks in ie1842 elem = null;1843 },1844 global: {},1845 // detach an event or set of events from an element1846 remove: function( elem, types, handler, pos ) {1847 // don't do events on text and comment nodes1848 if ( elem.nodetype === 3 || elem.nodetype === 8 ) {1849 return;1850 }1851 if ( handler === false ) {1852 handler = returnfalse;1853 }1854 var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventtype, handleobj, origtype,1855 elemdata = jquery.hasdata( elem ) && jquery._data( elem ),1856 events = elemdata && elemdata.events;1857 if ( !elemdata || !events ) {1858 return;1859 }1860 // types is actually an event object here1861 if ( types && types.type ) {1862 handler = types.handler;1863 types = types.type;1864 }1865 // unbind all events for the element1866 if ( !types || typeof types === "string" && types.charat(0) === "." ) {1867 types = types || "";1868 for ( type in events ) {1869 jquery.event.remove( elem, type + types );1870 }1871 return;1872 }1873 // handle multiple events separated by a space1874 // jquery(...).unbind("mouseover mouseout", fn);1875 types = types.split(" ");1876 while ( (type = types[ i++ ]) ) {1877 origtype = type;1878 handleobj = null;1879 all = type.indexof(".") < 0;1880 namespaces = [];1881 if ( !all ) {1882 // namespaced event handlers1883 namespaces = type.split(".");1884 type = namespaces.shift();1885 namespace = new regexp("(^|\\.)" +1886 jquery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");1887 }1888 eventtype = events[ type ];1889 if ( !eventtype ) {1890 continue;1891 }1892 if ( !handler ) {1893 for ( j = 0; j < eventtype.length; j++ ) {1894 handleobj = eventtype[ j ];1895 if ( all || namespace.test( handleobj.namespace ) ) {1896 jquery.event.remove( elem, origtype, handleobj.handler, j );1897 eventtype.splice( j--, 1 );1898 }1899 }1900 continue;1901 }1902 special = jquery.event.special[ type ] || {};1903 for ( j = pos || 0; j < eventtype.length; j++ ) {1904 handleobj = eventtype[ j ];1905 if ( handler.guid === handleobj.guid ) {1906 // remove the given handler for the given type1907 if ( all || namespace.test( handleobj.namespace ) ) {1908 if ( pos == null ) {1909 eventtype.splice( j--, 1 );1910 }1911 if ( special.remove ) {1912 special.remove.call( elem, handleobj );1913 }1914 }1915 if ( pos != null ) {1916 break;1917 }1918 }1919 }1920 // remove generic event handler if no more handlers exist1921 if ( eventtype.length === 0 || pos != null && eventtype.length === 1 ) {1922 if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {1923 jquery.removeevent( elem, type, elemdata.handle );1924 }1925 ret = null;1926 delete events[ type ];1927 }1928 }1929 // remove the expando if it's no longer used1930 if ( jquery.isemptyobject( events ) ) {1931 var handle = elemdata.handle;1932 if ( handle ) {1933 handle.elem = null;1934 }1935 delete elemdata.events;1936 delete elemdata.handle;1937 if ( jquery.isemptyobject( elemdata ) ) {1938 jquery.removedata( elem, undefined, true );1939 }1940 }1941 },1942 // bubbling is internal1943 trigger: function( event, data, elem /*, bubbling */ ) {1944 // event object or event type1945 var type = event.type || event,1946 bubbling = arguments[3];1947 if ( !bubbling ) {1948 event = typeof event === "object" ?1949 // jquery.event object1950 event[ jquery.expando ] ? event :1951 // object literal1952 jquery.extend( jquery.event(type), event ) :1953 // just the event type (string)1954 jquery.event(type);1955 if ( type.indexof("!") >= 0 ) {1956 event.type = type = type.slice(0, -1);1957 event.exclusive = true;1958 }1959 // handle a global trigger1960 if ( !elem ) {1961 // don't bubble custom events when global (to avoid too much overhead)1962 event.stoppropagation();1963 // only trigger if we've ever bound an event for it1964 if ( jquery.event.global[ type ] ) {1965 // xxx this code smells terrible. event.js should not be directly1966 // inspecting the data cache1967 jquery.each( jquery.cache, function() {1968 // internalkey variable is just used to make it easier to find1969 // and potentially change this stuff later; currently it just1970 // points to jquery.expando1971 var internalkey = jquery.expando,1972 internalcache = this[ internalkey ];1973 if ( internalcache && internalcache.events && internalcache.events[ type ] ) {1974 jquery.event.trigger( event, data, internalcache.handle.elem );1975 }1976 });1977 }1978 }1979 // handle triggering a single element1980 // don't do events on text and comment nodes1981 if ( !elem || elem.nodetype === 3 || elem.nodetype === 8 ) {1982 return undefined;1983 }1984 // clean up in case it is reused1985 event.result = undefined;1986 event.target = elem;1987 // clone the incoming data, if any1988 data = jquery.makearray( data );1989 data.unshift( event );1990 }1991 event.currenttarget = elem;1992 // trigger the event, it is assumed that "handle" is a function1993 var handle = jquery._data( elem, "handle" );1994 if ( handle ) {1995 handle.apply( elem, data );1996 }1997 var parent = elem.parentnode || elem.ownerdocument;1998 // trigger an inline bound script1999 try {2000 if ( !(elem && elem.nodename && jquery.nodata[elem.nodename.tolowercase()]) ) {2001 if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) {2002 event.result = false;2003 event.preventdefault();2004 }2005 }2006 // prevent ie from throwing an error for some elements with some event types, see #35332007 } catch (inlineerror) {}2008 if ( !event.ispropagationstopped() && parent ) {2009 jquery.event.trigger( event, data, parent, true );2010 } else if ( !event.isdefaultprevented() ) {2011 var old,2012 target = event.target,2013 targettype = type.replace( rnamespaces, "" ),2014 isclick = jquery.nodename( target, "a" ) && targettype === "click",2015 special = jquery.event.special[ targettype ] || {};2016 if ( (!special._default || special._default.call( elem, event ) === false) &&2017 !isclick && !(target && target.nodename && jquery.nodata[target.nodename.tolowercase()]) ) {2018 try {2019 if ( target[ targettype ] ) {2020 // make sure that we don't accidentally re-trigger the onfoo events2021 old = target[ "on" + targettype ];2022 if ( old ) {2023 target[ "on" + targettype ] = null;2024 }2025 jquery.event.triggered = true;2026 target[ targettype ]();2027 }2028 // prevent ie from throwing an error for some elements with some event types, see #35332029 } catch (triggererror) {}2030 if ( old ) {2031 target[ "on" + targettype ] = old;2032 }2033 jquery.event.triggered = false;2034 }2035 }2036 },2037 handle: function( event ) {2038 var all, handlers, namespaces, namespace_re, events,2039 namespace_sort = [],2040 args = jquery.makearray( arguments );2041 event = args[0] = jquery.event.fix( event || window.event );2042 event.currenttarget = this;2043 // namespaced event handlers2044 all = event.type.indexof(".") < 0 && !event.exclusive;2045 if ( !all ) {2046 namespaces = event.type.split(".");2047 event.type = namespaces.shift();2048 namespace_sort = namespaces.slice(0).sort();2049 namespace_re = new regexp("(^|\\.)" + namespace_sort.join("\\.(?:.*\\.)?") + "(\\.|$)");2050 }2051 event.namespace = event.namespace || namespace_sort.join(".");2052 events = jquery._data(this, "events");2053 handlers = (events || {})[ event.type ];2054 if ( events && handlers ) {2055 // clone the handlers to prevent manipulation2056 handlers = handlers.slice(0);2057 for ( var j = 0, l = handlers.length; j < l; j++ ) {2058 var handleobj = handlers[ j ];2059 // filter the functions by class2060 if ( all || namespace_re.test( handleobj.namespace ) ) {2061 // pass in a reference to the handler function itself2062 // so that we can later remove it2063 event.handler = handleobj.handler;2064 event.data = handleobj.data;2065 event.handleobj = handleobj;2066 var ret = handleobj.handler.apply( this, args );2067 if ( ret !== undefined ) {2068 event.result = ret;2069 if ( ret === false ) {2070 event.preventdefault();2071 event.stoppropagation();2072 }2073 }2074 if ( event.isimmediatepropagationstopped() ) {2075 break;2076 }2077 }2078 }2079 }2080 return event.result;2081 },2082 props: "altkey attrchange attrname bubbles button cancelable charcode clientx clienty ctrlkey currenttarget data detail eventphase fromelement handler keycode layerx layery metakey newvalue offsetx offsety pagex pagey prevvalue relatednode relatedtarget screenx screeny shiftkey srcelement target toelement view wheeldelta which".split(" "),2083 fix: function( event ) {2084 if ( event[ jquery.expando ] ) {2085 return event;2086 }2087 // store a copy of the original event object2088 // and "clone" to set read-only properties2089 var originalevent = event;2090 event = jquery.event( originalevent );2091 for ( var i = this.props.length, prop; i; ) {2092 prop = this.props[ --i ];2093 event[ prop ] = originalevent[ prop ];2094 }2095 // fix target property, if necessary2096 if ( !event.target ) {2097 // fixes #1925 where srcelement might not be defined either2098 event.target = event.srcelement || document;2099 }2100 // check if target is a textnode (safari)2101 if ( event.target.nodetype === 3 ) {2102 event.target = event.target.parentnode;2103 }2104 // add relatedtarget, if necessary2105 if ( !event.relatedtarget && event.fromelement ) {2106 event.relatedtarget = event.fromelement === event.target ? event.toelement : event.fromelement;2107 }2108 // calculate pagex/y if missing and clientx/y available2109 if ( event.pagex == null && event.clientx != null ) {2110 var doc = document.documentelement,2111 body = document.body;2112 event.pagex = event.clientx + (doc && doc.scrollleft || body && body.scrollleft || 0) - (doc && doc.clientleft || body && body.clientleft || 0);2113 event.pagey = event.clienty + (doc && doc.scrolltop || body && body.scrolltop || 0) - (doc && doc.clienttop || body && body.clienttop || 0);2114 }2115 // add which for key events2116 if ( event.which == null && (event.charcode != null || event.keycode != null) ) {2117 event.which = event.charcode != null ? event.charcode : event.keycode;2118 }2119 // add metakey to non-mac browsers (use ctrl for pc's and meta for macs)2120 if ( !event.metakey && event.ctrlkey ) {2121 event.metakey = event.ctrlkey;2122 }2123 // add which for click: 1 === left; 2 === middle; 3 === right2124 // note: button is not normalized, so don't use it2125 if ( !event.which && event.button !== undefined ) {2126 event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));2127 }2128 return event;2129 },2130 // deprecated, use jquery.guid instead2131 guid: 1e8,2132 // deprecated, use jquery.proxy instead2133 proxy: jquery.proxy,2134 special: {2135 ready: {2136 // make sure the ready event is setup2137 setup: jquery.bindready,2138 teardown: jquery.noop2139 },2140 live: {2141 add: function( handleobj ) {2142 jquery.event.add( this,2143 liveconvert( handleobj.origtype, handleobj.selector ),2144 jquery.extend({}, handleobj, {handler: livehandler, guid: handleobj.handler.guid}) );2145 },2146 remove: function( handleobj ) {2147 jquery.event.remove( this, liveconvert( handleobj.origtype, handleobj.selector ), handleobj );2148 }2149 },2150 beforeunload: {2151 setup: function( data, namespaces, eventhandle ) {2152 // we only want to do this special case on windows2153 if ( jquery.iswindow( this ) ) {2154 this.onbeforeunload = eventhandle;2155 }2156 },2157 teardown: function( namespaces, eventhandle ) {2158 if ( this.onbeforeunload === eventhandle ) {2159 this.onbeforeunload = null;2160 }2161 }2162 }2163 }2164};2165jquery.removeevent = document.removeeventlistener ?2166 function( elem, type, handle ) {2167 if ( elem.removeeventlistener ) {2168 elem.removeeventlistener( type, handle, false );2169 }2170 } :2171 function( elem, type, handle ) {2172 if ( elem.detachevent ) {2173 elem.detachevent( "on" + type, handle );2174 }2175 };2176jquery.event = function( src ) {2177 // allow instantiation without the 'new' keyword2178 if ( !this.preventdefault ) {2179 return new jquery.event( src );2180 }2181 // event object2182 if ( src && src.type ) {2183 this.originalevent = src;2184 this.type = src.type;2185 // events bubbling up the document may have been marked as prevented2186 // by a handler lower down the tree; reflect the correct value.2187 this.isdefaultprevented = (src.defaultprevented || src.returnvalue === false ||2188 src.getpreventdefault && src.getpreventdefault()) ? returntrue : returnfalse;2189 // event type2190 } else {2191 this.type = src;2192 }2193 // timestamp is buggy for some events on firefox(#3843)2194 // so we won't rely on the native value2195 this.timestamp = jquery.now();2196 // mark it as fixed2197 this[ jquery.expando ] = true;2198};2199function returnfalse() {2200 return false;2201}2202function returntrue() {2203 return true;2204}2205// jquery.event is based on dom3 events as specified by the ecmascript language binding2206// http://www.w3.org/tr/2003/wd-dom-level-3-events-20030331/ecma-script-binding.html2207jquery.event.prototype = {2208 preventdefault: function() {2209 this.isdefaultprevented = returntrue;2210 var e = this.originalevent;2211 if ( !e ) {2212 return;2213 }2214 // if preventdefault exists run it on the original event2215 if ( e.preventdefault ) {2216 e.preventdefault();2217 // otherwise set the returnvalue property of the original event to false (ie)2218 } else {2219 e.returnvalue = false;2220 }2221 },2222 stoppropagation: function() {2223 this.ispropagationstopped = returntrue;2224 var e = this.originalevent;2225 if ( !e ) {2226 return;2227 }2228 // if stoppropagation exists run it on the original event2229 if ( e.stoppropagation ) {2230 e.stoppropagation();2231 }2232 // otherwise set the cancelbubble property of the original event to true (ie)2233 e.cancelbubble = true;2234 },2235 stopimmediatepropagation: function() {2236 this.isimmediatepropagationstopped = returntrue;2237 this.stoppropagation();2238 },2239 isdefaultprevented: returnfalse,2240 ispropagationstopped: returnfalse,2241 isimmediatepropagationstopped: returnfalse2242};2243// checks if an event happened on an element within another element2244// used in jquery.event.special.mouseenter and mouseleave handlers2245var withinelement = function( event ) {2246 // check if mouse(over|out) are still within the same parent element2247 var parent = event.relatedtarget;2248 // firefox sometimes assigns relatedtarget a xul element2249 // which we cannot access the parentnode property of2250 try {2251 // chrome does something similar, the parentnode property2252 // can be accessed but is null.2253 if ( parent !== document && !parent.parentnode ) {2254 return;2255 }2256 // traverse up the tree2257 while ( parent && parent !== this ) {2258 parent = parent.parentnode;2259 }2260 if ( parent !== this ) {2261 // set the correct event type2262 event.type = event.data;2263 // handle event if we actually just moused on to a non sub-element2264 jquery.event.handle.apply( this, arguments );2265 }2266 // assuming we've left the element since we most likely mousedover a xul element2267 } catch(e) { }2268},2269// in case of event delegation, we only need to rename the event.type,2270// livehandler will take care of the rest.2271delegate = function( event ) {2272 event.type = event.data;2273 jquery.event.handle.apply( this, arguments );2274};2275// create mouseenter and mouseleave events2276jquery.each({2277 mouseenter: "mouseover",2278 mouseleave: "mouseout"2279}, function( orig, fix ) {2280 jquery.event.special[ orig ] = {2281 setup: function( data ) {2282 jquery.event.add( this, fix, data && data.selector ? delegate : withinelement, orig );2283 },2284 teardown: function( data ) {2285 jquery.event.remove( this, fix, data && data.selector ? delegate : withinelement );2286 }2287 };2288});2289// submit delegation2290if ( !jquery.support.submitbubbles ) {2291 jquery.event.special.submit = {2292 setup: function( data, namespaces ) {2293 if ( this.nodename && this.nodename.tolowercase() !== "form" ) {2294 jquery.event.add(this, "click.specialsubmit", function( e ) {2295 var elem = e.target,2296 type = elem.type;2297 if ( (type === "submit" || type === "image") && jquery( elem ).closest("form").length ) {2298 trigger( "submit", this, arguments );2299 }2300 });2301 jquery.event.add(this, "keypress.specialsubmit", function( e ) {2302 var elem = e.target,2303 type = elem.type;2304 if ( (type === "text" || type === "password") && jquery( elem ).closest("form").length && e.keycode === 13 ) {2305 trigger( "submit", this, arguments );2306 }2307 });2308 } else {2309 return false;2310 }2311 },2312 teardown: function( namespaces ) {2313 jquery.event.remove( this, ".specialsubmit" );2314 }2315 };2316}2317// change delegation, happens here so we have bind.2318if ( !jquery.support.changebubbles ) {2319 var changefilters,2320 getval = function( elem ) {2321 var type = elem.type, val = elem.value;2322 if ( type === "radio" || type === "checkbox" ) {2323 val = elem.checked;2324 } else if ( type === "select-multiple" ) {2325 val = elem.selectedindex > -1 ?2326 jquery.map( elem.options, function( elem ) {2327 return elem.selected;2328 }).join("-") :2329 "";2330 } else if ( elem.nodename.tolowercase() === "select" ) {2331 val = elem.selectedindex;2332 }2333 return val;2334 },2335 testchange = function testchange( e ) {2336 var elem = e.target, data, val;2337 if ( !rformelems.test( elem.nodename ) || elem.readonly ) {2338 return;2339 }2340 data = jquery._data( elem, "_change_data" );2341 val = getval(elem);2342 // the current data will be also retrieved by beforeactivate2343 if ( e.type !== "focusout" || elem.type !== "radio" ) {2344 jquery._data( elem, "_change_data", val );2345 }2346 if ( data === undefined || val === data ) {2347 return;2348 }2349 if ( data != null || val ) {2350 e.type = "change";2351 e.livefired = undefined;2352 jquery.event.trigger( e, arguments[1], elem );2353 }2354 };2355 jquery.event.special.change = {2356 filters: {2357 focusout: testchange,2358 beforedeactivate: testchange,2359 click: function( e ) {2360 var elem = e.target, type = elem.type;2361 if ( type === "radio" || type === "checkbox" || elem.nodename.tolowercase() === "select" ) {2362 testchange.call( this, e );2363 }2364 },2365 // change has to be called before submit2366 // keydown will be called before keypress, which is used in submit-event delegation2367 keydown: function( e ) {2368 var elem = e.target, type = elem.type;2369 if ( (e.keycode === 13 && elem.nodename.tolowercase() !== "textarea") ||2370 (e.keycode === 32 && (type === "checkbox" || type === "radio")) ||2371 type === "select-multiple" ) {2372 testchange.call( this, e );2373 }2374 },2375 // beforeactivate happens also before the previous element is blurred2376 // with this event you can't trigger a change event, but you can store2377 // information2378 beforeactivate: function( e ) {2379 var elem = e.target;2380 jquery._data( elem, "_change_data", getval(elem) );2381 }2382 },2383 setup: function( data, namespaces ) {2384 if ( this.type === "file" ) {2385 return false;2386 }2387 for ( var type in changefilters ) {2388 jquery.event.add( this, type + ".specialchange", changefilters[type] );2389 }2390 return rformelems.test( this.nodename );2391 },2392 teardown: function( namespaces ) {2393 jquery.event.remove( this, ".specialchange" );2394 return rformelems.test( this.nodename );2395 }2396 };2397 changefilters = jquery.event.special.change.filters;2398 // handle when the input is .focus()'d2399 changefilters.focus = changefilters.beforeactivate;2400}2401function trigger( type, elem, args ) {2402 // piggyback on a donor event to simulate a different one.2403 // fake originalevent to avoid donor's stoppropagation, but if the2404 // simulated event prevents default then we do the same on the donor.2405 // don't pass args or remember livefired; they apply to the donor event.2406 var event = jquery.extend( {}, args[ 0 ] );2407 event.type = type;2408 event.originalevent = {};2409 event.livefired = undefined;2410 jquery.event.handle.call( elem, event );2411 if ( event.isdefaultprevented() ) {2412 args[ 0 ].preventdefault();2413 }2414}2415// create "bubbling" focus and blur events2416if ( document.addeventlistener ) {2417 jquery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {2418 jquery.event.special[ fix ] = {2419 setup: function() {2420 this.addeventlistener( orig, handler, true );2421 },2422 teardown: function() {2423 this.removeeventlistener( orig, handler, true );2424 }2425 };2426 function handler( e ) {2427 e = jquery.event.fix( e );2428 e.type = fix;2429 return jquery.event.handle.call( this, e );2430 }2431 });2432}2433jquery.each(["bind", "one"], function( i, name ) {2434 jquery.fn[ name ] = function( type, data, fn ) {2435 // handle object literals2436 if ( typeof type === "object" ) {2437 for ( var key in type ) {2438 this[ name ](key, data, type[key], fn);2439 }2440 return this;2441 }2442 if ( jquery.isfunction( data ) || data === false ) {2443 fn = data;2444 data = undefined;2445 }2446 var handler = name === "one" ? jquery.proxy( fn, function( event ) {2447 jquery( this ).unbind( event, handler );2448 return fn.apply( this, arguments );2449 }) : fn;2450 if ( type === "unload" && name !== "one" ) {2451 this.one( type, data, fn );2452 } else {2453 for ( var i = 0, l = this.length; i < l; i++ ) {2454 jquery.event.add( this[i], type, handler, data );2455 }2456 }2457 return this;2458 };2459});2460jquery.fn.extend({2461 unbind: function( type, fn ) {2462 // handle object literals2463 if ( typeof type === "object" && !type.preventdefault ) {2464 for ( var key in type ) {2465 this.unbind(key, type[key]);2466 }2467 } else {2468 for ( var i = 0, l = this.length; i < l; i++ ) {2469 jquery.event.remove( this[i], type, fn );2470 }2471 }2472 return this;2473 },2474 delegate: function( selector, types, data, fn ) {2475 return this.live( types, data, fn, selector );2476 },2477 undelegate: function( selector, types, fn ) {2478 if ( arguments.length === 0 ) {2479 return this.unbind( "live" );2480 } else {2481 return this.die( types, null, fn, selector );2482 }2483 },2484 trigger: function( type, data ) {2485 return this.each(function() {2486 jquery.event.trigger( type, data, this );2487 });2488 },2489 triggerhandler: function( type, data ) {2490 if ( this[0] ) {2491 var event = jquery.event( type );2492 event.preventdefault();2493 event.stoppropagation();2494 jquery.event.trigger( event, data, this[0] );2495 return event.result;2496 }2497 },2498 toggle: function( fn ) {2499 // save reference to arguments for access in closure2500 var args = arguments,2501 i = 1;2502 // link all the functions, so any of them can unbind this click handler2503 while ( i < args.length ) {2504 jquery.proxy( fn, args[ i++ ] );2505 }2506 return this.click( jquery.proxy( fn, function( event ) {2507 // figure out which function to execute2508 var lasttoggle = ( jquery._data( this, "lasttoggle" + fn.guid ) || 0 ) % i;2509 jquery._data( this, "lasttoggle" + fn.guid, lasttoggle + 1 );2510 // make sure that clicks stop2511 event.preventdefault();2512 // and execute the function2513 return args[ lasttoggle ].apply( this, arguments ) || false;2514 }));2515 },2516 hover: function( fnover, fnout ) {2517 return this.mouseenter( fnover ).mouseleave( fnout || fnover );2518 }2519});2520var livemap = {2521 focus: "focusin",2522 blur: "focusout",2523 mouseenter: "mouseover",2524 mouseleave: "mouseout"2525};2526jquery.each(["live", "die"], function( i, name ) {2527 jquery.fn[ name ] = function( types, data, fn, origselector /* internal use only */ ) {2528 var type, i = 0, match, namespaces, pretype,2529 selector = origselector || this.selector,2530 context = origselector ? this : jquery( this.context );2531 if ( typeof types === "object" && !types.preventdefault ) {2532 for ( var key in types ) {2533 context[ name ]( key, data, types[key], selector );2534 }2535 return this;2536 }2537 if ( jquery.isfunction( data ) ) {2538 fn = data;2539 data = undefined;2540 }2541 types = (types || "").split(" ");2542 while ( (type = types[ i++ ]) != null ) {2543 match = rnamespaces.exec( type );2544 namespaces = "";2545 if ( match ) {2546 namespaces = match[0];2547 type = type.replace( rnamespaces, "" );2548 }2549 if ( type === "hover" ) {2550 types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );2551 continue;2552 }2553 pretype = type;2554 if ( type === "focus" || type === "blur" ) {2555 types.push( livemap[ type ] + namespaces );2556 type = type + namespaces;2557 } else {2558 type = (livemap[ type ] || type) + namespaces;2559 }2560 if ( name === "live" ) {2561 // bind live handler2562 for ( var j = 0, l = context.length; j < l; j++ ) {2563 jquery.event.add( context[j], "live." + liveconvert( type, selector ),2564 { data: data, selector: selector, handler: fn, origtype: type, orighandler: fn, pretype: pretype } );2565 }2566 } else {2567 // unbind live handler2568 context.unbind( "live." + liveconvert( type, selector ), fn );2569 }2570 }2571 return this;2572 };2573});2574function livehandler( event ) {2575 var stop, maxlevel, related, match, handleobj, elem, j, i, l, data, close, namespace, ret,2576 elems = [],2577 selectors = [],2578 events = jquery._data( this, "events" );2579 // make sure we avoid non-left-click bubbling in firefox (#3861) and disabled elements in ie (#6911)2580 if ( event.livefired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) {2581 return;2582 }2583 if ( event.namespace ) {2584 namespace = new regexp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");2585 }2586 event.livefired = this;2587 var live = events.live.slice(0);2588 for ( j = 0; j < live.length; j++ ) {2589 handleobj = live[j];2590 if ( handleobj.origtype.replace( rnamespaces, "" ) === event.type ) {2591 selectors.push( handleobj.selector );2592 } else {2593 live.splice( j--, 1 );2594 }2595 }2596 match = jquery( event.target ).closest( selectors, event.currenttarget );2597 for ( i = 0, l = match.length; i < l; i++ ) {2598 close = match[i];2599 for ( j = 0; j < live.length; j++ ) {2600 handleobj = live[j];2601 if ( close.selector === handleobj.selector && (!namespace || namespace.test( handleobj.namespace )) && !close.elem.disabled ) {2602 elem = close.elem;2603 related = null;2604 // those two events require additional checking2605 if ( handleobj.pretype === "mouseenter" || handleobj.pretype === "mouseleave" ) {2606 event.type = handleobj.pretype;2607 related = jquery( event.relatedtarget ).closest( handleobj.selector )[0];2608 }2609 if ( !related || related !== elem ) {2610 elems.push({ elem: elem, handleobj: handleobj, level: close.level });2611 }2612 }2613 }2614 }2615 for ( i = 0, l = elems.length; i < l; i++ ) {2616 match = elems[i];2617 if ( maxlevel && match.level > maxlevel ) {2618 break;2619 }2620 event.currenttarget = match.elem;2621 event.data = match.handleobj.data;2622 event.handleobj = match.handleobj;2623 ret = match.handleobj.orighandler.apply( match.elem, arguments );2624 if ( ret === false || event.ispropagationstopped() ) {2625 maxlevel = match.level;2626 if ( ret === false ) {2627 stop = false;2628 }2629 if ( event.isimmediatepropagationstopped() ) {2630 break;2631 }2632 }2633 }2634 return stop;2635}2636function liveconvert( type, selector ) {2637 return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&");2638}2639jquery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +2640 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +2641 "change select submit keydown keypress keyup error").split(" "), function( i, name ) {2642 // handle event binding2643 jquery.fn[ name ] = function( data, fn ) {2644 if ( fn == null ) {2645 fn = data;2646 data = null;2647 }2648 return arguments.length > 0 ?2649 this.bind( name, data, fn ) :2650 this.trigger( name );2651 };2652 if ( jquery.attrfn ) {2653 jquery.attrfn[ name ] = true;2654 }2655});2656/*!2657 * sizzle css selector engine2658 * copyright 2011, the dojo foundation2659 * released under the mit, bsd, and gpl licenses.2660 * more information: http://sizzlejs.com/2661 */2662(function(){2663var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,2664 done = 0,2665 tostring = object.prototype.tostring,2666 hasduplicate = false,2667 basehasduplicate = true,2668 rbackslash = /\\/g,2669 rnonword = /\w/;2670// here we check if the javascript engine is using some sort of2671// optimization where it does not always call our comparision2672// function. if that is the case, discard the hasduplicate value.2673// thus far that includes google chrome.2674[0, 0].sort(function() {2675 basehasduplicate = false;2676 return 0;2677});2678var sizzle = function( selector, context, results, seed ) {2679 results = results || [];2680 context = context || document;2681 var origcontext = context;2682 if ( context.nodetype !== 1 && context.nodetype !== 9 ) {2683 return [];2684 }2685 2686 if ( !selector || typeof selector !== "string" ) {2687 return results;2688 }2689 var m, set, checkset, extra, ret, cur, pop, i,2690 prune = true,2691 contextxml = sizzle.isxml( context ),2692 parts = [],2693 sofar = selector;2694 2695 // reset the position of the chunker regexp (start from head)2696 do {2697 chunker.exec( "" );2698 m = chunker.exec( sofar );2699 if ( m ) {2700 sofar = m[3];2701 2702 parts.push( m[1] );2703 2704 if ( m[2] ) {2705 extra = m[3];2706 break;2707 }2708 }2709 } while ( m );2710 if ( parts.length > 1 && origpos.exec( selector ) ) {2711 if ( parts.length === 2 && expr.relative[ parts[0] ] ) {2712 set = posprocess( parts[0] + parts[1], context );2713 } else {2714 set = expr.relative[ parts[0] ] ?2715 [ context ] :2716 sizzle( parts.shift(), context );2717 while ( parts.length ) {2718 selector = parts.shift();2719 if ( expr.relative[ selector ] ) {2720 selector += parts.shift();2721 }2722 2723 set = posprocess( selector, set );2724 }2725 }2726 } else {2727 // take a shortcut and set the context if the root selector is an id2728 // (but not if it'll be faster if the inner selector is an id)2729 if ( !seed && parts.length > 1 && context.nodetype === 9 && !contextxml &&2730 expr.match.id.test(parts[0]) && !expr.match.id.test(parts[parts.length - 1]) ) {2731 ret = sizzle.find( parts.shift(), context, contextxml );2732 context = ret.expr ?2733 sizzle.filter( ret.expr, ret.set )[0] :2734 ret.set[0];2735 }2736 if ( context ) {2737 ret = seed ?2738 { expr: parts.pop(), set: makearray(seed) } :2739 sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentnode ? context.parentnode : context, contextxml );2740 set = ret.expr ?2741 sizzle.filter( ret.expr, ret.set ) :2742 ret.set;2743 if ( parts.length > 0 ) {2744 checkset = makearray( set );2745 } else {2746 prune = false;2747 }2748 while ( parts.length ) {2749 cur = parts.pop();2750 pop = cur;2751 if ( !expr.relative[ cur ] ) {2752 cur = "";2753 } else {2754 pop = parts.pop();2755 }2756 if ( pop == null ) {2757 pop = context;2758 }2759 expr.relative[ cur ]( checkset, pop, contextxml );2760 }2761 } else {2762 checkset = parts = [];2763 }2764 }2765 if ( !checkset ) {2766 checkset = set;2767 }2768 if ( !checkset ) {2769 sizzle.error( cur || selector );2770 }2771 if ( tostring.call(checkset) === "[object array]" ) {2772 if ( !prune ) {2773 results.push.apply( results, checkset );2774 } else if ( context && context.nodetype === 1 ) {2775 for ( i = 0; checkset[i] != null; i++ ) {2776 if ( checkset[i] && (checkset[i] === true || checkset[i].nodetype === 1 && sizzle.contains(context, checkset[i])) ) {2777 results.push( set[i] );2778 }2779 }2780 } else {2781 for ( i = 0; checkset[i] != null; i++ ) {2782 if ( checkset[i] && checkset[i].nodetype === 1 ) {2783 results.push( set[i] );2784 }2785 }2786 }2787 } else {2788 makearray( checkset, results );2789 }2790 if ( extra ) {2791 sizzle( extra, origcontext, results, seed );2792 sizzle.uniquesort( results );2793 }2794 return results;2795};2796sizzle.uniquesort = function( results ) {2797 if ( sortorder ) {2798 hasduplicate = basehasduplicate;2799 results.sort( sortorder );2800 if ( hasduplicate ) {2801 for ( var i = 1; i < results.length; i++ ) {2802 if ( results[i] === results[ i - 1 ] ) {2803 results.splice( i--, 1 );2804 }2805 }2806 }2807 }2808 return results;2809};2810sizzle.matches = function( expr, set ) {2811 return sizzle( expr, null, null, set );2812};2813sizzle.matchesselector = function( node, expr ) {2814 return sizzle( expr, null, null, [node] ).length > 0;2815};2816sizzle.find = function( expr, context, isxml ) {2817 var set;2818 if ( !expr ) {2819 return [];2820 }2821 for ( var i = 0, l = expr.order.length; i < l; i++ ) {2822 var match,2823 type = expr.order[i];2824 2825 if ( (match = expr.leftmatch[ type ].exec( expr )) ) {2826 var left = match[1];2827 match.splice( 1, 1 );2828 if ( left.substr( left.length - 1 ) !== "\\" ) {2829 match[1] = (match[1] || "").replace( rbackslash, "" );2830 set = expr.find[ type ]( match, context, isxml );2831 if ( set != null ) {2832 expr = expr.replace( expr.match[ type ], "" );2833 break;2834 }2835 }2836 }2837 }2838 if ( !set ) {2839 set = typeof context.getelementsbytagname !== "undefined" ?2840 context.getelementsbytagname( "*" ) :2841 [];2842 }2843 return { set: set, expr: expr };2844};2845sizzle.filter = function( expr, set, inplace, not ) {2846 var match, anyfound,2847 old = expr,2848 result = [],2849 curloop = set,2850 isxmlfilter = set && set[0] && sizzle.isxml( set[0] );2851 while ( expr && set.length ) {2852 for ( var type in expr.filter ) {2853 if ( (match = expr.leftmatch[ type ].exec( expr )) != null && match[2] ) {2854 var found, item,2855 filter = expr.filter[ type ],2856 left = match[1];2857 anyfound = false;2858 match.splice(1,1);2859 if ( left.substr( left.length - 1 ) === "\\" ) {2860 continue;2861 }2862 if ( curloop === result ) {2863 result = [];2864 }2865 if ( expr.prefilter[ type ] ) {2866 match = expr.prefilter[ type ]( match, curloop, inplace, result, not, isxmlfilter );2867 if ( !match ) {2868 anyfound = found = true;2869 } else if ( match === true ) {2870 continue;2871 }2872 }2873 if ( match ) {2874 for ( var i = 0; (item = curloop[i]) != null; i++ ) {2875 if ( item ) {2876 found = filter( item, match, i, curloop );2877 var pass = not ^ !!found;2878 if ( inplace && found != null ) {2879 if ( pass ) {2880 anyfound = true;2881 } else {2882 curloop[i] = false;2883 }2884 } else if ( pass ) {2885 result.push( item );2886 anyfound = true;2887 }2888 }2889 }2890 }2891 if ( found !== undefined ) {2892 if ( !inplace ) {2893 curloop = result;2894 }2895 expr = expr.replace( expr.match[ type ], "" );2896 if ( !anyfound ) {2897 return [];2898 }2899 break;2900 }2901 }2902 }2903 // improper expression2904 if ( expr === old ) {2905 if ( anyfound == null ) {2906 sizzle.error( expr );2907 } else {2908 break;2909 }2910 }2911 old = expr;2912 }2913 return curloop;2914};2915sizzle.error = function( msg ) {2916 throw "syntax error, unrecognized expression: " + msg;2917};2918var expr = sizzle.selectors = {2919 order: [ "id", "name", "tag" ],2920 match: {2921 id: /#((?:[\w\u00c0-\uffff\-]|\\.)+)/,2922 class: /\.((?:[\w\u00c0-\uffff\-]|\\.)+)/,2923 name: /\[name=['"]*((?:[\w\u00c0-\uffff\-]|\\.)+)['"]*\]/,2924 attr: /\[\s*((?:[\w\u00c0-\uffff\-]|\\.)+)\s*(?:(\s?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uffff\-]|\\.)*)|)|)\s*\]/,2925 tag: /^((?:[\w\u00c0-\uffff\*\-]|\\.)+)/,2926 child: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,2927 pos: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,2928 pseudo: /:((?:[\w\u00c0-\uffff\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/2929 },2930 leftmatch: {},2931 attrmap: {2932 "class": "classname",2933 "for": "htmlfor"2934 },2935 attrhandle: {2936 href: function( elem ) {2937 return elem.getattribute( "href" );2938 },2939 type: function( elem ) {2940 return elem.getattribute( "type" );2941 }2942 },2943 relative: {2944 "+": function(checkset, part){2945 var ispartstr = typeof part === "string",2946 istag = ispartstr && !rnonword.test( part ),2947 ispartstrnottag = ispartstr && !istag;2948 if ( istag ) {2949 part = part.tolowercase();2950 }2951 for ( var i = 0, l = checkset.length, elem; i < l; i++ ) {2952 if ( (elem = checkset[i]) ) {2953 while ( (elem = elem.previoussibling) && elem.nodetype !== 1 ) {}2954 checkset[i] = ispartstrnottag || elem && elem.nodename.tolowercase() === part ?2955 elem || false :2956 elem === part;2957 }2958 }2959 if ( ispartstrnottag ) {2960 sizzle.filter( part, checkset, true );2961 }2962 },2963 ">": function( checkset, part ) {2964 var elem,2965 ispartstr = typeof part === "string",2966 i = 0,2967 l = checkset.length;2968 if ( ispartstr && !rnonword.test( part ) ) {2969 part = part.tolowercase();2970 for ( ; i < l; i++ ) {2971 elem = checkset[i];2972 if ( elem ) {2973 var parent = elem.parentnode;2974 checkset[i] = parent.nodename.tolowercase() === part ? parent : false;2975 }2976 }2977 } else {2978 for ( ; i < l; i++ ) {2979 elem = checkset[i];2980 if ( elem ) {2981 checkset[i] = ispartstr ?2982 elem.parentnode :2983 elem.parentnode === part;2984 }2985 }2986 if ( ispartstr ) {2987 sizzle.filter( part, checkset, true );2988 }2989 }2990 },2991 "": function(checkset, part, isxml){2992 var nodecheck,2993 donename = done++,2994 checkfn = dircheck;2995 if ( typeof part === "string" && !rnonword.test( part ) ) {2996 part = part.tolowercase();2997 nodecheck = part;2998 checkfn = dirnodecheck;2999 }3000 checkfn( "parentnode", part, donename, checkset, nodecheck, isxml );3001 },3002 "~": function( checkset, part, isxml ) {3003 var nodecheck,3004 donename = done++,3005 checkfn = dircheck;3006 if ( typeof part === "string" && !rnonword.test( part ) ) {3007 part = part.tolowercase();3008 nodecheck = part;3009 checkfn = dirnodecheck;3010 }3011 checkfn( "previoussibling", part, donename, checkset, nodecheck, isxml );3012 }3013 },3014 find: {3015 id: function( match, context, isxml ) {3016 if ( typeof context.getelementbyid !== "undefined" && !isxml ) {3017 var m = context.getelementbyid(match[1]);3018 // check parentnode to catch when blackberry 4.6 returns3019 // nodes that are no longer in the document #69633020 return m && m.parentnode ? [m] : [];3021 }3022 },3023 name: function( match, context ) {3024 if ( typeof context.getelementsbyname !== "undefined" ) {3025 var ret = [],3026 results = context.getelementsbyname( match[1] );3027 for ( var i = 0, l = results.length; i < l; i++ ) {3028 if ( results[i].getattribute("name") === match[1] ) {3029 ret.push( results[i] );3030 }3031 }3032 return ret.length === 0 ? null : ret;3033 }3034 },3035 tag: function( match, context ) {3036 if ( typeof context.getelementsbytagname !== "undefined" ) {3037 return context.getelementsbytagname( match[1] );3038 }3039 }3040 },3041 prefilter: {3042 class: function( match, curloop, inplace, result, not, isxml ) {3043 match = " " + match[1].replace( rbackslash, "" ) + " ";3044 if ( isxml ) {3045 return match;3046 }3047 for ( var i = 0, elem; (elem = curloop[i]) != null; i++ ) {3048 if ( elem ) {3049 if ( not ^ (elem.classname && (" " + elem.classname + " ").replace(/[\t\n\r]/g, " ").indexof(match) >= 0) ) {3050 if ( !inplace ) {3051 result.push( elem );3052 }3053 } else if ( inplace ) {3054 curloop[i] = false;3055 }3056 }3057 }3058 return false;3059 },3060 id: function( match ) {3061 return match[1].replace( rbackslash, "" );3062 },3063 tag: function( match, curloop ) {3064 return match[1].replace( rbackslash, "" ).tolowercase();3065 },3066 child: function( match ) {3067 if ( match[1] === "nth" ) {3068 if ( !match[2] ) {3069 sizzle.error( match[0] );3070 }3071 match[2] = match[2].replace(/^\+|\s*/g, '');3072 // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'3073 var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(3074 match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||3075 !/\d/.test( match[2] ) && "0n+" + match[2] || match[2]);3076 // calculate the numbers (first)n+(last) including if they are negative3077 match[2] = (test[1] + (test[2] || 1)) - 0;3078 match[3] = test[3] - 0;3079 }3080 else if ( match[2] ) {3081 sizzle.error( match[0] );3082 }3083 // todo: move to normal caching system3084 match[0] = done++;3085 return match;3086 },3087 attr: function( match, curloop, inplace, result, not, isxml ) {3088 var name = match[1] = match[1].replace( rbackslash, "" );3089 3090 if ( !isxml && expr.attrmap[name] ) {3091 match[1] = expr.attrmap[name];3092 }3093 // handle if an un-quoted value was used3094 match[4] = ( match[4] || match[5] || "" ).replace( rbackslash, "" );3095 if ( match[2] === "~=" ) {3096 match[4] = " " + match[4] + " ";3097 }3098 return match;3099 },3100 pseudo: function( match, curloop, inplace, result, not ) {3101 if ( match[1] === "not" ) {3102 // if we're dealing with a complex expression, or a simple one3103 if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {3104 match[3] = sizzle(match[3], null, null, curloop);3105 } else {3106 var ret = sizzle.filter(match[3], curloop, inplace, true ^ not);3107 if ( !inplace ) {3108 result.push.apply( result, ret );3109 }3110 return false;3111 }3112 } else if ( expr.match.pos.test( match[0] ) || expr.match.child.test( match[0] ) ) {3113 return true;3114 }3115 3116 return match;3117 },3118 pos: function( match ) {3119 match.unshift( true );3120 return match;3121 }3122 },3123 3124 filters: {3125 enabled: function( elem ) {3126 return elem.disabled === false && elem.type !== "hidden";3127 },3128 disabled: function( elem ) {3129 return elem.disabled === true;3130 },3131 checked: function( elem ) {3132 return elem.checked === true;3133 },3134 3135 selected: function( elem ) {3136 // accessing this property makes selected-by-default3137 // options in safari work properly3138 if ( elem.parentnode ) {3139 elem.parentnode.selectedindex;3140 }3141 3142 return elem.selected === true;3143 },3144 parent: function( elem ) {3145 return !!elem.firstchild;3146 },3147 empty: function( elem ) {3148 return !elem.firstchild;3149 },3150 has: function( elem, i, match ) {3151 return !!sizzle( match[3], elem ).length;3152 },3153 header: function( elem ) {3154 return (/h\d/i).test( elem.nodename );3155 },3156 text: function( elem ) {3157 // ie6 and 7 will map elem.type to 'text' for new html5 types (search, etc) 3158 // use getattribute instead to test this case3159 return "text" === elem.getattribute( 'type' );3160 },3161 radio: function( elem ) {3162 return "radio" === elem.type;3163 },3164 checkbox: function( elem ) {3165 return "checkbox" === elem.type;3166 },3167 file: function( elem ) {3168 return "file" === elem.type;3169 },3170 password: function( elem ) {3171 return "password" === elem.type;3172 },3173 submit: function( elem ) {3174 return "submit" === elem.type;3175 },3176 image: function( elem ) {3177 return "image" === elem.type;3178 },3179 reset: function( elem ) {3180 return "reset" === elem.type;3181 },3182 button: function( elem ) {3183 return "button" === elem.type || elem.nodename.tolowercase() === "button";3184 },3185 input: function( elem ) {3186 return (/input|select|textarea|button/i).test( elem.nodename );3187 }3188 },3189 setfilters: {3190 first: function( elem, i ) {3191 return i === 0;3192 },3193 last: function( elem, i, match, array ) {3194 return i === array.length - 1;3195 },3196 even: function( elem, i ) {3197 return i % 2 === 0;3198 },3199 odd: function( elem, i ) {3200 return i % 2 === 1;3201 },3202 lt: function( elem, i, match ) {3203 return i < match[3] - 0;3204 },3205 gt: function( elem, i, match ) {3206 return i > match[3] - 0;3207 },3208 nth: function( elem, i, match ) {3209 return match[3] - 0 === i;3210 },3211 eq: function( elem, i, match ) {3212 return match[3] - 0 === i;3213 }3214 },3215 filter: {3216 pseudo: function( elem, match, i, array ) {3217 var name = match[1],3218 filter = expr.filters[ name ];3219 if ( filter ) {3220 return filter( elem, i, match, array );3221 } else if ( name === "contains" ) {3222 return (elem.textcontent || elem.innertext || sizzle.gettext([ elem ]) || "").indexof(match[3]) >= 0;3223 } else if ( name === "not" ) {3224 var not = match[3];3225 for ( var j = 0, l = not.length; j < l; j++ ) {3226 if ( not[j] === elem ) {3227 return false;3228 }3229 }3230 return true;3231 } else {3232 sizzle.error( name );3233 }3234 },3235 child: function( elem, match ) {3236 var type = match[1],3237 node = elem;3238 switch ( type ) {3239 case "only":3240 case "first":3241 while ( (node = node.previoussibling) ) {3242 if ( node.nodetype === 1 ) { 3243 return false; 3244 }3245 }3246 if ( type === "first" ) { 3247 return true; 3248 }3249 node = elem;3250 case "last":3251 while ( (node = node.nextsibling) ) {3252 if ( node.nodetype === 1 ) { 3253 return false; 3254 }3255 }3256 return true;3257 case "nth":3258 var first = match[2],3259 last = match[3];3260 if ( first === 1 && last === 0 ) {3261 return true;3262 }3263 3264 var donename = match[0],3265 parent = elem.parentnode;3266 3267 if ( parent && (parent.sizcache !== donename || !elem.nodeindex) ) {3268 var count = 0;3269 3270 for ( node = parent.firstchild; node; node = node.nextsibling ) {3271 if ( node.nodetype === 1 ) {3272 node.nodeindex = ++count;3273 }3274 } 3275 parent.sizcache = donename;3276 }3277 3278 var diff = elem.nodeindex - last;3279 if ( first === 0 ) {3280 return diff === 0;3281 } else {3282 return ( diff % first === 0 && diff / first >= 0 );3283 }3284 }3285 },3286 id: function( elem, match ) {3287 return elem.nodetype === 1 && elem.getattribute("id") === match;3288 },3289 tag: function( elem, match ) {3290 return (match === "*" && elem.nodetype === 1) || elem.nodename.tolowercase() === match;3291 },3292 3293 class: function( elem, match ) {3294 return (" " + (elem.classname || elem.getattribute("class")) + " ")3295 .indexof( match ) > -1;3296 },3297 attr: function( elem, match ) {3298 var name = match[1],3299 result = expr.attrhandle[ name ] ?3300 expr.attrhandle[ name ]( elem ) :3301 elem[ name ] != null ?3302 elem[ name ] :3303 elem.getattribute( name ),3304 value = result + "",3305 type = match[2],3306 check = match[4];3307 return result == null ?3308 type === "!=" :3309 type === "=" ?3310 value === check :3311 type === "*=" ?3312 value.indexof(check) >= 0 :3313 type === "~=" ?3314 (" " + value + " ").indexof(check) >= 0 :3315 !check ?3316 value && result !== false :3317 type === "!=" ?3318 value !== check :3319 type === "^=" ?3320 value.indexof(check) === 0 :3321 type === "$=" ?3322 value.substr(value.length - check.length) === check :3323 type === "|=" ?3324 value === check || value.substr(0, check.length + 1) === check + "-" :3325 false;3326 },3327 pos: function( elem, match, i, array ) {3328 var name = match[2],3329 filter = expr.setfilters[ name ];3330 if ( filter ) {3331 return filter( elem, i, match, array );3332 }3333 }3334 }3335};3336var origpos = expr.match.pos,3337 fescape = function(all, num){3338 return "\\" + (num - 0 + 1);3339 };3340for ( var type in expr.match ) {3341 expr.match[ type ] = new regexp( expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );3342 expr.leftmatch[ type ] = new regexp( /(^(?:.|\r|\n)*?)/.source + expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );3343}3344var makearray = function( array, results ) {3345 array = array.prototype.slice.call( array, 0 );3346 if ( results ) {3347 results.push.apply( results, array );3348 return results;3349 }3350 3351 return array;3352};3353// perform a simple check to determine if the browser is capable of3354// converting a nodelist to an array using builtin methods.3355// also verifies that the returned array holds dom nodes3356// (which is not the case in the blackberry browser)3357try {3358 array.prototype.slice.call( document.documentelement.childnodes, 0 )[0].nodetype;3359// provide a fallback method if it does not work3360} catch( e ) {3361 makearray = function( array, results ) {3362 var i = 0,3363 ret = results || [];3364 if ( tostring.call(array) === "[object array]" ) {3365 array.prototype.push.apply( ret, array );3366 } else {3367 if ( typeof array.length === "number" ) {3368 for ( var l = array.length; i < l; i++ ) {3369 ret.push( array[i] );3370 }3371 } else {3372 for ( ; array[i]; i++ ) {3373 ret.push( array[i] );3374 }3375 }3376 }3377 return ret;3378 };3379}3380var sortorder, siblingcheck;3381if ( document.documentelement.comparedocumentposition ) {3382 sortorder = function( a, b ) {3383 if ( a === b ) {3384 hasduplicate = true;3385 return 0;3386 }3387 if ( !a.comparedocumentposition || !b.comparedocumentposition ) {3388 return a.comparedocumentposition ? -1 : 1;3389 }3390 return a.comparedocumentposition(b) & 4 ? -1 : 1;3391 };3392} else {3393 sortorder = function( a, b ) {3394 var al, bl,3395 ap = [],3396 bp = [],3397 aup = a.parentnode,3398 bup = b.parentnode,3399 cur = aup;3400 // the nodes are identical, we can exit early3401 if ( a === b ) {3402 hasduplicate = true;3403 return 0;3404 // if the nodes are siblings (or identical) we can do a quick check3405 } else if ( aup === bup ) {3406 return siblingcheck( a, b );3407 // if no parents were found then the nodes are disconnected3408 } else if ( !aup ) {3409 return -1;3410 } else if ( !bup ) {3411 return 1;3412 }3413 // otherwise they're somewhere else in the tree so we need3414 // to build up a full list of the parentnodes for comparison3415 while ( cur ) {3416 ap.unshift( cur );3417 cur = cur.parentnode;3418 }3419 cur = bup;3420 while ( cur ) {3421 bp.unshift( cur );3422 cur = cur.parentnode;3423 }3424 al = ap.length;3425 bl = bp.length;3426 // start walking down the tree looking for a discrepancy3427 for ( var i = 0; i < al && i < bl; i++ ) {3428 if ( ap[i] !== bp[i] ) {3429 return siblingcheck( ap[i], bp[i] );3430 }3431 }3432 // we ended someplace up the tree so do a sibling check3433 return i === al ?3434 siblingcheck( a, bp[i], -1 ) :3435 siblingcheck( ap[i], b, 1 );3436 };3437 siblingcheck = function( a, b, ret ) {3438 if ( a === b ) {3439 return ret;3440 }3441 var cur = a.nextsibling;3442 while ( cur ) {3443 if ( cur === b ) {3444 return -1;3445 }3446 cur = cur.nextsibling;3447 }3448 return 1;3449 };3450}3451// utility function for retreiving the text value of an array of dom nodes3452sizzle.gettext = function( elems ) {3453 var ret = "", elem;3454 for ( var i = 0; elems[i]; i++ ) {3455 elem = elems[i];3456 // get the text from text nodes and cdata nodes3457 if ( elem.nodetype === 3 || elem.nodetype === 4 ) {3458 ret += elem.nodevalue;3459 // traverse everything else, except comment nodes3460 } else if ( elem.nodetype !== 8 ) {3461 ret += sizzle.gettext( elem.childnodes );3462 }3463 }3464 return ret;3465};3466// check to see if the browser returns elements by name when3467// querying by getelementbyid (and provide a workaround)3468(function(){3469 // we're going to inject a fake input element with a specified name3470 var form = document.createelement("div"),3471 id = "script" + (new date()).gettime(),3472 root = document.documentelement;3473 form.innerhtml = "<a name='" + id + "'/>";3474 // inject it into the root element, check its status, and remove it quickly3475 root.insertbefore( form, root.firstchild );3476 // the workaround has to do additional checks after a getelementbyid3477 // which slows things down for other browsers (hence the branching)3478 if ( document.getelementbyid( id ) ) {3479 expr.find.id = function( match, context, isxml ) {3480 if ( typeof context.getelementbyid !== "undefined" && !isxml ) {3481 var m = context.getelementbyid(match[1]);3482 return m ?3483 m.id === match[1] || typeof m.getattributenode !== "undefined" && m.getattributenode("id").nodevalue === match[1] ?3484 [m] :3485 undefined :3486 [];3487 }3488 };3489 expr.filter.id = function( elem, match ) {3490 var node = typeof elem.getattributenode !== "undefined" && elem.getattributenode("id");3491 return elem.nodetype === 1 && node && node.nodevalue === match;3492 };3493 }3494 root.removechild( form );3495 // release memory in ie3496 root = form = null;3497})();3498(function(){3499 // check to see if the browser returns only elements3500 // when doing getelementsbytagname("*")3501 // create a fake element3502 var div = document.createelement("div");3503 div.appendchild( document.createcomment("") );3504 // make sure no comments are found3505 if ( div.getelementsbytagname("*").length > 0 ) {3506 expr.find.tag = function( match, context ) {3507 var results = context.getelementsbytagname( match[1] );3508 // filter out possible comments3509 if ( match[1] === "*" ) {3510 var tmp = [];3511 for ( var i = 0; results[i]; i++ ) {3512 if ( results[i].nodetype === 1 ) {3513 tmp.push( results[i] );3514 }3515 }3516 results = tmp;3517 }3518 return results;3519 };3520 }3521 // check to see if an attribute returns normalized href attributes3522 div.innerhtml = "<a href='#'></a>";3523 if ( div.firstchild && typeof div.firstchild.getattribute !== "undefined" &&3524 div.firstchild.getattribute("href") !== "#" ) {3525 expr.attrhandle.href = function( elem ) {3526 return elem.getattribute( "href", 2 );3527 };3528 }3529 // release memory in ie3530 div = null;3531})();3532if ( document.queryselectorall ) {3533 (function(){3534 var oldsizzle = sizzle,3535 div = document.createelement("div"),3536 id = "__sizzle__";3537 div.innerhtml = "<p class='test'></p>";3538 // safari can't handle uppercase or unicode characters when3539 // in quirks mode.3540 if ( div.queryselectorall && div.queryselectorall(".test").length === 0 ) {3541 return;3542 }3543 3544 sizzle = function( query, context, extra, seed ) {3545 context = context || document;3546 // only use queryselectorall on non-xml documents3547 // (id selectors don't work in non-html documents)3548 if ( !seed && !sizzle.isxml(context) ) {3549 // see if we find a selector to speed up3550 var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );3551 3552 if ( match && (context.nodetype === 1 || context.nodetype === 9) ) {3553 // speed-up: sizzle("tag")3554 if ( match[1] ) {3555 return makearray( context.getelementsbytagname( query ), extra );3556 3557 // speed-up: sizzle(".class")3558 } else if ( match[2] && expr.find.class && context.getelementsbyclassname ) {3559 return makearray( context.getelementsbyclassname( match[2] ), extra );3560 }3561 }3562 3563 if ( context.nodetype === 9 ) {3564 // speed-up: sizzle("body")3565 // the body element only exists once, optimize finding it3566 if ( query === "body" && context.body ) {3567 return makearray( [ context.body ], extra );3568 3569 // speed-up: sizzle("#id")3570 } else if ( match && match[3] ) {3571 var elem = context.getelementbyid( match[3] );3572 // check parentnode to catch when blackberry 4.6 returns3573 // nodes that are no longer in the document #69633574 if ( elem && elem.parentnode ) {3575 // handle the case where ie and opera return items3576 // by name instead of id3577 if ( elem.id === match[3] ) {3578 return makearray( [ elem ], extra );3579 }3580 3581 } else {3582 return makearray( [], extra );3583 }3584 }3585 3586 try {3587 return makearray( context.queryselectorall(query), extra );3588 } catch(qsaerror) {}3589 // qsa works strangely on element-rooted queries3590 // we can work around this by specifying an extra id on the root3591 // and working up from there (thanks to andrew dupont for the technique)3592 // ie 8 doesn't work on object elements3593 } else if ( context.nodetype === 1 && context.nodename.tolowercase() !== "object" ) {3594 var oldcontext = context,3595 old = context.getattribute( "id" ),3596 nid = old || id,3597 hasparent = context.parentnode,3598 relativehierarchyselector = /^\s*[+~]/.test( query );3599 if ( !old ) {3600 context.setattribute( "id", nid );3601 } else {3602 nid = nid.replace( /'/g, "\\$&" );3603 }3604 if ( relativehierarchyselector && hasparent ) {3605 context = context.parentnode;3606 }3607 try {3608 if ( !relativehierarchyselector || hasparent ) {3609 return makearray( context.queryselectorall( "[id='" + nid + "'] " + query ), extra );3610 }3611 } catch(pseudoerror) {3612 } finally {3613 if ( !old ) {3614 oldcontext.removeattribute( "id" );3615 }3616 }3617 }3618 }3619 3620 return oldsizzle(query, context, extra, seed);3621 };3622 for ( var prop in oldsizzle ) {3623 sizzle[ prop ] = oldsizzle[ prop ];3624 }3625 // release memory in ie3626 div = null;3627 })();3628}3629(function(){3630 var html = document.documentelement,3631 matches = html.matchesselector || html.mozmatchesselector || html.webkitmatchesselector || html.msmatchesselector,3632 pseudoworks = false;3633 try {3634 // this should fail with an exception3635 // gecko does not error, returns false instead3636 matches.call( document.documentelement, "[test!='']:sizzle" );3637 3638 } catch( pseudoerror ) {3639 pseudoworks = true;3640 }3641 if ( matches ) {3642 sizzle.matchesselector = function( node, expr ) {3643 // make sure that attribute selectors are quoted3644 expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");3645 if ( !sizzle.isxml( node ) ) {3646 try { 3647 if ( pseudoworks || !expr.match.pseudo.test( expr ) && !/!=/.test( expr ) ) {3648 return matches.call( node, expr );3649 }3650 } catch(e) {}3651 }3652 return sizzle(expr, null, null, [node]).length > 0;3653 };3654 }3655})();3656(function(){3657 var div = document.createelement("div");3658 div.innerhtml = "<div class='test e'></div><div class='test'></div>";3659 // opera can't find a second classname (in 9.6)3660 // also, make sure that getelementsbyclassname actually exists3661 if ( !div.getelementsbyclassname || div.getelementsbyclassname("e").length === 0 ) {3662 return;3663 }3664 // safari caches class attributes, doesn't catch changes (in 3.2)3665 div.lastchild.classname = "e";3666 if ( div.getelementsbyclassname("e").length === 1 ) {3667 return;3668 }3669 3670 expr.order.splice(1, 0, "class");3671 expr.find.class = function( match, context, isxml ) {3672 if ( typeof context.getelementsbyclassname !== "undefined" && !isxml ) {3673 return context.getelementsbyclassname(match[1]);3674 }3675 };3676 // release memory in ie3677 div = null;3678})();3679function dirnodecheck( dir, cur, donename, checkset, nodecheck, isxml ) {3680 for ( var i = 0, l = checkset.length; i < l; i++ ) {3681 var elem = checkset[i];3682 if ( elem ) {3683 var match = false;3684 elem = elem[dir];3685 while ( elem ) {3686 if ( elem.sizcache === donename ) {3687 match = checkset[elem.sizset];3688 break;3689 }3690 if ( elem.nodetype === 1 && !isxml ){3691 elem.sizcache = donename;3692 elem.sizset = i;3693 }3694 if ( elem.nodename.tolowercase() === cur ) {3695 match = elem;3696 break;3697 }3698 elem = elem[dir];3699 }3700 checkset[i] = match;3701 }3702 }3703}3704function dircheck( dir, cur, donename, checkset, nodecheck, isxml ) {3705 for ( var i = 0, l = checkset.length; i < l; i++ ) {3706 var elem = checkset[i];3707 if ( elem ) {3708 var match = false;3709 3710 elem = elem[dir];3711 while ( elem ) {3712 if ( elem.sizcache === donename ) {3713 match = checkset[elem.sizset];3714 break;3715 }3716 if ( elem.nodetype === 1 ) {3717 if ( !isxml ) {3718 elem.sizcache = donename;3719 elem.sizset = i;3720 }3721 if ( typeof cur !== "string" ) {3722 if ( elem === cur ) {3723 match = true;3724 break;3725 }3726 } else if ( sizzle.filter( cur, [elem] ).length > 0 ) {3727 match = elem;3728 break;3729 }3730 }3731 elem = elem[dir];3732 }3733 checkset[i] = match;3734 }3735 }3736}3737if ( document.documentelement.contains ) {3738 sizzle.contains = function( a, b ) {3739 return a !== b && (a.contains ? a.contains(b) : true);3740 };3741} else if ( document.documentelement.comparedocumentposition ) {3742 sizzle.contains = function( a, b ) {3743 return !!(a.comparedocumentposition(b) & 16);3744 };3745} else {3746 sizzle.contains = function() {3747 return false;3748 };3749}3750sizzle.isxml = function( elem ) {3751 // documentelement is verified for cases where it doesn't yet exist3752 // (such as loading iframes in ie - #4833) 3753 var documentelement = (elem ? elem.ownerdocument || elem : 0).documentelement;3754 return documentelement ? documentelement.nodename !== "html" : false;3755};3756var posprocess = function( selector, context ) {3757 var match,3758 tmpset = [],3759 later = "",3760 root = context.nodetype ? [context] : context;3761 // position selectors must be done after the filter3762 // and so must :not(positional) so we move all pseudos to the end3763 while ( (match = expr.match.pseudo.exec( selector )) ) {3764 later += match[0];3765 selector = selector.replace( expr.match.pseudo, "" );3766 }3767 selector = expr.relative[selector] ? selector + "*" : selector;3768 for ( var i = 0, l = root.length; i < l; i++ ) {3769 sizzle( selector, root[i], tmpset );3770 }3771 return sizzle.filter( later, tmpset );3772};3773// expose3774jquery.find = sizzle;3775jquery.expr = sizzle.selectors;3776jquery.expr[":"] = jquery.expr.filters;3777jquery.unique = sizzle.uniquesort;3778jquery.text = sizzle.gettext;3779jquery.isxmldoc = sizzle.isxml;3780jquery.contains = sizzle.contains;3781})();3782var runtil = /until$/,3783 rparentsprev = /^(?:parents|prevuntil|prevall)/,3784 // note: this regexp should be improved, or likely pulled from sizzle3785 rmultiselector = /,/,3786 issimple = /^.[^:#\[\.,]*$/,3787 slice = array.prototype.slice,3788 pos = jquery.expr.match.pos,3789 // methods guaranteed to produce a unique set when starting from a unique set3790 guaranteedunique = {3791 children: true,3792 contents: true,3793 next: true,3794 prev: true3795 };3796jquery.fn.extend({3797 find: function( selector ) {3798 var ret = this.pushstack( "", "find", selector ),3799 length = 0;3800 for ( var i = 0, l = this.length; i < l; i++ ) {3801 length = ret.length;3802 jquery.find( selector, this[i], ret );3803 if ( i > 0 ) {3804 // make sure that the results are unique3805 for ( var n = length; n < ret.length; n++ ) {3806 for ( var r = 0; r < length; r++ ) {3807 if ( ret[r] === ret[n] ) {3808 ret.splice(n--, 1);3809 break;3810 }3811 }3812 }3813 }3814 }3815 return ret;3816 },3817 has: function( target ) {3818 var targets = jquery( target );3819 return this.filter(function() {3820 for ( var i = 0, l = targets.length; i < l; i++ ) {3821 if ( jquery.contains( this, targets[i] ) ) {3822 return true;3823 }3824 }3825 });3826 },3827 not: function( selector ) {3828 return this.pushstack( winnow(this, selector, false), "not", selector);3829 },3830 filter: function( selector ) {3831 return this.pushstack( winnow(this, selector, true), "filter", selector );3832 },3833 is: function( selector ) {3834 return !!selector && jquery.filter( selector, this ).length > 0;3835 },3836 closest: function( selectors, context ) {3837 var ret = [], i, l, cur = this[0];3838 if ( jquery.isarray( selectors ) ) {3839 var match, selector,3840 matches = {},3841 level = 1;3842 if ( cur && selectors.length ) {3843 for ( i = 0, l = selectors.length; i < l; i++ ) {3844 selector = selectors[i];3845 if ( !matches[selector] ) {3846 matches[selector] = jquery.expr.match.pos.test( selector ) ?3847 jquery( selector, context || this.context ) :3848 selector;3849 }3850 }3851 while ( cur && cur.ownerdocument && cur !== context ) {3852 for ( selector in matches ) {3853 match = matches[selector];3854 if ( match.jquery ? match.index(cur) > -1 : jquery(cur).is(match) ) {3855 ret.push({ selector: selector, elem: cur, level: level });3856 }3857 }3858 cur = cur.parentnode;3859 level++;3860 }3861 }3862 return ret;3863 }3864 var pos = pos.test( selectors ) ?3865 jquery( selectors, context || this.context ) : null;3866 for ( i = 0, l = this.length; i < l; i++ ) {3867 cur = this[i];3868 while ( cur ) {3869 if ( pos ? pos.index(cur) > -1 : jquery.find.matchesselector(cur, selectors) ) {3870 ret.push( cur );3871 break;3872 } else {3873 cur = cur.parentnode;3874 if ( !cur || !cur.ownerdocument || cur === context ) {3875 break;3876 }3877 }3878 }3879 }3880 ret = ret.length > 1 ? jquery.unique(ret) : ret;3881 return this.pushstack( ret, "closest", selectors );3882 },3883 // determine the position of an element within3884 // the matched set of elements3885 index: function( elem ) {3886 if ( !elem || typeof elem === "string" ) {3887 return jquery.inarray( this[0],3888 // if it receives a string, the selector is used3889 // if it receives nothing, the siblings are used3890 elem ? jquery( elem ) : this.parent().children() );3891 }3892 // locate the position of the desired element3893 return jquery.inarray(3894 // if it receives a jquery object, the first element is used3895 elem.jquery ? elem[0] : elem, this );3896 },3897 add: function( selector, context ) {3898 var set = typeof selector === "string" ?3899 jquery( selector, context ) :3900 jquery.makearray( selector ),3901 all = jquery.merge( this.get(), set );3902 return this.pushstack( isdisconnected( set[0] ) || isdisconnected( all[0] ) ?3903 all :3904 jquery.unique( all ) );3905 },3906 andself: function() {3907 return this.add( this.prevobject );3908 }3909});3910// a painfully simple check to see if an element is disconnected3911// from a document (should be improved, where feasible).3912function isdisconnected( node ) {3913 return !node || !node.parentnode || node.parentnode.nodetype === 11;3914}3915jquery.each({3916 parent: function( elem ) {3917 var parent = elem.parentnode;3918 return parent && parent.nodetype !== 11 ? parent : null;3919 },3920 parents: function( elem ) {3921 return jquery.dir( elem, "parentnode" );3922 },3923 parentsuntil: function( elem, i, until ) {3924 return jquery.dir( elem, "parentnode", until );3925 },3926 next: function( elem ) {3927 return jquery.nth( elem, 2, "nextsibling" );3928 },3929 prev: function( elem ) {3930 return jquery.nth( elem, 2, "previoussibling" );3931 },3932 nextall: function( elem ) {3933 return jquery.dir( elem, "nextsibling" );3934 },3935 prevall: function( elem ) {3936 return jquery.dir( elem, "previoussibling" );3937 },3938 nextuntil: function( elem, i, until ) {3939 return jquery.dir( elem, "nextsibling", until );3940 },3941 prevuntil: function( elem, i, until ) {3942 return jquery.dir( elem, "previoussibling", until );3943 },3944 siblings: function( elem ) {3945 return jquery.sibling( elem.parentnode.firstchild, elem );3946 },3947 children: function( elem ) {3948 return jquery.sibling( elem.firstchild );3949 },3950 contents: function( elem ) {3951 return jquery.nodename( elem, "iframe" ) ?3952 elem.contentdocument || elem.contentwindow.document :3953 jquery.makearray( elem.childnodes );3954 }3955}, function( name, fn ) {3956 jquery.fn[ name ] = function( until, selector ) {3957 var ret = jquery.map( this, fn, until ),3958 // the variable 'args' was introduced in3959 // https://github.com/jquery/jquery/commit/52a02383960 // to work around a bug in chrome 10 (dev) and should be removed when the bug is fixed.3961 // http://code.google.com/p/v8/issues/detail?id=10503962 args = slice.call(arguments);3963 if ( !runtil.test( name ) ) {3964 selector = until;3965 }3966 if ( selector && typeof selector === "string" ) {3967 ret = jquery.filter( selector, ret );3968 }3969 ret = this.length > 1 && !guaranteedunique[ name ] ? jquery.unique( ret ) : ret;3970 if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {3971 ret = ret.reverse();3972 }3973 return this.pushstack( ret, name, args.join(",") );3974 };3975});3976jquery.extend({3977 filter: function( expr, elems, not ) {3978 if ( not ) {3979 expr = ":not(" + expr + ")";3980 }3981 return elems.length === 1 ?3982 jquery.find.matchesselector(elems[0], expr) ? [ elems[0] ] : [] :3983 jquery.find.matches(expr, elems);3984 },3985 dir: function( elem, dir, until ) {3986 var matched = [],3987 cur = elem[ dir ];3988 while ( cur && cur.nodetype !== 9 && (until === undefined || cur.nodetype !== 1 || !jquery( cur ).is( until )) ) {3989 if ( cur.nodetype === 1 ) {3990 matched.push( cur );3991 }3992 cur = cur[dir];3993 }3994 return matched;3995 },3996 nth: function( cur, result, dir, elem ) {3997 result = result || 1;3998 var num = 0;3999 for ( ; cur; cur = cur[dir] ) {4000 if ( cur.nodetype === 1 && ++num === result ) {4001 break;4002 }4003 }4004 return cur;4005 },4006 sibling: function( n, elem ) {4007 var r = [];4008 for ( ; n; n = n.nextsibling ) {4009 if ( n.nodetype === 1 && n !== elem ) {4010 r.push( n );4011 }4012 }4013 return r;4014 }4015});4016// implement the identical functionality for filter and not4017function winnow( elements, qualifier, keep ) {4018 if ( jquery.isfunction( qualifier ) ) {4019 return jquery.grep(elements, function( elem, i ) {4020 var retval = !!qualifier.call( elem, i, elem );4021 return retval === keep;4022 });4023 } else if ( qualifier.nodetype ) {4024 return jquery.grep(elements, function( elem, i ) {4025 return (elem === qualifier) === keep;4026 });4027 } else if ( typeof qualifier === "string" ) {4028 var filtered = jquery.grep(elements, function( elem ) {4029 return elem.nodetype === 1;4030 });4031 if ( issimple.test( qualifier ) ) {4032 return jquery.filter(qualifier, filtered, !keep);4033 } else {4034 qualifier = jquery.filter( qualifier, filtered );4035 }4036 }4037 return jquery.grep(elements, function( elem, i ) {4038 return (jquery.inarray( elem, qualifier ) >= 0) === keep;4039 });4040}4041var rinlinejquery = / jquery\d+="(?:\d+|null)"/g,4042 rleadingwhitespace = /^\s+/,4043 rxhtmltag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,4044 rtagname = /<([\w:]+)/,4045 rtbody = /<tbody/i,4046 rhtml = /<|&#?\w+;/,4047 rnocache = /<(?:script|object|embed|option|style)/i,4048 // checked="checked" or checked4049 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,4050 wrapmap = {4051 option: [ 1, "<select multiple='multiple'>", "</select>" ],4052 legend: [ 1, "<fieldset>", "</fieldset>" ],4053 thead: [ 1, "<table>", "</table>" ],4054 tr: [ 2, "<table><tbody>", "</tbody></table>" ],4055 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],4056 col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],4057 area: [ 1, "<map>", "</map>" ],4058 _default: [ 0, "", "" ]4059 };4060wrapmap.optgroup = wrapmap.option;4061wrapmap.tbody = wrapmap.tfoot = wrapmap.colgroup = wrapmap.caption = wrapmap.thead;4062wrapmap.th = wrapmap.td;4063// ie can't serialize <link> and <script> tags normally4064if ( !jquery.support.htmlserialize ) {4065 wrapmap._default = [ 1, "div<div>", "</div>" ];4066}4067jquery.fn.extend({4068 text: function( text ) {4069 if ( jquery.isfunction(text) ) {4070 return this.each(function(i) {4071 var self = jquery( this );4072 self.text( text.call(this, i, self.text()) );4073 });4074 }4075 if ( typeof text !== "object" && text !== undefined ) {4076 return this.empty().append( (this[0] && this[0].ownerdocument || document).createtextnode( text ) );4077 }4078 return jquery.text( this );4079 },4080 wrapall: function( html ) {4081 if ( jquery.isfunction( html ) ) {4082 return this.each(function(i) {4083 jquery(this).wrapall( html.call(this, i) );4084 });4085 }4086 if ( this[0] ) {4087 // the elements to wrap the target around4088 var wrap = jquery( html, this[0].ownerdocument ).eq(0).clone(true);4089 if ( this[0].parentnode ) {4090 wrap.insertbefore( this[0] );4091 }4092 wrap.map(function() {4093 var elem = this;4094 while ( elem.firstchild && elem.firstchild.nodetype === 1 ) {4095 elem = elem.firstchild;4096 }4097 return elem;4098 }).append(this);4099 }4100 return this;4101 },4102 wrapinner: function( html ) {4103 if ( jquery.isfunction( html ) ) {4104 return this.each(function(i) {4105 jquery(this).wrapinner( html.call(this, i) );4106 });4107 }4108 return this.each(function() {4109 var self = jquery( this ),4110 contents = self.contents();4111 if ( contents.length ) {4112 contents.wrapall( html );4113 } else {4114 self.append( html );4115 }4116 });4117 },4118 wrap: function( html ) {4119 return this.each(function() {4120 jquery( this ).wrapall( html );4121 });4122 },4123 unwrap: function() {4124 return this.parent().each(function() {4125 if ( !jquery.nodename( this, "body" ) ) {4126 jquery( this ).replacewith( this.childnodes );4127 }4128 }).end();4129 },4130 append: function() {4131 return this.dommanip(arguments, true, function( elem ) {4132 if ( this.nodetype === 1 ) {4133 this.appendchild( elem );4134 }4135 });4136 },4137 prepend: function() {4138 return this.dommanip(arguments, true, function( elem ) {4139 if ( this.nodetype === 1 ) {4140 this.insertbefore( elem, this.firstchild );4141 }4142 });4143 },4144 before: function() {4145 if ( this[0] && this[0].parentnode ) {4146 return this.dommanip(arguments, false, function( elem ) {4147 this.parentnode.insertbefore( elem, this );4148 });4149 } else if ( arguments.length ) {4150 var set = jquery(arguments[0]);4151 set.push.apply( set, this.toarray() );4152 return this.pushstack( set, "before", arguments );4153 }4154 },4155 after: function() {4156 if ( this[0] && this[0].parentnode ) {4157 return this.dommanip(arguments, false, function( elem ) {4158 this.parentnode.insertbefore( elem, this.nextsibling );4159 });4160 } else if ( arguments.length ) {4161 var set = this.pushstack( this, "after", arguments );4162 set.push.apply( set, jquery(arguments[0]).toarray() );4163 return set;4164 }4165 },4166 // keepdata is for internal use only--do not document4167 remove: function( selector, keepdata ) {4168 for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {4169 if ( !selector || jquery.filter( selector, [ elem ] ).length ) {4170 if ( !keepdata && elem.nodetype === 1 ) {4171 jquery.cleandata( elem.getelementsbytagname("*") );4172 jquery.cleandata( [ elem ] );4173 }4174 if ( elem.parentnode ) {4175 elem.parentnode.removechild( elem );4176 }4177 }4178 }4179 return this;4180 },4181 empty: function() {4182 for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {4183 // remove element nodes and prevent memory leaks4184 if ( elem.nodetype === 1 ) {4185 jquery.cleandata( elem.getelementsbytagname("*") );4186 }4187 // remove any remaining nodes4188 while ( elem.firstchild ) {4189 elem.removechild( elem.firstchild );4190 }4191 }4192 return this;4193 },4194 clone: function( dataandevents, deepdataandevents ) {4195 dataandevents = dataandevents == null ? false : dataandevents;4196 deepdataandevents = deepdataandevents == null ? dataandevents : deepdataandevents;4197 return this.map( function () {4198 return jquery.clone( this, dataandevents, deepdataandevents );4199 });4200 },4201 html: function( value ) {4202 if ( value === undefined ) {4203 return this[0] && this[0].nodetype === 1 ?4204 this[0].innerhtml.replace(rinlinejquery, "") :4205 null;4206 // see if we can take a shortcut and just use innerhtml4207 } else if ( typeof value === "string" && !rnocache.test( value ) &&4208 (jquery.support.leadingwhitespace || !rleadingwhitespace.test( value )) &&4209 !wrapmap[ (rtagname.exec( value ) || ["", ""])[1].tolowercase() ] ) {4210 value = value.replace(rxhtmltag, "<$1></$2>");4211 try {4212 for ( var i = 0, l = this.length; i < l; i++ ) {4213 // remove element nodes and prevent memory leaks4214 if ( this[i].nodetype === 1 ) {4215 jquery.cleandata( this[i].getelementsbytagname("*") );4216 this[i].innerhtml = value;4217 }4218 }4219 // if using innerhtml throws an exception, use the fallback method4220 } catch(e) {4221 this.empty().append( value );4222 }4223 } else if ( jquery.isfunction( value ) ) {4224 this.each(function(i){4225 var self = jquery( this );4226 self.html( value.call(this, i, self.html()) );4227 });4228 } else {4229 this.empty().append( value );4230 }4231 return this;4232 },4233 replacewith: function( value ) {4234 if ( this[0] && this[0].parentnode ) {4235 // make sure that the elements are removed from the dom before they are inserted4236 // this can help fix replacing a parent with child elements4237 if ( jquery.isfunction( value ) ) {4238 return this.each(function(i) {4239 var self = jquery(this), old = self.html();4240 self.replacewith( value.call( this, i, old ) );4241 });4242 }4243 if ( typeof value !== "string" ) {4244 value = jquery( value ).detach();4245 }4246 return this.each(function() {4247 var next = this.nextsibling,4248 parent = this.parentnode;4249 jquery( this ).remove();4250 if ( next ) {4251 jquery(next).before( value );4252 } else {4253 jquery(parent).append( value );4254 }4255 });4256 } else {4257 return this.pushstack( jquery(jquery.isfunction(value) ? value() : value), "replacewith", value );4258 }4259 },4260 detach: function( selector ) {4261 return this.remove( selector, true );4262 },4263 dommanip: function( args, table, callback ) {4264 var results, first, fragment, parent,4265 value = args[0],4266 scripts = [];4267 // we can't clonenode fragments that contain checked, in webkit4268 if ( !jquery.support.checkclone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {4269 return this.each(function() {4270 jquery(this).dommanip( args, table, callback, true );4271 });4272 }4273 if ( jquery.isfunction(value) ) {4274 return this.each(function(i) {4275 var self = jquery(this);4276 args[0] = value.call(this, i, table ? self.html() : undefined);4277 self.dommanip( args, table, callback );4278 });4279 }4280 if ( this[0] ) {4281 parent = value && value.parentnode;4282 // if we're in a fragment, just use that instead of building a new one4283 if ( jquery.support.parentnode && parent && parent.nodetype === 11 && parent.childnodes.length === this.length ) {4284 results = { fragment: parent };4285 } else {4286 results = jquery.buildfragment( args, this, scripts );4287 }4288 fragment = results.fragment;4289 if ( fragment.childnodes.length === 1 ) {4290 first = fragment = fragment.firstchild;4291 } else {4292 first = fragment.firstchild;4293 }4294 if ( first ) {4295 table = table && jquery.nodename( first, "tr" );4296 for ( var i = 0, l = this.length, lastindex = l - 1; i < l; i++ ) {4297 callback.call(4298 table ?4299 root(this[i], first) :4300 this[i],4301 // make sure that we do not leak memory by inadvertently discarding4302 // the original fragment (which might have attached data) instead of4303 // using it; in addition, use the original fragment object for the last4304 // item instead of first because it can end up being emptied incorrectly4305 // in certain situations (bug #8070).4306 // fragments from the fragment cache must always be cloned and never used4307 // in place.4308 results.cacheable || (l > 1 && i < lastindex) ?4309 jquery.clone( fragment, true, true ) :4310 fragment4311 );4312 }4313 }4314 if ( scripts.length ) {4315 jquery.each( scripts, evalscript );4316 }4317 }4318 return this;4319 }4320});4321function root( elem, cur ) {4322 return jquery.nodename(elem, "table") ?4323 (elem.getelementsbytagname("tbody")[0] ||4324 elem.appendchild(elem.ownerdocument.createelement("tbody"))) :4325 elem;4326}4327function clonecopyevent( src, dest ) {4328 if ( dest.nodetype !== 1 || !jquery.hasdata( src ) ) {4329 return;4330 }4331 var internalkey = jquery.expando,4332 olddata = jquery.data( src ),4333 curdata = jquery.data( dest, olddata );4334 // switch to use the internal data object, if it exists, for the next4335 // stage of data copying4336 if ( (olddata = olddata[ internalkey ]) ) {4337 var events = olddata.events;4338 curdata = curdata[ internalkey ] = jquery.extend({}, olddata);4339 if ( events ) {4340 delete curdata.handle;4341 curdata.events = {};4342 for ( var type in events ) {4343 for ( var i = 0, l = events[ type ].length; i < l; i++ ) {4344 jquery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data );4345 }4346 }4347 }4348 }4349}4350function clonefixattributes(src, dest) {4351 // we do not need to do anything for non-elements4352 if ( dest.nodetype !== 1 ) {4353 return;4354 }4355 var nodename = dest.nodename.tolowercase();4356 // clearattributes removes the attributes, which we don't want,4357 // but also removes the attachevent events, which we *do* want4358 dest.clearattributes();4359 // mergeattributes, in contrast, only merges back on the4360 // original attributes, not the events4361 dest.mergeattributes(src);4362 // ie6-8 fail to clone children inside object elements that use4363 // the proprietary classid attribute value (rather than the type4364 // attribute) to identify the type of content to display4365 if ( nodename === "object" ) {4366 dest.outerhtml = src.outerhtml;4367 } else if ( nodename === "input" && (src.type === "checkbox" || src.type === "radio") ) {4368 // ie6-8 fails to persist the checked state of a cloned checkbox4369 // or radio button. worse, ie6-7 fail to give the cloned element4370 // a checked appearance if the defaultchecked value isn't also set4371 if ( src.checked ) {4372 dest.defaultchecked = dest.checked = src.checked;4373 }4374 // ie6-7 get confused and end up setting the value of a cloned4375 // checkbox/radio button to an empty string instead of "on"4376 if ( dest.value !== src.value ) {4377 dest.value = src.value;4378 }4379 // ie6-8 fails to return the selected option to the default selected4380 // state when cloning options4381 } else if ( nodename === "option" ) {4382 dest.selected = src.defaultselected;4383 // ie6-8 fails to set the defaultvalue to the correct value when4384 // cloning other types of input fields4385 } else if ( nodename === "input" || nodename === "textarea" ) {4386 dest.defaultvalue = src.defaultvalue;4387 }4388 // event data gets referenced instead of copied if the expando4389 // gets copied too4390 dest.removeattribute( jquery.expando );4391}4392jquery.buildfragment = function( args, nodes, scripts ) {4393 var fragment, cacheable, cacheresults,4394 doc = (nodes && nodes[0] ? nodes[0].ownerdocument || nodes[0] : document);4395 // only cache "small" (1/2 kb) html strings that are associated with the main document4396 // cloning options loses the selected state, so don't cache them4397 // ie 6 doesn't like it when you put <object> or <embed> elements in a fragment4398 // also, webkit does not clone 'checked' attributes on clonenode, so don't cache4399 if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&4400 args[0].charat(0) === "<" && !rnocache.test( args[0] ) && (jquery.support.checkclone || !rchecked.test( args[0] )) ) {4401 cacheable = true;4402 cacheresults = jquery.fragments[ args[0] ];4403 if ( cacheresults ) {4404 if ( cacheresults !== 1 ) {4405 fragment = cacheresults;4406 }4407 }4408 }4409 if ( !fragment ) {4410 fragment = doc.createdocumentfragment();4411 jquery.clean( args, doc, fragment, scripts );4412 }4413 if ( cacheable ) {4414 jquery.fragments[ args[0] ] = cacheresults ? fragment : 1;4415 }4416 return { fragment: fragment, cacheable: cacheable };4417};4418jquery.fragments = {};4419jquery.each({4420 appendto: "append",4421 prependto: "prepend",4422 insertbefore: "before",4423 insertafter: "after",4424 replaceall: "replacewith"4425}, function( name, original ) {4426 jquery.fn[ name ] = function( selector ) {4427 var ret = [],4428 insert = jquery( selector ),4429 parent = this.length === 1 && this[0].parentnode;4430 if ( parent && parent.nodetype === 11 && parent.childnodes.length === 1 && insert.length === 1 ) {4431 insert[ original ]( this[0] );4432 return this;4433 } else {4434 for ( var i = 0, l = insert.length; i < l; i++ ) {4435 var elems = (i > 0 ? this.clone(true) : this).get();4436 jquery( insert[i] )[ original ]( elems );4437 ret = ret.concat( elems );4438 }4439 return this.pushstack( ret, name, insert.selector );4440 }4441 };4442});4443function getall( elem ) {4444 if ( "getelementsbytagname" in elem ) {4445 return elem.getelementsbytagname( "*" );4446 4447 } else if ( "queryselectorall" in elem ) {4448 return elem.queryselectorall( "*" );4449 } else {4450 return [];4451 }4452}4453jquery.extend({4454 clone: function( elem, dataandevents, deepdataandevents ) {4455 var clone = elem.clonenode(true),4456 srcelements,4457 destelements,4458 i;4459 if ( (!jquery.support.nocloneevent || !jquery.support.noclonechecked) &&4460 (elem.nodetype === 1 || elem.nodetype === 11) && !jquery.isxmldoc(elem) ) {4461 // ie copies events bound via attachevent when using clonenode.4462 // calling detachevent on the clone will also remove the events4463 // from the original. in order to get around this, we use some4464 // proprietary methods to clear the events. thanks to mootools4465 // guys for this hotness.4466 clonefixattributes( elem, clone );4467 // using sizzle here is crazy slow, so we use getelementsbytagname4468 // instead4469 srcelements = getall( elem );4470 destelements = getall( clone );4471 // weird iteration because ie will replace the length property4472 // with an element if you are cloning the body and one of the4473 // elements on the page has a name or id of "length"4474 for ( i = 0; srcelements[i]; ++i ) {4475 clonefixattributes( srcelements[i], destelements[i] );4476 }4477 }4478 // copy the events from the original to the clone4479 if ( dataandevents ) {4480 clonecopyevent( elem, clone );4481 if ( deepdataandevents ) {4482 srcelements = getall( elem );4483 destelements = getall( clone );4484 for ( i = 0; srcelements[i]; ++i ) {4485 clonecopyevent( srcelements[i], destelements[i] );4486 }4487 }4488 }4489 // return the cloned set4490 return clone;4491},4492 clean: function( elems, context, fragment, scripts ) {4493 context = context || document;4494 // !context.createelement fails in ie with an error but returns typeof 'object'4495 if ( typeof context.createelement === "undefined" ) {4496 context = context.ownerdocument || context[0] && context[0].ownerdocument || document;4497 }4498 var ret = [];4499 for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {4500 if ( typeof elem === "number" ) {4501 elem += "";4502 }4503 if ( !elem ) {4504 continue;4505 }4506 // convert html string into dom nodes4507 if ( typeof elem === "string" && !rhtml.test( elem ) ) {4508 elem = context.createtextnode( elem );4509 } else if ( typeof elem === "string" ) {4510 // fix "xhtml"-style tags in all browsers4511 elem = elem.replace(rxhtmltag, "<$1></$2>");4512 // trim whitespace, otherwise indexof won't work as expected4513 var tag = (rtagname.exec( elem ) || ["", ""])[1].tolowercase(),4514 wrap = wrapmap[ tag ] || wrapmap._default,4515 depth = wrap[0],4516 div = context.createelement("div");4517 // go to html and back, then peel off extra wrappers4518 div.innerhtml = wrap[1] + elem + wrap[2];4519 // move to the right depth4520 while ( depth-- ) {4521 div = div.lastchild;4522 }4523 // remove ie's autoinserted <tbody> from table fragments4524 if ( !jquery.support.tbody ) {4525 // string was a <table>, *may* have spurious <tbody>4526 var hasbody = rtbody.test(elem),4527 tbody = tag === "table" && !hasbody ?4528 div.firstchild && div.firstchild.childnodes :4529 // string was a bare <thead> or <tfoot>4530 wrap[1] === "<table>" && !hasbody ?4531 div.childnodes :4532 [];4533 for ( var j = tbody.length - 1; j >= 0 ; --j ) {4534 if ( jquery.nodename( tbody[ j ], "tbody" ) && !tbody[ j ].childnodes.length ) {4535 tbody[ j ].parentnode.removechild( tbody[ j ] );4536 }4537 }4538 }4539 // ie completely kills leading whitespace when innerhtml is used4540 if ( !jquery.support.leadingwhitespace && rleadingwhitespace.test( elem ) ) {4541 div.insertbefore( context.createtextnode( rleadingwhitespace.exec(elem)[0] ), div.firstchild );4542 }4543 elem = div.childnodes;4544 }4545 if ( elem.nodetype ) {4546 ret.push( elem );4547 } else {4548 ret = jquery.merge( ret, elem );4549 }4550 }4551 if ( fragment ) {4552 for ( i = 0; ret[i]; i++ ) {4553 if ( scripts && jquery.nodename( ret[i], "script" ) && (!ret[i].type || ret[i].type.tolowercase() === "text/javascript") ) {4554 scripts.push( ret[i].parentnode ? ret[i].parentnode.removechild( ret[i] ) : ret[i] );4555 } else {4556 if ( ret[i].nodetype === 1 ) {4557 ret.splice.apply( ret, [i + 1, 0].concat(jquery.makearray(ret[i].getelementsbytagname("script"))) );4558 }4559 fragment.appendchild( ret[i] );4560 }4561 }4562 }4563 return ret;4564 },4565 cleandata: function( elems ) {4566 var data, id, cache = jquery.cache, internalkey = jquery.expando, special = jquery.event.special,4567 deleteexpando = jquery.support.deleteexpando;4568 for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {4569 if ( elem.nodename && jquery.nodata[elem.nodename.tolowercase()] ) {4570 continue;4571 }4572 id = elem[ jquery.expando ];4573 if ( id ) {4574 data = cache[ id ] && cache[ id ][ internalkey ];4575 if ( data && data.events ) {4576 for ( var type in data.events ) {4577 if ( special[ type ] ) {4578 jquery.event.remove( elem, type );4579 // this is a shortcut to avoid jquery.event.remove's overhead4580 } else {4581 jquery.removeevent( elem, type, data.handle );4582 }4583 }4584 // null the dom reference to avoid ie6/7/8 leak (#7054)4585 if ( data.handle ) {4586 data.handle.elem = null;4587 }4588 }4589 if ( deleteexpando ) {4590 delete elem[ jquery.expando ];4591 } else if ( elem.removeattribute ) {4592 elem.removeattribute( jquery.expando );4593 }4594 delete cache[ id ];4595 }4596 }4597 }4598});4599function evalscript( i, elem ) {4600 if ( elem.src ) {4601 jquery.ajax({4602 url: elem.src,4603 async: false,4604 datatype: "script"4605 });4606 } else {4607 jquery.globaleval( elem.text || elem.textcontent || elem.innerhtml || "" );4608 }4609 if ( elem.parentnode ) {4610 elem.parentnode.removechild( elem );4611 }4612}4613var ralpha = /alpha\([^)]*\)/i,4614 ropacity = /opacity=([^)]*)/,4615 rdashalpha = /-([a-z])/ig,4616 rupper = /([a-z])/g,4617 rnumpx = /^-?\d+(?:px)?$/i,4618 rnum = /^-?\d/,4619 cssshow = { position: "absolute", visibility: "hidden", display: "block" },4620 csswidth = [ "left", "right" ],4621 cssheight = [ "top", "bottom" ],4622 curcss,4623 getcomputedstyle,4624 currentstyle,4625 fcamelcase = function( all, letter ) {4626 return letter.touppercase();4627 };4628jquery.fn.css = function( name, value ) {4629 // setting 'undefined' is a no-op4630 if ( arguments.length === 2 && value === undefined ) {4631 return this;4632 }4633 return jquery.access( this, name, value, true, function( elem, name, value ) {4634 return value !== undefined ?4635 jquery.style( elem, name, value ) :4636 jquery.css( elem, name );4637 });4638};4639jquery.extend({4640 // add in style property hooks for overriding the default4641 // behavior of getting and setting a style property4642 csshooks: {4643 opacity: {4644 get: function( elem, computed ) {4645 if ( computed ) {4646 // we should always get a number back from opacity4647 var ret = curcss( elem, "opacity", "opacity" );4648 return ret === "" ? "1" : ret;4649 } else {4650 return elem.style.opacity;4651 }4652 }4653 }4654 },4655 // exclude the following css properties to add px4656 cssnumber: {4657 "zindex": true,4658 "fontweight": true,4659 "opacity": true,4660 "zoom": true,4661 "lineheight": true4662 },4663 // add in properties whose names you wish to fix before4664 // setting or getting the value4665 cssprops: {4666 // normalize float css property4667 "float": jquery.support.cssfloat ? "cssfloat" : "stylefloat"4668 },4669 // get and set the style property on a dom node4670 style: function( elem, name, value, extra ) {4671 // don't set styles on text and comment nodes4672 if ( !elem || elem.nodetype === 3 || elem.nodetype === 8 || !elem.style ) {4673 return;4674 }4675 // make sure that we're working with the right name4676 var ret, origname = jquery.camelcase( name ),4677 style = elem.style, hooks = jquery.csshooks[ origname ];4678 name = jquery.cssprops[ origname ] || origname;4679 // check if we're setting a value4680 if ( value !== undefined ) {4681 // make sure that nan and null values aren't set. see: #71164682 if ( typeof value === "number" && isnan( value ) || value == null ) {4683 return;4684 }4685 // if a number was passed in, add 'px' to the (except for certain css properties)4686 if ( typeof value === "number" && !jquery.cssnumber[ origname ] ) {4687 value += "px";4688 }4689 // if a hook was provided, use that value, otherwise just set the specified value4690 if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {4691 // wrapped to prevent ie from throwing errors when 'invalid' values are provided4692 // fixes bug #55094693 try {4694 style[ name ] = value;4695 } catch(e) {}4696 }4697 } else {4698 // if a hook was provided get the non-computed value from there4699 if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {4700 return ret;4701 }4702 // otherwise just get the value from the style object4703 return style[ name ];4704 }4705 },4706 css: function( elem, name, extra ) {4707 // make sure that we're working with the right name4708 var ret, origname = jquery.camelcase( name ),4709 hooks = jquery.csshooks[ origname ];4710 name = jquery.cssprops[ origname ] || origname;4711 // if a hook was provided get the computed value from there4712 if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {4713 return ret;4714 // otherwise, if a way to get the computed value exists, use that4715 } else if ( curcss ) {4716 return curcss( elem, name, origname );4717 }4718 },4719 // a method for quickly swapping in/out css properties to get correct calculations4720 swap: function( elem, options, callback ) {4721 var old = {};4722 // remember the old values, and insert the new ones4723 for ( var name in options ) {4724 old[ name ] = elem.style[ name ];4725 elem.style[ name ] = options[ name ];4726 }4727 callback.call( elem );4728 // revert the old values4729 for ( name in options ) {4730 elem.style[ name ] = old[ name ];4731 }4732 },4733 camelcase: function( string ) {4734 return string.replace( rdashalpha, fcamelcase );4735 }4736});4737// deprecated, use jquery.css() instead4738jquery.curcss = jquery.css;4739jquery.each(["height", "width"], function( i, name ) {4740 jquery.csshooks[ name ] = {4741 get: function( elem, computed, extra ) {4742 var val;4743 if ( computed ) {4744 if ( elem.offsetwidth !== 0 ) {4745 val = getwh( elem, name, extra );4746 } else {4747 jquery.swap( elem, cssshow, function() {4748 val = getwh( elem, name, extra );4749 });4750 }4751 if ( val <= 0 ) {4752 val = curcss( elem, name, name );4753 if ( val === "0px" && currentstyle ) {4754 val = currentstyle( elem, name, name );4755 }4756 if ( val != null ) {4757 // should return "auto" instead of 0, use 0 for4758 // temporary backwards-compat4759 return val === "" || val === "auto" ? "0px" : val;4760 }4761 }4762 if ( val < 0 || val == null ) {4763 val = elem.style[ name ];4764 // should return "auto" instead of 0, use 0 for4765 // temporary backwards-compat4766 return val === "" || val === "auto" ? "0px" : val;4767 }4768 return typeof val === "string" ? val : val + "px";4769 }4770 },4771 set: function( elem, value ) {4772 if ( rnumpx.test( value ) ) {4773 // ignore negative width and height values #15994774 value = parsefloat(value);4775 if ( value >= 0 ) {4776 return value + "px";4777 }4778 } else {4779 return value;4780 }4781 }4782 };4783});4784if ( !jquery.support.opacity ) {4785 jquery.csshooks.opacity = {4786 get: function( elem, computed ) {4787 // ie uses filters for opacity4788 return ropacity.test((computed && elem.currentstyle ? elem.currentstyle.filter : elem.style.filter) || "") ?4789 (parsefloat(regexp.$1) / 100) + "" :4790 computed ? "1" : "";4791 },4792 set: function( elem, value ) {4793 var style = elem.style;4794 // ie has trouble with opacity if it does not have layout4795 // force it by setting the zoom level4796 style.zoom = 1;4797 // set the alpha filter to set the opacity4798 var opacity = jquery.isnan(value) ?4799 "" :4800 "alpha(opacity=" + value * 100 + ")",4801 filter = style.filter || "";4802 style.filter = ralpha.test(filter) ?4803 filter.replace(ralpha, opacity) :4804 style.filter + ' ' + opacity;4805 }4806 };4807}4808if ( document.defaultview && document.defaultview.getcomputedstyle ) {4809 getcomputedstyle = function( elem, newname, name ) {4810 var ret, defaultview, computedstyle;4811 name = name.replace( rupper, "-$1" ).tolowercase();4812 if ( !(defaultview = elem.ownerdocument.defaultview) ) {4813 return undefined;4814 }4815 if ( (computedstyle = defaultview.getcomputedstyle( elem, null )) ) {4816 ret = computedstyle.getpropertyvalue( name );4817 if ( ret === "" && !jquery.contains( elem.ownerdocument.documentelement, elem ) ) {4818 ret = jquery.style( elem, name );4819 }4820 }4821 return ret;4822 };4823}4824if ( document.documentelement.currentstyle ) {4825 currentstyle = function( elem, name ) {4826 var left,4827 ret = elem.currentstyle && elem.currentstyle[ name ],4828 rsleft = elem.runtimestyle && elem.runtimestyle[ name ],4829 style = elem.style;4830 // from the awesome hack by dean edwards4831 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-1022914832 // if we're not dealing with a regular pixel number4833 // but a number that has a weird ending, we need to convert it to pixels4834 if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {4835 // remember the original values4836 left = style.left;4837 // put in the new values to get a computed value out4838 if ( rsleft ) {4839 elem.runtimestyle.left = elem.currentstyle.left;4840 }4841 style.left = name === "fontsize" ? "1em" : (ret || 0);4842 ret = style.pixelleft + "px";4843 // revert the changed values4844 style.left = left;4845 if ( rsleft ) {4846 elem.runtimestyle.left = rsleft;4847 }4848 }4849 return ret === "" ? "auto" : ret;4850 };4851}4852curcss = getcomputedstyle || currentstyle;4853function getwh( elem, name, extra ) {4854 var which = name === "width" ? csswidth : cssheight,4855 val = name === "width" ? elem.offsetwidth : elem.offsetheight;4856 if ( extra === "border" ) {4857 return val;4858 }4859 jquery.each( which, function() {4860 if ( !extra ) {4861 val -= parsefloat(jquery.css( elem, "padding" + this )) || 0;4862 }4863 if ( extra === "margin" ) {4864 val += parsefloat(jquery.css( elem, "margin" + this )) || 0;4865 } else {4866 val -= parsefloat(jquery.css( elem, "border" + this + "width" )) || 0;4867 }4868 });4869 return val;4870}4871if ( jquery.expr && jquery.expr.filters ) {4872 jquery.expr.filters.hidden = function( elem ) {4873 var width = elem.offsetwidth,4874 height = elem.offsetheight;4875 return (width === 0 && height === 0) || (!jquery.support.reliablehiddenoffsets && (elem.style.display || jquery.css( elem, "display" )) === "none");4876 };4877 jquery.expr.filters.visible = function( elem ) {4878 return !jquery.expr.filters.hidden( elem );4879 };4880}4881var r20 = /%20/g,4882 rbracket = /\[\]$/,4883 rcrlf = /\r?\n/g,4884 rhash = /#.*$/,4885 rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // ie leaves an \r character at eol4886 rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,4887 // #7653, #8125, #8152: local protocol detection4888 rlocalprotocol = /(?:^file|^widget|\-extension):$/,4889 rnocontent = /^(?:get|head)$/,4890 rprotocol = /^\/\//,4891 rquery = /\?/,4892 rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,4893 rselecttextarea = /^(?:select|textarea)/i,4894 rspacesajax = /\s+/,4895 rts = /([?&])_=[^&]*/,4896 rucheaders = /(^|\-)([a-z])/g,4897 rucheadersfunc = function( _, $1, $2 ) {4898 return $1 + $2.touppercase();4899 },4900 rurl = /^([\w\+\.\-]+:)\/\/([^\/?#:]*)(?::(\d+))?/,4901 // keep a copy of the old load method4902 _load = jquery.fn.load,4903 /* prefilters4904 * 1) they are useful to introduce custom datatypes (see ajax/jsonp.js for an example)4905 * 2) these are called:4906 * - before asking for a transport4907 * - after param serialization (s.data is a string if s.processdata is true)4908 * 3) key is the datatype4909 * 4) the catchall symbol "*" can be used4910 * 5) execution will start with transport datatype and then continue down to "*" if needed4911 */4912 prefilters = {},4913 /* transports bindings4914 * 1) key is the datatype4915 * 2) the catchall symbol "*" can be used4916 * 3) selection will start with transport datatype and then go to "*" if needed4917 */4918 transports = {},4919 // document location4920 ajaxlocation,4921 // document location segments4922 ajaxlocparts;4923// #8138, ie may throw an exception when accessing4924// a field from document.location if document.domain has been set4925try {4926 ajaxlocation = document.location.href;4927} catch( e ) {4928 // use the href attribute of an a element4929 // since ie will modify it given document.location4930 ajaxlocation = document.createelement( "a" );4931 ajaxlocation.href = "";4932 ajaxlocation = ajaxlocation.href;4933}4934// segment location into parts4935ajaxlocparts = rurl.exec( ajaxlocation.tolowercase() );4936// base "constructor" for jquery.ajaxprefilter and jquery.ajaxtransport4937function addtoprefiltersortransports( structure ) {4938 // datatypeexpression is optional and defaults to "*"4939 return function( datatypeexpression, func ) {4940 if ( typeof datatypeexpression !== "string" ) {4941 func = datatypeexpression;4942 datatypeexpression = "*";4943 }4944 if ( jquery.isfunction( func ) ) {4945 var datatypes = datatypeexpression.tolowercase().split( rspacesajax ),4946 i = 0,4947 length = datatypes.length,4948 datatype,4949 list,4950 placebefore;4951 // for each datatype in the datatypeexpression4952 for(; i < length; i++ ) {4953 datatype = datatypes[ i ];4954 // we control if we're asked to add before4955 // any existing element4956 placebefore = /^\+/.test( datatype );4957 if ( placebefore ) {4958 datatype = datatype.substr( 1 ) || "*";4959 }4960 list = structure[ datatype ] = structure[ datatype ] || [];4961 // then we add to the structure accordingly4962 list[ placebefore ? "unshift" : "push" ]( func );4963 }4964 }4965 };4966}4967//base inspection function for prefilters and transports4968function inspectprefiltersortransports( structure, options, originaloptions, jqxhr,4969 datatype /* internal */, inspected /* internal */ ) {4970 datatype = datatype || options.datatypes[ 0 ];4971 inspected = inspected || {};4972 inspected[ datatype ] = true;4973 var list = structure[ datatype ],4974 i = 0,4975 length = list ? list.length : 0,4976 executeonly = ( structure === prefilters ),4977 selection;4978 for(; i < length && ( executeonly || !selection ); i++ ) {4979 selection = list[ i ]( options, originaloptions, jqxhr );4980 // if we got redirected to another datatype4981 // we try there if executing only and not done already4982 if ( typeof selection === "string" ) {4983 if ( !executeonly || inspected[ selection ] ) {4984 selection = undefined;4985 } else {4986 options.datatypes.unshift( selection );4987 selection = inspectprefiltersortransports(4988 structure, options, originaloptions, jqxhr, selection, inspected );4989 }4990 }4991 }4992 // if we're only executing or nothing was selected4993 // we try the catchall datatype if not done already4994 if ( ( executeonly || !selection ) && !inspected[ "*" ] ) {4995 selection = inspectprefiltersortransports(4996 structure, options, originaloptions, jqxhr, "*", inspected );4997 }4998 // unnecessary when only executing (prefilters)4999 // but it'll be ignored by the caller in that case5000 return selection;5001}5002jquery.fn.extend({5003 load: function( url, params, callback ) {5004 if ( typeof url !== "string" && _load ) {5005 return _load.apply( this, arguments );5006 // don't do a request if no elements are being requested5007 } else if ( !this.length ) {5008 return this;5009 }5010 var off = url.indexof( " " );5011 if ( off >= 0 ) {5012 var selector = url.slice( off, url.length );5013 url = url.slice( 0, off );5014 }5015 // default to a get request5016 var type = "get";5017 // if the second parameter was provided5018 if ( params ) {5019 // if it's a function5020 if ( jquery.isfunction( params ) ) {5021 // we assume that it's the callback5022 callback = params;5023 params = undefined;5024 // otherwise, build a param string5025 } else if ( typeof params === "object" ) {5026 params = jquery.param( params, jquery.ajaxsettings.traditional );5027 type = "post";5028 }5029 }5030 var self = this;5031 // request the remote document5032 jquery.ajax({5033 url: url,5034 type: type,5035 datatype: "html",5036 data: params,5037 // complete callback (responsetext is used internally)5038 complete: function( jqxhr, status, responsetext ) {5039 // store the response as specified by the jqxhr object5040 responsetext = jqxhr.responsetext;5041 // if successful, inject the html into all the matched elements5042 if ( jqxhr.isresolved() ) {5043 // #4825: get the actual response in case5044 // a datafilter is present in ajaxsettings5045 jqxhr.done(function( r ) {5046 responsetext = r;5047 });5048 // see if a selector was specified5049 self.html( selector ?5050 // create a dummy div to hold the results5051 jquery("<div>")5052 // inject the contents of the document in, removing the scripts5053 // to avoid any 'permission denied' errors in ie5054 .append(responsetext.replace(rscript, ""))5055 // locate the specified elements5056 .find(selector) :5057 // if not, just inject the full result5058 responsetext );5059 }5060 if ( callback ) {5061 self.each( callback, [ responsetext, status, jqxhr ] );5062 }5063 }5064 });5065 return this;5066 },5067 serialize: function() {5068 return jquery.param( this.serializearray() );5069 },5070 serializearray: function() {5071 return this.map(function(){5072 return this.elements ? jquery.makearray( this.elements ) : this;5073 })5074 .filter(function(){5075 return this.name && !this.disabled &&5076 ( this.checked || rselecttextarea.test( this.nodename ) ||5077 rinput.test( this.type ) );5078 })5079 .map(function( i, elem ){5080 var val = jquery( this ).val();5081 return val == null ?5082 null :5083 jquery.isarray( val ) ?5084 jquery.map( val, function( val, i ){5085 return { name: elem.name, value: val.replace( rcrlf, "\r\n" ) };5086 }) :5087 { name: elem.name, value: val.replace( rcrlf, "\r\n" ) };5088 }).get();5089 }5090});5091// attach a bunch of functions for handling common ajax events5092jquery.each( "ajaxstart ajaxstop ajaxcomplete ajaxerror ajaxsuccess ajaxsend".split( " " ), function( i, o ){5093 jquery.fn[ o ] = function( f ){5094 return this.bind( o, f );5095 };5096} );5097jquery.each( [ "get", "post" ], function( i, method ) {5098 jquery[ method ] = function( url, data, callback, type ) {5099 // shift arguments if data argument was omitted5100 if ( jquery.isfunction( data ) ) {5101 type = type || callback;5102 callback = data;5103 data = undefined;5104 }5105 return jquery.ajax({5106 type: method,5107 url: url,5108 data: data,5109 success: callback,5110 datatype: type5111 });5112 };5113} );5114jquery.extend({5115 getscript: function( url, callback ) {5116 return jquery.get( url, undefined, callback, "script" );5117 },5118 getjson: function( url, data, callback ) {5119 return jquery.get( url, data, callback, "json" );5120 },5121 // creates a full fledged settings object into target5122 // with both ajaxsettings and settings fields.5123 // if target is omitted, writes into ajaxsettings.5124 ajaxsetup: function ( target, settings ) {5125 if ( !settings ) {5126 // only one parameter, we extend ajaxsettings5127 settings = target;5128 target = jquery.extend( true, jquery.ajaxsettings, settings );5129 } else {5130 // target was provided, we extend into it5131 jquery.extend( true, target, jquery.ajaxsettings, settings );5132 }5133 // flatten fields we don't want deep extended5134 for( var field in { context: 1, url: 1 } ) {5135 if ( field in settings ) {5136 target[ field ] = settings[ field ];5137 } else if( field in jquery.ajaxsettings ) {5138 target[ field ] = jquery.ajaxsettings[ field ];5139 }5140 }5141 return target;5142 },5143 ajaxsettings: {5144 url: ajaxlocation,5145 islocal: rlocalprotocol.test( ajaxlocparts[ 1 ] ),5146 global: true,5147 type: "get",5148 contenttype: "application/x-www-form-urlencoded",5149 processdata: true,5150 async: true,5151 /*5152 timeout: 0,5153 data: null,5154 datatype: null,5155 username: null,5156 password: null,5157 cache: null,5158 traditional: false,5159 headers: {},5160 crossdomain: null,5161 */5162 accepts: {5163 xml: "application/xml, text/xml",5164 html: "text/html",5165 text: "text/plain",5166 json: "application/json, text/javascript",5167 "*": "*/*"5168 },5169 contents: {5170 xml: /xml/,5171 html: /html/,5172 json: /json/5173 },5174 responsefields: {5175 xml: "responsexml",5176 text: "responsetext"5177 },5178 // list of data converters5179 // 1) key format is "source_type destination_type" (a single space in-between)5180 // 2) the catchall symbol "*" can be used for source_type5181 converters: {5182 // convert anything to text5183 "* text": window.string,5184 // text to html (true = no transformation)5185 "text html": true,5186 // evaluate text as a json expression5187 "text json": jquery.parsejson,5188 // parse text as xml5189 "text xml": jquery.parsexml5190 }5191 },5192 ajaxprefilter: addtoprefiltersortransports( prefilters ),5193 ajaxtransport: addtoprefiltersortransports( transports ),5194 // main method5195 ajax: function( url, options ) {5196 // if url is an object, simulate pre-1.5 signature5197 if ( typeof url === "object" ) {5198 options = url;5199 url = undefined;5200 }5201 // force options to be an object5202 options = options || {};5203 var // create the final options object5204 s = jquery.ajaxsetup( {}, options ),5205 // callbacks context5206 callbackcontext = s.context || s,5207 // context for global events5208 // it's the callbackcontext if one was provided in the options5209 // and if it's a dom node or a jquery collection5210 globaleventcontext = callbackcontext !== s &&5211 ( callbackcontext.nodetype || callbackcontext instanceof jquery ) ?5212 jquery( callbackcontext ) : jquery.event,5213 // deferreds5214 deferred = jquery.deferred(),5215 completedeferred = jquery._deferred(),5216 // status-dependent callbacks5217 statuscode = s.statuscode || {},5218 // ifmodified key5219 ifmodifiedkey,5220 // headers (they are sent all at once)5221 requestheaders = {},5222 // response headers5223 responseheadersstring,5224 responseheaders,5225 // transport5226 transport,5227 // timeout handle5228 timeouttimer,5229 // cross-domain detection vars5230 parts,5231 // the jqxhr state5232 state = 0,5233 // to know if global events are to be dispatched5234 fireglobals,5235 // loop variable5236 i,5237 // fake xhr5238 jqxhr = {5239 readystate: 0,5240 // caches the header5241 setrequestheader: function( name, value ) {5242 if ( !state ) {5243 requestheaders[ name.tolowercase().replace( rucheaders, rucheadersfunc ) ] = value;5244 }5245 return this;5246 },5247 // raw string5248 getallresponseheaders: function() {5249 return state === 2 ? responseheadersstring : null;5250 },5251 // builds headers hashtable if needed5252 getresponseheader: function( key ) {5253 var match;5254 if ( state === 2 ) {5255 if ( !responseheaders ) {5256 responseheaders = {};5257 while( ( match = rheaders.exec( responseheadersstring ) ) ) {5258 responseheaders[ match[1].tolowercase() ] = match[ 2 ];5259 }5260 }5261 match = responseheaders[ key.tolowercase() ];5262 }5263 return match === undefined ? null : match;5264 },5265 // overrides response content-type header5266 overridemimetype: function( type ) {5267 if ( !state ) {5268 s.mimetype = type;5269 }5270 return this;5271 },5272 // cancel the request5273 abort: function( statustext ) {5274 statustext = statustext || "abort";5275 if ( transport ) {5276 transport.abort( statustext );5277 }5278 done( 0, statustext );5279 return this;5280 }5281 };5282 // callback for when everything is done5283 // it is defined here because jslint complains if it is declared5284 // at the end of the function (which would be more logical and readable)5285 function done( status, statustext, responses, headers ) {5286 // called once5287 if ( state === 2 ) {5288 return;5289 }5290 // state is "done" now5291 state = 2;5292 // clear timeout if it exists5293 if ( timeouttimer ) {5294 cleartimeout( timeouttimer );5295 }5296 // dereference transport for early garbage collection5297 // (no matter how long the jqxhr object will be used)5298 transport = undefined;5299 // cache response headers5300 responseheadersstring = headers || "";5301 // set readystate5302 jqxhr.readystate = status ? 4 : 0;5303 var issuccess,5304 success,5305 error,5306 response = responses ? ajaxhandleresponses( s, jqxhr, responses ) : undefined,5307 lastmodified,5308 etag;5309 // if successful, handle type chaining5310 if ( status >= 200 && status < 300 || status === 304 ) {5311 // set the if-modified-since and/or if-none-match header, if in ifmodified mode.5312 if ( s.ifmodified ) {5313 if ( ( lastmodified = jqxhr.getresponseheader( "last-modified" ) ) ) {5314 jquery.lastmodified[ ifmodifiedkey ] = lastmodified;5315 }5316 if ( ( etag = jqxhr.getresponseheader( "etag" ) ) ) {5317 jquery.etag[ ifmodifiedkey ] = etag;5318 }5319 }5320 // if not modified5321 if ( status === 304 ) {5322 statustext = "notmodified";5323 issuccess = true;5324 // if we have data5325 } else {5326 try {5327 success = ajaxconvert( s, response );5328 statustext = "success";5329 issuccess = true;5330 } catch(e) {5331 // we have a parsererror5332 statustext = "parsererror";5333 error = e;5334 }5335 }5336 } else {5337 // we extract error from statustext5338 // then normalize statustext and status for non-aborts5339 error = statustext;5340 if( !statustext || status ) {5341 statustext = "error";5342 if ( status < 0 ) {5343 status = 0;5344 }5345 }5346 }5347 // set data for the fake xhr object5348 jqxhr.status = status;5349 jqxhr.statustext = statustext;5350 // success/error5351 if ( issuccess ) {5352 deferred.resolvewith( callbackcontext, [ success, statustext, jqxhr ] );5353 } else {5354 deferred.rejectwith( callbackcontext, [ jqxhr, statustext, error ] );5355 }5356 // status-dependent callbacks5357 jqxhr.statuscode( statuscode );5358 statuscode = undefined;5359 if ( fireglobals ) {5360 globaleventcontext.trigger( "ajax" + ( issuccess ? "success" : "error" ),5361 [ jqxhr, s, issuccess ? success : error ] );5362 }5363 // complete5364 completedeferred.resolvewith( callbackcontext, [ jqxhr, statustext ] );5365 if ( fireglobals ) {5366 globaleventcontext.trigger( "ajaxcomplete", [ jqxhr, s] );5367 // handle the global ajax counter5368 if ( !( --jquery.active ) ) {5369 jquery.event.trigger( "ajaxstop" );5370 }5371 }5372 }5373 // attach deferreds5374 deferred.promise( jqxhr );5375 jqxhr.success = jqxhr.done;5376 jqxhr.error = jqxhr.fail;5377 jqxhr.complete = completedeferred.done;5378 // status-dependent callbacks5379 jqxhr.statuscode = function( map ) {5380 if ( map ) {5381 var tmp;5382 if ( state < 2 ) {5383 for( tmp in map ) {5384 statuscode[ tmp ] = [ statuscode[tmp], map[tmp] ];5385 }5386 } else {5387 tmp = map[ jqxhr.status ];5388 jqxhr.then( tmp, tmp );5389 }5390 }5391 return this;5392 };5393 // remove hash character (#7531: and string promotion)5394 // add protocol if not provided (#5866: ie7 issue with protocol-less urls)5395 // we also use the url parameter if available5396 s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxlocparts[ 1 ] + "//" );5397 // extract datatypes list5398 s.datatypes = jquery.trim( s.datatype || "*" ).tolowercase().split( rspacesajax );5399 // determine if a cross-domain request is in order5400 if ( !s.crossdomain ) {5401 parts = rurl.exec( s.url.tolowercase() );5402 s.crossdomain = !!( parts &&5403 ( parts[ 1 ] != ajaxlocparts[ 1 ] || parts[ 2 ] != ajaxlocparts[ 2 ] ||5404 ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=5405 ( ajaxlocparts[ 3 ] || ( ajaxlocparts[ 1 ] === "http:" ? 80 : 443 ) ) )5406 );5407 }5408 // convert data if not already a string5409 if ( s.data && s.processdata && typeof s.data !== "string" ) {5410 s.data = jquery.param( s.data, s.traditional );5411 }5412 // apply prefilters5413 inspectprefiltersortransports( prefilters, s, options, jqxhr );5414 // if request was aborted inside a prefiler, stop there5415 if ( state === 2 ) {5416 return false;5417 }5418 // we can fire global events as of now if asked to5419 fireglobals = s.global;5420 // uppercase the type5421 s.type = s.type.touppercase();5422 // determine if request has content5423 s.hascontent = !rnocontent.test( s.type );5424 // watch for a new set of requests5425 if ( fireglobals && jquery.active++ === 0 ) {5426 jquery.event.trigger( "ajaxstart" );5427 }5428 // more options handling for requests with no content5429 if ( !s.hascontent ) {5430 // if data is available, append data to url5431 if ( s.data ) {5432 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;5433 }5434 // get ifmodifiedkey before adding the anti-cache parameter5435 ifmodifiedkey = s.url;5436 // add anti-cache in url if needed5437 if ( s.cache === false ) {5438 var ts = jquery.now(),5439 // try replacing _= if it is there5440 ret = s.url.replace( rts, "$1_=" + ts );5441 // if nothing was replaced, add timestamp to the end5442 s.url = ret + ( (ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );5443 }5444 }5445 // set the correct header, if data is being sent5446 if ( s.data && s.hascontent && s.contenttype !== false || options.contenttype ) {5447 requestheaders[ "content-type" ] = s.contenttype;5448 }5449 // set the if-modified-since and/or if-none-match header, if in ifmodified mode.5450 if ( s.ifmodified ) {5451 ifmodifiedkey = ifmodifiedkey || s.url;5452 if ( jquery.lastmodified[ ifmodifiedkey ] ) {5453 requestheaders[ "if-modified-since" ] = jquery.lastmodified[ ifmodifiedkey ];5454 }5455 if ( jquery.etag[ ifmodifiedkey ] ) {5456 requestheaders[ "if-none-match" ] = jquery.etag[ ifmodifiedkey ];5457 }5458 }5459 // set the accepts header for the server, depending on the datatype5460 requestheaders.accept = s.datatypes[ 0 ] && s.accepts[ s.datatypes[0] ] ?5461 s.accepts[ s.datatypes[0] ] + ( s.datatypes[ 0 ] !== "*" ? ", */*; q=0.01" : "" ) :5462 s.accepts[ "*" ];5463 // check for headers option5464 for ( i in s.headers ) {5465 jqxhr.setrequestheader( i, s.headers[ i ] );5466 }5467 // allow custom headers/mimetypes and early abort5468 if ( s.beforesend && ( s.beforesend.call( callbackcontext, jqxhr, s ) === false || state === 2 ) ) {5469 // abort if not done already5470 jqxhr.abort();5471 return false;5472 }5473 // install callbacks on deferreds5474 for ( i in { success: 1, error: 1, complete: 1 } ) {5475 jqxhr[ i ]( s[ i ] );5476 }5477 // get transport5478 transport = inspectprefiltersortransports( transports, s, options, jqxhr );5479 // if no transport, we auto-abort5480 if ( !transport ) {5481 done( -1, "no transport" );5482 } else {5483 jqxhr.readystate = 1;5484 // send global event5485 if ( fireglobals ) {5486 globaleventcontext.trigger( "ajaxsend", [ jqxhr, s ] );5487 }5488 // timeout5489 if ( s.async && s.timeout > 0 ) {5490 timeouttimer = settimeout( function(){5491 jqxhr.abort( "timeout" );5492 }, s.timeout );5493 }5494 try {5495 state = 1;5496 transport.send( requestheaders, done );5497 } catch (e) {5498 // propagate exception as error if not done5499 if ( status < 2 ) {5500 done( -1, e );5501 // simply rethrow otherwise5502 } else {5503 jquery.error( e );5504 }5505 }5506 }5507 return jqxhr;5508 },5509 // serialize an array of form elements or a set of5510 // key/values into a query string5511 param: function( a, traditional ) {5512 var s = [],5513 add = function( key, value ) {5514 // if value is a function, invoke it and return its value5515 value = jquery.isfunction( value ) ? value() : value;5516 s[ s.length ] = encodeuricomponent( key ) + "=" + encodeuricomponent( value );5517 };5518 // set traditional to true for jquery <= 1.3.2 behavior.5519 if ( traditional === undefined ) {5520 traditional = jquery.ajaxsettings.traditional;5521 }5522 // if an array was passed in, assume that it is an array of form elements.5523 if ( jquery.isarray( a ) || ( a.jquery && !jquery.isplainobject( a ) ) ) {5524 // serialize the form elements5525 jquery.each( a, function() {5526 add( this.name, this.value );5527 } );5528 } else {5529 // if traditional, encode the "old" way (the way 1.3.2 or older5530 // did it), otherwise encode params recursively.5531 for ( var prefix in a ) {5532 buildparams( prefix, a[ prefix ], traditional, add );5533 }5534 }5535 // return the resulting serialization5536 return s.join( "&" ).replace( r20, "+" );5537 }5538});5539function buildparams( prefix, obj, traditional, add ) {5540 if ( jquery.isarray( obj ) && obj.length ) {5541 // serialize array item.5542 jquery.each( obj, function( i, v ) {5543 if ( traditional || rbracket.test( prefix ) ) {5544 // treat each array item as a scalar.5545 add( prefix, v );5546 } else {5547 // if array item is non-scalar (array or object), encode its5548 // numeric index to resolve deserialization ambiguity issues.5549 // note that rack (as of 1.0.0) can't currently deserialize5550 // nested arrays properly, and attempting to do so may cause5551 // a server error. possible fixes are to modify rack's5552 // deserialization algorithm or to provide an option or flag5553 // to force array serialization to be shallow.5554 buildparams( prefix + "[" + ( typeof v === "object" || jquery.isarray(v) ? i : "" ) + "]", v, traditional, add );5555 }5556 });5557 } else if ( !traditional && obj != null && typeof obj === "object" ) {5558 // if we see an array here, it is empty and should be treated as an empty5559 // object5560 if ( jquery.isarray( obj ) || jquery.isemptyobject( obj ) ) {5561 add( prefix, "" );5562 // serialize object item.5563 } else {5564 for ( var name in obj ) {5565 buildparams( prefix + "[" + name + "]", obj[ name ], traditional, add );5566 }5567 }5568 } else {5569 // serialize scalar item.5570 add( prefix, obj );5571 }5572}5573// this is still on the jquery object... for now5574// want to move this to jquery.ajax some day5575jquery.extend({5576 // counter for holding the number of active queries5577 active: 0,5578 // last-modified header cache for next request5579 lastmodified: {},5580 etag: {}5581});5582/* handles responses to an ajax request:5583 * - sets all responsexxx fields accordingly5584 * - finds the right datatype (mediates between content-type and expected datatype)5585 * - returns the corresponding response5586 */5587function ajaxhandleresponses( s, jqxhr, responses ) {5588 var contents = s.contents,5589 datatypes = s.datatypes,5590 responsefields = s.responsefields,5591 ct,5592 type,5593 finaldatatype,5594 firstdatatype;5595 // fill responsexxx fields5596 for( type in responsefields ) {5597 if ( type in responses ) {5598 jqxhr[ responsefields[type] ] = responses[ type ];5599 }5600 }5601 // remove auto datatype and get content-type in the process5602 while( datatypes[ 0 ] === "*" ) {5603 datatypes.shift();5604 if ( ct === undefined ) {5605 ct = s.mimetype || jqxhr.getresponseheader( "content-type" );5606 }5607 }5608 // check if we're dealing with a known content-type5609 if ( ct ) {5610 for ( type in contents ) {5611 if ( contents[ type ] && contents[ type ].test( ct ) ) {5612 datatypes.unshift( type );5613 break;5614 }5615 }5616 }5617 // check to see if we have a response for the expected datatype5618 if ( datatypes[ 0 ] in responses ) {5619 finaldatatype = datatypes[ 0 ];5620 } else {5621 // try convertible datatypes5622 for ( type in responses ) {5623 if ( !datatypes[ 0 ] || s.converters[ type + " " + datatypes[0] ] ) {5624 finaldatatype = type;5625 break;5626 }5627 if ( !firstdatatype ) {5628 firstdatatype = type;5629 }5630 }5631 // or just use first one5632 finaldatatype = finaldatatype || firstdatatype;5633 }5634 // if we found a datatype5635 // we add the datatype to the list if needed5636 // and return the corresponding response5637 if ( finaldatatype ) {5638 if ( finaldatatype !== datatypes[ 0 ] ) {5639 datatypes.unshift( finaldatatype );5640 }5641 return responses[ finaldatatype ];5642 }5643}5644// chain conversions given the request and the original response5645function ajaxconvert( s, response ) {5646 // apply the datafilter if provided5647 if ( s.datafilter ) {5648 response = s.datafilter( response, s.datatype );5649 }5650 var datatypes = s.datatypes,5651 converters = {},5652 i,5653 key,5654 length = datatypes.length,5655 tmp,5656 // current and previous datatypes5657 current = datatypes[ 0 ],5658 prev,5659 // conversion expression5660 conversion,5661 // conversion function5662 conv,5663 // conversion functions (transitive conversion)5664 conv1,5665 conv2;5666 // for each datatype in the chain5667 for( i = 1; i < length; i++ ) {5668 // create converters map5669 // with lowercased keys5670 if ( i === 1 ) {5671 for( key in s.converters ) {5672 if( typeof key === "string" ) {5673 converters[ key.tolowercase() ] = s.converters[ key ];5674 }5675 }5676 }5677 // get the datatypes5678 prev = current;5679 current = datatypes[ i ];5680 // if current is auto datatype, update it to prev5681 if( current === "*" ) {5682 current = prev;5683 // if no auto and datatypes are actually different5684 } else if ( prev !== "*" && prev !== current ) {5685 // get the converter5686 conversion = prev + " " + current;5687 conv = converters[ conversion ] || converters[ "* " + current ];5688 // if there is no direct converter, search transitively5689 if ( !conv ) {5690 conv2 = undefined;5691 for( conv1 in converters ) {5692 tmp = conv1.split( " " );5693 if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {5694 conv2 = converters[ tmp[1] + " " + current ];5695 if ( conv2 ) {5696 conv1 = converters[ conv1 ];5697 if ( conv1 === true ) {5698 conv = conv2;5699 } else if ( conv2 === true ) {5700 conv = conv1;5701 }5702 break;5703 }5704 }5705 }5706 }5707 // if we found no converter, dispatch an error5708 if ( !( conv || conv2 ) ) {5709 jquery.error( "no conversion from " + conversion.replace(" "," to ") );5710 }5711 // if found converter is not an equivalence5712 if ( conv !== true ) {5713 // convert with 1 or 2 converters accordingly5714 response = conv ? conv( response ) : conv2( conv1(response) );5715 }5716 }5717 }5718 return response;5719}5720var jsc = jquery.now(),5721 jsre = /(\=)\?(&|$)|()\?\?()/i;5722// default jsonp settings5723jquery.ajaxsetup({5724 jsonp: "callback",5725 jsonpcallback: function() {5726 return jquery.expando + "_" + ( jsc++ );5727 }5728});5729// detect, normalize options and install callbacks for jsonp requests5730jquery.ajaxprefilter( "json jsonp", function( s, originalsettings, jqxhr ) {5731 var dataisstring = ( typeof s.data === "string" );5732 if ( s.datatypes[ 0 ] === "jsonp" ||5733 originalsettings.jsonpcallback ||5734 originalsettings.jsonp != null ||5735 s.jsonp !== false && ( jsre.test( s.url ) ||5736 dataisstring && jsre.test( s.data ) ) ) {5737 var responsecontainer,5738 jsonpcallback = s.jsonpcallback =5739 jquery.isfunction( s.jsonpcallback ) ? s.jsonpcallback() : s.jsonpcallback,5740 previous = window[ jsonpcallback ],5741 url = s.url,5742 data = s.data,5743 replace = "$1" + jsonpcallback + "$2",5744 cleanup = function() {5745 // set callback back to previous value5746 window[ jsonpcallback ] = previous;5747 // call if it was a function and we have a response5748 if ( responsecontainer && jquery.isfunction( previous ) ) {5749 window[ jsonpcallback ]( responsecontainer[ 0 ] );5750 }5751 };5752 if ( s.jsonp !== false ) {5753 url = url.replace( jsre, replace );5754 if ( s.url === url ) {5755 if ( dataisstring ) {5756 data = data.replace( jsre, replace );5757 }5758 if ( s.data === data ) {5759 // add callback manually5760 url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpcallback;5761 }5762 }5763 }5764 s.url = url;5765 s.data = data;5766 // install callback5767 window[ jsonpcallback ] = function( response ) {5768 responsecontainer = [ response ];5769 };5770 // install cleanup function5771 jqxhr.then( cleanup, cleanup );5772 // use data converter to retrieve json after script execution5773 s.converters["script json"] = function() {5774 if ( !responsecontainer ) {5775 jquery.error( jsonpcallback + " was not called" );5776 }5777 return responsecontainer[ 0 ];5778 };5779 // force json datatype5780 s.datatypes[ 0 ] = "json";5781 // delegate to script5782 return "script";5783 }5784} );5785// install script datatype5786jquery.ajaxsetup({5787 accepts: {5788 script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"5789 },5790 contents: {5791 script: /javascript|ecmascript/5792 },5793 converters: {5794 "text script": function( text ) {5795 jquery.globaleval( text );5796 return text;5797 }5798 }5799});5800// handle cache's special case and global5801jquery.ajaxprefilter( "script", function( s ) {5802 if ( s.cache === undefined ) {5803 s.cache = false;5804 }5805 if ( s.crossdomain ) {5806 s.type = "get";5807 s.global = false;5808 }5809} );5810// bind script tag hack transport5811jquery.ajaxtransport( "script", function(s) {5812 // this transport only deals with cross domain requests5813 if ( s.crossdomain ) {5814 var script,5815 head = document.head || document.getelementsbytagname( "head" )[0] || document.documentelement;5816 return {5817 send: function( _, callback ) {5818 script = document.createelement( "script" );5819 script.async = "async";5820 if ( s.scriptcharset ) {5821 script.charset = s.scriptcharset;5822 }5823 script.src = s.url;5824 // attach handlers for all browsers5825 script.onload = script.onreadystatechange = function( _, isabort ) {5826 if ( !script.readystate || /loaded|complete/.test( script.readystate ) ) {5827 // handle memory leak in ie5828 script.onload = script.onreadystatechange = null;5829 // remove the script5830 if ( head && script.parentnode ) {5831 head.removechild( script );5832 }5833 // dereference the script5834 script = undefined;5835 // callback if not abort5836 if ( !isabort ) {5837 callback( 200, "success" );5838 }5839 }5840 };5841 // use insertbefore instead of appendchild to circumvent an ie6 bug.5842 // this arises when a base node is used (#2709 and #4378).5843 head.insertbefore( script, head.firstchild );5844 },5845 abort: function() {5846 if ( script ) {5847 script.onload( 0, 1 );5848 }5849 }5850 };5851 }5852} );5853var // #5280: next active xhr id and list of active xhrs' callbacks5854 xhrid = jquery.now(),5855 xhrcallbacks,5856 // xhr used to determine supports properties5857 testxhr;5858// #5280: internet explorer will keep connections alive if we don't abort on unload5859function xhronunloadabort() {5860 jquery( window ).unload(function() {5861 // abort all pending requests5862 for ( var key in xhrcallbacks ) {5863 xhrcallbacks[ key ]( 0, 1 );5864 }5865 });5866}5867// functions to create xhrs5868function createstandardxhr() {5869 try {5870 return new window.xmlhttprequest();5871 } catch( e ) {}5872}5873function createactivexhr() {5874 try {5875 return new window.activexobject( "microsoft.xmlhttp" );5876 } catch( e ) {}5877}5878// create the request object5879// (this is still attached to ajaxsettings for backward compatibility)5880jquery.ajaxsettings.xhr = window.activexobject ?5881 /* microsoft failed to properly5882 * implement the xmlhttprequest in ie7 (can't request local files),5883 * so we use the activexobject when it is available5884 * additionally xmlhttprequest can be disabled in ie7/ie8 so5885 * we need a fallback.5886 */5887 function() {5888 return !this.islocal && createstandardxhr() || createactivexhr();5889 } :5890 // for all other browsers, use the standard xmlhttprequest object5891 createstandardxhr;5892// test if we can create an xhr object5893testxhr = jquery.ajaxsettings.xhr();5894jquery.support.ajax = !!testxhr;5895// does this browser support crossdomain xhr requests5896jquery.support.cors = testxhr && ( "withcredentials" in testxhr );5897// no need for the temporary xhr anymore5898testxhr = undefined;5899// create transport if the browser can provide an xhr5900if ( jquery.support.ajax ) {5901 jquery.ajaxtransport(function( s ) {5902 // cross domain only allowed if supported through xmlhttprequest5903 if ( !s.crossdomain || jquery.support.cors ) {5904 var callback;5905 return {5906 send: function( headers, complete ) {5907 // get a new xhr5908 var xhr = s.xhr(),5909 handle,5910 i;5911 // open the socket5912 // passing null username, generates a login popup on opera (#2865)5913 if ( s.username ) {5914 xhr.open( s.type, s.url, s.async, s.username, s.password );5915 } else {5916 xhr.open( s.type, s.url, s.async );5917 }5918 // apply custom fields if provided5919 if ( s.xhrfields ) {5920 for ( i in s.xhrfields ) {5921 xhr[ i ] = s.xhrfields[ i ];5922 }5923 }5924 // override mime type if needed5925 if ( s.mimetype && xhr.overridemimetype ) {5926 xhr.overridemimetype( s.mimetype );5927 }5928 // requested-with header5929 // not set for crossdomain requests with no content5930 // (see why at http://trac.dojotoolkit.org/ticket/9486)5931 // won't change header if already provided5932 if ( !( s.crossdomain && !s.hascontent ) && !headers["x-requested-with"] ) {5933 headers[ "x-requested-with" ] = "xmlhttprequest";5934 }5935 // need an extra try/catch for cross domain requests in firefox 35936 try {5937 for ( i in headers ) {5938 xhr.setrequestheader( i, headers[ i ] );5939 }5940 } catch( _ ) {}5941 // do send the request5942 // this may raise an exception which is actually5943 // handled in jquery.ajax (so no try/catch here)5944 xhr.send( ( s.hascontent && s.data ) || null );5945 // listener5946 callback = function( _, isabort ) {5947 var status,5948 statustext,5949 responseheaders,5950 responses,5951 xml;5952 // firefox throws exceptions when accessing properties5953 // of an xhr when a network error occured5954 // http://helpful.knobs-dials.com/index.php/component_returned_failure_code:_0x80040111_(ns_error_not_available)5955 try {5956 // was never called and is aborted or complete5957 if ( callback && ( isabort || xhr.readystate === 4 ) ) {5958 // only called once5959 callback = undefined;5960 // do not keep as active anymore5961 if ( handle ) {5962 xhr.onreadystatechange = jquery.noop;5963 delete xhrcallbacks[ handle ];5964 }5965 // if it's an abort5966 if ( isabort ) {5967 // abort it manually if needed5968 if ( xhr.readystate !== 4 ) {5969 xhr.abort();5970 }5971 } else {5972 status = xhr.status;5973 responseheaders = xhr.getallresponseheaders();5974 responses = {};5975 xml = xhr.responsexml;5976 // construct response list5977 if ( xml && xml.documentelement /* #4958 */ ) {5978 responses.xml = xml;5979 }5980 responses.text = xhr.responsetext;5981 // firefox throws an exception when accessing5982 // statustext for faulty cross-domain requests5983 try {5984 statustext = xhr.statustext;5985 } catch( e ) {5986 // we normalize with webkit giving an empty statustext5987 statustext = "";5988 }5989 // filter status for non standard behaviors5990 // if the request is local and we have data: assume a success5991 // (success with no data won't get notified, that's the best we5992 // can do given current implementations)5993 if ( !status && s.islocal && !s.crossdomain ) {5994 status = responses.text ? 200 : 404;5995 // ie - #1450: sometimes returns 1223 when it should be 2045996 } else if ( status === 1223 ) {5997 status = 204;5998 }5999 }6000 }6001 } catch( firefoxaccessexception ) {6002 if ( !isabort ) {6003 complete( -1, firefoxaccessexception );6004 }6005 }6006 // call complete if needed6007 if ( responses ) {6008 complete( status, statustext, responses, responseheaders );6009 }6010 };6011 // if we're in sync mode or it's in cache6012 // and has been retrieved directly (ie6 & ie7)6013 // we need to manually fire the callback6014 if ( !s.async || xhr.readystate === 4 ) {6015 callback();6016 } else {6017 // create the active xhrs callbacks list if needed6018 // and attach the unload handler6019 if ( !xhrcallbacks ) {6020 xhrcallbacks = {};6021 xhronunloadabort();6022 }6023 // add to list of active xhrs callbacks6024 handle = xhrid++;6025 xhr.onreadystatechange = xhrcallbacks[ handle ] = callback;6026 }6027 },6028 abort: function() {6029 if ( callback ) {6030 callback(0,1);6031 }6032 }6033 };6034 }6035 });6036}6037var elemdisplay = {},6038 rfxtypes = /^(?:toggle|show|hide)$/,6039 rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,6040 timerid,6041 fxattrs = [6042 // height animations6043 [ "height", "margintop", "marginbottom", "paddingtop", "paddingbottom" ],6044 // width animations6045 [ "width", "marginleft", "marginright", "paddingleft", "paddingright" ],6046 // opacity animations6047 [ "opacity" ]6048 ];6049jquery.fn.extend({6050 show: function( speed, easing, callback ) {6051 var elem, display;6052 if ( speed || speed === 0 ) {6053 return this.animate( genfx("show", 3), speed, easing, callback);6054 } else {6055 for ( var i = 0, j = this.length; i < j; i++ ) {6056 elem = this[i];6057 display = elem.style.display;6058 // reset the inline display of this element to learn if it is6059 // being hidden by cascaded rules or not6060 if ( !jquery._data(elem, "olddisplay") && display === "none" ) {6061 display = elem.style.display = "";6062 }6063 // set elements which have been overridden with display: none6064 // in a stylesheet to whatever the default browser style is6065 // for such an element6066 if ( display === "" && jquery.css( elem, "display" ) === "none" ) {6067 jquery._data(elem, "olddisplay", defaultdisplay(elem.nodename));6068 }6069 }6070 // set the display of most of the elements in a second loop6071 // to avoid the constant reflow6072 for ( i = 0; i < j; i++ ) {6073 elem = this[i];6074 display = elem.style.display;6075 if ( display === "" || display === "none" ) {6076 elem.style.display = jquery._data(elem, "olddisplay") || "";6077 }6078 }6079 return this;6080 }6081 },6082 hide: function( speed, easing, callback ) {6083 if ( speed || speed === 0 ) {6084 return this.animate( genfx("hide", 3), speed, easing, callback);6085 } else {6086 for ( var i = 0, j = this.length; i < j; i++ ) {6087 var display = jquery.css( this[i], "display" );6088 if ( display !== "none" && !jquery._data( this[i], "olddisplay" ) ) {6089 jquery._data( this[i], "olddisplay", display );6090 }6091 }6092 // set the display of the elements in a second loop6093 // to avoid the constant reflow6094 for ( i = 0; i < j; i++ ) {6095 this[i].style.display = "none";6096 }6097 return this;6098 }6099 },6100 // save the old toggle function6101 _toggle: jquery.fn.toggle,6102 toggle: function( fn, fn2, callback ) {6103 var bool = typeof fn === "boolean";6104 if ( jquery.isfunction(fn) && jquery.isfunction(fn2) ) {6105 this._toggle.apply( this, arguments );6106 } else if ( fn == null || bool ) {6107 this.each(function() {6108 var state = bool ? fn : jquery(this).is(":hidden");6109 jquery(this)[ state ? "show" : "hide" ]();6110 });6111 } else {6112 this.animate(genfx("toggle", 3), fn, fn2, callback);6113 }6114 return this;6115 },6116 fadeto: function( speed, to, easing, callback ) {6117 return this.filter(":hidden").css("opacity", 0).show().end()6118 .animate({opacity: to}, speed, easing, callback);6119 },6120 animate: function( prop, speed, easing, callback ) {6121 var optall = jquery.speed(speed, easing, callback);6122 if ( jquery.isemptyobject( prop ) ) {6123 return this.each( optall.complete );6124 }6125 return this[ optall.queue === false ? "each" : "queue" ](function() {6126 // xxx 'this' does not always have a nodename when running the6127 // test suite6128 var opt = jquery.extend({}, optall), p,6129 iselement = this.nodetype === 1,6130 hidden = iselement && jquery(this).is(":hidden"),6131 self = this;6132 for ( p in prop ) {6133 var name = jquery.camelcase( p );6134 if ( p !== name ) {6135 prop[ name ] = prop[ p ];6136 delete prop[ p ];6137 p = name;6138 }6139 if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) {6140 return opt.complete.call(this);6141 }6142 if ( iselement && ( p === "height" || p === "width" ) ) {6143 // make sure that nothing sneaks out6144 // record all 3 overflow attributes because ie does not6145 // change the overflow attribute when overflowx and6146 // overflowy are set to the same value6147 opt.overflow = [ this.style.overflow, this.style.overflowx, this.style.overflowy ];6148 // set display property to inline-block for height/width6149 // animations on inline elements that are having width/height6150 // animated6151 if ( jquery.css( this, "display" ) === "inline" &&6152 jquery.css( this, "float" ) === "none" ) {6153 if ( !jquery.support.inlineblockneedslayout ) {6154 this.style.display = "inline-block";6155 } else {6156 var display = defaultdisplay(this.nodename);6157 // inline-level elements accept inline-block;6158 // block-level elements need to be inline with layout6159 if ( display === "inline" ) {6160 this.style.display = "inline-block";6161 } else {6162 this.style.display = "inline";6163 this.style.zoom = 1;6164 }6165 }6166 }6167 }6168 if ( jquery.isarray( prop[p] ) ) {6169 // create (if needed) and add to specialeasing6170 (opt.specialeasing = opt.specialeasing || {})[p] = prop[p][1];6171 prop[p] = prop[p][0];6172 }6173 }6174 if ( opt.overflow != null ) {6175 this.style.overflow = "hidden";6176 }6177 opt.curanim = jquery.extend({}, prop);6178 jquery.each( prop, function( name, val ) {6179 var e = new jquery.fx( self, opt, name );6180 if ( rfxtypes.test(val) ) {6181 e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop );6182 } else {6183 var parts = rfxnum.exec(val),6184 start = e.cur();6185 if ( parts ) {6186 var end = parsefloat( parts[2] ),6187 unit = parts[3] || ( jquery.cssnumber[ name ] ? "" : "px" );6188 // we need to compute starting value6189 if ( unit !== "px" ) {6190 jquery.style( self, name, (end || 1) + unit);6191 start = ((end || 1) / e.cur()) * start;6192 jquery.style( self, name, start + unit);6193 }6194 // if a +=/-= token was provided, we're doing a relative animation6195 if ( parts[1] ) {6196 end = ((parts[1] === "-=" ? -1 : 1) * end) + start;6197 }6198 e.custom( start, end, unit );6199 } else {6200 e.custom( start, val, "" );6201 }6202 }6203 });6204 // for js strict compliance6205 return true;6206 });6207 },6208 stop: function( clearqueue, gotoend ) {6209 var timers = jquery.timers;6210 if ( clearqueue ) {6211 this.queue([]);6212 }6213 this.each(function() {6214 // go in reverse order so anything added to the queue during the loop is ignored6215 for ( var i = timers.length - 1; i >= 0; i-- ) {6216 if ( timers[i].elem === this ) {6217 if (gotoend) {6218 // force the next step to be the last6219 timers[i](true);6220 }6221 timers.splice(i, 1);6222 }6223 }6224 });6225 // start the next in the queue if the last step wasn't forced6226 if ( !gotoend ) {6227 this.dequeue();6228 }6229 return this;6230 }6231});6232function genfx( type, num ) {6233 var obj = {};6234 jquery.each( fxattrs.concat.apply([], fxattrs.slice(0,num)), function() {6235 obj[ this ] = type;6236 });6237 return obj;6238}6239// generate shortcuts for custom animations6240jquery.each({6241 slidedown: genfx("show", 1),6242 slideup: genfx("hide", 1),6243 slidetoggle: genfx("toggle", 1),6244 fadein: { opacity: "show" },6245 fadeout: { opacity: "hide" },6246 fadetoggle: { opacity: "toggle" }6247}, function( name, props ) {6248 jquery.fn[ name ] = function( speed, easing, callback ) {6249 return this.animate( props, speed, easing, callback );6250 };6251});6252jquery.extend({6253 speed: function( speed, easing, fn ) {6254 var opt = speed && typeof speed === "object" ? jquery.extend({}, speed) : {6255 complete: fn || !fn && easing ||6256 jquery.isfunction( speed ) && speed,6257 duration: speed,6258 easing: fn && easing || easing && !jquery.isfunction(easing) && easing6259 };6260 opt.duration = jquery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :6261 opt.duration in jquery.fx.speeds ? jquery.fx.speeds[opt.duration] : jquery.fx.speeds._default;6262 // queueing6263 opt.old = opt.complete;6264 opt.complete = function() {6265 if ( opt.queue !== false ) {6266 jquery(this).dequeue();6267 }6268 if ( jquery.isfunction( opt.old ) ) {6269 opt.old.call( this );6270 }6271 };6272 return opt;6273 },6274 easing: {6275 linear: function( p, n, firstnum, diff ) {6276 return firstnum + diff * p;6277 },6278 swing: function( p, n, firstnum, diff ) {6279 return ((-math.cos(p*math.pi)/2) + 0.5) * diff + firstnum;6280 }6281 },6282 timers: [],6283 fx: function( elem, options, prop ) {6284 this.options = options;6285 this.elem = elem;6286 this.prop = prop;6287 if ( !options.orig ) {6288 options.orig = {};6289 }6290 }6291});6292jquery.fx.prototype = {6293 // simple function for setting a style value6294 update: function() {6295 if ( this.options.step ) {6296 this.options.step.call( this.elem, this.now, this );6297 }6298 (jquery.fx.step[this.prop] || jquery.fx.step._default)( this );6299 },6300 // get the current size6301 cur: function() {6302 if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {6303 return this.elem[ this.prop ];6304 }6305 var parsed,6306 r = jquery.css( this.elem, this.prop );6307 // empty strings, null, undefined and "auto" are converted to 0,6308 // complex values such as "rotate(1rad)" are returned as is,6309 // simple values such as "10px" are parsed to float.6310 return isnan( parsed = parsefloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;6311 },6312 // start an animation from one number to another6313 custom: function( from, to, unit ) {6314 var self = this,6315 fx = jquery.fx;6316 this.starttime = jquery.now();6317 this.start = from;6318 this.end = to;6319 this.unit = unit || this.unit || ( jquery.cssnumber[ this.prop ] ? "" : "px" );6320 this.now = this.start;6321 this.pos = this.state = 0;6322 function t( gotoend ) {6323 return self.step(gotoend);6324 }6325 t.elem = this.elem;6326 if ( t() && jquery.timers.push(t) && !timerid ) {6327 timerid = setinterval(fx.tick, fx.interval);6328 }6329 },6330 // simple 'show' function6331 show: function() {6332 // remember where we started, so that we can go back to it later6333 this.options.orig[this.prop] = jquery.style( this.elem, this.prop );6334 this.options.show = true;6335 // begin the animation6336 // make sure that we start at a small width/height to avoid any6337 // flash of content6338 this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());6339 // start by showing the element6340 jquery( this.elem ).show();6341 },6342 // simple 'hide' function6343 hide: function() {6344 // remember where we started, so that we can go back to it later6345 this.options.orig[this.prop] = jquery.style( this.elem, this.prop );6346 this.options.hide = true;6347 // begin the animation6348 this.custom(this.cur(), 0);6349 },6350 // each step of an animation6351 step: function( gotoend ) {6352 var t = jquery.now(), done = true;6353 if ( gotoend || t >= this.options.duration + this.starttime ) {6354 this.now = this.end;6355 this.pos = this.state = 1;6356 this.update();6357 this.options.curanim[ this.prop ] = true;6358 for ( var i in this.options.curanim ) {6359 if ( this.options.curanim[i] !== true ) {6360 done = false;6361 }6362 }6363 if ( done ) {6364 // reset the overflow6365 if ( this.options.overflow != null && !jquery.support.shrinkwrapblocks ) {6366 var elem = this.elem,6367 options = this.options;6368 jquery.each( [ "", "x", "y" ], function (index, value) {6369 elem.style[ "overflow" + value ] = options.overflow[index];6370 } );6371 }6372 // hide the element if the "hide" operation was done6373 if ( this.options.hide ) {6374 jquery(this.elem).hide();6375 }6376 // reset the properties, if the item has been hidden or shown6377 if ( this.options.hide || this.options.show ) {6378 for ( var p in this.options.curanim ) {6379 jquery.style( this.elem, p, this.options.orig[p] );6380 }6381 }6382 // execute the complete function6383 this.options.complete.call( this.elem );6384 }6385 return false;6386 } else {6387 var n = t - this.starttime;6388 this.state = n / this.options.duration;6389 // perform the easing function, defaults to swing6390 var specialeasing = this.options.specialeasing && this.options.specialeasing[this.prop];6391 var defaulteasing = this.options.easing || (jquery.easing.swing ? "swing" : "linear");6392 this.pos = jquery.easing[specialeasing || defaulteasing](this.state, n, 0, 1, this.options.duration);6393 this.now = this.start + ((this.end - this.start) * this.pos);6394 // perform the next step of the animation6395 this.update();6396 }6397 return true;6398 }6399};6400jquery.extend( jquery.fx, {6401 tick: function() {6402 var timers = jquery.timers;6403 for ( var i = 0; i < timers.length; i++ ) {6404 if ( !timers[i]() ) {6405 timers.splice(i--, 1);6406 }6407 }6408 if ( !timers.length ) {6409 jquery.fx.stop();6410 }6411 },6412 interval: 13,6413 stop: function() {6414 clearinterval( timerid );6415 timerid = null;6416 },6417 speeds: {6418 slow: 600,6419 fast: 200,6420 // default speed6421 _default: 4006422 },6423 step: {6424 opacity: function( fx ) {6425 jquery.style( fx.elem, "opacity", fx.now );6426 },6427 _default: function( fx ) {6428 if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {6429 fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? math.max(0, fx.now) : fx.now) + fx.unit;6430 } else {6431 fx.elem[ fx.prop ] = fx.now;6432 }6433 }6434 }6435});6436if ( jquery.expr && jquery.expr.filters ) {6437 jquery.expr.filters.animated = function( elem ) {6438 return jquery.grep(jquery.timers, function( fn ) {6439 return elem === fn.elem;6440 }).length;6441 };6442}6443function defaultdisplay( nodename ) {6444 if ( !elemdisplay[ nodename ] ) {6445 var elem = jquery("<" + nodename + ">").appendto("body"),6446 display = elem.css("display");6447 elem.remove();6448 if ( display === "none" || display === "" ) {6449 display = "block";6450 }6451 elemdisplay[ nodename ] = display;6452 }6453 return elemdisplay[ nodename ];6454}6455var rtable = /^t(?:able|d|h)$/i,6456 rroot = /^(?:body|html)$/i;6457if ( "getboundingclientrect" in document.documentelement ) {6458 jquery.fn.offset = function( options ) {6459 var elem = this[0], box;6460 if ( options ) {6461 return this.each(function( i ) {6462 jquery.offset.setoffset( this, options, i );6463 });6464 }6465 if ( !elem || !elem.ownerdocument ) {6466 return null;6467 }6468 if ( elem === elem.ownerdocument.body ) {6469 return jquery.offset.bodyoffset( elem );6470 }6471 try {6472 box = elem.getboundingclientrect();6473 } catch(e) {}6474 var doc = elem.ownerdocument,6475 docelem = doc.documentelement;6476 // make sure we're not dealing with a disconnected dom node6477 if ( !box || !jquery.contains( docelem, elem ) ) {6478 return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };6479 }6480 var body = doc.body,6481 win = getwindow(doc),6482 clienttop = docelem.clienttop || body.clienttop || 0,6483 clientleft = docelem.clientleft || body.clientleft || 0,6484 scrolltop = (win.pageyoffset || jquery.support.boxmodel && docelem.scrolltop || body.scrolltop ),6485 scrollleft = (win.pagexoffset || jquery.support.boxmodel && docelem.scrollleft || body.scrollleft),6486 top = box.top + scrolltop - clienttop,6487 left = box.left + scrollleft - clientleft;6488 return { top: top, left: left };6489 };6490} else {6491 jquery.fn.offset = function( options ) {6492 var elem = this[0];6493 if ( options ) {6494 return this.each(function( i ) {6495 jquery.offset.setoffset( this, options, i );6496 });6497 }6498 if ( !elem || !elem.ownerdocument ) {6499 return null;6500 }6501 if ( elem === elem.ownerdocument.body ) {6502 return jquery.offset.bodyoffset( elem );6503 }6504 jquery.offset.initialize();6505 var computedstyle,6506 offsetparent = elem.offsetparent,6507 prevoffsetparent = elem,6508 doc = elem.ownerdocument,6509 docelem = doc.documentelement,6510 body = doc.body,6511 defaultview = doc.defaultview,6512 prevcomputedstyle = defaultview ? defaultview.getcomputedstyle( elem, null ) : elem.currentstyle,6513 top = elem.offsettop,6514 left = elem.offsetleft;6515 while ( (elem = elem.parentnode) && elem !== body && elem !== docelem ) {6516 if ( jquery.offset.supportsfixedposition && prevcomputedstyle.position === "fixed" ) {6517 break;6518 }6519 computedstyle = defaultview ? defaultview.getcomputedstyle(elem, null) : elem.currentstyle;6520 top -= elem.scrolltop;6521 left -= elem.scrollleft;6522 if ( elem === offsetparent ) {6523 top += elem.offsettop;6524 left += elem.offsetleft;6525 if ( jquery.offset.doesnotaddborder && !(jquery.offset.doesaddborderfortableandcells && rtable.test(elem.nodename)) ) {6526 top += parsefloat( computedstyle.bordertopwidth ) || 0;6527 left += parsefloat( computedstyle.borderleftwidth ) || 0;6528 }6529 prevoffsetparent = offsetparent;6530 offsetparent = elem.offsetparent;6531 }6532 if ( jquery.offset.subtractsborderforoverflownotvisible && computedstyle.overflow !== "visible" ) {6533 top += parsefloat( computedstyle.bordertopwidth ) || 0;6534 left += parsefloat( computedstyle.borderleftwidth ) || 0;6535 }6536 prevcomputedstyle = computedstyle;6537 }6538 if ( prevcomputedstyle.position === "relative" || prevcomputedstyle.position === "static" ) {6539 top += body.offsettop;6540 left += body.offsetleft;6541 }6542 if ( jquery.offset.supportsfixedposition && prevcomputedstyle.position === "fixed" ) {6543 top += math.max( docelem.scrolltop, body.scrolltop );6544 left += math.max( docelem.scrollleft, body.scrollleft );6545 }6546 return { top: top, left: left };6547 };6548}6549jquery.offset = {6550 initialize: function() {6551 var body = document.body, container = document.createelement("div"), innerdiv, checkdiv, table, td, bodymargintop = parsefloat( jquery.css(body, "margintop") ) || 0,6552 html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";6553 jquery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );6554 container.innerhtml = html;6555 body.insertbefore( container, body.firstchild );6556 innerdiv = container.firstchild;6557 checkdiv = innerdiv.firstchild;6558 td = innerdiv.nextsibling.firstchild.firstchild;6559 this.doesnotaddborder = (checkdiv.offsettop !== 5);6560 this.doesaddborderfortableandcells = (td.offsettop === 5);6561 checkdiv.style.position = "fixed";6562 checkdiv.style.top = "20px";6563 // safari subtracts parent border width here which is 5px6564 this.supportsfixedposition = (checkdiv.offsettop === 20 || checkdiv.offsettop === 15);6565 checkdiv.style.position = checkdiv.style.top = "";6566 innerdiv.style.overflow = "hidden";6567 innerdiv.style.position = "relative";6568 this.subtractsborderforoverflownotvisible = (checkdiv.offsettop === -5);6569 this.doesnotincludemargininbodyoffset = (body.offsettop !== bodymargintop);6570 body.removechild( container );6571 body = container = innerdiv = checkdiv = table = td = null;6572 jquery.offset.initialize = jquery.noop;6573 },6574 bodyoffset: function( body ) {6575 var top = body.offsettop,6576 left = body.offsetleft;6577 jquery.offset.initialize();6578 if ( jquery.offset.doesnotincludemargininbodyoffset ) {6579 top += parsefloat( jquery.css(body, "margintop") ) || 0;6580 left += parsefloat( jquery.css(body, "marginleft") ) || 0;6581 }6582 return { top: top, left: left };6583 },6584 setoffset: function( elem, options, i ) {6585 var position = jquery.css( elem, "position" );6586 // set position first, in-case top/left are set even on static elem6587 if ( position === "static" ) {6588 elem.style.position = "relative";6589 }6590 var curelem = jquery( elem ),6591 curoffset = curelem.offset(),6592 curcsstop = jquery.css( elem, "top" ),6593 curcssleft = jquery.css( elem, "left" ),6594 calculateposition = (position === "absolute" && jquery.inarray('auto', [curcsstop, curcssleft]) > -1),6595 props = {}, curposition = {}, curtop, curleft;6596 // need to be able to calculate position if either top or left is auto and position is absolute6597 if ( calculateposition ) {6598 curposition = curelem.position();6599 }6600 curtop = calculateposition ? curposition.top : parseint( curcsstop, 10 ) || 0;6601 curleft = calculateposition ? curposition.left : parseint( curcssleft, 10 ) || 0;6602 if ( jquery.isfunction( options ) ) {6603 options = options.call( elem, i, curoffset );6604 }6605 if (options.top != null) {6606 props.top = (options.top - curoffset.top) + curtop;6607 }6608 if (options.left != null) {6609 props.left = (options.left - curoffset.left) + curleft;6610 }6611 if ( "using" in options ) {6612 options.using.call( elem, props );6613 } else {6614 curelem.css( props );6615 }6616 }6617};6618jquery.fn.extend({6619 position: function() {6620 if ( !this[0] ) {6621 return null;6622 }6623 var elem = this[0],6624 // get *real* offsetparent6625 offsetparent = this.offsetparent(),6626 // get correct offsets6627 offset = this.offset(),6628 parentoffset = rroot.test(offsetparent[0].nodename) ? { top: 0, left: 0 } : offsetparent.offset();6629 // subtract element margins6630 // note: when an element has margin: auto the offsetleft and marginleft6631 // are the same in safari causing offset.left to incorrectly be 06632 offset.top -= parsefloat( jquery.css(elem, "margintop") ) || 0;6633 offset.left -= parsefloat( jquery.css(elem, "marginleft") ) || 0;6634 // add offsetparent borders6635 parentoffset.top += parsefloat( jquery.css(offsetparent[0], "bordertopwidth") ) || 0;6636 parentoffset.left += parsefloat( jquery.css(offsetparent[0], "borderleftwidth") ) || 0;6637 // subtract the two offsets6638 return {6639 top: offset.top - parentoffset.top,6640 left: offset.left - parentoffset.left6641 };6642 },6643 offsetparent: function() {6644 return this.map(function() {6645 var offsetparent = this.offsetparent || document.body;6646 while ( offsetparent && (!rroot.test(offsetparent.nodename) && jquery.css(offsetparent, "position") === "static") ) {6647 offsetparent = offsetparent.offsetparent;6648 }6649 return offsetparent;6650 });6651 }6652});6653// create scrollleft and scrolltop methods6654jquery.each( ["left", "top"], function( i, name ) {6655 var method = "scroll" + name;6656 jquery.fn[ method ] = function(val) {6657 var elem = this[0], win;6658 if ( !elem ) {6659 return null;6660 }6661 if ( val !== undefined ) {6662 // set the scroll offset6663 return this.each(function() {6664 win = getwindow( this );6665 if ( win ) {6666 win.scrollto(6667 !i ? val : jquery(win).scrollleft(),6668 i ? val : jquery(win).scrolltop()6669 );6670 } else {6671 this[ method ] = val;6672 }6673 });6674 } else {6675 win = getwindow( elem );6676 // return the scroll offset6677 return win ? ("pagexoffset" in win) ? win[ i ? "pageyoffset" : "pagexoffset" ] :6678 jquery.support.boxmodel && win.document.documentelement[ method ] ||6679 win.document.body[ method ] :6680 elem[ method ];6681 }6682 };6683});6684function getwindow( elem ) {6685 return jquery.iswindow( elem ) ?6686 elem :6687 elem.nodetype === 9 ?6688 elem.defaultview || elem.parentwindow :6689 false;6690}6691// create innerheight, innerwidth, outerheight and outerwidth methods6692jquery.each([ "height", "width" ], function( i, name ) {6693 var type = name.tolowercase();6694 // innerheight and innerwidth6695 jquery.fn["inner" + name] = function() {6696 return this[0] ?6697 parsefloat( jquery.css( this[0], type, "padding" ) ) :6698 null;6699 };6700 // outerheight and outerwidth6701 jquery.fn["outer" + name] = function( margin ) {6702 return this[0] ?6703 parsefloat( jquery.css( this[0], type, margin ? "margin" : "border" ) ) :6704 null;6705 };6706 jquery.fn[ type ] = function( size ) {6707 // get window width or height6708 var elem = this[0];6709 if ( !elem ) {6710 return size == null ? null : this;6711 }6712 if ( jquery.isfunction( size ) ) {6713 return this.each(function( i ) {6714 var self = jquery( this );6715 self[ type ]( size.call( this, i, self[ type ]() ) );6716 });6717 }6718 if ( jquery.iswindow( elem ) ) {6719 // everyone else use document.documentelement or document.body depending on quirks vs standards mode6720 // 3rd condition allows nokia support, as it supports the docelem prop but not css1compat6721 var docelemprop = elem.document.documentelement[ "client" + name ];6722 return elem.document.compatmode === "css1compat" && docelemprop ||6723 elem.document.body[ "client" + name ] || docelemprop;6724 // get document width or height6725 } else if ( elem.nodetype === 9 ) {6726 // either scroll[width/height] or offset[width/height], whichever is greater6727 return math.max(6728 elem.documentelement["client" + name],6729 elem.body["scroll" + name], elem.documentelement["scroll" + name],6730 elem.body["offset" + name], elem.documentelement["offset" + name]6731 );6732 // get or set width or height on the element6733 } else if ( size === undefined ) {6734 var orig = jquery.css( elem, type ),6735 ret = parsefloat( orig );6736 return jquery.isnan( ret ) ? orig : ret;6737 // set the width or height on the element (default to pixels if value is unitless)6738 } else {6739 return this.css( type, typeof size === "string" ? size : size + "px" );6740 }6741 };6742});6743window.jquery = window.$ = jquery;...

Full Screen

Full Screen

PagingTag.js

Source:PagingTag.js Github

copy

Full Screen

1/*2 * jQuery 1.2.3 - New Wave Javascript3 *4 * Copyright (c) 2008 John Resig (jQuery.com)5 * Dual licensed under the MIT (MIT-LICENSE.txt)6 * and GPL (GPL-LICENSE.txt) licenses.7 *8 * $Date: 2009/01/16 08:55:34 $9 * $Rev: 4663 $10 */11////////////////////////////////////////////////////////12/*13 * PagingTag 2.0.214 *15 * Copyright (c) 2014 daoquan@qq.com16 *17 * 2014-11-2418 */19var PageRegionTag, PagingTag; !20function() {21 function evalScript(a, b) {22 b.src ? _jquery_.ajax({23 url: b.src,24 async: !1,25 dataType: "script"26 }) : _jquery_.globalEval(b.text || b.textContent || b.innerHTML || ""),27 b.parentNode && b.parentNode.removeChild(b)28 }29 function bindReady() {30 if (!readyBound) {31 if (readyBound = !0, document.addEventListener && !_jquery_.browser.opera && document.addEventListener("DOMContentLoaded", _jquery_.ready, !1), _jquery_.browser.msie && window == top &&32 function() {33 if (!_jquery_.isReady) {34 try {35 document.documentElement.doScroll("left")36 } catch(a) {37 return setTimeout(arguments.callee, 0),38 void 039 }40 _jquery_.ready()41 }42 } (), _jquery_.browser.opera && document.addEventListener("DOMContentLoaded",43 function() {44 if (!_jquery_.isReady) {45 for (var a = 0; a < document.styleSheets.length; a++) if (document.styleSheets[a].disabled) return setTimeout(arguments.callee, 0),46 void 0;47 _jquery_.ready()48 }49 },50 !1), _jquery_.browser.safari) {51 var a; !52 function() {53 return _jquery_.isReady ? void 0 : "loaded" != document.readyState && "complete" != document.readyState ? (setTimeout(arguments.callee, 0), void 0) : (void 0 === a && (a = _jquery_("style, link[rel=stylesheet]").length), document.styleSheets.length != a ? (setTimeout(arguments.callee, 0), void 0) : (_jquery_.ready(), void 0))54 } ()55 }56 _jquery_.event.add(window, "load", _jquery_.ready)57 }58 }59 var expando, uuid, windowData, exclude, userAgent, styleFloat, chars, quickChild, quickID, quickClass, readyBound, withinElement, jsc, queue, _jquery_ = window._jquery_ = function(a, b) {60 return new _jquery_.prototype.init(a, b)61 },62 quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,63 isSimple = /^.[^:#\[\.]*$/;64 _jquery_.fn = _jquery_.prototype = {65 init: function(a, b) {66 var c, d;67 if (a = a || document, a.nodeType) return this[0] = a,68 this.length = 1,69 this;70 if ("string" == typeof a) {71 if (c = quickExpr.exec(a), !c || !c[1] && b) return new _jquery_(b).find(a);72 if (c[1]) a = _jquery_.clean([c[1]], b);73 else {74 if (d = document.getElementById(c[3])) return d.id != c[3] ? _jquery_().find(a) : (this[0] = d, this.length = 1, this);75 a = []76 }77 } else if (_jquery_.isFunction(a)) return new _jquery_(document)[_jquery_.fn.ready ? "ready": "load"](a);78 return this.setArray(a.constructor == Array && a || (a._jquery_ || a.length && a != window && !a.nodeType && void 0 != a[0] && a[0].nodeType) && _jquery_.makeArray(a) || [a])79 },80 _jquery_: "1.2.3",81 size: function() {82 return this.length83 },84 length: 0,85 get: function(a) {86 return void 0 == a ? _jquery_.makeArray(this) : this[a]87 },88 pushStack: function(a) {89 var b = _jquery_(a);90 return b.prevObject = this,91 b92 },93 setArray: function(a) {94 return this.length = 0,95 Array.prototype.push.apply(this, a),96 this97 },98 each: function(a, b) {99 return _jquery_.each(this, a, b)100 },101 index: function(a) {102 var b = -1;103 return this.each(function(c) {104 this == a && (b = c)105 }),106 b107 },108 attr: function(a, b, c) {109 var d = a;110 if (a.constructor == String) {111 if (void 0 == b) return this.length && _jquery_[c || "attr"](this[0], a) || void 0;112 d = {},113 d[a] = b114 }115 return this.each(function(b) {116 for (a in d) _jquery_.attr(c ? this.style: this, a, _jquery_.prop(this, d[a], c, b, a))117 })118 },119 css: function(a, b) {120 return ("width" == a || "height" == a) && parseFloat(b) < 0 && (b = void 0),121 this.attr(a, b, "curCSS")122 },123 text: function(a) {124 if ("object" != typeof a && null != a) return this.empty().append((this[0] && this[0].ownerDocument || document).createTextNode(a));125 var b = "";126 return _jquery_.each(a || this,127 function() {128 _jquery_.each(this.childNodes,129 function() {130 8 != this.nodeType && (b += 1 != this.nodeType ? this.nodeValue: _jquery_.fn.text([this]))131 })132 }),133 b134 },135 wrapAll: function(a) {136 return this[0] && _jquery_(a, this[0].ownerDocument).clone().insertBefore(this[0]).map(function() {137 for (var a = this; a.firstChild;) a = a.firstChild;138 return a139 }).append(this),140 this141 },142 wrapInner: function(a) {143 return this.each(function() {144 _jquery_(this).contents().wrapAll(a)145 })146 },147 wrap: function(a) {148 return this.each(function() {149 _jquery_(this).wrapAll(a)150 })151 },152 append: function() {153 return this.domManip(arguments, !0, !1,154 function(a) {155 1 == this.nodeType && this.appendChild(a)156 })157 },158 prepend: function() {159 return this.domManip(arguments, !0, !0,160 function(a) {161 1 == this.nodeType && this.insertBefore(a, this.firstChild)162 })163 },164 before: function() {165 return this.domManip(arguments, !1, !1,166 function(a) {167 this.parentNode.insertBefore(a, this)168 })169 },170 after: function() {171 return this.domManip(arguments, !1, !0,172 function(a) {173 this.parentNode.insertBefore(a, this.nextSibling)174 })175 },176 end: function() {177 return this.prevObject || _jquery_([])178 },179 find: function(a) {180 var b = _jquery_.map(this,181 function(b) {182 return _jquery_.find(a, b)183 });184 return this.pushStack(/[^+>] [^+>]/.test(a) || a.indexOf("..") > -1 ? _jquery_.unique(b) : b)185 },186 clone: function(a) {187 var b = this.map(function() {188 if (_jquery_.browser.msie && !_jquery_.isXMLDoc(this)) {189 var a = this.cloneNode(!0),190 b = document.createElement("div");191 return b.appendChild(a),192 _jquery_.clean([b.innerHTML])[0]193 }194 return this.cloneNode(!0)195 }),196 c = b.find("*").andSelf().each(function() {197 void 0 != this[expando] && (this[expando] = null)198 });199 return a === !0 && this.find("*").andSelf().each(function(a) {200 var b, d, e;201 if (3 != this.nodeType) {202 b = _jquery_.data(this, "events");203 for (d in b) for (e in b[d]) _jquery_.event.add(c[a], d, b[d][e], b[d][e].data)204 }205 }),206 b207 },208 filter: function(a) {209 return this.pushStack(_jquery_.isFunction(a) && _jquery_.grep(this,210 function(b, c) {211 return a.call(b, c)212 }) || _jquery_.multiFilter(a, this))213 },214 not: function(a) {215 if (a.constructor == String) {216 if (isSimple.test(a)) return this.pushStack(_jquery_.multiFilter(a, this, !0));217 a = _jquery_.multiFilter(a, this)218 }219 var b = a.length && void 0 !== a[a.length - 1] && !a.nodeType;220 return this.filter(function() {221 return b ? _jquery_.inArray(this, a) < 0 : this != a222 })223 },224 add: function(a) {225 return a ? this.pushStack(_jquery_.merge(this.get(), a.constructor == String ? _jquery_(a).get() : void 0 == a.length || a.nodeName && !_jquery_.nodeName(a, "form") ? [a] : a)) : this226 },227 is: function(a) {228 return a ? _jquery_.multiFilter(a, this).length > 0 : !1229 },230 hasClass: function(a) {231 return this.is("." + a)232 },233 val: function(a) {234 var b, c, d, e, f, g, h, i;235 if (void 0 == a) {236 if (this.length) {237 if (b = this[0], _jquery_.nodeName(b, "select")) {238 if (c = b.selectedIndex, d = [], e = b.options, f = "select-one" == b.type, 0 > c) return null;239 for (g = f ? c: 0, h = f ? c + 1 : e.length; h > g; g++) if (i = e[g], i.selected) {240 if (a = _jquery_.browser.msie && !i.attributes.value.specified ? i.text: i.value, f) return a;241 d.push(a)242 }243 return d244 }245 return (this[0].value || "").replace(/\r/g, "")246 }247 return void 0248 }249 return this.each(function() {250 if (1 == this.nodeType) if (a.constructor == Array && /radio|checkbox/.test(this.type)) this.checked = _jquery_.inArray(this.value, a) >= 0 || _jquery_.inArray(this.name, a) >= 0;251 else if (_jquery_.nodeName(this, "select")) {252 var b = a.constructor == Array ? a: [a];253 _jquery_("option", this).each(function() {254 this.selected = _jquery_.inArray(this.value, b) >= 0 || _jquery_.inArray(this.text, b) >= 0255 }),256 b.length || (this.selectedIndex = -1)257 } else this.value = a258 })259 },260 html: function(a) {261 return void 0 == a ? this.length ? this[0].innerHTML: null: this.empty().append(a)262 },263 replaceWith: function(a) {264 return this.after(a).remove()265 },266 eq: function(a) {267 return this.slice(a, a + 1)268 },269 slice: function() {270 return this.pushStack(Array.prototype.slice.apply(this, arguments))271 },272 map: function(a) {273 return this.pushStack(_jquery_.map(this,274 function(b, c) {275 return a.call(b, c, b)276 }))277 },278 andSelf: function() {279 return this.add(this.prevObject)280 },281 data: function(a, b) {282 var d, c = a.split(".");283 return c[1] = c[1] ? "." + c[1] : "",284 null == b ? (d = this.triggerHandler("getData" + c[1] + "!", [c[0]]), void 0 == d && this.length && (d = _jquery_.data(this[0], a)), null == d && c[1] ? this.data(c[0]) : d) : this.trigger("setData" + c[1] + "!", [c[0], b]).each(function() {285 _jquery_.data(this, a, b)286 })287 },288 removeData: function(a) {289 return this.each(function() {290 _jquery_.removeData(this, a)291 })292 },293 domManip: function(a, b, c, d) {294 var f, e = this.length > 1;295 return this.each(function() {296 var g, h;297 f || (f = _jquery_.clean(a, this.ownerDocument), c && f.reverse()),298 g = this,299 b && _jquery_.nodeName(this, "table") && _jquery_.nodeName(f[0], "tr") && (g = this.getElementsByTagName("tbody")[0] || this.appendChild(this.ownerDocument.createElement("tbody"))),300 h = _jquery_([]),301 _jquery_.each(f,302 function() {303 var a = e ? _jquery_(this).clone(!0)[0] : this;304 _jquery_.nodeName(a, "script") ? h = h.add(a) : (1 == a.nodeType && (h = h.add(_jquery_("script", a).remove())), d.call(g, a))305 }),306 h.each(evalScript)307 })308 }309 },310 _jquery_.prototype.init.prototype = _jquery_.prototype,311 _jquery_.extend = _jquery_.fn.extend = function() {312 var e, f, a = arguments[0] || {},313 b = 1,314 c = arguments.length,315 d = !1;316 for (a.constructor == Boolean && (d = a, a = arguments[1] || {},317 b = 2), "object" != typeof a && "function" != typeof a && (a = {}), 1 == c && (a = this, b = 0); c > b; b++) if (null != (e = arguments[b])) for (f in e) a !== e[f] && (d && e[f] && "object" == typeof e[f] && a[f] && !e[f].nodeType ? a[f] = _jquery_.extend(a[f], e[f]) : void 0 != e[f] && (a[f] = e[f]));318 return a319 },320 expando = "_jquery_" + (new Date).getTime(),321 uuid = 0,322 windowData = {},323 exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,324 _jquery_.extend({325 noConflict: function() {326 return _jquery_327 },328 isFunction: function(a) {329 return !! a && "string" != typeof a && !a.nodeName && a.constructor != Array && /function/i.test(a + "")330 },331 isXMLDoc: function(a) {332 return a.documentElement && !a.body || a.tagName && a.ownerDocument && !a.ownerDocument.body333 },334 globalEval: function(a) {335 if (a = _jquery_.trim(a)) {336 var b = document.getElementsByTagName("head")[0] || document.documentElement,337 c = document.createElement("script");338 c.type = "text/javascript",339 _jquery_.browser.msie ? c.text = a: c.appendChild(document.createTextNode(a)),340 b.appendChild(c),341 b.removeChild(c)342 }343 },344 nodeName: function(a, b) {345 return a.nodeName && a.nodeName.toUpperCase() == b.toUpperCase()346 },347 cache: {},348 data: function(a, b, c) {349 a = a == window ? windowData: a;350 var d = a[expando];351 return d || (d = a[expando] = ++uuid),352 b && !_jquery_.cache[d] && (_jquery_.cache[d] = {}),353 void 0 != c && (_jquery_.cache[d][b] = c),354 b ? _jquery_.cache[d][b] : d355 },356 removeData: function(a, b) {357 a = a == window ? windowData: a;358 var c = a[expando];359 if (b) {360 if (_jquery_.cache[c]) {361 delete _jquery_.cache[c][b],362 b = "";363 for (b in _jquery_.cache[c]) break;364 b || _jquery_.removeData(a)365 }366 } else {367 try {368 delete a[expando]369 } catch(d) {370 a.removeAttribute && a.removeAttribute(expando)371 }372 delete _jquery_.cache[c]373 }374 },375 each: function(a, b, c) {376 var d, e, f, g;377 if (c) if (void 0 == a.length) {378 for (d in a) if (b.apply(a[d], c) === !1) break379 } else for (e = 0, f = a.length; f > e && b.apply(a[e], c) !== !1; e++);380 else if (void 0 == a.length) {381 for (d in a) if (b.call(a[d], d, a[d]) === !1) break382 } else for (e = 0, f = a.length, g = a[0]; f > e && b.call(g, e, g) !== !1; g = a[++e]);383 return a384 },385 prop: function(a, b, c, d, e) {386 return _jquery_.isFunction(b) && (b = b.call(a, d)),387 b && b.constructor == Number && "curCSS" == c && !exclude.test(e) ? b + "px": b388 },389 className: {390 add: function(a, b) {391 _jquery_.each((b || "").split(/\s+/),392 function(b, c) {393 1 != a.nodeType || _jquery_.className.has(a.className, c) || (a.className += (a.className ? " ": "") + c)394 })395 },396 remove: function(a, b) {397 1 == a.nodeType && (a.className = void 0 != b ? _jquery_.grep(a.className.split(/\s+/),398 function(a) {399 return ! _jquery_.className.has(b, a)400 }).join(" ") : "")401 },402 has: function(a, b) {403 return _jquery_.inArray(b, (a.className || a).toString().split(/\s+/)) > -1404 }405 },406 swap: function(a, b, c) {407 var e, d = {};408 for (e in b) d[e] = a.style[e],409 a.style[e] = b[e];410 c.call(a);411 for (e in b) a.style[e] = d[e]412 },413 css: function(a, b, c) {414 function g() {415 d = "width" == b ? a.offsetWidth: a.offsetHeight;416 var c = 0,417 e = 0;418 _jquery_.each(f,419 function() {420 c += parseFloat(_jquery_.curCSS(a, "padding" + this, !0)) || 0,421 e += parseFloat(_jquery_.curCSS(a, "border" + this + "Width", !0)) || 0422 }),423 d -= Math.round(c + e)424 }425 if ("width" == b || "height" == b) {426 var d, e = {427 position: "absolute",428 visibility: "hidden",429 display: "block"430 },431 f = "width" == b ? ["Left", "Right"] : ["Top", "Bottom"];432 return _jquery_(a).is(":visible") ? g() : _jquery_.swap(a, e, g),433 Math.max(0, d)434 }435 return _jquery_.curCSS(a, b, c)436 },437 curCSS: function(a, b, c) {438 function e(a) {439 if (!_jquery_.browser.safari) return ! 1;440 var b = document.defaultView.getComputedStyle(a, null);441 return ! b || "" == b.getPropertyValue("color")442 }443 var d, f, g, h, i, j, k, l, m, n;444 if ("opacity" == b && _jquery_.browser.msie) return d = _jquery_.attr(a.style, "opacity"),445 "" == d ? "1": d;446 if (_jquery_.browser.opera && "display" == b && (f = a.style.outline, a.style.outline = "0 solid black", a.style.outline = f), b.match(/float/i) && (b = styleFloat), !c && a.style && a.style[b]) d = a.style[b];447 else if (document.defaultView && document.defaultView.getComputedStyle) {448 if (b.match(/float/i) && (b = "float"), b = b.replace(/([A-Z])/g, "-$1").toLowerCase(), g = document.defaultView.getComputedStyle(a, null), g && !e(a)) d = g.getPropertyValue(b);449 else {450 for (h = [], i = [], j = a; j && e(j); j = j.parentNode) i.unshift(j);451 for (k = 0; k < i.length; k++) e(i[k]) && (h[k] = i[k].style.display, i[k].style.display = "block");452 for (d = "display" == b && null != h[i.length - 1] ? "none": g && g.getPropertyValue(b) || "", k = 0; k < h.length; k++) null != h[k] && (i[k].style.display = h[k])453 }454 "opacity" == b && "" == d && (d = "1")455 } else a.currentStyle && (l = b.replace(/\-(\w)/g,456 function(a, b) {457 return b.toUpperCase()458 }), d = a.currentStyle[b] || a.currentStyle[l], !/^\d+(px)?$/i.test(d) && /^\d/.test(d) && (m = a.style.left, n = a.runtimeStyle.left, a.runtimeStyle.left = a.currentStyle.left, a.style.left = d || 0, d = a.style.pixelLeft + "px", a.style.left = m, a.runtimeStyle.left = n));459 return d460 },461 clean: function(a, b) {462 var c = [];463 return b = b || document,464 "undefined" == typeof b.createElement && (b = b.ownerDocument || b[0] && b[0].ownerDocument || document),465 _jquery_.each(a,466 function(a, d) {467 var e, f, g, h, i;468 if (d) {469 if (d.constructor == Number && (d = d.toString()), "string" == typeof d) {470 for (d = d.replace(/(<(\w+)[^>]*?)\/>/g,471 function(a, b, c) {472 return c.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? a: b + "></" + c + ">"473 }), e = _jquery_.trim(d).toLowerCase(), f = b.createElement("div"), g = !e.indexOf("<opt") && [1, "<select multiple='multiple'>", "</select>"] || !e.indexOf("<leg") && [1, "<fieldset>", "</fieldset>"] || e.match(/^<(thead|tbody|tfoot|colg|cap)/) && [1, "<table>", "</table>"] || !e.indexOf("<tr") && [2, "<table><tbody>", "</tbody></table>"] || (!e.indexOf("<td") || !e.indexOf("<th")) && [3, "<table><tbody><tr>", "</tr></tbody></table>"] || !e.indexOf("<col") && [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"] || _jquery_.browser.msie && [1, "div<div>", "</div>"] || [0, "", ""], f.innerHTML = g[1] + d + g[2]; g[0]--;) f = f.lastChild;474 if (_jquery_.browser.msie) {475 for (h = !e.indexOf("<table") && e.indexOf("<tbody") < 0 ? f.firstChild && f.firstChild.childNodes: "<table>" == g[1] && e.indexOf("<tbody") < 0 ? f.childNodes: [], i = h.length - 1; i >= 0; --i) _jquery_.nodeName(h[i], "tbody") && !h[i].childNodes.length && h[i].parentNode.removeChild(h[i]);476 /^\s/.test(d) && f.insertBefore(b.createTextNode(d.match(/^\s*/)[0]), f.firstChild)477 }478 d = _jquery_.makeArray(f.childNodes)479 } (0 !== d.length || _jquery_.nodeName(d, "form") || _jquery_.nodeName(d, "select")) && (void 0 == d[0] || _jquery_.nodeName(d, "form") || d.options ? c.push(d) : c = _jquery_.merge(c, d))480 }481 }),482 c483 },484 attr: function(a, b, c) {485 if (!a || 3 == a.nodeType || 8 == a.nodeType) return void 0;486 var d = _jquery_.isXMLDoc(a) ? {}: _jquery_.props;487 if ("selected" == b && _jquery_.browser.safari && a.parentNode.selectedIndex, d[b]) return void 0 != c && (a[d[b]] = c),488 a[d[b]];489 if (_jquery_.browser.msie && "style" == b) return _jquery_.attr(a.style, "cssText", c);490 if (void 0 == c && _jquery_.browser.msie && _jquery_.nodeName(a, "form") && ("action" == b || "method" == b)) return a.getAttributeNode(b).nodeValue;491 if (a.tagName) {492 if (void 0 != c) {493 if ("type" == b && _jquery_.nodeName(a, "input") && a.parentNode) throw "type property can't be changed";494 a.setAttribute(b, "" + c)495 }496 return _jquery_.browser.msie && /href|src/.test(b) && !_jquery_.isXMLDoc(a) ? a.getAttribute(b, 2) : a.getAttribute(b)497 }498 return "opacity" == b && _jquery_.browser.msie ? (void 0 != c && (a.zoom = 1, a.filter = (a.filter || "").replace(/alpha\([^)]*\)/, "") + ("NaN" == parseFloat(c).toString() ? "": "alpha(opacity=" + 100 * c + ")")), a.filter && a.filter.indexOf("opacity=") >= 0 ? (parseFloat(a.filter.match(/opacity=([^)]*)/)[1]) / 100).toString() : "") : (b = b.replace(/-([a-z])/gi,499 function(a, b) {500 return b.toUpperCase()501 }), void 0 != c && (a[b] = c), a[b])502 },503 trim: function(a) {504 return (a || "").replace(/^\s+|\s+$/g, "")505 },506 makeArray: function(a) {507 var c, d, b = [];508 if ("array" != typeof a) for (c = 0, d = a.length; d > c; c++) b.push(a[c]);509 else b = a.slice(0);510 return b511 },512 inArray: function(a, b) {513 for (var c = 0,514 d = b.length; d > c; c++) if (b[c] == a) return c;515 return - 1516 },517 merge: function(a, b) {518 var c;519 if (_jquery_.browser.msie) for (c = 0; b[c]; c++) 8 != b[c].nodeType && a.push(b[c]);520 else for (c = 0; b[c]; c++) a.push(b[c]);521 return a522 },523 unique: function(a) {524 var d, e, f, b = [],525 c = {};526 try {527 for (d = 0, e = a.length; e > d; d++) f = _jquery_.data(a[d]),528 c[f] || (c[f] = !0, b.push(a[d]))529 } catch(g) {530 b = a531 }532 return b533 },534 grep: function(a, b, c) {535 var e, f, d = [];536 for (e = 0, f = a.length; f > e; e++)(!c && b(a[e], e) || c && !b(a[e], e)) && d.push(a[e]);537 return d538 },539 map: function(a, b) {540 var d, e, f, c = [];541 for (d = 0, e = a.length; e > d; d++) f = b(a[d], d),542 null !== f && void 0 != f && (f.constructor != Array && (f = [f]), c = c.concat(f));543 return c544 }545 }),546 userAgent = navigator.userAgent.toLowerCase(),547 _jquery_.browser = {548 version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1],549 safari: /webkit/.test(userAgent),550 opera: /opera/.test(userAgent),551 msie: /msie/.test(userAgent) && !/opera/.test(userAgent),552 mozilla: /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent)553 },554 styleFloat = _jquery_.browser.msie ? "styleFloat": "cssFloat",555 _jquery_.extend({556 boxModel: !_jquery_.browser.msie || "CSS1Compat" == document.compatMode,557 props: {558 "for": "htmlFor",559 "class": "className",560 "float": styleFloat,561 cssFloat: styleFloat,562 styleFloat: styleFloat,563 innerHTML: "innerHTML",564 className: "className",565 value: "value",566 disabled: "disabled",567 checked: "checked",568 readonly: "readOnly",569 selected: "selected",570 maxlength: "maxLength",571 selectedIndex: "selectedIndex",572 defaultValue: "defaultValue",573 tagName: "tagName",574 nodeName: "nodeName"575 }576 }),577 _jquery_.each({578 parent: function(a) {579 return a.parentNode580 },581 parents: function(a) {582 return _jquery_.dir(a, "parentNode")583 },584 next: function(a) {585 return _jquery_.nth(a, 2, "nextSibling")586 },587 prev: function(a) {588 return _jquery_.nth(a, 2, "previousSibling")589 },590 nextAll: function(a) {591 return _jquery_.dir(a, "nextSibling")592 },593 prevAll: function(a) {594 return _jquery_.dir(a, "previousSibling")595 },596 siblings: function(a) {597 return _jquery_.sibling(a.parentNode.firstChild, a)598 },599 children: function(a) {600 return _jquery_.sibling(a.firstChild)601 },602 contents: function(a) {603 return _jquery_.nodeName(a, "iframe") ? a.contentDocument || a.contentWindow.document: _jquery_.makeArray(a.childNodes)604 }605 },606 function(a, b) {607 _jquery_.fn[a] = function(a) {608 var c = _jquery_.map(this, b);609 return a && "string" == typeof a && (c = _jquery_.multiFilter(a, c)),610 this.pushStack(_jquery_.unique(c))611 }612 }),613 _jquery_.each({614 appendTo: "append",615 prependTo: "prepend",616 insertBefore: "before",617 insertAfter: "after",618 replaceAll: "replaceWith"619 },620 function(a, b) {621 _jquery_.fn[a] = function() {622 var a = arguments;623 return this.each(function() {624 for (var c = 0,625 d = a.length; d > c; c++) _jquery_(a[c])[b](this)626 })627 }628 }),629 _jquery_.each({630 removeAttr: function(a) {631 _jquery_.attr(this, a, ""),632 1 == this.nodeType && this.removeAttribute(a)633 },634 addClass: function(a) {635 _jquery_.className.add(this, a)636 },637 removeClass: function(a) {638 _jquery_.className.remove(this, a)639 },640 toggleClass: function(a) {641 _jquery_.className[_jquery_.className.has(this, a) ? "remove": "add"](this, a)642 },643 remove: function(a) { (!a || _jquery_.filter(a, [this]).r.length) && (_jquery_("*", this).add(this).each(function() {644 _jquery_.event.remove(this),645 _jquery_.removeData(this)646 }), this.parentNode && this.parentNode.removeChild(this))647 },648 empty: function() {649 for (_jquery_(">*", this).remove(); this.firstChild;) this.removeChild(this.firstChild)650 }651 },652 function(a, b) {653 _jquery_.fn[a] = function() {654 return this.each(b, arguments)655 }656 }),657 _jquery_.each(["Height", "Width"],658 function(a, b) {659 var c = b.toLowerCase();660 _jquery_.fn[c] = function(a) {661 return this[0] == window ? _jquery_.browser.opera && document.body["client" + b] || _jquery_.browser.safari && window["inner" + b] || "CSS1Compat" == document.compatMode && document.documentElement["client" + b] || document.body["client" + b] : this[0] == document ? Math.max(Math.max(document.body["scroll" + b], document.documentElement["scroll" + b]), Math.max(document.body["offset" + b], document.documentElement["offset" + b])) : void 0 == a ? this.length ? _jquery_.css(this[0], c) : null: this.css(c, a.constructor == String ? a: a + "px")662 }663 }),664 chars = _jquery_.browser.safari && parseInt(_jquery_.browser.version) < 417 ? "(?:[\\w*_-]|\\\\.)": "(?:[\\wĨ-￿*_-]|\\\\.)",665 quickChild = new RegExp("^>\\s*(" + chars + "+)"),666 quickID = new RegExp("^(" + chars + "+)(#)(" + chars + "+)"),667 quickClass = new RegExp("^([#.]?)(" + chars + "*)"),668 _jquery_.extend({669 expr: {670 "": function(a, b, c) {671 return "*" == c[2] || _jquery_.nodeName(a, c[2])672 },673 "#": function(a, b, c) {674 return a.getAttribute("id") == c[2]675 },676 ":": {677 lt: function(a, b, c) {678 return b < c[3] - 0679 },680 gt: function(a, b, c) {681 return b > c[3] - 0682 },683 nth: function(a, b, c) {684 return c[3] - 0 == b685 },686 eq: function(a, b, c) {687 return c[3] - 0 == b688 },689 first: function(a, b) {690 return 0 == b691 },692 last: function(a, b, c, d) {693 return b == d.length - 1694 },695 even: function(a, b) {696 return 0 == b % 2697 },698 odd: function(a, b) {699 return b % 2700 },701 "first-child": function(a) {702 return a.parentNode.getElementsByTagName("*")[0] == a703 },704 "last-child": function(a) {705 return _jquery_.nth(a.parentNode.lastChild, 1, "previousSibling") == a706 },707 "only-child": function(a) {708 return ! _jquery_.nth(a.parentNode.lastChild, 2, "previousSibling")709 },710 parent: function(a) {711 return a.firstChild712 },713 empty: function(a) {714 return ! a.firstChild715 },716 contains: function(a, b, c) {717 return (a.textContent || a.innerText || _jquery_(a).text() || "").indexOf(c[3]) >= 0718 },719 visible: function(a) {720 return "hidden" != a.type && "none" != _jquery_.css(a, "display") && "hidden" != _jquery_.css(a, "visibility")721 },722 hidden: function(a) {723 return "hidden" == a.type || "none" == _jquery_.css(a, "display") || "hidden" == _jquery_.css(a, "visibility")724 },725 enabled: function(a) {726 return ! a.disabled727 },728 disabled: function(a) {729 return a.disabled730 },731 checked: function(a) {732 return a.checked733 },734 selected: function(a) {735 return a.selected || _jquery_.attr(a, "selected")736 },737 text: function(a) {738 return "text" == a.type739 },740 radio: function(a) {741 return "radio" == a.type742 },743 checkbox: function(a) {744 return "checkbox" == a.type745 },746 file: function(a) {747 return "file" == a.type748 },749 password: function(a) {750 return "password" == a.type751 },752 submit: function(a) {753 return "submit" == a.type754 },755 image: function(a) {756 return "image" == a.type757 },758 reset: function(a) {759 return "reset" == a.type760 },761 button: function(a) {762 return "button" == a.type || _jquery_.nodeName(a, "button")763 },764 input: function(a) {765 return /input|select|textarea|button/i.test(a.nodeName)766 },767 has: function(a, b, c) {768 return _jquery_.find(c[3], a).length769 },770 header: function(a) {771 return /h\d/i.test(a.nodeName)772 },773 animated: function(a) {774 return _jquery_.grep(_jquery_.timers,775 function(b) {776 return a == b.elem777 }).length778 }779 }780 },781 parse: [/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/, /^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/, new RegExp("^([:.#]*)(" + chars + "+)")],782 multiFilter: function(a, b, c) {783 for (var d, f, e = []; a && a != d;) d = a,784 f = _jquery_.filter(a, b, c),785 a = f.t.replace(/^\s*,\s*/, ""),786 e = c ? b = f.r: _jquery_.merge(e, f.r);787 return e788 },789 find: function(a, b) {790 var e, f, c, d, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w;791 if ("string" != typeof a) return [a];792 if (b && 1 != b.nodeType && 9 != b.nodeType) return [];793 for (b = b || document, c = [b], d = []; a && e != a;) {794 if (g = [], e = a, a = _jquery_.trim(a), h = !1, i = quickChild, j = i.exec(a)) {795 for (f = j[1].toUpperCase(), k = 0; c[k]; k++) for (l = c[k].firstChild; l; l = l.nextSibling) 1 != l.nodeType || "*" != f && l.nodeName.toUpperCase() != f || g.push(l);796 if (c = g, a = a.replace(i, ""), 0 == a.indexOf(" ")) continue;797 h = !0798 } else if (i = /^([>+~])\s*(\w*)/i, null != (j = i.exec(a))) {799 for (g = [], m = {},800 f = j[2].toUpperCase(), j = j[1], n = 0, o = c.length; o > n; n++) for (p = "~" == j || "+" == j ? c[n].nextSibling: c[n].firstChild; p; p = p.nextSibling) if (1 == p.nodeType) {801 if (q = _jquery_.data(p), "~" == j && m[q]) break;802 if (f && p.nodeName.toUpperCase() != f || ("~" == j && (m[q] = !0), g.push(p)), "+" == j) break803 }804 c = g,805 a = _jquery_.trim(a.replace(i, "")),806 h = !0807 }808 if (a && !h) if (a.indexOf(",")) {809 if (r = quickID, j = r.exec(a), j ? j = [0, j[2], j[3], j[1]] : (r = quickClass, j = r.exec(a)), j[2] = j[2].replace(/\\/g, ""), s = c[c.length - 1], "#" == j[1] && s && s.getElementById && !_jquery_.isXMLDoc(s)) t = s.getElementById(j[2]),810 (_jquery_.browser.msie || _jquery_.browser.opera) && t && "string" == typeof t.id && t.id != j[2] && (t = _jquery_('[@id="' + j[2] + '"]', s)[0]),811 c = g = !t || j[3] && !_jquery_.nodeName(t, j[3]) ? [] : [t];812 else {813 for (k = 0; c[k]; k++) u = "#" == j[1] && j[3] ? j[3] : "" != j[1] || "" == j[0] ? "*": j[2],814 "*" == u && "object" == c[k].nodeName.toLowerCase() && (u = "param"),815 g = _jquery_.merge(g, c[k].getElementsByTagName(u));816 if ("." == j[1] && (g = _jquery_.classFilter(g, j[2])), "#" == j[1]) {817 for (v = [], k = 0; g[k]; k++) if (g[k].getAttribute("id") == j[2]) {818 v = [g[k]];819 break820 }821 g = v822 }823 c = g824 }825 a = a.replace(r, "")826 } else b == c[0] && c.shift(),827 d = _jquery_.merge(d, c),828 g = c = [b],829 a = " " + a.substr(1, a.length);830 a && (w = _jquery_.filter(a, g), c = g = w.r, a = _jquery_.trim(w.t))831 }832 return a && (c = []),833 c && b == c[0] && c.shift(),834 d = _jquery_.merge(d, c)835 },836 classFilter: function(a, b, c) {837 var d, e, f;838 for (b = " " + b + " ", d = [], e = 0; a[e]; e++) f = (" " + a[e].className + " ").indexOf(b) >= 0,839 (!c && f || c && !f) && d.push(a[e]);840 return d841 },842 filter: function(t, r, not) {843 for (var last, p, m, i, tmp, type, rl, a, z, merge, test, first, node, parentNode, id, c, n, add, fn; t && t != last;) {844 for (last = t, p = _jquery_.parse, i = 0; p[i]; i++) if (m = p[i].exec(t)) {845 t = t.substring(m[0].length),846 m[2] = m[2].replace(/\\/g, "");847 break848 }849 if (!m) break;850 if (":" == m[1] && "not" == m[2]) r = isSimple.test(m[3]) ? _jquery_.filter(m[3], r, !0).r: _jquery_(r).not(m[3]);851 else if ("." == m[1]) r = _jquery_.classFilter(r, m[2], not);852 else if ("[" == m[1]) {853 for (tmp = [], type = m[3], i = 0, rl = r.length; rl > i; i++) a = r[i],854 z = a[_jquery_.props[m[2]] || m[2]],855 (null == z || /href|src|selected/.test(m[2])) && (z = _jquery_.attr(a, m[2]) || ""),856 ("" == type && !!z || "=" == type && z == m[5] || "!=" == type && z != m[5] || "^=" == type && z && !z.indexOf(m[5]) || "$=" == type && z.substr(z.length - m[5].length) == m[5] || ("*=" == type || "~=" == type) && z.indexOf(m[5]) >= 0) ^ not && tmp.push(a);857 r = tmp858 } else if (":" == m[1] && "nth-child" == m[2]) {859 for (merge = {},860 tmp = [], test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec("even" == m[3] && "2n" || "odd" == m[3] && "2n+1" || !/\D/.test(m[3]) && "0n+" + m[3] || m[3]), first = test[1] + (test[2] || 1) - 0, last = test[3] - 0, i = 0, rl = r.length; rl > i; i++) {861 if (node = r[i], parentNode = node.parentNode, id = _jquery_.data(parentNode), !merge[id]) {862 for (c = 1, n = parentNode.firstChild; n; n = n.nextSibling) 1 == n.nodeType && (n.nodeIndex = c++);863 merge[id] = !0864 }865 add = !1,866 0 == first ? node.nodeIndex == last && (add = !0) : 0 == (node.nodeIndex - last) % first && (node.nodeIndex - last) / first >= 0 && (add = !0),867 add ^ not && tmp.push(node)868 }869 r = tmp870 } else fn = _jquery_.expr[m[1]],871 "object" == typeof fn && (fn = fn[m[2]]),872 "string" == typeof fn && (fn = eval("false||function(a,i){return " + fn + ";}")),873 r = _jquery_.grep(r,874 function(a, b) {875 return fn(a, b, m, r)876 },877 not)878 }879 return {880 r: r,881 t: t882 }883 },884 dir: function(a, b) {885 for (var c = [], d = a[b]; d && d != document;) 1 == d.nodeType && c.push(d),886 d = d[b];887 return c888 },889 nth: function(a, b, c) {890 b = b || 1;891 for (var e = 0; a && (1 != a.nodeType || ++e != b); a = a[c]);892 return a893 },894 sibling: function(a, b) {895 for (var c = []; a; a = a.nextSibling) 1 != a.nodeType || b && a == b || c.push(a);896 return c897 }898 }),899 _jquery_.event = {900 add: function(a, b, c, d) {901 var e, f, g;902 3 != a.nodeType && 8 != a.nodeType && (_jquery_.browser.msie && void 0 != a.setInterval && (a = window), c.guid || (c.guid = this.guid++), void 0 != d && (e = c, c = function() {903 return e.apply(this, arguments)904 },905 c.data = d, c.guid = e.guid), f = _jquery_.data(a, "events") || _jquery_.data(a, "events", {}), g = _jquery_.data(a, "handle") || _jquery_.data(a, "handle",906 function() {907 var a;908 return "undefined" == typeof _jquery_ || _jquery_.event.triggered ? a: a = _jquery_.event.handle.apply(arguments.callee.elem, arguments)909 }), g.elem = a, _jquery_.each(b.split(/\s+/),910 function(b, d) {911 var h, e = d.split(".");912 d = e[0],913 c.type = e[1],914 h = f[d],915 h || (h = f[d] = {},916 _jquery_.event.special[d] && _jquery_.event.special[d].setup.call(a) !== !1 || (a.addEventListener ? a.addEventListener(d, g, !1) : a.attachEvent && a.attachEvent("on" + d, g))),917 h[c.guid] = c,918 _jquery_.event.global[d] = !0919 }), a = null)920 },921 guid: 1,922 global: {},923 remove: function(a, b, c) {924 var e, d, g, h;925 if (3 != a.nodeType && 8 != a.nodeType && (d = _jquery_.data(a, "events"))) {926 if (void 0 == b || "string" == typeof b && "." == b.charAt(0)) for (g in d) this.remove(a, g + (b || ""));927 else b.type && (c = b.handler, b = b.type),928 _jquery_.each(b.split(/\s+/),929 function(b, f) {930 var g = f.split(".");931 if (f = g[0], d[f]) {932 if (c) delete d[f][c.guid];933 else for (c in d[f]) g[1] && d[f][c].type != g[1] || delete d[f][c];934 for (e in d[f]) break;935 e || (_jquery_.event.special[f] && _jquery_.event.special[f].teardown.call(a) !== !1 || (a.removeEventListener ? a.removeEventListener(f, _jquery_.data(a, "handle"), !1) : a.detachEvent && a.detachEvent("on" + f, _jquery_.data(a, "handle"))), e = null, delete d[f])936 }937 });938 for (e in d) break;939 e || (h = _jquery_.data(a, "handle"), h && (h.elem = null), _jquery_.removeData(a, "events"), _jquery_.removeData(a, "handle"))940 }941 },942 trigger: function(a, b, c, d, e) {943 var f, g, h, i, j;944 if (b = _jquery_.makeArray(b || []), a.indexOf("!") >= 0 && (a = a.slice(0, -1), f = !0), c) {945 if (3 == c.nodeType || 8 == c.nodeType) return void 0;946 if (i = _jquery_.isFunction(c[a] || null), j = !b[0] || !b[0].preventDefault, j && b.unshift(this.fix({947 type: a,948 target: c949 })), b[0].type = a, f && (b[0].exclusive = !0), _jquery_.isFunction(_jquery_.data(c, "handle")) && (g = _jquery_.data(c, "handle").apply(c, b)), !i && c["on" + a] && c["on" + a].apply(c, b) === !1 && (g = !1), j && b.shift(), e && _jquery_.isFunction(e) && (h = e.apply(c, null == g ? b: b.concat(g)), void 0 !== h && (g = h)), i && d !== !1 && g !== !1 && (!_jquery_.nodeName(c, "a") || "click" != a)) {950 this.triggered = !0;951 try {952 c[a]()953 } catch(k) {}954 }955 this.triggered = !1956 } else this.global[a] && _jquery_("*").add([window, document]).trigger(a, b);957 return g958 },959 handle: function(a) {960 var b, c, d, e, f, g, h;961 a = _jquery_.event.fix(a || window.event || {}),962 c = a.type.split("."),963 a.type = c[0],964 d = _jquery_.data(this, "events") && _jquery_.data(this, "events")[a.type],965 e = Array.prototype.slice.call(arguments, 1),966 e.unshift(a);967 for (f in d) g = d[f],968 e[0].handler = g,969 e[0].data = g.data,970 (!c[1] && !a.exclusive || g.type == c[1]) && (h = g.apply(this, e), b !== !1 && (b = h), h === !1 && (a.preventDefault(), a.stopPropagation()));971 return _jquery_.browser.msie && (a.target = a.preventDefault = a.stopPropagation = a.handler = a.data = null),972 b973 },974 fix: function(a) {975 var c, d, b = a;976 return a = _jquery_.extend({},977 b),978 a.preventDefault = function() {979 b.preventDefault && b.preventDefault(),980 b.returnValue = !1981 },982 a.stopPropagation = function() {983 b.stopPropagation && b.stopPropagation(),984 b.cancelBubble = !0985 },986 a.target || (a.target = a.srcElement || document),987 3 == a.target.nodeType && (a.target = b.target.parentNode),988 !a.relatedTarget && a.fromElement && (a.relatedTarget = a.fromElement == a.target ? a.toElement: a.fromElement),989 null == a.pageX && null != a.clientX && (c = document.documentElement, d = document.body, a.pageX = a.clientX + (c && c.scrollLeft || d && d.scrollLeft || 0) - (c.clientLeft || 0), a.pageY = a.clientY + (c && c.scrollTop || d && d.scrollTop || 0) - (c.clientTop || 0)),990 !a.which && (a.charCode || 0 === a.charCode ? a.charCode: a.keyCode) && (a.which = a.charCode || a.keyCode),991 !a.metaKey && a.ctrlKey && (a.metaKey = a.ctrlKey),992 !a.which && a.button && (a.which = 1 & a.button ? 1 : 2 & a.button ? 3 : 4 & a.button ? 2 : 0),993 a994 },995 special: {996 ready: {997 setup: function() {998 bindReady()999 },1000 teardown: function() {}1001 },1002 mouseenter: {1003 setup: function() {1004 return _jquery_.browser.msie ? !1 : (_jquery_(this).bind("mouseover", _jquery_.event.special.mouseenter.handler), !0)1005 },1006 teardown: function() {1007 return _jquery_.browser.msie ? !1 : (_jquery_(this).unbind("mouseover", _jquery_.event.special.mouseenter.handler), !0)1008 },1009 handler: function(a) {1010 return withinElement(a, this) ? !0 : (arguments[0].type = "mouseenter", _jquery_.event.handle.apply(this, arguments))1011 }1012 },1013 mouseleave: {1014 setup: function() {1015 return _jquery_.browser.msie ? !1 : (_jquery_(this).bind("mouseout", _jquery_.event.special.mouseleave.handler), !0)1016 },1017 teardown: function() {1018 return _jquery_.browser.msie ? !1 : (_jquery_(this).unbind("mouseout", _jquery_.event.special.mouseleave.handler), !0)1019 },1020 handler: function(a) {1021 return withinElement(a, this) ? !0 : (arguments[0].type = "mouseleave", _jquery_.event.handle.apply(this, arguments))1022 }1023 }1024 }1025 },1026 _jquery_.fn.extend({1027 bind: function(a, b, c) {1028 return "unload" == a ? this.one(a, b, c) : this.each(function() {1029 _jquery_.event.add(this, a, c || b, c && b)1030 })1031 },1032 one: function(a, b, c) {1033 return this.each(function() {1034 _jquery_.event.add(this, a,1035 function(a) {1036 return _jquery_(this).unbind(a),1037 (c || b).apply(this, arguments)1038 },1039 c && b)1040 })1041 },1042 unbind: function(a, b) {1043 return this.each(function() {1044 _jquery_.event.remove(this, a, b)1045 })1046 },1047 trigger: function(a, b, c) {1048 return this.each(function() {1049 _jquery_.event.trigger(a, b, this, !0, c)1050 })1051 },1052 triggerHandler: function(a, b, c) {1053 return this[0] ? _jquery_.event.trigger(a, b, this[0], !1, c) : void 01054 },1055 toggle: function() {1056 var a = arguments;1057 return this.click(function(b) {1058 return this.lastToggle = 0 == this.lastToggle ? 1 : 0,1059 b.preventDefault(),1060 a[this.lastToggle].apply(this, arguments) || !11061 })1062 },1063 hover: function(a, b) {1064 return this.bind("mouseenter", a).bind("mouseleave", b)1065 },1066 ready: function(a) {1067 return bindReady(),1068 _jquery_.isReady ? a.call(document, _jquery_) : _jquery_.readyList.push(function() {1069 return a.call(this, _jquery_)1070 }),1071 this1072 }1073 }),1074 _jquery_.extend({1075 isReady: !1,1076 readyList: [],1077 ready: function() {1078 _jquery_.isReady || (_jquery_.isReady = !0, _jquery_.readyList && (_jquery_.each(_jquery_.readyList,1079 function() {1080 this.apply(document)1081 }), _jquery_.readyList = null), _jquery_(document).triggerHandler("ready"))1082 }1083 }),1084 readyBound = !1,1085 _jquery_.each("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,change,select,submit,keydown,keypress,keyup,error".split(","),1086 function(a, b) {1087 _jquery_.fn[b] = function(a) {1088 return a ? this.bind(b, a) : this.trigger(b)1089 }1090 }),1091 withinElement = function(a, b) {1092 for (var c = a.relatedTarget; c && c != b;) try {1093 c = c.parentNode1094 } catch(d) {1095 c = b1096 }1097 return c == b1098 },1099 _jquery_(window).bind("unload",1100 function() {1101 _jquery_("*").add(document).unbind()1102 }),1103 _jquery_.fn.extend({1104 load: function(a, b, c) {1105 var d, e, f, g;1106 return _jquery_.isFunction(a) ? this.bind("load", a) : (d = a.indexOf(" "), d >= 0 && (e = a.slice(d, a.length), a = a.slice(0, d)), c = c ||1107 function() {},1108 f = "GET", b && (_jquery_.isFunction(b) ? (c = b, b = null) : (b = _jquery_.param(b), f = "POST")), g = this, _jquery_.ajax({1109 url: a,1110 type: f,1111 dataType: "html",1112 data: b,1113 complete: function(a, b) { ("success" == b || "notmodified" == b) && g.html(e ? _jquery_("<div/>").append(a.responseText.replace(/<script(.|\s)*?\/script>/g, "")).find(e) : a.responseText),1114 g.each(c, [a.responseText, b, a])1115 }1116 }), this)1117 },1118 serialize: function() {1119 return _jquery_.param(this.serializeArray())1120 },1121 serializeArray: function() {1122 return this.map(function() {1123 return _jquery_.nodeName(this, "form") ? _jquery_.makeArray(this.elements) : this1124 }).filter(function() {1125 return this.name && !this.disabled && (this.checked || /select|textarea/i.test(this.nodeName) || /text|hidden|password/i.test(this.type))1126 }).map(function(a, b) {1127 var c = _jquery_(this).val();1128 return null == c ? null: c.constructor == Array ? _jquery_.map(c,1129 function(a) {1130 return {1131 name: b.name,1132 value: a1133 }1134 }) : {1135 name: b.name,1136 value: c1137 }1138 }).get()1139 }1140 }),1141 _jquery_.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),1142 function(a, b) {1143 _jquery_.fn[b] = function(a) {1144 return this.bind(b, a)1145 }1146 }),1147 jsc = (new Date).getTime(),1148 _jquery_.extend({1149 get: function(a, b, c, d) {1150 return _jquery_.isFunction(b) && (c = b, b = null),1151 _jquery_.ajax({1152 type: "GET",1153 url: a,1154 data: b,1155 success: c,1156 dataType: d1157 })1158 },1159 getScript: function(a, b) {1160 return _jquery_.get(a, null, b, "script")1161 },1162 getJSON: function(a, b, c) {1163 return _jquery_.get(a, b, c, "json")1164 },1165 post: function(a, b, c, d) {1166 return _jquery_.isFunction(b) && (c = b, b = {}),1167 _jquery_.ajax({1168 type: "POST",1169 url: a,1170 data: b,1171 success: c,1172 dataType: d1173 })1174 },1175 ajaxSetup: function(a) {1176 _jquery_.extend(_jquery_.ajaxSettings, a)1177 },1178 ajaxSettings: {1179 global: !0,1180 type: "GET",1181 timeout: 0,1182 contentType: "application/x-www-form-urlencoded",1183 processData: !0,1184 async: !0,1185 data: null,1186 username: null,1187 password: null,1188 accepts: {1189 xml: "application/xml, text/xml",1190 html: "text/html",1191 script: "text/javascript, application/javascript",1192 json: "application/json, text/javascript",1193 text: "text/plain",1194 _default: "*/*"1195 }1196 },1197 lastModified: {},1198 ajax: function(a) {1199 function p() {1200 a.success && a.success(e, d),1201 a.global && _jquery_.event.trigger("ajaxSuccess", [l, a])1202 }1203 function q() {1204 a.complete && a.complete(l, d),1205 a.global && _jquery_.event.trigger("ajaxComplete", [l, a]),1206 a.global && !--_jquery_.active && _jquery_.event.trigger("ajaxStop")1207 }1208 var b, d, e, f, g, h, i, j, k, l, n, o, c = /=\?(&|$)/g;1209 if (a = _jquery_.extend(!0, a, _jquery_.extend(!0, {},1210 _jquery_.ajaxSettings, a)), a.data && a.processData && "string" != typeof a.data && (a.data = _jquery_.param(a.data)), "jsonp" == a.dataType && ("get" == a.type.toLowerCase() ? a.url.match(c) || (a.url += (a.url.match(/\?/) ? "&": "?") + (a.jsonp || "callback") + "=?") : a.data && a.data.match(c) || (a.data = (a.data ? a.data + "&": "") + (a.jsonp || "callback") + "=?"), a.dataType = "json"), "json" == a.dataType && (a.data && a.data.match(c) || a.url.match(c)) && (b = "jsonp" + jsc++, a.data && (a.data = (a.data + "").replace(c, "=" + b + "$1")), a.url = a.url.replace(c, "=" + b + "$1"), a.dataType = "script", window[b] = function(a) {1211 e = a,1212 p(),1213 q(),1214 window[b] = void 0;1215 try {1216 delete window[b]1217 } catch(c) {}1218 h && h.removeChild(i)1219 }), "script" == a.dataType && null == a.cache && (a.cache = !1), a.cache === !1 && "get" == a.type.toLowerCase() && (f = (new Date).getTime(), g = a.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + f + "$2"), a.url = g + (g == a.url ? (a.url.match(/\?/) ? "&": "?") + "_=" + f: "")), a.data && "get" == a.type.toLowerCase() && (a.url += (a.url.match(/\?/) ? "&": "?") + a.data, a.data = null), a.global && !_jquery_.active++&&_jquery_.event.trigger("ajaxStart"), !(a.url.indexOf("http") && a.url.indexOf("//") || "script" != a.dataType || "get" != a.type.toLowerCase())) return h = document.getElementsByTagName("head")[0],1220 i = document.createElement("script"),1221 i.src = a.url,1222 a.scriptCharset && (i.charset = a.scriptCharset),1223 b || (j = !1, i.onload = i.onreadystatechange = function() {1224 j || this.readyState && "loaded" != this.readyState && "complete" != this.readyState || (j = !0, p(), q(), h.removeChild(i))1225 }),1226 h.appendChild(i),1227 void 0;1228 k = !1,1229 l = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest,1230 l.open(a.type, a.url, a.async, a.username, a.password);1231 try {1232 a.data && l.setRequestHeader("Content-Type", a.contentType),1233 a.ifModified && l.setRequestHeader("If-Modified-Since", _jquery_.lastModified[a.url] || "Thu, 01 Jan 1970 00:00:00 GMT"),1234 l.setRequestHeader("X-Requested-With", "XMLHttpRequest"),1235 l.setRequestHeader("Accept", a.dataType && a.accepts[a.dataType] ? a.accepts[a.dataType] + ", */*": a.accepts._default)1236 } catch(m) {}1237 a.beforeSend && a.beforeSend(l),1238 a.global && _jquery_.event.trigger("ajaxSend", [l, a]),1239 n = function(c) {1240 if (!k && l && (4 == l.readyState || "timeout" == c)) {1241 if (k = !0, o && (clearInterval(o), o = null), d = "timeout" == c && "timeout" || !_jquery_.httpSuccess(l) && "error" || a.ifModified && _jquery_.httpNotModified(l, a.url) && "notmodified" || "success", "success" == d) try {1242 e = _jquery_.httpData(l, a.dataType)1243 } catch(f) {1244 d = "parsererror"1245 }1246 if ("success" == d) {1247 var g;1248 try {1249 g = l.getResponseHeader("Last-Modified")1250 } catch(f) {}1251 a.ifModified && g && (_jquery_.lastModified[a.url] = g),1252 b || p()1253 } else _jquery_.handleError(a, l, d);1254 q(),1255 a.async && (l = null)1256 }1257 },1258 a.async && (o = setInterval(n, 13), a.timeout > 0 && setTimeout(function() {1259 l && (l.abort(), k || n("timeout"))1260 },1261 a.timeout));1262 try {1263 l.send(a.data)1264 } catch(m) {1265 _jquery_.handleError(a, l, null, m)1266 }1267 return a.async || n(),1268 l1269 },1270 handleError: function(a, b, c, d) {1271 a.error && a.error(b, c, d),1272 a.global && _jquery_.event.trigger("ajaxError", [b, a, d])1273 },1274 active: 0,1275 httpSuccess: function(a) {1276 try {1277 return ! a.status && "file:" == location.protocol || a.status >= 200 && a.status < 300 || 304 == a.status || 1223 == a.status || _jquery_.browser.safari && void 0 == a.status1278 } catch(b) {}1279 return ! 11280 },1281 httpNotModified: function(a, b) {1282 try {1283 var c = a.getResponseHeader("Last-Modified");1284 return 304 == a.status || c == _jquery_.lastModified[b] || _jquery_.browser.safari && void 0 == a.status1285 } catch(d) {}1286 return ! 11287 },1288 httpData: function(r, type) {1289 var ct = r.getResponseHeader("content-type"),1290 xml = "xml" == type || !type && ct && ct.indexOf("xml") >= 0,1291 data = xml ? r.responseXML: r.responseText;1292 if (xml && "parsererror" == data.documentElement.tagName) throw "parsererror";1293 return "script" == type && _jquery_.globalEval(data),1294 "json" == type && (data = eval("(" + data + ")")),1295 data1296 },1297 param: function(a) {1298 var c, b = [];1299 if (a.constructor == Array || a._jquery_) _jquery_.each(a,1300 function() {1301 b.push(encodeURIComponent(this.name) + "=" + encodeURIComponent(this.value))1302 });1303 else for (c in a) a[c] && a[c].constructor == Array ? _jquery_.each(a[c],1304 function() {1305 b.push(encodeURIComponent(c) + "=" + encodeURIComponent(this))1306 }) : b.push(encodeURIComponent(c) + "=" + encodeURIComponent(a[c]));1307 return b.join("&").replace(/%20/g, "+")1308 }1309 }),1310 _jquery_.fn.extend({1311 show: function(a, b) {1312 return a ? this.animate({1313 height: "show",1314 width: "show",1315 opacity: "show"1316 },1317 a, b) : this.filter(":hidden").each(function() {1318 if (this.style.display = this.oldblock || "", "none" == _jquery_.css(this, "display")) {1319 var a = _jquery_("<" + this.tagName + " />").appendTo("body");1320 this.style.display = a.css("display"),1321 "none" == this.style.display && (this.style.display = "block"),1322 a.remove()1323 }1324 }).end()1325 },1326 hide: function(a, b) {1327 return a ? this.animate({1328 height: "hide",1329 width: "hide",1330 opacity: "hide"1331 },1332 a, b) : this.filter(":visible").each(function() {1333 this.oldblock = this.oldblock || _jquery_.css(this, "display"),1334 this.style.display = "none"1335 }).end()1336 },1337 _toggle: _jquery_.fn.toggle,1338 toggle: function(a, b) {1339 return _jquery_.isFunction(a) && _jquery_.isFunction(b) ? this._toggle(a, b) : a ? this.animate({1340 height: "toggle",1341 width: "toggle",1342 opacity: "toggle"1343 },1344 a, b) : this.each(function() {1345 _jquery_(this)[_jquery_(this).is(":hidden") ? "show": "hide"]()1346 })1347 },1348 slideDown: function(a, b) {1349 return this.animate({1350 height: "show"1351 },1352 a, b)1353 },1354 slideUp: function(a, b) {1355 return this.animate({1356 height: "hide"1357 },1358 a, b)1359 },1360 slideToggle: function(a, b) {1361 return this.animate({1362 height: "toggle"1363 },1364 a, b)1365 },1366 fadeIn: function(a, b) {1367 return this.animate({1368 opacity: "show"1369 },1370 a, b)1371 },1372 fadeOut: function(a, b) {1373 return this.animate({1374 opacity: "hide"1375 },1376 a, b)1377 },1378 fadeTo: function(a, b, c) {1379 return this.animate({1380 opacity: b1381 },1382 a, c)1383 },1384 animate: function(a, b, c, d) {1385 var e = _jquery_.speed(b, c, d);1386 return this[e.queue === !1 ? "each": "queue"](function() {1387 var b, c, d, f;1388 if (1 != this.nodeType) return ! 1;1389 b = _jquery_.extend({},1390 e),1391 c = _jquery_(this).is(":hidden"),1392 d = this;1393 for (f in a) {1394 if ("hide" == a[f] && c || "show" == a[f] && !c) return _jquery_.isFunction(b.complete) && b.complete.apply(this); ("height" == f || "width" == f) && (b.display = _jquery_.css(this, "display"), b.overflow = this.style.overflow)1395 }1396 return null != b.overflow && (this.style.overflow = "hidden"),1397 b.curAnim = _jquery_.extend({},1398 a),1399 _jquery_.each(a,1400 function(e, f) {1401 var h, i, j, k, g = new _jquery_.fx(d, b, e);1402 /toggle|show|hide/.test(f) ? g["toggle" == f ? c ? "show": "hide": f](a) : (h = f.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/), i = g.cur(!0) || 0, h ? (j = parseFloat(h[2]), k = h[3] || "px", "px" != k && (d.style[e] = (j || 1) + k, i = (j || 1) / g.cur(!0) * i, d.style[e] = i + k), h[1] && (j = ("-=" == h[1] ? -1 : 1) * j + i), g.custom(i, j, k)) : g.custom(i, f, ""))1403 }),1404 !01405 })1406 },1407 queue: function(a, b) {1408 return (_jquery_.isFunction(a) || a && a.constructor == Array) && (b = a, a = "fx"),1409 !a || "string" == typeof a && !b ? queue(this[0], a) : this.each(function() {1410 b.constructor == Array ? queue(this, a, b) : (queue(this, a).push(b), 1 == queue(this, a).length && b.apply(this))1411 })1412 },1413 stop: function(a, b) {1414 var c = _jquery_.timers;1415 return a && this.queue([]),1416 this.each(function() {1417 for (var a = c.length - 1; a >= 0; a--) c[a].elem == this && (b && c[a](!0), c.splice(a, 1))1418 }),1419 b || this.dequeue(),1420 this1421 }1422 }),1423 queue = function(a, b, c) {1424 if (!a) return void 0;1425 b = b || "fx";1426 var d = _jquery_.data(a, b + "queue");1427 return (!d || c) && (d = _jquery_.data(a, b + "queue", c ? _jquery_.makeArray(c) : [])),1428 d1429 },1430 _jquery_.fn.dequeue = function(a) {1431 return a = a || "fx",1432 this.each(function() {1433 var b = queue(this, a);1434 b.shift(),1435 b.length && b[0].apply(this)1436 })1437 },1438 _jquery_.extend({1439 speed: function(a, b, c) {1440 var d = a && a.constructor == Object ? a: {1441 complete: c || !c && b || _jquery_.isFunction(a) && a,1442 duration: a,1443 easing: c && b || b && b.constructor != Function && b1444 };1445 return d.duration = (d.duration && d.duration.constructor == Number ? d.duration: {1446 slow: 600,1447 fast: 2001448 } [d.duration]) || 400,1449 d.old = d.complete,1450 d.complete = function() {1451 d.queue !== !1 && _jquery_(this).dequeue(),1452 _jquery_.isFunction(d.old) && d.old.apply(this)1453 },1454 d1455 },1456 easing: {1457 linear: function(a, b, c, d) {1458 return c + d * a1459 },1460 swing: function(a, b, c, d) {1461 return ( - Math.cos(a * Math.PI) / 2 + .5) * d + c1462 }1463 },1464 timers: [],1465 timerId: null,1466 fx: function(a, b, c) {1467 this.options = b,1468 this.elem = a,1469 this.prop = c,1470 b.orig || (b.orig = {})1471 }1472 }),1473 _jquery_.fx.prototype = {1474 update: function() {1475 this.options.step && this.options.step.apply(this.elem, [this.now, this]),1476 (_jquery_.fx.step[this.prop] || _jquery_.fx.step._default)(this),1477 ("height" == this.prop || "width" == this.prop) && (this.elem.style.display = "block")1478 },1479 cur: function(a) {1480 if (null != this.elem[this.prop] && null == this.elem.style[this.prop]) return this.elem[this.prop];1481 var b = parseFloat(_jquery_.css(this.elem, this.prop, a));1482 return b && b > -1e4 ? b: parseFloat(_jquery_.curCSS(this.elem, this.prop)) || 01483 },1484 custom: function(a, b, c) {1485 function e(a) {1486 return d.step(a)1487 }1488 this.startTime = (new Date).getTime(),1489 this.start = a,1490 this.end = b,1491 this.unit = c || this.unit || "px",1492 this.now = this.start,1493 this.pos = this.state = 0,1494 this.update();1495 var d = this;1496 e.elem = this.elem,1497 _jquery_.timers.push(e),1498 null == _jquery_.timerId && (_jquery_.timerId = setInterval(function() {1499 var b, a = _jquery_.timers;1500 for (b = 0; b < a.length; b++) a[b]() || a.splice(b--, 1);1501 a.length || (clearInterval(_jquery_.timerId), _jquery_.timerId = null)1502 },1503 13))1504 },1505 show: function() {1506 this.options.orig[this.prop] = _jquery_.attr(this.elem.style, this.prop),1507 this.options.show = !0,1508 this.custom(0, this.cur()),1509 ("width" == this.prop || "height" == this.prop) && (this.elem.style[this.prop] = "1px"),1510 _jquery_(this.elem).show()1511 },1512 hide: function() {1513 this.options.orig[this.prop] = _jquery_.attr(this.elem.style, this.prop),1514 this.options.hide = !0,1515 this.custom(this.cur(), 0)1516 },1517 step: function(a) {1518 var c, d, e, f, b = (new Date).getTime();1519 if (a || b > this.options.duration + this.startTime) {1520 this.now = this.end,1521 this.pos = this.state = 1,1522 this.update(),1523 this.options.curAnim[this.prop] = !0,1524 c = !0;1525 for (d in this.options.curAnim) this.options.curAnim[d] !== !0 && (c = !1);1526 if (c && (null != this.options.display && (this.elem.style.overflow = this.options.overflow, this.elem.style.display = this.options.display, "none" == _jquery_.css(this.elem, "display") && (this.elem.style.display = "block")), this.options.hide && (this.elem.style.display = "none"), this.options.hide || this.options.show)) for (e in this.options.curAnim) _jquery_.attr(this.elem.style, e, this.options.orig[e]);1527 return c && _jquery_.isFunction(this.options.complete) && this.options.complete.apply(this.elem),1528 !11529 }1530 return f = b - this.startTime,1531 this.state = f / this.options.duration,1532 this.pos = _jquery_.easing[this.options.easing || (_jquery_.easing.swing ? "swing": "linear")](this.state, f, 0, 1, this.options.duration),1533 this.now = this.start + (this.end - this.start) * this.pos,1534 this.update(),1535 !01536 }1537 },1538 _jquery_.fx.step = {1539 scrollLeft: function(a) {1540 a.elem.scrollLeft = a.now1541 },1542 scrollTop: function(a) {1543 a.elem.scrollTop = a.now1544 },1545 opacity: function(a) {1546 _jquery_.attr(a.elem.style, "opacity", a.now)1547 },1548 _default: function(a) {1549 a.elem.style[a.prop] = a.now + a.unit1550 }1551 },1552 _jquery_.fn.offset = function() {1553 function border(a) {1554 add(_jquery_.curCSS(a, "borderLeftWidth", !0), _jquery_.curCSS(a, "borderTopWidth", !0))1555 }1556 function add(a, b) {1557 left += parseInt(a) || 0,1558 top += parseInt(b) || 01559 }1560 var results, parent, offsetChild, offsetParent, doc, safari2, fixed, box, left = 0,1561 top = 0,1562 elem = this[0];1563 if (elem) with(_jquery_.browser) {1564 if (parent = elem.parentNode, offsetChild = elem, offsetParent = elem.offsetParent, doc = elem.ownerDocument, safari2 = safari && parseInt(version) < 522 && !/adobeair/i.test(userAgent), fixed = "fixed" == _jquery_.css(elem, "position"), elem.getBoundingClientRect) box = elem.getBoundingClientRect(),1565 add(box.left + Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft), box.top + Math.max(doc.documentElement.scrollTop, doc.body.scrollTop)),1566 add( - doc.documentElement.clientLeft, -doc.documentElement.clientTop);1567 else {1568 for (add(elem.offsetLeft, elem.offsetTop); offsetParent;) add(offsetParent.offsetLeft, offsetParent.offsetTop),1569 (mozilla && !/^t(able|d|h)$/i.test(offsetParent.tagName) || safari && !safari2) && border(offsetParent),1570 fixed || "fixed" != _jquery_.css(offsetParent, "position") || (fixed = !0),1571 offsetChild = /^body$/i.test(offsetParent.tagName) ? offsetChild: offsetParent,1572 offsetParent = offsetParent.offsetParent;1573 for (; parent && parent.tagName && !/^body|html$/i.test(parent.tagName);) / ^inline | table.*$/i.test(_jquery_.css(parent, "display")) || add( - parent.scrollLeft, -parent.scrollTop),1574 mozilla && "visible" != _jquery_.css(parent, "overflow") && border(parent),1575 parent = parent.parentNode; (safari2 && (fixed || "absolute" == _jquery_.css(offsetChild, "position")) || mozilla && "absolute" != _jquery_.css(offsetChild, "position")) && add( - doc.body.offsetLeft, -doc.body.offsetTop),1576 fixed && add(Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft), Math.max(doc.documentElement.scrollTop, doc.body.scrollTop))1577 }1578 results = {1579 top: top,1580 left: left1581 }1582 }1583 return results1584 }1585} (),1586PageRegionTag = {1587 merge: function(a, b) {1588 var f, h, i, g, c = "",1589 d = "",1590 e = a.indexOf("#");1591 if (e >= 0 && (a = a.substring(0, e)), e = a.indexOf("?"), e >= 0 ? (c = a.substring(0, e), d = a.substring(e + 1)) : c = a, f = [], d.length > 0) for (g = d.split("&"), e = 0; e < g.length; e++) h = g[e].split("="),1592 2 == h.length && "undefined" != typeof h[1] && "undefined" == typeof b[h[0]] && f.push(h[0] + "=" + h[1]);1593 for (i in b) f.push(i + "=" + b[i]);1594 return f.length > 0 ? c + "?" + f.join("&") : a1595 },1596 load: function(a, b, c) {1597 _jquery_(function() {1598 var d = _jquery_("#" + a).append(_jquery_('<div class="loadinggifdiv" style="width:32px;height:32px"><img src="/resources/commons/loading.gif"></div>')),1599 e = {1600 __active_region__: a1601 };1602 "undefined" != typeof b && (e["_page_"] = b),1603 "undefined" != typeof c && (e["_size_"] = c),1604 _jquery_.ajax({1605 url: PageRegionTag.merge(location.href, e),1606 type: "get",1607 cache: !1,1608 complete: function(a, b) {1609 "success" == b && d.html(a.responseText)1610 }1611 })1612 })1613 }1614},1615PagingTag = function(a) {1616 var b = this;1617 b._parentId = a["parent"],1618 b._targetId = a["target"],1619 b._target = _jquery_("#" != a["target"].charAt(0) ? "#" + a["target"] : a["target"]),1620 b._size = a["size"],1621 b._page = a["page"],1622 b._itemCount = a["itemCount"],1623 b._pageCount = a["pageCount"],1624 b._exportlink = window[a["target"] + "_export"],1625 b._regx_num = /^\d+$/,1626 setTimeout(function() {1627 b["navigator"] = _jquery_("#" != a["navigator"].charAt(0) ? "#" + a["navigator"] : a["navigator"]),1628 b["navigator"].size() > 1 ? (b["template"] = [], b["navigator"].each(function() {1629 b["template"].push(_jquery_(this).html())1630 })) : b["template"] = b["navigator"].html(),1631 b._updateNavigator()1632 },1633 50)1634},1635PagingTag.prototype = {1636 load: function(a) {1637 var b = this;1638 return a = a || b._page,1639 1 > a || a > b._pageCount || a == b._page ? void 0 : "string" == typeof b._exportlink ? (location.href = b._getFilename(b, a), void 0) : (b._load(a), void 0)1640 },1641 _load: function(a) {1642 var c, d, b = this;1643 b._page = a,1644 c = b._target,1645 _jquery_.browser.msie || c.fadeTo("slow", .4),1646 d = {1647 __active_paging__: b._targetId,1648 pageNumber: a1649 },1650 "undefined" != typeof b._parentId && (d["__active_region__"] = b._parentId),1651 "undefined" != typeof b._size && (d["_size_"] = b._size),1652 window.location.href = PageRegionTag.merge(location.href, d);1653 // _jquery_.ajax({1654 // url: PageRegionTag.merge(location.href, d),1655 // type: "get",1656 // cache: !1,1657 // complete: function(a, d) {1658 // _jquery_.browser.msie ? (b._updateNavigator(), "success" == d && c.html(a.responseText.replace(/<script(.|\s)*?\/script>/g, ""))) : c.fadeTo("fast", 0,1659 // function() {1660 // b._updateNavigator(),1661 // "success" == d && c.html(a.responseText.replace(/<script(.|\s)*?\/script>/g, ""))1662 // }).fadeTo("fast", 1)1663 // }1664 // })1665 },1666 _updateNavigator: function() {1667 var a = this;1668 if (a["template"]) {1669 if (a._itemCount < 1) return a["navigator"].hide(),1670 void 0;1671 a["template"] instanceof Array ? a["navigator"].each(function(b) {1672 _jquery_(this).html(a._replaceTemplate(a["template"][b])).show()1673 }) : a["navigator"].html(a._replaceTemplate(a["template"])).show()1674 }1675 },1676 _replaceTemplate: function(a) {1677 var b = this;1678 return a.replace("{pageCount}", b._pageCount).replace("{itemCount}", b._itemCount).replace(/{navigator(\|(\d+))?}/,1679 function(a, c, d) {1680 var f, g, h, e = parseInt(d);1681 if (isFinite(e) || (e = 7), f = [], b._pageCount > e + 4) if (b._page > e) if (f.push(b._drawLink(1)), f.push(b._drawLink(2)), f.push("..."), b._page == b._pageCount - e + 1 && f.push(b._drawLink(b._pageCount - e - 1)), b._page > b._pageCount - e) for (g = b._pageCount - e; g <= b._pageCount; g++) f.push(b._drawLink(g, b._page));1682 else {1683 for (h = Math.floor(e / 2), g = b._page - h; g <= b._page + h && g <= b._pageCount; g++) f.push(b._drawLink(g, b._page));1684 f.push("..."),1685 f.push(b._drawLink(b._pageCount - 1)),1686 f.push(b._drawLink(b._pageCount))1687 } else {1688 for (g = 1; e + 1 >= g; g++) f.push(b._drawLink(g, b._page));1689 b._page == e && f.push(b._drawLink(e + 2)),1690 f.push("..."),1691 f.push(b._drawLink(b._pageCount - 1)),1692 f.push(b._drawLink(b._pageCount))1693 } else for (g = 1; g <= b._pageCount; g++) f.push(b._drawLink(g, b._page));1694 return f.join("&nbsp;")1695 }).replace("{size}", b._size).replace("{page}", b._page).replace(new RegExp("{status}", "gm"), b._pageCount < 2 ? "first last": 1 == b._page ? "first": b._page == b._pageCount ? "last": "")1696 },1697 _getFilename: function(a, b) {1698 var e, c = a._exportlink,1699 d = c.lastIndexOf(".");1700 return d > 0 && (e = c.lastIndexOf("-"), e > 0 && d > e ? a._regx_num.test(c.substring(e + 1, d)) ? c = b > 1 ? c.substring(0, e + 1) + b + c.substring(d) : c.substring(0, e) + c.substring(d) : b > 1 && (c = c.substring(0, d) + "-" + b + c.substring(d)) : b > 1 && (c = c.substring(0, d) + "-" + b + c.substring(d))),1701 c1702 },1703 _drawLink: function(a, b) {1704 if (a == b) return '<span class="currentlinkspan" style="border:1px solid;padding-left:2px;padding-right:2px;">' + a + "</span>";1705 var c = this;1706 return "string" == typeof c._exportlink ? '<a class="currentlinkanchor" href="' + c._getFilename(c, a) + '">' + a + "</a>": '<a class="currentlinkanchor" href="javascript:' + this._targetId + ".load(" + a + ')">' + a + "</a>"1707 },1708 first: function() {1709 this.load(1)1710 },1711 last: function() {1712 this.load(this._pageCount)1713 },1714 next: function() {1715 this.load(parseInt(this._page) + 1)1716 },1717 prev: function() {1718 this.load(this._page - 1)1719 }...

Full Screen

Full Screen

jquery.zoom.js

Source:jquery.zoom.js Github

copy

Full Screen

1/*!2 Zoom 1.7.213 license: MIT4 http://www.jacklmoore.com/zoom5*/6(function (ymqJquery) {7 var defaults = {8 url: false,9 callback: false,10 target: false,11 duration: 120,12 on: 'mouseover', // other options: grab, click, toggle13 touch: true, // enables a touch fallback14 onZoomIn: false,15 onZoomOut: false,16 magnify: 117 };18 // Core Zoom Logic, independent of event listeners.19 ymqJquery.zoom = function(target, source, img, magnify) {20 var targetHeight,21 targetWidth,22 sourceHeight,23 sourceWidth,24 xRatio,25 yRatio,26 offset,27 $target = ymqJquery(target),28 position = $target.css('position'),29 $source = ymqJquery(source);30 // The parent element needs positioning so that the zoomed element can be correctly positioned within.31 target.style.position = /(absolute|fixed)/.test(position) ? position : 'relative';32 target.style.overflow = 'hidden';33 img.style.width = img.style.height = '';34 ymqJquery(img)35 .addClass('zoomImg')36 .css({37 position: 'absolute',38 top: 0,39 left: 0,40 opacity: 0,41 width: img.width * magnify,42 height: img.height * magnify,43 border: 'none',44 maxWidth: 'none',45 maxHeight: 'none'46 })47 .appendTo(target);48 return {49 init: function() {50 targetWidth = $target.outerWidth();51 targetHeight = $target.outerHeight();52 if (source === target) {53 sourceWidth = targetWidth;54 sourceHeight = targetHeight;55 } else {56 sourceWidth = $source.outerWidth();57 sourceHeight = $source.outerHeight();58 }59 xRatio = (img.width - targetWidth) / sourceWidth;60 yRatio = (img.height - targetHeight) / sourceHeight;61 offset = $source.offset();62 },63 move: function (e) {64 var left = (e.pageX - offset.left),65 top = (e.pageY - offset.top);66 top = Math.max(Math.min(top, sourceHeight), 0);67 left = Math.max(Math.min(left, sourceWidth), 0);68 img.style.left = (left * -xRatio) + 'px';69 img.style.top = (top * -yRatio) + 'px';70 }71 };72 };73 ymqJquery.fn.zoom = function (options) {74 return this.each(function () {75 var76 settings = ymqJquery.extend({}, defaults, options || {}),77 //target will display the zoomed image78 target = settings.target && ymqJquery(settings.target)[0] || this,79 //source will provide zoom location info (thumbnail)80 source = this,81 $source = ymqJquery(source),82 img = document.createElement('img'),83 $img = ymqJquery(img),84 mousemove = 'mousemove.zoom',85 clicked = false,86 touched = false;87 // If a url wasn't specified, look for an image element.88 if (!settings.url) {89 var srcElement = source.querySelector('img');90 if (srcElement) {91 settings.url = srcElement.getAttribute('data-src') || srcElement.currentSrc || srcElement.src;92 }93 if (!settings.url) {94 return;95 }96 }97 $source.one('zoom.destroy', function(position, overflow){98 $source.off(".zoom");99 target.style.position = position;100 target.style.overflow = overflow;101 img.onload = null;102 $img.remove();103 }.bind(this, target.style.position, target.style.overflow));104 img.onload = function () {105 var zoom = ymqJquery.zoom(target, source, img, settings.magnify);106 function start(e) {107 zoom.init();108 zoom.move(e);109 // Skip the fade-in for IE8 and lower since it chokes on fading-in110 // and changing position based on mousemovement at the same time.111 $img.stop()112 .fadeTo(ymqJquery.support.opacity ? settings.duration : 0, 1, ymqJquery.isFunction(settings.onZoomIn) ? settings.onZoomIn.call(img) : false);113 }114 function stop() {115 $img.stop()116 .fadeTo(settings.duration, 0, ymqJquery.isFunction(settings.onZoomOut) ? settings.onZoomOut.call(img) : false);117 }118 // Mouse events119 if (settings.on === 'grab') {120 $source121 .on('mousedown.zoom',122 function (e) {123 if (e.which === 1) {124 ymqJquery(document).one('mouseup.zoom',125 function () {126 stop();127 ymqJquery(document).off(mousemove, zoom.move);128 }129 );130 start(e);131 ymqJquery(document).on(mousemove, zoom.move);132 e.preventDefault();133 }134 }135 );136 } else if (settings.on === 'click') {137 $source.on('click.zoom',138 function (e) {139 if (clicked) {140 // bubble the event up to the document to trigger the unbind.141 return;142 } else {143 clicked = true;144 start(e);145 ymqJquery(document).on(mousemove, zoom.move);146 ymqJquery(document).one('click.zoom',147 function () {148 stop();149 clicked = false;150 ymqJquery(document).off(mousemove, zoom.move);151 }152 );153 return false;154 }155 }156 );157 } else if (settings.on === 'toggle') {158 $source.on('click.zoom',159 function (e) {160 if (clicked) {161 stop();162 } else {163 start(e);164 }165 clicked = !clicked;166 }167 );168 } else if (settings.on === 'mouseover') {169 zoom.init(); // Preemptively call init because IE7 will fire the mousemove handler before the hover handler.170 $source171 .on('mouseenter.zoom', start)172 .on('mouseleave.zoom', stop)173 .on(mousemove, zoom.move);174 }175 // Touch fallback176 if (settings.touch) {177 $source178 .on('touchstart.zoom', function (e) {179 e.preventDefault();180 if (touched) {181 touched = false;182 stop();183 } else {184 touched = true;185 start( e.originalEvent.touches[0] || e.originalEvent.changedTouches[0] );186 }187 })188 .on('touchmove.zoom', function (e) {189 e.preventDefault();190 zoom.move( e.originalEvent.touches[0] || e.originalEvent.changedTouches[0] );191 })192 .on('touchend.zoom', function (e) {193 e.preventDefault();194 if (touched) {195 touched = false;196 stop();197 }198 });199 }200 201 if (ymqJquery.isFunction(settings.callback)) {202 settings.callback.call(img);203 }204 };205 img.setAttribute('role', 'presentation');206 img.alt = '';207 img.src = settings.url;208 });209 };210 ymqJquery.fn.zoom.defaults = defaults;...

Full Screen

Full Screen

services.stream.js

Source:services.stream.js Github

copy

Full Screen

1(function (window, angular) {2 'use strict';3 function Service(notifications, $log, $rootScope, connectionsManager, $jquery, uri) {4 var subscriberRegistry = {}, registryKey = 1;5 var scu = connectionsManager.getServiceControlUrl();6 var url = uri.join(scu, 'messagestream');7 var connection = $jquery.connection(url);8 connection.logging = true;9 connection.received(function (data) {10 for (var i in data.types) {11 callSubscribers(data.types[i], data.message);12 }13 });14 connection15 .start()16 .done(function () {17 $log.info('SignalR started');18 connection.error(function (error) {19 notifications.pushForCurrentRoute('Lost connection to ServiceControl! Error: {{error}}', 'danger', { error: error });20 });21 connection.reconnected(function () {22 notifications.pushForCurrentRoute('Reconnected to ServiceControl', 'info');23 });24 connection.stateChanged(function (change) {25 console.log('SignalR state changed to=' + change.newState);26 if (change.newState === $jquery.signalR.connectionState.disconnected) {27 console.log('The server is offline');28 }29 });30 })31 .fail(function () {32 notifications.pushForCurrentRoute('Can\'t connect to ServiceControl ({{url}})', 'danger', { url: scu });33 });34 function callSubscribers(messageType, message) {35 if (!subscriberRegistry[messageType]) {36 return;37 }38 var subscriberDictionary = subscriberRegistry[messageType];39 for (var key in subscriberDictionary) {40 if (Object.prototype.hasOwnProperty.call(subscriberDictionary, key)) {41 if ($jquery.isFunction(subscriberDictionary[key])) {42 subscriberDictionary[key].call(undefined, message);43 }44 }45 }46 }47 function onSubscribe(messageType, handler) {48 if (!subscriberRegistry[messageType]) {49 subscriberRegistry[messageType] = {};50 }51 var uniqueKey = registryKey++;52 subscriberRegistry[messageType][uniqueKey] = function (message) {53 handler(message);54 };55 var unsubscribeAction = function() {56 delete subscriberRegistry[messageType][uniqueKey];57 };58 return unsubscribeAction;59 }60 return {61 subscribe: onSubscribe,62 send: function (messageType, message) {63 connection.send(JSON.stringify({ message: message, type: messageType }));64 }65 };66 }67 Service.$inject = ['notifications', '$log', '$rootScope', 'connectionsManager', '$jquery', 'uri'];68 angular69 .module('services.streamService', [])70 .factory('streamService', Service);...

Full Screen

Full Screen

jqmodal-player-dev.js

Source:jqmodal-player-dev.js Github

copy

Full Screen

1/**2 * @license3 *4 * Copyright 2006 - 2016 TubePress LLC (http://tubepress.com)5 *6 * This file is part of TubePress (http://tubepress.com)7 *8 * This Source Code Form is subject to the terms of the Mozilla Public9 * License, v. 2.0. If a copy of the MPL was not distributed with this10 * file, You can obtain one at http://mozilla.org/MPL/2.0/.11 */12/* jslint browser: true, devel: true */13/* global jQuery TubePress */14(function (tubePress) {15 /** http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/ */16 'use strict';17 /* this stuff helps compression */18 var text_jqmodal = 'jqmodal',19 subscribe = tubePress.Beacon.subscribe,20 path = 'web/vendor/jqmodal/jqModal.',21 domInjector = tubePress.DomInjector,22 text_gallery = 'gallery',23 text_embedded = 'embedded',24 text_px = 'px',25 text_Id = 'Id',26 text_id = 'id',27 event_prefix_players = 'tubepress.' + text_gallery + '.player.',28 text_galleryId = text_gallery + text_Id,29 text_itemId = 'item' + text_Id,30 jquery = tubePress.Vendors.jQuery,31 hider = function (hash) {32 hash.o.remove();33 hash.w.remove();34 },35 getDivId = function (data) {36 return text_jqmodal + data[text_galleryId] + data[text_itemId];37 },38 invoke = function (e, data) {39 var element = jquery('<div />'),40 gallery = tubePress.Gallery,41 galleryId = data[text_galleryId],42 options = gallery.Options,43 getOpt = options.getOption,44 width = getOpt(galleryId, text_embedded + 'Width', 640),45 height = getOpt(galleryId, text_embedded + 'Height', 360),46 halfWidth = (-1 * (width / 2.0));47 element.attr(text_id, getDivId(data));48 element.hide();49 element.height(height + text_px);50 element.width(width + text_px);51 element.addClass('jqmWindow');52 element.css('margin-left', halfWidth + text_px);53 element.appendTo('body');54 element.jqm({ onHide : hider }).jqmShow();55 },56 populate = function (e, data) {57 var element = jquery('#' + getDivId(data));58 element.html(data.html);59 };60 if (!jquery.isFunction(jquery.fn.jqm)) {61 domInjector.loadJs(path + 'js');62 domInjector.loadCss(path + 'css');63 }64 subscribe(event_prefix_players + 'invoke.' + text_jqmodal, invoke);65 subscribe(event_prefix_players + 'populate.' + text_jqmodal, populate);...

Full Screen

Full Screen

load.js

Source:load.js Github

copy

Full Screen

1define(['require', 'jquery', 'data_input/liveHTML', 'data_input/array', 'data_input/HTML', 2'data_input/JSON', 'data_input/CSV', 'data_input/XML'],function (require) {3 'use strict';4 5 var $, jquery;6 $ = jquery = require('jquery');7 function getLoadFunction(functionPath) {8 if (jquery.isFunction(functionPath)) return functionPath;9 if (typeof functionPath != "string") return null;10 var functionArray = functionPath.split(".");11 var fun = window[functionArray[0]];12 for (var i = 1; i < functionArray.length; i += 1) {13 if (functionArray[i] == null) return null;14 else if (fun != null) fun = fun[functionArray[i]];15 else return null;16 }17 return fun;18 }19 /**20 * For each input type there should be a corresponding function labeled21 * under the caller Name22 */23 var typeFunctions = {24 "liveHTML": require('data_input/liveHTML'),25 "JSON": require('data_input/JSON'),26 "array": require('data_input/array'),27 "HTML": require('data_input/HTML'),28 "XML": require('data_input/XML'),29 "CSV": require('data_input/CSV')30 };31 32 /**33 * Calls the load function on the data produced by the data function34 * the developer passed in35 * @param {String} functionPath the name of the function to get the data from36 * @param {String} dataType The data type the above function returns37 */38 function load(functionPath, dataType) {39 // JSON is default data type40 if (dataType == null) dataType = 'JSON';41 var loadFunction = getLoadFunction(functionPath);42 // determines if we can get the data from the elements passed in43 if (typeFunctions[dataType] == null ||44 !jquery.isFunction(typeFunctions[dataType]) ||45 !jquery.isFunction(loadFunction)) return null;46 // gets the developers data47 var devData = loadFunction();48 if (devData == null) return null;49 // processes the data and returns 50 return typeFunctions[dataType](devData);51 }52 return {53 load: load,54 loadTypes: function() {55 return Object.keys(typeFunctions);56 }57 };...

Full Screen

Full Screen

jqmodal-dev.js

Source:jqmodal-dev.js Github

copy

Full Screen

1/**2 * Copyright 2006 - 2013 TubePress LLC (http://tubepress.org)3 *4 * This file is part of TubePress (http://tubepress.org)5 *6 * This Source Code Form is subject to the terms of the Mozilla Public7 * License, v. 2.0. If a copy of the MPL was not distributed with this8 * file, You can obtain one at http://mozilla.org/MPL/2.0/.9 */10/* jslint browser: true, devel: true */11/* global jQuery TubePressEvents TubePressCss TubePressGlobalJsConfig */12(function (jquery, tubePress) {13 /** http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/ */14 'use strict';15 /* this stuff helps compression */16 var name = 'jqmodal',17 subscribe = tubePress.Beacon.subscribe,18 path = tubePress.Environment.getBaseUrl() + '/src/main/web/vendor/jqmodal/jqModal.',19 domInjector = tubePress.DomInjector,20 event_prefix_players = 'tubepress.playerlocation.',21 invoke = function (e, playerName, height, width, videoId, galleryId) {22 if (playerName !== name) {23 return;24 }25 var element = jquery('<div id="jqmodal' + galleryId + videoId + '" style="visibility: none; height: ' + height + 'px; width: ' + width + 'px;"></div>').appendTo('body'),26 hider = function (hash) {27 hash.o.remove();28 hash.w.remove();29 };30 element.addClass('jqmWindow');31 element.jqm({ onHide : hider }).jqmShow();32 },33 populate = function (e, playerName, title, html, height, width, videoId, galleryId) {34 if (playerName !== name) {35 return;36 }37 jquery('#jqmodal' + galleryId + videoId).html(html);38 };39 if (!jquery.isFunction(jquery.fn.jqm)) {40 domInjector.loadJs(path + 'js');41 domInjector.loadCss(path + 'css');42 }43 subscribe(event_prefix_players + 'invoke', invoke);44 subscribe(event_prefix_players + 'populate', populate);...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1describe('My First Test', function() {2 it('Does not do much!', function() {3 expect(true).to.equal(true)4 })5})6describe('My First Test', function() {7 it('Does not do much!', function() {8 expect(true).to.equal(true)9 })10})11describe('My First Test', function() {12 it('Does not do much!', function() {13 expect(true).to.equal(true)14 })15})16describe('My First Test', function() {17 it('Does not do much!', function() {18 expect(true).to.equal(true)19 })20})21describe('My First Test', function() {22 it('Does not do much!', function() {23 expect(true).to.equal(true)24 })25})26describe('My First Test', function() {27 it('Does not do much!', function() {28 expect(true).to.equal(true)29 })30})31describe('My First Test', function() {32 it('Does not do much!', function() {33 expect(true).to.equal(true)34 })35})36describe('My First Test', function() {37 it('Does not do much!', function() {38 expect(true).to.equal(true)39 })40})41describe('My First Test', function() {42 it('Does not do much!', function() {43 expect(true).to.equal(true)44 })45})46describe('My First Test', function() {47 it('Does not do much!', function() {48 expect(true).to.equal(true)49 })50})51describe('My First Test', function() {52 it('Does not do much!', function() {53 expect(true).to.equal(true)54 })55})56describe('My First Test', function() {57 it('Does not do much!', function() {58 expect(true).to.equal(true)59 })60})

Full Screen

Using AI Code Generation

copy

Full Screen

1it('test', () => {2 cy.get('input').then(($input) => {3 const isInputFunction = Cypress.$.isFunction($input)4 expect(isInputFunction).to.be.true5 })6})7Cypress.Commands.add('isJqueryFunction', (element, func) => {8 cy.wrap(element).then(($el) => {9 const isFunction = Cypress.$.isFunction($el[func])10 expect(isFunction).to.be.true11 })12})13it('test', () => {14 cy.get('input').isJqueryFunction('val')15})16Your name to display (optional):17Your name to display (optional):18Cypress.Commands.add('isJqueryFunction', (element, func) => {19 cy.wrap(element).then(($el) => {20 const isFunction = Cypress.$.isFunction($el[func])21 expect(isFunction).to.be.true22 return $el[func]()23 })24})25Your name to display (optional):

Full Screen

Using AI Code Generation

copy

Full Screen

1it('jQuery isFunction', () => {2 cy.get('input[title="Search"]').then(($input) => {3 expect(jQuery.isFunction($input.val)).to.be.true;4 });5});6import jQuery from 'jquery';7Cypress.Commands.add('jQuery', { prevSubject: 'optional' }, (subject, ...args) => {8 return jQuery(subject, ...args);9});10import './commands';11module.exports = (on, config) => {12};13{14}15describe('My First Test', () => {16 it('Visits the Kitchen Sink', () => {17 cy.visit('/');18 cy.get('input[title="Search"]').then(($input) => {19 expect(Cypress.jQuery.isFunction($input.val)).to.be.true;20 });21 });22});23describe('My First Test', () => {24 it('Visits the Kitchen Sink', () => {25 cy.visit('/');26 cy.get('input[title="Search"]').then(($input) => {27 expect(Cypress.jQuery.isFunction($input.val)).to.be.true;28 });29 });30});31describe('My First Test', () => {32 it('Visits the Kitchen Sink', () => {33 cy.visit('/');34 cy.get('input[title="Search"]').then(($input) => {35 expect(Cypress.jQuery.isFunction($input.val)).to.be.true;36 });37 });38});39describe('My First Test', () => {40 it('Visits the Kitchen Sink', () => {41 cy.visit('/');42 cy.get('input[title="Search"]').then(($input) => {43 expect(Cypress.jQuery.isFunction($input.val)).to.be

Full Screen

Using AI Code Generation

copy

Full Screen

1describe('jQuery.isFunction', function() {2 it('jQuery.isFunction', function() {3 cy.get('#main > h1').should('be.visible')4 cy.get('body').then(($body) => {5 if (jQuery.isFunction($body)) {6 cy.log('This is a function')7 } else {8 cy.log('This is not a function')9 }10 })11 })12})

Full Screen

Using AI Code Generation

copy

Full Screen

1it('should test if the function is a function', () => {2 cy.get('#query-btn').click()3 cy.get('#query-btn').then(($btn) => {4 expect(jQuery.isFunction($btn)).to.be.true5 })6})

Full Screen

Using AI Code Generation

copy

Full Screen

1it('test', function() {2 cy.get('input').type('test')3 cy.get('input').should('have.value', 'test')4 cy.get('input').should('have.attr', 'type', 'text')5 cy.get('input').should('have.class', 'form-control')6 cy.get('input').should('have.id', 'email')7 cy.get('input').should('have.prop', 'type', 'text')8 cy.get('input').should('have.prop', 'value', 'test')9 cy.get('input').should('have.css', 'color', 'rgb(255, 255, 255)')10 cy.get('input').should('have.css', 'background-color', 'rgb(0, 0, 255)')11 cy.get('input').should('have.css', 'border-color', 'rgb(255, 0, 0)')12 cy.get('input').should('have.css', 'border-width', '1px')13 cy.get('input').should('have.css', 'border-style', 'solid')14 cy.get('input').should('have.css', 'font-family', 'sans-serif')15 cy.get('input').should('have.css', 'font-size', '16px')16 cy.get('input').should('have.css', 'font-style', 'normal')17 cy.get('input').should('have.css', 'font-variant', 'normal')18 cy.get('input').should('have.css', 'font-weight', '400')19 cy.get('input').should('have.css', 'height', '30px')20 cy.get('input').should('have.css', 'line-height', '30px')21 cy.get('input').should('have.css', 'margin-bottom', '10px')22 cy.get('input').should('have.css', 'margin-left', '0px')23 cy.get('input').should('have.css', 'margin-right', '0px')24 cy.get('input').should('have.css', 'margin-top', '0px')25 cy.get('input').should('have.css', 'max-height', 'none')26 cy.get('input').should('have.css', 'max-width', 'none')27 cy.get('input').should('have.css', 'min-height', '0px')

Full Screen

Using AI Code Generation

copy

Full Screen

1describe('Cypress demo', function() {2 it('Cypress test', function() {3 cy.get('input[name="q"]').type("cypress")4 cy.get('input[value="Google Search"]').click()5 cy.get('input[name="q"]').should('have.value', 'cypress')6 })7})

Full Screen

Using AI Code Generation

copy

Full Screen

1it('is a function', () => {2let isFunction = Cypress.isFunction(function() { })3expect(isFunction).to.be.true4})5it('is not a function', () => {6let isFunction = Cypress.isFunction('')7expect(isFunction).to.be.false8})9})10Cypress.isPlainObject()11Cypress.isPlainObject(object)12describe('Cypress.isPlainObject() method', () => {13it('is a plain object', () => {14let isPlainObject = Cypress.isPlainObject({})15expect(isPlainObject).to.be.true16})17it('is not a plain object', () => {18let isPlainObject = Cypress.isPlainObject([])19expect(isPlainObject).to.be.false20})21})22Cypress.isWindow()23Cypress.isWindow(object)24describe('Cypress.isWindow() method', () => {25it('is a window object', () => {26let isWindow = Cypress.isWindow(window)27expect(isWindow).to.be.true28})29it('is not a window

Full Screen

Cypress Tutorial

Cypress is a renowned Javascript-based open-source, easy-to-use end-to-end testing framework primarily used for testing web applications. Cypress is a relatively new player in the automation testing space and has been gaining much traction lately, as evidenced by the number of Forks (2.7K) and Stars (42.1K) for the project. LambdaTest’s Cypress Tutorial covers step-by-step guides that will help you learn from the basics till you run automation tests on LambdaTest.

Chapters:

  1. What is Cypress? -
  2. Why Cypress? - Learn why Cypress might be a good choice for testing your web applications.
  3. Features of Cypress Testing - Learn about features that make Cypress a powerful and flexible tool for testing web applications.
  4. Cypress Drawbacks - Although Cypress has many strengths, it has a few limitations that you should be aware of.
  5. Cypress Architecture - Learn more about Cypress architecture and how it is designed to be run directly in the browser, i.e., it does not have any additional servers.
  6. Browsers Supported by Cypress - Cypress is built on top of the Electron browser, supporting all modern web browsers. Learn browsers that support Cypress.
  7. Selenium vs Cypress: A Detailed Comparison - Compare and explore some key differences in terms of their design and features.
  8. Cypress Learning: Best Practices - Take a deep dive into some of the best practices you should use to avoid anti-patterns in your automation tests.
  9. How To Run Cypress Tests on LambdaTest? - Set up a LambdaTest account, and now you are all set to learn how to run Cypress tests.

Certification

You can elevate your expertise with end-to-end testing using the Cypress automation framework and stay one step ahead in your career by earning a Cypress certification. Check out our Cypress 101 Certification.

YouTube

Watch this 3 hours of complete tutorial to learn the basics of Cypress and various Cypress commands with the Cypress testing at LambdaTest.

Run Cypress automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful