| 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>Icon Container (Multi - Below)</title> |
| 8 | |
| 9 | <script type="text/javascript" src="../../../deviceTheme.js" data-dojo-config="mblThemeFiles: ['base','IconContainer']"></script> |
| 10 | <script type="text/javascript" src="../../../../../dojo/dojo.js" data-dojo-config="async: false, 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/IconContainer", |
| 20 | "dojox/mobile/IconItem", |
| 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 IconContainer", [ |
| 27 | { |
| 28 | name: "mobile", |
| 29 | timeout: 2000, |
| 30 | runTest: function(){ |
| 31 | var LRE = String.fromCharCode(8234); |
| 32 | var RLE = String.fromCharCode(8235); |
| 33 | var firstListItem = registry.byId('first_li'); |
| 34 | var secondListItem = registry.byId('second_li'); |
| 35 | var deferred = new runner.Deferred(); |
| 36 | |
| 37 | runner.is(RLE, firstListItem.labelNode.innerHTML.charAt(0), "label node of first list item inherits textDir attribute from IconContainer"); |
| 38 | runner.is(RLE, firstListItem.paneWidget.labelNode.innerHTML.charAt(0), "paneWidget node of first list item inherits textDir attribute from IconContainer"); |
| 39 | |
| 40 | runner.is(LRE, secondListItem.labelNode.innerHTML.charAt(0), "label node of second list item textDir has been set to 'ltr' explicitly"); |
| 41 | runner.is(LRE, secondListItem.paneWidget.labelNode.innerHTML.charAt(0), "paneWidget node of second list item textDir has been set to 'ltr' explicitly"); |
| 42 | |
| 43 | runner.assertTrue(firstListItem._onTouchStartHandle, "'startup' call chain was successful, widget icon mouse click handle has been initialized"); |
| 44 | |
| 45 | deferred.getTestCallback(function(){ |
| 46 | firstListItem.set("textDir","ltr"); |
| 47 | runner.is(LRE, firstListItem.labelNode.innerHTML.charAt(0), "the text direction of label node of first list item has been changed on the fly"); |
| 48 | runner.is(LRE, firstListItem.paneWidget.labelNode.innerHTML.charAt(0), "the text direction of paneWidget node of first list item has been changed on the fly"); |
| 49 | firstListItem.set("textDir","rtl"); |
| 50 | })(); |
| 51 | |
| 52 | return deferred; |
| 53 | } |
| 54 | } |
| 55 | ]); |
| 56 | |
| 57 | runner.register("log", function(){ |
| 58 | dom.byId('failures').innerHTML = runner._failureCount; |
| 59 | dom.byId('errors').innerHTML = runner._errorCount; |
| 60 | }); |
| 61 | |
| 62 | runner.run(); |
| 63 | }); |
| 64 | }); |
| 65 | </script> |
| 66 | <style> |
| 67 | .box { |
| 68 | border: 1px solid #A7C0E0; |
| 69 | width: 300px; |
| 70 | height: 250px; |
| 71 | background-image: url(../../images/widget-bg.png); |
| 72 | background-repeat: no-repeat; |
| 73 | background-color: white; |
| 74 | } |
| 75 | </style> |
| 76 | </head> |
| 77 | <body style="visibility:hidden;"> |
| 78 | <div id="view1" data-dojo-type="dojox/mobile/View"> |
| 79 | <h1 data-dojo-type="dojox/mobile/Heading">Icon Container (Multi - Below)</h1> |
| 80 | <ul data-dojo-type="dojox/mobile/IconContainer" data-dojo-props='textDir:"rtl" '> |
| 81 | <li id="first_li" data-dojo-type="dojox/mobile/IconItem" data-dojo-props='label:"app1!!", icon:"../../images/icon-1.png", lazy:true '><div class="box"></div></li> |
| 82 | <li id="second_li" data-dojo-type="dojox/mobile/IconItem" data-dojo-props='label:"app2!!", icon:"../../images/icon-1.png", lazy:true,textDir:"ltr" '><div class="box"></div></li> |
| 83 | <li data-dojo-type="dojox/mobile/IconItem" data-dojo-props='label:"app3!!", icon:"../../images/icon-1.png", lazy:true'><div class="box"></div></li> |
| 84 | <li data-dojo-type="dojox/mobile/IconItem" data-dojo-props='label:"href?", icon:"../../images/icon-1.png", href:"../../test_RoundRectList.html", transition:"slide"'></li> |
| 85 | </ul> |
| 86 | </div> |
| 87 | <br>Errors: <span id="errors">?</span> |
| 88 | <br>Failures: <span id="failures">?</span> |
| 89 | </body> |
| 90 | </html> |