aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2013-06-01 23:30:55 +0200
committerMatěj Cepl <mcepl@redhat.com>2013-06-01 23:30:55 +0200
commit5f7dfa2ac4394f2b87d0fee4560e7dddbe1ab5cd (patch)
treea186a70d957823148ef934cb49a355a745946a12
parent17a0c198426e59abaa4ca77c82e9000a70a63d2b (diff)
downloadimportLDIF-5f7dfa2ac4394f2b87d0fee4560e7dddbe1ab5cd.tar.gz
Fix calling of secondLineInAddress.
-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": {