Permalink
Fetching contributors…
Cannot retrieve contributors at this time
118 lines (77 sloc) 2.46 KB
<!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>