X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fjquery%2Fjquery.js;h=d22d136f7eec4b0510bc7ba36c495ce49fdef9df;hb=c20924818c560f1afd9c60f188c8bc616583217b;hp=3d2bf48869adbd01ea4460aa8b8b29258321ce34;hpb=37ee2df8a81fa4e9fba49dbc166c4e89820f9152;p=jquery.git diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 3d2bf48..d22d136 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -1473,20 +1473,24 @@ jQuery.extend({ "^=": "z && !z.indexOf(m[4])", "$=": "z && z.substr(z.length - m[4].length,m[4].length)==m[4]", "*=": "z && z.indexOf(m[4])>=0", - "": "z" + "": "z", + _resort: function(m){ + return ["", m[1], m[3], m[2], m[5]]; + }, + _prefix: "z=jQuery.attr(a,m[3]);" }, "[": "jQuery.find(m[2],a).length" }, - /** + /** * All elements on a specified axis. * * @private * @name $.sibling * @type Array * @param Element elem The element to find all the siblings of (including itself). - * @cat DOM/Traversing - */ + * @cat DOM/Traversing + */ sibling: function( n, elem ) { var r = []; @@ -1806,8 +1810,8 @@ jQuery.extend({ if ( m ) { // Re-organize the first match - if ( !i ) - m = ["",m[1], m[3], m[2], m[5]]; + if ( jQuery.expr[ m[1] ]._resort ) + m = jQuery.expr[ m[1] ]._resort( m ); // Remove what we just matched t = t.replace( re, "" ); @@ -1838,7 +1842,7 @@ jQuery.extend({ // Build a custom macro to enclose it eval("f = function(a,i){" + - ( m[1] == "@" ? "z=jQuery.attr(a,m[3]);" : "" ) + + ( jQuery.expr[ m[1] ]._prefix || "" ) + "return " + f + "}"); // Execute it against the current filter