Added Code to be able to edit an existing address book card. Only available through the Select Address dialog at this time.

This commit is contained in:
hangas%netscape.com 1999-07-03 01:39:52 +00:00
Родитель 78fdd105bc
Коммит 5796b05a36
4 изменённых файлов: 45 добавлений и 2 удалений

Просмотреть файл

@ -7,11 +7,13 @@ function AbNewCard()
}
function AbEditCard()
function AbEditCard(card)
{
var dialog = window.openDialog("chrome://addressbook/content/editcardDialog.xul",
"abEditCard",
"chrome");
"chrome",
{card:card});
return dialog;
}

Просмотреть файл

@ -1,3 +1,21 @@
var card;
function OnLoadEditCard()
{
// look in arguments[0] for card
if (window.arguments && window.arguments[0])
{
if ( window.arguments[0].card )
{
// keep card in global for later
top.card = window.arguments[0].card;
GetCardValues(top.card, frames["browser.editcard"].document)
}
}
}
function NewCardOKButton()
{
var cardproperty = Components.classes["component://netscape/addressbook/cardproperty"].createInstance();
@ -17,6 +35,11 @@ function NewCardOKButton()
function EditCardOKButton()
{
SetCardValues(top.card, frames["browser.editcard"].document);
// Need to commit changes here Candice.
top.window.close();
}

Просмотреть файл

@ -53,6 +53,7 @@
<window xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="top.OnLoadEditCard()"
flex="100%"
align="vertical">

Просмотреть файл

@ -44,6 +44,23 @@ function SelectAddressCancelButton()
top.window.close();
}
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 selArray = resultsDoc.getElementsByAttribute('selected', 'true');
if ( selArray && selArray.length == 1 )
{
var uri = selArray[0].getAttribute('id');
var card = rdf.GetResource(uri);
card = card.QueryInterface(Components.interfaces.nsIAbCard);
AbEditCard(card);
}
}
function AddSelectedAddressesIntoBucket(prefix)
{
var item, uri, rdf, cardResource, card, address;