Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
/*
* $Rev: 5651 $
*/
_$ = window.$;
};
// Is it a simple selector
isSimple = /^.[^:#\[\.]*$/,
undefined;
jQuery.fn = jQuery.prototype = {
init: function( selector, context ) {
// Handle $(DOMElement)
if ( selector.nodeType ) {
this[0] = selector;
this.length = 1;
return this;
if ( match[1] )
// HANDLE: $("#id")
else {
if ( elem ){
items
// by name instead of ID
if ( elem.id != match[3] )
selector = [];
} else
// HANDLE: $(function)
( selector );
return this.setArray(jQuery.makeArray(selector));
},
jquery: "1.2.5",
size: function() {
return this.length;
},
length: 0,
// Get the Nth element in the matched element set OR
jQuery.makeArray( this ) :
this[ num ];
},
ret.prevObject = this;
return ret;
},
// You should use pushStack() in order to do this, but maintain the stack
this.length = 0;
},
// (You can seed the arguments with an array of args, but this is
},
return jQuery.inArray(
, this );
},
if ( name.constructor == String )
name );
else {
options = {};
return this.each(function(i){
jQuery.attr(
type ?
this.style :
this,
name )
);
});
},
value = undefined;
},
document).createTextNode( text ) );
if ( this.nodeType != 8 )
ret += this.nodeType != 1 ?
this.nodeValue :
jQuery.fn.text( [ this ] );
});
});
return ret;
},
if ( this[0] )
.clone()
.insertBefore( this[0] )
.map(function(){
while ( elem.firstChild )
elem = elem.firstChild;
return elem;
})
.append(this);
return this;
},
return this.each(function(){
},
return this.each(function(){
});
},
append: function() {
if (this.nodeType == 1)
this.appendChild( elem );
});
},
prepend: function() {
if (this.nodeType == 1)
});
},
before: function() {
});
},
after: function() {
});
},
end: function() {
},
});
selector.indexOf("..") > -1 ?
jQuery.unique( elems ) :
elems );
},
// Do the clone
container = document.createElement("div");
container.appendChild(clone);
return jQuery.clean([container.innerHTML])[0];
} else
return this.cloneNode(true);
});
well
});
this.find("*").andSelf().each(function(i){
if (this.nodeType == 3)
return;
});
return ret;
},
return this.pushStack(
jQuery.isFunction( selector ) &&
}) ||
},
if ( selector.constructor == String )
if ( isSimple.test( selector ) )
true ) );
else
return this.filter(function() {
this != selector;
});
},
this.get(),
jQuery( selector ) :
jQuery.makeArray( selector )
)));
},
is: function( selector ) {
},
},
if ( value == undefined ) {
if ( this.length ) {
values = [],
options = elem.options,
if ( index < 0 )
return null;
if ( option.selected ) {
if ( one )
return value;
values.push( value );
return values;
} else
return undefined;
return this.each(function(){
if ( this.nodeType != 1 )
return;
this.type ) )
>= 0 ||
});
if ( !values.length )
this.selectedIndex = -1;
} else
this.value = value;
});
},
(this.length ?
this[0].innerHTML :
null) :
this.empty().append( value );
},
},
eq: function( i ) {
return this.slice( i, i + 1 );
},
slice: function() {
return this.pushStack( Array.prototype.slice.apply( this, arguments
) );
},
}));
},
andSelf: function() {
},
[parts[0]]);
this.data( parts[0] ) :
data;
} else
value]).each(function(){
});
},
return this.each(function(){
});
},
return this.each(function(){
if ( !elems ) {
if ( reverse )
elems.reverse();
obj = this.getElementsByTagName("tbody")[0] ||
this.appendChild( this.ownerDocument.createElement("tbody") );
jQuery.each(elems, function(){
this;
// execute all scripts after the elements have been
injected
} else {
if ( elem.nodeType == 1 )
elem ).remove() );
});
scripts.each( evalScript );
});
};
// Give the init function the jQuery prototype for later instantiation
jQuery.fn.init.prototype = jQuery.fn;
if ( elem.src )
jQuery.ajax({
url: elem.src,
async: false,
dataType: "script"
});
else
if ( elem.parentNode )
elem.parentNode.removeChild( elem );
function now(){
false, options;
if ( target.constructor == Boolean ) {
deep = target;
i = 2;
target = {};
if ( length == i ) {
target = this;
--i;
}
for ( ; i < length; i++ )
continue;
copy.nodeType )
, copy );
return target;
};
exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
// cache defaultView
defaultView = document.defaultView || {};
jQuery.extend({
window.$ = _$;
if ( deep )
window.jQuery = _jQuery;
return jQuery;
},
isFunction: function( fn ) {
},
},
if ( data ) {
// http://webreflection.blogspot.com/2007/08/global-scope-
evaluation-and-dom.html
script = document.createElement("script");
script.type = "text/javascript";
if ( jQuery.browser.msie )
script.text = data;
else
bug.
head.removeChild( script );
},
name.toUpperCase();
},
cache: {},
windowData :
elem;
if ( !id )
id = elem[ expando ] = ++uuid;
jQuery.cache[ id ] = {};
return name ?
jQuery.cache[ id ][ name ] :
id;
},
windowData :
elem;
if ( name ) {
if ( jQuery.cache[ id ] ) {
cache
name = "";
for ( name in jQuery.cache[ id ] )
break;
if ( !name )
jQuery.removeData( elem );
} else {
try {
} catch(e){
if ( elem.removeAttribute )
elem.removeAttribute( expando );
delete jQuery.cache[ id ];
},
if ( args ) {
if ( length == undefined ) {
break;
} else
false )
break;
} else {
if ( length == undefined ) {
break;
} else
return object;
},
if ( jQuery.isFunction( value ) )
value + "px" :
value;
},
className: {
className){
elem.className, className ) )
className;
});
},
if (elem.nodeType == 1)
jQuery.grep(elem.className.split(/\s+/),
function(className){
className );
}).join(" ") :
"";
},
},
// A method for quickly swapping in/out CSS properties to get correct
calculations
callback.call( elem );
},
"Bottom" ];
function getWH() {
elem.offsetHeight;
+ this, true)) || 0;
if ( jQuery(elem).is(":visible") )
getWH();
else
},
if ( !jQuery.browser.safari )
return false;
// defaultView is cached
ret;
// Opera sometimes will give the wrong display answer, this fixes it,
see #2037
style.outline = save;
// Make sure we're using the right name for getting the float value
if ( name.match( /float/i ) )
name = styleFloat;
else if ( defaultView.getComputedStyle ) {
if ( name.match( /float/i ) )
name = "float";
stack.unshift(a);
if ( color( stack[ i ] ) ) {
"none" :
name ) ) || "";
if ( swap[ i ] != null )
ret = "1";
} else if ( elem.currentStyle ) {
return letter.toUpperCase();
});
camelCase ];
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-
102291
pixels
elem.runtimeStyle.left = elem.currentStyle.left;
style.left = ret || 0;
style.left = left;
elem.runtimeStyle.left = rsLeft;
return ret;
},
clean: function( elems, context ) {
'object'
context[0].ownerDocument || document;
if ( !elem )
return;
if ( elem.constructor == Number )
elem += '';
front, tag){
return tag.match(/^(abbr|br|col|img|input|link|meta|
param|hr|area|embed)$/i) ?
all :
});
expected
context.createElement("div");
var wrap =
// option or optgroup
!tags.indexOf("<opt") &&
!tags.indexOf("<leg") &&
[ 1, "<fieldset>", "</fieldset>" ] ||
tags.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
[ 1, "<table>", "</table>" ] ||
!tags.indexOf("<tr") &&
[ 2, "<table><tbody>", "</tbody></table>" ] ||
[ 3, "<table><tbody><tr>", "</tr></tbody></table>" ]
||
!tags.indexOf("<col") &&
[ 2, "<table><tbody></tbody><colgroup>",
"</colgroup></table>" ] ||
normally
jQuery.browser.msie &&
[ 1, "div<div>", "</div>" ] ||
[ 0, "", "" ];
while ( wrap[0]-- )
div = div.lastChild;
if ( jQuery.browser.msie ) {
tags.indexOf("<tbody") < 0 ?
< 0 ?
div.childNodes :
[];
j ] );
innerHTML is used
if ( /^\s/.test( elem ) )
div.insertBefore( context.createTextNode(
elem.match(/^\s*/)[0] ), div.firstChild );
return;
elem.options )
ret.push( elem );
else
});
return ret;
},
return undefined;
msie = jQuery.browser.msie;
option
elem.parentNode.selectedIndex;
if ( set ){
) && elem.parentNode )
priority to attributes.
elem.getAttributeNode(name) )
if ( set )
if ( set ) {
elem.zoom = 1;
/alpha\([^)]*\)/, "" ) +
(parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) /
100) + '':
"";
return letter.toUpperCase();
});
if ( set )
},
},
var i = array.length;
ret[0] = array;
else
while( i )
ret[--i] = array[i];
return ret;
},
inArray: function( elem, array ) {
return i;
return -1;
},
// We have to loop this way because IE & Opera overwrite the length
// expando of getElementsByTagName
// Also, we need to make sure that the correct elements are being
returned
if ( jQuery.browser.msie ) {
if ( elem.nodeType != 8 )
} else
return first;
},
try {
for ( var i = 0, length = array.length; i < length; i++ ) {
if ( !done[ id ] ) {
done[ id ] = true;
ret.push( array[ i ] );
} catch( e ) {
ret = array;
return ret;
},
ret.push( elems[ i ] );
return ret;
},
if ( value != null )
});
jQuery.browser = {
userAgent )
};
"styleFloat" :
"cssFloat";
jQuery.extend({
props: {
"for": "htmlFor",
"class": "className",
"float": styleFloat,
cssFloat: styleFloat,
styleFloat: styleFloat,
readonly: "readOnly",
maxlength: "maxLength",
cellspacing: "cellSpacing"
});
jQuery.each({
siblings: function(elem){return
jQuery.sibling(elem.parentNode.firstChild,elem);},
contents: function(elem){return
jQuery.nodeName(elem,"iframe")?elem.contentDocument||
elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}
}, function(name, fn){
};
});
jQuery.each({
appendTo: "append",
prependTo: "prepend",
insertBefore: "before",
insertAfter: "after",
replaceAll: "replaceWith"
}, function(name, original){
return this.each(function(){
});
};
});
jQuery.each({
if (this.nodeType == 1)
this.removeAttribute( name );
},
},
},
toggleClass: function( classNames ) {
},
jQuery.event.remove(this);
jQuery.removeData(this);
});
if (this.parentNode)
this.parentNode.removeChild( this );
},
empty: function() {
while ( this.firstChild )
this.removeChild( this.firstChild );
}, function(name, fn){
};
});
this[0] == document ?
whichever is greater
Math.max(
Math.max(document.body["scroll" + name],
document.documentElement["scroll" + name]),
Math.max(document.body["offset" + name],
document.documentElement["offset" + name])
) :
size == undefined ?
size + "px" );
};
});
"(?:[\\w*_-]|\\\\.)" :
"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",
jQuery.extend({
expr: {
":": {
// Position Checks
// Child Checks
"first-child": function(a){return
a.parentNode.getElementsByTagName("*")[0]==a;},
"last-child": function(a){return
jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},
"only-child": function(a){return !
jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},
// Parent Checks
// Text Check
jQuery(a).text()||"").indexOf(m[3])>=0;},
// Visibility
visible: function(a){return
"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hid
den";},
jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},
// Form attributes
jQuery.attr(a,"selected");},
// Form elements
jQuery.nodeName(a,"button");},
button/i.test(a.nodeName);},
// :has()
// :header
// :animated
animated: function(a){return
jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}
},
parse: [
// Match: :contains('foo')
/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,
],
multiFilter: function( expr, elems, not ) {
old = expr;
return cur;
},
if ( typeof t != "string" )
return [ t ];
return [ ];
var r = [];
last = t;
t = jQuery.trim(t);
re = quickChild,
m = re.exec(t);
if ( m ) {
nodeName = m[1].toUpperCase();
c.nodeName.toUpperCase() == nodeName) )
r.push( c );
ret = r;
foundToken = true;
} else {
re = /^([>+~])\s*(\w*)/i;
if ( (m = re.exec(t)) != null ) {
r = [];
var merge = {};
nodeName = m[2].toUpperCase();
m = m[1];
ret[j].nextSibling : ret[j].firstChild;
for ( ; n; n = n.nextSibling )
if ( n.nodeType == 1 ) {
var id = jQuery.data(n);
if (!nodeName ||
n.nodeName.toUpperCase() == nodeName ) {
if ( m == "~" ) merge[id] =
true;
r.push( n );
if ( m == "+" ) break;
ret = r;
foundToken = true;
// matched a token
if ( t && !foundToken ) {
if ( !t.indexOf(",") ) {
r = ret = [context];
} else {
var m = re2.exec(t);
consistent
if ( m ) {
} else {
re2 = quickClass;
m = re2.exec(t);
}
m[2] = m[2].replace(/\\/g, "");
jQuery.isXMLDoc(elem) ) {
actual ID attribute
IE
if ( (jQuery.browser.msie||
jQuery.browser.opera) && oid && typeof oid.id == "string" && oid.id != m[2] )
oid = jQuery('[@id="'+m[2]+'"]',
elem)[0];
applicable) so
} else {
<object>s
ret[i].nodeName.toLowerCase() == "object" )
tag = "param";
r = jQuery.merge( r,
with it
if ( m[1] == "." )
r = jQuery.classFilter( r, m[2] );
if ( m[1] == "#" ) {
if ( r[i].getAttribute("id") ==
m[2] ) {
tmp = [ r[i] ];
break;
r = tmp;
ret = r;
}
t = t.replace( re2, "" );
if ( t ) {
// Attempt to filter it
ret = r = val.r;
t = jQuery.trim(val.t);
if ( t )
ret = [];
ret.shift();
return done;
},
classFilter: function(r,m,not){
tmp.push( r[i] );
return tmp;
},
filter: function(t,r,not) {
var last;
last = t;
var p = jQuery.parse, m;
m = p[i].exec( t );
if ( m ) {
t = t.substring( m[0].length );
break;
if ( !m )
break;
r = isSimple.test( m[3] ) ?
jQuery.filter(m[3], r, true).r :
if ( z == null || /href|src|selected/.test(m[2]) )
z = jQuery.attr(a,m[2]) || '';
m[5].length) == m[5] ||
tmp.push( a );
r = tmp;
// We can get a speed boost by handling nth-child here
test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
"2n+1" ||
test[3] - 0;
jQuery.data(parentNode);
if ( !merge[id] ) {
var c = 1;
n.nextSibling )
if ( n.nodeType == 1 )
n.nodeIndex = c++;
merge[id] = true;
if ( first == 0 ) {
if ( node.nodeIndex == last )
add = true;
add = true;
if ( add ^ not )
tmp.push( node );
r = tmp;
} else {
if ( typeof fn == "object" )
fn = fn[ m[2] ];
if ( typeof fn == "string" )
fn = eval("false||function(a,i){return " + fn +
";}");
}, not );
return { r: r, t: t };
},
dir: function( elem, dir ){
cur = elem[dir];
if ( cur.nodeType == 1 )
matched.push( cur );
cur = cur[dir];
return matched;
},
nth: function(cur,result,dir,elem){
result = result || 1;
var num = 0;
break;
return cur;
},
var r = [];
for ( ; n; n = n.nextSibling ) {
r.push( n );
return r;
}
});
/*
*/
jQuery.event = {
if ( elem.nodeType == 3 || elem.nodeType == 8 )
return;
elem = window;
if ( !handler.guid )
handler.guid = this.guid++;
var fn = handler;
handler
handler.data = data;
{}),
"handle", function(){
jQuery.event.triggered )
return
jQuery.event.handle.apply(arguments.callee.elem, arguments);
});
// event in IE.
handle.elem = elem;
type = parts[0];
handler.type = parts[1];
if (!handlers) {
if ( !jQuery.event.special[type] ||
if (elem.addEventListener)
else if (elem.attachEvent)
handlers[handler.guid] = handler;
triggering
jQuery.event.global[type] = true;
});
elem = null;
},
guid: 1,
global: {},
// Detach an event or set of events from an element
if ( elem.nodeType == 3 || elem.nodeType == 8 )
return;
if ( events ) {
types.charAt(0) == ".") )
else {
if ( types.type ) {
handler = types.handler;
types = types.type;
type = parts[0];
if ( events[type] ) {
if ( handler )
delete events[type][handler.guid];
// remove all handlers for the given type
else
events
if ( !parts[1] ||
events[type][handler].type == parts[1] )
delete events[type][handler];
handlers exist
if ( !ret ) {
if ( !jQuery.event.special[type] ||
if (elem.removeEventListener)
else if (elem.detachEvent)
elem.detachEvent("on" + type,
jQuery.data(elem, "handle"));
ret = null;
delete events[type];
});
if ( !ret ) {
},
data = jQuery.makeArray(data);
if ( type.indexOf("!") >= 0 ) {
if ( !elem ) {
if ( this.global[type] )
} else {
if ( elem.nodeType == 3 || elem.nodeType == 8 )
return undefined;
data.unshift({
type: type,
target: elem,
preventDefault: function(){},
stopPropagation: function(){},
timeStamp: now()
});
data[0].type = type;
if ( exclusive )
data[0].exclusive = true;
if ( handle )
val = false;
if ( event )
data.shift();
val ) );
val = ret;
this.triggered = true;
try {
elements
} catch (e) {}
this.triggered = false;
return val;
},
handle: function(event) {
namespace = event.type.split(".");
event.type = namespace[0];
namespace = namespace[1];
event.handler = handler;
event.data = handler.data;
val = ret;
event.preventDefault();
event.stopPropagation();
return val;
},
fix: function(event) {
if ( event[expando] == true )
return event;
// Mark it as fixed
event[expando] = true;
event.preventDefault = function() {
if (originalEvent.preventDefault)
originalEvent.preventDefault();
to false (IE)
originalEvent.returnValue = false;
};
event.stopPropagation = function() {
if (originalEvent.stopPropagation)
originalEvent.stopPropagation();
to true (IE)
originalEvent.cancelBubble = true;
};
// Fix timeStamp
if ( !event.target )
if ( event.target.nodeType == 3 )
event.target = event.target.parentNode;
event.toElement : event.fromElement;
event.charCode : event.keyCode) )
// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for
Macs)
event.metaKey = event.ctrlKey;
return event;
},
it can be removed
return proxy;
},
special: {
ready: {
setup: function() {
bindReady();
return;
},
teardown: function() { return; }
},
mouseenter: {
setup: function() {
jQuery(this).bind("mouseover",
jQuery.event.special.mouseenter.handler);
return true;
},
teardown: function() {
jQuery(this).unbind("mouseover",
jQuery.event.special.mouseenter.handler);
return true;
},
handler: function(event) {
it
mouseenter
event.type = "mouseenter";
},
mouseleave: {
setup: function() {
jQuery.event.special.mouseleave.handler);
return true;
},
teardown: function() {
jQuery(this).unbind("mouseout",
jQuery.event.special.mouseleave.handler);
return true;
},
handler: function(event) {
it
mouseleave
event.type = "mouseleave";
};
jQuery.fn.extend({
this.each(function(){
});
},
one: function( type, data, fn ) {
jQuery(this).unbind(event, one);
});
return this.each(function(){
});
},
return this.each(function(){
});
},
return this.each(function(){
});
},
fn );
},
toggle: function( fn ) {
// link all the functions, so any of them can unbind this click handler
this.lastToggle = ( this.lastToggle || 0 ) % i;
event.preventDefault();
false;
}));
},
},
ready: function(fn) {
bindReady();
if ( jQuery.isReady )
else
} );
return this;
});
jQuery.extend({
isReady: false,
readyList: [],
ready: function() {
if ( !jQuery.isReady ) {
jQuery.isReady = true;
if ( jQuery.readyList ) {
this.call( document );
});
jQuery.readyList = null;
jQuery(document).triggerHandler("ready");
});
if ( readyBound ) return;
readyBound = true;
// Mozilla, Opera (see further below for it) and webkit nightlies currently
if (jQuery.isReady) return;
try {
// http://javascript.nwbox.com/IEContentLoaded/
document.documentElement.doScroll("left");
} catch( error ) {
setTimeout( arguments.callee, 0 );
return;
jQuery.ready();
})();
if ( jQuery.browser.opera )
if (jQuery.isReady) return;
if (document.styleSheets[i].disabled) {
setTimeout( arguments.callee, 0 );
return;
jQuery.ready();
}, false);
if ( jQuery.browser.safari ) {
var numStyles;
(function(){
if (jQuery.isReady) return;
"complete" ) {
setTimeout( arguments.callee, 0 );
return;
if ( document.styleSheets.length != numStyles ) {
setTimeout( arguments.callee, 0 );
return;
jQuery.ready();
})();
jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
"mousedown,mouseup,mousemove,mouseover,mouseout,change,select," +
jQuery.fn[name] = function(fn){
};
});
};
// And prevent errors on refresh with events like mouseover in other browsers
jQuery(window).bind("unload", function() {
jQuery("*").add(document).unbind();
});
jQuery.fn.extend({
_load: jQuery.fn.load,
if ( off >= 0 ) {
if ( params )
// If it's a function
if ( jQuery.isFunction( params ) ) {
callback = params;
params = null;
} else {
type = "POST";
jQuery.ajax({
url: url,
type: type,
dataType: "html",
data: params,
complete: function(res, status){
elements
self.html( selector ?
jQuery("<div/>")
errors in IE
append(res.responseText.replace(/<script(.|\s)*?\/script>/g, ""))
.find(selector) :
res.responseText );
});
return this;
},
serialize: function() {
return jQuery.param(this.serializeArray());
},
serializeArray: function() {
return this.map(function(){
})
.filter(function(){
(this.checked || /select|textarea/i.test(this.nodeName) ||
/text|hidden|password/i.test(this.type));
})
.map(function(i, elem){
val.constructor == Array ?
}) :
}).get();
});
jQuery.each(
"ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),
function(i,o){
jQuery.fn[o] = function(f){
};
});
jQuery.extend({
callback = data;
data = null;
return jQuery.ajax({
type: "GET",
url: url,
data: data,
success: callback,
dataType: type
});
},
},
},
if ( jQuery.isFunction( data ) ) {
callback = data;
data = {};
return jQuery.ajax({
type: "POST",
url: url,
data: data,
success: callback,
dataType: type
});
},
},
ajaxSettings: {
url: location.href,
global: true,
type: "GET",
timeout: 0,
contentType: "application/x-www-form-urlencoded",
processData: true,
async: true,
data: null,
username: null,
password: null,
accepts: {
html: "text/html",
text: "text/plain",
_default: "*/*"
},
lastModified: {},
ajax: function( s ) {
// Extend the settings, but re-extend 's' so that it can be
s));
type = s.type.toUpperCase();
s.data = jQuery.param(s.data);
if ( s.dataType == "jsonp" ) {
if ( type == "GET" ) {
if ( !s.url.match(jsre) )
|| "callback") + "=?";
"callback") + "=?";
s.dataType = "json";
s.url.match(jsre)) ) {
// Replace the =? sequence both in the query string and the data
if ( s.data )
s.dataType = "script";
data = tmp;
success();
complete();
// Garbage collect
if ( head )
head.removeChild( script );
};
s.cache = false;
var ts = now();
"_=" + ts : "");
s.data = null;
jQuery.event.trigger( "ajaxStart" );
location.host ){
script.src = s.url;
if (s.scriptCharset)
script.charset = s.scriptCharset;
if ( !jsonp ) {
this.readyState == "loaded" ||
this.readyState == "complete") ) {
done = true;
success();
complete();
head.removeChild( script );
};
head.appendChild(script);
return undefined;
when it is available
: new XMLHttpRequest();
if( s.username )
else
try {
if ( s.data )
xhr.setRequestHeader("Content-Type", s.contentType);
// Set the If-Modified-Since header, if ifModified mode.
if ( s.ifModified )
xhr.setRequestHeader("If-Modified-Since",
00:00:00 GMT" );
XMLHttpRequest
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
dataType
s.dataType ] ?
s.accepts._default );
} catch(e){}
xhr.abort();
return false;
if ( s.global )
"timeout") ) {
requestDone = true;
if (ival) {
clearInterval(ival);
ival = null;
&& "notmodified" ||
"success";
if ( status == "success" ) {
try {
s.dataFilter );
} catch(e) {
status = "parsererror";
if ( status == "success" ) {
try {
modRes = xhr.getResponseHeader("Last-
Modified");
jQuery.lastModified[s.url] = modRes;
if ( !jsonp )
success();
} else
complete();
if ( s.async )
xhr = null;
};
if ( s.async ) {
// Timeout checker
if ( s.timeout > 0 )
setTimeout(function(){
xhr.abort();
if( !requestDone )
onreadystatechange( "timeout" );
}, s.timeout);
try {
xhr.send(s.data);
} catch(e) {
if ( !s.async )
onreadystatechange();
function success(){
data
if ( s.success )
if ( s.global )
function complete(){
// Process result
if ( s.complete )
s.complete(xhr, status);
if ( s.global )
jQuery.event.trigger( "ajaxStop" );
return xhr;
},
if ( s.global )
},
active: 0,
try {
} catch(e){}
return false;
},
try {
} catch(e){}
return false;
},
var ct = xhr.getResponseHeader("content-type"),
throw "parsererror";
if( filter )
if ( type == "script" )
jQuery.globalEval( data );
if ( type == "json" )
return data;
},
param: function( a ) {
var s = [];
// of form elements
jQuery.each( a, function(){
encodeURIComponent( this.value ) );
});
else
for ( var j in a )
repeated
encodeURIComponent( this ) );
});
else
});
jQuery.fn.extend({
show: function(speed,callback){
return speed ?
this.animate({
}, speed, callback) :
this.filter(":hidden").each(function(){
if ( jQuery.css(this,"display") == "none" ) {
/>").appendTo("body");
this.style.display = elem.css("display");
{ display:none; } or similar
if (this.style.display == "none")
this.style.display = "block";
elem.remove();
}).end();
},
hide: function(speed,callback){
return speed ?
this.animate({
}, speed, callback) :
this.filter(":visible").each(function(){
this.oldblock = this.oldblock ||
jQuery.css(this,"display");
this.style.display = "none";
}).end();
},
_toggle: jQuery.fn.toggle,
fn ?
this.animate({
}, fn, fn2) :
this.each(function(){
"hide" ]();
});
},
slideDown: function(speed,callback){
},
slideUp: function(speed,callback){
},
},
},
},
fadeTo: function(speed,to,callback){
},
if ( this.nodeType != 1)
return false;
for ( p in prop ) {
return opt.complete.call(this);
if ( p == "height" || p == "width" ) {
opt.overflow = this.style.overflow;
if ( opt.overflow != null )
this.style.overflow = "hidden";
if ( /toggle|show|hide/.test(val) )
( prop );
else {
+)(.*)$/),
start = e.cur(true) || 0;
if ( parts ) {
start;
relative animation
if ( parts[1] )
+ start;
} else
});
return true;
});
},
fn = type;
type = "fx";
if ( fn.constructor == Array )
else {
queue(this, type).push( fn );
if ( queue(this, type).length == 1 )
fn.call(this);
});
},
if (clearQueue)
this.queue([]);
this.each(function(){
loop is ignored
if ( timers[i].elem == this ) {
if (gotoEnd)
timers[i](true);
timers.splice(i, 1);
});
// start the next in the queue if the last step wasn't forced
if (!gotoEnd)
this.dequeue();
return this;
});
if ( elem ){
if ( !q || array )
return q;
};
jQuery.fn.dequeue = function(type){
return this.each(function(){
q.shift();
if ( q.length )
q[0].call( this );
});
};
jQuery.extend({
duration: speed,
&& easing
};
opt.duration :
jQuery.fx.speeds[opt.duration]) || jQuery.fx.speeds.def;
// Queueing
opt.old = opt.complete;
opt.complete = function(){
jQuery(this).dequeue();
if ( jQuery.isFunction( opt.old ) )
opt.old.call( this );
};
return opt;
},
easing: {
},
},
timers: [],
timerId: null,
this.options = options;
this.elem = elem;
this.prop = prop;
if ( !options.orig )
options.orig = {};
});
jQuery.fx.prototype = {
update: function(){
if ( this.options.step )
this.elem.style.display = "block";
},
this.prop)) || 0;
},
this.startTime = now();
this.start = from;
this.end = to;
this.now = this.start;
this.pos = this.state = 0;
this.update();
function t(gotoEnd){
return self.step(gotoEnd);
t.elem = this.elem;
jQuery.timers.push(t);
if ( jQuery.timerId == null ) {
jQuery.timerId = setInterval(function(){
if ( !timers[i]() )
timers.splice(i--, 1);
if ( !timers.length ) {
clearInterval( jQuery.timerId );
jQuery.timerId = null;
}, 13);
},
show: function(){
this.prop );
this.options.show = true;
this.custom(0, this.cur());
// flash of content
this.elem.style[this.prop] = "1px";
jQuery(this.elem).show();
},
hide: function(){
// Remember where we started, so that we can go back to it later
this.prop );
this.options.hide = true;
this.custom(this.cur(), 0);
},
step: function(gotoEnd){
var t = now();
this.now = this.end;
this.pos = this.state = 1;
this.update();
done = false;
if ( done ) {
if ( this.options.display != null ) {
this.elem.style.overflow = this.options.overflow;
this.elem.style.display = this.options.display;
if ( this.options.hide )
this.elem.style.display = "none";
shown
if ( this.options.hide || this.options.show )
jQuery.attr(this.elem.style, p,
this.options.orig[p]);
if ( done )
this.options.complete.call( this.elem );
return false;
} else {
var n = t - this.startTime;
this.state = n / this.options.duration;
this.pos = jQuery.easing[this.options.easing ||
this.options.duration);
this.update();
}
return true;
};
jQuery.extend( jQuery.fx, {
speeds:{
slow: 600,
fast: 200,
// Default speed
def: 400
},
step: {
scrollLeft: function(fx){
fx.elem.scrollLeft = fx.now;
},
scrollTop: function(fx){
fx.elem.scrollTop = fx.now;
},
opacity: function(fx){
},
_default: function(fx){
});
jQuery.fn.offset = function() {
offsetChild = elem,
offsetParent = elem.offsetParent,
doc = elem.ownerDocument,
/adobeair/i.test(userAgent),
css = jQuery.curCSS,
if ( elem.getBoundingClientRect ) {
add(box.left + Math.max(doc.documentElement.scrollLeft,
doc.body.scrollLeft),
box.top + Math.max(doc.documentElement.scrollTop,
doc.body.scrollTop));
which is 2px
quirksmode
documentElement.clientTop );
} else {
while ( offsetParent ) {
offset parents
border( offsetParent );
any offsetParent
fixed = true;
offsetChild = /^body$/i.test(offsetParent.tagName) ?
offsetChild : offsetParent;
html$/i.test(parent.tagName) ) {
if ( !/^inline|table.*$/i.test(css(parent, "display")) )
// Mozilla does not add the border for a parent that has
overflow != visible
border( parent );
parent = parent.parentNode;
offsetChild
"absolute")) ||
if ( fixed )
add(Math.max(doc.documentElement.scrollLeft,
doc.body.scrollLeft),
Math.max(doc.documentElement.scrollTop,
doc.body.scrollTop));
function border(elem) {
"borderTopWidth", true) );
function add(l, t) {
return results;
};
jQuery.fn.extend({
position: function() {
if ( this[0] ) {
offset = this.offset(),
parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ?
marginLeft
results = {
};
return results;
},
offsetParent: function() {
offsetParent = offsetParent.offsetParent;
return jQuery(offsetParent);
});
// Create scrollLeft and scrollTop methods
if (!this[0]) return;
this.each(function() {
window.scrollTo(
!i ? val : jQuery(window).scrollLeft(),
i ? val : jQuery(window).scrollTop()
) :
}) :
||
document.body[ method ] :
this[0][ method ];
};
});
};
(margin ?
};
});})();