-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWindow.html
More file actions
102 lines (77 loc) · 2.73 KB
/
Window.html
File metadata and controls
102 lines (77 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Window Demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link href="../style.css" rel="stylesheet" type="text/css" />
<!-- JavaXT Includes -->
<script type="text/javascript" src="../../src/window/Window.js"></script>
<script type="text/javascript" src="../../src/utils/Utils.js"></script>
</head>
<body>
<h1>Window Demos</h1>
<h2>Modal Pop-up Window</h2>
<p>Simple modal pop-up window </p>
<input type="button" value="Open" onclick="demo1()"></input>
<script type="text/javascript">
var win;
var demo1 = function() {
if (!win){
var body = document.getElementsByTagName("body")[0];
win = new javaxt.dhtml.Window(body, {
width: 400,
height: 100,
modal: true,
valign: "top",
title: "Demo 1",
body: "Drag me! Grab the header and move me around."
});
}
win.show();
};
</script>
<!--
<h2>Simple Pop-up Window</h2>
<p>Simple pop-up window initialized using contents of an existing element.</p>
<div style="height: 50px;width: 150px;background-color: aliceblue;border: 1px solid #a4d5ff;padding: 7px;margin: 15px 0;">
<div id="msg">Hello World!</div>
</div>
<input type="button" value="Open" onclick="demo2()"></input>
<script type="text/javascript">
var win2;
var demo2 = function() {
var msg = document.getElementById("msg");
var msgContainer = msg.parentNode;
if (!win2){
var body = document.getElementsByTagName("body")[0];
var win2 = new javaxt.dhtml.Window(body, {
width: 300,
height: 100,
title: "Demo 2",
body: msg
});
win2.onClose = function(){
msgContainer.appendChild(msg);
};
}
var rect = javaxt.dhtml.utils.getRect(msgContainer);
win2.showAt(rect.right+25, rect.top);
};
</script>
-->
<h2>Pop-up Inside Div</h2>
<p>So far we've seen windows opened inside the browser window.
The following will constrain the window inside a specific div.</p>
<div id="div-test" style="height: 600px;width: 700px;background-color: aliceblue;border: 1px solid #a4d5ff;"></div>
<script type="text/javascript">
new javaxt.dhtml.Window("div-test", {
width: 300,
height: 100,
closable: false,
title: "Demo 3"
}).show();
</script>
</body>
</html>