Debian Codegraph @

dojox/mobile/tests/doh/bidi/SpinWheel_Programmatic_Rtl.html

raw symbols SCIP
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','base_rtl','SpinWheel','SpinWheel_rtl']"></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 "dojo/dom-construct", // dojo.place
15 "dojo/ready", // dojo.ready
16 "dijit/registry", // dijit.byId
17 "doh/runner", //doh functions
18 "dojox/mobile/SpinWheel",
19 "dojox/mobile/SpinWheelSlot",
20 "dojox/mobile", // This is a mobile app.
21 "dojox/mobile/View", // This mobile app uses mobile view
22 "dojox/mobile/compat", // This mobile app supports running on desktop browsers
23 "dojox/mobile/parser" // This mobile app uses declarative programming with fast mobile parser
24 ], function(domConst, ready, registry, runner, SpinWheel, SpinWheelSlot){
25 ready(function(){
26 var view = registry.byId("view1");
27 var demoWidget = new SpinWheel({id:"spin1"});
28 demoWidget.placeAt(view.containerNode);
29
30 // No initial value specified
31 var slot0 = new SpinWheelSlot({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'],
32 style:"text-align:center;width:40px;"});
33 demoWidget.addChild(slot0);
34
35 // Initial value: C
36 var slot1 = new SpinWheelSlot({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'],
37 value:'C', style:"text-align:center;width:40px;"});
38 demoWidget.addChild(slot1);
39
40 // No initial value specified
41 var slot2 = new SpinWheelSlot({labelFrom:3000, labelTo:3100, style:"width:70px;"});
42 demoWidget.addChild(slot2);
43
44 // Initial value: 3009
45 var slot3 = new SpinWheelSlot({labelFrom:3000, labelTo:3100, value:3009, style:"width:70px;"});
46 demoWidget.addChild(slot3);
47
48 domConst.create("div", {className: "mblSpinWheelSlot", id:"pt"}, demoWidget.containerNode);
49 domConst.create("div", {className: "mblSpinWheelSlot", id:"txt", innerHTML:"."}, demoWidget.containerNode);
50
51 var slot4 = new SpinWheelSlot({labelFrom:0, labelTo:9, style:"width:30px;"});
52 demoWidget.addChild(slot4);
53
54 var slot5 = new SpinWheelSlot({labels:['pt','px','cm'], style:"width:50px;"});
55 demoWidget.addChild(slot5);
56
57 var slot6 = new SpinWheelSlot({
58 labels:[
59 '<img src=../images/i-icon-1.png>',
60 '<img src=../images/i-icon-2.png>',
61 '<img src=../images/i-icon-3.png>',
62 '<img src=../images/i-icon-4.png>',
63 '<img src=../images/i-icon-5.png>',
64 '<img src=../images/i-icon-6.png>',
65 '<img src=../images/i-icon-7.png>',
66 '<img src=../images/i-icon-8.png>',
67 '<img src=../images/i-icon-9.png>',
68 '<img src=../images/i-icon-10.png>'
69 ],
70 style:"width:70px;text-align: center;"
71 });
72 demoWidget.addChild(slot6);
73
74 var slot7 = new SpinWheelSlot({
75 items:[
76 ['key1', 'value1'],
77 ['key2', 'value2'],
78 ['key2', 'value2']
79 ],
80 value:'value2',
81 style:"text-align:center;width:40px;"});
82 demoWidget.addChild(slot7);
83
84 demoWidget.reset();
85 });
86 })
87 </script>
88
89 <script type="text/javascript">
90 require([
91 "dojo/ready", // dojo.ready
92 "dijit/registry", // dijit.byId
93 "doh/runner", //doh functions
94 "dojox/mobile/SpinWheel",
95 "dojox/mobile/SpinWheelSlot",
96 "dojox/mobile", // This is a mobile app.
97 "dojox/mobile/View", // This mobile app uses mobile view
98 "dojox/mobile/compat", // This mobile app supports running on desktop browsers
99 "dojox/mobile/parser" // This mobile app uses declarative programming with fast mobile parser
100 ], function(ready, registry, runner, SpinWheel, SpinWheelSlot){
101 ready(function(){
102 runner.register("dojox.mobile.test.doh.SpinWheel", [
103 {
104 name: "SpinWheel Verification",
105 timeout: 4000,
106 runTest: function(){
107 var d = new runner.Deferred();
108 setTimeout(d.getTestCallback(function(){
109 var demoWidget = registry.byId("spin1");
110 var slots = demoWidget.getSlots();
111 doh.assertEqual('A', slots[0].get("value"));
112 doh.assertEqual('C', slots[1].get("value"));
113 doh.assertEqual('3000', slots[2].get("value"));
114 doh.assertEqual('3009', slots[3].get("value"));
115 doh.assertEqual('0', slots[4].get("value"));
116 doh.assertEqual('pt', slots[5].get("value"));
117 doh.assertEqual('<img src=../images/i-icon-1.png>', slots[6].get("value"));
118 doh.assertEqual('value2', slots[7].get("value"));
119 }),2000);
120 return d;
121 }
122 }
123 ]);
124 runner.run();
125 });
126
127 })
128 </script>
129
130 <style>
131 #spin1 {
132 width: 304px;
133 margin: 10px auto;
134 }
135 #pt {
136 width: 20px;
137 }
138 #txt {
139 width: 10px;
140 margin-left: -15px;
141 padding-top: 85px;
142 font-size: 24px;
143 font-weight: bold;
144 border: none;
145 }
146 </style>
147 </head>
148 <body style="visibility:hidden;" dir="rtl">
149 <div id="view1" data-dojo-type="dojox.mobile.View">
150 <h1 data-dojo-type="dojox.mobile.Heading">Custom SpinWheel</h1>
151 </div>
152 </body>
153 </html>