aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--importAddrBook.js19
-rw-r--r--manifest.webapp2
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": {