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] 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