| 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>Round Rect</title> |
| 7 | <link href="../../../themes/iphone/iphone.css" rel="stylesheet"/> |
| 8 | |
| 9 | <script type="text/javascript" src="../../../../../dojo/dojo.js" data-dojo-config="parseOnLoad: true"></script> |
| 10 | |
| 11 | <script language="JavaScript" type="text/javascript"> |
| 12 | //dojo.require("dojo.parser"); // Use the lightweight parser. |
| 13 | dojo.require("dojox.mobile.parser"); |
| 14 | dojo.require("dojox.mobile"); |
| 15 | dojo.requireIf(!dojo.isWebKit, "dojox.mobile.compat"); |
| 16 | |
| 17 | dojo.require("doh.runner"); |
| 18 | dojo.addOnLoad(function(){ |
| 19 | var view = dijit.byId("foo"); |
| 20 | var demoWidget = new dojox.mobile.RoundRect({shadow:"true"}); |
| 21 | demoWidget.domNode.appendChild(dojo.doc.createTextNode("This module provides some widgets that can be used to build web-based applications for mobile devices such as iPhone or Android.")); |
| 22 | // view.addChild(demoWidget); |
| 23 | demoWidget.placeAt(view.containerNode); |
| 24 | demoWidget.startup(); |
| 25 | |
| 26 | demoWidget = new dojox.mobile.RoundRect(); |
| 27 | demoWidget.domNode.appendChild(dojo.doc.createTextNode("This module provides some widgets that can be used to build web-based applications for mobile devices such as iPhone or Android.")); |
| 28 | // view.addChild(demoWidget); |
| 29 | demoWidget.placeAt(view.containerNode); |
| 30 | demoWidget.startup(); |
| 31 | |
| 32 | doh.register("dojox.mobile.test.doh.RoundRect", [ |
| 33 | { |
| 34 | name: "RoundRect Verification", |
| 35 | timeout: 4000, |
| 36 | runTest: function(){ |
| 37 | var d = new doh.Deferred(); |
| 38 | setTimeout(d.getTestCallback(function(){ |
| 39 | var demoWidget = dijit.byId("dojox_mobile_RoundRect_0"); |
| 40 | if(dojo.isIE < 10){ |
| 41 | doh.assertEqual('mblRoundRect', demoWidget.domNode.className); |
| 42 | }else{ |
| 43 | doh.assertEqual('mblRoundRect mblShadow', demoWidget.domNode.className); |
| 44 | } |
| 45 | |
| 46 | demoWidget = dijit.byId("dojox_mobile_RoundRect_1"); |
| 47 | doh.assertEqual('mblRoundRect', demoWidget.domNode.className); |
| 48 | })); |
| 49 | return d; |
| 50 | } |
| 51 | }, |
| 52 | { |
| 53 | name: "Set", |
| 54 | timeout: 4000, |
| 55 | runTest: function(){ |
| 56 | var demoWidget = dijit.byId("dojox_mobile_RoundRect_0"); |
| 57 | demoWidget.set({shadow :false}); |
| 58 | |
| 59 | demoWidget.set({shadow :false}); |
| 60 | // doh.assertFalse(demoWidget.get("shadow")); |
| 61 | // doh.assertEqual('mblRoundRect', demoWidget.domNode.className); |
| 62 | } |
| 63 | } |
| 64 | ]); |
| 65 | doh.run(); |
| 66 | }); |
| 67 | </script> |
| 68 | </head> |
| 69 | <body> |
| 70 | <div id="foo" dojoType="dojox.mobile.View" selected="true"> |
| 71 | <h2 dojoType="dojox.mobile.RoundRectCategory">Round Rectangle</h2> |
| 72 | </div> |
| 73 | </body> |
| 74 | </html> |