| 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 ValuePicker</title> |
| 8 | |
| 9 | <script type="text/javascript" src="../../../deviceTheme.js" data-dojo-config="mblThemeFiles: ['base','ValuePicker']"></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/ValuePicker", |
| 20 | "dojox/mobile/ValuePickerSlot", |
| 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 ValuePicker", [ |
| 27 | { |
| 28 | name: "mobile", |
| 29 | runTest: function(){ |
| 30 | var firstSlotWidget = registry.byId('first'); |
| 31 | var node = query(".mblValuePickerSlotInput",dom.byId('first'))[0]; |
| 32 | runner.is(String.fromCharCode(8234), node.value.charAt(0), "label node has direction correspondent to 'textDir' of Value Picker Slot"); |
| 33 | firstSlotWidget.set("textDir","rtl"); |
| 34 | runner.is(String.fromCharCode(8235), node.value.charAt(0), "label node had direction changed after change of 'textDir'"); |
| 35 | runner.assertEqual(firstSlotWidget.get("value"),firstSlotWidget.value,"No UCC directional characters are to be present in obtained value"); |
| 36 | } |
| 37 | } |
| 38 | ]); |
| 39 | |
| 40 | runner.register("log", function(){ |
| 41 | dom.byId('failures').innerHTML = runner._failureCount; |
| 42 | dom.byId('errors').innerHTML = runner._errorCount; |
| 43 | }); |
| 44 | |
| 45 | runner.run(); |
| 46 | }); |
| 47 | }); |
| 48 | </script> |
| 49 | </head> |
| 50 | <body style="visibility:hidden;background-color:#424142;"> |
| 51 | <div data-dojo-type="dojox/mobile/View"> |
| 52 | <h1 data-dojo-type="dojox/mobile/Heading">Custom ValuePicker</h1> |
| 53 | <div id="spin1" data-dojo-type="dojox/mobile/ValuePicker"> |
| 54 | <div data-dojo-type="dojox/mobile/ValuePickerSlot" |
| 55 | 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']" |
| 56 | style="text-align:center;width:40px;"></div> |
| 57 | <div data-dojo-type="dojox/mobile/ValuePickerSlot" |
| 58 | data-dojo-props='labelFrom:3000, labelTo:3100' |
| 59 | style="width:70px;"></div> |
| 60 | <div data-dojo-type="dojox/mobile/ValuePickerSlot" |
| 61 | data-dojo-props='labelFrom:0, labelTo:9' |
| 62 | style="width:50px;"></div> |
| 63 | <div id="first" data-dojo-type="dojox/mobile/ValuePickerSlot" |
| 64 | data-dojo-props="labels:['pt.','px.','cm.'],textDir:'ltr'" |
| 65 | style="width:50px;"></div> |
| 66 | </div> |
| 67 | </div> |
| 68 | <br><font style="background-color: White">Errors: <span id="errors">?</span></font> |
| 69 | <br><font style="background-color: White">Failures: <span id="failures">?</span></font> |
| 70 | </body> |
| 71 | </html> |