From 5773ad7ddc7aeae4a467c0d11006d2ceafca4397 Mon Sep 17 00:00:00 2001 From: tschaub Date: Thu, 29 Dec 2011 14:29:03 -0700 Subject: [PATCH 1/2] Removing duplicate code. These string prototype methods were unintentionally added twice in 20e19203d54306196c11357283d35ca121c479d8. --- lib/deprecated.js | 69 ----------------------------------------------- 1 file changed, 69 deletions(-) diff --git a/lib/deprecated.js b/lib/deprecated.js index cde92fd6f6..b7f1ef4f33 100644 --- a/lib/deprecated.js +++ b/lib/deprecated.js @@ -939,75 +939,6 @@ if (!String.prototype.camelize) { }; } -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 From 47368ddfa92df848626297520454908c5691f9ef Mon Sep 17 00:00:00 2001 From: tschaub Date: Thu, 29 Dec 2011 14:39:34 -0700 Subject: [PATCH 2/2] Listing deprecated functionality in the notes. --- notes/2.12.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/notes/2.12.md b/notes/2.12.md index e4c004d9fd..97111ed53e 100644 --- a/notes/2.12.md +++ b/notes/2.12.md @@ -50,3 +50,49 @@ The base `OpenLayers.Geometry` class no longer depends on `OpenLayers.Format.WKT Without the WKT format included (by default), the `OpenLayers.Geometry::toString` method now returns "[object Object]." Previously, it returned the Well-Known Text representation of the geometry. To maintain the previous behavior, include the OpenLayers/Format/WKT.js file in your build. +## Deprecated Components + +A number of constructors have been marked as deprecated for multiple releases in the 2.x series. For the 2.12 release this deprecated functionality has been moved to a separate deprecated.js file. If you use any of the constructors or methods below, you will have to explicitly include the deprecated.js file in your build (or add it in a separate `