From 526ff5f6ed61c5834a440f6ffec217af3e54d96b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Sun, 4 Mar 2012 23:21:41 +0100 Subject: [PATCH 1/3] Revert "indicate that String.camelize is deprecated in the 2.12 release notes, refs #64, no functional change" This reverts commit acf6a8a97d7f9d67b8bc4bbd38e866f3c542bc4c. --- notes/2.12.md | 1 - 1 file changed, 1 deletion(-) diff --git a/notes/2.12.md b/notes/2.12.md index e4e9b09ca3..7b0fba7267 100644 --- a/notes/2.12.md +++ b/notes/2.12.md @@ -144,7 +144,6 @@ A number of properties, methods, and constructors have been marked as deprecated * OpenLayers.Util.setOpacity * OpenLayers.Util.safeStopPropagation * OpenLayers.Util.getArgs - * OpenLayers.Sring.camelize * OpenLayers.nullHandler * OpenLayers.loadURL * OpenLayers.parseXMLString From 55a52008d6ccdf7b0b7d63a97a1469492d4aa1f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Sun, 4 Mar 2012 23:21:54 +0100 Subject: [PATCH 2/3] Revert "Moving camelize and its tests to deprecated" This reverts commit 5875b50a510898093e3898f6bf43645b4815a8e9. --- lib/deprecated.js | 24 ---------------- tests/deprecated/BaseTypes.html | 40 -------------------------- tests/deprecated/BaseTypes/String.html | 40 -------------------------- tests/list-tests.html | 1 - 4 files changed, 105 deletions(-) delete mode 100644 tests/deprecated/BaseTypes.html delete mode 100644 tests/deprecated/BaseTypes/String.html diff --git a/lib/deprecated.js b/lib/deprecated.js index a86fcdaa8b..c22b849216 100644 --- a/lib/deprecated.js +++ b/lib/deprecated.js @@ -105,30 +105,6 @@ OpenLayers.Util.clearArray = function(array) { array.length = 0; }; - -/** - * APIFunction: camelize - * Camel-case a hyphenated string. - * Ex. "chicken-head" becomes "chickenHead", and - * "-chicken-head" becomes "ChickenHead". - * - * Parameters: - * str - {String} The string to be camelized. The original is not modified. - * - * Returns: - * {String} The string, camelized - */ - -OpenLayers.String.camelize = function(str) { - var oStringList = str.split('-'); - var camelizedString = oStringList[0]; - for (var i=1, len=oStringList.length; i - - - - - - - - - - diff --git a/tests/deprecated/BaseTypes/String.html b/tests/deprecated/BaseTypes/String.html deleted file mode 100644 index b8a66b8574..0000000000 --- a/tests/deprecated/BaseTypes/String.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - diff --git a/tests/list-tests.html b/tests/list-tests.html index 6fe622d95b..7c4cb1d402 100644 --- a/tests/list-tests.html +++ b/tests/list-tests.html @@ -226,7 +226,6 @@
  • deprecated/Ajax.html
  • deprecated/BaseTypes/Class.html
  • deprecated/BaseTypes/Element.html
  • -
  • deprecated/BaseTypes/String.html
  • deprecated/Control/MouseToolbar.html
  • deprecated/Geometry/Rectangle.html
  • deprecated/Layer/GML.html
  • From c58f093615276707ca9f694fcd43e98b97a95188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Sun, 4 Mar 2012 23:22:21 +0100 Subject: [PATCH 3/3] Revert "Removing camelize method." This reverts commit 43ef0920c2d9bf006cd1d769d2391b9b75a92cf8. --- lib/OpenLayers/BaseTypes.js | 22 ++++++++++++++++++++++ lib/OpenLayers/BaseTypes/Element.js | 4 ++-- lib/OpenLayers/Control/OverviewMap.js | 6 +++--- lib/OpenLayers/Handler/Box.js | 8 ++++---- lib/OpenLayers/Popup.js | 8 ++++---- tests/BaseTypes.html | 27 +++++++++++++++++++++++++++ tests/Handler/Box.html | 2 +- 7 files changed, 63 insertions(+), 14 deletions(-) diff --git a/lib/OpenLayers/BaseTypes.js b/lib/OpenLayers/BaseTypes.js index d07b429d17..d2e5711ca8 100644 --- a/lib/OpenLayers/BaseTypes.js +++ b/lib/OpenLayers/BaseTypes.js @@ -64,6 +64,28 @@ OpenLayers.String = { return str.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); }, + /** + * APIFunction: camelize + * Camel-case a hyphenated string. + * Ex. "chicken-head" becomes "chickenHead", and + * "-chicken-head" becomes "ChickenHead". + * + * Parameters: + * str - {String} The string to be camelized. The original is not modified. + * + * Returns: + * {String} The string, camelized + */ + camelize: function(str) { + var oStringList = str.split('-'); + var camelizedString = oStringList[0]; + for (var i=1, len=oStringList.length; i