Ticket #6739: test_Dialog.html

File test_Dialog.html, 2.4 kB (added by bill, 8 months ago)

the onclick works, the a/href doesn't...

Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2                "http://www.w3.org/TR/html4/strict.dtd">
3<html>
4<head>
5        <title>Dialog Widget Dojo Tests</title>
6
7        <style type="text/css">
8                @import "../../dojo/resources/dojo.css";
9                @import "css/dijitTests.css";
10
11                body { font-family : sans-serif; }
12                form { margin-bottom : 0; }
13                table { border: none; }
14                #dialog3_underlay { background-color: #027 }
15                #reallyWide { width:2222px; }
16        </style>               
17
18        <!-- required: a default dijit theme: -->
19        <link id="themeStyles" rel="stylesheet" href="../../dijit/themes/tundra/tundra.css" />
20       
21        <!-- required: dojo.js -->
22        <script type="text/javascript" src="../../dojo/dojo.js"
23                djConfig="parseOnLoad: true, isDebug: true"></script>
24       
25        <!-- not needed, for testing alternate themes -->
26        <script type="text/javascript" src="_testCommon.js"></script>
27
28
29        <script type="text/javascript">
30                dojo.require("dijit.Dialog");
31                dojo.require("dijit.form.Button");
32                dojo.require("dijit.form.TextBox");
33                dojo.require("dijit.form.DateTextBox");
34                dojo.require("dijit.form.TimeTextBox");
35                dojo.require("dijit.form.FilteringSelect");
36                dojo.require("dijit.layout.TabContainer");
37                dojo.require("dijit.Menu");
38                dojo.require("dojo.parser");    // scan page for widgets and instantiate them                   
39
40                // create a do nothing, only for test widget
41                dojo.declare("dijit.TestWidget",
42                        [dijit._Widget, dijit._Templated], {
43                        templateString: "<div style='margin: 10px; border: inset #700 4px; padding: 5px;' dojoAttachPoint='containerNode'></div>"
44                });
45
46                // make dojo.toJson() print dates correctly (this feels a bit dirty)
47                Date.prototype.json = function(){ return dojo.date.stamp.toISOString(this, {selector: 'date'});};
48
49                var thirdDlg;
50                function createDialog() {
51                        if(!thirdDlg){ 
52                                var pane = dojo.byId('thirdDialog');
53                                pane.style.width = "300px";     
54                                thirdDlg = new dijit.Dialog({
55                                        id: "dialog3",
56                                        refocus:false,
57                                        title: "Programatic Dialog Creation"
58                                },pane);
59                        }
60                        setTimeout(function(){thirdDlg.show();},"3000");
61                }
62
63                //var invite;
64                dojo.addOnLoad(function() {
65                        invite = new dijit.Dialog({title: "TEST"}, dojo.byId('dialogTest'));
66                });
67
68        </script>
69</head>
70<body class="tundra">
71       
72        <h1 class="testTitle">Dijit layout.Dialog tests</h1>
73
74    <a href="javascript:invite.show()" style="font-weight:bold;">Open Dialog via href</a>
75    <button onclick="javascript:invite.show()" style="font-weight:bold;">Open dialog via onclick</button>
76 
77        <div id="dialogTest"></div>
78     
79
80
81
82</body>
83</html>