Side navigation
Ticket #4158: 4156.patch
File 4156.patch, 1.4 KB (added by dz, February 16, 2009 04:38PM UTC)
Index: selector.js
===================================================================
--- selector.js (revision 6208)
+++ selector.js (working copy)
@@ -510,6 +510,25 @@
}
},
filter: {
+ PSEUDO: function(elem, match, i, array){
+ var name = match[1], filter = Expr.filters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ } else if ( name === "contains" ) {
+ return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;
+ } else if ( name === "not" ) {
+ var not = match[3];
+
+ for ( var i = 0, l = not.length; i < l; i++ ) {
+ if ( not[i] === elem ) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+ },
CHILD: function(elem, match){
var type = match[1], node = elem;
switch (type) {
@@ -553,25 +572,6 @@
}
}
},
- PSEUDO: function(elem, match, i, array){
- var name = match[1], filter = Expr.filters[ name ];
-
- if ( filter ) {
- return filter( elem, i, match, array );
- } else if ( name === "contains" ) {
- return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;
- } else if ( name === "not" ) {
- var not = match[3];
-
- for ( var i = 0, l = not.length; i < l; i++ ) {
- if ( not[i] === elem ) {
- return false;
- }
- }
-
- return true;
- }
- },
ID: function(elem, match){
return elem.nodeType === 1 && elem.getAttribute("id") === match;
},
Download in other formats:
Original Format
File 4156.patch, 1.4 KB (added by dz, February 16, 2009 04:38PM UTC)
Index: selector.js
===================================================================
--- selector.js (revision 6208)
+++ selector.js (working copy)
@@ -510,6 +510,25 @@
}
},
filter: {
+ PSEUDO: function(elem, match, i, array){
+ var name = match[1], filter = Expr.filters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ } else if ( name === "contains" ) {
+ return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;
+ } else if ( name === "not" ) {
+ var not = match[3];
+
+ for ( var i = 0, l = not.length; i < l; i++ ) {
+ if ( not[i] === elem ) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+ },
CHILD: function(elem, match){
var type = match[1], node = elem;
switch (type) {
@@ -553,25 +572,6 @@
}
}
},
- PSEUDO: function(elem, match, i, array){
- var name = match[1], filter = Expr.filters[ name ];
-
- if ( filter ) {
- return filter( elem, i, match, array );
- } else if ( name === "contains" ) {
- return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;
- } else if ( name === "not" ) {
- var not = match[3];
-
- for ( var i = 0, l = not.length; i < l; i++ ) {
- if ( not[i] === elem ) {
- return false;
- }
- }
-
- return true;
- }
- },
ID: function(elem, match){
return elem.nodeType === 1 && elem.getAttribute("id") === match;
},