Merge pull request #64 from tmcw/no-camel

Removing camelize method.
This commit is contained in:
ahocevar
2012-02-28 00:05:58 -08:00
11 changed files with 119 additions and 63 deletions

View File

@@ -105,6 +105,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<len; i++) {
var s = oStringList[i];
camelizedString += s.charAt(0).toUpperCase() + s.substring(1);
}
return camelizedString;
};
/**
* Function: setOpacity
* *Deprecated*. This function has been deprecated. Instead, please use