dojox
Version:
Dojo eXtensions, a rollup of many useful sub-projects and varying states of maturity – from very stable and robust, to alpha and experimental. See individual projects contain README files for details.
104 lines (99 loc) • 3.72 kB
HTML
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<title>Custom SpinWheel</title>
<script type="text/javascript" src="../../../deviceTheme.js" data-dojo-config="mblThemeFiles: ['base','SpinWheel']"></script>
<script type="text/javascript" src="../../../../../dojo/dojo.js" data-dojo-config="async: true,parseOnLoad: true, has: {'dojo-bidi': true }"></script>
<script type="text/javascript">
require([
"dijit/registry",
"doh/runner",
"dojo/dom",
"dojo/ready",
"dojo/query",
"dojox/mobile/SpinWheel",
"dojox/mobile/SpinWheelSlot",
"dojox/mobile",
"dojox/mobile/compat",
"dojox/mobile/parser"
], function(registry,runner,dom,ready,query){
ready(function(){
runner.register("Bidi SpinWheel", [
{
name: "mobile",
runTest: function(){
query(".mblSpinWheelSlotLabel",dom.byId('first')).forEach(function(node, index, arr){
runner.is(String.fromCharCode(8234), node.innerHTML.charAt(0), "label nodes have direction correspondent to 'textDir' of Speen Wheel Slot");
});
registry.byId('first').set("textDir","rtl");
var labelNode = query(".mblSpinWheelSlotLabel",dom.byId('first'))[0];
runner.is(String.fromCharCode(8235), labelNode.innerHTML.charAt(0), "label node had direction changed after change of 'textDir'");
}
}]);
runner.register("log", function(){
dom.byId('failures').innerHTML = runner._failureCount;
dom.byId('errors').innerHTML = runner._errorCount;
});
runner.run();
});
});
</script>
<style>
#spin1 {
width: 304px;
margin: 10px auto;
}
#pt {
width: 20px;
}
#txt {
width: 10px;
margin-left: -15px;
padding-top: 85px;
font-size: 24px;
font-weight: bold;
border: none;
}
</style>
</head>
<body style="visibility:hidden;">
<div data-dojo-type="dojox/mobile/View">
<h1 data-dojo-type="dojox/mobile/Heading">Custom SpinWheel</h1>
<div id="spin1" data-dojo-type="dojox/mobile/SpinWheel">
<div data-dojo-type="dojox/mobile/SpinWheelSlot"
data-dojo-props="labels:['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']"
style="text-align:center;width:40px;"></div>
<div data-dojo-type="dojox/mobile/SpinWheelSlot"
data-dojo-props='labelFrom:3000, labelTo:3100'
style="width:70px;"></div>
<div id="pt" class="mblSpinWheelSlot"></div>
<div id="txt" class="mblSpinWheelSlot">.</div>
<div data-dojo-type="dojox/mobile/SpinWheelSlot"
data-dojo-props='labelFrom:0, labelTo:9'
style="width:30px;"></div>
<div id="first" data-dojo-type="dojox/mobile/SpinWheelSlot"
data-dojo-props="labels:['pt.','px.','cm.'],textDir:'ltr' "
style="width:50px;"></div>
<div data-dojo-type="dojox/mobile/SpinWheelSlot"
data-dojo-props="labels:[
'<img src=../../images/i-icon-1.png>',
'<img src=../../images/i-icon-2.png>',
'<img src=../../images/i-icon-3.png>',
'<img src=../../images/i-icon-4.png>',
'<img src=../../images/i-icon-5.png>',
'<img src=../../images/i-icon-6.png>',
'<img src=../../images/i-icon-7.png>',
'<img src=../../images/i-icon-8.png>',
'<img src=../../images/i-icon-9.png>',
'<img src=../../images/i-icon-10.png>'
]"
style="width:70px;text-align: center;"></div>
</div>
</div>
<br>Errors: <span id="errors">?</span>
<br>Failures: <span id="failures">?</span>
</body>
</html>