summaryrefslogtreecommitdiff
path: root/share/www
diff options
context:
space:
mode:
Diffstat (limited to 'share/www')
-rw-r--r--share/www/config.html2
-rw-r--r--share/www/couch_tests.html2
-rw-r--r--share/www/custom_test.html2
-rw-r--r--share/www/database.html2
-rw-r--r--share/www/document.html2
-rw-r--r--share/www/index.html2
-rw-r--r--share/www/replicator.html2
-rw-r--r--share/www/script/jquery.js1381
-rw-r--r--share/www/status.html2
9 files changed, 819 insertions, 578 deletions
diff --git a/share/www/config.html b/share/www/config.html
index 212f8b57..dde897f9 100644
--- a/share/www/config.html
+++ b/share/www/config.html
@@ -20,7 +20,7 @@ specific language governing permissions and limitations under the License.
<link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
<script src="script/json2.js"></script>
<script src="script/sha1.js"></script>
- <script src="script/jquery.js?1.4.0"></script>
+ <script src="script/jquery.js?1.4.2"></script>
<script src="script/jquery.couch.js?0.11.0"></script>
<script src="script/jquery.dialog.js?0.11.0"></script>
<script src="script/futon.js?0.11.0"></script>
diff --git a/share/www/couch_tests.html b/share/www/couch_tests.html
index 16819d04..0d09a4af 100644
--- a/share/www/couch_tests.html
+++ b/share/www/couch_tests.html
@@ -20,7 +20,7 @@ specific language governing permissions and limitations under the License.
<link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
<script src="script/json2.js"></script>
<script src="script/sha1.js"></script>
- <script src="script/jquery.js?1.4.0"></script>
+ <script src="script/jquery.js?1.4.2"></script>
<script src="script/jquery.couch.js?0.11.0"></script>
<script src="script/jquery.dialog.js?0.11.0"></script>
<script src="script/futon.js?0.11.0"></script>
diff --git a/share/www/custom_test.html b/share/www/custom_test.html
index a7774612..d0f4bdda 100644
--- a/share/www/custom_test.html
+++ b/share/www/custom_test.html
@@ -20,7 +20,7 @@ specific language governing permissions and limitations under the License.
<link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
<script src="script/json2.js"></script>
<script src="script/sha1.js"></script>
- <script src="script/jquery.js?1.4.0"></script>
+ <script src="script/jquery.js?1.4.2"></script>
<script src="script/jquery.couch.js?0.11.0"></script>
<script src="script/jquery.dialog.js?0.11.0"></script>
<script src="script/futon.js?0.11.0"></script>
diff --git a/share/www/database.html b/share/www/database.html
index 7bc04c11..5142ed1b 100644
--- a/share/www/database.html
+++ b/share/www/database.html
@@ -20,7 +20,7 @@ specific language governing permissions and limitations under the License.
<link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
<script src="script/json2.js"></script>
<script src="script/sha1.js"></script>
- <script src="script/jquery.js?1.4.0"></script>
+ <script src="script/jquery.js?1.4.2"></script>
<script src="script/jquery.couch.js?0.11.0"></script>
<script src="script/jquery.dialog.js?0.11.0"></script>
<script src="script/futon.js?0.11.0"></script>
diff --git a/share/www/document.html b/share/www/document.html
index 02185e30..3c4c7628 100644
--- a/share/www/document.html
+++ b/share/www/document.html
@@ -20,7 +20,7 @@ specific language governing permissions and limitations under the License.
<link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
<script src="script/json2.js"></script>
<script src="script/sha1.js"></script>
- <script src="script/jquery.js?1.4.0"></script>
+ <script src="script/jquery.js?1.4.2"></script>
<script src="script/jquery.couch.js?0.11.0"></script>
<script src="script/jquery.dialog.js?0.11.0"></script>
<script src="script/futon.js?0.11.0"></script>
diff --git a/share/www/index.html b/share/www/index.html
index ea7bbb28..e34dbde1 100644
--- a/share/www/index.html
+++ b/share/www/index.html
@@ -20,7 +20,7 @@ specific language governing permissions and limitations under the License.
<link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
<script src="script/json2.js"></script>
<script src="script/sha1.js"></script>
- <script src="script/jquery.js?1.4.0"></script>
+ <script src="script/jquery.js?1.4.2"></script>
<script src="script/jquery.couch.js?0.11.0"></script>
<script src="script/jquery.dialog.js?0.11.0"></script>
<script src="script/futon.js?0.11.0"></script>
diff --git a/share/www/replicator.html b/share/www/replicator.html
index 2aa88721..6d980cbd 100644
--- a/share/www/replicator.html
+++ b/share/www/replicator.html
@@ -20,7 +20,7 @@ specific language governing permissions and limitations under the License.
<link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
<script src="script/json2.js"></script>
<script src="script/sha1.js"></script>
- <script src="script/jquery.js?1.4.0"></script>
+ <script src="script/jquery.js?1.4.2"></script>
<script src="script/jquery.couch.js?0.11.0"></script>
<script src="script/jquery.dialog.js?0.11.0"></script>
<script src="script/futon.js?0.11.0"></script>
diff --git a/share/www/script/jquery.js b/share/www/script/jquery.js
index a448490e..fff67764 100644
--- a/share/www/script/jquery.js
+++ b/share/www/script/jquery.js
@@ -1,17 +1,17 @@
/*!
- * jQuery JavaScript Library v1.4
+ * jQuery JavaScript Library v1.4.2
* http://jquery.com/
*
* Copyright 2010, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
- * http://docs.jquery.com/License
+ * http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
* Copyright 2010, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
*
- * Date: Wed Jan 13 15:23:05 2010 -0500
+ * Date: Sat Feb 13 22:33:48 2010 -0500
*/
(function( window, undefined ) {
@@ -86,6 +86,15 @@ jQuery.fn = jQuery.prototype = {
this.length = 1;
return this;
}
+
+ // The body element only exists once, optimize finding it
+ if ( selector === "body" && !context ) {
+ this.context = document;
+ this[0] = document.body;
+ this.selector = "body";
+ this.length = 1;
+ return this;
+ }
// Handle HTML strings
if ( typeof selector === "string" ) {
@@ -116,7 +125,9 @@ jQuery.fn = jQuery.prototype = {
ret = buildFragment( [ match[1] ], [ doc ] );
selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
}
-
+
+ return jQuery.merge( this, selector );
+
// HANDLE: $("#id")
} else {
elem = document.getElementById( match[2] );
@@ -143,6 +154,7 @@ jQuery.fn = jQuery.prototype = {
this.selector = selector;
this.context = document;
selector = document.getElementsByTagName( selector );
+ return jQuery.merge( this, selector );
// HANDLE: $(expr, $(...))
} else if ( !context || context.jquery ) {
@@ -165,16 +177,14 @@ jQuery.fn = jQuery.prototype = {
this.context = selector.context;
}
- return jQuery.isArray( selector ) ?
- this.setArray( selector ) :
- jQuery.makeArray( selector, this );
+ return jQuery.makeArray( selector, this );
},
// Start with an empty selector
selector: "",
// The current version of jQuery being used
- jquery: "1.4",
+ jquery: "1.4.2",
// The default length of a jQuery object is 0
length: 0,
@@ -204,7 +214,14 @@ jQuery.fn = jQuery.prototype = {
// (returning the new matched element set)
pushStack: function( elems, name, selector ) {
// Build a new jQuery matched element set
- var ret = jQuery( elems || null );
+ var ret = jQuery();
+
+ if ( jQuery.isArray( elems ) ) {
+ push.apply( ret, elems );
+
+ } else {
+ jQuery.merge( ret, elems );
+ }
// Add the old object onto the stack (as a reference)
ret.prevObject = this;
@@ -221,18 +238,6 @@ jQuery.fn = jQuery.prototype = {
return ret;
},
- // Force the current matched set of elements to become
- // the specified array of elements (destroying the stack in the process)
- // You should use pushStack() in order to do this, but maintain the stack
- setArray: function( elems ) {
- // Resetting the length to 0, then using the native Array push
- // is a super-fast way to populate an object with array-like properties
- this.length = 0;
- push.apply( this, elems );
-
- return this;
- },
-
// Execute a callback for every element in the matched set.
// (You can seed the arguments with an array of args, but this is
// only used internally.)
@@ -483,6 +488,34 @@ jQuery.extend({
}
return true;
},
+
+ error: function( msg ) {
+ throw msg;
+ },
+
+ parseJSON: function( data ) {
+ if ( typeof data !== "string" || !data ) {
+ return null;
+ }
+
+ // Make sure leading/trailing whitespace is removed (IE can't handle it)
+ data = jQuery.trim( data );
+
+ // Make sure the incoming data is actual JSON
+ // Logic borrowed from http://json.org/json2.js
+ if ( /^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
+ .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]")
+ .replace(/(?:^|:|,)(?:\s*\[)+/g, "")) ) {
+
+ // Try to use the native JSON parser first
+ return window.JSON && window.JSON.parse ?
+ window.JSON.parse( data ) :
+ (new Function("return " + data))();
+
+ } else {
+ jQuery.error( "Invalid JSON: " + data );
+ }
+ },
noop: function() {},
@@ -594,6 +627,7 @@ jQuery.extend({
for ( var l = second.length; j < l; j++ ) {
first[ i++ ] = second[ j ];
}
+
} else {
while ( second[j] !== undefined ) {
first[ i++ ] = second[ j++ ];
@@ -670,26 +704,15 @@ jQuery.extend({
// Use of jQuery.browser is frowned upon.
// More details: http://docs.jquery.com/Utilities/jQuery.browser
uaMatch: function( ua ) {
- var ret = { browser: "" };
-
ua = ua.toLowerCase();
- if ( /webkit/.test( ua ) ) {
- ret = { browser: "webkit", version: /webkit[\/ ]([\w.]+)/ };
+ var match = /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
+ /(opera)(?:.*version)?[ \/]([\w.]+)/.exec( ua ) ||
+ /(msie) ([\w.]+)/.exec( ua ) ||
+ !/compatible/.test( ua ) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec( ua ) ||
+ [];
- } else if ( /opera/.test( ua ) ) {
- ret = { browser: "opera", version: /version/.test( ua ) ? /version[\/ ]([\w.]+)/ : /opera[\/ ]([\w.]+)/ };
-
- } else if ( /msie/.test( ua ) ) {
- ret = { browser: "msie", version: /msie ([\w.]+)/ };
-
- } else if ( /mozilla/.test( ua ) && !/compatible/.test( ua ) ) {
- ret = { browser: "mozilla", version: /rv:([\w.]+)/ };
- }
-
- ret.version = (ret.version && ret.version.exec( ua ) || [0, "0"])[1];
-
- return ret;
+ return { browser: match[1] || "", version: match[2] || "0" };
},
browser: {}
@@ -751,12 +774,6 @@ function doScrollCheck() {
jQuery.ready();
}
-if ( indexOf ) {
- jQuery.inArray = function( elem, array ) {
- return indexOf.call( array, elem );
- };
-}
-
function evalScript( i, elem ) {
if ( elem.src ) {
jQuery.ajax({
@@ -799,7 +816,7 @@ function access( elems, key, value, exec, fn, pass ) {
}
// Getting an attribute
- return length ? fn( elems[0], key ) : null;
+ return length ? fn( elems[0], key ) : undefined;
}
function now() {
@@ -863,7 +880,11 @@ function now() {
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
optSelected: document.createElement("select").appendChild( document.createElement("option") ).selected,
+ parentNode: div.removeChild( div.appendChild( document.createElement("div") ) ).parentNode === null,
+
// Will be defined later
+ deleteExpando: true,
+ checkClone: false,
scriptEval: false,
noCloneEvent: true,
boxModel: null
@@ -884,6 +905,15 @@ function now() {
delete window[ id ];
}
+ // Test to see if it's possible to delete an expando from an element
+ // Fails in Internet Explorer
+ try {
+ delete script.test;
+
+ } catch(e) {
+ jQuery.support.deleteExpando = false;
+ }
+
root.removeChild( script );
if ( div.attachEvent && div.fireEvent ) {
@@ -896,9 +926,17 @@ function now() {
div.cloneNode(true).fireEvent("onclick");
}
+ div = document.createElement("div");
+ div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>";
+
+ var fragment = document.createDocumentFragment();
+ fragment.appendChild( div.firstChild );
+
+ // WebKit doesn't clone checked state correctly in fragments
+ jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;
+
// Figure out if the W3C box model works as expected
// document.body must exist before we can do this
- // TODO: This timeout is temporary until I move ready into core.js.
jQuery(function() {
var div = document.createElement("div");
div.style.width = div.style.paddingLeft = "1px";
@@ -906,6 +944,7 @@ function now() {
document.body.appendChild( div );
jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
document.body.removeChild( div ).style.display = 'none';
+
div = null;
});
@@ -945,7 +984,6 @@ jQuery.props = {
frameborder: "frameBorder"
};
var expando = "jQuery" + now(), uuid = 0, windowData = {};
-var emptyObject = {};
jQuery.extend({
cache: {},
@@ -971,8 +1009,7 @@ jQuery.extend({
var id = elem[ expando ], cache = jQuery.cache, thisCache;
- // Handle the case where there's no name immediately
- if ( !name && !id ) {
+ if ( !id && typeof name === "string" && data === undefined ) {
return null;
}
@@ -986,17 +1023,16 @@ jQuery.extend({
if ( typeof name === "object" ) {
elem[ expando ] = id;
thisCache = cache[ id ] = jQuery.extend(true, {}, name);
- } else if ( cache[ id ] ) {
- thisCache = cache[ id ];
- } else if ( typeof data === "undefined" ) {
- thisCache = emptyObject;
- } else {
- thisCache = cache[ id ] = {};
+
+ } else if ( !cache[ id ] ) {
+ elem[ expando ] = id;
+ cache[ id ] = {};
}
+ thisCache = cache[ id ];
+
// Prevent overriding the named cache with undefined values
if ( data !== undefined ) {
- elem[ expando ] = id;
thisCache[ name ] = data;
}
@@ -1028,15 +1064,11 @@ jQuery.extend({
// Otherwise, we want to remove all of the element's data
} else {
- // Clean up the element expando
- try {
- delete elem[ expando ];
- } catch( e ) {
- // IE has trouble directly removing the expando
- // but it's ok with using removeAttribute
- if ( elem.removeAttribute ) {
- elem.removeAttribute( expando );
- }
+ if ( jQuery.support.deleteExpando ) {
+ delete elem[ jQuery.expando ];
+
+ } else if ( elem.removeAttribute ) {
+ elem.removeAttribute( jQuery.expando );
}
// Completely remove the data cache
@@ -1213,12 +1245,13 @@ jQuery.fn.extend({
elem.className = value;
} else {
- var className = " " + elem.className + " ";
+ var className = " " + elem.className + " ", setClass = elem.className;
for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
- elem.className += " " + classNames[c];
+ setClass += " " + classNames[c];
}
}
+ elem.className = jQuery.trim( setClass );
}
}
}
@@ -1247,7 +1280,7 @@ jQuery.fn.extend({
for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
className = className.replace(" " + classNames[c] + " ", " ");
}
- elem.className = className.substring(1, className.length - 1);
+ elem.className = jQuery.trim( className );
} else {
elem.className = "";
@@ -1454,7 +1487,7 @@ jQuery.extend({
if ( set ) {
// We can't allow the type property to be changed (since it causes problems in IE)
if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
- throw "type property can't be changed";
+ jQuery.error( "type property can't be changed" );
}
elem[ name ] = value;
@@ -1503,15 +1536,16 @@ jQuery.extend({
}
// elem is actually elem.style ... set the style
- // Using attr for specific style information is now deprecated. Use style insead.
+ // Using attr for specific style information is now deprecated. Use style instead.
return jQuery.style( elem, name, value );
}
});
-var fcleanup = function( nm ) {
- return nm.replace(/[^\w\s\.\|`]/g, function( ch ) {
- return "\\" + ch;
- });
-};
+var rnamespaces = /\.(.*)$/,
+ fcleanup = function( nm ) {
+ return nm.replace(/[^\w\s\.\|`]/g, function( ch ) {
+ return "\\" + ch;
+ });
+ };
/*
* A number of helper functions used for managing events.
@@ -1533,96 +1567,104 @@ jQuery.event = {
elem = window;
}
+ var handleObjIn, handleObj;
+
+ if ( handler.handler ) {
+ handleObjIn = handler;
+ handler = handleObjIn.handler;
+ }
+
// Make sure that the function being executed has a unique ID
if ( !handler.guid ) {
handler.guid = jQuery.guid++;
}
- // if data is passed, bind to handler
- if ( data !== undefined ) {
- // Create temporary function pointer to original handler
- var fn = handler;
-
- // Create unique handler function, wrapped around original handler
- handler = jQuery.proxy( fn );
+ // Init the element's event structure
+ var elemData = jQuery.data( elem );
- // Store data in unique handler
- handler.data = data;
+ // If no elemData is found then we must be trying to bind to one of the
+ // banned noData elements
+ if ( !elemData ) {
+ return;
}
- // Init the element's event structure
- var events = jQuery.data( elem, "events" ) || jQuery.data( elem, "events", {} ),
- handle = jQuery.data( elem, "handle" ), eventHandle;
+ var events = elemData.events = elemData.events || {},
+ eventHandle = elemData.handle, eventHandle;
- if ( !handle ) {
- eventHandle = function() {
+ if ( !eventHandle ) {
+ elemData.handle = eventHandle = function() {
// Handle the second event of a trigger and when
// an event is called after a page has unloaded
return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
jQuery.event.handle.apply( eventHandle.elem, arguments ) :
undefined;
};
-
- handle = jQuery.data( elem, "handle", eventHandle );
- }
-
- // If no handle is found then we must be trying to bind to one of the
- // banned noData elements
- if ( !handle ) {
- return;
}
// Add elem as a property of the handle function
- // This is to prevent a memory leak with non-native
- // event in IE.
- handle.elem = elem;
+ // This is to prevent a memory leak with non-native events in IE.
+ eventHandle.elem = elem;
// Handle multiple events separated by a space
// jQuery(...).bind("mouseover mouseout", fn);
- types = types.split( /\s+/ );
- var type, i=0;
+ types = types.split(" ");
+
+ var type, i = 0, namespaces;
+
while ( (type = types[ i++ ]) ) {
+ handleObj = handleObjIn ?
+ jQuery.extend({}, handleObjIn) :
+ { handler: handler, data: data };
+
// Namespaced event handlers
- var namespaces = type.split(".");
- type = namespaces.shift();
- handler.type = namespaces.slice(0).sort().join(".");
+ if ( type.indexOf(".") > -1 ) {
+ namespaces = type.split(".");
+ type = namespaces.shift();
+ handleObj.namespace = namespaces.slice(0).sort().join(".");
+
+ } else {
+ namespaces = [];
+ handleObj.namespace = "";
+ }
+
+ handleObj.type = type;
+ handleObj.guid = handler.guid;
// Get the current list of functions bound to this event
var handlers = events[ type ],
- special = this.special[ type ] || {};
-
-
+ special = jQuery.event.special[ type ] || {};
// Init the event handler queue
if ( !handlers ) {
- handlers = events[ type ] = {};
+ handlers = events[ type ] = [];
// Check for a special event handler
// Only use addEventListener/attachEvent if the special
// events handler returns false
- if ( !special.setup || special.setup.call( elem, data, namespaces, handler) === false ) {
+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
// Bind the global event handler to the element
if ( elem.addEventListener ) {
- elem.addEventListener( type, handle, false );
+ elem.addEventListener( type, eventHandle, false );
+
} else if ( elem.attachEvent ) {
- elem.attachEvent( "on" + type, handle );
+ elem.attachEvent( "on" + type, eventHandle );
}
}
}
if ( special.add ) {
- var modifiedHandler = special.add.call( elem, handler, data, namespaces, handlers );
- if ( modifiedHandler && jQuery.isFunction( modifiedHandler ) ) {
- modifiedHandler.guid = modifiedHandler.guid || handler.guid;
- handler = modifiedHandler;
- }
- }
-
+ special.add.call( elem, handleObj );
+
+ if ( !handleObj.handler.guid ) {
+ handleObj.handler.guid = handler.guid;
+ }
+ }
+
// Add the function to the element's handler list
- handlers[ handler.guid ] = handler;
+ handlers.push( handleObj );
// Keep track of which events have been used, for global triggering
- this.global[ type ] = true;
+ jQuery.event.global[ type ] = true;
}
// Nullify elem to prevent memory leaks in IE
@@ -1632,90 +1674,121 @@ jQuery.event = {
global: {},
// Detach an event or set of events from an element
- remove: function( elem, types, handler ) {
+ remove: function( elem, types, handler, pos ) {
// don't do events on text and comment nodes
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
return;
}
- var events = jQuery.data( elem, "events" ), ret, type, fn;
+ var ret, type, fn, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
+ elemData = jQuery.data( elem ),
+ events = elemData && elemData.events;
- if ( events ) {
- // Unbind all events for the element
- if ( types === undefined || (typeof types === "string" && types.charAt(0) === ".") ) {
- for ( type in events ) {
- this.remove( elem, type + (types || "") );
- }
- } else {
- // types is actually an event object here
- if ( types.type ) {
- handler = types.handler;
- types = types.type;
+ if ( !elemData || !events ) {
+ return;
+ }
+
+ // types is actually an event object here
+ if ( types && types.type ) {
+ handler = types.handler;
+ types = types.type;
+ }
+
+ // Unbind all events for the element
+ if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
+ types = types || "";
+
+ for ( type in events ) {
+ jQuery.event.remove( elem, type + types );
+ }
+
+ return;
+ }
+
+ // Handle multiple events separated by a space
+ // jQuery(...).unbind("mouseover mouseout", fn);
+ types = types.split(" ");
+
+ while ( (type = types[ i++ ]) ) {
+ origType = type;
+ handleObj = null;
+ all = type.indexOf(".") < 0;
+ namespaces = [];
+
+ if ( !all ) {
+ // Namespaced event handlers
+ namespaces = type.split(".");
+ type = namespaces.shift();
+
+ namespace = new RegExp("(^|\\.)" +
+ jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)")
+ }
+
+ eventType = events[ type ];
+
+ if ( !eventType ) {
+ continue;
+ }
+
+ if ( !handler ) {
+ for ( var j = 0; j < eventType.length; j++ ) {
+ handleObj = eventType[ j ];
+
+ if ( all || namespace.test( handleObj.namespace ) ) {
+ jQuery.event.remove( elem, origType, handleObj.handler, j );
+ eventType.splice( j--, 1 );
+ }
}
- // Handle multiple events separated by a space
- // jQuery(...).unbind("mouseover mouseout", fn);
- types = types.split(/\s+/);
- var i = 0;
- while ( (type = types[ i++ ]) ) {
- // Namespaced event handlers
- var namespaces = type.split(".");
- type = namespaces.shift();
- var all = !namespaces.length,
- cleaned = jQuery.map( namespaces.slice(0).sort(), fcleanup ),
- namespace = new RegExp("(^|\\.)" + cleaned.join("\\.(?:.*\\.)?") + "(\\.|$)"),
- special = this.special[ type ] || {};
-
- if ( events[ type ] ) {
- // remove the given handler for the given type
- if ( handler ) {
- fn = events[ type ][ handler.guid ];
- delete events[ type ][ handler.guid ];
-
- // remove all handlers for the given type
- } else {
- for ( var handle in events[ type ] ) {
- // Handle the removal of namespaced events
- if ( all || namespace.test( events[ type ][ handle ].type ) ) {
- delete events[ type ][ handle ];
- }
- }
+ continue;
+ }
+
+ special = jQuery.event.special[ type ] || {};
+
+ for ( var j = pos || 0; j < eventType.length; j++ ) {
+ handleObj = eventType[ j ];
+
+ if ( handler.guid === handleObj.guid ) {
+ // remove the given handler for the given type
+ if ( all || namespace.test( handleObj.namespace ) ) {
+ if ( pos == null ) {
+ eventType.splice( j--, 1 );
}
if ( special.remove ) {
- special.remove.call( elem, namespaces, fn);
+ special.remove.call( elem, handleObj );
}
+ }
- // remove generic event handler if no more handlers exist
- for ( ret in events[ type ] ) {
- break;
- }
- if ( !ret ) {
- if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
- if ( elem.removeEventListener ) {
- elem.removeEventListener( type, jQuery.data( elem, "handle" ), false );
- } else if ( elem.detachEvent ) {
- elem.detachEvent( "on" + type, jQuery.data( elem, "handle" ) );
- }
- }
- ret = null;
- delete events[ type ];
- }
+ if ( pos != null ) {
+ break;
}
}
}
- // Remove the expando if it's no longer used
- for ( ret in events ) {
- break;
- }
- if ( !ret ) {
- var handle = jQuery.data( elem, "handle" );
- if ( handle ) {
- handle.elem = null;
+ // remove generic event handler if no more handlers exist
+ if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
+ if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
+ removeEvent( elem, type, elemData.handle );
}
- jQuery.removeData( elem, "events" );
- jQuery.removeData( elem, "handle" );
+
+ ret = null;
+ delete events[ type ];
+ }
+ }
+
+ // Remove the expando if it's no longer used
+ if ( jQuery.isEmptyObject( events ) ) {
+ var handle = elemData.handle;
+ if ( handle ) {
+ handle.elem = null;
+ }
+
+ delete elemData.events;
+ delete elemData.handle;
+
+ if ( jQuery.isEmptyObject( elemData ) ) {
+ jQuery.removeData( elem );
}
}
},
@@ -1746,7 +1819,7 @@ jQuery.event = {
event.stopPropagation();
// Only trigger if we've ever bound an event for it
- if ( this.global[ type ] ) {
+ if ( jQuery.event.global[ type ] ) {
jQuery.each( jQuery.cache, function() {
if ( this.events && this.events[type] ) {
jQuery.event.trigger( event, data, this.handle.elem );
@@ -1779,82 +1852,101 @@ jQuery.event = {
handle.apply( elem, data );
}
- var nativeFn, nativeHandler;
+ var parent = elem.parentNode || elem.ownerDocument;
+
+ // Trigger an inline bound script
try {
if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
- nativeFn = elem[ type ];
- nativeHandler = elem[ "on" + type ];
+ if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) {
+ event.result = false;
+ }
}
+
// prevent IE from throwing an error for some elements with some event types, see #3533
} catch (e) {}
- var isClick = jQuery.nodeName(elem, "a") && type === "click";
+ if ( !event.isPropagationStopped() && parent ) {
+ jQuery.event.trigger( event, data, parent, true );
- // Trigger the native events (except for clicks on links)
- if ( !bubbling && nativeFn && !event.isDefaultPrevented() && !isClick ) {
- this.triggered = true;
- try {
- elem[ type ]();
- // prevent IE from throwing an error for some hidden elements
- } catch (e) {}
+ } else if ( !event.isDefaultPrevented() ) {
+ var target = event.target, old,
+ isClick = jQuery.nodeName(target, "a") && type === "click",
+ special = jQuery.event.special[ type ] || {};
- // Handle triggering native .onfoo handlers
- } else if ( nativeHandler && elem[ "on" + type ].apply( elem, data ) === false ) {
- event.result = false;
- }
+ if ( (!special._default || special._default.call( elem, event ) === false) &&
+ !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) {
+
+ try {
+ if ( target[ type ] ) {
+ // Make sure that we don't accidentally re-trigger the onFOO events
+ old = target[ "on" + type ];
+
+ if ( old ) {
+ target[ "on" + type ] = null;
+ }
+
+ jQuery.event.triggered = true;
+ target[ type ]();
+ }
+
+ // prevent IE from throwing an error for some elements with some event types, see #3533
+ } catch (e) {}
- this.triggered = false;
+ if ( old ) {
+ target[ "on" + type ] = old;
+ }
- if ( !event.isPropagationStopped() ) {
- var parent = elem.parentNode || elem.ownerDocument;
- if ( parent ) {
- jQuery.event.trigger( event, data, parent, true );
+ jQuery.event.triggered = false;
}
}
},
handle: function( event ) {
- // returned undefined or false
- var all, handlers;
+ var all, handlers, namespaces, namespace, events;
event = arguments[0] = jQuery.event.fix( event || window.event );
event.currentTarget = this;
// Namespaced event handlers
- var namespaces = event.type.split(".");
- event.type = namespaces.shift();
-
- // Cache this now, all = true means, any handler
- all = !namespaces.length && !event.exclusive;
+ all = event.type.indexOf(".") < 0 && !event.exclusive;
- var namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)");
+ if ( !all ) {
+ namespaces = event.type.split(".");
+ event.type = namespaces.shift();
+ namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)");
+ }
- handlers = ( jQuery.data(this, "events") || {} )[ event.type ];
+ var events = jQuery.data(this, "events"), handlers = events[ event.type ];
- for ( var j in handlers ) {
- var handler = handlers[ j ];
+ if ( events && handlers ) {
+ // Clone the handlers to prevent manipulation
+ handlers = handlers.slice(0);
- // Filter the functions by class
- if ( all || namespace.test(handler.type) ) {
- // Pass in a reference to the handler function itself
- // So that we can later remove it
- event.handler = handler;
- event.data = handler.data;
+ for ( var j = 0, l = handlers.length; j < l; j++ ) {
+ var handleObj = handlers[ j ];
- var ret = handler.apply( this, arguments );
+ // Filter the functions by class
+ if ( all || namespace.test( handleObj.namespace ) ) {
+ // Pass in a reference to the handler function itself
+ // So that we can later remove it
+ event.handler = handleObj.handler;
+ event.data = handleObj.data;
+ event.handleObj = handleObj;
+
+ var ret = handleObj.handler.apply( this, arguments );
- if ( ret !== undefined ) {
- event.result = ret;
- if ( ret === false ) {
- event.preventDefault();
- event.stopPropagation();
+ if ( ret !== undefined ) {
+ event.result = ret;
+ if ( ret === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
}
- }
- if ( event.isImmediatePropagationStopped() ) {
- break;
+ if ( event.isImmediatePropagationStopped() ) {
+ break;
+ }
}
-
}
}
@@ -1933,42 +2025,39 @@ jQuery.event = {
},
live: {
- add: function( proxy, data, namespaces, live ) {
- jQuery.extend( proxy, data || {} );
-
- proxy.guid += data.selector + data.live;
- jQuery.event.add( this, data.live, liveHandler, data );
-
+ add: function( handleObj ) {
+ jQuery.event.add( this, handleObj.origType, jQuery.extend({}, handleObj, {handler: liveHandler}) );
},
- remove: function( namespaces ) {
- if ( namespaces.length ) {
- var remove = 0, name = new RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)");
-
- jQuery.each( (jQuery.data(this, "events").live || {}), function() {
- if ( name.test(this.type) ) {
- remove++;
- }
- });
-
- if ( remove < 1 ) {
- jQuery.event.remove( this, namespaces[0], liveHandler );
+ remove: function( handleObj ) {
+ var remove = true,
+ type = handleObj.origType.replace(rnamespaces, "");
+
+ jQuery.each( jQuery.data(this, "events").live || [], function() {
+ if ( type === this.origType.replace(rnamespaces, "") ) {
+ remove = false;
+ return false;
}
+ });
+
+ if ( remove ) {
+ jQuery.event.remove( this, handleObj.origType, liveHandler );
}
- },
- special: {}
+ }
+
},
+
beforeunload: {
- setup: function( data, namespaces, fn ) {
+ setup: function( data, namespaces, eventHandle ) {
// We only want to do this special case on windows
if ( this.setInterval ) {
- this.onbeforeunload = fn;
+ this.onbeforeunload = eventHandle;
}
return false;
},
- teardown: function( namespaces, fn ) {
- if ( this.onbeforeunload === fn ) {
+ teardown: function( namespaces, eventHandle ) {
+ if ( this.onbeforeunload === eventHandle ) {
this.onbeforeunload = null;
}
}
@@ -1976,6 +2065,14 @@ jQuery.event = {
}
};
+var removeEvent = document.removeEventListener ?
+ function( elem, type, handle ) {
+ elem.removeEventListener( type, handle, false );
+ } :
+ function( elem, type, handle ) {
+ elem.detachEvent( "on" + type, handle );
+ };
+
jQuery.Event = function( src ) {
// Allow instantiation without the 'new' keyword
if ( !this.preventDefault ) {
@@ -2053,27 +2150,24 @@ var withinElement = function( event ) {
// Check if mouse(over|out) are still within the same parent element
var parent = event.relatedTarget;
- // Traverse up the tree
- while ( parent && parent !== this ) {
- // Firefox sometimes assigns relatedTarget a XUL element
- // which we cannot access the parentNode property of
- try {
+ // Firefox sometimes assigns relatedTarget a XUL element
+ // which we cannot access the parentNode property of
+ try {
+ // Traverse up the tree
+ while ( parent && parent !== this ) {
parent = parent.parentNode;
-
- // assuming we've left the element since we most likely mousedover a xul element
- } catch(e) {
- break;
}
- }
- if ( parent !== this ) {
- // set the correct event type
- event.type = event.data;
+ if ( parent !== this ) {
+ // set the correct event type
+ event.type = event.data;
- // handle event if we actually just moused on to a non sub-element
- jQuery.event.handle.apply( this, arguments );
- }
+ // handle event if we actually just moused on to a non sub-element
+ jQuery.event.handle.apply( this, arguments );
+ }
+ // assuming we've left the element since we most likely mousedover a xul element
+ } catch(e) { }
},
// In case of event delegation, we only need to rename the event.type,
@@ -2101,64 +2195,65 @@ jQuery.each({
// submit delegation
if ( !jQuery.support.submitBubbles ) {
-jQuery.event.special.submit = {
- setup: function( data, namespaces, fn ) {
- if ( this.nodeName.toLowerCase() !== "form" ) {
- jQuery.event.add(this, "click.specialSubmit." + fn.guid, function( e ) {
- var elem = e.target, type = elem.type;
+ jQuery.event.special.submit = {
+ setup: function( data, namespaces ) {
+ if ( this.nodeName.toLowerCase() !== "form" ) {
+ jQuery.event.add(this, "click.specialSubmit", function( e ) {
+ var elem = e.target, type = elem.type;
- if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
- return trigger( "submit", this, arguments );
- }
- });
+ if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
+ return trigger( "submit", this, arguments );
+ }
+ });
- jQuery.event.add(this, "keypress.specialSubmit." + fn.guid, function( e ) {
- var elem = e.target, type = elem.type;
+ jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
+ var elem = e.target, type = elem.type;
- if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
- return trigger( "submit", this, arguments );
- }
- });
+ if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
+ return trigger( "submit", this, arguments );
+ }
+ });
- } else {
- return false;
- }
- },
+ } else {
+ return false;
+ }
+ },
- remove: function( namespaces, fn ) {
- jQuery.event.remove( this, "click.specialSubmit" + (fn ? "."+fn.guid : "") );
- jQuery.event.remove( this, "keypress.specialSubmit" + (fn ? "."+fn.guid : "") );
- }
-};
+ teardown: function( namespaces ) {
+ jQuery.event.remove( this, ".specialSubmit" );
+ }
+ };
}
// change delegation, happens here so we have bind.
if ( !jQuery.support.changeBubbles ) {
-var formElems = /textarea|input|select/i;
+ var formElems = /textarea|input|select/i,
-function getVal( elem ) {
- var type = elem.type, val = elem.value;
+ changeFilters,
- if ( type === "radio" || type === "checkbox" ) {
- val = elem.checked;
+ getVal = function( elem ) {
+ var type = elem.type, val = elem.value;
- } else if ( type === "select-multiple" ) {
- val = elem.selectedIndex > -1 ?
- jQuery.map( elem.options, function( elem ) {
- return elem.selected;
- }).join("-") :
- "";
+ if ( type === "radio" || type === "checkbox" ) {
+ val = elem.checked;
- } else if ( elem.nodeName.toLowerCase() === "select" ) {
- val = elem.selectedIndex;
- }
+ } else if ( type === "select-multiple" ) {
+ val = elem.selectedIndex > -1 ?
+ jQuery.map( elem.options, function( elem ) {
+ return elem.selected;
+ }).join("-") :
+ "";
- return val;
-}
+ } else if ( elem.nodeName.toLowerCase() === "select" ) {
+ val = elem.selectedIndex;
+ }
-function testChange( e ) {
+ return val;
+ },
+
+ testChange = function testChange( e ) {
var elem = e.target, data, val;
if ( !formElems.test( elem.nodeName ) || elem.readOnly ) {
@@ -2168,74 +2263,74 @@ function testChange( e ) {
data = jQuery.data( elem, "_change_data" );
val = getVal(elem);
- if ( val === data ) {
- return;
- }
-
// the current data will be also retrieved by beforeactivate
if ( e.type !== "focusout" || elem.type !== "radio" ) {
jQuery.data( elem, "_change_data", val );
}
+
+ if ( data === undefined || val === data ) {
+ return;
+ }
- if ( elem.type !== "select" && (data != null || val) ) {
+ if ( data != null || val ) {
e.type = "change";
- return jQuery.event.trigger( e, arguments[1], this );
+ return jQuery.event.trigger( e, arguments[1], elem );
}
-}
+ };
-jQuery.event.special.change = {
- filters: {
- focusout: testChange,
+ jQuery.event.special.change = {
+ filters: {
+ focusout: testChange,
- click: function( e ) {
- var elem = e.target, type = elem.type;
+ click: function( e ) {
+ var elem = e.target, type = elem.type;
- if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
- return testChange.call( this, e );
- }
- },
+ if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
+ return testChange.call( this, e );
+ }
+ },
- // Change has to be called before submit
- // Keydown will be called before keypress, which is used in submit-event delegation
- keydown: function( e ) {
- var elem = e.target, type = elem.type;
+ // Change has to be called before submit
+ // Keydown will be called before keypress, which is used in submit-event delegation
+ keydown: function( e ) {
+ var elem = e.target, type = elem.type;
- if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
- (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
- type === "select-multiple" ) {
- return testChange.call( this, e );
+ if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
+ (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
+ type === "select-multiple" ) {
+ return testChange.call( this, e );
+ }
+ },
+
+ // Beforeactivate happens also before the previous element is blurred
+ // with this event you can't trigger a change event, but you can store
+ // information/focus[in] is not needed anymore
+ beforeactivate: function( e ) {
+ var elem = e.target;
+ jQuery.data( elem, "_change_data", getVal(elem) );
}
},
- // Beforeactivate happens also before the previous element is blurred
- // with this event you can't trigger a change event, but you can store
- // information/focus[in] is not needed anymore
- beforeactivate: function( e ) {
- var elem = e.target;
+ setup: function( data, namespaces ) {
+ if ( this.type === "file" ) {
+ return false;
+ }
- if ( elem.nodeName.toLowerCase() === "input" && elem.type === "radio" ) {
- jQuery.data( elem, "_change_data", getVal(elem) );
+ for ( var type in changeFilters ) {
+ jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
}
- }
- },
- setup: function( data, namespaces, fn ) {
- for ( var type in changeFilters ) {
- jQuery.event.add( this, type + ".specialChange." + fn.guid, changeFilters[type] );
- }
- return formElems.test( this.nodeName );
- },
- remove: function( namespaces, fn ) {
- for ( var type in changeFilters ) {
- jQuery.event.remove( this, type + ".specialChange" + (fn ? "."+fn.guid : ""), changeFilters[type] );
- }
+ return formElems.test( this.nodeName );
+ },
- return formElems.test( this.nodeName );
- }
-};
+ teardown: function( namespaces ) {
+ jQuery.event.remove( this, ".specialChange" );
-var changeFilters = jQuery.event.special.change.filters;
+ return formElems.test( this.nodeName );
+ }
+ };
+ changeFilters = jQuery.event.special.change.filters;
}
function trigger( type, elem, args ) {
@@ -2274,7 +2369,6 @@ jQuery.each(["bind", "one"], function( i, name ) {
}
if ( jQuery.isFunction( data ) ) {
- thisObject = fn;
fn = data;
data = undefined;
}
@@ -2284,11 +2378,16 @@ jQuery.each(["bind", "one"], function( i, name ) {
return fn.apply( this, arguments );
}) : fn;
- return type === "unload" && name !== "one" ?
- this.one( type, data, fn, thisObject ) :
- this.each(function() {
- jQuery.event.add( this, type, handler, data );
- });
+ if ( type === "unload" && name !== "one" ) {
+ this.one( type, data, fn );
+
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ jQuery.event.add( this[i], type, handler, data );
+ }
+ }
+
+ return this;
};
});
@@ -2299,13 +2398,29 @@ jQuery.fn.extend({
for ( var key in type ) {
this.unbind(key, type[key]);
}
- return this;
+
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ jQuery.event.remove( this[i], type, fn );
+ }
}
- return this.each(function() {
- jQuery.event.remove( this, type, fn );
- });
+ return this;
},
+
+ delegate: function( selector, types, data, fn ) {
+ return this.live( types, data, fn, selector );
+ },
+
+ undelegate: function( selector, types, fn ) {
+ if ( arguments.length === 0 ) {
+ return this.unbind( "live" );
+
+ } else {
+ return this.die( types, null, fn, selector );
+ }
+ },
+
trigger: function( type, data ) {
return this.each(function() {
jQuery.event.trigger( type, data, this );
@@ -2346,63 +2461,112 @@ jQuery.fn.extend({
hover: function( fnOver, fnOut ) {
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
- },
+ }
+});
+
+var liveMap = {
+ focus: "focusin",
+ blur: "focusout",
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+};
+
+jQuery.each(["live", "die"], function( i, name ) {
+ jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
+ var type, i = 0, match, namespaces, preType,
+ selector = origSelector || this.selector,
+ context = origSelector ? this : jQuery( this.context );
- live: function( type, data, fn ) {
if ( jQuery.isFunction( data ) ) {
fn = data;
data = undefined;
}
- jQuery( this.context ).bind( liveConvert( type, this.selector ), {
- data: data, selector: this.selector, live: type
- }, fn );
+ types = (types || "").split(" ");
- return this;
- },
+ while ( (type = types[ i++ ]) != null ) {
+ match = rnamespaces.exec( type );
+ namespaces = "";
+
+ if ( match ) {
+ namespaces = match[0];
+ type = type.replace( rnamespaces, "" );
+ }
+
+ if ( type === "hover" ) {
+ types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );
+ continue;
+ }
+
+ preType = type;
+
+ if ( type === "focus" || type === "blur" ) {
+ types.push( liveMap[ type ] + namespaces );
+ type = type + namespaces;
+
+ } else {
+ type = (liveMap[ type ] || type) + namespaces;
+ }
+
+ if ( name === "live" ) {
+ // bind live handler
+ context.each(function(){
+ jQuery.event.add( this, liveConvert( type, selector ),
+ { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
+ });
- die: function( type, fn ) {
- jQuery( this.context ).unbind( liveConvert( type, this.selector ), fn ? { guid: fn.guid + this.selector + type } : null );
+ } else {
+ // unbind live handler
+ context.unbind( liveConvert( type, selector ), fn );
+ }
+ }
+
return this;
}
});
function liveHandler( event ) {
- var stop = true, elems = [], selectors = [], args = arguments,
- related, match, fn, elem, j, i, data,
- live = jQuery.extend({}, jQuery.data( this, "events" ).live);
+ var stop, elems = [], selectors = [], args = arguments,
+ related, match, handleObj, elem, j, i, l, data,
+ events = jQuery.data( this, "events" );
- for ( j in live ) {
- fn = live[j];
- if ( fn.live === event.type ||
- fn.altLive && jQuery.inArray(event.type, fn.altLive) > -1 ) {
+ // Make sure we avoid non-left-click bubbling in Firefox (#3861)
+ if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) {
+ return;
+ }
+
+ event.liveFired = this;
+
+ var live = events.live.slice(0);
+
+ for ( j = 0; j < live.length; j++ ) {
+ handleObj = live[j];
+
+ if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
+ selectors.push( handleObj.selector );
- data = fn.data;
- if ( !(data.beforeFilter && data.beforeFilter[event.type] &&
- !data.beforeFilter[event.type](event)) ) {
- selectors.push( fn.selector );
- }
} else {
- delete live[j];
+ live.splice( j--, 1 );
}
}
match = jQuery( event.target ).closest( selectors, event.currentTarget );
for ( i = 0, l = match.length; i < l; i++ ) {
- for ( j in live ) {
- fn = live[j];
- elem = match[i].elem;
- related = null;
+ for ( j = 0; j < live.length; j++ ) {
+ handleObj = live[j];
+
+ if ( match[i].selector === handleObj.selector ) {
+ elem = match[i].elem;
+ related = null;
- if ( match[i].selector === fn.selector ) {
// Those two events require additional checking
- if ( fn.live === "mouseenter" || fn.live === "mouseleave" ) {
- related = jQuery( event.relatedTarget ).closest( fn.selector )[0];
+ if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
+ related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
}
if ( !related || related !== elem ) {
- elems.push({ elem: elem, fn: fn });
+ elems.push({ elem: elem, handleObj: handleObj });
}
}
}
@@ -2411,8 +2575,10 @@ function liveHandler( event ) {
for ( i = 0, l = elems.length; i < l; i++ ) {
match = elems[i];
event.currentTarget = match.elem;
- event.data = match.fn.data;
- if ( match.fn.apply( match.elem, args ) === false ) {
+ event.data = match.handleObj.data;
+ event.handleObj = match.handleObj;
+
+ if ( match.handleObj.origHandler.apply( match.elem, args ) === false ) {
stop = false;
break;
}
@@ -2422,7 +2588,7 @@ function liveHandler( event ) {
}
function liveConvert( type, selector ) {
- return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "&")].join(".");
+ return "live." + (type && type !== "*" ? type + "." : "") + selector.replace(/\./g, "`").replace(/ /g, "&");
}
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
@@ -2569,7 +2735,7 @@ var Sizzle = function(selector, context, results, seed) {
}
if ( !checkSet ) {
- throw "Syntax error, unrecognized expression: " + (cur || selector);
+ Sizzle.error( cur || selector );
}
if ( toString.call(checkSet) === "[object Array]" ) {
@@ -2722,7 +2888,7 @@ Sizzle.filter = function(expr, set, inplace, not){
// Improper expression
if ( expr === old ) {
if ( anyFound == null ) {
- throw "Syntax error, unrecognized expression: " + expr;
+ Sizzle.error( expr );
} else {
break;
}
@@ -2734,6 +2900,10 @@ Sizzle.filter = function(expr, set, inplace, not){
return curLoop;
};
+Sizzle.error = function( msg ) {
+ throw "Syntax error, unrecognized expression: " + msg;
+};
+
var Expr = Sizzle.selectors = {
order: [ "ID", "NAME", "TAG" ],
match: {
@@ -3038,7 +3208,7 @@ var Expr = Sizzle.selectors = {
return true;
} else {
- throw "Syntax error, unrecognized expression: " + name;
+ Sizzle.error( "Syntax error, unrecognized expression: " + name );
}
},
CHILD: function(elem, match){
@@ -3163,8 +3333,10 @@ var makeArray = function(array, results) {
// Perform a simple check to determine if the browser is capable of
// converting a NodeList to an array using builtin methods.
+// Also verifies that the returned array holds DOM nodes
+// (which is not the case in the Blackberry browser)
try {
- Array.prototype.slice.call( document.documentElement.childNodes, 0 );
+ Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
// Provide a fallback method if it does not work
} catch(e){
@@ -3468,7 +3640,7 @@ function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
}
var contains = document.compareDocumentPosition ? function(a, b){
- return a.compareDocumentPosition(b) & 16;
+ return !!(a.compareDocumentPosition(b) & 16);
} : function(a, b){
return a !== b && (a.contains ? a.contains(b) : true);
};
@@ -3505,7 +3677,7 @@ jQuery.find = Sizzle;
jQuery.expr = Sizzle.selectors;
jQuery.expr[":"] = jQuery.expr.filters;
jQuery.unique = Sizzle.uniqueSort;
-jQuery.getText = getText;
+jQuery.text = getText;
jQuery.isXMLDoc = isXML;
jQuery.contains = contains;
@@ -3540,7 +3712,7 @@ var winnow = function( elements, qualifier, keep ) {
if ( isSimple.test( qualifier ) ) {
return jQuery.filter(qualifier, filtered, !keep);
} else {
- qualifier = jQuery.filter( qualifier, elements );
+ qualifier = jQuery.filter( qualifier, filtered );
}
}
@@ -3751,7 +3923,7 @@ jQuery.extend({
dir: function( elem, dir, until ) {
var matched = [], cur = elem[dir];
- while ( cur && cur.nodeType !== 9 && (until === undefined || !jQuery( cur ).is( until )) ) {
+ while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
if ( cur.nodeType === 1 ) {
matched.push( cur );
}
@@ -3791,7 +3963,9 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
rtagName = /<([\w:]+)/,
rtbody = /<tbody/i,
- rhtml = /<|&\w+;/,
+ rhtml = /<|&#?\w+;/,
+ rnocache = /<script|<object|<embed|<option|<style/i,
+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, // checked="checked" or checked (html5)
fcloseTag = function( all, front, tag ) {
return rselfClosing.test( tag ) ?
all :
@@ -3822,7 +3996,7 @@ jQuery.fn.extend({
if ( jQuery.isFunction(text) ) {
return this.each(function(i) {
var self = jQuery(this);
- return self.text( text.call(this, i, self.text()) );
+ self.text( text.call(this, i, self.text()) );
});
}
@@ -3830,7 +4004,7 @@ jQuery.fn.extend({
return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
}
- return jQuery.getText( this );
+ return jQuery.text( this );
},
wrapAll: function( html ) {
@@ -3863,6 +4037,12 @@ jQuery.fn.extend({
},
wrapInner: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapInner( html.call(this, i) );
+ });
+ }
+
return this.each(function() {
var self = jQuery( this ), contents = self.contents();
@@ -3928,6 +4108,40 @@ jQuery.fn.extend({
return set;
}
},
+
+ // keepData is for internal use only--do not document
+ remove: function( selector, keepData ) {
+ for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
+ if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
+ if ( !keepData && elem.nodeType === 1 ) {
+ jQuery.cleanData( elem.getElementsByTagName("*") );
+ jQuery.cleanData( [ elem ] );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+ }
+ }
+
+ return this;
+ },
+
+ empty: function() {
+ for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( elem.getElementsByTagName("*") );
+ }
+
+ // Remove any remaining nodes
+ while ( elem.firstChild ) {
+ elem.removeChild( elem.firstChild );
+ }
+ }
+
+ return this;
+ },
clone: function( events ) {
// Do the clone
@@ -3949,6 +4163,8 @@ jQuery.fn.extend({
}
return jQuery.clean([html.replace(rinlinejQuery, "")
+ // Handle the case in IE 8 where action=/test/> self-closes a tag
+ .replace(/=([^="'>\s]+\/)>/g, '="$1">')
.replace(rleadingWhitespace, "")], ownerDocument)[0];
} else {
return this.cloneNode(true);
@@ -3972,15 +4188,17 @@ jQuery.fn.extend({
null;
// See if we can take a shortcut and just use innerHTML
- } else if ( typeof value === "string" && !/<script/i.test( value ) &&
+ } else if ( typeof value === "string" && !rnocache.test( value ) &&
(jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
+ value = value.replace(rxhtmlTag, fcloseTag);
+
try {
for ( var i = 0, l = this.length; i < l; i++ ) {
// Remove element nodes and prevent memory leaks
if ( this[i].nodeType === 1 ) {
- cleanData( this[i].getElementsByTagName("*") );
+ jQuery.cleanData( this[i].getElementsByTagName("*") );
this[i].innerHTML = value;
}
}
@@ -4009,8 +4227,15 @@ jQuery.fn.extend({
if ( this[0] && this[0].parentNode ) {
// Make sure that the elements are removed from the DOM before they are inserted
// this can help fix replacing a parent with child elements
- if ( !jQuery.isFunction( value ) ) {
- value = jQuery( value ).detach();
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function(i) {
+ var self = jQuery(this), old = self.html();
+ self.replaceWith( value.call( this, i, old ) );
+ });
+ }
+
+ if ( typeof value !== "string" ) {
+ value = jQuery(value).detach();
}
return this.each(function() {
@@ -4034,25 +4259,41 @@ jQuery.fn.extend({
},
domManip: function( args, table, callback ) {
- var results, first, value = args[0], scripts = [];
+ var results, first, value = args[0], scripts = [], fragment, parent;
+
+ // We can't cloneNode fragments that contain checked, in WebKit
+ if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
+ return this.each(function() {
+ jQuery(this).domManip( args, table, callback, true );
+ });
+ }
if ( jQuery.isFunction(value) ) {
return this.each(function(i) {
var self = jQuery(this);
args[0] = value.call(this, i, table ? self.html() : undefined);
- return self.domManip( args, table, callback );
+ self.domManip( args, table, callback );
});
}
if ( this[0] ) {
+ parent = value && value.parentNode;
+
// If we're in a fragment, just use that instead of building a new one
- if ( args[0] && args[0].parentNode && args[0].parentNode.nodeType === 11 ) {
- results = { fragment: args[0].parentNode };
+ if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
+ results = { fragment: parent };
+
} else {
results = buildFragment( args, this, scripts );
}
-
- first = results.fragment.firstChild;
+
+ fragment = results.fragment;
+
+ if ( fragment.childNodes.length === 1 ) {
+ first = fragment = fragment.firstChild;
+ } else {
+ first = fragment.firstChild;
+ }
if ( first ) {
table = table && jQuery.nodeName( first, "tr" );
@@ -4062,14 +4303,14 @@ jQuery.fn.extend({
table ?
root(this[i], first) :
this[i],
- results.cacheable || this.length > 1 || i > 0 ?
- results.fragment.cloneNode(true) :
- results.fragment
+ i > 0 || results.cacheable || this.length > 1 ?
+ fragment.cloneNode(true) :
+ fragment
);
}
}
- if ( scripts ) {
+ if ( scripts.length ) {
jQuery.each( scripts, evalScript );
}
}
@@ -4109,21 +4350,26 @@ function cloneCopyEvent(orig, ret) {
}
function buildFragment( args, nodes, scripts ) {
- var fragment, cacheable, cached, cacheresults, doc;
+ var fragment, cacheable, cacheresults,
+ doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
+
+ // Only cache "small" (1/2 KB) strings that are associated with the main document
+ // Cloning options loses the selected state, so don't cache them
+ // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
+ // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
+ if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
+ !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
- if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && args[0].indexOf("<option") < 0 ) {
cacheable = true;
cacheresults = jQuery.fragments[ args[0] ];
if ( cacheresults ) {
if ( cacheresults !== 1 ) {
fragment = cacheresults;
}
- cached = true;
}
}
if ( !fragment ) {
- doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
fragment = doc.createDocumentFragment();
jQuery.clean( args, doc, fragment, scripts );
}
@@ -4145,46 +4391,22 @@ jQuery.each({
replaceAll: "replaceWith"
}, function( name, original ) {
jQuery.fn[ name ] = function( selector ) {
- var ret = [], insert = jQuery( selector );
-
- for ( var i = 0, l = insert.length; i < l; i++ ) {
- var elems = (i > 0 ? this.clone(true) : this).get();
- jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
- ret = ret.concat( elems );
- }
- return this.pushStack( ret, name, insert.selector );
- };
-});
-
-jQuery.each({
- // keepData is for internal use only--do not document
- remove: function( selector, keepData ) {
- if ( !selector || jQuery.filter( selector, [ this ] ).length ) {
- if ( !keepData && this.nodeType === 1 ) {
- cleanData( this.getElementsByTagName("*") );
- cleanData( [ this ] );
- }
-
- if ( this.parentNode ) {
- this.parentNode.removeChild( this );
+ var ret = [], insert = jQuery( selector ),
+ parent = this.length === 1 && this[0].parentNode;
+
+ if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
+ insert[ original ]( this[0] );
+ return this;
+
+ } else {
+ for ( var i = 0, l = insert.length; i < l; i++ ) {
+ var elems = (i > 0 ? this.clone(true) : this).get();
+ jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
+ ret = ret.concat( elems );
}
+
+ return this.pushStack( ret, name, insert.selector );
}
- },
-
- empty: function() {
- // Remove element nodes and prevent memory leaks
- if ( this.nodeType === 1 ) {
- cleanData( this.getElementsByTagName("*") );
- }
-
- // Remove any remaining nodes
- while ( this.firstChild ) {
- this.removeChild( this.firstChild );
- }
- }
-}, function( name, fn ) {
- jQuery.fn[ name ] = function() {
- return this.each( fn, arguments );
};
});
@@ -4199,13 +4421,13 @@ jQuery.extend({
var ret = [];
- jQuery.each(elems, function( i, elem ) {
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
if ( typeof elem === "number" ) {
elem += "";
}
if ( !elem ) {
- return;
+ continue;
}
// Convert html string into DOM nodes
@@ -4256,7 +4478,7 @@ jQuery.extend({
div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
}
- elem = jQuery.makeArray( div.childNodes );
+ elem = div.childNodes;
}
if ( elem.nodeType ) {
@@ -4264,13 +4486,13 @@ jQuery.extend({
} else {
ret = jQuery.merge( ret, elem );
}
-
- });
+ }
if ( fragment ) {
for ( var i = 0; ret[i]; i++ ) {
if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
+
} else {
if ( ret[i].nodeType === 1 ) {
ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
@@ -4281,16 +4503,42 @@ jQuery.extend({
}
return ret;
- }
-});
+ },
+
+ cleanData: function( elems ) {
+ var data, id, cache = jQuery.cache,
+ special = jQuery.event.special,
+ deleteExpando = jQuery.support.deleteExpando;
+
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ id = elem[ jQuery.expando ];
+
+ if ( id ) {
+ data = cache[ id ];
+
+ if ( data.events ) {
+ for ( var type in data.events ) {
+ if ( special[ type ] ) {
+ jQuery.event.remove( elem, type );
-function cleanData( elems ) {
- for ( var i = 0, elem, id; (elem = elems[i]) != null; i++ ) {
- if ( !jQuery.noData[elem.nodeName.toLowerCase()] && (id = elem[expando]) ) {
- delete jQuery.cache[ id ];
+ } else {
+ removeEvent( elem, type, data.handle );
+ }
+ }
+ }
+
+ if ( deleteExpando ) {
+ delete elem[ jQuery.expando ];
+
+ } else if ( elem.removeAttribute ) {
+ elem.removeAttribute( jQuery.expando );
+ }
+
+ delete cache[ id ];
+ }
}
}
-}
+});
// exclude the following css properties to add px
var rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
ralpha = /alpha\([^)]*\)/,
@@ -4528,15 +4776,15 @@ var jsc = now(),
rquery = /\?/,
rts = /(\?|&)_=.*?(&|$)/,
rurl = /^(\w+:)?\/\/([^\/?#]+)/,
- r20 = /%20/g;
+ r20 = /%20/g,
-jQuery.fn.extend({
- // Keep a copy of the old load
- _load: jQuery.fn.load,
+ // Keep a copy of the old load method
+ _load = jQuery.fn.load;
+jQuery.fn.extend({
load: function( url, params, callback ) {
if ( typeof url !== "string" ) {
- return this._load( url );
+ return _load.call( this, url );
// Don't do a request if no elements are being requested
} else if ( !this.length ) {
@@ -4567,18 +4815,19 @@ jQuery.fn.extend({
}
}
+ var self = this;
+
// Request the remote document
jQuery.ajax({
url: url,
type: type,
dataType: "html",
data: params,
- context:this,
complete: function( res, status ) {
// If successful, inject the HTML into all the matched elements
if ( status === "success" || status === "notmodified" ) {
// See if a selector was specified
- this.html( selector ?
+ self.html( selector ?
// Create a dummy div to hold the results
jQuery("<div />")
// inject the contents of the document in, removing the scripts
@@ -4593,7 +4842,7 @@ jQuery.fn.extend({
}
if ( callback ) {
- this.each( callback, [res.responseText, status, res] );
+ self.each( callback, [res.responseText, status, res] );
}
}
});
@@ -4727,7 +4976,7 @@ jQuery.extend({
var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings);
var jsonp, status, data,
- callbackContext = s.context || s,
+ callbackContext = origSettings && origSettings.context || s,
type = s.type.toUpperCase();
// convert data if not already a string
@@ -4913,7 +5162,7 @@ jQuery.extend({
// Wait for a response to come back
var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) {
// The request was aborted
- if ( !xhr || xhr.readyState === 0 ) {
+ if ( !xhr || xhr.readyState === 0 || isTimeout === "abort" ) {
// Opera doesn't call onreadystatechange before this point
// so we simulate the call
if ( !requestDone ) {
@@ -4938,13 +5187,16 @@ jQuery.extend({
"notmodified" :
"success";
+ var errMsg;
+
if ( status === "success" ) {
// Watch for, and catch, XML document parse errors
try {
// process the data (runs the xml through httpData regardless of callback)
data = jQuery.httpData( xhr, s.dataType, s );
- } catch(e) {
+ } catch(err) {
status = "parsererror";
+ errMsg = err;
}
}
@@ -4955,7 +5207,7 @@ jQuery.extend({
success();
}
} else {
- jQuery.handleError(s, xhr, status);
+ jQuery.handleError(s, xhr, status, errMsg);
}
// Fire the complete handlers
@@ -4979,12 +5231,9 @@ jQuery.extend({
xhr.abort = function() {
if ( xhr ) {
oldAbort.call( xhr );
- if ( xhr ) {
- xhr.readyState = 0;
- }
}
- onreadystatechange();
+ onreadystatechange( "abort" );
};
} catch(e) { }
@@ -5052,7 +5301,7 @@ jQuery.extend({
handleError: function( s, xhr, status, e ) {
// If a local callback was specified, fire it
if ( s.error ) {
- s.error.call( s.context || window, xhr, status, e );
+ s.error.call( s.context || s, xhr, status, e );
}
// Fire the global callback
@@ -5100,7 +5349,7 @@ jQuery.extend({
data = xml ? xhr.responseXML : xhr.responseText;
if ( xml && data.documentElement.nodeName === "parsererror" ) {
- throw "parsererror";
+ jQuery.error( "parsererror" );
}
// Allow a pre-filtering function to sanitize the response
@@ -5113,23 +5362,7 @@ jQuery.extend({
if ( typeof data === "string" ) {
// Get the JavaScript object, if JSON is used.
if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
- // Make sure the incoming data is actual JSON
- // Logic borrowed from http://json.org/json2.js
- if (/^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
- .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]")
- .replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) {
-
- // Try to use the native JSON parser first
- if ( window.JSON && window.JSON.parse ) {
- data = window.JSON.parse( data );
-
- } else {
- data = (new Function("return " + data))();
- }
-
- } else {
- throw "Invalid JSON: " + data;
- }
+ data = jQuery.parseJSON( data );
// If the type is "script", eval it in global context
} else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) {
@@ -5143,7 +5376,6 @@ jQuery.extend({
// Serialize an array of form elements or a set of
// key/values into a query string
param: function( a, traditional ) {
-
var s = [];
// Set traditional to true for jQuery <= 1.3.2 behavior.
@@ -5151,12 +5383,6 @@ jQuery.extend({
traditional = jQuery.ajaxSettings.traditional;
}
- function add( key, value ) {
- // If value is a function, invoke it and return its value
- value = jQuery.isFunction(value) ? value() : value;
- s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
- }
-
// If an array was passed in, assume that it is an array of form elements.
if ( jQuery.isArray(a) || a.jquery ) {
// Serialize the form elements
@@ -5167,43 +5393,51 @@ jQuery.extend({
} else {
// If traditional, encode the "old" way (the way 1.3.2 or older
// did it), otherwise encode params recursively.
- jQuery.each( a, function buildParams( prefix, obj ) {
-
- if ( jQuery.isArray(obj) ) {
- // Serialize array item.
- jQuery.each( obj, function( i, v ) {
- if ( traditional ) {
- // Treat each array item as a scalar.
- add( prefix, v );
- } else {
- // If array item is non-scalar (array or object), encode its
- // numeric index to resolve deserialization ambiguity issues.
- // Note that rack (as of 1.0.0) can't currently deserialize
- // nested arrays properly, and attempting to do so may cause
- // a server error. Possible fixes are to modify rack's
- // deserialization algorithm or to provide an option or flag
- // to force array serialization to be shallow.
- buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v );
- }
- });
-
- } else if ( !traditional && obj != null && typeof obj === "object" ) {
- // Serialize object item.
- jQuery.each( obj, function( k, v ) {
- buildParams( prefix + "[" + k + "]", v );
- });
-
- } else {
- // Serialize scalar item.
- add( prefix, obj );
- }
- });
+ for ( var prefix in a ) {
+ buildParams( prefix, a[prefix] );
+ }
}
-
+
// Return the resulting serialization
return s.join("&").replace(r20, "+");
- }
+ function buildParams( prefix, obj ) {
+ if ( jQuery.isArray(obj) ) {
+ // Serialize array item.
+ jQuery.each( obj, function( i, v ) {
+ if ( traditional || /\[\]$/.test( prefix ) ) {
+ // Treat each array item as a scalar.
+ add( prefix, v );
+ } else {
+ // If array item is non-scalar (array or object), encode its
+ // numeric index to resolve deserialization ambiguity issues.
+ // Note that rack (as of 1.0.0) can't currently deserialize
+ // nested arrays properly, and attempting to do so may cause
+ // a server error. Possible fixes are to modify rack's
+ // deserialization algorithm or to provide an option or flag
+ // to force array serialization to be shallow.
+ buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v );
+ }
+ });
+
+ } else if ( !traditional && obj != null && typeof obj === "object" ) {
+ // Serialize object item.
+ jQuery.each( obj, function( k, v ) {
+ buildParams( prefix + "[" + k + "]", v );
+ });
+
+ } else {
+ // Serialize scalar item.
+ add( prefix, obj );
+ }
+ }
+
+ function add( key, value ) {
+ // If value is a function, invoke it and return its value
+ value = jQuery.isFunction(value) ? value() : value;
+ s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
+ }
+ }
});
var elemdisplay = {},
rfxtypes = /toggle|show|hide/,
@@ -5220,7 +5454,7 @@ var elemdisplay = {},
jQuery.fn.extend({
show: function( speed, callback ) {
- if ( speed != null ) {
+ if ( speed || speed === 0) {
return this.animate( genFx("show", 3), speed, callback);
} else {
@@ -5264,7 +5498,7 @@ jQuery.fn.extend({
},
hide: function( speed, callback ) {
- if ( speed != null ) {
+ if ( speed || speed === 0 ) {
return this.animate( genFx("hide", 3), speed, callback);
} else {
@@ -5691,16 +5925,16 @@ if ( "getBoundingClientRect" in document.documentElement ) {
jQuery.fn.offset = function( options ) {
var elem = this[0];
- if ( !elem || !elem.ownerDocument ) {
- return null;
- }
-
if ( options ) {
return this.each(function( i ) {
jQuery.offset.setOffset( this, options, i );
});
}
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
if ( elem === elem.ownerDocument.body ) {
return jQuery.offset.bodyOffset( elem );
}
@@ -5717,16 +5951,16 @@ if ( "getBoundingClientRect" in document.documentElement ) {
jQuery.fn.offset = function( options ) {
var elem = this[0];
- if ( !elem || !elem.ownerDocument ) {
- return null;
- }
-
if ( options ) {
return this.each(function( i ) {
jQuery.offset.setOffset( this, options, i );
});
}
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
if ( elem === elem.ownerDocument.body ) {
return jQuery.offset.bodyOffset( elem );
}
@@ -5968,6 +6202,13 @@ jQuery.each([ "Height", "Width" ], function( i, name ) {
if ( !elem ) {
return size == null ? null : this;
}
+
+ if ( jQuery.isFunction( size ) ) {
+ return this.each(function( i ) {
+ var self = jQuery( this );
+ self[ type ]( size.call( this, i, self[ type ]() ) );
+ });
+ }
return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window?
// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
diff --git a/share/www/status.html b/share/www/status.html
index 3dadebb0..2067ab9b 100644
--- a/share/www/status.html
+++ b/share/www/status.html
@@ -20,7 +20,7 @@ specific language governing permissions and limitations under the License.
<link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
<script src="script/json2.js"></script>
<script src="script/sha1.js"></script>
- <script src="script/jquery.js?1.4.0"></script>
+ <script src="script/jquery.js?1.4.2"></script>
<script src="script/jquery.couch.js?0.11.0"></script>
<script src="script/jquery.dialog.js?0.11.0"></script>
<script src="script/futon.js?0.11.0"></script>