diff --git a/lib/OpenLayers/Util.js b/lib/OpenLayers/Util.js index 729bbce20d..13f93f166d 100644 --- a/lib/OpenLayers/Util.js +++ b/lib/OpenLayers/Util.js @@ -103,23 +103,6 @@ OpenLayers.Util.removeItem = function(array, item) { return array; }; -/** - * Function: clearArray - * *Deprecated*. This function will disappear in 3.0. - * Please use "array.length = 0" instead. - * - * Parameters: - * array - {Array} - */ -OpenLayers.Util.clearArray = function(array) { - OpenLayers.Console.warn( - OpenLayers.i18n( - "methodDeprecated", {'newMethod': 'array = []'} - ) - ); - array.length = 0; -}; - /** * Function: indexOf * Seems to exist already in FF, but not in MOZ. @@ -299,27 +282,6 @@ OpenLayers.Util.createImage = function(id, px, sz, imgURL, position, border, return image; }; -/** - * Function: setOpacity - * *Deprecated*. This function has been deprecated. Instead, please use - * - * or - * - * - * Set the opacity of a DOM Element - * Note that for this function to work in IE, elements must "have layout" - * according to: - * http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/haslayout.asp - * - * Parameters: - * element - {DOMElement} Set the opacity on this DOM element - * opacity - {Float} Opacity value (0.0 - 1.0) - */ -OpenLayers.Util.setOpacity = function(element, opacity) { - OpenLayers.Util.modifyDOMElement(element, null, null, null, - null, null, null, opacity); -}; - /** * Property: IMAGE_RELOAD_ATTEMPTS * {Integer} How many times should we try to reload an image before giving up? @@ -930,27 +892,6 @@ OpenLayers.Util.getParameters = function(url) { return parameters; }; -/** - * Function: getArgs - * *Deprecated*. Will be removed in 3.0. Please use instead - * - * - * Parameters: - * url - {String} Optional url used to extract the query string. - * If null, query string is taken from page location. - * - * Returns: - * {Object} An object of key/value pairs from the query string. - */ -OpenLayers.Util.getArgs = function(url) { - OpenLayers.Console.warn( - OpenLayers.i18n( - "methodDeprecated", {'newMethod': 'OpenLayers.Util.getParameters'} - ) - ); - return OpenLayers.Util.getParameters(url); -}; - /** * Property: lastSeqID * {Integer} The ever-incrementing count variable. @@ -1155,22 +1096,6 @@ OpenLayers.Util.getScaleFromResolution = function (resolution, units) { return scale; }; -/** - * Function: safeStopPropagation - * *Deprecated*. This function has been deprecated. Please use directly - * passing 'true' as the 2nd - * argument (preventDefault) - * - * Safely stop the propagation of an event *without* preventing - * the default browser action from occurring. - * - * Parameter: - * evt - {Event} - */ -OpenLayers.Util.safeStopPropagation = function(evt) { - OpenLayers.Event.stop(evt, true); -}; - /** * Function: pagePosition * Calculates the position of an element on the page (see diff --git a/lib/deprecated.js b/lib/deprecated.js index 20243ea459..fc0e11bf38 100644 --- a/lib/deprecated.js +++ b/lib/deprecated.js @@ -60,6 +60,81 @@ OpenLayers.Class.inherit = function (P) { return C.prototype; }; +/** + * Function: clearArray + * *Deprecated*. This function will disappear in 3.0. + * Please use "array.length = 0" instead. + * + * Parameters: + * array - {Array} + */ +OpenLayers.Util.clearArray = function(array) { + OpenLayers.Console.warn( + OpenLayers.i18n( + "methodDeprecated", {'newMethod': 'array = []'} + ) + ); + array.length = 0; +}; + +/** + * Function: setOpacity + * *Deprecated*. This function has been deprecated. Instead, please use + * + * or + * + * + * Set the opacity of a DOM Element + * Note that for this function to work in IE, elements must "have layout" + * according to: + * http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/haslayout.asp + * + * Parameters: + * element - {DOMElement} Set the opacity on this DOM element + * opacity - {Float} Opacity value (0.0 - 1.0) + */ +OpenLayers.Util.setOpacity = function(element, opacity) { + OpenLayers.Util.modifyDOMElement(element, null, null, null, + null, null, null, opacity); +}; + +/** + * Function: safeStopPropagation + * *Deprecated*. This function has been deprecated. Please use directly + * passing 'true' as the 2nd + * argument (preventDefault) + * + * Safely stop the propagation of an event *without* preventing + * the default browser action from occurring. + * + * Parameter: + * evt - {Event} + */ +OpenLayers.Util.safeStopPropagation = function(evt) { + OpenLayers.Event.stop(evt, true); +}; + +/** + * Function: getArgs + * *Deprecated*. Will be removed in 3.0. Please use instead + * + * + * Parameters: + * url - {String} Optional url used to extract the query string. + * If null, query string is taken from page location. + * + * Returns: + * {Object} An object of key/value pairs from the query string. + */ +OpenLayers.Util.getArgs = function(url) { + OpenLayers.Console.warn( + OpenLayers.i18n( + "methodDeprecated", {'newMethod': 'OpenLayers.Util.getParameters'} + ) + ); + return OpenLayers.Util.getParameters(url); +}; + /** * Function: OpenLayers.nullHandler * @param {} request diff --git a/tests/Util.html b/tests/Util.html index d6dcc93def..51eabd244a 100644 --- a/tests/Util.html +++ b/tests/Util.html @@ -1019,33 +1019,6 @@ } - function test_Util_getArgs(t) { - //DEPRECATED -- to be removed in 3.0 - t.plan(3); - - OpenLayers.Lang.setCode(OpenLayers.Lang.defaultCode); - - var temp = OpenLayers.Console.warn; - OpenLayers.Console.warn = function(err) { - t.ok(err != null, "warning is fired on use of getArgs()"); - } - - var temp2 = OpenLayers.Util.getParameters; - OpenLayers.Util.getParameters = function(url) { - t.eq(url, g_Url, "correct url passed to getParameters()"); - return g_Params; - } - - g_Params = {}; - g_Url = {}; - - var ret = OpenLayers.Util.getArgs(g_Url); - t.ok( ret == g_Params, "correctly returns value from getParameters"); - - OpenLayers.Console.warn = temp; - OpenLayers.Util.getParameters = temp2; - } - function tests_Util_extend(t) { t.plan(7);