[Zope-CVS] CVS: Packages/Moztop/moztop/content/Explorer - Explorer.js:1.10

Paul Everitt paul@zope.com
Mon, 10 Mar 2003 16:25:41 -0500


Update of /cvs-repository/Packages/Moztop/moztop/content/Explorer
In directory cvs.zope.org:/tmp/cvs-serv7256

Modified Files:
	Explorer.js 
Log Message:
Moved commandset to its own overlay, put in a test PUT button with a method (hardwired for now) in Explorer.js

=== Packages/Moztop/moztop/content/Explorer/Explorer.js 1.9 => 1.10 ===
--- Packages/Moztop/moztop/content/Explorer/Explorer.js:1.9	Sat Mar  1 08:23:22 2003
+++ Packages/Moztop/moztop/content/Explorer/Explorer.js	Mon Mar 10 16:25:38 2003
@@ -163,7 +163,7 @@
 }
 
 
-SitesManager.prototype.PUT=function (puturl, putcontent) 
+SitesManager.prototype.DELETE=function (puturl, putcontent) 
 {
     var p = new XMLHttpRequest();
 
@@ -179,7 +179,7 @@
     }
 
     p.onload = myfunc;
-    p.open("PUT",puturl);
+    p.open("DELETE",puturl);
     p.setRequestHeader("Content-type", "text/plain");
     p.setRequestHeader("Host","localhost");
     p.send(putcontent);
@@ -311,6 +311,43 @@
 
 
 
+
+SitesManager.prototype.PUT=function () 
+{
+    var puturl = "http://localhost:9700/fooboy3";
+    var putcontent = "";
+
+    var p = new XMLHttpRequest();
+    var typeheader = "X-Zope-Type-Name"
+
+    function myfunc (e) {
+	if (p.responseXML) {
+
+	    var s = new XMLSerializer();
+	    var d = p.responseXML;
+	    var str = s.serializeToString(d);
+
+	    dump("\nmade it in PUT\n" + str + "\n");
+	}
+    }
+
+    var x = document.implementation.createDocument("", "test", null);
+    x.documentElement.appendChild(document.createElement("Foo"));
+    x.documentElement.appendChild(document.createElement("Bar"));
+    x.documentElement.firstChild.appendChild(document.createTextNode("My Stuff\nYeah"));
+
+    var s = new XMLSerializer();
+    str = s.serializeToString(x);
+
+    p.onload = myfunc;
+    p.open("PUT",puturl);
+    p.setRequestHeader("Content-type", "text/xml");
+    p.setRequestHeader("Host","localhost");
+    p.setRequestHeader(typeheader, "PageTemplate");
+    p.send(x);
+
+    return;
+}