-
Notifications
You must be signed in to change notification settings - Fork 9
/
bootstrap.html
117 lines (77 loc) · 2.46 KB
/
bootstrap.html
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>bootstrapper</title>
<script src="vendors/air/AIRAliases.js" type="text/javascript" charset="utf-8"></script>
<script src="spazcore/spazcore-air.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
sc.setDumpLevel(5);
var WinManager = function() {
var defaults = {
id : sch.UUID(),
width : 350,
height : 580,
x : 150,
y : 150,
inituserid : null
};
this.winSettings = [];
this.openWindows = [];
this.prefs = {};
this.init = function() {
// this.prefs = new SpazPrefs();
};
this.buildWindows = function() {
};
this.openWindow = function(opts) {
sch.debug(defaults);
opts = sch.defaults(defaults);
sch.debug(opts);
var winopts = new air.NativeWindowInitOptions();
winopts.maximizable = true;
winopts.minimizable = true;
winopts.resizable = true;
winopts.systemChrome = 'none';
winopts.transparent = true;
winopts.type = air.NativeWindowType.NORMAL;
air.trace(sch.enJSON([opts.x,opts.y,opts.width,opts.height]));
var windowBounds = new air.Rectangle(opts.x,opts.y,opts.width,opts.height);
var newHTMLLoader = air.HTMLLoader.createRootWindow(true, winopts, true, windowBounds);
// map the new window's opener property to this window
newHTMLLoader.window.opener = window;
newHTMLLoader.window._spazwin = {
'id':opts.id,
'inituserid':opts.inituserid,
'winMan':this
}
newHTMLLoader.load(new air.URLRequest("index.html"));
this.openWindows.push(newHTMLLoader);
};
this.closeWindow = function(id) {
};
this.addNewWindow = function(opts) {
opts = sch.defaults(this.defaults);
this.winSettings.push(opts);
};
this.loadWinPrefs = function() {
};
this.saveWinPrefs = function() {
};
this.getSettingsForWin = function(id) {
for (var i=0; i < this.winSettings.length; i++) {
if (this.winSettings[i].id === id) {
return this.winSettings[i]
}
};
return null;
}
}
var winMan = new WinManager();
winMan.openWindow();
</script>
</head>
<body>
</body>
</html>