From 64dfb152ba36f5765c8b12883b1c66bfec67f9b9 Mon Sep 17 00:00:00 2001 From: "alecf%netscape.com" Date: Wed, 19 May 1999 00:12:48 +0000 Subject: [PATCH] update account manager to use the account manager data source --- .../ui/messenger/resources/AccountManager.js | 39 ++++++++++++ .../ui/messenger/resources/AccountManager.xul | 4 +- mailnews/ui/messenger/resources/Makefile.in | 4 ++ .../ui/messenger/resources/accounttree.css | 38 ++++++++++++ .../ui/messenger/resources/accounttree.xul | 59 +++++++------------ mailnews/ui/messenger/resources/makefile.win | 2 + 6 files changed, 105 insertions(+), 41 deletions(-) create mode 100644 mailnews/ui/messenger/resources/accounttree.css diff --git a/mailnews/ui/messenger/resources/AccountManager.js b/mailnews/ui/messenger/resources/AccountManager.js index 139597f9cb07..a105cd668807 100644 --- a/mailnews/ui/messenger/resources/AccountManager.js +++ b/mailnews/ui/messenger/resources/AccountManager.js @@ -1,2 +1,41 @@ +var RDF = Components.classes['component://netscape/rdf/rdf-service'].getService(); +RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService); +var pageTagArc = RDF.GetResource("http://home.netscape.com/NC-rdf#PageTag"); + +function showPage(event) { + + var node = event.target.parentNode; + var uri = node.getAttribute('id'); + + var server = node.parentNode.parentNode; + var serveruri = server.getAttribute('id'); + + var pageResource = RDF.GetResource(uri); + + // we have to do this extra QI because of a bug in XPConnect + var db = document.getElementById("accounttree").database; + var db2 = db.QueryInterface(Components.interfaces.nsIRDFDataSource); + + // convert node->literal + var newPageNode = db2.GetTarget(pageResource, pageTagArc, true); + var newPageResource = newPageNode.QueryInterface(Components.interfaces.nsIRDFLiteral); + + var pageURI = newPageResource.Value; + + var destFrame = window.parent.frames["prefframe"]; + + var oldLocation = new String(destFrame.location); + var lastSlashPos = oldLocation.lastIndexOf('/'); + + if (lastSlashPos >= 0) { + var newLocation = oldLocation.slice(0, lastSlashPos+1); + newLocation += pageURI; + } + + if (oldLocation != newLocation) { + destFrame.location = newLocation; + } +} + diff --git a/mailnews/ui/messenger/resources/AccountManager.xul b/mailnews/ui/messenger/resources/AccountManager.xul index 83b071e043df..52d06a4e424b 100644 --- a/mailnews/ui/messenger/resources/AccountManager.xul +++ b/mailnews/ui/messenger/resources/AccountManager.xul @@ -8,8 +8,8 @@