зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
78fdd105bc
Коммит
5796b05a36
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче