Debian Codegraph @

dojox/mobile/tests/bidi/test_RoundRectStoreList_rtl.html

raw symbols SCIP
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>RoundRectStoreList RTL</title>
8
9 <script type="text/javascript" src="../../deviceTheme.js" data-dojo-config="'dojo-bidi': true, mblThemeFiles: ['base']"></script>
10 <script type="text/javascript" src="../../../../dojo/dojo.js" data-dojo-config="async: true, parseOnLoad: true, has:{'dojo-bidi': true}"></script>
11
12 <script type="text/javascript">
13 require([
14 "dojo/_base/Deferred",
15 "dojo/store/Cache",
16 "dojo/store/JsonRest",
17 "dojo/store/Memory",
18 "dojo/store/Observable",
19 "dijit/registry",
20 "dojo/parser",
21 "dojox/mobile",
22 "dojox/mobile/compat",
23 "dojox/mobile/RoundRectStoreList"
24 ], function(Deferred, Cache, JsonRest, Memory, Observable, registry){
25 var static_data1 = [
26 { label: "LTR", icon: "../images/i-icon-1.png", moveTo: "wifi", dir: "ltr" },
27 { label: "Brightness & Wallpaper", icon: "../images/i-icon-2.png", moveTo: "bright" },
28 { label: "Picture Frame", icon: "../images/i-icon-3.png", moveTo: "picture" },
29 { label: "General", icon: "../images/i-icon-4.png", moveTo: "general", "selected": "true" },
30 { label: "Mail, Contacts, Calendars", icon: "../images/i-icon-5.png", moveTo: "wifi" },
31 { label: "Safari", icon: "../images/i-icon-6.png", moveTo: "bright" },
32 { label: "iPod", icon: "../images/i-icon-7.png", moveTo: "picture" },
33 { label: "Video", icon: "../images/i-icon-8.png", moveTo: "general" },
34 { label: "Photos", icon: "../images/i-icon-9.png", moveTo: "wifi" },
35 { label: "Store", icon: "../images/i-icon-10.png", moveTo: "bright" }
36 ];
37
38 var static_data2 = [
39 {label: "Apple", moveTo: "dummy"},
40 {label: "LTR", moveTo: "dummy", dir: "ltr"},
41 {label: "Cherry", moveTo: "dummy"},
42 {label: "Grape", moveTo: "dummy"},
43 {label: "Kiwi", moveTo: "dummy"},
44 {label: "Lemon", moveTo: "dummy"},
45 {label: "Melon", moveTo: "dummy"},
46 {label: "Orange", moveTo: "dummy"},
47 {label: "Peach", moveTo: "dummy"}
48 ];
49 store1 = Observable(new Memory({idProperty:"label", data: static_data1}));
50 store2 = Observable(new Memory({idProperty:"label", data: static_data2}));
51 store1.__counter = store2.__counter = 1;
52 store = store1;
53
54 // switch to the selected store
55 switchTo = function(store){
56 window.store = store;
57 registry.byId("list").setStore(store);
58 };
59 // add a new item
60 add1 = function(){
61 store.add({
62 label: "New Item "+(store.__counter++),
63 icon: "../images/i-icon-1.png",
64 moveTo: "dummy"
65 });
66 };
67 // delete the added item
68 delete1 = function(){
69 if(store.__counter > 1){
70 store.remove("New Item "+(--store.__counter));
71 }
72 };
73 });
74 </script>
75 </head>
76 <body style="visibility:hidden;">
77 <div data-dojo-type="dojox.mobile.View" dir="rtl">
78 <h1 data-dojo-type="dojox.mobile.Heading">RoundRectStoreList RTL</h1>
79 <ul data-dojo-type="dojox.mobile.RoundRectStoreList" id="list" data-dojo-props='store:store, query:{}'></ul>
80 <p>show the different set:<br>
81 <input type="button" value="Set1" onclick="switchTo(store1)">
82 <input type="button" value="Set2" onclick="switchTo(store2)">
83 <p>alter the object store:<br>
84 <input type="button" value="Add" onclick="add1()">
85 <input type="button" value="Delete" onclick="delete1()">
86 </div>
87 </body>
88 </html>