git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
88c88f0
)
Added minor support for |= and ~= selectors.
author
John Resig
<jeresig@gmail.com>
Fri, 29 Jun 2007 21:43:22 +0000
(21:43 +0000)
committer
John Resig
<jeresig@gmail.com>
Fri, 29 Jun 2007 21:43:22 +0000
(21:43 +0000)
src/selector/selector.js
patch
|
blob
|
history
diff --git
a/src/selector/selector.js
b/src/selector/selector.js
index
94af81e
..
bc250fe
100644
(file)
--- a/
src/selector/selector.js
+++ b/
src/selector/selector.js
@@
-53,7
+53,7
@@
jQuery.extend({
// The regular expressions that power the parsing engine
parse: [
// Match: [@value='test'], [@foo]
// The regular expressions that power the parsing engine
parse: [
// Match: [@value='test'], [@foo]
- /^\[ *(@)([\w-]+) *([!*$^=]*) *('?"?)(.*?)\4 *\]/,
+ /^\[ *(@)([\w-]+) *([!*$^~|=]*) *('?"?)(.*?)\4 *\]/,
// Match: [div], [div p]
/^(\[)\s*(.*?(\[.*?\])?[^[]*?)\s*\]/,
// Match: [div], [div p]
/^(\[)\s*(.*?(\[.*?\])?[^[]*?)\s*\]/,
@@
-347,7
+347,7
@@
jQuery.extend({
type == "!=" && z != m[5] ||
type == "^=" && z && !z.indexOf(m[5]) ||
type == "$=" && z.substr(z.length - m[5].length) == m[5] ||
type == "!=" && z != m[5] ||
type == "^=" && z && !z.indexOf(m[5]) ||
type == "$=" && z.substr(z.length - m[5].length) == m[5] ||
- type == "*=" && z.indexOf(m[5]) >= 0) ^ not )
+ (type == "*=" || type == "|=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not )
tmp.push( a );
}
tmp.push( a );
}