summaryrefslogtreecommitdiff
path: root/swat/desktop
diff options
context:
space:
mode:
authorDeryck Hodge <deryck@samba.org>2005-08-19 12:02:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:33:34 -0500
commitd9c4ff9ef044b04ec52cea99b8005e71f632ce3e (patch)
tree6a967c96c956cbc3e7e019e5c087bb5e85ab9e06 /swat/desktop
parentbfe1ea62446594885a027d13fc9caa29b17793ad (diff)
downloadsamba-d9c4ff9ef044b04ec52cea99b8005e71f632ce3e.tar.gz
samba-d9c4ff9ef044b04ec52cea99b8005e71f632ce3e.tar.bz2
samba-d9c4ff9ef044b04ec52cea99b8005e71f632ce3e.zip
r9397: Playing with qooxdoo a bit and saving my work, so I
can get to it later today at work. Not much to see yet, and not linked to from SWAT yet. Playing with the idea of a web-based desktop, and just seeing how widgets can be used. deryck (This used to be commit 435467f90d809899c3d0efeaf991fb659d97202d)
Diffstat (limited to 'swat/desktop')
-rw-r--r--swat/desktop/index.esp168
1 files changed, 168 insertions, 0 deletions
diff --git a/swat/desktop/index.esp b/swat/desktop/index.esp
new file mode 100644
index 0000000000..8fe45ed4a0
--- /dev/null
+++ b/swat/desktop/index.esp
@@ -0,0 +1,168 @@
+<%
+/*** Reg stuff ***/
+libinclude("base.js");
+libinclude("winreg.js");
+libinclude("server_call.js");
+
+/*
+ server side call to return a listing of elements in a winreg path
+*/
+function enum_path(binding, path) {
+ printf("enum_path(%s, %s)\n", binding, path);
+ var reg = winreg_init();
+ security_init(reg);
+
+ reg.credentials = session.authinfo.credentials;
+
+ var status = reg.connect(binding);
+ if (status.is_ok != true) {
+ printVars(status);
+ return undefined;
+ }
+ var list = winreg_enum_path(reg, path);
+ return list;
+}
+
+/* register a call for clients to make */
+var call = servCallObj();
+call.add('enum_path', enum_path);
+
+/* run the function that was asked for */
+call.run();
+/** endReg stuff *****/
+
+ page_header("desktop", "Virtual Desktop Design Test", "desktop");
+%>
+
+<script type="text/javascript" src="/scripting/client/encoder.js"></script>
+<script type="text/javascript" src="/scripting/client/call.js"></script>
+
+<script type="text/javascript">
+
+function folder_list(fParent, list) {
+ var i;
+ fParent.populated = true;
+ fParent.removeAll();
+ for (i=0;i<list.length;i++) {
+ var fChild;
+ fChild = new QxTreeFolder(list[i]);
+ fParent.add(fChild);
+ fChild.binding = fParent.binding;
+ if (fParent.reg_path == '\\\\') {
+ fChild.reg_path = list[i];
+ } else {
+ fChild.reg_path = fParent.reg_path + '\\\\' + list[i];
+ }
+ fChild.add(new QxTreeFolder('Working ...'));
+ fChild.addEventListener("click", function() {
+ var el = this; folder_click(el);
+ });
+ fParent.setOpen(1);
+ }
+}
+
+function folder_click(node) {
+ if (!node.populated) {
+ server_call_url("@@request.REQUEST_URI", 'enum_path',
+ function(list) { folder_list(node, list); },
+ node.binding, node.reg_path);
+ }
+}
+
+/* return a registry tree for the given server */
+function registry_tree(binding) {
+ var tree = new QxTree("registry: " + binding);
+ tree.binding = binding;
+ tree.reg_path = "\\\\";
+ tree.populated = false;
+ with(tree)
+ {
+ setBackgroundColor(255);
+ setBorder(QxBorder.presets.inset);
+ setOverflow("scroll");
+ setStyleProperty("padding", "2px");
+ setWidth(400);
+ setHeight(400);
+ setTop(20);
+ }
+ tree.addEventListener("click", function() {
+ var el = this; folder_click(el);
+ });
+ return tree;
+}
+
+/*** init the page for qooxdoo ***/
+window.application.main = function()
+{
+ // Don't declare local with var
+ doc = this.getClientWindow().getClientDocument();
+}
+
+function showReg()
+{
+ var inlineWidget = new QxInline;
+ var fieldSet = new QxFieldSet("Registry");
+ var binding = "ncalrpc:";
+
+ with(fieldSet)
+ {
+ setWidth("40%");
+ setMinHeight(500);
+ setBottom(48);
+ setMinWidth(500);
+ setBackgroundColor("#FFF");
+ };
+
+ var gl = new QxGridLayout("auto,auto,auto,auto,auto", "100%");
+ gl.setEdge(0);
+ gl.setCellPaddingTop(3);
+ gl.setCellPaddingBottom(3);
+
+ inlineWidget.add(fieldSet);
+
+ var t = registry_tree(binding);
+
+ function change_binding(e) {
+ binding = e.getNewValue();
+ srv_printf("changed binding to %s\\n", binding);
+ gl.remove(t);
+ t = registry_tree(binding);
+ gl.add(t, { row : 2, col : 1 });
+ }
+
+ var b = new QxTextField(binding);
+ b.addEventListener("changeText", change_binding);
+
+ gl.add(b, { row : 1, col : 1 });
+ gl.add(t, { row : 2, col : 1 });
+
+ fieldSet.add(gl);
+ inlineWidget.add(fieldSet);
+ doc.add(inlineWidget, "canvas");
+
+ w1.setVisible(false);
+}
+
+function startSwat()
+{
+ // Don't declare local with var (for now)
+ w1 = new QxWindow("Welcome to SWAT.");
+ w1.setSpace(100, 100, 100, 100);
+ doc.add(w1);
+
+ var btn1 = new QxButton("View Registry");
+ btn1.set({ top: 20, left : 30 });
+ btn1.addEventListener("click", showReg)
+ w1.add(btn1);
+
+ w1.setVisible(true);
+}
+</script>
+
+<div id="canvas" style="overflow:hidden;position:static;margin-top:38px;margin-left:10px;margin-right:700px;width:700px"></div>
+
+<div id="toolbar">
+ <h3><a href="javascript:startSwat()">SWAT (Start)</a></h3>
+</div>
+
+<% page_footer(); %>