r9761: Move initial widget setup to desktop library. Now, just by including
[kai/samba.git] / swat / desktop / index.esp
index 833ed08bbad2493384aaf6a1df416158f3bcf77e..21ca766f590a6023cce4c1d07f9cd8dd3bffcea5 100644 (file)
@@ -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()
 {