aboutsummaryrefslogtreecommitdiffstats
path: root/src/selector
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2007-01-10 17:54:42 +0000
committerJohn Resig <jeresig@gmail.com>2007-01-10 17:54:42 +0000
commitf2ff0db0320cfab0d856ff68d012cb843c97b600 (patch)
treeef7603b8db47c45863028d63a35a4d4ae4f12a03 /src/selector
parentee0175c4b9d665322ac496dfcc6f8b0cc70b3c35 (diff)
downloadjquery-f2ff0db0320cfab0d856ff68d012cb843c97b600.tar.gz
jquery-f2ff0db0320cfab0d856ff68d012cb843c97b600.zip
Lots of improvements. Added support for .not( jQuery("...") ) and support for multi filters: .filter("foo,bar") .parent("div, .class"), etc.
Diffstat (limited to 'src/selector')
-rw-r--r--src/selector/selector.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/selector/selector.js b/src/selector/selector.js
index e21102c8d..1bad21b63 100644
--- a/src/selector/selector.js
+++ b/src/selector/selector.js
@@ -89,6 +89,24 @@ jQuery.extend({
}
],
+ multiFilter: function( expr, elems, not ) {
+ var old, cur = [];
+
+ while ( expr && expr != old ) {
+console.log( cur, expr, elems, not );
+ var f = jQuery.filter( expr, elems, not );
+ expr = f.t.replace(/^\s*,\s*/, "" );
+
+ if ( not )
+ cur = elems = f.r;
+ else
+ cur = jQuery.merge( cur, f.r );
+ }
+console.log( "DONE", cur, expr, elems, not );
+
+ return cur;
+ },
+
/**
* @name $.find
* @type Array<Element>