| 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>Button</title> |
| 7 | <link href="../../../themes/iphone/iphone.css" rel="stylesheet"/> |
| 8 | <style> |
| 9 | .redButton { |
| 10 | border-color: #cc3333; |
| 11 | background-image: url(../../images/red-button-bg.png); |
| 12 | background: -webkit-gradient(linear, left top, left bottom, from(#D3656D), to(#BC1320), color-stop(0.5, #C9404B), color-stop(0.5, #BC1421)); |
| 13 | } |
| 14 | .redButtonSelected { |
| 15 | background-image: url(../../images/red-button-sel-bg.png); |
| 16 | background: -webkit-gradient(linear, left top, left bottom, from(#AF333C), to(#880E17), color-stop(0.5, #952B33), color-stop(0.5, #870F18)); |
| 17 | } |
| 18 | </style> |
| 19 | <script type="text/javascript" src="../../../../../dojo/dojo.js" data-dojo-config="parseOnLoad: true"></script> |
| 20 | |
| 21 | <script language="JavaScript" type="text/javascript"> |
| 22 | //dojo.require("dojo.parser"); // Use the lightweight parser. |
| 23 | dojo.require("dojox.mobile.parser"); |
| 24 | dojo.require("dojox.mobile"); |
| 25 | dojo.require("dojox.mobile.Button"); |
| 26 | dojo.requireIf(!dojo.isWebKit, "dojox.mobile.compat"); |
| 27 | |
| 28 | dojo.require("doh.runner"); |
| 29 | |
| 30 | dojo.addOnLoad(function(){ |
| 31 | var demoWidget = new dojox.mobile.Button({"class":"mblBlueButton", style:"width:120px", label:"Default Button"}); |
| 32 | dojo.doc.body.appendChild(demoWidget.domNode); |
| 33 | |
| 34 | var child = dojo.create("P", null, dojo.doc.body); |
| 35 | |
| 36 | demoWidget = new dojox.mobile.Button({"class":"redButton", style:"width:120px", label:"Custom Button"}); |
| 37 | dojo.doc.body.appendChild(demoWidget.domNode); |
| 38 | |
| 39 | doh.register("dojox.mobile.test.doh.Button", [ |
| 40 | function test_Button_Verification(){ |
| 41 | var demoWidget = dijit.byId("dojox_mobile_Button_0"); |
| 42 | doh.assertEqual('mblButton mblBlueButton', demoWidget.domNode.className); |
| 43 | doh.assertEqual('Default Button', demoWidget.domNode.childNodes[0].nodeValue); |
| 44 | demoWidget = dijit.byId("dojox_mobile_Button_1"); |
| 45 | doh.assertEqual('mblButton redButton', demoWidget.domNode.className); |
| 46 | doh.assertEqual('Custom Button', demoWidget.domNode.childNodes[0].nodeValue); |
| 47 | } |
| 48 | ]); |
| 49 | doh.run(); |
| 50 | }); |
| 51 | </script> |
| 52 | </head> |
| 53 | <body style="padding: 20px;visibility:visible"> |
| 54 | </body> |
| 55 | </html> |