| 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <meta http-equiv="Content-type" content="text/html; charset=utf-8"/> |
| 5 | <meta name="viewport" |
| 6 | content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/> |
| 7 | <meta name="apple-mobile-web-app-capable" content="yes"/> |
| 8 | <title>Simple Dialog Test</title> |
| 9 | |
| 10 | <link href="../../themes/common/domButtons.css" rel="stylesheet"/> |
| 11 | <script type="text/javascript" src="../../deviceTheme.js" |
| 12 | data-dojo-config="'dojo-bidi': true, mblThemeFiles: ['base','SimpleDialog','TextBox','Button','Slider']"></script> |
| 13 | <script type="text/javascript" src="../../../../dojo/dojo.js" |
| 14 | data-dojo-config="async: true, parseOnLoad: true, has: {'dojo-bidi':true}"></script> |
| 15 | |
| 16 | <script type="text/javascript"> |
| 17 | require([ |
| 18 | "dojo/dom", |
| 19 | "dijit/registry", |
| 20 | "dojox/mobile/ProgressIndicator", |
| 21 | "dojo/parser", |
| 22 | "dojox/mobile", |
| 23 | "dojox/mobile/compat", |
| 24 | "dojox/mobile/SimpleDialog", |
| 25 | "dojox/mobile/TextBox", |
| 26 | "dojox/mobile/Button", |
| 27 | "dojox/mobile/Slider" |
| 28 | ], function(dom, registry, ProgressIndicator){ |
| 29 | show = function(dlg){ |
| 30 | registry.byId(dlg).show(); |
| 31 | } |
| 32 | hide = function(dlg){ |
| 33 | registry.byId(dlg).hide(); |
| 34 | } |
| 35 | var prog; |
| 36 | show_progress_indicator = function(dlg, cont){ |
| 37 | show(dlg); |
| 38 | var container = dom.byId(cont); |
| 39 | prog = ProgressIndicator.getInstance({dir:"rtl"}); |
| 40 | container.appendChild(prog.domNode); |
| 41 | prog.start(); |
| 42 | setTimeout(function(){ |
| 43 | hide_progress_indicator(dlg); |
| 44 | }, 5000); |
| 45 | } |
| 46 | hide_progress_indicator = function(dlg){ |
| 47 | prog.stop(); |
| 48 | hide(dlg); |
| 49 | } |
| 50 | }); |
| 51 | |
| 52 | </script> |
| 53 | |
| 54 | <style> |
| 55 | .mblSimpleDialog .mblProgressIndicator { |
| 56 | position: relative; |
| 57 | margin: 14px 0 7px; |
| 58 | top: 0; |
| 59 | } |
| 60 | </style> |
| 61 | </head> |
| 62 | <body style="visibility:hidden;"> |
| 63 | |
| 64 | <div dir="rtl" id="dlg_progress" data-dojo-type="dojox.mobile.SimpleDialog"> |
| 65 | <div class="mblSimpleDialogText">Please wait for 5 seconds.</div> |
| 66 | <div class="mblSimpleDialogText" id="progress_indicator_container"></div> |
| 67 | <button data-dojo-type="dojox.mobile.Button" class="mblSimpleDialogButton mblRedButton" |
| 68 | onclick="hide_progress_indicator('dlg_progress')">Cancel |
| 69 | </button> |
| 70 | </div> |
| 71 | |
| 72 | <div data-dojo-type="dojox.mobile.RoundRect" data-dojo-props='shadow:true'> |
| 73 | Progress Indicator |
| 74 | <button onclick="show_progress_indicator('dlg_progress','progress_indicator_container')">Show Dialog</button> |
| 75 | </div> |
| 76 | |
| 77 | |
| 78 | </body> |
| 79 | </html> |