Revert "Moving camelize and its tests to deprecated"
This reverts commit 5875b50a51.
This commit is contained in:
@@ -105,30 +105,6 @@ OpenLayers.Util.clearArray = function(array) {
|
|||||||
array.length = 0;
|
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
|
* Function: setOpacity
|
||||||
* *Deprecated*. This function has been deprecated. Instead, please use
|
* *Deprecated*. This function has been deprecated. Instead, please use
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
<html>
|
|
||||||
<head>
|
|
||||||
<script src="../../OLLoader.js"></script>
|
|
||||||
<script src="../../../lib/deprecated.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
|
|
||||||
function test_String_camelize(t) {
|
|
||||||
t.plan(7);
|
|
||||||
|
|
||||||
var str = "chickenhead";
|
|
||||||
t.eq(OpenLayers.String.camelize(str), "chickenhead", "string with no hyphens is left alone");
|
|
||||||
|
|
||||||
str = "chicken-head";
|
|
||||||
t.eq(OpenLayers.String.camelize(str), "chickenHead", "string with one middle hyphen is camelized correctly");
|
|
||||||
|
|
||||||
str = "chicken-head-man";
|
|
||||||
t.eq(OpenLayers.String.camelize(str), "chickenHeadMan", "string with multiple middle hyphens is camelized correctly");
|
|
||||||
|
|
||||||
str = "-chickenhead";
|
|
||||||
t.eq(OpenLayers.String.camelize(str), "Chickenhead", "string with starting hyphen is camelized correctly (capitalized)");
|
|
||||||
|
|
||||||
str = "-chicken-head-man";
|
|
||||||
t.eq(OpenLayers.String.camelize(str), "ChickenHeadMan", "string with starting hypen and multiple middle hyphens is camelized correctly");
|
|
||||||
|
|
||||||
str = "chicken-";
|
|
||||||
t.eq(OpenLayers.String.camelize(str), "chicken", "string ending in hyphen is camelized correctly (hyphen dropped)");
|
|
||||||
|
|
||||||
str = "chicken-head-man-";
|
|
||||||
t.eq(OpenLayers.String.camelize(str), "chickenHeadMan", "string with multiple middle hyphens and end hyphen is camelized correctly (end hyphen dropped)");
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
<html>
|
|
||||||
<head>
|
|
||||||
<script src="../../OLLoader.js"></script>
|
|
||||||
<script src="../../../lib/deprecated.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
|
|
||||||
function test_String_camelize(t) {
|
|
||||||
t.plan(7);
|
|
||||||
|
|
||||||
var str = "chickenhead";
|
|
||||||
t.eq(OpenLayers.String.camelize(str), "chickenhead", "string with no hyphens is left alone");
|
|
||||||
|
|
||||||
str = "chicken-head";
|
|
||||||
t.eq(OpenLayers.String.camelize(str), "chickenHead", "string with one middle hyphen is camelized correctly");
|
|
||||||
|
|
||||||
str = "chicken-head-man";
|
|
||||||
t.eq(OpenLayers.String.camelize(str), "chickenHeadMan", "string with multiple middle hyphens is camelized correctly");
|
|
||||||
|
|
||||||
str = "-chickenhead";
|
|
||||||
t.eq(OpenLayers.String.camelize(str), "Chickenhead", "string with starting hyphen is camelized correctly (capitalized)");
|
|
||||||
|
|
||||||
str = "-chicken-head-man";
|
|
||||||
t.eq(OpenLayers.String.camelize(str), "ChickenHeadMan", "string with starting hypen and multiple middle hyphens is camelized correctly");
|
|
||||||
|
|
||||||
str = "chicken-";
|
|
||||||
t.eq(OpenLayers.String.camelize(str), "chicken", "string ending in hyphen is camelized correctly (hyphen dropped)");
|
|
||||||
|
|
||||||
str = "chicken-head-man-";
|
|
||||||
t.eq(OpenLayers.String.camelize(str), "chickenHeadMan", "string with multiple middle hyphens and end hyphen is camelized correctly (end hyphen dropped)");
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
||||||
@@ -226,7 +226,6 @@
|
|||||||
<li>deprecated/Ajax.html</li>
|
<li>deprecated/Ajax.html</li>
|
||||||
<li>deprecated/BaseTypes/Class.html</li>
|
<li>deprecated/BaseTypes/Class.html</li>
|
||||||
<li>deprecated/BaseTypes/Element.html</li>
|
<li>deprecated/BaseTypes/Element.html</li>
|
||||||
<li>deprecated/BaseTypes/String.html</li>
|
|
||||||
<li>deprecated/Control/MouseToolbar.html</li>
|
<li>deprecated/Control/MouseToolbar.html</li>
|
||||||
<li>deprecated/Geometry/Rectangle.html</li>
|
<li>deprecated/Geometry/Rectangle.html</li>
|
||||||
<li>deprecated/Layer/GML.html</li>
|
<li>deprecated/Layer/GML.html</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user