source: Dev/trunk/src/client/dojox/widget/tests/test_Standby_quirks.html

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

Added Dojo 1.9.3 release.

  • Property svn:executable set to *
File size: 18.8 KB
Line 
1<html>
2<head>
3        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4        <title>Testing the Standby widget</title>
5        <style type="text/css">
6                @import "../../../dijit/themes/soria/soria.css";
7                @import "../../../dijit/tests/css/dijitTests.css";
8                @import "../../../dojox/grid/resources/soriaGrid.css";
9
10                .curvedClass {
11                        background-color: darkblue;
12                        width: 250px;
13                        height: 250px;
14                        -moz-border-radius: 15px 15px 15px 15px;
15                        -webkit-border-radius: 15px;"       
16                }
17        </style>
18       
19        <script type="text/javascript" src="../../../dojo/dojo.js" data-dojo-config="parseOnLoad:true, isDebug: true"></script>
20
21        <script type="text/javascript">
22                dojo.require("dojox.widget.Standby");
23                dojo.require("dijit.form.Button");
24                dojo.require("dijit.Tree");
25                dojo.require("dijit.tree.ForestStoreModel");
26                dojo.require("dijit.Dialog");
27                dojo.require("dojox.grid.DataGrid");
28                dojo.require("dojo.data.ItemFileReadStore");
29
30                var connects = [];
31
32                function init() {
33                        var button1 = dijit.byId("overlay1Button1");
34                        var button2 = dijit.byId("overlay1Button2");
35                        var overlay1= dijit.byId("standby1");
36                        connects.push(dojo.connect(button1, "onClick", function(){overlay1.show()}));
37                        connects.push(dojo.connect(button2, "onClick", function(){overlay1.hide()}));
38
39                        var button3 = dijit.byId("overlay2Button1");
40                        var button4 = dijit.byId("overlay2Button2");
41                        var overlay2= dijit.byId("standby2");
42                        connects.push(dojo.connect(button3, "onClick", function(){overlay2.show()}));
43                        connects.push(dojo.connect(button4, "onClick", function(){overlay2.hide()}));
44
45                        var button5 = dijit.byId("overlay3Button1");
46                        var button6 = dijit.byId("overlay3Button2");
47                        var overlay3= dijit.byId("standby3");
48                        connects.push(dojo.connect(button5, "onClick", function(){overlay3.show()}));
49                        connects.push(dojo.connect(button6, "onClick", function(){overlay3.hide()}));
50
51                        var button7 = dijit.byId("overlay4Button1");
52                        var button8 = dijit.byId("overlay4Button2");
53                        var overlay4= dijit.byId("standby4");
54                        connects.push(dojo.connect(button7, "onClick", function(){overlay4.show()}));
55                        connects.push(dojo.connect(button8, "onClick", function(){overlay4.hide()}));
56
57                        var button9 = dijit.byId("overlay5Button1");
58                        var button10 = dijit.byId("overlay5Button2");
59                        var overlay5= dijit.byId("standby5");
60                        connects.push(dojo.connect(button9, "onClick", function(){overlay5.show()}));
61                        connects.push(dojo.connect(button10, "onClick", function(){overlay5.hide()}));
62
63                        var button11 = dijit.byId("overlay6Button1");
64                        var button12 = dijit.byId("overlay6Button2");
65                        var overlay6= dijit.byId("standby6");
66                        connects.push(dojo.connect(button11, "onClick", function(){overlay6.show()}));
67                        connects.push(dojo.connect(button12, "onClick", function(){overlay6.hide()}));
68
69                        var button13 = dijit.byId("overlay7Button1");
70                        var button14 = dijit.byId("overlay7Button2");
71                        var overlay7= dijit.byId("standby7");
72                        connects.push(dojo.connect(button13, "onClick", function(){overlay7.show()}));
73                        connects.push(dojo.connect(button14, "onClick", function(){overlay7.hide()}));
74
75                        var button15 = dijit.byId("overlay8Button1");
76                        var button16 = dijit.byId("overlay8Button2");
77                        var overlay8= dijit.byId("standby8");
78                        connects.push(dojo.connect(button15, "onClick", function(){overlay8.show()}));
79                        connects.push(dojo.connect(button16, "onClick", function(){overlay8.hide()}));
80
81                        var button17 = dijit.byId("overlay9Button1");
82                        var button18 = dijit.byId("overlay9Button2");
83                        var overlay9= dijit.byId("standby9");
84                        connects.push(dojo.connect(button17, "onClick", function(){overlay9.show()}));
85                        connects.push(dojo.connect(button18, "onClick", function(){overlay9.hide()}));
86
87                        var button19 = dijit.byId("overlay10Button1");
88                        var button20 = dijit.byId("overlay10Button2");
89                        var overlay10= dijit.byId("standby10");
90                        connects.push(dojo.connect(button19, "onClick", function(){
91                                overlay10.show();
92                                var moveDiv = dojo.byId("overlayTarget10");
93                                var moveAnim = dojo.animateProperty({node: moveDiv, properties: {marginLeft: {start: 0, end: 300}}});
94                                moveAnim.play();
95                        }));
96                        connects.push(dojo.connect(button20, "onClick", function(){
97                                var moveDiv = dojo.byId("overlayTarget10");
98                                var moveAnim = dojo.animateProperty({node: moveDiv, properties: {marginLeft: {start: 300, end: 0}}, onEnd: function(){overlay10.hide()}});
99                                moveAnim.play();
100                        }));
101
102                        var button21 = dijit.byId("overlay11Button1");
103                        var button22 = dijit.byId("overlay11Button2");
104                        var overlay11= dijit.byId("standby11");
105                        connects.push(dojo.connect(button21, "onClick", function(){overlay11.show()}));
106                        connects.push(dojo.connect(button22, "onClick", function(){overlay11.hide()}));
107                       
108                        var button23 = dijit.byId("overlay12Button1");
109                        var button24 = dijit.byId("overlay12Button2");
110                        var overlay12= dijit.byId("standby12");
111                        connects.push(dojo.connect(button23, "onClick", function(){overlay12.show()}));
112                        connects.push(dojo.connect(button24, "onClick", function(){overlay12.hide()}));
113
114                        var button25 = dijit.byId("overlay13Button1");
115                        var button26 = dijit.byId("overlay13Button2");
116                        var overlay13= dijit.byId("standby13");
117                        connects.push(dojo.connect(button25, "onClick", function(){overlay13.show()}));
118                        connects.push(dojo.connect(button26, "onClick", function(){overlay13.hide()}));
119
120                        var button27 = dijit.byId("overlay14Button1");
121                        var button28 = dijit.byId("overlay14Button2");
122                        var overlay14= dijit.byId("standby14");
123                        connects.push(dojo.connect(button27, "onClick", function(){overlay14.show()}));
124                        connects.push(dojo.connect(button28, "onClick", function(){overlay14.hide()}));
125
126                        var button29 = dijit.byId("overlay15Button1");
127                        var button30 = dijit.byId("overlay15Button2");
128                        var overlay15= dijit.byId("standby15");
129                        connects.push(dojo.connect(button29, "onClick", function(){overlay15.show()}));
130                        connects.push(dojo.connect(button30, "onClick", function(){overlay15.hide()}));
131
132                        var button31 = dijit.byId("overlay16Button1");
133                        var button32 = dijit.byId("overlay16Button2");
134                        var overlay16= dijit.byId("standby16");
135                        connects.push(dojo.connect(button31, "onClick", function(){overlay16.show()}));
136                        connects.push(dojo.connect(button32, "onClick", function(){overlay16.hide()}));
137
138                        var button33 = dijit.byId("overlay17Button1");
139                        var button34 = dijit.byId("overlay17Button2");
140                        var overlay17= dijit.byId("standby17");
141                        connects.push(dojo.connect(button33, "onClick", function(){overlay17.show()}));
142                        connects.push(dojo.connect(button34, "onClick", function(){overlay17.hide()}));
143
144                        var showCount = 0;
145                        var button35 = dijit.byId("overlay18Button1");
146                        var button36 = dijit.byId("overlay18Button2");
147                        var overlay18= dijit.byId("standby18");
148                        connects.push(dojo.connect(button35, "onClick", function(){
149                                showCount++;
150                                console.log(overlay18.get("text"));
151                                overlay18.set("text", "Shown: " + showCount);
152                                overlay18.show()}));
153                        connects.push(dojo.connect(button36, "onClick", function(){overlay18.hide()}));
154
155                        var colors = ["red", "green", "gray", "black", "purple"]
156                        var cPos = 0;
157                        var button37 = dijit.byId("overlay19Button1");
158                        var button38 = dijit.byId("overlay19Button2");
159                        var overlay19= dijit.byId("standby19");
160                        connects.push(dojo.connect(button37, "onClick", function(){
161                                console.log(overlay19.get("color"));
162                                overlay19.set("color", colors[cPos]);
163                                cPos++;
164                                if(cPos === colors.length - 1){
165                                        cPos = 0;
166                                }
167                                overlay19.show()}));
168                        connects.push(dojo.connect(button38, "onClick", function(){overlay19.hide()}));
169                        dijit.byId("dialog").show();
170
171                        var button39 = dijit.byId("overlay20Button1");
172                        var overlay20= dijit.byId("standby20");
173                        connects.push(dojo.connect(button39, "onClick", function(){
174                                overlay20.show();
175                                setTimeout(function(){
176                        overlay20.hide();
177                                }, 5000);
178                        }));
179                }
180                dojo.addOnLoad(init);
181
182                //Cleanup, so I can check for leaks in the widget itself.
183                dojo.addOnUnload(function(){
184                        var i;
185                        for(i = 0; i < connects.length; i++){
186                                dojo.disconnect(connects[i]);
187                        }
188                });
189
190        </script>
191       
192</head>
193<body class="soria" id="bodyId">
194       
195        <h1 class="testTitle">dojox.widget.Standby</h1>
196
197        <h3>Testing a basic on a div contained in a scrolling div</h3>
198        <button id ="overlay14Button1" dojoType="dijit.form.Button">Click to show the standby overlay</button>
199        <br>
200        <button id ="overlay14Button2" dojoType="dijit.form.Button">Click to hide the standby overlay</button>
201        <div style="width: 250px; height: 100px; overflow: auto">
202                <br>
203                <br>
204                <br>
205                <br>
206                <br>
207        <div id ="overlayTarget14" style="width: 200px; height: 200px; background-color: darkblue;"></div>
208                <div style="width: 400px; height: 5px"></div>
209                <br>
210                <br>
211                <br>
212                <br>
213                <br>
214        </div>
215        <div id ="standby14" target="overlayTarget14" dojoType="dojox.widget.Standby"></div>
216        <hr>
217
218        <hr>
219        <h3>Testing a basic overlay</h3>
220        <button id ="overlay1Button1" dojoType="dijit.form.Button">Click to show the standby overlay</button>
221        <br>
222        <button id ="overlay1Button2" dojoType="dijit.form.Button">Click to hide the standby overlay</button>
223        <div id ="overlayTarget1" style="width: 200px; height: 100px; background-color: darkblue;"></div>
224        <div id ="standby1" target="overlayTarget1" dojoType="dojox.widget.Standby"></div>
225        <hr>
226
227
228        <h3>Testing a basic overlay on a positioned div</h3>
229        <button id ="overlay2Button1" dojoType="dijit.form.Button">Click to show the standby overlay</button>
230        <br>
231        <button id ="overlay2Button2" dojoType="dijit.form.Button">Click to hide the standby overlay</button>
232        <div id ="overlayTarget2" style="position: absolute; width: 200px; height: 100px; background-color: darkblue; top: 500px; left: 500px;"></div>
233        <div id ="standby2" target="overlayTarget2" dojoType="dojox.widget.Standby"></div>
234        <hr>
235
236        <h3>Testing a basic overlay on a dijit</h3>
237        <button id ="overlay3Button1" dojoType="dijit.form.Button">Really long button!!!!!  Click to show the standby overlay on the button.</button>
238        <br>
239        <button id ="overlay3Button2" dojoType="dijit.form.Button">Click to hide the standby overlay</button>
240        <div id ="standby3" target="overlay3Button1" dojoType="dojox.widget.Standby"></div>
241        <hr>
242
243        <h3>Testing a basic on a nested div</h3>
244        <button id ="overlay4Button1" dojoType="dijit.form.Button">Click to show the standby overlay</button>
245        <br>
246        <button id ="overlay4Button2" dojoType="dijit.form.Button">Click to hide the standby overlay</button>
247        <div><div><div><div id ="overlayTarget4" style="width: 200px; height: 100px; background-color: darkblue;"></div></div></div></div>
248        <div id ="standby4" target="overlayTarget4" dojoType="dojox.widget.Standby"></div>
249        <hr>
250
251        <h3>Testing a different image</h3>
252        <button id ="overlay5Button1" dojoType="dijit.form.Button">Click to show the standby overlay</button>
253        <br>
254        <button id ="overlay5Button2" dojoType="dijit.form.Button">Click to hide the standby overlay</button>
255        <div id ="overlayTarget5" style="width: 500px; height: 500px; background-color: darkgray;"></div>
256        <div id ="standby5" target="overlayTarget5" dojoType="dojox.widget.Standby" image="images/busy.gif"></div>
257        <hr>
258
259        <h3>Testing an overlay on a div that has curved borders (CSS styles, Firefox and Webkit (Safari), only)</h3>
260        <button id ="overlay6Button1" dojoType="dijit.form.Button">Click to show the standby overlay</button>
261        <br>
262        <button id ="overlay6Button2" dojoType="dijit.form.Button">Click to hide the standby overlay</button>
263        <div id ="overlayTarget6" style="width: 200px; height: 100px; background-color: darkblue; -moz-border-radius: 15px; -webkit-border-radius: 15px;"></div>
264        <div id ="standby6" target="overlayTarget6" dojoType="dojox.widget.Standby"></div>
265        <hr>
266
267        <h3>Testing an overlay on a div that has curved borders (CSS styles, Firefox and Webkit (Safari), only, margined to the center) and a different color for the overlay</h3>
268        <button id ="overlay7Button1" dojoType="dijit.form.Button">Click to show the standby overlay</button>
269        <br>
270        <button id ="overlay7Button2" dojoType="dijit.form.Button">Click to hide the standby overlay</button>
271        <div id ="overlayTarget7" style="width: 200px; height: 100px; background-color: darkblue; -moz-border-radius: 15px; -webkit-border-radius: 15px; margin: auto"></div>
272        <div id ="standby7" target="overlayTarget7" dojoType="dojox.widget.Standby" color="lightblue"></div>
273        <hr>
274
275
276        <h3>Testing an overlay on a grid</h3>
277        <button id ="overlay8Button1" dojoType="dijit.form.Button">Click to show the standby overlay</button>
278        <br>
279        <button id ="overlay8Button2" dojoType="dijit.form.Button">Click to hide the standby overlay</button>
280        <div data-dojo-id="ifsStore" dojoType="dojo.data.ItemFileReadStore", url="../../../dijit/tests/_data/countries.json"></div>
281        <table id ="overlayTarget8" dojoType="dojox.grid.DataGrid", style="width: 500px; height: 300px; margin: auto" store="ifsStore", query="{}">
282                <thead>
283                        <tr>
284                                <th field="name" width="300px">Country/Continent Name</th>
285                                <th field="type" width="auto">Type</th>
286                        </tr>
287                </thead>
288        </table>
289        <div id ="standby8" target="overlayTarget8" dojoType="dojox.widget.Standby"></div>
290        <hr>
291
292
293        <h3>Testing an overlay on a dijit.Tree</h3>
294        <button id ="overlay9Button1" dojoType="dijit.form.Button">Click to show the standby overlay</button>
295        <br>
296        <button id ="overlay9Button2" dojoType="dijit.form.Button">Click to hide the standby overlay</button>
297        <div data-dojo-id="ifsStore2" dojoType="dojo.data.ItemFileReadStore", url="../../../dijit/tests/_data/countries.json"></div>
298        <div dojoType="dijit.tree.ForestStoreModel" data-dojo-id="continentModel" store="ifsStore2" query="{type:'continent'}" rootId="continentRoot" rootLabel="Continents" childrenAttrs="children"></div>
299        <div id ="overlayTarget9" dojoType="dijit.Tree", style="width: 30%" model="continentModel", query="{}"></div>
300        <div id ="standby9" target="overlayTarget9" dojoType="dojox.widget.Standby"></div>
301        <hr>
302
303        <h3>Testing overlay following a div as it moves (And with some whacky margins that need to be accounted for)</h3>
304        <button id ="overlay10Button1" dojoType="dijit.form.Button">Click to show the standby overlay and move the overlayed div.</button>
305        <br>
306        <button id ="overlay10Button2" dojoType="dijit.form.Button">Click to scoot the div back and hide the standby overlay.</button>
307        <div style="width: 100%;"><div id ="overlayTarget10" style="width: 200px; height: 100px; background-color: darkblue; margin-right: 100px; margin-top: 100px; margin-bottom: 100px;"></div></div>
308        <div id ="standby10" target="overlayTarget10" dojoType="dojox.widget.Standby"></div>
309        <hr>
310
311        <h3>Testing an overlay with class set styles for curves (Firefox, safari only).</h3>
312        <button id ="overlay11Button1" dojoType="dijit.form.Button">Click to show the standby overlay</button>
313        <br>
314        <button id ="overlay11Button2" dojoType="dijit.form.Button">Click to hide the standby overlay</button>
315        <div id ="overlayTarget11" class="curvedClass"></div>
316        <div id ="standby11" target="overlayTarget11" dojoType="dojox.widget.Standby"></div>
317        <hr>
318
319        <h3>Testing a basic on a zIndex'ed div</h3>
320        <button id ="overlay13Button1" dojoType="dijit.form.Button">Click to show the standby overlay</button>
321        <br>
322        <button id ="overlay13Button2" dojoType="dijit.form.Button">Click to hide the standby overlay</button>
323        <div id ="overlayTarget13" style="width: 200px; height: 100px; background-color: darkblue; z-index: 200"></div>
324        <div id ="standby13" target="overlayTarget13" dojoType="dojox.widget.Standby"></div>
325        <hr>
326
327        <h3>Testing that this still works in a dialog after zIndex changes</h3>
328        <div dojoType="dijit.Dialog" id="dialog">
329                <button id ="overlay15Button1" dojoType="dijit.form.Button">Click to show the standby overlay</button>
330                <br>
331                <button id ="overlay15Button2" dojoType="dijit.form.Button">Click to hide the standby overlay</button>
332                <div id ="overlayTarget15" style="width: 200px; height: 100px; background-color: darkblue;"></div>
333                <div id ="standby15" target="overlayTarget15" dojoType="dojox.widget.Standby" zIndex="1000"></div>
334        </div>
335        <hr>
336
337        <h3>Testing a basic on a node, using only centered text.</h3>
338        <button id ="overlay16Button1" dojoType="dijit.form.Button">Click to show the standby overlay</button>
339        <br>
340        <button id ="overlay16Button2" dojoType="dijit.form.Button">Click to hide the standby overlay</button>
341        <div id ="overlayTarget16" style="width: 200px; height: 100px; background-color: darkblue;"></div>
342        <div id ="standby16" target="overlayTarget16" dojoType="dojox.widget.Standby" centerIndicator="text"></div>
343        <hr>
344
345        <h3>Testing a basic on a node, using only centered text that was customized.</h3>
346        <button id ="overlay17Button1" dojoType="dijit.form.Button">Click to show the standby overlay</button>
347        <br>
348        <button id ="overlay17Button2" dojoType="dijit.form.Button">Click to hide the standby overlay</button>
349        <div id ="overlayTarget17" style="width: 200px; height: 100px; background-color: darkblue;"></div>
350        <div id ="standby17" target="overlayTarget17" dojoType="dojox.widget.Standby" centerIndicator="text" text="&lt;span style='color: red; font-weight: bold; font-style: italic;'>WAIT, FOO!&lt;/span>"></div>
351        <hr>
352
353        <h3>Testing a basic on a node, using only centered text that is changed with each display.</h3>
354        <button id ="overlay18Button1" dojoType="dijit.form.Button">Click to show the standby overlay</button>
355        <br>
356        <button id ="overlay18Button2" dojoType="dijit.form.Button">Click to hide the standby overlay</button>
357        <div id ="overlayTarget18" style="width: 200px; height: 100px; background-color: darkblue;"></div>
358        <div id ="standby18" target="overlayTarget18" dojoType="dojox.widget.Standby" centerIndicator="text" text="&lt;span style='color: red; font-weight: bold; font-style: italic;'>WAIT, FOO!&lt;/span>"></div>
359        <hr>
360
361        <h3>Testing a basic on a node, using only centered text, and with a background color that changes with each show</h3>
362        <button id ="overlay19Button1" dojoType="dijit.form.Button">Click to show the standby overlay</button>
363        <br>
364        <button id ="overlay19Button2" dojoType="dijit.form.Button">Click to hide the standby overlay</button>
365        <div id ="overlayTarget19" style="width: 200px; height: 100px; background-color: darkblue;"></div>
366        <div id ="standby19" target="overlayTarget19" dojoType="dojox.widget.Standby" centerIndicator="text" text="&lt;span style='color: red; font-weight: bold; font-style: italic;'&gt;Watch Background&lt;/span&gt;"></div>
367        <hr>
368
369        <h3>Testing the widget in a relatively positioned block.  This has caused problems, verifying the fix of reparenting to document.body works.</h3>
370        <button id ="overlay12Button1" dojoType="dijit.form.Button">Click to show the standby overlay</button>
371        <br>
372        <button id ="overlay12Button2" dojoType="dijit.form.Button">Click to hide the standby overlay</button>
373        <div style="position: relative; top: 50px; left: 50px;">
374                <div id ="overlayTarget12" class="curvedClass"></div>
375                <div id ="standby12" target="overlayTarget12" dojoType="dojox.widget.Standby"></div>
376        </div>       
377
378        <br>
379        <br>
380        <br>
381        <h3>Testing an overlay of the entire document body.</h3>
382        <button id ="overlay20Button1" dojoType="dijit.form.Button">Click to show the standby overlay on body for 5 seconds!</button>
383        <div id ="standby20" target="bodyId" dojoType="dojox.widget.Standby"></div>
384
385</body>
386</html>
Note: See TracBrowser for help on using the repository browser.