Remove jquery.delayedBind module
authorBartosz Dziewoński <matma.rex@gmail.com>
Sat, 22 Feb 2014 19:21:39 +0000 (20:21 +0100)
committerBartosz Dziewoński <matma.rex@gmail.com>
Mon, 14 Apr 2014 18:19:13 +0000 (20:19 +0200)
As promised, removing the module deprecated in 1.23.

Its test suite was already removed earlier.

Change-Id: Ifc84b09a78007a6a0ea5676b0f12a38937dca2e7

RELEASE-NOTES-1.24
resources/Resources.php
resources/src/jquery/jquery.delayedBind.js [deleted file]
tests/qunit/QUnitTestResources.php

index 3f4c617..3d9efc3 100644 (file)
@@ -23,6 +23,7 @@ regularly. Below only new and removed languages are listed, as well as
 changes to languages because of Bugzilla reports.
 
 === Other changes in 1.24 ===
+* The deprecated jquery.delayedBind ResourceLoader module was removed.
 
 == Compatibility ==
 
index 642897c..cea012a 100644 (file)
@@ -236,9 +236,6 @@ return array(
                'scripts' => 'resources/lib/jquery/jquery.cookie.js',
                'targets' => array( 'desktop', 'mobile' ),
        ),
-       'jquery.delayedBind' => array(
-               'scripts' => 'resources/src/jquery/jquery.delayedBind.js',
-       ),
        'jquery.expandableField' => array(
                'scripts' => 'resources/src/jquery/jquery.expandableField.js',
        ),
diff --git a/resources/src/jquery/jquery.delayedBind.js b/resources/src/jquery/jquery.delayedBind.js
deleted file mode 100644 (file)
index 874c111..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-( function ( mw, $ ) {
-/**
- * Function that escapes spaces in event names. This is needed because
- * "_delayedBind-foo bar-1000" refers to two events
- */
-function encodeEvent( event ) {
-       return event.replace( /-/g, '--' ).replace( / /g, '-' );
-}
-
-$.fn.extend( {
-       /**
-        * Bind a callback to an event in a delayed fashion.
-        * In detail, this means that the callback will be called a certain
-        * time after the event fires, but the timer is reset every time
-        * the event fires.
-        * @param timeout Number of milliseconds to wait
-        * @param event Name of the event (string)
-        * @param data Data to pass to the event handler (optional)
-        * @param callback Function to call
-        */
-       delayedBind: function ( timeout, event, data, callback ) {
-               if ( arguments.length === 3 ) {
-                       // Shift optional parameter down
-                       callback = data;
-                       data = undefined;
-               }
-               var encEvent = encodeEvent( event );
-               return this.each( function () {
-                       var that = this;
-                       // Bind the top half
-                       // Do this only once for every (event, timeout) pair
-                       if (  !( $(this).data( '_delayedBindBound-' + encEvent + '-' + timeout ) ) ) {
-                               $(this).data( '_delayedBindBound-' + encEvent + '-' + timeout, true );
-                               $(this).bind( event, function () {
-                                       var timerID = $(this).data( '_delayedBindTimerID-' + encEvent + '-' + timeout );
-                                       // Cancel the running timer
-                                       if ( timerID !== null ) {
-                                               clearTimeout( timerID );
-                                       }
-                                       timerID = setTimeout( function () {
-                                               $(that).trigger( '_delayedBind-' + encEvent + '-' + timeout );
-                                       }, timeout );
-                                       $(this).data( '_delayedBindTimerID-' + encEvent + '-' + timeout, timerID );
-                               } );
-                       }
-
-                       // Bottom half
-                       $(this).bind( '_delayedBind-' + encEvent + '-' + timeout, data, callback );
-               } );
-       },
-
-       /**
-        * Cancel the timers for delayed events on the selected elements.
-        */
-       delayedBindCancel: function ( timeout, event ) {
-               var encEvent = encodeEvent( event );
-               return this.each( function () {
-                       var timerID = $(this).data( '_delayedBindTimerID-' + encEvent + '-' + timeout );
-                       if ( timerID !== null ) {
-                               clearTimeout( timerID );
-                       }
-               } );
-       },
-
-       /**
-        * Unbind an event bound with delayedBind()
-        */
-       delayedBindUnbind: function ( timeout, event, callback ) {
-               var encEvent = encodeEvent( event );
-               return this.each( function () {
-                       $(this).unbind( '_delayedBind-' + encEvent + '-' + timeout, callback );
-               } );
-       }
-} );
-
-mw.log.deprecate( $.fn, 'delayedBind', $.fn.delayedBind,
-       'Use the jquery.throttle-debounce module instead' );
-mw.log.deprecate( $.fn, 'delayedBindCancel', $.fn.delayedBindCancel,
-       'Use the jquery.throttle-debounce module instead' );
-mw.log.deprecate( $.fn, 'delayedBindUnbind', $.fn.delayedBindUnbind,
-       'Use the jquery.throttle-debounce module instead' );
-
-}( mediaWiki, jQuery ) );
index 74ea58e..a0fb918 100644 (file)
@@ -83,7 +83,6 @@ return array(
                        'jquery.client',
                        'jquery.color',
                        'jquery.colorUtil',
-                       'jquery.delayedBind',
                        'jquery.getAttrs',
                        'jquery.hidpi',
                        'jquery.highlightText',