summaryrefslogtreecommitdiffstats
path: root/swat
diff options
context:
space:
mode:
authorDeryck Hodge <deryck@samba.org>2005-08-22 03:38:31 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:34:19 -0500
commit8005114fda2f19e4f96fcb38613c8e67a945f7b2 (patch)
tree550c2787fb248e2105e07de90af2c58eed89569c /swat
parentf35e72d9caed80accb337be2b120c731d683fc5f (diff)
downloadsamba-8005114fda2f19e4f96fcb38613c8e67a945f7b2.tar.gz
samba-8005114fda2f19e4f96fcb38613c8e67a945f7b2.tar.xz
samba-8005114fda2f19e4f96fcb38613c8e67a945f7b2.zip
r9469: Add a right-click menu to the SWAT desktop.
This includes a generic showMessage() for opening a dialog window to the user. Next is a start menu, and then I'll move on to more practical functionality... user manager, server config, etc. deryck (This used to be commit eeacd73ef2da16337f2968aec86f9f9313085c25)
Diffstat (limited to 'swat')
-rw-r--r--swat/desktop/index.esp59
1 files changed, 57 insertions, 2 deletions
diff --git a/swat/desktop/index.esp b/swat/desktop/index.esp
index aeded6ed475..e45a099156a 100644
--- a/swat/desktop/index.esp
+++ b/swat/desktop/index.esp
@@ -38,6 +38,60 @@ function docHeight()
return y;
}
+function showMessage(m)
+{
+ var message = new QxWindow();
+ with(message) {
+ setWidth(300);
+ setTop("35%");
+ setLeft("35%");
+ setShowMaximize(false);
+ setShowMinimize(false);
+ }
+
+ var note = new QxAtom(m);
+ with(note) {
+ setTop(10);
+ setLeft(10);
+ }
+
+ var ok = new QxButton("OK");
+ with(ok) {
+ setLeft("42%");
+ setBottom(2);
+ }
+ ok.addEventListener("click", function() {
+ w.remove(message);
+ });
+
+ message.add(note);
+ message.add(ok);
+ w.add(message);
+ message.setVisible(true);
+}
+
+function showContextMenu(e)
+{
+
+ var aboutCmd = new QxCommand();
+ aboutCmd.addEventListener("execute", function() {
+ showMessage("SWAT, the Samba Web Administration Tool.<br/>This tool is currently under development.");
+ });
+
+ var menu = new QxMenu;
+
+ var sub1 = new QxMenuButton("About SWAT", null, aboutCmd);
+ var sep = new QxMenuSeparator();
+ var sub2 = new QxMenuButton("More menu later...", null);
+
+ menu.add(sub1, sep, sub2);
+
+ menu.setLeft(e.getClientX());
+ menu.setTop(e.getClientY());
+ w.add(menu);
+ menu.setVisible(true);
+}
+
/*** init the page for qooxdoo ***/
window.application.main = function()
{
@@ -50,14 +104,15 @@ window.application.main = function()
setWidth(docWidth());
setHeight(docHeight());
}
+ doc.addEventListener("contextmenu", showContextMenu);
doc.add(w);
}
window.onresize = function()
{
- w.setWidth(docWidth());
- w.setHeight(docHeight());
+ w.setWidth(docWidth());
+ w.setHeight(docHeight());
}
function showReg()