mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-30 21:55:31 +00:00
Cleanup of frame names and added some front-end code to support multiple address books.
This commit is contained in:
parent
17eff11a06
commit
870158739c
@ -2,7 +2,9 @@ function AbNewCardDialog()
|
||||
{
|
||||
var dialog = window.openDialog("chrome://addressbook/content/newcardDialog.xul",
|
||||
"abNewCard",
|
||||
"chrome");
|
||||
"chrome",
|
||||
{abURI:GetResultTreeDirectory()});
|
||||
|
||||
return dialog;
|
||||
}
|
||||
|
||||
@ -11,7 +13,8 @@ function AbEditCardDialog(card, okCallback)
|
||||
var dialog = window.openDialog("chrome://addressbook/content/editcardDialog.xul",
|
||||
"abEditCard",
|
||||
"chrome",
|
||||
{card:card, okCallback:okCallback});
|
||||
{abURI:GetResultTreeDirectory(),
|
||||
card:card, okCallback:okCallback});
|
||||
|
||||
return dialog;
|
||||
}
|
||||
|
@ -252,7 +252,7 @@
|
||||
</toolbox>
|
||||
|
||||
<!-- The main address book three pane frame -->
|
||||
<html:iframe src="chrome://addressbook/content/addresspanes.html" name="browser.2paneaddressbook" flex="100%" />
|
||||
<html:iframe src="chrome://addressbook/content/addresspanes.html" name="3paneaddressbook" flex="100%" />
|
||||
|
||||
</window>
|
||||
|
||||
|
@ -1,12 +1,19 @@
|
||||
var card;
|
||||
var newCard = -1;
|
||||
var okCallback;
|
||||
var abURI;
|
||||
var editCardTitlePrefix = "Card for ";
|
||||
|
||||
function OnLoadNewCard()
|
||||
{
|
||||
top.card = newCard;
|
||||
top.okCallback = 0;
|
||||
|
||||
if (window.arguments && window.arguments[0])
|
||||
{
|
||||
if ( window.arguments[0].abURI )
|
||||
top.abURI = window.arguments[0].abURI;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -19,11 +26,13 @@ function OnLoadEditCard()
|
||||
top.card = window.arguments[0].card;
|
||||
if ( window.arguments[0].okCallback )
|
||||
top.okCallback = window.arguments[0].okCallback;
|
||||
|
||||
GetCardValues(top.card, frames["browser.editcard"].document);
|
||||
|
||||
//top.window.setAttribute('title', editCardTitlePrefix + top.card.DisplayName);
|
||||
if ( window.arguments[0].abURI )
|
||||
top.abURI = window.arguments[0].abURI;
|
||||
}
|
||||
|
||||
GetCardValues(top.card, frames["editcard"].document);
|
||||
|
||||
//top.window.setAttribute('title', editCardTitlePrefix + top.card.DisplayName);
|
||||
}
|
||||
|
||||
|
||||
@ -35,9 +44,9 @@ function NewCardOKButton()
|
||||
|
||||
if ( cardproperty )
|
||||
{
|
||||
SetCardValues(cardproperty, frames["browser.newcard"].document);
|
||||
SetCardValues(cardproperty, frames["editcard"].document);
|
||||
|
||||
cardproperty.AddCardToDatabase();
|
||||
cardproperty.AddCardToDatabase();// Candice pass top.abURI this is the var containing GetResultTreeDirectory()
|
||||
}
|
||||
|
||||
top.window.close();
|
||||
@ -46,9 +55,9 @@ function NewCardOKButton()
|
||||
|
||||
function EditCardOKButton()
|
||||
{
|
||||
SetCardValues(top.card, frames["browser.editcard"].document);
|
||||
SetCardValues(top.card, frames["editcard"].document);
|
||||
|
||||
top.card.EditCardToDatabase();
|
||||
top.card.EditCardToDatabase();// Candice pass top.abURI this is the var containing GetResultTreeDirectory()
|
||||
|
||||
// callback to allow caller to update
|
||||
if ( top.okCallback )
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
<!-- Results pane -->
|
||||
<html:iframe flex="100%"
|
||||
name="browser.editcard"
|
||||
name="editcard"
|
||||
src="chrome://addressbook/content/editcard.xul"/>
|
||||
|
||||
<spring style="height:10px"/>
|
||||
|
@ -34,7 +34,7 @@
|
||||
<!-- editcard -->
|
||||
<html:iframe flex="100%"
|
||||
style="border:none"
|
||||
name="browser.newcard"
|
||||
name="editcard"
|
||||
src="chrome://addressbook/content/editcard.xul"/>
|
||||
|
||||
<spring style="height:10px"/>
|
||||
|
@ -39,7 +39,7 @@ function AddAddressFromComposeWindow(addresses, prefix)
|
||||
{
|
||||
if ( addresses )
|
||||
{
|
||||
var bucketDoc = frames["browser.addressbucket"].document;
|
||||
var bucketDoc = frames["addressbucket"].document;
|
||||
var addressArray = addresses.split(",");
|
||||
|
||||
for ( var index = 0; index < addressArray.length; index++ )
|
||||
@ -56,7 +56,7 @@ function AddAddressFromComposeWindow(addresses, prefix)
|
||||
|
||||
function SelectAddressOKButton()
|
||||
{
|
||||
var bucketDoc = frames["browser.addressbucket"].document;
|
||||
var bucketDoc = frames["addressbucket"].document;
|
||||
var body = bucketDoc.getElementById('bucketBody');
|
||||
var item, row, cell, text, colon;
|
||||
var toAddress="", ccAddress="", bccAddress="";
|
||||
@ -123,7 +123,7 @@ function saChangeDirectoryByDOMNode(dirNode)
|
||||
|
||||
function saChangeDirectoryByURI(uri)
|
||||
{
|
||||
var tree = frames["browser.selAddrResultPane"].document.getElementById('resultTree');
|
||||
var tree = frames["resultsFrame"].document.getElementById('resultTree');
|
||||
//dump("tree = " + tree + "\n");
|
||||
|
||||
var treechildrenList = tree.getElementsByTagName('treechildren');
|
||||
@ -160,7 +160,7 @@ function SelectAddressEditButton()
|
||||
var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService();
|
||||
rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);
|
||||
|
||||
var resultsDoc = frames["browser.selAddrResultPane"].document;
|
||||
var resultsDoc = frames["resultsFrame"].document;
|
||||
var selArray = resultsDoc.getElementsByAttribute('selected', 'true');
|
||||
|
||||
if ( selArray && selArray.length == 1 )
|
||||
@ -175,8 +175,8 @@ function SelectAddressEditButton()
|
||||
function AddSelectedAddressesIntoBucket(prefix)
|
||||
{
|
||||
var item, uri, rdf, cardResource, card, address;
|
||||
var resultsDoc = frames["browser.selAddrResultPane"].document;
|
||||
var bucketDoc = frames["browser.addressbucket"].document;
|
||||
var resultsDoc = frames["resultsFrame"].document;
|
||||
var bucketDoc = frames["addressbucket"].document;
|
||||
|
||||
rdf = Components.classes["component://netscape/rdf/rdf-service"].getService();
|
||||
rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);
|
||||
@ -212,7 +212,7 @@ function AddAddressIntoBucket(doc, address)
|
||||
|
||||
function RemoveSelectedFromBucket()
|
||||
{
|
||||
var bucketDoc = frames["browser.addressbucket"].document;
|
||||
var bucketDoc = frames["addressbucket"].document;
|
||||
var body = bucketDoc.getElementById("bucketBody");
|
||||
|
||||
var selArray = body.getElementsByAttribute('selected', 'true');
|
||||
|
@ -115,7 +115,7 @@ Rights Reserved.
|
||||
<box align="vertical" flex="50%">
|
||||
<!-- Results pane -->
|
||||
<html:iframe flex="100%" style="border:none; border-bottom:thin solid"
|
||||
name="browser.selAddrResultPane"
|
||||
name="resultsFrame"
|
||||
src="chrome://addressbook/content/resultPane.xul"/>
|
||||
|
||||
<!-- Box that holds (to,cc,bcc buttons) -->
|
||||
@ -137,7 +137,7 @@ Rights Reserved.
|
||||
|
||||
<!-- The bucket -->
|
||||
<html:iframe flex="100%" style="border:none; border-bottom:thin solid"
|
||||
name="browser.addressbucket"
|
||||
name="addressbucket"
|
||||
src="chrome://addressbook/content/addressbucket.xul"/>
|
||||
</box>
|
||||
</box>
|
||||
|
Loading…
Reference in New Issue
Block a user