[Pkg-mozext-commits] [gcontactsync] 45/88: Issue #24: Invalid rel value on gContact:website when changing the type of an existing website

David Prévot taffit at moszumanska.debian.org
Thu Sep 18 20:52:28 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository gcontactsync.

commit a89c08979915e6aa00890f69f661a11f6f482b87
Author: Josh Geenen <joshgeenen at gmail.com>
Date:   Tue Mar 11 22:22:21 2014 -0500

    Issue #24: Invalid rel value on gContact:website when changing the type of an existing website
---
 src/content/gdata.js | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/src/content/gdata.js b/src/content/gdata.js
index 9b26831..07c9b84 100644
--- a/src/content/gdata.js
+++ b/src/content/gdata.js
@@ -244,31 +244,26 @@ com.gContactSync.gdata = {
       }
       
       var arr,
-          relAttr = "rel";
-      switch (aElement.tagName) {
+          relAttr = "rel",
+          tagName = aElement.tagName.substr(aElement.tagName.lastIndexOf(":") + 1);
+      switch (tagName) {
         case "email":
-        case "gd:email":
           arr = this.EMAIL_TYPES;
           break;
         case "im":
-        case "gd:im":
           arr = this.IM_TYPES;
           relAttr = "protocol";
           break;
         case "phoneNumber":
-        case "gd:phoneNumber":
           arr = this.PHONE_TYPES;
           break;
         case "structuredPostalAddress":
-        case "gd:structuredPostalAddress":
-          arr = this.POSTAL_ADDRESS_TYPES
+          arr = this.POSTAL_ADDRESS_TYPES;
           break;
         case "relation":
-        case "gd:relation":
           arr = this.RELATION_TYPES;
           break;
         case "website":
-        case "gContact:website":
           arr = this.WEBSITE_TYPES;
           break;
         default:
@@ -280,9 +275,9 @@ com.gContactSync.gdata = {
       
         // Set a rel; website and relation elements need the rel to just be the
         // type, everything else has a prefix and im elements need a protocol.
-        if (aElement.tagName == "website" || aElement.tagName == "relation") {
+        if (tagName === "website" || tagName === "relation") {
           aElement.setAttribute(relAttr, aType);
-        } else if (aElement.tagName == "im") {
+        } else if (tagName === "im") {
           aElement.setAttribute("protocol", com.gContactSync.gdata.contacts.rel + "#" + aType);
           aElement.setAttribute("rel",      com.gContactSync.gdata.contacts.rel + "#other");
         } else {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/gcontactsync.git



More information about the Pkg-mozext-commits mailing list