if ( m ) a = jQuery.clean( [ m[1] ] );
// Watch for when an array is passed in
- this.get( a.constructor == Array || a.length && a[0].nodeType ?
- // Assume that it's an array of DOM Elements
+ this.get( a.constructor == Array || a.length && a[0] != undefined && a[0].nodeType ?
+ // Assume that it is an array of DOM Elements
jQuery.merge( a, [] ) :
// Find the matching elements and save them for later
* @param Object value The value to set the property to.
*/
css: function( key, value ) {
- return this.attr( key, value, "css" );
+ return this.attr( key, value, "curCSS" );
},
/**
* @type jQuery
* @param String type An event type
*/
- trigger: function( type ) {
- jQuery.event.trigger( this, type );
+ trigger: function( type, data ) {
+ jQuery.event.trigger( type, data, this );
}
};
this.length ? this[0][n] : null :
this.attr( n, h );
};
- }
-
- var css = "width,height,top,left,position,float,overflow,color,background".split(",");
-
+ };
+
+ var css = "width,height,top,left,position,float,overflow,color,background".split(",");
+
for ( var i in css ) new function() {
var n = css[i];
jQuery.fn[ i ] = function(h) {
return h == undefined ?
- this.length ? jQuery.css( this[0], n ) : null :
+ ( this.length ? jQuery.css( this[0], n ) : null ) :
this.css( n, h );
};
- }
+ };
}
});
return p == "height" ? oHeight : oWidth;
- }
-
+ } else if ( p == "opacity" && jQuery.browser.msie )
+ return parseFloat( jQuery.curCSS(e,"filter").replace(/[^0-9.]/,"") ) || 1;
+
+ return jQuery.curCSS( e, p );
+ },
+
+ curCSS: function(e,p,force) {
var r;
- if (e.style[p])
+ if (!force && e.style[p])
r = e.style[p];
- else if (e.currentStyle)
+ else if (e.currentStyle) {
+ p = p.replace(/\-(\w)/g,function(m,c){return c.toUpperCase()});
r = e.currentStyle[p];
- else if (document.defaultView && document.defaultView.getComputedStyle) {
+ } else if (document.defaultView && document.defaultView.getComputedStyle) {
p = p.replace(/([A-Z])/g,"-$1").toLowerCase();
var s = document.defaultView.getComputedStyle(e,"");
r = s ? s.getPropertyValue(p) : null;
contains: "(a.innerText||a.innerHTML).indexOf(m[3])>=0",
// Visibility
- visible: "jQuery.css(a,'display')!='none'&&jQuery.css(a,'visibility')!='hidden'",
- hidden: "jQuery.css(a,'display')=='none'||jQuery.css(a,'visibility')=='hidden'",
+ visible: "a.type!='hidden'&&jQuery.css(a,'display')!='none'&&jQuery.css(a,'visibility')!='hidden'",
+ hidden: "a.type=='hidden'||jQuery.css(a,'display')=='none'||jQuery.css(a,'visibility')=='hidden'",
// Form elements
enabled: "!a.disabled",
find: function( t, context ) {
// Make sure that the context is a DOM Element
- if ( context && context.getElementsByTagName == undefined )
+ if ( context && context.nodeType == undefined )
context = null;
// Set the correct context (if none is provided)
// The regular expressions that power the parsing engine
parse: [
// Match: [@value='test'], [@foo]
- "\\[ *(@)S *([!*$^=]*) *Q\\]",
+ [ "\\[ *(@)S *([!*$^=]*) *Q\\]", 1 ],
// Match: [div], [div p]
- "(\\[)Q\\]",
+ [ "(\\[)Q\\]", 0 ],
// Match: :contains('foo')
- "(:)S\\(Q\\)",
+ [ "(:)S\\(Q\\)", 0 ],
// Match: :even, :last-chlid
- "([:.#]*)S"
+ [ "([:.#]*)S", 0 ]
],
-
- parseSwap: [ 1, 0, 0, 0 ],
filter: function(t,r,not) {
// Figure out if we're doing regular, or inverse, filtering
while ( t && /^[a-z[({<*:.#]/i.test(t) ) {
- for ( var i = 0; i < jQuery.parse.length; i++ ) {
- var re = new RegExp( "^" + jQuery.parse[i]
+ var p = jQuery.parse;
+
+ for ( var i = 0; i < p.length; i++ ) {
+ var re = new RegExp( "^" + p[i][0]
// Look for a string-like sequence
.replace( 'S', "([a-z*_-][a-z0-9_-]*)" )
if ( m ) {
// Re-organize the match
- if ( jQuery.parseSwap[i] )
+ if ( p[i][1] )
m = ["", m[1], m[3], m[2], m[4]];
// Remove what we just matched
},
handle: function(event) {
+ if ( typeof jQuery == "undefined" ) return;
+
event = event || jQuery.event.fix( window.event );
// If no correct event was found, fail