3 page_header("desktop", "Virtual Desktop Design Test", "desktop");
6 <script type="text/javascript" src="/scripting/client/encoder.js"></script>
7 <script type="text/javascript" src="/scripting/client/call.js"></script>
8 <script type="text/javascript" src="/scripting/client/js_scripts.js"></script>
9 <script type="text/javascript" src="/scripting/client/desktop.js"></script>
10 <script type="text/javascript" src="/scripting/client/status.js"></script>
11 <script type="text/javascript" src="/scripting/client/regedit.js"></script>
13 <script type="text/javascript">
15 function showMessage(m)
17 var message = new QxWindow();
22 setShowMaximize(false);
23 setShowMinimize(false);
26 var note = new QxAtom(m);
32 var ok = new QxButton("OK");
37 ok.addEventListener("click", function() {
44 message.setVisible(true);
49 var blank = new Window.standard('SWAT');
51 blank.setVisible(true);
56 document.js.add('/scripting/client/regedit.js');
58 var regWin = new QxWindow("Registry Editor");
59 regWin._onclosebuttonclick = function(e)
63 document.js.remove('/scripting/client/regedit.js');
72 var regedit = regedit_widget("ncalrpc:");
75 regWin.setVisible('true');
78 function clientContextMenu(e)
80 var aboutCmd = new QxCommand();
81 aboutCmd.addEventListener("execute", function() {
82 showMessage("SWAT, the Samba Web Administration Tool.<br/>This tool is currently under development.");
85 var newWin = new QxCommand();
86 newWin.addEventListener("execute", blankW);
88 var cmenu = new QxMenu;
90 var sub1 = new QxMenuButton("About SWAT", null, aboutCmd);
91 var sep = new QxMenuSeparator();
92 var sub2 = new QxMenuButton("New Window", null, newWin);
94 cmenu.add(sub1, sep, sub2);
96 cmenu.setLeft(e.getClientX());
97 cmenu.setTop(e.getClientY());
99 cmenu.setVisible(true);
102 function windowContextMenu(t, e)
104 var WinWin = new QxCommand();
105 WinWin.addEventListener("execute", function() {
106 var blank = new QxWindow();
108 blank.setVisible(true);
111 var inset = new QxMenu;
112 var sub1 = new QxMenuButton("Open window in a window", null, WinWin);
117 inset.setVisible(true);
122 var sMenu = new QxMenu;
128 var srvMenu = new QxMenu;
129 var srv1 = new QxMenuButton("LDAP Server", null);
130 var srv2 = new QxMenuButton("CDAP Server", null);
131 var srv3 = new QxMenuButton("RPC Server", null);
132 var srv4 = new QxMenuButton("NBT Server", null);
133 var srv5 = new QxMenuButton("WINS Server", null);
134 var srv6 = new QxMenuButton("Kerberos Server", null);
135 srvMenu.add(srv1, srv2, srv3, srv4, srv5, srv6);
137 srvMenu.setVisible(false);
139 var editReg = new QxCommand;
140 editReg.addEventListener("execute", function() {
144 var espMenu = new QxMenu;
145 var esp1 = new QxMenuButton("Registry Editor", null, editReg);
148 espMenu.setVisible(false);
150 var opt1 = new QxMenuButton("Servers", null)
151 opt1.addEventListener("mouseover", function() {
152 srvMenu.setVisible(true);
153 srvMenu.setLeft(this.getComputedPageBoxRight() + 4);
154 srvMenu.setTop(this.getComputedPageBoxTop() - 3);
155 if (espMenu.getVisible()) {
156 espMenu.setVisible(false);
157 } else if (newMenu.getVisible()) {
158 newMenu.setVisible(false);
162 var openWin = new QxCommand;
163 openWin.addEventListener("execute", function() {
167 var newMenu = new QxMenu;
168 var new1 = new QxMenuButton("Window", null, openWin);
171 newMenu.setVisible(false);
173 var opt2 = new QxMenuButton("Installation", null);
174 var opt3 = new QxMenuButton("Configuration", null);
175 var opt4 = new QxMenuButton("ESP Tests", null);
176 opt4.addEventListener("mouseover", function() {
177 espMenu.setVisible(true);
178 espMenu.setLeft(this.getComputedPageBoxRight() + 4);
179 espMenu.setTop(this.getComputedPageBoxTop() - 3);
180 if (srvMenu.getVisible()) {
181 srvMenu.setVisible(false);
182 } else if (newMenu.getVisible()) {
183 newMenu.setVisible(false);
186 var opt5 = new QxMenuButton("Documentation", null);
187 var opt6 = new QxMenuButton("New", null);
188 opt6.addEventListener("mouseover", function() {
189 newMenu.setVisible(true);
190 newMenu.setLeft(this.getComputedPageBoxRight() + 4);
191 newMenu.setTop(this.getComputedPageBoxTop() - 3);
192 if (srvMenu.getVisible()) {
193 srvMenu.setVisible(false);
194 } else if (espMenu.getVisible()) {
195 espMenu.setVisible(false);
198 var sep1 = new QxMenuSeparator();
199 var sep2 = new QxMenuSeparator();
201 sMenu.add(opt1, opt2, opt3, sep1, opt4, sep2, opt5, opt6);
203 sMenu.setTop(docY() - 150);
205 sMenu.setVisible(true);
208 function contextMenu(e)
210 var t = e.getTarget()
211 var tObj = t.getHtmlAttribute("class")
213 if (tObj == 'QxClientDocument QxThemeWin9x') {
214 clientContextMenu(e);
215 } else if (tObj == 'QxWindowPane') {
216 windowContextMenu(t, e);
220 window.application.main = function()
222 doc = this.getClientWindow().getClientDocument();
223 doc.addEventListener("contextmenu", contextMenu);
225 var bar = new QxMenuBar;
231 setBackgroundColor("ThreeDFace");
234 var start = new QxMenuButton("START");
235 start.addEventListener("click", function() {
242 // Always open with stats
243 var win = new QxWindow();
244 document.js.add('/scripting/client/status.js');
245 win._onclosebuttonclick = function(e)
249 document.js.remove('/scripting/client/status.js');
257 getServerStatus(win);