[Zope-CVS] CVS: Packages/Moztop/moztop/content/Menu - ToolBar.js:1.13
Stephan Richter
srichter@cbu.edu
Thu, 16 Jan 2003 00:03:11 -0500
Update of /cvs-repository/Packages/Moztop/moztop/content/Menu
In directory cvs.zope.org:/tmp/cvs-serv17745/moztop/content/Menu
Modified Files:
ToolBar.js
Log Message:
Rename and Delete Objects from the Explorer are now working.
=== Packages/Moztop/moztop/content/Menu/ToolBar.js 1.12 => 1.13 ===
--- Packages/Moztop/moztop/content/Menu/ToolBar.js:1.12 Wed Jan 15 23:11:30 2003
+++ Packages/Moztop/moztop/content/Menu/ToolBar.js Thu Jan 16 00:03:09 2003
@@ -16,58 +16,6 @@
$Id$
******************************************************************************/
-function getClient() {
- return Components.classes['@mozilla.org/xml-rpc/client;1']
- .createInstance(Components.interfaces.nsIXmlRpcClient);
-}
-
-var xmlRpcClient;
-function getXmlRpc() {
- if (!xmlRpcClient) xmlRpcClient = getClient();
- return xmlRpcClient;
-}
-
-var Listener = {
- onResult: function(client, ctxt, result) {
- /* result = result.QueryInterface(
- Components.interfaces.nsISupportsString);
- alert(result.data); */
- alert('Object successfully added');
- },
-
- onFault: function(client, ctxt, fault) {
- alert('Fault! ' + fault + '\n');
- },
-
- onError: function(client, ctxt, status, errorMsg) {
- alert('Error! <(' + status.toString(16) + ') ' + errorMsg + '>\n');
- }
-};
-
-/* Send the Add request via XML-RPC and handle the result. */
-function sendAddRequest(parent, obj_type, obj_name) {
- var xmlRpc = getXmlRpc();
- xmlRpc.init(ZOPE3_URL + parent);
- var type = xmlRpc.createType(xmlRpc.STRING, {});
- type.data = obj_type;
- var name = xmlRpc.createType(xmlRpc.STRING, {});
- name.data = obj_name;
- xmlRpc.asyncCall(Listener, null, 'createAndAdd', [type, name], 2);
-}
-
-/* Add a content object to the folder that is selected in the tree. */
-function addContentObject() {
- var type = document.getElementById("field_obj_type").selectedItem.label;
- var name = document.getElementById("field_obj_name").value;
- var tree = document.getElementById("navigationtree");
- index = tree.view.selection.currentIndex;
- rdf = tree.view.getItemAtIndex(index).resource;
- var parent = rdf.Value.replace('urn:explorer:data', '') + '/';
- while (parent.indexOf(":") > -1)
- parent = parent.replace(":", "/");
- // alert(parent);
- sendAddRequest(parent, type, name);
-}
/* Remove the Welcome tab. */
function _removeWelcome() {
@@ -148,7 +96,6 @@
var iframe = document.createElement("iframe");
iframe.setAttribute('src',
- // ZOPE3_HTML + name + '/@@EditMetaData.html')
'chrome://moztop/content/ContentObjects/' + type + '/' +
sub_tab_ids[index] + '.xul');
iframe.setAttribute('flex', '1');