svn commit: samba r9397 - in branches/SAMBA_4_0/swat: . desktop scripting

deryck at samba.org deryck at samba.org
Fri Aug 19 12:02:32 GMT 2005


Author: deryck
Date: 2005-08-19 12:02:30 +0000 (Fri, 19 Aug 2005)
New Revision: 9397

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=9397

Log:
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

Added:
   branches/SAMBA_4_0/swat/desktop/
   branches/SAMBA_4_0/swat/desktop/index.esp
   branches/SAMBA_4_0/swat/scripting/footer_desktop.esp
   branches/SAMBA_4_0/swat/scripting/header_desktop.esp


Changeset:
Added: branches/SAMBA_4_0/swat/desktop/index.esp
===================================================================
--- branches/SAMBA_4_0/swat/desktop/index.esp	2005-08-18 22:36:12 UTC (rev 9396)
+++ branches/SAMBA_4_0/swat/desktop/index.esp	2005-08-19 12:02:30 UTC (rev 9397)
@@ -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(); %>

Added: branches/SAMBA_4_0/swat/scripting/footer_desktop.esp
===================================================================
--- branches/SAMBA_4_0/swat/scripting/footer_desktop.esp	2005-08-18 22:36:12 UTC (rev 9396)
+++ branches/SAMBA_4_0/swat/scripting/footer_desktop.esp	2005-08-19 12:02:30 UTC (rev 9397)
@@ -0,0 +1,6 @@
+<% 
+   /* footer for desktop page type */
+%>
+
+</body>
+</html>

Added: branches/SAMBA_4_0/swat/scripting/header_desktop.esp
===================================================================
--- branches/SAMBA_4_0/swat/scripting/header_desktop.esp	2005-08-18 22:36:12 UTC (rev 9396)
+++ branches/SAMBA_4_0/swat/scripting/header_desktop.esp	2005-08-19 12:02:30 UTC (rev 9397)
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta http-equiv="Content-Language" content="en-us" />
+
+  <title>@@global.page.title</title>
+
+<link rel="stylesheet" href="/style/qooxdoo/layouts/application.css" type="text/css" media="all" />
+<link rel="shortcut icon" href="/images/favicon.ico" />
+
+<script type="text/javascript" src="/style/qooxdoo/widgets/qooxdoo.js"></script>
+
+<style type="text/css" media="screen">
+body {
+  background-color:#3A6EA5;
+}
+#toolbar {
+  background-color:ThreeDFace;
+  position:fixed;
+  bottom:0;
+  height:25px;
+  width:100%;
+  line-height:25px;
+  border-top:1px outset #000;
+}
+</style>
+
+</head>
+
+<body>
+



More information about the samba-cvs mailing list