From 43ef0920c2d9bf006cd1d769d2391b9b75a92cf8 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Sun, 20 Nov 2011 23:47:37 -0500 Subject: [PATCH 1/2] Removing camelize method. --- 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, 14 insertions(+), 63 deletions(-) diff --git a/lib/OpenLayers/BaseTypes.js b/lib/OpenLayers/BaseTypes.js index 05b06b8d3d..f19a70d223 100644 --- a/lib/OpenLayers/BaseTypes.js +++ b/lib/OpenLayers/BaseTypes.js @@ -60,28 +60,6 @@ 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 Date: Mon, 21 Nov 2011 15:42:46 -0500 Subject: [PATCH 2/2] Moving camelize and its tests to deprecated --- lib/deprecated.js | 24 ++++++++++++++++ tests/deprecated/BaseTypes.html | 40 ++++++++++++++++++++++++++ tests/deprecated/BaseTypes/String.html | 40 ++++++++++++++++++++++++++ tests/list-tests.html | 1 + 4 files changed, 105 insertions(+) create mode 100644 tests/deprecated/BaseTypes.html create mode 100644 tests/deprecated/BaseTypes/String.html diff --git a/lib/deprecated.js b/lib/deprecated.js index 23f0d976b8..ebe9725b30 100644 --- a/lib/deprecated.js +++ b/lib/deprecated.js @@ -85,6 +85,30 @@ 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 new file mode 100644 index 0000000000..b8a66b8574 --- /dev/null +++ b/tests/deprecated/BaseTypes/String.html @@ -0,0 +1,40 @@ + + + + + + + + + + + diff --git a/tests/list-tests.html b/tests/list-tests.html index adc9580f73..af7b6b29d6 100644 --- a/tests/list-tests.html +++ b/tests/list-tests.html @@ -226,6 +226,7 @@
  • deprecated/Ajax.html
  • deprecated/BaseTypes/Class.html
  • deprecated/BaseTypes/Element.html
  • +
  • deprecated/BaseTypes/String.html
  • deprecated/Control/MouseToolbar.html
  • deprecated/Layer/MapServer/Untiled.html
  • deprecated/Layer/MultiMap.html