| 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>List with domButtons</title> |
| 8 | |
| 9 | <link href="../themes/common/domButtons.css" rel="stylesheet"/> |
| 10 | <script type="text/javascript" src="../deviceTheme.js" data-dojo-config="mblThemeFiles: ['base']"></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/array", |
| 16 | "dojo/_base/connect", |
| 17 | "dojo/_base/window", |
| 18 | "dojo/ready", |
| 19 | "dijit/registry", |
| 20 | "dojox/mobile/parser", |
| 21 | "dojox/mobile", |
| 22 | "dojox/mobile/compat" |
| 23 | ], function(array, connect, win, ready, registry){ |
| 24 | function setRightIcon2Value(id, val){ |
| 25 | var txt = win.doc.createTextNode(val); |
| 26 | registry.byId(id).rightIcon2Node.firstChild.firstChild.appendChild(txt); |
| 27 | } |
| 28 | function setIconValue(id, val){ |
| 29 | var txt = win.doc.createTextNode(val); |
| 30 | registry.byId(id).iconNode.firstChild.firstChild.firstChild.firstChild.appendChild(txt); |
| 31 | } |
| 32 | ready(function(){ |
| 33 | setRightIcon2Value("item1", "32"); |
| 34 | setRightIcon2Value("item2", "5"); |
| 35 | setRightIcon2Value("item3", "108"); |
| 36 | setIconValue("item42", "3"); |
| 37 | array.forEach(registry.byId("list1").getChildren(), function(w){ |
| 38 | connect.connect(w.iconNode, "onclick", w, function(e){ |
| 39 | console.log(this); |
| 40 | registry.byId("list1").removeChild(this); |
| 41 | }); |
| 42 | }); |
| 43 | array.forEach(registry.byId("list5").getChildren(), function(w){ |
| 44 | connect.connect(w.iconNode, "onclick", w, function(e){ |
| 45 | console.log(this); |
| 46 | registry.byId("list5").removeChild(this); |
| 47 | }); |
| 48 | }); |
| 49 | }); |
| 50 | }); |
| 51 | </script> |
| 52 | <style> |
| 53 | #item1, #item2, #item3 { |
| 54 | font-weight: normal; |
| 55 | font-size: 12px; |
| 56 | } |
| 57 | .subject { |
| 58 | font: bold 16px Helvetica; |
| 59 | } |
| 60 | .textBox { |
| 61 | overflow: hidden; |
| 62 | } |
| 63 | |
| 64 | /* Note: The class name of DOM buttons must start with "mblDomButton". */ |
| 65 | |
| 66 | /* === My Custom Button1 ==*/ |
| 67 | .mblDomButtonMyCustomButton1 { |
| 68 | position: relative; |
| 69 | width: 30px; |
| 70 | height: 30px; |
| 71 | border-width: 1px; |
| 72 | border-style: outset; |
| 73 | border-color: #A5A2A5; |
| 74 | color: white; |
| 75 | -webkit-border-radius: 3px; |
| 76 | background-color: #D6D3D6; |
| 77 | background: -webkit-gradient(linear, left top, left bottom, from(#EFF3EF), to(#BDBEBD)); |
| 78 | } |
| 79 | .mblDomButtonMyCustomButton1 > DIV { |
| 80 | position: absolute; |
| 81 | top: 13px; |
| 82 | left: 5px; |
| 83 | width: 20px; |
| 84 | height: 4px; |
| 85 | margin: 0px; |
| 86 | font-size: 1px; |
| 87 | background-color: red; |
| 88 | -webkit-border-radius: 2px; |
| 89 | -webkit-transform: rotate(45deg); |
| 90 | } |
| 91 | .mblDomButtonMyCustomButton1 > DIV > DIV { |
| 92 | position: absolute; |
| 93 | top: -8px; |
| 94 | left: 8px; |
| 95 | width: 4px; |
| 96 | height: 20px; |
| 97 | margin: 0px; |
| 98 | font-size: 1px; |
| 99 | background-color: red; |
| 100 | -webkit-border-radius: 2px; |
| 101 | } |
| 102 | |
| 103 | /* === My Custom Button2 ==*/ |
| 104 | .mblDomButtonMyCustomButton2 { |
| 105 | position: relative; |
| 106 | width: 29px; |
| 107 | height: 29px; |
| 108 | } |
| 109 | |
| 110 | .mblDomButtonMyCustomButton2 > DIV { |
| 111 | position: relative; |
| 112 | top: 2px; |
| 113 | left: 2px; |
| 114 | width: 22px; |
| 115 | height: 22px; |
| 116 | border: 1px solid #B5B6B5; |
| 117 | -webkit-border-radius: 12px; |
| 118 | -webkit-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.5); |
| 119 | } |
| 120 | .mblDomButtonMyCustomButton2 > DIV > DIV { |
| 121 | position: relative; |
| 122 | top: 2px; |
| 123 | left: 2px; |
| 124 | width: 18px; |
| 125 | height: 18px; |
| 126 | -webkit-border-radius: 9px; |
| 127 | background-color: green; |
| 128 | } |
| 129 | .mblDomButtonMyCustomButton2 > DIV > DIV > DIV { |
| 130 | position: relative; |
| 131 | color: white; |
| 132 | text-align: center; |
| 133 | line-height: 17px; |
| 134 | font-size: 14px; |
| 135 | } |
| 136 | .mblDomButtonMyCustomButton2 > DIV > DIV > DIV > DIV { |
| 137 | display: none; |
| 138 | } |
| 139 | </style> |
| 140 | </head> |
| 141 | <body style="visibility:hidden;"> |
| 142 | <div id="view1" data-dojo-type="dojox.mobile.View" data-dojo-props='selected:true'> |
| 143 | <h1 data-dojo-type="dojox.mobile.Heading">View 1</h1> |
| 144 | <h2 data-dojo-type="dojox.mobile.RoundRectCategory">RoundRectList</h2> |
| 145 | <ul id="list1" data-dojo-type="dojox.mobile.RoundRectList"> |
| 146 | <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"mblDomButtonRedCircleMinus" |
| 147 | , moveTo:"view2", arrowClass:"mblDomButtonSilverCircleDownArrow"'> |
| 148 | Slide |
| 149 | </li> |
| 150 | <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"mblDomButtonRedCircleMinus" |
| 151 | , moveTo:"view2", arrowClass:"mblDomButtonSilverCircleGreenButton"'> |
| 152 | Flip |
| 153 | </li> |
| 154 | <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"mblDomButtonRedCircleMinus" |
| 155 | , moveTo:"view2", arrowClass:"mblDomButtonSilverCircleRedCross"'> |
| 156 | Fade |
| 157 | </li> |
| 158 | </ul> |
| 159 | </div> |
| 160 | |
| 161 | <div id="view2" data-dojo-type="dojox.mobile.View"> |
| 162 | <h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view1"'>View 2</h1> |
| 163 | <h2 data-dojo-type="dojox.mobile.RoundRectCategory">Dom Button with Text</h2> |
| 164 | <ul id="list2" data-dojo-type="dojox.mobile.RoundRectList" data-dojo-props='variableHeight:true'> |
| 165 | <li id="item1" data-dojo-type="dojox.mobile.ListItem" |
| 166 | data-dojo-props='icon:"mblDomButtonBlueBall", moveTo:"view3", rightIcon2:"mblDomButtonGrayRoundRect"'> |
| 167 | <div class="textBox"> |
| 168 | <div class="subject">Dojo: Traditional Karate-do Spirit</div> |
| 169 | Sarah Connor Hardcover<br> |
| 170 | Eligible for FREE Super Saver Shipping<br> |
| 171 | <span style="color:red">$14.50 (50%)</span> In Stock |
| 172 | </div> |
| 173 | </li> |
| 174 | <li id="item2" data-dojo-type="dojox.mobile.ListItem" |
| 175 | data-dojo-props='icon:"mblDomButtonTransparent19", moveTo:"view3", rightIcon2:"mblDomButtonGrayRoundRect"'> |
| 176 | <div class="textBox"> |
| 177 | <div class="subject">Japanese Martial Arts Dojo</div> |
| 178 | Martin Parker Hardcover<br> |
| 179 | <span style="color:red">$14.00 (60%)</span> In Stock |
| 180 | </div> |
| 181 | </li> |
| 182 | <li id="item3" data-dojo-type="dojox.mobile.ListItem" |
| 183 | data-dojo-props='icon:"mblDomButtonGreenBall", moveTo:"view3", rightIcon2:"mblDomButtonGrayRoundRect"'> |
| 184 | <div class="textBox"> |
| 185 | <div class="subject">Total Solar Eclipse</div> |
| 186 | Steven Young Hardcover<br> |
| 187 | Get it by Mar. 2 if you order in the next <span style="color:green"><b>16 hours</b></span><br> |
| 188 | Eligible for FREE Super Saver Shipping<br> |
| 189 | <span style="color:red">$9.50 (62%)</span> In Stock |
| 190 | </div> |
| 191 | </li> |
| 192 | </ul> |
| 193 | </div> |
| 194 | |
| 195 | <div id="view3" data-dojo-type="dojox.mobile.View"> |
| 196 | <h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view2"'>View 3</h1> |
| 197 | <h2 data-dojo-type="dojox.mobile.RoundRectCategory">Variable Height List</h2> |
| 198 | <ul id="list3" data-dojo-type="dojox.mobile.RoundRectList" data-dojo-props='variableHeight:true'> |
| 199 | <li data-dojo-type="dojox.mobile.ListItem" |
| 200 | data-dojo-props='moveTo:"view4", arrowClass:"mblDomButtonBlueCircleArrow"'> |
| 201 | Top 10 news stories of the decade |
| 202 | </li> |
| 203 | <li data-dojo-type="dojox.mobile.ListItem" |
| 204 | data-dojo-props='moveTo:"view4", arrowClass:"mblDomButtonBlueCircleArrow"'> |
| 205 | Create client-side diagrammatic interaction in Web applications with GFX |
| 206 | </li> |
| 207 | <li data-dojo-type="dojox.mobile.ListItem" |
| 208 | data-dojo-props='moveTo:"view4", arrowClass:"mblDomButtonBlueCircleArrow"'> |
| 209 | Explores advanced topics in the new Java framework for implementing and consuming REST-based Web services, Part 3 |
| 210 | </li> |
| 211 | </ul> |
| 212 | </div> |
| 213 | |
| 214 | <div id="view4" data-dojo-type="dojox.mobile.View"> |
| 215 | <h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view3"'>View 4</h1> |
| 216 | <h2 data-dojo-type="dojox.mobile.RoundRectCategory">Custom DOM Buttons</h2> |
| 217 | <ul id="list4" data-dojo-type="dojox.mobile.RoundRectList"> |
| 218 | <li id="item41" data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"mblDomButtonMyCustomButton1", moveTo:"view5"'> |
| 219 | My Custom Button 1 |
| 220 | </li> |
| 221 | <li id="item42" data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"mblDomButtonMyCustomButton2", moveTo:"view5"'> |
| 222 | My Custom Button 2 |
| 223 | </li> |
| 224 | </ul> |
| 225 | </div> |
| 226 | |
| 227 | <div id="view5" data-dojo-type="dojox.mobile.View"> |
| 228 | <h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view4"'>View 5</h1> |
| 229 | <h2 data-dojo-type="dojox.mobile.EdgeToEdgeCategory">EdgeToEdgeList</h2> |
| 230 | <ul id="list5" data-dojo-type="dojox.mobile.EdgeToEdgeList"> |
| 231 | <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"mblDomButtonRedCircleMinus"'> |
| 232 | Airplane Mode |
| 233 | <div data-dojo-type="dojox.mobile.Switch"></div> |
| 234 | </li> |
| 235 | <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"mblDomButtonRedCircleMinus", rightText:"mac", moveTo:"view1"'> |
| 236 | Wi-Fi |
| 237 | </li> |
| 238 | <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"mblDomButtonRedCircleMinus", rightText:"AcmePhone", moveTo:"view1"'> |
| 239 | Carrier |
| 240 | </li> |
| 241 | </ul> |
| 242 | </div> |
| 243 | </body> |
| 244 | </html> |