source: Dev/trunk/src/client/dojox/mobile/tests/test_ProgressIndicator.html

Last change on this file was 483, checked in by hendrikvanantwerpen, 11 years ago

Added Dojo 1.9.3 release.

File size: 2.9 KB
Line 
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>Progress Indicator</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"></script>
11
12        <script type="text/javascript">
13                require([
14                        "dojo/_base/declare",
15                        "dojo/dom",
16                        "dojox/mobile/parser",
17                        "dojox/mobile/ProgressIndicator",
18                        "dojox/mobile",
19                        "dojox/mobile/bookmarkable",
20                        "dojox/mobile/compat"
21                ], function(declare, dom, parser, ProgressIndicator){
22                        function loadPage(moveTo){
23                                if(!(moveTo.match(/#(\w+)/))){ return; }
24                                moveTo.match(/#(\w+)(.*)/);
25                                var id = RegExp.$1;
26                                var param = RegExp.$2;
27                                if(!param){ return; }
28                                var container = dom.byId(id);
29                                container.innerHTML = "";
30                                var prog = ProgressIndicator.getInstance();
31                                container.appendChild(prog.domNode);
32                                prog.start();
33                                setTimeout(function(){ // network latency simulation
34                                        prog.stop();
35                                        container.innerHTML = '<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props=\'back:"Home", moveTo:"#home"\'>'+param+'</h1>\n'+param;
36                                        parser.parse(container);
37                                }, 5000);
38                        }
39                        dojox.mobile.ViewEx = declare(
40                                "dojox.mobile.ViewEx",
41                                dojox.mobile.View,
42                        {
43                                onStartView: function(){
44                                        loadPage(location.hash);
45                                },
46                                onBeforeTransitionIn: function(moveTo, dir, transition, context, method){
47                                        loadPage("#"+moveTo);
48                                }
49                        });
50                });
51        </script>
52</head>
53<body style="visibility:hidden;">
54        <div id="home" data-dojo-type="dojox.mobile.View" data-dojo-props='selected:true'>
55                <h1 data-dojo-type="dojox.mobile.Heading">Progress Indicator</h1>
56                <h2 data-dojo-type="dojox.mobile.RoundRectCategory">External Documents</h2>
57                <ul data-dojo-type="dojox.mobile.RoundRectList">
58                        <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"images/i-icon-1.png", moveTo:"#view2?myParam=0001"'>
59                                Document 0001
60                        </li>
61                        <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"images/i-icon-2.png", moveTo:"#view2?myParam=0002"'>
62                                Document 0002
63                        </li>
64                        <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"images/i-icon-3.png", moveTo:"#view2?myParam=0003"'>
65                                Document 0003
66                        </li>
67                </ul>
68                <div data-dojo-type="dojox.mobile.RoundRect">
69                        A progress indicator shows up about 5 seconds before a view content is displayed.
70                        After you move to other views, you should also be able to navigate through the views with browser's back and forward buttons. Also, views should be bookmarkable. Note that you can pass parameters (e.g. ?myParam=001) to a destination view.
71                </div>
72        </div>
73
74        <div id="view2" data-dojo-type="dojox.mobile.ViewEx"></div>
75</body>
76</html>
Note: See TracBrowser for help on using the repository browser.