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

@@ -59,34 +59,7 @@
str = " ";
t.eq(OpenLayers.String.trim(str), "", "whitespace string is trimmed correctly");
}
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)");
}
function test_String_format(t) {
var unchanged = [
"", "${ ", "${", " ${", "${${", "${}", "${${}}", " ${ ${",

View File

@@ -41,7 +41,7 @@
// Chromium 10: left is 0
var testdiv = OpenLayers.Util.createDiv('testdiv', new OpenLayers.Pixel(5, 5));
map.div.appendChild(testdiv);
var left = parseInt(OpenLayers.Element.getStyle(testdiv, 'border-left-width'));
var left = parseInt(OpenLayers.Element.getStyle(testdiv, 'borderLeftWidth'));
map.div.removeChild(testdiv);
var testAll = !isNaN(left);

View File

@@ -0,0 +1,40 @@
<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>

View File

@@ -0,0 +1,40 @@
<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>

View File

@@ -225,6 +225,7 @@
<li>deprecated/Ajax.html</li>
<li>deprecated/BaseTypes/Class.html</li>
<li>deprecated/BaseTypes/Element.html</li>
<li>deprecated/BaseTypes/String.html</li>
<li>deprecated/Control/MouseToolbar.html</li>
<li>deprecated/Geometry/Rectangle.html</li>
<li>deprecated/Layer/GML.html</li>