diff --git a/mailnews/addrbook/resources/content/cardviewPane.js b/mailnews/addrbook/resources/content/cardviewPane.js index ee07c2b7b9d0..57f9afc3e9a6 100644 --- a/mailnews/addrbook/resources/content/cardviewPane.js +++ b/mailnews/addrbook/resources/content/cardviewPane.js @@ -1,3 +1,13 @@ +var zWork = "Work: "; +var zHome = "Home: "; +var zFax = "Fax: "; +var zCellular = "Cellular: "; +var zPager = "Pager: "; +var zCustom1 = "Custom 1: "; +var zCustom2 = "Custom 2: "; +var zCustom3 = "Custom 3: "; +var zCustom4 = "Custom 4: "; + var rdf; var cvData; @@ -26,9 +36,15 @@ function OnLoadAddressBook() // Home section cvData.cvhHome = doc.getElementById("cvhHome"); cvData.cvHomeAddress = doc.getElementById("cvHomeAddress"); + cvData.cvHomeAddress2 = doc.getElementById("cvHomeAddress2"); cvData.cvHomeCityStZip = doc.getElementById("cvHomeCityStZip"); + cvData.cvHomeCountry = doc.getElementById("cvHomeCountry"); // Other section cvData.cvhOther = doc.getElementById("cvhOther"); + cvData.cvCustom1 = doc.getElementById("cvCustom1"); + cvData.cvCustom2 = doc.getElementById("cvCustom2"); + cvData.cvCustom3 = doc.getElementById("cvCustom3"); + cvData.cvCustom4 = doc.getElementById("cvCustom4"); cvData.cvNotes = doc.getElementById("cvNotes"); // Phone section cvData.cvhPhone = doc.getElementById("cvhPhone"); @@ -40,9 +56,12 @@ function OnLoadAddressBook() // Work section cvData.cvhWork = doc.getElementById("cvhWork"); cvData.cvJobTitle = doc.getElementById("cvJobTitle"); + cvData.cvDepartment = doc.getElementById("cvDepartment"); cvData.cvCompany = doc.getElementById("cvCompany"); cvData.cvWorkAddress = doc.getElementById("cvWorkAddress"); + cvData.cvWorkAddress2 = doc.getElementById("cvWorkAddress2"); cvData.cvWorkCityStZip = doc.getElementById("cvWorkCityStZip"); + cvData.cvWorkCountry = doc.getElementById("cvWorkCountry"); } function DisplayCardViewPane(abNode) @@ -51,8 +70,12 @@ function DisplayCardViewPane(abNode) var cardResource = parent.parent.rdf.GetResource(uri); var card = cardResource.QueryInterface(Components.interfaces.nsIAbCard); - var name = card.DisplayName;// FIX ME - this should be displayName + var name = card.DisplayName; + var nickname; + if ( card.NickName ) + nickname = "\"" + card.NickName + "\""; + var data = parent.parent.cvData; var visible; @@ -66,28 +89,37 @@ function DisplayCardViewPane(abNode) /* Name section */ cvSetNode(data.cvhName, name); - cvSetNode(data.cvNickname, "\"" + card.NickName + "\""); + cvSetNode(data.cvNickname, nickname); cvSetNode(data.cvEmail1, card.PrimaryEmail); cvSetNode(data.cvEmail2, card.SecondEmail); /* Home section */ - visible = cvSetNode(data.cvHomeAddress, "not yet supported"); - visible = cvSetNode(data.cvHomeCityStZip, "not yet supported") || visible; + visible = cvSetNode(data.cvHomeAddress, card.HomeAddress); + visible = cvSetNode(data.cvHomeAddress2, card.HomeAddress2) || visible; + visible = cvSetCityStateZip(data.cvHomeCityStZip, card.HomeCity, card.HomeState, card.HomeZipCode) || visible; + visible = cvSetNode(data.cvHomeCountry, card.HomeCountry) || visible; cvSetVisible(data.cvhHome, visible); /* Other section */ - visible = cvSetNode(data.cvNotes, "not yet supported"); + visible = cvSetNodeWithLabel(data.cvCustom1, zCustom1, card.Custom1); + visible = cvSetNodeWithLabel(data.cvCustom2, zCustom2, card.Custom2) || visible; + visible = cvSetNodeWithLabel(data.cvCustom3, zCustom3, card.Custom3) || visible; + visible = cvSetNodeWithLabel(data.cvCustom4, zCustom4, card.Custom4) || visible; + visible = cvSetNode(data.cvNotes, card.Notes) || visible; cvSetVisible(data.cvhOther, visible); /* Phone section */ - visible = cvSetPhone(data.cvPhWork, "Work: ", card.WorkPhone); - visible = cvSetPhone(data.cvPhHome, "Home: ", card.HomePhone) || visible; - visible = cvSetPhone(data.cvPhFax, "Fax: ", card.FaxNumber) || visible; - visible = cvSetPhone(data.cvPhCellular, "Cellular: ", card.CellularNumber) || visible; - visible = cvSetPhone(data.cvPhPager, "Pager: ", card.PagerNumber) || visible; + visible = cvSetNodeWithLabel(data.cvPhWork, zWork, card.WorkPhone); + visible = cvSetNodeWithLabel(data.cvPhHome, zHome, card.HomePhone) || visible; + visible = cvSetNodeWithLabel(data.cvPhFax, zFax, card.FaxNumber) || visible; + visible = cvSetNodeWithLabel(data.cvPhCellular, zCellular, card.CellularNumber) || visible; + visible = cvSetNodeWithLabel(data.cvPhPager, zPager, card.PagerNumber) || visible; cvSetVisible(data.cvhPhone, visible); /* Work section */ - visible = cvSetNode(data.cvJobTitle, "not yet supported"); + visible = cvSetNode(data.cvJobTitle, card.JobTitle); + visible = cvSetNode(data.cvDepartment, card.Department) || visible; visible = cvSetNode(data.cvCompany, card.Company) || visible; - visible = cvSetNode(data.cvWorkAddress, "not yet supported") || visible; - visible = cvSetNode(data.cvWorkCityStZip, "not yet supported") || visible; + visible = cvSetNode(data.cvWorkAddress, card.WorkAddress) || visible; + visible = cvSetNode(data.cvWorkAddress2, card.WorkAddress2) || visible; + visible = cvSetCityStateZip(data.cvWorkCityStZip, card.WorkCity, card.WorkState, card.WorkZipCode) || visible; + visible = cvSetNode(data.cvWorkCountry, card.WorkCountry) || visible; cvSetVisible(data.cvhWork, visible); } @@ -127,14 +159,32 @@ function ClearCardViewPane() cvSetVisible(data.cvWorkCityStZip, false); } -function cvSetPhone(node, phone, text) +function cvSetNodeWithLabel(node, label, text) { if ( text ) - return cvSetNode(node, phone + text); + return cvSetNode(node, label + text); else return cvSetNode(node, ""); } +function cvSetCityStateZip(node, city, state, zip) +{ + var text; + + if ( city ) + { + text = city; + if ( state || zip ) + text += ", "; + } + if ( state ) + text += state + " "; + if ( zip ) + text += zip; + + return cvSetNode(node, text); +} + function cvSetNode(node, text) { node.childNodes[0].nodeValue = text; diff --git a/mailnews/addrbook/resources/content/cardviewPane.xul b/mailnews/addrbook/resources/content/cardviewPane.xul index c64c756298fb..62bff39d3143 100644 --- a/mailnews/addrbook/resources/content/cardviewPane.xul +++ b/mailnews/addrbook/resources/content/cardviewPane.xul @@ -36,11 +36,17 @@ Home * + * * + * Other + * + * + * + * * @@ -63,9 +69,12 @@ Work * - * + * + * * + * * + * diff --git a/mailnews/addrbook/resources/content/editcard.js b/mailnews/addrbook/resources/content/editcard.js index eddb1b4add52..9c01ad9255d0 100644 --- a/mailnews/addrbook/resources/content/editcard.js +++ b/mailnews/addrbook/resources/content/editcard.js @@ -1,4 +1,12 @@ var card; +var newCard = -1; +var editCardTitlePrefix = "Card for "; + +function OnLoadNewCard() +{ + top.card = newCard; +} + function OnLoadEditCard() { @@ -10,7 +18,9 @@ function OnLoadEditCard() // keep card in global for later top.card = window.arguments[0].card; - GetCardValues(top.card, frames["browser.editcard"].document) + GetCardValues(top.card, frames["browser.editcard"].document); + + //top.window.setAttribute('title', editCardTitlePrefix + top.card.DisplayName); } } } diff --git a/mailnews/addrbook/resources/content/editcard.xul b/mailnews/addrbook/resources/content/editcard.xul index 009f58dfe1f1..00c21776267e 100644 --- a/mailnews/addrbook/resources/content/editcard.xul +++ b/mailnews/addrbook/resources/content/editcard.xul @@ -53,8 +53,7 @@ @@ -64,7 +63,7 @@ &Other.tab; - + @@ -134,12 +133,12 @@ - &WorkPhone.label; + &WorkPhone.label; - &WorkPhone.label; + &WorkPhone.label; diff --git a/mailnews/addrbook/resources/content/editcardDialog.xul b/mailnews/addrbook/resources/content/editcardDialog.xul index 3ef6020854b0..c4c47bf363ba 100644 --- a/mailnews/addrbook/resources/content/editcardDialog.xul +++ b/mailnews/addrbook/resources/content/editcardDialog.xul @@ -3,15 +3,13 @@ - ]> @@ -24,7 +22,7 @@ - + diff --git a/mailnews/addrbook/resources/content/newcardDialog.xul b/mailnews/addrbook/resources/content/newcardDialog.xul index dc17e11d0f3a..a5f575338edf 100644 --- a/mailnews/addrbook/resources/content/newcardDialog.xul +++ b/mailnews/addrbook/resources/content/newcardDialog.xul @@ -5,26 +5,39 @@ [ + + ]> - + + &chooseAddressBook.label; + + Personal Address Book + + + + + + - + diff --git a/mailnews/addrbook/resources/content/selectaddress.js b/mailnews/addrbook/resources/content/selectaddress.js index 2ae04b085923..d24a1b34bd41 100644 --- a/mailnews/addrbook/resources/content/selectaddress.js +++ b/mailnews/addrbook/resources/content/selectaddress.js @@ -44,6 +44,12 @@ function SelectAddressCancelButton() top.window.close(); } + +function SelectAddressNewButton() +{ + AbNewCard(); +} + function SelectAddressEditButton() { var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService(); diff --git a/mailnews/addrbook/resources/content/selectaddress.xul b/mailnews/addrbook/resources/content/selectaddress.xul index 9ee8ef20a0e9..7b5368117a98 100644 --- a/mailnews/addrbook/resources/content/selectaddress.xul +++ b/mailnews/addrbook/resources/content/selectaddress.xul @@ -33,8 +33,8 @@ Rights Reserved. - - + +