diff options
-rw-r--r-- | swat/desktop/index.esp | 50 | ||||
-rw-r--r-- | swat/scripting/client/desktop.js | 23 |
2 files changed, 37 insertions, 36 deletions
diff --git a/swat/desktop/index.esp b/swat/desktop/index.esp index 833ed08bba..21ca766f59 100644 --- a/swat/desktop/index.esp +++ b/swat/desktop/index.esp @@ -7,6 +7,7 @@ libinclude("base.js"); <script type="text/javascript" src="/scripting/client/call.js"></script> <script type="text/javascript" src="/scripting/client/js_scripts.js"></script> <script type="text/javascript" src="/scripting/client/desktop.js"></script> +<script type="text/javascript" src="/scripting/client/status.js"></script> <script type="text/javascript"> @@ -73,45 +74,22 @@ function showContextMenu(e) cmenu.setVisible(true); } -/*** init the page for qooxdoo ***/ +// Always open with stats +var win = new QxWindow(); document.js.add('/scripting/client/status.js'); -window.application.main = function() +win._onclosebuttonclick = function(e) { - var doc = this.getClientWindow().getClientDocument(); - // Don't declare local with var - w = new QxWidget(); - with(w) { - setTop(0); - setLeft(0); - setWidth(docX()); - setHeight(docY()); - } - doc.addEventListener("contextmenu", showContextMenu); - doc.add(w); - - - // Always open with stats - var win = new QxWindow(); - win._onclosebuttonclick = function(e) - { - this.close(); - e.stopPropagation(); - document.js.remove('/scripting/client/status.js'); - }; - with(win) { - setTop(50); - setRight(50); - setHeight(175); - } - w.add(win); - getServerStatus(win); -} - -window.onresize = function() -{ - w.setWidth(docX()); - w.setHeight(docY()); + this.close(); + e.stopPropagation(); + document.js.remove('/scripting/client/status.js'); +}; +with(win) { + setTop(50); + setRight(50); + setHeight(175); } +w.add(win); +getServerStatus(win); function showReg() { diff --git a/swat/scripting/client/desktop.js b/swat/scripting/client/desktop.js index 563af4907f..b1c77dc613 100644 --- a/swat/scripting/client/desktop.js +++ b/swat/scripting/client/desktop.js @@ -6,6 +6,15 @@ */ +// The global widget we attach everything to +var w = new QxWidget(); +with(w) { + setTop(0); + setLeft(0); + setWidth(docX()); + setHeight(docY()); +} + /* Qooxdoo's browser sniffer doesn't distinguish IE version. We'll cover IE 6 for now, but these checks need to be revisited for fuller browser coverage. */ @@ -139,3 +148,17 @@ function LargeWindow(h, src) Window.small = SmallWindow; Window.standard = StandardWindow; Window.large = LargeWindow; + +window.application.main = function() +{ + var doc = this.getClientWindow().getClientDocument(); + doc.addEventListener("contextmenu", showContextMenu); + doc.add(w); +} + +window.onresize = function() +{ + w.setWidth(docX()); + w.setHeight(docY()); +} + |