| 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>Heading</title> |
| 8 | |
| 9 | <script type="text/javascript" src="../deviceTheme.js" |
| 10 | data-dojo-config="mblThemeFiles: ['base','TabBar','dojox/mobile/themes/common/domButtons.css']"></script> |
| 11 | <script type="text/javascript" src="../../../dojo/dojo.js" data-dojo-config="async: true, parseOnLoad: true"></script> |
| 12 | |
| 13 | <script type="text/javascript"> |
| 14 | require([ |
| 15 | "dojo/_base/window", |
| 16 | "dojo/dom", |
| 17 | "dojo/ready", |
| 18 | "dijit/registry", |
| 19 | "dojox/mobile/parser", |
| 20 | "dojox/mobile", |
| 21 | "dojox/mobile/compat", |
| 22 | "dojox/mobile/TabBar" |
| 23 | ], function(win, dom, ready, registry){ |
| 24 | win.doc.dojoClick = false; // disable dojo/touch clicks for native radios buttons |
| 25 | var btn1; |
| 26 | setIcon = function(flag){ |
| 27 | if(flag == 1){ |
| 28 | btn1.set("iconPos", ""); |
| 29 | btn1.set("icon", "mblDomButtonWhitePlus"); |
| 30 | }else if(flag == 2){ |
| 31 | btn1.set("iconPos", ""); |
| 32 | btn1.set("icon", "images/tab-icon-33w.png"); |
| 33 | }else if(flag == 3){ |
| 34 | btn1.set("iconPos", "29,116,29,29"); |
| 35 | btn1.set("icon", "images/tab-icons.png"); |
| 36 | }else if(flag == 4){ |
| 37 | btn1.set("iconPos", ""); |
| 38 | btn1.set("icon", ""); |
| 39 | } |
| 40 | } |
| 41 | setSelected = function(flag){ |
| 42 | btn1.set("selected", flag); |
| 43 | } |
| 44 | setLabel = function(){ |
| 45 | btn1.set("label", dom.byId("txt1").value); |
| 46 | } |
| 47 | |
| 48 | ready(function(){ |
| 49 | btn1 = registry.byId("btn1"); |
| 50 | }); |
| 51 | }); |
| 52 | </script> |
| 53 | </head> |
| 54 | <body style="visibility:hidden;"> |
| 55 | <div data-dojo-type="dojox.mobile.Heading" data-dojo-props='label:"Arrow"'> |
| 56 | <span id="btn1" data-dojo-type="dojox.mobile.ToolBarButton" data-dojo-props='light:false'>MMMM</span> |
| 57 | </div> |
| 58 | <table style="margin:20px"> |
| 59 | <tr> |
| 60 | <td style="margin-right:20px">Icon</td> |
| 61 | <td><input id="icon1" type="radio" name="icon" onclick="setIcon(1)"><label for="icon1">DOM Buttn</label> |
| 62 | <input id="icon2" type="radio" name="icon" onclick="setIcon(2)"><label for="icon2">Image</label> |
| 63 | <input id="icon3" type="radio" name="icon" onclick="setIcon(3)"><label for="icon3">Sprite</label> |
| 64 | <input id="icon4" type="radio" name="icon" onclick="setIcon(4)" checked><label for="icon4">none</label></td> |
| 65 | </tr> |
| 66 | <tr> |
| 67 | <td style="margin-right:20px">Selected</td> |
| 68 | <td><input id="sel1" type="radio" name="selected" onclick="setSelected(true)" value="on"><label for="sel1">on</label> |
| 69 | <input id="sel2" type="radio" name="selected" onclick="setSelected(false)" value="off" checked><label for="sel2">off</label></td> |
| 70 | </tr> |
| 71 | <tr> |
| 72 | <td style="margin-right:20px">Label</td> |
| 73 | <td><input id="txt1" type="text" value="MMMM"> <input type="button" value="Set" onclick="setLabel()"></td> |
| 74 | </tr> |
| 75 | </table> |
| 76 | </body> |
| 77 | </html> |