| 1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
| 2 |
<html lang="en"> |
| 3 |
<head> |
| 4 |
|
| 5 |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> |
| 6 |
|
| 7 |
<title>TextBox type Tests</title> |
| 8 |
<style type="text/css"> |
| 9 |
@import "../../themes/claro/document.css"; |
| 10 |
@import "../css/dijitTests.css"; |
| 11 |
</style> |
| 12 |
|
| 13 |
|
| 14 |
<link id="themeStyles" rel="stylesheet" href="../../../dijit/themes/claro/claro.css"/> |
| 15 |
|
| 16 |
|
| 17 |
<script type="text/javascript" src="../../../dojo/dojo.js" |
| 18 |
data-dojo-config="parseOnLoad: true, isDebug: true"></script> |
| 19 |
|
| 20 |
|
| 21 |
<script type="text/javascript" src="../_testCommon.js"></script> |
| 22 |
|
| 23 |
<script type="text/javascript"> |
| 24 |
dojo.require("doh.runner"); |
| 25 |
dojo.require("dojo.parser"); |
| 26 |
dojo.require("dijit.dijit"); // optimize: load dijit layer |
| 27 |
dojo.require("dijit.form.TextBox"); |
| 28 |
dojo.require("dijit.form.CurrencyTextBox"); |
| 29 |
dojo.require("dijit.form.DateTextBox"); |
| 30 |
dojo.require("dijit.form.TimeTextBox"); |
| 31 |
dojo.require("dijit.form.NumberTextBox"); |
| 32 |
dojo.require("dijit.form.RangeBoundTextBox"); |
| 33 |
|
| 34 |
dojo.ready(function(){ |
| 35 |
|
| 36 |
doh.register("types", [ |
| 37 |
{ |
| 38 |
name: "HTML4", |
| 39 |
runTest: function(){ |
| 40 |
doh.is(dojo.byId('hn').type, dijit.byId('dr').focusNode.type, "dr"); |
| 41 |
doh.is(dojo.byId('hp').type, dijit.byId('dp').focusNode.type, "dp"); |
| 42 |
doh.is("text", dijit.byId('dn').focusNode.type, "dn"); |
| 43 |
doh.is("text", dijit.byId('dc').focusNode.type, "dc"); |
| 44 |
doh.is("text", dijit.byId('dd').focusNode.type, "dd"); |
| 45 |
doh.is("text", dijit.byId('dt').focusNode.type, "dt"); |
| 46 |
} |
| 47 |
}, |
| 48 |
{ |
| 49 |
name: "HTML5", |
| 50 |
runTest: function(){ |
| 51 |
doh.is(dojo.byId('hn').type, dijit.byId('wr').focusNode.type, "wr"); |
| 52 |
doh.is(dojo.byId('hp').type, dijit.byId('wp').focusNode.type, "wp"); |
| 53 |
doh.is("text", dijit.byId('wn').focusNode.type, "wn"); |
| 54 |
doh.is("text", dijit.byId('wc').focusNode.type, "wc"); |
| 55 |
doh.is("text", dijit.byId('wd').focusNode.type, "wd"); |
| 56 |
doh.is("text", dijit.byId('wt').focusNode.type, "wt"); |
| 57 |
} |
| 58 |
} |
| 59 |
]); |
| 60 |
|
| 61 |
doh.run(); |
| 62 |
}); |
| 63 |
|
| 64 |
</script> |
| 65 |
</head> |
| 66 |
<body class="claro" role="main"> |
| 67 |
<h1>TextBox type Tests</h1> |
| 68 |
<input id="hn" aria-label="hn" type="number" value="1234" /><br> |
| 69 |
<input id="hd" aria-label="hd" type="date" value="2011-05-19" /><br> |
| 70 |
<input id="ht" aria-label="ht" type="time" value="10:11:00" /><br> |
| 71 |
<input id="hp" aria-label="hp" type="password" value="password" /><br> |
| 72 |
<br> |
| 73 |
<input aria-label="dr" id="dr" type="number" dojoType="dijit.form.RangeBoundTextBox" value="1234" /><br> |
| 74 |
<input aria-label="dp" id="dp" type="password" dojoType="dijit.form.TextBox" value="password" /><br> |
| 75 |
<input aria-label="dn" id="dn" type="number" dojoType="dijit.form.NumberTextBox" value="1234" /><br> |
| 76 |
<input aria-label="dc" id="dc" type="number" dojoType="dijit.form.CurrencyTextBox" value="1234.00" /><br> |
| 77 |
<input aria-label="dd" id="dd" type="date" dojoType="dijit.form.DateTextBox" value="2011-05-19" /><br> |
| 78 |
<input aria-label="dt" id="dt" type="time" dojoType="dijit.form.TimeTextBox" value="T10:11:00" /><br> |
| 79 |
<br> |
| 80 |
<input id="wr" data-dojo-type="dijit/form/RangeBoundTextBox" data-dojo-props='value:1234, type:"number", "aria-label":"wr" ' /><br> |
| 81 |
<input id="wp" data-dojo-type="dijit/form/TextBox" data-dojo-props='value:"password", type:"password", "aria-label":"wp" ' /><br> |
| 82 |
<input id="wn" data-dojo-type="dijit/form/NumberTextBox" data-dojo-props='value:1234, type:"number", "aria-label":"wn" ' /><br> |
| 83 |
<input id="wc" data-dojo-type="dijit/form/CurrencyTextBox" data-dojo-props='value:1234, type:"number", "aria-label":"wc" ' /><br> |
| 84 |
<input id="wd" data-dojo-type="dijit/form/DateTextBox" data-dojo-props='value:new Date(2011,04,19,0,0,0,0), type:"date", "aria-label":"wd" ' /><br> |
| 85 |
<input id="wt" data-dojo-type="dijit/form/TimeTextBox" data-dojo-props='value:new Date(0,0,0,10,11,0,0), type:"time", "aria-label":"wt" ' /><br> |
| 86 |
</body> |
| 87 |
</html> |