| 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>Bidi Mobile test - EdgeToEdgeStoreList</title> |
| 8 |
|
| 9 |
<script type="text/javascript" src="../../deviceTheme.js" data-dojo-config="mblThemeFiles: ['base']"></script> |
| 10 |
<script type="text/javascript" src="../../../../dojo/dojo.js" data-dojo-config="async: true, parseOnLoad: true, mblAlwaysHideAddressBar: true, has: { 'dojo-bidi': true }"></script> |
| 11 |
|
| 12 |
<script type="text/javascript"> |
| 13 |
require([ |
| 14 |
"dojo/store/Memory", |
| 15 |
"dojo/store/Observable", |
| 16 |
"dijit/registry", |
| 17 |
"doh/runner", |
| 18 |
"dojo/dom", |
| 19 |
"dojo/ready", |
| 20 |
"dojo/query", |
| 21 |
"dojox/mobile/parser", |
| 22 |
"dojox/mobile", |
| 23 |
"dojox/mobile/compat", |
| 24 |
"dojox/mobile/ScrollableView", |
| 25 |
"dojox/mobile/RoundRectStoreList", |
| 26 |
"dojox/mobile/EdgeToEdgeStoreList" |
| 27 |
], function(Memory, Observable, registry, runner, dom, ready, query){ |
| 28 |
var static_data1 = { |
| 29 |
items: [ |
| 30 |
{ label: "Hello world!", icon: "../images/i-icon-1.png", moveTo: "wifi" }, |
| 31 |
{ label: "שלום עולם!", icon: "../images/i-icon-2.png", moveTo: "bright" }, |
| 32 |
{ label: "Hello עולם!", icon: "../images/i-icon-3.png", moveTo: "picture" }, |
| 33 |
{ label: "שלום World!", icon: "../images/i-icon-5.png", moveTo: "wifi" } |
| 34 |
] |
| 35 |
}; |
| 36 |
|
| 37 |
var static_data2 = { |
| 38 |
items: [ |
| 39 |
{label: "שלום World!", moveTo: "dummy"}, |
| 40 |
{label: "Hello עולם!", moveTo: "dummy"}, |
| 41 |
{label: "שלום עולם!", moveTo: "dummy"}, |
| 42 |
{label: "Hello world!", moveTo: "dummy"} |
| 43 |
] |
| 44 |
}; |
| 45 |
store1 = Observable(new Memory({idProperty:"label", data: static_data1})); |
| 46 |
store2 = Observable(new Memory({idProperty:"label", data: static_data2})); |
| 47 |
store1.__counter = store2.__counter = 1; |
| 48 |
store = store1; |
| 49 |
|
| 50 |
// switch to the selected store |
| 51 |
switchTo = function(store){ |
| 52 |
window.store = store; |
| 53 |
registry.byId("roundrect_list1").setStore(store); |
| 54 |
registry.byId("edgetoedge_list1").setStore(store); |
| 55 |
registry.byId("roundrect_list2").setStore(store); |
| 56 |
registry.byId("edgetoedge_list2").setStore(store); |
| 57 |
registry.byId("roundrect_list3").setStore(store); |
| 58 |
registry.byId("edgetoedge_list3").setStore(store); |
| 59 |
registry.byId("roundrect_list4").setStore(store); |
| 60 |
registry.byId("edgetoedge_list4").setStore(store); |
| 61 |
registry.byId("roundrect_list5").setStore(store); |
| 62 |
registry.byId("edgetoedge_list5").setStore(store); |
| 63 |
registry.byId("roundrect_list6").setStore(store); |
| 64 |
registry.byId("edgetoedge_list6").setStore(store); |
| 65 |
}; |
| 66 |
// add a new item |
| 67 |
add1 = function(){ |
| 68 |
store.add({label: "חדש"+(store.__counter++)+ "!",icon: "../images/i-icon-1.png",moveTo: "dummy"}); |
| 69 |
}; |
| 70 |
}); |
| 71 |
</script> |
| 72 |
</head> |
| 73 |
|
| 74 |
<body style="visibility:hidden;"> |
| 75 |
<div id="group1" data-dojo-type="dojox.mobile.View" data-dojo-props='keepScrollPos:false'> |
| 76 |
<div id="view0" data-dojo-type="dojox.mobile.ScrollableView"> |
| 77 |
<h2 data-dojo-type="dojox.mobile.Heading">EdgeToEdgeStoreList widget</h2> |
| 78 |
<h1 data-dojo-type="dojox.mobile.Heading">dir LTR</h1> |
| 79 |
<ul data-dojo-type="dojox.mobile.EdgeToEdgeList" > |
| 80 |
<li id="l1" data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"../images/LTR.png", moveTo:"view1"'>Tex Dir LTR</li> |
| 81 |
<li id="l2" data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"../images/RTL.png", moveTo:"view2"'>Tex Dir RTL</li> |
| 82 |
<li id="l3" data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"../images/auto.png", moveTo:"view3"'>Tex Dir AUTO</li> |
| 83 |
</ul> |
| 84 |
<h1 data-dojo-type="dojox.mobile.Heading">dir RTL</h1> |
| 85 |
<ul data-dojo-type="dojox.mobile.EdgeToEdgeList" > |
| 86 |
<li id="l4" data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"../images/LTR.png", moveTo:"view4"'>Tex Dir LTR</li> |
| 87 |
<li id="l5" data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"../images/RTL.png", moveTo:"view5"'>Tex Dir RTL</li> |
| 88 |
<li id="l6" data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"../images/auto.png", moveTo:"view6"'>Tex Dir AUTO</li> |
| 89 |
</ul> |
| 90 |
</div> |
| 91 |
|
| 92 |
|
| 93 |
<div id="view1" data-dojo-type="dojox.mobile.ScrollableView"> |
| 94 |
<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir LTR | textDir LTR</h1> |
| 95 |
|
| 96 |
<h2 data-dojo-type="dojox.mobile.Heading">RoundRectStoreList</h2> |
| 97 |
<ul data-dojo-type="dojox.mobile.RoundRectStoreList" id="roundrect_list1" data-dojo-props='textDir:"ltr", store:store, query:{}'></ul> |
| 98 |
<h2 data-dojo-type="dojox.mobile.Heading">EdgeToEdgeStoreList</h2> |
| 99 |
<ul data-dojo-type="dojox.mobile.EdgeToEdgeStoreList" id="edgetoedge_list1" data-dojo-props='textDir:"ltr", store:store, query:{}'></ul> |
| 100 |
<table border="1"> |
| 101 |
<tr><th>Show the different set</th><th>Alter the object store</th></tr> |
| 102 |
<tr><td> |
| 103 |
<input type="button" value="Set1" onclick="switchTo(store1)"> |
| 104 |
<input type="button" value="Set2" onclick="switchTo(store2)"> |
| 105 |
</td><td> |
| 106 |
<input type="button" value="Add" onclick="add1()"> |
| 107 |
</td></tr></table> |
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
</div> |
| 112 |
|
| 113 |
|
| 114 |
<div id="view2" data-dojo-type="dojox.mobile.ScrollableView"> |
| 115 |
<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir LTR | textDir RTL</h1> |
| 116 |
|
| 117 |
<h2 data-dojo-type="dojox.mobile.Heading">RoundRectStoreList</h2> |
| 118 |
<ul data-dojo-type="dojox.mobile.RoundRectStoreList" id="roundrect_list2" data-dojo-props='textDir:"rtl", store:store, query:{}'></ul> |
| 119 |
<h2 data-dojo-type="dojox.mobile.Heading">EdgeToEdgeStoreList</h2> |
| 120 |
<ul data-dojo-type="dojox.mobile.EdgeToEdgeStoreList" id="edgetoedge_list2" data-dojo-props='textDir:"rtl", store:store, query:{}'></ul> |
| 121 |
<table border="1"> |
| 122 |
<tr><th>Show the different set</th><th>Alter the object store</th></tr> |
| 123 |
<tr><td> |
| 124 |
<input type="button" value="Set1" onclick="switchTo(store1)"> |
| 125 |
<input type="button" value="Set2" onclick="switchTo(store2)"> |
| 126 |
</td><td> |
| 127 |
<input type="button" value="Add" onclick="add1()"> |
| 128 |
</td></tr></table> |
| 129 |
|
| 130 |
</div> |
| 131 |
|
| 132 |
<div id="view3" data-dojo-type="dojox.mobile.ScrollableView"> |
| 133 |
<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir LTR | textDir AUTO</h1> |
| 134 |
<h2 data-dojo-type="dojox.mobile.Heading">RoundRectStoreList</h2> |
| 135 |
<ul data-dojo-type="dojox.mobile.RoundRectStoreList" id="roundrect_list3" data-dojo-props='textDir:"auto", store:store, query:{}'></ul> |
| 136 |
<h2 data-dojo-type="dojox.mobile.Heading">EdgeToEdgeStoreList</h2> |
| 137 |
<ul data-dojo-type="dojox.mobile.EdgeToEdgeStoreList" id="edgetoedge_list3" data-dojo-props='textDir:"auto", store:store, query:{}'></ul> |
| 138 |
<table border="1"> |
| 139 |
<tr><th>Show the different set</th><th>Alter the object store</th></tr> |
| 140 |
<tr><td> |
| 141 |
<input type="button" value="Set1" onclick="switchTo(store1)"> |
| 142 |
<input type="button" value="Set2" onclick="switchTo(store2)"> |
| 143 |
</td><td> |
| 144 |
<input type="button" value="Add" onclick="add1()"> |
| 145 |
</td></tr></table> |
| 146 |
|
| 147 |
</div> |
| 148 |
|
| 149 |
|
| 150 |
<div id="view4" data-dojo-type="dojox.mobile.ScrollableView"> |
| 151 |
<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir RTL | textDir LTR</h1> |
| 152 |
|
| 153 |
<h2 data-dojo-type="dojox.mobile.Heading">RoundRectStoreList</h2> |
| 154 |
<ul data-dojo-type="dojox.mobile.RoundRectStoreList" dir=rtl id="roundrect_list4" data-dojo-props='textDir:"ltr", store:store, query:{}'></ul> |
| 155 |
<h2 data-dojo-type="dojox.mobile.Heading">EdgeToEdgeStoreList</h2> |
| 156 |
<ul data-dojo-type="dojox.mobile.EdgeToEdgeStoreList" dir=rtl id="edgetoedge_list4" data-dojo-props='textDir:"ltr", store:store, query:{}'></ul> |
| 157 |
<table border="1"> |
| 158 |
<tr><th>Show the different set</th><th>Alter the object store</th></tr> |
| 159 |
<tr><td> |
| 160 |
<input type="button" value="Set1" onclick="switchTo(store1)"> |
| 161 |
<input type="button" value="Set2" onclick="switchTo(store2)"> |
| 162 |
</td><td> |
| 163 |
<input type="button" value="Add" onclick="add1()"> |
| 164 |
</td></tr></table> |
| 165 |
|
| 166 |
|
| 167 |
</div> |
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
<div dir="rtl" id="view5" data-dojo-type="dojox.mobile.ScrollableView"> |
| 172 |
<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir RTL | textDir RTL</h1> |
| 173 |
|
| 174 |
<h2 data-dojo-type="dojox.mobile.Heading">RoundRectStoreList</h2> |
| 175 |
<ul data-dojo-type="dojox.mobile.RoundRectStoreList" id="roundrect_list5" data-dojo-props='textDir:"rtl", store:store, query:{}'></ul> |
| 176 |
<h2 data-dojo-type="dojox.mobile.Heading">EdgeToEdgeStoreList</h2> |
| 177 |
<ul data-dojo-type="dojox.mobile.EdgeToEdgeStoreList" id="edgetoedge_list5" data-dojo-props='textDir:"rtl", store:store, query:{}'></ul> |
| 178 |
<table border="1"> |
| 179 |
<tr><th>Show the different set</th><th>Alter the object store</th></tr> |
| 180 |
<tr><td> |
| 181 |
<input type="button" value="Set1" onclick="switchTo(store1)"> |
| 182 |
<input type="button" value="Set2" onclick="switchTo(store2)"> |
| 183 |
</td><td> |
| 184 |
<input type="button" value="Add" onclick="add1()"> |
| 185 |
</td></tr></table> |
| 186 |
|
| 187 |
|
| 188 |
</div> |
| 189 |
|
| 190 |
<div dir="rtl" id="view6" data-dojo-type="dojox.mobile.ScrollableView"> |
| 191 |
<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir RTL | textDir AUTO</h1> |
| 192 |
|
| 193 |
<h2 data-dojo-type="dojox.mobile.Heading">RoundRectStoreList</h2> |
| 194 |
<ul data-dojo-type="dojox.mobile.RoundRectStoreList" id="roundrect_list6" data-dojo-props='textDir:"auto", store:store, query:{}'></ul> |
| 195 |
<h2 data-dojo-type="dojox.mobile.Heading">EdgeToEdgeStoreList</h2> |
| 196 |
<ul data-dojo-type="dojox.mobile.EdgeToEdgeStoreList" id="edgetoedge_list6" data-dojo-props='textDir:"auto", store:store, query:{}'></ul> |
| 197 |
<table border="1"> |
| 198 |
<tr><th>Show the different set</th><th>Alter the object store</th></tr> |
| 199 |
<tr><td> |
| 200 |
<input type="button" value="Set1" onclick="switchTo(store1)"> |
| 201 |
<input type="button" value="Set2" onclick="switchTo(store2)"> |
| 202 |
</td><td> |
| 203 |
<input type="button" value="Add" onclick="add1()"> |
| 204 |
</td></tr></table> |
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
</div> |
| 209 |
|
| 210 |
|
| 211 |
</div> |
| 212 |
</body> |
| 213 |
</html> |