Sbisson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/248070

Change subject: Depend on jquery.findWithParent from Core
......................................................................

Depend on jquery.findWithParent from Core

Depends on Ibf7f498491bc134f924dc08c59e086d70d6baadd

Bug: T116146
Change-Id: I48450d1518ac4e0cb4f0bd5f39f4c060f72f5f9e
---
M Resources.php
D modules/engine/misc/jquery.findWithParent.js
2 files changed, 1 insertion(+), 63 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/70/248070/1

diff --git a/Resources.php b/Resources.php
index bee4a05..b00159a 100644
--- a/Resources.php
+++ b/Resources.php
@@ -353,7 +353,7 @@
                'dependencies' => array(
                        'oojs',
                        'ext.flow.templating', // prototype-based for 
progressiveEnhancement
-                       'ext.flow.jquery.findWithParent',
+                       'jquery.findWithParent',
                        'ext.flow.vendor.storer',
                        'mediawiki.Title',
                        'mediawiki.user',
@@ -609,11 +609,6 @@
        'ext.flow.jquery.conditionalScroll' => $flowResourceTemplate + array(
                'scripts' => array(
                        'engine/misc/jquery.conditionalScroll.js',
-               ),
-       ) + $mobile,
-       'ext.flow.jquery.findWithParent' => $flowResourceTemplate + array(
-               'scripts' => array(
-                       'engine/misc/jquery.findWithParent.js',
                ),
        ) + $mobile,
 );
diff --git a/modules/engine/misc/jquery.findWithParent.js 
b/modules/engine/misc/jquery.findWithParent.js
deleted file mode 100644
index 99011a8..0000000
--- a/modules/engine/misc/jquery.findWithParent.js
+++ /dev/null
@@ -1,57 +0,0 @@
-( function ( $ ) {
-       /** @class jQuery */
-
-       /**
-        * Gives support to find parent elements using .closest with less-than 
selector syntax.
-        *
-        *     $.findWithParent( $div, "< html div < body" ); // find closest 
parent of $div "html", find child "div" of it, find closest parent "body" of 
that, return "body"
-        *     $( '#foo' ).findWithParent( '.bar < .baz' ); // find child 
".bar" of "#foo", return closest parent ".baz" from there
-        *
-        * @method findWithParent
-        * @param {jQuery|HTMLElement|string} $context
-        * @param {string} selector
-        * @return {jQuery}
-        */
-       function jQueryFindWithParent( $context, selector ) {
-               var matches;
-
-               $context = $( $context );
-               selector = $.trim( selector );
-
-               while ( selector && ( matches = selector.match( 
/(.*?(?:^|[>\s+~]))(<\s*[^>\s+~]+)(.*?)$/ ) ) ) {
-                       if ( $.trim( matches[ 1 ] ) ) {
-                               $context = $context.find( matches[ 1 ] );
-                       }
-                       if ( $.trim( matches[ 2 ] ) ) {
-                               $context = $context.closest( matches[ 2 
].substr( 1 ) );
-                       }
-                       selector = $.trim( matches[ 3 ] );
-               }
-
-               if ( selector ) {
-                       $context = $context.find( selector );
-               }
-
-               return $context;
-       }
-
-       $.findWithParent = jQueryFindWithParent;
-
-       /** @class jQuery.fn */
-       /**
-        * @param {string} selector
-        * @return {jQuery}
-        * @see jQuery#findWithParent
-        */
-       $.fn.findWithParent = function ( selector ) {
-               var selectors = selector.split( ',' ),
-                       $elements = $(),
-                       self = this;
-
-               $.each( selectors, function ( i, selector ) {
-                       $elements = $elements.add( jQueryFindWithParent( self, 
selector ) );
-               } );
-
-               return $elements;
-       };
-}( jQuery ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/248070
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I48450d1518ac4e0cb4f0bd5f39f4c060f72f5f9e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Sbisson <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to