Move deprecated functions from OpenLayers.Util into deprecated.js.
This commit is contained in:
@@ -103,23 +103,6 @@ OpenLayers.Util.removeItem = function(array, item) {
|
|||||||
return array;
|
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
|
* Function: indexOf
|
||||||
* Seems to exist already in FF, but not in MOZ.
|
* 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;
|
return image;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Function: setOpacity
|
|
||||||
* *Deprecated*. This function has been deprecated. Instead, please use
|
|
||||||
* <OpenLayers.Util.modifyDOMElement>
|
|
||||||
* or
|
|
||||||
* <OpenLayers.Util.modifyAlphaImageDiv>
|
|
||||||
*
|
|
||||||
* 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
|
* Property: IMAGE_RELOAD_ATTEMPTS
|
||||||
* {Integer} How many times should we try to reload an image before giving up?
|
* {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;
|
return parameters;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Function: getArgs
|
|
||||||
* *Deprecated*. Will be removed in 3.0. Please use instead
|
|
||||||
* <OpenLayers.Util.getParameters>
|
|
||||||
*
|
|
||||||
* 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
|
* Property: lastSeqID
|
||||||
* {Integer} The ever-incrementing count variable.
|
* {Integer} The ever-incrementing count variable.
|
||||||
@@ -1155,22 +1096,6 @@ OpenLayers.Util.getScaleFromResolution = function (resolution, units) {
|
|||||||
return scale;
|
return scale;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Function: safeStopPropagation
|
|
||||||
* *Deprecated*. This function has been deprecated. Please use directly
|
|
||||||
* <OpenLayers.Event.stop> 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
|
* Function: pagePosition
|
||||||
* Calculates the position of an element on the page (see
|
* Calculates the position of an element on the page (see
|
||||||
|
|||||||
@@ -60,6 +60,81 @@ OpenLayers.Class.inherit = function (P) {
|
|||||||
return C.prototype;
|
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
|
||||||
|
* <OpenLayers.Util.modifyDOMElement>
|
||||||
|
* or
|
||||||
|
* <OpenLayers.Util.modifyAlphaImageDiv>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* <OpenLayers.Event.stop> 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
|
||||||
|
* <OpenLayers.Util.getParameters>
|
||||||
|
*
|
||||||
|
* 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
|
* Function: OpenLayers.nullHandler
|
||||||
* @param {} request
|
* @param {} request
|
||||||
|
|||||||
@@ -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) {
|
function tests_Util_extend(t) {
|
||||||
t.plan(7);
|
t.plan(7);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user