| 1 |
<!DOCTYPE html> |
| 2 |
<html> |
| 3 |
<head> |
| 4 |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/> |
| 5 |
<meta name="viewport" |
| 6 |
content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/> |
| 7 |
<meta name="apple-mobile-web-app-capable" content="yes"/> |
| 8 |
<title>Templated Widgets Tests</title> |
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
<script type="text/javascript" src="../../../deviceTheme.js"></script> |
| 15 |
<script type="text/javascript" src="../../../../../dojo/dojo.js" |
| 16 |
data-dojo-config="async: true, parseOnLoad: true, mblAlwaysHideAddressBar: true"></script> |
| 17 |
|
| 18 |
<script type="text/javascript"> |
| 19 |
// Templates |
| 20 |
|
| 21 |
// Without widgets (pure HTML); with attach point for label node. |
| 22 |
var templateListItem1 = // pure HTML |
| 23 |
"<div>A template." + |
| 24 |
" <div data-dojo-attach-point=\'labelNode\'></div>" + |
| 25 |
"</div>"; |
| 26 |
|
| 27 |
// With widgets; with attach point for labelNode. |
| 28 |
var templateListItem2 = |
| 29 |
"<div>" + |
| 30 |
" <div data-dojo-type='dojox/mobile/RoundRect'>" + |
| 31 |
" A template." + |
| 32 |
" <div data-dojo-attach-point='labelNode'></div>" + |
| 33 |
" </div>" + |
| 34 |
"</div>"; |
| 35 |
|
| 36 |
// With widgets; without attach point for labelNode. |
| 37 |
var templateListItem3 = |
| 38 |
"<div>" + |
| 39 |
" <div data-dojo-type='dojox/mobile/RoundRect'>" + |
| 40 |
" A template." + |
| 41 |
" </div>" + |
| 42 |
"</div>"; |
| 43 |
|
| 44 |
var templateHeading1 = |
| 45 |
"<div class='mblHeading mblHeadingCenterTitle'>" + |
| 46 |
" <span data-dojo-type='dojox/mobile/ToolBarButton'" + |
| 47 |
" data-dojo-attach-point='backButton'" + |
| 48 |
" data-dojo-props='arrow: \"left\", back: true, transitionDir: -1'>" + |
| 49 |
" </span>" + |
| 50 |
" <ul data-dojo-type='dojox/mobile/TabBar'" + |
| 51 |
" style='float:right;'" + |
| 52 |
" data-dojo-props='barType:\"segmentedControl\", selectOne:false'>" + |
| 53 |
" <li data-dojo-type='dojox/mobile/TabBarButton'" + |
| 54 |
" data-dojo-props='icon:\"mblDomButtonWhiteUpArrow\"'></li>" + |
| 55 |
" <li data-dojo-type='dojox/mobile/TabBarButton'" + |
| 56 |
" data-dojo-props='icon:\"mblDomButtonWhiteDownArrow\"'></li>" + |
| 57 |
" </ul>" + |
| 58 |
" <span class='mblHeadingSpanTitle'" + |
| 59 |
" data-dojo-attach-point='labelNode'>" + |
| 60 |
" </span>" + |
| 61 |
" <div class='mblHeadingDivTitle'" + |
| 62 |
" data-dojo-attach-point='labelDivNode'>" + |
| 63 |
" </div>" + |
| 64 |
"</div>"; |
| 65 |
|
| 66 |
var templateSlider1 = |
| 67 |
"<div class='mblSlider mblSliderH' tabindex='0'" + |
| 68 |
" aria-valuenow='${value}'" + |
| 69 |
" data-dojo-attach-point='focusNode'>" + |
| 70 |
" <input data-dojo-attach-point='valueNode'" + |
| 71 |
" type='hidden' value='${value}'>" + |
| 72 |
" <div data-dojo-attach-point='relativeParent'" + |
| 73 |
" style='position: relative; height: 100%; width: 100%;'>" + |
| 74 |
" <div data-dojo-attach-point='progressBar'" + |
| 75 |
" style='position: absolute; left: 0px; width: 100%;'" + |
| 76 |
" class='mblSliderProgressBar mblSliderTransition'>" + |
| 77 |
" </div>" + |
| 78 |
" <div data-dojo-attach-point='touchBox'" + |
| 79 |
" style='position: absolute;' class='mblSliderTouchBox'>" + |
| 80 |
" </div>" + |
| 81 |
" <div data-dojo-attach-point='handle'" + |
| 82 |
" style='position: absolute; left: 100%;'" + |
| 83 |
" class='mblSliderHandle mblSliderTransition'>" + |
| 84 |
" </div>" + |
| 85 |
" </div>" + |
| 86 |
"</div>"; |
| 87 |
|
| 88 |
var templateButton1 = |
| 89 |
"<button class='${baseClass}' data-dojo-attach-point='containerNode'></button>"; |
| 90 |
|
| 91 |
var templateToggleButton1 = |
| 92 |
"<span>" + |
| 93 |
" <button class='${baseClass}' tabindex='0'" + |
| 94 |
" style='-webkit-user-select: none;' aria-pressed='true'" + |
| 95 |
" data-dojo-attach-point='containerNode'>" + |
| 96 |
" </button>" + |
| 97 |
"</span>"; |
| 98 |
|
| 99 |
var templateCheckBox1 = |
| 100 |
"<input type='checkbox'" + |
| 101 |
" class='mblCheckBox mblCheckBoxChecked' value='${value}' tabindex='0'" + |
| 102 |
" style='-webkit-user-select: none;' aria-checked='true'>"; |
| 103 |
|
| 104 |
var templateRadioButton1 = |
| 105 |
"<input type='radio' value='Small' class='mblRadioButton mblRadioButtonChecked'" + |
| 106 |
" tabindex='0' style='-webkit-user-select: none;' aria-checked='true'>"; |
| 107 |
|
| 108 |
var templateSwitch1 = |
| 109 |
"<span class='mblSwitch mblSwDefaultShape mblSwitchOn' tabindex='0' >" + |
| 110 |
" <div class='mblSwitchInner' data-dojo-attach-point='inner'>" + |
| 111 |
" <div class='mblSwitchBg mblSwitchBgLeft'" + |
| 112 |
" data-dojo-attach-point='left'>" + |
| 113 |
" <div class='mblSwitchText mblSwitchTextLeft'>ON</div>" + |
| 114 |
" </div>" + |
| 115 |
" <div class='mblSwitchBg mblSwitchBgRight' style='display: none;'" + |
| 116 |
" data-dojo-attach-point='right'>" + |
| 117 |
" <div class='mblSwitchText mblSwitchTextRight'>OFF</div>" + |
| 118 |
" </div>" + |
| 119 |
" <div class='mblSwitchKnob' data-dojo-attach-point='knob'></div>" + |
| 120 |
" <input type='hidden' value='on' data-dojo-attach-point='input'>" + |
| 121 |
" </div>" + |
| 122 |
"</span>"; |
| 123 |
|
| 124 |
var templateView1 = |
| 125 |
"<div>" + |
| 126 |
" <div data-dojo-type='dojox/mobile/Heading'" + |
| 127 |
" data-dojo-props='label: \"Templated View\"'>" + |
| 128 |
" </div>" + |
| 129 |
" <div data-dojo-attach-point='myAttachPoint'>" + |
| 130 |
"${myProp}" + // no indentation here such that we can test by comparing the |
| 131 |
"</div>" + // innerHTML of the attach point with the value of myProp |
| 132 |
" <ul data-dojo-type='dojox/mobile/RoundRectList'>" + |
| 133 |
" <li data-dojo-type='dojox/mobile/ListItem'>" + |
| 134 |
" Apple" + |
| 135 |
" </li>" + |
| 136 |
" <li data-dojo-type='dojox/mobile/ListItem'>" + |
| 137 |
" Banana" + |
| 138 |
" </li>"; |
| 139 |
" </ul>" + |
| 140 |
"</div>"; |
| 141 |
|
| 142 |
// Templated widget classes |
| 143 |
var TemplatedListItem1, TemplatedWithWidgetsListItem1, |
| 144 |
TemplatedWithWidgetsHeading1, TemplatedSwitch, TemplatedView1; |
| 145 |
|
| 146 |
require([ |
| 147 |
"dojo/ready", |
| 148 |
"dojo/dom", |
| 149 |
"dojo/dom-class", |
| 150 |
"dojo/sniff", |
| 151 |
"dijit/registry", |
| 152 |
"dojox/mobile/parser", |
| 153 |
"dojox/mobile", |
| 154 |
"dojox/mobile/compat", |
| 155 |
"dojo/_base/declare", |
| 156 |
"dojo/dom-construct", |
| 157 |
"doh/runner", |
| 158 |
"dijit/_TemplatedMixin", |
| 159 |
"dijit/_WidgetsInTemplateMixin", |
| 160 |
"dojox/mobile/ListItem", |
| 161 |
"dojox/mobile/Heading", |
| 162 |
"dojox/mobile/Switch", |
| 163 |
"dojox/mobile/View", |
| 164 |
"dojox/mobile/Button", |
| 165 |
"dojox/mobile/TabBar", |
| 166 |
"dojox/mobile/TabBarButton", |
| 167 |
"dojox/mobile/CheckBox", |
| 168 |
"dojox/mobile/ToggleButton", |
| 169 |
"dojox/mobile/RadioButton", |
| 170 |
"dojox/mobile/Slider", |
| 171 |
"dojox/mobile/RoundRect", |
| 172 |
"dojox/mobile/RoundRectList", |
| 173 |
"dojox/mobile/ScrollableView" |
| 174 |
], function(ready, dom, domClass, has, registry, parser, mobile, compat, declare, domConstruct, |
| 175 |
runner, TemplatedMixin, WidgetsInTemplateMixin, |
| 176 |
ListItem, Heading, Switch, View){ |
| 177 |
|
| 178 |
// 2.1 Without widgets (pure HTML); with attach point for labelNode and label property specified |
| 179 |
TemplatedListItem1 = declare( |
| 180 |
[ListItem, TemplatedMixin], { |
| 181 |
label: "Some label", |
| 182 |
templateString: templateListItem1 |
| 183 |
} |
| 184 |
); |
| 185 |
|
| 186 |
// 2.2 With widgets; with attach point for labelNode but no label property specified |
| 187 |
TemplatedWithWidgetsListItem1 = declare( |
| 188 |
[ListItem, TemplatedMixin, WidgetsInTemplateMixin], { |
| 189 |
templateString: templateListItem2 |
| 190 |
} |
| 191 |
); |
| 192 |
|
| 193 |
// 2.3 With widgets; without attach point for labelNode and no label property specified |
| 194 |
TemplatedWithWidgetsListItem2 = declare( |
| 195 |
[ListItem, TemplatedMixin, WidgetsInTemplateMixin], { |
| 196 |
templateString: templateListItem3 |
| 197 |
} |
| 198 |
); |
| 199 |
|
| 200 |
// 2.4 With widgets; without attach point for labelNode but label property specified |
| 201 |
// (error case) |
| 202 |
TemplatedWithWidgetsListItem3 = declare( |
| 203 |
[ListItem, TemplatedMixin, WidgetsInTemplateMixin], { |
| 204 |
label: "Some label", |
| 205 |
templateString: templateListItem3 |
| 206 |
} |
| 207 |
); |
| 208 |
|
| 209 |
TemplatedWithWidgetsHeading1 = declare( |
| 210 |
[Heading, TemplatedMixin, WidgetsInTemplateMixin], { |
| 211 |
templateString: templateHeading1 |
| 212 |
} |
| 213 |
); |
| 214 |
|
| 215 |
TemplatedWithWidgetsHeading2 = declare( |
| 216 |
[Heading, TemplatedMixin, WidgetsInTemplateMixin], { |
| 217 |
back:"Back", |
| 218 |
label: "Templated by: <code>Heading2.html</code> (using declare)", |
| 219 |
templateString: templateHeading1 |
| 220 |
} |
| 221 |
); |
| 222 |
|
| 223 |
TemplatedSwitch = declare( |
| 224 |
[Switch, TemplatedMixin], { |
| 225 |
templateString: templateSwitch1 |
| 226 |
} |
| 227 |
); |
| 228 |
|
| 229 |
TemplatedView1 = declare( |
| 230 |
[View, TemplatedMixin, WidgetsInTemplateMixin], { |
| 231 |
myProp: "myValue", |
| 232 |
templateString: templateView1 |
| 233 |
} |
| 234 |
); |
| 235 |
|
| 236 |
ready(function(){ |
| 237 |
runner.register("dojox.mobile.test.doh.TemplatedWidgetsTests", [ |
| 238 |
function testTemplatedListItem(){ |
| 239 |
// 1. Using markup |
| 240 |
|
| 241 |
// 1.1 With attach point for labelNode and label property specified |
| 242 |
var listItem = registry.byId("listItem1"); |
| 243 |
runner.assertTrue(!!listItem.domNode); |
| 244 |
runner.assertTrue(domClass.contains(listItem.domNode, "mblListItem")); |
| 245 |
runner.assertEqual("Some label", listItem.label); |
| 246 |
runner.assertTrue(!!listItem.labelNode, "1.1 labelNode"); |
| 247 |
runner.assertEqual("Some label", listItem.labelNode.innerHTML, "1.1 labelNode.innerHTML"); |
| 248 |
|
| 249 |
// 1.2 With attach point for labelNode but no label property specified |
| 250 |
listItem = registry.byId("listItem2"); |
| 251 |
runner.assertTrue(!!listItem.domNode); |
| 252 |
runner.assertTrue(domClass.contains(listItem.domNode, "mblListItem")); |
| 253 |
runner.assertFalse(!!listItem.label, "1.2 label"); |
| 254 |
runner.assertTrue(!!listItem.labelNode, "1.2 labelNode"); |
| 255 |
|
| 256 |
// 1.3 Without attach point for labelNode and no label property specified |
| 257 |
listItem = registry.byId("listItem3"); |
| 258 |
runner.assertTrue(!!listItem.domNode); |
| 259 |
runner.assertTrue(domClass.contains(listItem.domNode, "mblListItem")); |
| 260 |
runner.assertFalse(!!listItem.label, "1.2 label"); |
| 261 |
runner.assertFalse(!!listItem.labelNode, "1.2 labelNode"); |
| 262 |
|
| 263 |
// 2. Using declare |
| 264 |
|
| 265 |
// 2.1 With attach point for labelNode and label property specified |
| 266 |
listItem = registry.byId("listItem4"); |
| 267 |
runner.assertTrue(!!listItem.domNode); |
| 268 |
runner.assertTrue(domClass.contains(listItem.domNode, "mblListItem")); |
| 269 |
runner.assertEqual("Some label", listItem.label); |
| 270 |
runner.assertTrue(!!listItem.labelNode); |
| 271 |
runner.assertEqual("Some label", listItem.labelNode.innerHTML, "2.1 labelNode.innerHTML"); |
| 272 |
|
| 273 |
// 2.2 With attach point for labelNode but no label property specified |
| 274 |
listItem = registry.byId("listItem5"); |
| 275 |
runner.assertTrue(!!listItem.domNode); |
| 276 |
runner.assertTrue(domClass.contains(listItem.domNode, "mblListItem")); |
| 277 |
runner.assertFalse(!!listItem.label, "2.2 label"); |
| 278 |
runner.assertTrue(!!listItem.labelNode, "2.2 labelNode"); |
| 279 |
|
| 280 |
// 2.3 Without attach point for labelNode and no label property specified |
| 281 |
listItem = registry.byId("listItem6"); |
| 282 |
runner.assertTrue(!!listItem.domNode); |
| 283 |
runner.assertTrue(domClass.contains(listItem.domNode, "mblListItem")); |
| 284 |
runner.assertFalse(!!listItem.label, "2.3 label"); |
| 285 |
runner.assertFalse(!!listItem.labelNode, "2.3 labelNode"); |
| 286 |
|
| 287 |
// 2.4 Without attach point for labelNode but label property specified |
| 288 |
// (error case) |
| 289 |
try{ |
| 290 |
new TemplatedWithWidgetsListItem3({ |
| 291 |
label: "Some label" |
| 292 |
}); |
| 293 |
runner.assertTrue(false, |
| 294 |
"Creating a templated ListItem without attach point for labelNode " + |
| 295 |
"should throw Error if label property is set"); |
| 296 |
}catch(err){ |
| 297 |
// error as expected |
| 298 |
} |
| 299 |
}, |
| 300 |
function testTemplatedHeading(){ |
| 301 |
// 3. Using markup |
| 302 |
|
| 303 |
// 3.1 With back specified and no attach point |
| 304 |
var heading = registry.byId("heading1"); |
| 305 |
runner.assertTrue(!!heading.domNode); |
| 306 |
runner.assertTrue(domClass.contains(heading.domNode, "mblHeading")); |
| 307 |
runner.assertFalse(!!heading.label); |
| 308 |
runner.assertFalse(!!heading.labelNode); |
| 309 |
runner.assertFalse(!!heading.labelDivNode); |
| 310 |
runner.assertTrue(!!heading.backButton, "3.1 backButton"); |
| 311 |
runner.assertEqual("Back", heading.backButton.label, "1.1 backButton.label"); |
| 312 |
|
| 313 |
// 3.2 With attach points; back and label specified |
| 314 |
heading = registry.byId("heading2"); |
| 315 |
runner.assertTrue(!!heading.domNode, "heading2.domNode"); |
| 316 |
runner.assertTrue(domClass.contains(heading.domNode, "mblHeading")); |
| 317 |
runner.assertEqual("Some label", heading.label); |
| 318 |
runner.assertTrue(!!heading.labelNode); |
| 319 |
runner.assertTrue(!!heading.labelDivNode); |
| 320 |
runner.assertEqual("Some label", heading.labelNode.innerHTML); |
| 321 |
runner.assertTrue(!!heading.backButton, "3.2 backButton"); |
| 322 |
runner.assertEqual("Back", heading.backButton.label, "1.1 backButton.label"); |
| 323 |
|
| 324 |
// 3.3 Without attach point for backButton but back property specified |
| 325 |
// (error case) |
| 326 |
try{ |
| 327 |
new TemplatedWithWidgetsHeading1({ |
| 328 |
back: "Back" |
| 329 |
}); |
| 330 |
runner.assertTrue(false, |
| 331 |
"Creating a templated Heading without attach point for backButton " + |
| 332 |
"should throw Error if back property is set"); |
| 333 |
}catch(err){ |
| 334 |
// error as expected |
| 335 |
} |
| 336 |
|
| 337 |
// 3.4 Without attach point for labelNode but label property specified |
| 338 |
// (error case) |
| 339 |
try{ |
| 340 |
new TemplatedWithWidgetsHeading1({ |
| 341 |
label: "Some label" |
| 342 |
}); |
| 343 |
runner.assertTrue(false, |
| 344 |
"Creating a templated Heading without attach point for labelNode " + |
| 345 |
"should throw Error if label property is set"); |
| 346 |
}catch(err){ |
| 347 |
// error as expected |
| 348 |
} |
| 349 |
}, |
| 350 |
function testTemplatedFormControls(){ |
| 351 |
// Button |
| 352 |
var widget = registry.byId("button1"); |
| 353 |
runner.assertTrue(!!widget.domNode); |
| 354 |
runner.assertTrue(domClass.contains(widget.domNode, "mblButton")); |
| 355 |
|
| 356 |
// Slider |
| 357 |
widget = registry.byId("slider1"); |
| 358 |
runner.assertTrue(!!widget.domNode); |
| 359 |
runner.assertTrue(domClass.contains(widget.domNode, "mblSlider")); |
| 360 |
runner.assertTrue(!!widget.focusNode); |
| 361 |
runner.assertTrue(!!widget.valueNode); |
| 362 |
runner.assertTrue(!!widget.relativeParent); |
| 363 |
runner.assertTrue(!!widget.progressBar); |
| 364 |
runner.assertTrue(!!widget.touchBox); |
| 365 |
runner.assertTrue(!!widget.handle); |
| 366 |
|
| 367 |
// CheckBox |
| 368 |
widget = registry.byId("checkbox1"); |
| 369 |
runner.assertTrue(!!widget.domNode); |
| 370 |
runner.assertTrue(domClass.contains(widget.domNode, has("windows-theme") ? |
| 371 |
"mblCheckableInputContainer" : "mblCheckBox")); |
| 372 |
|
| 373 |
// ToggleButton |
| 374 |
widget = registry.byId("togglebutton1"); |
| 375 |
runner.assertTrue(!!widget.domNode); |
| 376 |
runner.assertTrue(domClass.contains(widget.domNode, "mblToggleButton")); |
| 377 |
|
| 378 |
// Switch |
| 379 |
widget = registry.byId("switch1"); |
| 380 |
runner.assertTrue(!!widget.domNode); |
| 381 |
runner.assertTrue(domClass.contains(widget.domNode, has("windows-theme") ? |
| 382 |
"mblSwitchContainer" : "mblSwitch")); |
| 383 |
runner.assertTrue(!!widget.inner); |
| 384 |
runner.assertTrue(!!widget.left); |
| 385 |
runner.assertTrue(!!widget.right); |
| 386 |
runner.assertTrue(!!widget.knob); |
| 387 |
runner.assertTrue(!!widget.input); |
| 388 |
runner.assertTrue(domClass.contains(widget.inner, "mblSwitchInner")); |
| 389 |
runner.assertTrue(domClass.contains(widget.left, "mblSwitchBg")); |
| 390 |
runner.assertTrue(domClass.contains(widget.left, "mblSwitchBgLeft")); |
| 391 |
runner.assertTrue(domClass.contains(widget.right, "mblSwitchBg")); |
| 392 |
runner.assertTrue(domClass.contains(widget.right, "mblSwitchBgRight")); |
| 393 |
runner.assertTrue(domClass.contains(widget.knob, "mblSwitchKnob")); |
| 394 |
|
| 395 |
widget = registry.byId("switch2"); // using declare |
| 396 |
runner.assertTrue(!!widget.domNode); |
| 397 |
runner.assertTrue(domClass.contains(widget.domNode, has("windows-theme") ? |
| 398 |
"mblSwitchContainer" : "mblSwitch")); |
| 399 |
runner.assertTrue(!!widget.inner); |
| 400 |
runner.assertTrue(!!widget.left); |
| 401 |
runner.assertTrue(!!widget.right); |
| 402 |
runner.assertTrue(!!widget.knob); |
| 403 |
runner.assertTrue(!!widget.input); |
| 404 |
runner.assertTrue(domClass.contains(widget.inner, "mblSwitchInner")); |
| 405 |
runner.assertTrue(domClass.contains(widget.left, "mblSwitchBg")); |
| 406 |
runner.assertTrue(domClass.contains(widget.left, "mblSwitchBgLeft")); |
| 407 |
runner.assertTrue(domClass.contains(widget.right, "mblSwitchBg")); |
| 408 |
runner.assertTrue(domClass.contains(widget.right, "mblSwitchBgRight")); |
| 409 |
runner.assertTrue(domClass.contains(widget.knob, "mblSwitchKnob")); |
| 410 |
|
| 411 |
// RadioButton |
| 412 |
widget = registry.byId("rb1"); // using declare |
| 413 |
runner.assertTrue(!!widget.domNode); |
| 414 |
runner.assertTrue(domClass.contains(widget.domNode, has("windows-theme") ? |
| 415 |
"mblCheckableInputContainer" : "mblRadioButton")); |
| 416 |
}, |
| 417 |
function testTemplatedView(){ |
| 418 |
var view = registry.byId("view1"); |
| 419 |
runner.assertTrue(!!view.domNode); |
| 420 |
runner.assertTrue(domClass.contains(view.domNode, "mblView")); |
| 421 |
runner.assertTrue(!!view.myAttachPoint); |
| 422 |
runner.assertTrue(!!view.myAttachPoint.innerHTML); |
| 423 |
runner.assertEqual("myValue", view.myAttachPoint.innerHTML, "view.myAttachPoint.innerHTML"); |
| 424 |
} |
| 425 |
]); |
| 426 |
runner.run(); |
| 427 |
}); |
| 428 |
}) |
| 429 |
</script> |
| 430 |
|
| 431 |
<style type="text/css"> |
| 432 |
html,body{ |
| 433 |
height: 100%; |
| 434 |
} |
| 435 |
.mblRoundRect { |
| 436 |
margin-left: 32px; |
| 437 |
margin-right: 32px; |
| 438 |
} |
| 439 |
.bold { |
| 440 |
font-weight: bold; |
| 441 |
} |
| 442 |
</style> |
| 443 |
</head> |
| 444 |
|
| 445 |
<body> |
| 446 |
<div id="main" data-dojo-type="dojox/mobile/View"> |
| 447 |
|
| 448 |
<div id="ListItem" data-dojo-type="dojox/mobile/ScrollableView"> |
| 449 |
<ul id="list" data-dojo-type="dojox/mobile/RoundRectList" |
| 450 |
data-dojo-props="variableHeight: true"> |
| 451 |
|
| 452 |
|
| 453 |
|
| 454 |
|
| 455 |
|
| 456 |
<li id="listItem1" data-dojo-type="dojox/mobile/ListItem" |
| 457 |
data-dojo-mixins="dijit/_TemplatedMixin" |
| 458 |
data-dojo-props="label:'Some label', |
| 459 |
templateString: '<div>My inline <i>HTML</i> template (markup)<div data-dojo-attach-point=\'labelNode\'></div></div>'"> |
| 460 |
</li> |
| 461 |
|
| 462 |
<li id="listItem2" data-dojo-type="dojox/mobile/ListItem" |
| 463 |
data-dojo-mixins="dijit/_TemplatedMixin" |
| 464 |
data-dojo-props="templateString: '<div>My inline <i>HTML</i> template (markup)<div data-dojo-attach-point=\'labelNode\'></div></div>'"> |
| 465 |
</li> |
| 466 |
|
| 467 |
<li id="listItem3" data-dojo-type="dojox/mobile/ListItem" |
| 468 |
data-dojo-mixins="dijit/_TemplatedMixin" |
| 469 |
data-dojo-props="templateString: '<div><div>My inline, multiline <i>HTML</i><br>template (markup)</div></div>'"> |
| 470 |
</li> |
| 471 |
|
| 472 |
|
| 473 |
|
| 474 |
<li id="listItem4" data-dojo-type=TemplatedListItem1> |
| 475 |
</li> |
| 476 |
|
| 477 |
<li id="listItem5" data-dojo-type=TemplatedWithWidgetsListItem1> |
| 478 |
</li> |
| 479 |
|
| 480 |
<li id="listItem6" data-dojo-type=TemplatedWithWidgetsListItem2> |
| 481 |
</li> |
| 482 |
|
| 483 |
|
| 484 |
|
| 485 |
<div id="heading1" data-dojo-type="dojox/mobile/Heading" |
| 486 |
data-dojo-props="back:'Back', |
| 487 |
templateString: '<div>My inline <i>HTML</i> template (markup)</div>'" |
| 488 |
data-dojo-mixins="dijit/_TemplatedMixin"> |
| 489 |
</div> |
| 490 |
|
| 491 |
<div id="heading2" data-dojo-type=TemplatedWithWidgetsHeading1 |
| 492 |
data-dojo-props="back:'Back', label: 'Some label'"> |
| 493 |
</div> |
| 494 |
|
| 495 |
|
| 496 |
<div data-dojo-type="dojox/mobile/RoundRect" data-dojo-props="shadow:true"> |
| 497 |
<table style="width:100%"> |
| 498 |
<tr> |
| 499 |
<td><span class="bold">Button</span></td> |
| 500 |
<td style="text-align:right"> |
| 501 |
<button id="button1" data-dojo-type="dojox/mobile/Button" |
| 502 |
data-dojo-props="templateString: templateButton1" |
| 503 |
data-dojo-mixins="dijit/_TemplatedMixin"> |
| 504 |
Press me! |
| 505 |
</button> |
| 506 |
</td> |
| 507 |
</tr> |
| 508 |
</table> |
| 509 |
</div> |
| 510 |
|
| 511 |
|
| 512 |
<div data-dojo-type="dojox/mobile/RoundRect" data-dojo-props="shadow:true"> |
| 513 |
<table style="width:100%"> |
| 514 |
<tr> |
| 515 |
<td><span class="bold">Slider</span></td> |
| 516 |
<td style="float:right"> |
| 517 |
<input id="slider1" data-dojo-type="dojox/mobile/Slider" |
| 518 |
style="width:200px;" type="range" |
| 519 |
data-dojo-props="templateString: templateSlider1, |
| 520 |
value:10, min:0, max:40, step:0.1" |
| 521 |
data-dojo-mixins="dijit/_TemplatedMixin"> |
| 522 |
</td> |
| 523 |
</tr> |
| 524 |
</table> |
| 525 |
</div> |
| 526 |
|
| 527 |
|
| 528 |
<div data-dojo-type="dojox/mobile/RoundRect" data-dojo-props="shadow:true"> |
| 529 |
<table style="width:100%"> |
| 530 |
<tr> |
| 531 |
<td><span class="bold">CheckBox</span></td> |
| 532 |
<td style="text-align:right"> |
| 533 |
<label for="checkbox1">Click me</label> |
| 534 |
<input type="checkbox" id="checkbox1" |
| 535 |
data-dojo-type="dojox/mobile/CheckBox" |
| 536 |
data-dojo-props="templateString: templateCheckBox1"> |
| 537 |
</td> |
| 538 |
</tr> |
| 539 |
</table> |
| 540 |
</div> |
| 541 |
|
| 542 |
|
| 543 |
<div data-dojo-type="dojox/mobile/RoundRect" data-dojo-props="shadow:true"> |
| 544 |
<table style="width:100%"> |
| 545 |
<tr> |
| 546 |
<td><span class="bold">ToggleButton</span></td> |
| 547 |
<td style="text-align:right"> |
| 548 |
<button id="togglebutton1" data-dojo-type="dojox/mobile/ToggleButton" |
| 549 |
data-dojo-props="templateString: templateToggleButton1"> |
| 550 |
Toggle me |
| 551 |
</button> |
| 552 |
</td> |
| 553 |
</tr> |
| 554 |
</table> |
| 555 |
</div> |
| 556 |
|
| 557 |
|
| 558 |
<div data-dojo-type="dojox/mobile/RoundRect" data-dojo-props="shadow:true"> |
| 559 |
<table style="width:100%"> |
| 560 |
<tr> |
| 561 |
<td><span class="bold">Switch</span></td> |
| 562 |
<td style="text-align:right"> |
| 563 |
<input id="switch1" type="checkbox" value="on" |
| 564 |
data-dojo-type="dojox/mobile/Switch" |
| 565 |
data-dojo-props="templateString: templateSwitch1" |
| 566 |
data-dojo-mixins="dijit/_TemplatedMixin, dijit/_WidgetsInTemplateMixin"> |
| 567 |
</td> |
| 568 |
<td style="text-align:right"> |
| 569 |
<input id="switch2" type="checkbox" value="on" |
| 570 |
data-dojo-type=TemplatedSwitch> |
| 571 |
</td> |
| 572 |
</tr> |
| 573 |
</table> |
| 574 |
</div> |
| 575 |
|
| 576 |
|
| 577 |
<div data-dojo-type="dojox/mobile/RoundRect" data-dojo-props="shadow:true"> |
| 578 |
<table style="width:100%"> |
| 579 |
<tr> |
| 580 |
<td><span class="bold">Radio Button</span></td> |
| 581 |
<td style="text-align:right"> |
| 582 |
<input type="radio" id="rb1" data-dojo-type="dojox/mobile/RadioButton" |
| 583 |
data-dojo-props="templateString: templateRadioButton1" |
| 584 |
name="mobileRadio" value="Large" checked> |
| 585 |
<label for="rb1">1</label> |
| 586 |
|
| 587 |
<input type="radio" id="rb2" data-dojo-type="dojox/mobile/RadioButton" |
| 588 |
data-dojo-props="templateString: templateRadioButton1" |
| 589 |
name="mobileRadio" value="Large"> |
| 590 |
<label for="rb2">2</label> |
| 591 |
|
| 592 |
<input type="radio" id="rb3" data-dojo-type="dojox/mobile/RadioButton" |
| 593 |
data-dojo-props="templateString: templateRadioButton1" |
| 594 |
name="mobileRadio" value="Large"> |
| 595 |
<label for="rb3">3</label> |
| 596 |
</tr> |
| 597 |
</table> |
| 598 |
</div> |
| 599 |
</ul> |
| 600 |
</div> |
| 601 |
|
| 602 |
|
| 603 |
<div id="view1" data-dojo-type=TemplatedView1> |
| 604 |
</div> |
| 605 |
</div> |
| 606 |
|
| 607 |
</body> |
| 608 |
</html> |