| @@ 2726-2753 (lines=28) @@ | ||
| 2723 | var risSimple = /^.[^:#\[\.,]*$/; |
|
| 2724 | ||
| 2725 | // Implement the identical functionality for filter and not |
|
| 2726 | function winnow( elements, qualifier, not ) { |
|
| 2727 | if ( jQuery.isFunction( qualifier ) ) { |
|
| 2728 | return jQuery.grep( elements, function( elem, i ) { |
|
| 2729 | /* jshint -W018 */ |
|
| 2730 | return !!qualifier.call( elem, i, elem ) !== not; |
|
| 2731 | } ); |
|
| 2732 | ||
| 2733 | } |
|
| 2734 | ||
| 2735 | if ( qualifier.nodeType ) { |
|
| 2736 | return jQuery.grep( elements, function( elem ) { |
|
| 2737 | return ( elem === qualifier ) !== not; |
|
| 2738 | } ); |
|
| 2739 | ||
| 2740 | } |
|
| 2741 | ||
| 2742 | if ( typeof qualifier === "string" ) { |
|
| 2743 | if ( risSimple.test( qualifier ) ) { |
|
| 2744 | return jQuery.filter( qualifier, elements, not ); |
|
| 2745 | } |
|
| 2746 | ||
| 2747 | qualifier = jQuery.filter( qualifier, elements ); |
|
| 2748 | } |
|
| 2749 | ||
| 2750 | return jQuery.grep( elements, function( elem ) { |
|
| 2751 | return ( indexOf.call( qualifier, elem ) > -1 ) !== not; |
|
| 2752 | } ); |
|
| 2753 | } |
|
| 2754 | ||
| 2755 | jQuery.filter = function( expr, elems, not ) { |
|
| 2756 | var elem = elems[ 0 ]; |
|
| @@ 2607-2634 (lines=28) @@ | ||
| 2604 | var risSimple = /^.[^:#\[\.,]*$/; |
|
| 2605 | ||
| 2606 | // Implement the identical functionality for filter and not |
|
| 2607 | function winnow( elements, qualifier, not ) { |
|
| 2608 | if ( jQuery.isFunction( qualifier ) ) { |
|
| 2609 | return jQuery.grep( elements, function( elem, i ) { |
|
| 2610 | /* jshint -W018 */ |
|
| 2611 | return !!qualifier.call( elem, i, elem ) !== not; |
|
| 2612 | }); |
|
| 2613 | ||
| 2614 | } |
|
| 2615 | ||
| 2616 | if ( qualifier.nodeType ) { |
|
| 2617 | return jQuery.grep( elements, function( elem ) { |
|
| 2618 | return ( elem === qualifier ) !== not; |
|
| 2619 | }); |
|
| 2620 | ||
| 2621 | } |
|
| 2622 | ||
| 2623 | if ( typeof qualifier === "string" ) { |
|
| 2624 | if ( risSimple.test( qualifier ) ) { |
|
| 2625 | return jQuery.filter( qualifier, elements, not ); |
|
| 2626 | } |
|
| 2627 | ||
| 2628 | qualifier = jQuery.filter( qualifier, elements ); |
|
| 2629 | } |
|
| 2630 | ||
| 2631 | return jQuery.grep( elements, function( elem ) { |
|
| 2632 | return ( indexOf.call( qualifier, elem ) >= 0 ) !== not; |
|
| 2633 | }); |
|
| 2634 | } |
|
| 2635 | ||
| 2636 | jQuery.filter = function( expr, elems, not ) { |
|
| 2637 | var elem = elems[ 0 ]; |
|