Deprecated methods from BaseTypes.js.
This commit is contained in:
@@ -198,75 +198,6 @@ OpenLayers.String = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!String.prototype.startsWith) {
|
|
||||||
/**
|
|
||||||
* APIMethod: String.startsWith
|
|
||||||
* *Deprecated*. Whether or not a string starts with another string.
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* sStart - {String} The string we're testing for.
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
* {Boolean} Whether or not this string starts with the string passed in.
|
|
||||||
*/
|
|
||||||
String.prototype.startsWith = function(sStart) {
|
|
||||||
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",
|
|
||||||
{'newMethod':'OpenLayers.String.startsWith'}));
|
|
||||||
return OpenLayers.String.startsWith(this, sStart);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!String.prototype.contains) {
|
|
||||||
/**
|
|
||||||
* APIMethod: String.contains
|
|
||||||
* *Deprecated*. Whether or not a string contains another string.
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* str - {String} The string that we're testing for.
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
* {Boolean} Whether or not this string contains with the string passed in.
|
|
||||||
*/
|
|
||||||
String.prototype.contains = function(str) {
|
|
||||||
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",
|
|
||||||
{'newMethod':'OpenLayers.String.contains'}));
|
|
||||||
return OpenLayers.String.contains(this, str);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!String.prototype.trim) {
|
|
||||||
/**
|
|
||||||
* APIMethod: String.trim
|
|
||||||
* *Deprecated*. Removes leading and trailing whitespace characters from a string.
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
* {String} A trimmed version of the string - all leading and
|
|
||||||
* trailing spaces removed
|
|
||||||
*/
|
|
||||||
String.prototype.trim = function() {
|
|
||||||
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",
|
|
||||||
{'newMethod':'OpenLayers.String.trim'}));
|
|
||||||
return OpenLayers.String.trim(this);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!String.prototype.camelize) {
|
|
||||||
/**
|
|
||||||
* APIMethod: String.camelize
|
|
||||||
* *Deprecated*. Camel-case a hyphenated string.
|
|
||||||
* Ex. "chicken-head" becomes "chickenHead", and
|
|
||||||
* "-chicken-head" becomes "ChickenHead".
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
* {String} The string, camelized
|
|
||||||
*/
|
|
||||||
String.prototype.camelize = function() {
|
|
||||||
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",
|
|
||||||
{'newMethod':'OpenLayers.String.camelize'}));
|
|
||||||
return OpenLayers.String.camelize(this);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Namespace: OpenLayers.Number
|
* Namespace: OpenLayers.Number
|
||||||
* Contains convenience functions for manipulating numbers.
|
* Contains convenience functions for manipulating numbers.
|
||||||
@@ -360,26 +291,6 @@ OpenLayers.Number = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!Number.prototype.limitSigDigs) {
|
|
||||||
/**
|
|
||||||
* APIMethod: Number.limitSigDigs
|
|
||||||
* *Deprecated*. Limit the number of significant digits on an integer. Does *not*
|
|
||||||
* work with floats!
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* sig - {Integer}
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
* {Integer} The number, rounded to the specified number of significant digits.
|
|
||||||
* If null, 0, or negative value passed in, returns 0
|
|
||||||
*/
|
|
||||||
Number.prototype.limitSigDigs = function(sig) {
|
|
||||||
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",
|
|
||||||
{'newMethod':'OpenLayers.Number.limitSigDigs'}));
|
|
||||||
return OpenLayers.Number.limitSigDigs(this, sig);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Namespace: OpenLayers.Function
|
* Namespace: OpenLayers.Function
|
||||||
* Contains convenience functions for function manipulation.
|
* Contains convenience functions for function manipulation.
|
||||||
@@ -471,47 +382,6 @@ OpenLayers.Function = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!Function.prototype.bind) {
|
|
||||||
/**
|
|
||||||
* APIMethod: Function.bind
|
|
||||||
* *Deprecated*. Bind a function to an object.
|
|
||||||
* Method to easily create closures with 'this' altered.
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* object - {Object} the this parameter
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
* {Function} A closure with 'this' altered to the first
|
|
||||||
* argument.
|
|
||||||
*/
|
|
||||||
Function.prototype.bind = function() {
|
|
||||||
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",
|
|
||||||
{'newMethod':'OpenLayers.Function.bind'}));
|
|
||||||
// new function takes the same arguments with this function up front
|
|
||||||
Array.prototype.unshift.apply(arguments, [this]);
|
|
||||||
return OpenLayers.Function.bind.apply(null, arguments);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Function.prototype.bindAsEventListener) {
|
|
||||||
/**
|
|
||||||
* APIMethod: Function.bindAsEventListener
|
|
||||||
* *Deprecated*. Bind a function to an object, and configure it to receive the
|
|
||||||
* event object as first parameter when called.
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* object - {Object} A reference to this.
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
* {Function}
|
|
||||||
*/
|
|
||||||
Function.prototype.bindAsEventListener = function(object) {
|
|
||||||
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",
|
|
||||||
{'newMethod':'OpenLayers.Function.bindAsEventListener'}));
|
|
||||||
return OpenLayers.Function.bindAsEventListener(this, object);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Namespace: OpenLayers.Array
|
* Namespace: OpenLayers.Array
|
||||||
* Contains convenience functions for array manipulation.
|
* Contains convenience functions for array manipulation.
|
||||||
|
|||||||
+180
-1
@@ -765,4 +765,183 @@ OpenLayers.Util.extend(OpenLayers.Element, {
|
|||||||
return {width: originalWidth, height: originalHeight};
|
return {width: originalWidth, height: originalHeight};
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!String.prototype.startsWith) {
|
||||||
|
/**
|
||||||
|
* APIMethod: String.startsWith
|
||||||
|
* *Deprecated*. Whether or not a string starts with another string.
|
||||||
|
*
|
||||||
|
* Parameters:
|
||||||
|
* sStart - {String} The string we're testing for.
|
||||||
|
*
|
||||||
|
* Returns:
|
||||||
|
* {Boolean} Whether or not this string starts with the string passed in.
|
||||||
|
*/
|
||||||
|
String.prototype.startsWith = function(sStart) {
|
||||||
|
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",
|
||||||
|
{'newMethod':'OpenLayers.String.startsWith'}));
|
||||||
|
return OpenLayers.String.startsWith(this, sStart);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!String.prototype.contains) {
|
||||||
|
/**
|
||||||
|
* APIMethod: String.contains
|
||||||
|
* *Deprecated*. Whether or not a string contains another string.
|
||||||
|
*
|
||||||
|
* Parameters:
|
||||||
|
* str - {String} The string that we're testing for.
|
||||||
|
*
|
||||||
|
* Returns:
|
||||||
|
* {Boolean} Whether or not this string contains with the string passed in.
|
||||||
|
*/
|
||||||
|
String.prototype.contains = function(str) {
|
||||||
|
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",
|
||||||
|
{'newMethod':'OpenLayers.String.contains'}));
|
||||||
|
return OpenLayers.String.contains(this, str);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!String.prototype.trim) {
|
||||||
|
/**
|
||||||
|
* APIMethod: String.trim
|
||||||
|
* *Deprecated*. Removes leading and trailing whitespace characters from a string.
|
||||||
|
*
|
||||||
|
* Returns:
|
||||||
|
* {String} A trimmed version of the string - all leading and
|
||||||
|
* trailing spaces removed
|
||||||
|
*/
|
||||||
|
String.prototype.trim = function() {
|
||||||
|
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",
|
||||||
|
{'newMethod':'OpenLayers.String.trim'}));
|
||||||
|
return OpenLayers.String.trim(this);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!String.prototype.camelize) {
|
||||||
|
/**
|
||||||
|
* APIMethod: String.camelize
|
||||||
|
* *Deprecated*. Camel-case a hyphenated string.
|
||||||
|
* Ex. "chicken-head" becomes "chickenHead", and
|
||||||
|
* "-chicken-head" becomes "ChickenHead".
|
||||||
|
*
|
||||||
|
* Returns:
|
||||||
|
* {String} The string, camelized
|
||||||
|
*/
|
||||||
|
String.prototype.camelize = function() {
|
||||||
|
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",
|
||||||
|
{'newMethod':'OpenLayers.String.camelize'}));
|
||||||
|
return OpenLayers.String.camelize(this);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!String.prototype.startsWith) {
|
||||||
|
/**
|
||||||
|
* APIMethod: String.startsWith
|
||||||
|
* *Deprecated*. Whether or not a string starts with another string.
|
||||||
|
*
|
||||||
|
* Parameters:
|
||||||
|
* sStart - {String} The string we're testing for.
|
||||||
|
*
|
||||||
|
* Returns:
|
||||||
|
* {Boolean} Whether or not this string starts with the string passed in.
|
||||||
|
*/
|
||||||
|
String.prototype.startsWith = function(sStart) {
|
||||||
|
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",
|
||||||
|
{'newMethod':'OpenLayers.String.startsWith'}));
|
||||||
|
return OpenLayers.String.startsWith(this, sStart);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!String.prototype.contains) {
|
||||||
|
/**
|
||||||
|
* APIMethod: String.contains
|
||||||
|
* *Deprecated*. Whether or not a string contains another string.
|
||||||
|
*
|
||||||
|
* Parameters:
|
||||||
|
* str - {String} The string that we're testing for.
|
||||||
|
*
|
||||||
|
* Returns:
|
||||||
|
* {Boolean} Whether or not this string contains with the string passed in.
|
||||||
|
*/
|
||||||
|
String.prototype.contains = function(str) {
|
||||||
|
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",
|
||||||
|
{'newMethod':'OpenLayers.String.contains'}));
|
||||||
|
return OpenLayers.String.contains(this, str);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!String.prototype.trim) {
|
||||||
|
/**
|
||||||
|
* APIMethod: String.trim
|
||||||
|
* *Deprecated*. Removes leading and trailing whitespace characters from a string.
|
||||||
|
*
|
||||||
|
* Returns:
|
||||||
|
* {String} A trimmed version of the string - all leading and
|
||||||
|
* trailing spaces removed
|
||||||
|
*/
|
||||||
|
String.prototype.trim = function() {
|
||||||
|
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",
|
||||||
|
{'newMethod':'OpenLayers.String.trim'}));
|
||||||
|
return OpenLayers.String.trim(this);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!String.prototype.camelize) {
|
||||||
|
/**
|
||||||
|
* APIMethod: String.camelize
|
||||||
|
* *Deprecated*. Camel-case a hyphenated string.
|
||||||
|
* Ex. "chicken-head" becomes "chickenHead", and
|
||||||
|
* "-chicken-head" becomes "ChickenHead".
|
||||||
|
*
|
||||||
|
* Returns:
|
||||||
|
* {String} The string, camelized
|
||||||
|
*/
|
||||||
|
String.prototype.camelize = function() {
|
||||||
|
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",
|
||||||
|
{'newMethod':'OpenLayers.String.camelize'}));
|
||||||
|
return OpenLayers.String.camelize(this);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Function.prototype.bind) {
|
||||||
|
/**
|
||||||
|
* APIMethod: Function.bind
|
||||||
|
* *Deprecated*. Bind a function to an object.
|
||||||
|
* Method to easily create closures with 'this' altered.
|
||||||
|
*
|
||||||
|
* Parameters:
|
||||||
|
* object - {Object} the this parameter
|
||||||
|
*
|
||||||
|
* Returns:
|
||||||
|
* {Function} A closure with 'this' altered to the first
|
||||||
|
* argument.
|
||||||
|
*/
|
||||||
|
Function.prototype.bind = function() {
|
||||||
|
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",
|
||||||
|
{'newMethod':'OpenLayers.Function.bind'}));
|
||||||
|
// new function takes the same arguments with this function up front
|
||||||
|
Array.prototype.unshift.apply(arguments, [this]);
|
||||||
|
return OpenLayers.Function.bind.apply(null, arguments);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Function.prototype.bindAsEventListener) {
|
||||||
|
/**
|
||||||
|
* APIMethod: Function.bindAsEventListener
|
||||||
|
* *Deprecated*. Bind a function to an object, and configure it to receive the
|
||||||
|
* event object as first parameter when called.
|
||||||
|
*
|
||||||
|
* Parameters:
|
||||||
|
* object - {Object} A reference to this.
|
||||||
|
*
|
||||||
|
* Returns:
|
||||||
|
* {Function}
|
||||||
|
*/
|
||||||
|
Function.prototype.bindAsEventListener = function(object) {
|
||||||
|
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",
|
||||||
|
{'newMethod':'OpenLayers.Function.bindAsEventListener'}));
|
||||||
|
return OpenLayers.Function.bindAsEventListener(this, object);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user