Commit 7104127c authored by CardBook's avatar CardBook

version 22.7

parent 2c6b6ed7
......@@ -199,7 +199,7 @@ if ("undefined" == typeof(wdw_cardEdition)) {
var myCurrentDirPrefId = document.getElementById('dirPrefIdTextBox').value;
if (myCurrentDirPrefId != "") {
for (var i in cardbookRepository.cardbookCardSearch[myCurrentDirPrefId]) {
if (i.indexOf(searchValue) >= 0 || searchValue == "") {
if (i.includes(searchValue) || searchValue == "") {
for (var j = 0; j < cardbookRepository.cardbookCardSearch[myCurrentDirPrefId][i].length; j++) {
var myCard = cardbookRepository.cardbookCardSearch[myCurrentDirPrefId][i][j];
if (myCard.dirPrefId == myCurrentDirPrefId) {
......
......@@ -1782,9 +1782,7 @@ if ("undefined" == typeof(cardbookUtils)) {
},
addEtag: function(aCard, aEtag) {
if (!(aEtag != null && aEtag !== undefined && aEtag != "")) {
aEtag = "0";
} else {
if (aEtag != null && aEtag !== undefined && aEtag != "") {
var cardbookPrefService = new cardbookPreferenceService(aCard.dirPrefId);
var myPrefType = cardbookPrefService.getType();
if (myPrefType != "FILE" || myPrefType != "CACHE" || myPrefType != "DIRECTORY" || myPrefType != "LOCALDB") {
......
......@@ -148,7 +148,7 @@ if ("undefined" == typeof(wdw_cardbookContactsSidebar)) {
if ((searchCategory === "allCategories") || (searchCategory === "noCategory") || (searchCategory === "onlyCategories")) {
if (searchCategory !== "onlyCategories") {
for (var j in cardbookRepository.cardbookCardSearch[myDirPrefId]) {
if (j.indexOf(searchInput) >= 0 || searchInput == "") {
if (j.includes(searchInput) || searchInput == "") {
for (var k = 0; k < cardbookRepository.cardbookCardSearch[myDirPrefId][j].length; k++) {
var myCard = cardbookRepository.cardbookCardSearch[myDirPrefId][j][k];
if (wdw_cardbookContactsSidebar.catExclRestrictions[myDirPrefId]) {
......@@ -219,7 +219,7 @@ if ("undefined" == typeof(wdw_cardbookContactsSidebar)) {
return element == myCategory;
};
for (var j in cardbookRepository.cardbookCardSearch[myDirPrefId]) {
if (j.indexOf(searchInput) >= 0 || searchInput == "") {
if (j.includes(searchInput) || searchInput == "") {
for (var k = 0; k < cardbookRepository.cardbookCardSearch[myDirPrefId][j].length; k++) {
var myCard = cardbookRepository.cardbookCardSearch[myDirPrefId][j][k]
if (((myCard.categories.find(searchArray) != undefined) && (cardbookRepository.cardbookUncategorizedCards != myCategory))
......@@ -249,7 +249,7 @@ if ("undefined" == typeof(wdw_cardbookContactsSidebar)) {
}
}
}
if (myCategory.replace(/[\s+\-+\.+\,+\;+]/g, "").toUpperCase().indexOf(searchInput) >= 0 || searchInput == "") {
if (myCategory.replace(/[\s+\-+\.+\,+\;+]/g, "").toUpperCase().includes(searchInput) || searchInput == "") {
var myEmails = [] ;
var myFormattedEmails = [];
for (var k = 0; k < cardbookRepository.cardbookDisplayCards[searchCategory].length; k++) {
......@@ -290,7 +290,7 @@ if ("undefined" == typeof(wdw_cardbookContactsSidebar)) {
if (searchCategory !== "onlyCategories") {
var myCard = cardbookRepository.cardbookDisplayCards[myDirPrefId][j];
var myDirPrefName = cardbookUtils.getPrefNameFromPrefId(myCard.dirPrefId);
if (cardbookRepository.getSearchString(myCard).indexOf(searchInput) >= 0 || searchInput == "") {
if (cardbookRepository.getSearchString(myCard).includes(searchInput) || searchInput == "") {
if (wdw_cardbookContactsSidebar.catExclRestrictions[myDirPrefId]) {
var add = true;
for (var l in wdw_cardbookContactsSidebar.catExclRestrictions[myDirPrefId]) {
......@@ -336,7 +336,7 @@ if ("undefined" == typeof(wdw_cardbookContactsSidebar)) {
var myDirPrefName = cardbookUtils.getPrefNameFromPrefId(myCard.dirPrefId);
// All No categories
if (searchCategory !== "onlyCategories") {
if (cardbookRepository.getSearchString(myCard).indexOf(searchInput) >= 0 || searchInput == "") {
if (cardbookRepository.getSearchString(myCard).includes(searchInput) || searchInput == "") {
if (wdw_cardbookContactsSidebar.catExclRestrictions[myDirPrefId]) {
var add = true;
for (var l in wdw_cardbookContactsSidebar.catExclRestrictions[myDirPrefId]) {
......@@ -425,7 +425,7 @@ if ("undefined" == typeof(wdw_cardbookContactsSidebar)) {
if (myPrimaryEmail != "") {
var lSearchString = myABCard.getProperty("FirstName","") + myABCard.getProperty("LastName","") + myDisplayName + myABCard.getProperty("NickName","") + myPrimaryEmail;
lSearchString = lSearchString.replace(/[\s+\-+\.+\,+\;+]/g, "").toUpperCase();
if (lSearchString.indexOf(searchInput) >= 0 || searchInput == "") {
if (lSearchString.includes(searchInput) || searchInput == "") {
if (myDisplayName == "") {
var delim = myPrimaryEmail.indexOf("@",0);
myDisplayName = myPrimaryEmail.substr(0,delim);
......@@ -441,7 +441,7 @@ if ("undefined" == typeof(wdw_cardbookContactsSidebar)) {
var myABList = contactManager.getDirectory(myABCard.mailListURI);
var lSearchString = myDisplayName + myABList.listNickName + myABList.description;
lSearchString = lSearchString.replace(/[\s+\-+\.+\,+\;+]/g, "").toUpperCase();
if (lSearchString.indexOf(searchInput) >= 0 || searchInput == "") {
if (lSearchString.includes(searchInput) || searchInput == "") {
wdw_cardbookContactsSidebar.searchResults.push([myDisplayName, contact.dirName, "", true, "LISTCORE", myABCard, MailServices.headerParser.makeMimeAddress(myDisplayName, myDisplayName), contact.dirPrefId]);
}
}
......
......@@ -355,7 +355,7 @@ cardbookAutocompleteSearch.prototype = {
for (var l = 0; l < myCard.email.length; l++) {
var myCurrentPopularity = 0;
if (cardbookRepository.cardbookMailPopularityIndex[myCard.email[l][0][0].toLowerCase()]) {
myCurrentPopularity = cardbookRepository.cardbookMailPopularityIndex[myCard.email[l][0][0].toLowerCase()];
myCurrentPopularity = parseInt(cardbookRepository.cardbookMailPopularityIndex[myCard.email[l][0][0].toLowerCase()]);
if (first) {
myMinPopularity = myCurrentPopularity;
first = false;
......
......@@ -65,5 +65,5 @@ pref("extensions.cardbook.viewABContact", true);
pref("extensions.cardbook.accountsShown", "all");
pref("extensions.cardbook.uncategorizedCards", "");
pref("extensions.cardbook.addonVersion", "22.6");
pref("extensions.cardbook.addonVersion", "22.7");
......@@ -6,7 +6,7 @@
<Description about="urn:mozilla:install-manifest">
<em:id>cardbook@vigneau.philippe</em:id>
<em:name>CardBook</em:name>
<em:version>22.6</em:version>
<em:version>22.7</em:version>
<em:type>2</em:type>
<em:description>vCard Address Book</em:description>
<em:creator>Philippe Vigneau</em:creator>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment