зеркало из https://github.com/mozilla/gecko-dev.git
update account manager to use the account manager data source
This commit is contained in:
Родитель
820c1b2e55
Коммит
64dfb152ba
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
<script language="javascript" src="AccountManager.js"/>
|
<script language="javascript" src="AccountManager.js"/>
|
||||||
|
|
||||||
<frameset cols="25%,75%">
|
<frameset cols="25%,75%">
|
||||||
<frame name="accounttree" id="accounttree" src="am-test.xul" scrolling="auto"/>
|
<frame name="accounttree" id="accounttree" src="accounttree.xul" scrolling="auto"/>
|
||||||
<frame name="am-main" id="am-main" src="am-main.xul" resize="yes" scrolling="auto"/>
|
<frame name="prefframe" id="prefframe" src="am-main.xul" resize="yes" scrolling="auto"/>
|
||||||
</frameset>
|
</frameset>
|
||||||
|
|
||||||
</xul:window>
|
</xul:window>
|
||||||
|
|
|
@ -57,6 +57,7 @@ EXPORT_RESOURCE_SAMPLES = \
|
||||||
$(srcdir)/AccountManager.xul \
|
$(srcdir)/AccountManager.xul \
|
||||||
$(srcdir)/AccountManager.js \
|
$(srcdir)/AccountManager.js \
|
||||||
$(srcdir)/accounttree.xul \
|
$(srcdir)/accounttree.xul \
|
||||||
|
$(srcdir)/accounttree.css \
|
||||||
$(srcdir)/am-main.xul \
|
$(srcdir)/am-main.xul \
|
||||||
$(srcdir)/am-test.xul \
|
$(srcdir)/am-test.xul \
|
||||||
$(srcdir)/am-server.xul \
|
$(srcdir)/am-server.xul \
|
||||||
|
@ -69,6 +70,9 @@ EXPORT_RESOURCE_SAMPLES = \
|
||||||
$(srcdir)/am-advanced.xul \
|
$(srcdir)/am-advanced.xul \
|
||||||
$(srcdir)/SearchDialog.xul \
|
$(srcdir)/SearchDialog.xul \
|
||||||
$(srcdir)/FilterListDialog.xul \
|
$(srcdir)/FilterListDialog.xul \
|
||||||
|
$(srcdir)/FilterEditor.xul \
|
||||||
|
$(srcdir)/FilterEditor.js \
|
||||||
|
$(srcdir)/test1.html \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
EXPORT_RESOURCE_SAMPLES_TO_REMOVE := $(addprefix $(SAMPLES_DIR)/, $(EXPORT_RESOURCE_SAMPLES))
|
EXPORT_RESOURCE_SAMPLES_TO_REMOVE := $(addprefix $(SAMPLES_DIR)/, $(EXPORT_RESOURCE_SAMPLES))
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
tree {
|
||||||
|
display: table;
|
||||||
|
background-color: white;
|
||||||
|
border: none;
|
||||||
|
border-spacing: 0px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem {
|
||||||
|
display: table-row;
|
||||||
|
}
|
||||||
|
|
||||||
|
treehead {
|
||||||
|
/* display: table-header-group; */
|
||||||
|
}
|
||||||
|
|
||||||
|
treebody {
|
||||||
|
display: table-row-group;
|
||||||
|
}
|
||||||
|
|
||||||
|
treecell {
|
||||||
|
display: table-cell;
|
||||||
|
color: black;
|
||||||
|
font-family: Veranda;
|
||||||
|
font-size: 12pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
treecell[selectedcell] {
|
||||||
|
background-color: #666699;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
treehead treeitem treecell {
|
||||||
|
font-size: 9pt;
|
||||||
|
background-color: #666699;
|
||||||
|
border: thin darkgray solid;
|
||||||
|
color: white;
|
||||||
|
}
|
|
@ -1,58 +1,39 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<?xml-stylesheet href="resource:/res/samples/xul.css" type="text/css"?>
|
<?xml-stylesheet href="resource:/res/samples/xul.css" type="text/css"?>
|
||||||
<?xml-stylesheet href="chrome://messenger/skin/" type="text/css"?>
|
<?xml-stylesheet href="chrome://messenger/skin/" type="text/css"?>
|
||||||
|
<?xml-stylesheet href="accounttree.css" type="text/css"?>
|
||||||
|
|
||||||
<!DOCTYPE window>
|
<!DOCTYPE window>
|
||||||
|
|
||||||
<xul:window xmlns:html="http://www.w3.org/TR/REC-html40"
|
<xul:window xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||||
onload = "">
|
style="width:100%"
|
||||||
|
onload = "">
|
||||||
|
<html:script language="JavaScript" src="AccountManager.js"/>
|
||||||
<tree rdf:datasources="rdf:msgaccountmanager"
|
<tree rdf:datasources="rdf:msgaccountmanager"
|
||||||
onclick="return ClickChangePanel(event.target);">
|
onclick="showPage(event)"
|
||||||
|
id="accounttree">
|
||||||
<treecol rdf:resource="http://home.netscape.com/NC-rdf#Name"/>
|
<treecol rdf:resource="http://home.netscape.com/NC-rdf#Name"/>
|
||||||
<treehead>
|
<treehead>
|
||||||
<treecell>Name</treecell>
|
<treecell>Name</treecell>
|
||||||
</treehead>
|
</treehead>
|
||||||
|
|
||||||
<treebody rdf:containment="http://home.netscape.com/NC-rdf#settings">
|
<treebody rdf:containment="http://home.netscape.com/NC-rdf#Settings">
|
||||||
<treeitem id="msgaccounts:/" open="true">
|
<treeitem id="msgaccounts:/" open="true"/>
|
||||||
<treecell><treeindentation/>RealAccounts</treecell>
|
|
||||||
</treeitem>
|
|
||||||
<treeitem>
|
|
||||||
<treecell name="Account"><treeindentation/>FakeAccount1</treecell>
|
|
||||||
<treechildren>
|
|
||||||
<treeitem>
|
|
||||||
<treecell name="MailServers">
|
|
||||||
<treeindentation/>Server
|
|
||||||
</treecell>
|
|
||||||
</treeitem>
|
|
||||||
<treeitem>
|
|
||||||
<treecell name="CopiesFolders">
|
|
||||||
<treeindentation/>Copies & Folders
|
|
||||||
</treecell>
|
|
||||||
</treeitem>
|
|
||||||
<treeitem>
|
|
||||||
<treecell name="Advanced">
|
|
||||||
<treeindentation/>Advanced
|
|
||||||
</treecell>
|
|
||||||
</treeitem>
|
|
||||||
</treechildren>
|
|
||||||
|
|
||||||
</treeitem>
|
|
||||||
|
|
||||||
</treebody>
|
</treebody>
|
||||||
|
|
||||||
</tree>
|
</tree>
|
||||||
<html:form>
|
<box align="vertical">
|
||||||
<html:center>
|
<box align="horizontal">
|
||||||
<html:button type="button" name="Duplicate">Duplicate</html:button>
|
<titledbutton class="push" flex="50%" name="Duplicate" value="Duplicate"/>
|
||||||
<html:button type="button" name="Delete">Delete</html:button>
|
<titledbutton class="push" flex="50%" name="Delete" value="Delete"/>
|
||||||
<html:br/>
|
</box>
|
||||||
<html:button type="button" name="NewAccount">New Account</html:button>
|
<box align="horizontal">
|
||||||
<html:br/>
|
<titledbutton class="push" name="NewAccount" value="New Account" flex="100%"/>
|
||||||
<html:button type="button" name="Default">Set as Default</html:button>
|
</box>
|
||||||
</html:center>
|
<box align="horizontal">
|
||||||
</html:form>
|
<titledbutton class="push" name="Default" value="Set As Default" flex="100%"/>
|
||||||
|
</box>
|
||||||
|
</box>
|
||||||
</xul:window>
|
</xul:window>
|
||||||
|
|
|
@ -52,6 +52,7 @@ install::
|
||||||
$(MAKE_INSTALL) AccountManager.xul $(DIST)\bin\res\mailnews\messenger
|
$(MAKE_INSTALL) AccountManager.xul $(DIST)\bin\res\mailnews\messenger
|
||||||
$(MAKE_INSTALL) AccountManager.js $(DIST)\bin\res\mailnews\messenger
|
$(MAKE_INSTALL) AccountManager.js $(DIST)\bin\res\mailnews\messenger
|
||||||
$(MAKE_INSTALL) accounttree.xul $(DIST)\bin\res\mailnews\messenger
|
$(MAKE_INSTALL) accounttree.xul $(DIST)\bin\res\mailnews\messenger
|
||||||
|
$(MAKE_INSTALL) accounttree.css $(DIST)\bin\res\mailnews\messenger
|
||||||
$(MAKE_INSTALL) am-main.xul $(DIST)\bin\res\mailnews\messenger
|
$(MAKE_INSTALL) am-main.xul $(DIST)\bin\res\mailnews\messenger
|
||||||
$(MAKE_INSTALL) am-test.xul $(DIST)\bin\res\mailnews\messenger
|
$(MAKE_INSTALL) am-test.xul $(DIST)\bin\res\mailnews\messenger
|
||||||
$(MAKE_INSTALL) am-server.xul $(DIST)\bin\res\mailnews\messenger
|
$(MAKE_INSTALL) am-server.xul $(DIST)\bin\res\mailnews\messenger
|
||||||
|
@ -84,6 +85,7 @@ clobber::
|
||||||
rm -f $(DIST)\res\mailnews\messenger\AccountManager.xul
|
rm -f $(DIST)\res\mailnews\messenger\AccountManager.xul
|
||||||
rm -f $(DIST)\res\mailnews\messenger\AccountManager.js
|
rm -f $(DIST)\res\mailnews\messenger\AccountManager.js
|
||||||
rm -f $(DIST)\res\mailnews\messenger\accounttree.xul
|
rm -f $(DIST)\res\mailnews\messenger\accounttree.xul
|
||||||
|
rm -f $(DIST)\res\mailnews\messenger\accounttree.css
|
||||||
rm -f $(DIST)\res\mailnews\messenger\am-main.xul
|
rm -f $(DIST)\res\mailnews\messenger\am-main.xul
|
||||||
rm -f $(DIST)\res\mailnews\messenger\am-test.xul
|
rm -f $(DIST)\res\mailnews\messenger\am-test.xul
|
||||||
rm -f $(DIST)\res\mailnews\messenger\am-server.xul
|
rm -f $(DIST)\res\mailnews\messenger\am-server.xul
|
||||||
|
|
Загрузка…
Ссылка в новой задаче