From 3fc156d513cf4bca7e4c69817bea7d014716fe80 Mon Sep 17 00:00:00 2001 From: akansjain <100862574+akansjain@users.noreply.github.com> Date: Tue, 6 Jun 2023 23:04:04 +0530 Subject: [PATCH 1/3] Removed createCallback function --- src/openseadragon.js | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/src/openseadragon.js b/src/openseadragon.js index c03a0288..bcd629ef 100644 --- a/src/openseadragon.js +++ b/src/openseadragon.js @@ -2252,42 +2252,6 @@ function OpenSeadragon( options ){ }, - /** - * Similar to OpenSeadragon.delegate, but it does not immediately call - * the method on the object, returning a function which can be called - * repeatedly to delegate the method. It also allows additional arguments - * to be passed during construction which will be added during each - * invocation, and each invocation can add additional arguments as well. - * - * @function - * @param {Object} object - * @param {Function} method - * @param [args] any additional arguments are passed as arguments to the - * created callback - * @returns {Function} - */ - createCallback: function( object, method ) { - //TODO: This pattern is painful to use and debug. It's much cleaner - // to use pinning plus anonymous functions. Get rid of this - // pattern! - var initialArgs = [], - i; - for ( i = 2; i < arguments.length; i++ ) { - initialArgs.push( arguments[ i ] ); - } - - return function() { - var args = initialArgs.concat( [] ), - i; - for ( i = 0; i < arguments.length; i++ ) { - args.push( arguments[ i ] ); - } - - return method.apply( object, args ); - }; - }, - - /** * Retrieves the value of a url parameter from the window.location string. * @function From 7dec7b9abac87607a1f4c1d2757b265db3b7da64 Mon Sep 17 00:00:00 2001 From: akansjain <100862574+akansjain@users.noreply.github.com> Date: Fri, 9 Jun 2023 17:58:22 +0530 Subject: [PATCH 2/3] Added console.error() in createCallback() function --- src/openseadragon.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/openseadragon.js b/src/openseadragon.js index bcd629ef..7b306f2d 100644 --- a/src/openseadragon.js +++ b/src/openseadragon.js @@ -2251,6 +2251,42 @@ function OpenSeadragon( options ){ event.stopPropagation(); }, + /** + * Similar to OpenSeadragon.delegate, but it does not immediately call + * the method on the object, returning a function which can be called + * repeatedly to delegate the method. It also allows additional arguments + * to be passed during construction which will be added during each + * invocation, and each invocation can add additional arguments as well. + * + * @function + * @param {Object} object + * @param {Function} method + * @param [args] any additional arguments are passed as arguments to the + * created callback + * @returns {Function} + */ + createCallback: function( object, method ) { + //TODO: This pattern is painful to use and debug. It's much cleaner + // to use pinning plus anonymous functions. Get rid of this + // pattern! + console.error('The createCallback function is deprecated and will be removed in future versions. Please use alternativeFunction instead.'); + var initialArgs = [], + i; + for ( i = 2; i < arguments.length; i++ ) { + initialArgs.push( arguments[ i ] ); + } + + return function() { + var args = initialArgs.concat( [] ), + i; + for ( i = 0; i < arguments.length; i++ ) { + args.push( arguments[ i ] ); + } + + return method.apply( object, args ); + }; + }, + /** * Retrieves the value of a url parameter from the window.location string. From eaa41f7f05fe4ca52a87f6dc1aba5a358228374f Mon Sep 17 00:00:00 2001 From: akansjain <100862574+akansjain@users.noreply.github.com> Date: Wed, 21 Jun 2023 13:34:58 +0530 Subject: [PATCH 3/3] Replaced the comment with Deprecated --- src/openseadragon.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/openseadragon.js b/src/openseadragon.js index 7b306f2d..278f61c8 100644 --- a/src/openseadragon.js +++ b/src/openseadragon.js @@ -2251,20 +2251,7 @@ function OpenSeadragon( options ){ event.stopPropagation(); }, - /** - * Similar to OpenSeadragon.delegate, but it does not immediately call - * the method on the object, returning a function which can be called - * repeatedly to delegate the method. It also allows additional arguments - * to be passed during construction which will be added during each - * invocation, and each invocation can add additional arguments as well. - * - * @function - * @param {Object} object - * @param {Function} method - * @param [args] any additional arguments are passed as arguments to the - * created callback - * @returns {Function} - */ + // Deprecated createCallback: function( object, method ) { //TODO: This pattern is painful to use and debug. It's much cleaner // to use pinning plus anonymous functions. Get rid of this