| 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <meta http-equiv="Content-type" content="text/html; charset=utf-8"/> |
| 5 | <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/> |
| 6 | <meta name="apple-mobile-web-app-capable" content="yes"/> |
| 7 | <title>Custom SpinWheel</title> |
| 8 | |
| 9 | <script type="text/javascript" src="../../../deviceTheme.js" data-dojo-config="mblThemeFiles: ['base','SpinWheel']"></script> |
| 10 | <script type="text/javascript" src="../../../../../dojo/dojo.js" data-dojo-config="async: true,parseOnLoad: true, has: {'dojo-bidi': true }"></script> |
| 11 | |
| 12 | <script type="text/javascript"> |
| 13 | require([ |
| 14 | "dijit/registry", |
| 15 | "doh/runner", |
| 16 | "dojo/dom", |
| 17 | "dojo/ready", |
| 18 | "dojo/query", |
| 19 | "dojox/mobile/SpinWheel", |
| 20 | "dojox/mobile/SpinWheelSlot", |
| 21 | "dojox/mobile", |
| 22 | "dojox/mobile/compat", |
| 23 | "dojox/mobile/parser" |
| 24 | ], function(registry,runner,dom,ready,query){ |
| 25 | ready(function(){ |
| 26 | runner.register("Bidi SpinWheel", [ |
| 27 | { |
| 28 | name: "mobile", |
| 29 | runTest: function(){ |
| 30 | query(".mblSpinWheelSlotLabel",dom.byId('first')).forEach(function(node, index, arr){ |
| 31 | runner.is(String.fromCharCode(8234), node.innerHTML.charAt(0), "label nodes have direction correspondent to 'textDir' of Speen Wheel Slot"); |
| 32 | }); |
| 33 | registry.byId('first').set("textDir","rtl"); |
| 34 | var labelNode = query(".mblSpinWheelSlotLabel",dom.byId('first'))[0]; |
| 35 | runner.is(String.fromCharCode(8235), labelNode.innerHTML.charAt(0), "label node had direction changed after change of 'textDir'"); |
| 36 | } |
| 37 | }]); |
| 38 | |
| 39 | runner.register("log", function(){ |
| 40 | dom.byId('failures').innerHTML = runner._failureCount; |
| 41 | dom.byId('errors').innerHTML = runner._errorCount; |
| 42 | }); |
| 43 | |
| 44 | runner.run(); |
| 45 | }); |
| 46 | }); |
| 47 | </script> |
| 48 | <style> |
| 49 | #spin1 { |
| 50 | width: 304px; |
| 51 | margin: 10px auto; |
| 52 | } |
| 53 | #pt { |
| 54 | width: 20px; |
| 55 | } |
| 56 | #txt { |
| 57 | width: 10px; |
| 58 | margin-left: -15px; |
| 59 | padding-top: 85px; |
| 60 | font-size: 24px; |
| 61 | font-weight: bold; |
| 62 | border: none; |
| 63 | } |
| 64 | </style> |
| 65 | </head> |
| 66 | <body style="visibility:hidden;"> |
| 67 | <div data-dojo-type="dojox/mobile/View"> |
| 68 | <h1 data-dojo-type="dojox/mobile/Heading">Custom SpinWheel</h1> |
| 69 | <div id="spin1" data-dojo-type="dojox/mobile/SpinWheel"> |
| 70 | <div data-dojo-type="dojox/mobile/SpinWheelSlot" |
| 71 | 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']" |
| 72 | style="text-align:center;width:40px;"></div> |
| 73 | <div data-dojo-type="dojox/mobile/SpinWheelSlot" |
| 74 | data-dojo-props='labelFrom:3000, labelTo:3100' |
| 75 | style="width:70px;"></div> |
| 76 | <div id="pt" class="mblSpinWheelSlot"></div> |
| 77 | <div id="txt" class="mblSpinWheelSlot">.</div> |
| 78 | <div data-dojo-type="dojox/mobile/SpinWheelSlot" |
| 79 | data-dojo-props='labelFrom:0, labelTo:9' |
| 80 | style="width:30px;"></div> |
| 81 | <div id="first" data-dojo-type="dojox/mobile/SpinWheelSlot" |
| 82 | data-dojo-props="labels:['pt.','px.','cm.'],textDir:'ltr' " |
| 83 | style="width:50px;"></div> |
| 84 | <div data-dojo-type="dojox/mobile/SpinWheelSlot" |
| 85 | data-dojo-props="labels:[ |
| 86 | '<img src=../../images/i-icon-1.png>', |
| 87 | '<img src=../../images/i-icon-2.png>', |
| 88 | '<img src=../../images/i-icon-3.png>', |
| 89 | '<img src=../../images/i-icon-4.png>', |
| 90 | '<img src=../../images/i-icon-5.png>', |
| 91 | '<img src=../../images/i-icon-6.png>', |
| 92 | '<img src=../../images/i-icon-7.png>', |
| 93 | '<img src=../../images/i-icon-8.png>', |
| 94 | '<img src=../../images/i-icon-9.png>', |
| 95 | '<img src=../../images/i-icon-10.png>' |
| 96 | ]" |
| 97 | style="width:70px;text-align: center;"></div> |
| 98 | </div> |
| 99 | </div> |
| 100 | <br>Errors: <span id="errors">?</span> |
| 101 | <br>Failures: <span id="failures">?</span> |
| 102 | </body> |
| 103 | </html> |