From 5f7dfa2ac4394f2b87d0fee4560e7dddbe1ab5cd Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Sat, 1 Jun 2013 23:30:55 +0200 Subject: Fix calling of secondLineInAddress. --- importAddrBook.js | 19 ++++++++++++++++--- manifest.webapp | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/importAddrBook.js b/importAddrBook.js index 2a16f86..518002b 100644 --- a/importAddrBook.js +++ b/importAddrBook.js @@ -106,7 +106,18 @@ return cAddr; } - // secondLineInAddress("home", "mozillaHomeStreet", "mozillaHomeStreet2") + /** + * Manages squeezing two-line address into one value field + * + * @param type String ['home', 'work'] + * @param target String ContactsAddress attribute to be set (e.g., + * streetAddress) + * @param first String first line index in inRec + * @param second String second line index in inRec + * @return None + * sets variable inRec local to outer function + * deletes both fields from inRec so as to avoid duplication + */ function secondLineInAddress(type, target, first, second) { var curRec = findSubElement("adr", type); if (second in inRec) { @@ -209,7 +220,8 @@ } else if (["mozillaHomeStreet", "mozillaHomeStreet2"]. indexOf(key) !== -1) { - secondLineInAddress("home", "mozillaHomeStreet", "mozillaHomeStreet2"); + secondLineInAddress("home", "streetAddress", + "mozillaHomeStreet", "mozillaHomeStreet2"); } else if (key === "mozillaWorkUrl") { curRec = findSubElement("url", "work"); @@ -276,7 +288,8 @@ } else if (["street", "mozillaWorkStreet2"]. indexOf(key) !== -1) { - secondLineInAddress("work", "street", "mozillaWorkStreet2"); + secondLineInAddress("work", "streetAddress", + "street", "mozillaWorkStreet2"); } else if (key === "telephoneNumber") { curRec = findSubElement("tel", "work"); diff --git a/manifest.webapp b/manifest.webapp index 6f696ec..51acbe7 100644 --- a/manifest.webapp +++ b/manifest.webapp @@ -1,5 +1,5 @@ { - "version": "4", + "version": "5", "name": "Import LDIF", "description": "Import LDIF file from the remote URL to Firefox OS Contacts application", "icons": { -- cgit