diff -ru cardbook1/chrome/content/addressbooksconfiguration/wdw_addressbooksAdd.js cardbook2/chrome/content/addressbooksconfiguration/wdw_addressbooksAdd.js --- cardbook1/chrome/content/addressbooksconfiguration/wdw_addressbooksAdd.js 2018-06-05 16:56:28.000000000 -0400 +++ cardbook2/chrome/content/addressbooksconfiguration/wdw_addressbooksAdd.js 2018-09-14 22:45:21.000000000 -0400 @@ -248,31 +248,13 @@ document.getElementById('remotePagePassword').value = ""; var type = document.getElementById('remotePageType').selectedItem.value; - if (type == 'GOOGLE' || type == 'YAHOO') { - document.getElementById('remotePageUriLabel').disabled=true; - document.getElementById('remotePageURI').disabled=true; - document.getElementById('remotePageURI').setAttribute('required', 'false'); - document.getElementById('remotePagePasswordLabel').disabled=true; - document.getElementById('remotePagePassword').disabled=true; - document.getElementById('remotePagePassword').setAttribute('required', 'false'); - document.getElementById('passwordCheckBox').disabled=true; - } else if (type == 'APPLE') { - document.getElementById('remotePageUriLabel').disabled=true; - document.getElementById('remotePageURI').disabled=true; - document.getElementById('remotePageURI').setAttribute('required', 'false'); - document.getElementById('remotePagePasswordLabel').disabled=false; - document.getElementById('remotePagePassword').disabled=false; - document.getElementById('remotePagePassword').setAttribute('required', 'true'); - document.getElementById('passwordCheckBox').disabled=false; - } else { - document.getElementById('remotePageUriLabel').disabled=false; - document.getElementById('remotePageURI').disabled=false; - document.getElementById('remotePageURI').setAttribute('required', 'true'); - document.getElementById('remotePagePasswordLabel').disabled=false; - document.getElementById('remotePagePassword').disabled=false; - document.getElementById('remotePagePassword').setAttribute('required', 'true'); - document.getElementById('passwordCheckBox').disabled=false; - } + document.getElementById('remotePageUriLabel').disabled=false; + document.getElementById('remotePageURI').disabled=false; + document.getElementById('remotePageURI').setAttribute('required', 'true'); + document.getElementById('remotePagePasswordLabel').disabled=false; + document.getElementById('remotePagePassword').disabled=false; + document.getElementById('remotePagePassword').setAttribute('required', 'true'); + document.getElementById('passwordCheckBox').disabled=false; wdw_addressbooksAdd.checklocationNetwork(); cardbookNotifications.setNotification("resultNotifications", "OK"); }, @@ -357,46 +339,21 @@ var type = document.getElementById('remotePageType').selectedItem.value; var username = document.getElementById('remotePageUsername').value; var password = document.getElementById('remotePagePassword').value; - if (type == 'GOOGLE') { - var url = cardbookRepository.cardbookOAuthData.GOOGLE.ROOT_API; - } else if (type == 'YAHOO') { - var url = cardbookRepository.cardbookOAuthData.YAHOO.ROOT_API; - } else if (type == 'APPLE') { - var url = cardbookRepository.APPLE_API; - wdw_addressbooksAdd.gCardDAVURLs.push([cardbookSynchronization.getSlashedUrl(url), true]); // [url, discovery] - } else { - var url = document.getElementById('remotePageURI').value; - if (cardbookSynchronization.getRootUrl(url) == "") { - cardbookNotifications.setNotification("resultNotifications", "ValidatingURLFailedLabel"); - return; - } - wdw_addressbooksAdd.gCardDAVURLs.push([url, false]); // [url, discovery] - wdw_addressbooksAdd.gCardDAVURLs.push([cardbookSynchronization.getWellKnownUrl(url), true]); - var carddavURL = cardbookSynchronization.getCardDAVUrl(url, username); - if (carddavURL != "") { + var url = document.getElementById('remotePageURI').value; + if (cardbookSynchronization.getRootUrl(url) == "") { + cardbookNotifications.setNotification("resultNotifications", "ValidatingURLFailedLabel"); + return; + } + wdw_addressbooksAdd.gCardDAVURLs.push([url, false]); // [url, discovery] + wdw_addressbooksAdd.gCardDAVURLs.push([cardbookSynchronization.getWellKnownUrl(url), true]); + var carddavURL = cardbookSynchronization.getCardDAVUrl(url, username); + if (carddavURL != "") { wdw_addressbooksAdd.gCardDAVURLs.push([carddavURL, false]); - } } var dirPrefId = cardbookUtils.getUUID(); - if (type == 'GOOGLE') { - cardbookNotifications.setNotification("resultNotifications", "ValidatingLabel", url, "PRIORITY_INFO_MEDIUM"); - cardbookSynchronization.initMultipleOperations(dirPrefId); - cardbookRepository.cardbookServerSyncRequest[dirPrefId]++; - var connection = {connUser: username, connPrefId: dirPrefId, connDescription: wdw_addressbooksAdd.gValidateDescription}; - cardbookSynchronizationGoogle.requestNewRefreshTokenForGoogle(connection, null, type, null); - wdw_addressbooksAdd.waitForRefreshTokenFinished(dirPrefId, url); - } else if (type == 'YAHOO') { - cardbookNotifications.setNotification("resultNotifications", "ValidatingLabel", url, "PRIORITY_INFO_MEDIUM"); - cardbookSynchronization.initMultipleOperations(dirPrefId); - cardbookRepository.cardbookServerSyncRequest[dirPrefId]++; - var connection = {connUser: username, connPrefId: dirPrefId, connDescription: wdw_addressbooksAdd.gValidateDescription}; - cardbookSynchronizationYahoo.requestNewRefreshTokenForYahoo(connection, null, type, null); - wdw_addressbooksAdd.waitForRefreshTokenFinished(dirPrefId, url); - } else { - cardbookSynchronization.initDiscovery(dirPrefId); - wdw_addressbooksAdd.validateCardDAVURL(dirPrefId, username, password, type); - } + cardbookSynchronization.initDiscovery(dirPrefId); + wdw_addressbooksAdd.validateCardDAVURL(dirPrefId, username, password, type); }, validateCardDAVURL: function (aDirPrefId, aUsername, aPassword, aType) { @@ -544,18 +501,6 @@ } else if (wdw_addressbooksAdd.gType == 'FILE' || wdw_addressbooksAdd.gType == 'DIRECTORY') { aTextbox.value = wdw_addressbooksAdd.gFile.leafName; cardbookElementTools.loadVCardVersions("vCardVersionPageNameMenupopup", "vCardVersionPageName"); - } else if (wdw_addressbooksAdd.gType == 'GOOGLE') { - aTextbox.value = document.getElementById('remotePageUsername').value; - // does not work with 4.0 - cardbookElementTools.loadVCardVersions("vCardVersionPageNameMenupopup", "vCardVersionPageName", ["3.0"]); - } else if (wdw_addressbooksAdd.gType == 'YAHOO') { - aTextbox.value = document.getElementById('remotePageUsername').value; - // does not work with 4.0 - cardbookElementTools.loadVCardVersions("vCardVersionPageNameMenupopup", "vCardVersionPageName", ["3.0"]); - } else if (wdw_addressbooksAdd.gType == 'APPLE') { - aTextbox.value = document.getElementById('remotePageUsername').value; - // list cannot be easily created in 4.0 - cardbookElementTools.loadVCardVersions("vCardVersionPageNameMenupopup", "vCardVersionPageName", ["3.0"]); } else { if (window.arguments[0].action == "discovery") { wdw_addressbooksAdd.setCanRewindFalse(); @@ -739,39 +684,6 @@ var enabled = true; } wdw_addressbooksAdd.gFinishParams.push({searchDef: wdw_addressbooksAdd.gTypeFile, name: name, username: "", color: color, vcard: vCardVersion, enabled: enabled, dirPrefId: dirPrefId, DBcached: false, firstAction: false}); - } else if (wdw_addressbooksAdd.gType == 'GOOGLE') { - var url = cardbookRepository.cardbookOAuthData.GOOGLE.ROOT_API; - var name = document.getElementById('namePageName').value; - var color = document.getElementById('serverColorInput').value; - var vCardVersion = document.getElementById('vCardVersionPageName').value; - var readonly = document.getElementById('readonlyPageName').checked; - var dateFormat = document.getElementById('dateFormatMenuList').value; - var urnuuid = document.getElementById('urnuuidPageName').checked; - var dirPrefId = cardbookUtils.getUUID(); - wdw_addressbooksAdd.gFinishParams.push({url: url, name: name, username: username, color: color, vcard: vCardVersion, readonly: readonly, dirPrefId: dirPrefId, dateFormat: dateFormat, - urnuuid: urnuuid, DBcached: true, firstAction: false}); - } else if (wdw_addressbooksAdd.gType == 'YAHOO') { - var url = cardbookRepository.cardbookOAuthData.YAHOO.ROOT_API; - var name = document.getElementById('namePageName').value; - var color = document.getElementById('serverColorInput').value; - var vCardVersion = document.getElementById('vCardVersionPageName').value; - var readonly = document.getElementById('readonlyPageName').checked; - var dateFormat = document.getElementById('dateFormatMenuList').value; - var urnuuid = document.getElementById('urnuuidPageName').checked; - var dirPrefId = cardbookUtils.getUUID(); - wdw_addressbooksAdd.gFinishParams.push({url: url, name: name, username: username, color: color, vcard: vCardVersion, readonly: readonly, dirPrefId: dirPrefId, dateFormat: dateFormat, - urnuuid: urnuuid, DBcached: true, firstAction: false}); - } else if (wdw_addressbooksAdd.gType == 'APPLE') { - var url = cardbookRepository.APPLE_API; - var name = document.getElementById('namePageName').value; - var color = document.getElementById('serverColorInput').value; - var vCardVersion = document.getElementById('vCardVersionPageName').value; - var readonly = document.getElementById('readonlyPageName').checked; - var dateFormat = document.getElementById('dateFormatMenuList').value; - var urnuuid = document.getElementById('urnuuidPageName').checked; - var dirPrefId = cardbookUtils.getUUID(); - wdw_addressbooksAdd.gFinishParams.push({url: url, name: name, username: username, color: color, vcard: vCardVersion, readonly: readonly, dirPrefId: dirPrefId, dateFormat: dateFormat, - urnuuid: urnuuid, DBcached: true, firstAction: false}); } else if (wdw_addressbooksAdd.gType == 'CARDDAV') { for (var i = 0; i < wdw_addressbooksAdd.gAccountsFound.length; i++) { if (wdw_addressbooksAdd.gAccountsFound.length > 1) { @@ -865,7 +777,7 @@ return; } } - if (wdw_addressbooksAdd.gType === "GOOGLE" || wdw_addressbooksAdd.gType === "CARDDAV" || wdw_addressbooksAdd.gType === "APPLE" || wdw_addressbooksAdd.gType === "YAHOO") { + if (wdw_addressbooksAdd.gType === "CARDDAV") { for (var i = 0; i < wdw_addressbooksAdd.gFinishParams.length; i++) { cardbookRepository.addAccountToRepository(wdw_addressbooksAdd.gFinishParams[i].dirPrefId, wdw_addressbooksAdd.gFinishParams[i].name, wdw_addressbooksAdd.gType, wdw_addressbooksAdd.gFinishParams[i].url, wdw_addressbooksAdd.gFinishParams[i].username, wdw_addressbooksAdd.gFinishParams[i].color, true, true, wdw_addressbooksAdd.gFinishParams[i].vcard, wdw_addressbooksAdd.gFinishParams[i].readonly, wdw_addressbooksAdd.gFinishParams[i].dateFormat, wdw_addressbooksAdd.gFinishParams[i].urnuuid, diff -ru cardbook1/chrome/content/addressbooksconfiguration/wdw_addressbooksAdd.xul cardbook2/chrome/content/addressbooksconfiguration/wdw_addressbooksAdd.xul --- cardbook1/chrome/content/addressbooksconfiguration/wdw_addressbooksAdd.xul 2018-07-17 15:01:30.000000000 -0400 +++ cardbook2/chrome/content/addressbooksconfiguration/wdw_addressbooksAdd.xul 2018-09-14 21:28:41.000000000 -0400 @@ -35,8 +35,6 @@