vCard UI does not save some fields.

thanks to Ian Neal <bugzilla@arlen.demon.co.uk> for the fix.

r/sr=sspitzer
This commit is contained in:
sspitzer%mozilla.org 2004-05-29 21:46:41 +00:00
parent 21e1198449
commit 6dd7169ecd
2 changed files with 20 additions and 5 deletions

View File

@ -108,6 +108,8 @@ function OnLoadNewCard()
gOkCallback = window.arguments[0].okCallback;
if ("escapedVCardStr" in window.arguments[0]) {
// hide non vcard values
HideNonVcardFields();
var addressbook = Components.classes["@mozilla.org/addressbook;1"].createInstance(Components.interfaces.nsIAddressBook);
editCard.card = addressbook.escapedVCardToAbCard(window.arguments[0].escapedVCardStr);
}
@ -449,6 +451,19 @@ function GetCardValues(cardproperty, doc)
}
}
// when the ab card dialog is being loaded to show a vCard,
// hide the fields which aren't supported
// by vCard so the user does not try to edit them.
function HideNonVcardFields()
{
document.getElementById('nickNameContainer').collapsed = true;
document.getElementById('secondaryEmailContainer').collapsed = true;
document.getElementById('screenNameContainer').collapsed = true;
document.getElementById('homeAddressGroup').collapsed = true;
document.getElementById('customFields').collapsed = true;
}
// Move the data from the dialog to the cardproperty to be stored in the database
function SetCardValues(cardproperty, doc)
{

View File

@ -114,7 +114,7 @@
<textbox id="DisplayName" flex="1" oninput="DisplayNameChanged()" disableforreadonly="true"/>
</hbox>
</hbox>
<hbox>
<hbox id="nickNameContainer">
<spacer flex="1"/>
<label control="NickName" value="&NickName.label;" accesskey="&NickName.accesskey;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
@ -134,7 +134,7 @@
<textbox id="PrimaryEmail" flex="1" disableforreadonly="true" class="uri-element"/>
</hbox>
</hbox>
<hbox>
<hbox id="secondaryEmailContainer">
<spacer flex="1"/>
<label control="SecondEmail" value="&SecondEmail.label;" accesskey="&SecondEmail.accesskey;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
@ -154,7 +154,7 @@
</menupopup>
</menulist>
</hbox>
<hbox>
<hbox id="screenNameContainer">
<spacer flex="1"/>
<label control="ScreenName" value="&ScreenName.label;" accesskey="&ScreenName.accesskey;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
@ -208,7 +208,7 @@
<!-- ** Address Tab ** -->
<vbox index="address" flex="1">
<groupbox flex="1">
<groupbox id="homeAddressGroup" flex="1">
<caption label="&Home.box;"/>
<vbox style="width:100%">
<hbox>
@ -334,7 +334,7 @@
<!-- ** Other Tab ** -->
<vbox index="other" flex="1">
<vbox class="alignBoxWithFieldset">
<vbox id="customFields" class="alignBoxWithFieldset">
<hbox flex="1">
<label control="Custom1" value="&Custom1.label;" accesskey="&Custom1.accesskey;" class="CardEditLabel"/>
<textbox id="Custom1" flex="1" disableforreadonly="true"/>