Debian Codegraph @

dojox/app/tests/doh/layoutApp/index.html

raw symbols SCIP
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
5 <meta name="apple-mobile-web-app-capable" content="yes" />
6 <title>Layout App</title>
7 <link type="text/css" href="../../layoutApp/css/layoutApp.css" rel="stylesheet" />
8 <link href="../../../../mobile/themes/iphone/base.css" rel="stylesheet">
9 <style>
10 html,body {
11 width: 100%;
12 height: 100%;
13 background: #eee;
14 font-family: arial;
15 color: #333;
16 overflow: hidden;
17 margin: 0;
18 padding: 0;
19 visibility: visible;
20 }
21
22 #splash {
23 width: 90%;
24 height: 90%;
25 margin: auto;
26 overflow: hidden;
27 border: 2px solid green;
28 color: #333;
29 text-align: center;
30 }
31
32 </style>
33 <script type="text/javascript">
34 dojoConfig = {
35 parseOnLoad: false,
36 mblHideAddressBar: false,
37 mblAndroidWorkaround: false,
38 mblAlwaysHideAddressBar: false,
39 async:1,
40 app: {debugApp: 0} // set debugApp to log app transitions and view activate/deactivate
41 };
42 </script>
43 <script type="text/javascript" src="../../../../../dojo/dojo.js"></script>
44
45 <script>
46 // the actual launcher
47 require(["../../layoutApp/layoutApp.js"], function(){});
48 </script>
49 <script type="text/javascript">
50 require([
51 "doh/runner",
52 "dojo/topic",
53 "dojo/_base/lang",
54 "dojo/dom",
55 "dojox/mobile/TransitionEvent",
56 "dijit/registry"
57 ], function(doh, topic, lang, dom, TransitionEvent, registry) {
58 var events = [];
59
60 var getLabelfromWid = function(wid, indx1, indx2){
61 var val = wid.labelNode.innerText || wid.labelNode.firstChild.nodeValue || "";
62 val = lang.trim(val);
63 if(indx2){
64 val = val.substring(indx1,indx2)
65 }
66 return val;
67 };
68
69 topic.subscribe("/app/status", lang.hitch(this, function(newStatus) {
70 events.push(newStatus);
71 if (newStatus == 2) {
72 var listItem_0TestStr = "Simple Form Data";
73 var listItem_1TestStr = "List Data Test";
74 doh.register("Test-layoutApp1", [{
75 // Test initial values
76 name : "initial-listItem-labels",
77 runTest : function() {
78 var dfd = new doh.Deferred();
79 setTimeout(function() {
80 var ListItem_0Label = registry.byId("dojox_mobile_ListItem_0");
81 if(ListItem_0Label){
82 var lab = getLabelfromWid(ListItem_0Label,0,listItem_0TestStr.length);
83 doh.is(lab, listItem_0TestStr);
84 }
85 var ListItem_1Label = registry.byId("dojox_mobile_ListItem_1");
86 if(ListItem_1Label){
87 doh.is(getLabelfromWid(ListItem_1Label,0,listItem_1TestStr.length), listItem_1TestStr);
88 }
89 var shiptostreetInput1Text = registry.byId("shiptostreetInput1");
90 if(shiptostreetInput1Text){
91 doh.is(shiptostreetInput1Text.value,"123 Valley Rd");
92 }
93 return dfd.callback(true);
94 }, 500);
95 return dfd;
96 }
97 }, {
98 // Test first transition
99 name : "transition-test-1",
100 runTest : function() {
101 var dfd = new doh.Deferred();
102 setTimeout(function() {
103 var liWidget = registry.byId("dojox_mobile_ListItem_1");
104 var ev = new TransitionEvent(liWidget.domNode, liWidget.params);
105 ev.dispatch();
106 return dfd.callback(true);
107 }, 500);
108 }
109 }, {
110 // Test layout data 1
111 name : "layout-data-test-1",
112 runTest : function() {
113 var dfd = new doh.Deferred();
114 setTimeout(function() {
115 var d = registry.byId("dojox_mobile_EdgeToEdgeCategory_2");
116 if(d){
117 doh.is("Using a dojox/mobile/EdgeToEdgeStoreList", d.domNode.innerHTML, "dojox_mobile_EdgeToEdgeCategory_2 should be set");
118 }
119 doh.t(layoutApp.children["layoutApp_listMain"], "layoutApp_listMain viewShowing should be true");
120 return dfd.callback(true);
121 }, 1000);
122 return dfd;
123 }
124 }, {
125 // Test back transition
126 name : "transition-back-1",
127 runTest : function() {
128 var dfd = new doh.Deferred();
129 if(history){
130 history.back();
131 setTimeout(function() {
132 doh.t(layoutApp.children["layoutApp_simple"], "layoutApp_simple viewShowing should be true");
133 return dfd.callback(true);
134 }, 500);
135 }
136 }
137 }]);
138 doh.run();
139 }
140 }));
141 });
142 </script>
143 </head>
144 <body>
145 </body>
146 </html>