Commit 210b20bb authored by CardBook's avatar CardBook

version 26.3

parent e5c0825a
......@@ -183,12 +183,14 @@ if ("undefined" == typeof(cardbookObserver)) {
case "cardbook.ABModifiedDirect":
wdw_cardbookContactsSidebar.loadAB();
break;
case "cardbook.syncRunning":
wdw_cardbookContactsSidebar.onABChange(aData);
break;
case "cardbook.catAddedIndirect":
case "cardbook.cardAddedIndirect":
case "cardbook.cardRemovedIndirect":
case "cardbook.cardRemovedDirect":
case "cardbook.cardModifiedIndirect":
case "cardbook.syncRunning":
case "cardbook.cardPasted":
case "cardbook.cardDragged":
case "cardbook.cardImportedFromFile":
......@@ -245,11 +247,13 @@ if ("undefined" == typeof(cardbookObserver)) {
switch (aTopic) {
case "cardbook.catAddedIndirect":
break;
case "cardbook.syncRunning":
wdw_cardbook.refreshWindow(aData);
break;
case "cardbook.cardAddedIndirect":
case "cardbook.cardRemovedIndirect":
case "cardbook.cardRemovedDirect":
case "cardbook.cardModifiedIndirect":
case "cardbook.syncRunning":
case "cardbook.cardPasted":
case "cardbook.cardDragged":
case "cardbook.cardImportedFromFile":
......
......@@ -2072,7 +2072,7 @@ if ("undefined" == typeof(cardbookSynchronization)) {
cardbookRepository.lTimerSyncAll[aPrefId] = Components.classes["@mozilla.org/timer;1"].createInstance(Components.interfaces.nsITimer);
var lTimerSync = cardbookRepository.lTimerSyncAll[aPrefId];
lTimerSync.initWithCallback({ notify: function(lTimerSync) {
cardbookUtils.notifyObservers("cardbook.syncRunning");
cardbookUtils.notifyObservers("cardbook.syncRunning", "syncaccountid:" + aPrefId);
if (cardbookRepository.cardbookServerSyncCompareWithCacheDone[aPrefId] != 0) {
if (cardbookRepository.cardbookServerSyncCompareWithCacheDone[aPrefId] == cardbookRepository.cardbookServerSyncCompareWithCacheTotal[aPrefId]) {
cardbookRepository.cardbookServerSyncCompareWithCacheDone[aPrefId] = 0;
......@@ -2142,7 +2142,7 @@ if ("undefined" == typeof(cardbookSynchronization)) {
cardbookRepository.lTimerDirAll[aPrefId] = Components.classes["@mozilla.org/timer;1"].createInstance(Components.interfaces.nsITimer);
var lTimerDir = cardbookRepository.lTimerDirAll[aPrefId];
lTimerDir.initWithCallback({ notify: function(lTimerDir) {
cardbookUtils.notifyObservers("cardbook.syncRunning");
cardbookUtils.notifyObservers("cardbook.syncRunning", "syncaccountid:" + aPrefId);
if (cardbookRepository.cardbookServerSyncHandleRemainingDone[aPrefId] == cardbookRepository.cardbookServerSyncHandleRemainingTotal[aPrefId]) {
var request = cardbookSynchronization.getRequest(aPrefId, aPrefName) + cardbookSynchronization.getTotal(aPrefId, aPrefName);
var response = cardbookSynchronization.getResponse(aPrefId, aPrefName) + cardbookSynchronization.getDone(aPrefId, aPrefName);
......@@ -2167,7 +2167,7 @@ if ("undefined" == typeof(cardbookSynchronization)) {
cardbookRepository.lTimerLoadCacheAll[aPrefId] = Components.classes["@mozilla.org/timer;1"].createInstance(Components.interfaces.nsITimer);
var lTimerLoadCache = cardbookRepository.lTimerLoadCacheAll[aPrefId];
lTimerLoadCache.initWithCallback({ notify: function(lTimerLoadCache) {
cardbookUtils.notifyObservers("cardbook.syncRunning");
cardbookUtils.notifyObservers("cardbook.syncRunning", "syncaccountid:" + aPrefId);
wdw_cardbooklog.updateStatusProgressInformationWithDebug1(aPrefName + " : debug mode : cardbookRepository.cardbookServerSyncEmptyCache : ", cardbookRepository.cardbookServerSyncEmptyCache[aPrefId]);
wdw_cardbooklog.updateStatusProgressInformationWithDebug1(aPrefName + " : debug mode : cardbookRepository.cardbookServerSyncLoadCacheDone : ", cardbookRepository.cardbookServerSyncLoadCacheDone[aPrefId]);
wdw_cardbooklog.updateStatusProgressInformationWithDebug1(aPrefName + " : debug mode : cardbookRepository.cardbookServerSyncLoadCacheTotal : ", cardbookRepository.cardbookServerSyncLoadCacheTotal[aPrefId]);
......@@ -2199,7 +2199,7 @@ if ("undefined" == typeof(cardbookSynchronization)) {
cardbookRepository.lTimerImportAll[aPrefId] = Components.classes["@mozilla.org/timer;1"].createInstance(Components.interfaces.nsITimer);
var lTimerImport = cardbookRepository.lTimerImportAll[aPrefId];
lTimerImport.initWithCallback({ notify: function(lTimerImport) {
cardbookUtils.notifyObservers("cardbook.syncRunning");
cardbookUtils.notifyObservers("cardbook.syncRunning", "syncaccountid:" + aPrefId);
var request = cardbookSynchronization.getRequest(aPrefId, aPrefName) + cardbookSynchronization.getTotal(aPrefId, aPrefName);
var response = cardbookSynchronization.getResponse(aPrefId, aPrefName) + cardbookSynchronization.getDone(aPrefId, aPrefName);
if (request == response) {
......@@ -2219,7 +2219,7 @@ if ("undefined" == typeof(cardbookSynchronization)) {
cardbookRepository.lComplexSearchAll[aPrefId] = Components.classes["@mozilla.org/timer;1"].createInstance(Components.interfaces.nsITimer);
var lComplexSearch = cardbookRepository.lComplexSearchAll[aPrefId];
lComplexSearch.initWithCallback({ notify: function(lComplexSearch) {
cardbookUtils.notifyObservers("cardbook.syncRunning");
cardbookUtils.notifyObservers("cardbook.syncRunning", "syncaccountid:" + aPrefId);
var request = cardbookSynchronization.getRequest(aPrefId, aPrefName);
var response = cardbookSynchronization.getResponse(aPrefId, aPrefName);
if (request == response) {
......
......@@ -1427,17 +1427,20 @@ if ("undefined" == typeof(cardbookUtils)) {
getSelectedCards: function () {
var myTree = document.getElementById('cardsTree');
var listOfUid = [];
var listOfSelectedCard = [];
var numRanges = myTree.view.selection.getRangeCount();
var start = new Object();
var end = new Object();
for (var i = 0; i < numRanges; i++) {
myTree.view.selection.getRangeAt(i,start,end);
for (var j = start.value; j <= end.value; j++){
listOfUid.push(myTree.view.getCellText(j, {id: "uid"}));
var myId = myTree.view.getCellText(j, {id: "cbid"});
if (cardbookRepository.cardbookCards[myId]) {
listOfSelectedCard.push(cardbookRepository.cardbookCards[myId]);
}
}
}
return listOfUid;
return listOfSelectedCard;
},
getSelectedCardsCount: function () {
......@@ -1466,20 +1469,30 @@ if ("undefined" == typeof(cardbookUtils)) {
}
},
setSelectedCards: function (aListOfUid, aFirstVisibleRow, aLastVisibleRow) {
if (aListOfUid.length == 0) {
setSelectedCards: function (aListOfCard, aFirstVisibleRow, aLastVisibleRow) {
var myList = JSON.parse(JSON.stringify(aListOfCard));
if (myList.length == 0) {
return;
}
var foundIndex;
var foundIndex = 0;
var myTree = document.getElementById('cardsTree');
for (var i = 0; i < aListOfUid.length; i++) {
for (var j = 0; j < myTree.view.rowCount; j++) {
if (myTree.view.getCellText(j, {id: "uid"}) == aListOfUid[i]) {
myTree.view.selection.rangedSelect(j,j,true);
myTree.view.selection.clearSelection();
// the list of Cards should be ordered
var treeLength = myTree.view.rowCount;
for (var j = 0; j < treeLength; j++) {
if (myList.length == 0) {
break;
}
if (myTree.view.getCellText(j, {id: "cbid"}) == myList[0].cbid) {
myTree.view.selection.rangedSelect(j,j,true);
myList.shift();
if (foundIndex == 0) {
foundIndex = j;
break;
}
}
if (j == treeLength -1) {
break;
}
}
if (foundIndex < aFirstVisibleRow || foundIndex > aLastVisibleRow) {
myTree.boxObject.scrollToRow(foundIndex);
......@@ -1512,7 +1525,7 @@ if ("undefined" == typeof(cardbookUtils)) {
for (var i = 0; i < numRanges; i++) {
myTree.view.selection.getRangeAt(i,start,end);
for (var j = start.value; j <= end.value; j++){
listOfUid.push(myTree.view.getCellText(j, {id: "dirPrefId"}) + "::" + myTree.view.getCellText(j, {id: "uid"}));
listOfUid.push(myTree.view.getCellText(j, {id: "cbid"}));
}
}
return listOfUid;
......@@ -1736,7 +1749,7 @@ if ("undefined" == typeof(cardbookUtils)) {
for (var i = 0; i < numRanges; i++) {
myTree.view.selection.getRangeAt(i,start,end);
for (var j = start.value; j <= end.value; j++){
listOfSelectedCard.push(cardbookRepository.cardbookCards[myTree.view.getCellText(j, {id: "dirPrefId"})+"::"+myTree.view.getCellText(j, {id: "uid"})]);
listOfSelectedCard.push(cardbookRepository.cardbookCards[myTree.view.getCellText(j, {id: "cbid"})]);
}
}
return listOfSelectedCard;
......
......@@ -718,40 +718,50 @@ if ("undefined" == typeof(wdw_cardbookContactsSidebar)) {
document.getElementById('peopleSearchInput').placeholder = strBundle.getString("cardbookSearchInputDefault");
},
onABChange: function () {
var addrbookColumn = document.getElementById("addrbook");
if (document.getElementById('CardBookABMenulist').selectedItem.value != "allAddressBooks" && document.getElementById('CardBookABMenulist').selectedItem.getAttribute("ABtype") != "search") {
addrbookColumn.setAttribute('hidden', 'true');
addrbookColumn.setAttribute('ignoreincolumnpicker', "true");
onABChange: function (aParams) {
// no need to refresh cards for others syncing dirprefid
if (aParams && aParams.search(/^syncaccountid:/) != -1) {
mySyncAccountId = aParams.replace(/^syncaccountid:/, "");
var mySyncCondition = (mySyncAccountId == document.getElementById('CardBookABMenulist').selectedItem.value ||
document.getElementById('CardBookABMenulist').selectedItem.value == "allAddressBooks");
} else {
addrbookColumn.removeAttribute('hidden');
addrbookColumn.removeAttribute('ignoreincolumnpicker');
mySyncCondition = true;
}
var ABList = document.getElementById('CardBookABMenulist').selectedItem;
if (ABList.value != null && ABList.value !== undefined && ABList.value != "") {
var ABDefaultValue = ABList.value;
} else {
var ABDefaultValue = 0;
}
var categoryList = document.getElementById('categoriesMenulist');
if (categoryList.value != null && categoryList.value !== undefined && categoryList.value != "") {
var categoryDefaultValue = categoryList.value;
} else {
var categoryDefaultValue = 0;
}
cardbookElementTools.loadCategories("categoriesMenupopup", "categoriesMenulist", ABDefaultValue, categoryDefaultValue, true, true, true, false,
wdw_cardbookContactsSidebar.catInclRestrictions, wdw_cardbookContactsSidebar.catExclRestrictions);
if (document.getElementById('categoriesMenulist').itemCount == 3) {
document.getElementById('categoriesPickerLabel').setAttribute('hidden', 'true');
document.getElementById('categoriesMenulist').setAttribute('hidden', 'true');
} else {
document.getElementById('categoriesPickerLabel').removeAttribute('hidden');
document.getElementById('categoriesMenulist').removeAttribute('hidden');
if (mySyncCondition) {
var addrbookColumn = document.getElementById("addrbook");
if (document.getElementById('CardBookABMenulist').selectedItem.value != "allAddressBooks" && document.getElementById('CardBookABMenulist').selectedItem.getAttribute("ABtype") != "search") {
addrbookColumn.setAttribute('hidden', 'true');
addrbookColumn.setAttribute('ignoreincolumnpicker', "true");
} else {
addrbookColumn.removeAttribute('hidden');
addrbookColumn.removeAttribute('ignoreincolumnpicker');
}
var ABList = document.getElementById('CardBookABMenulist').selectedItem;
if (ABList.value != null && ABList.value !== undefined && ABList.value != "") {
var ABDefaultValue = ABList.value;
} else {
var ABDefaultValue = 0;
}
var categoryList = document.getElementById('categoriesMenulist');
if (categoryList.value != null && categoryList.value !== undefined && categoryList.value != "") {
var categoryDefaultValue = categoryList.value;
} else {
var categoryDefaultValue = 0;
}
cardbookElementTools.loadCategories("categoriesMenupopup", "categoriesMenulist", ABDefaultValue, categoryDefaultValue, true, true, true, false,
wdw_cardbookContactsSidebar.catInclRestrictions, wdw_cardbookContactsSidebar.catExclRestrictions);
if (document.getElementById('categoriesMenulist').itemCount == 3) {
document.getElementById('categoriesPickerLabel').setAttribute('hidden', 'true');
document.getElementById('categoriesMenulist').setAttribute('hidden', 'true');
} else {
document.getElementById('categoriesPickerLabel').removeAttribute('hidden');
document.getElementById('categoriesMenulist').removeAttribute('hidden');
}
wdw_cardbookContactsSidebar.search();
}
wdw_cardbookContactsSidebar.search();
},
// works only when the restrictions are changed
......
......@@ -165,6 +165,8 @@
<splitter class="tree-splitter"/>
<treecol id="uid" label="&uidColumnLabel;" flex="1" persist="width ordinal hidden" style="text-align:left" hidden="true" class="sortDirectionIndicator" sortDirection="ascending"/>
<splitter class="tree-splitter"/>
<treecol id="cbid" label="&cbidColumnLabel;" flex="1" persist="width ordinal hidden" style="text-align:left" hidden="true" class="sortDirectionIndicator" sortDirection="ascending"/>
<splitter class="tree-splitter"/>
<treecol id="dispurl" label="&dispurlColumnLabel;" flex="1" persist="width ordinal hidden" style="text-align:left" hidden="true" class="sortDirectionIndicator" sortDirection="ascending"/>
<splitter class="tree-splitter"/>
<treecol id="version" label="&versionColumnLabel;" flex="1" persist="width ordinal hidden" style="text-align:left" hidden="true" class="sortDirectionIndicator" sortDirection="ascending"/>
......
......@@ -90,7 +90,7 @@ if ("undefined" == typeof(ovl_synchro)) {
prefs.setCharPref("accountsShown", "all");
prefs.setCharPref("uncategorizedCards", "");
prefs.setCharPref("addonVersion", "26.2");
prefs.setCharPref("addonVersion", "26.3");
},
lEventTimerSync : { notify: function(lTimerSync) {
......
This diff is collapsed.
......@@ -93,6 +93,7 @@
<!ENTITY prodidColumnLabel "Prodid">
<!ENTITY sortstringColumnLabel "Řadící řetězec">
<!ENTITY uidColumnLabel "Uid">
<!ENTITY cbidColumnLabel "CardBook id">
<!ENTITY dispurlColumnLabel "URL">
<!ENTITY versionColumnLabel "Verze">
<!ENTITY class1ColumnLabel "Třída">
......
......@@ -93,6 +93,7 @@
<!ENTITY prodidColumnLabel "Prodid">
<!ENTITY sortstringColumnLabel "Sorteringsstreng">
<!ENTITY uidColumnLabel "Uid">
<!ENTITY cbidColumnLabel "CardBook id">
<!ENTITY dispurlColumnLabel "URL">
<!ENTITY versionColumnLabel "Version">
<!ENTITY class1ColumnLabel "Klasse">
......
......@@ -93,6 +93,7 @@
<!ENTITY prodidColumnLabel "Prodid">
<!ENTITY sortstringColumnLabel "Sortierbegriff">
<!ENTITY uidColumnLabel "Uid">
<!ENTITY cbidColumnLabel "CardBook id">
<!ENTITY dispurlColumnLabel "URL">
<!ENTITY versionColumnLabel "Version">
<!ENTITY class1ColumnLabel "Klasse">
......
......@@ -93,6 +93,7 @@
<!ENTITY prodidColumnLabel "Prodid">
<!ENTITY sortstringColumnLabel "Sort String">
<!ENTITY uidColumnLabel "Uid">
<!ENTITY cbidColumnLabel "CardBook id">
<!ENTITY dispurlColumnLabel "URL">
<!ENTITY versionColumnLabel "Version">
<!ENTITY class1ColumnLabel "Class">
......
......@@ -93,6 +93,7 @@
<!ENTITY prodidColumnLabel "Prodid">
<!ENTITY sortstringColumnLabel "Sort string">
<!ENTITY uidColumnLabel "Uid">
<!ENTITY cbidColumnLabel "CardBook id">
<!ENTITY dispurlColumnLabel "URL">
<!ENTITY versionColumnLabel "Version">
<!ENTITY class1ColumnLabel "Class">
......
......@@ -93,6 +93,7 @@
<!ENTITY prodidColumnLabel "Prodid">
<!ENTITY sortstringColumnLabel "Poredaj niz">
<!ENTITY uidColumnLabel "Uid">
<!ENTITY cbidColumnLabel "CardBook id">
<!ENTITY dispurlColumnLabel "URL">
<!ENTITY versionColumnLabel "Bilješke">
<!ENTITY class1ColumnLabel "Klasa">
......
......@@ -93,6 +93,7 @@
<!ENTITY prodidColumnLabel "Prodid">
<!ENTITY sortstringColumnLabel "String rendezése">
<!ENTITY uidColumnLabel "Uid">
<!ENTITY cbidColumnLabel "CardBook id">
<!ENTITY dispurlColumnLabel "Webcím">
<!ENTITY versionColumnLabel "Változat">
<!ENTITY class1ColumnLabel "Osztály">
......
......@@ -93,6 +93,7 @@
<!ENTITY prodidColumnLabel "Produk Identitas">
<!ENTITY sortstringColumnLabel "Urutkan String">
<!ENTITY uidColumnLabel "Uid">
<!ENTITY cbidColumnLabel "CardBook id">
<!ENTITY dispurlColumnLabel "Alamat URL">
<!ENTITY versionColumnLabel "Versi">
<!ENTITY class1ColumnLabel "Kelas">
......
......@@ -93,6 +93,7 @@
<!ENTITY prodidColumnLabel "Prodid">
<!ENTITY sortstringColumnLabel "Ordina stringa">
<!ENTITY uidColumnLabel "Uid">
<!ENTITY cbidColumnLabel "CardBook id">
<!ENTITY dispurlColumnLabel "URL">
<!ENTITY versionColumnLabel "Versione">
<!ENTITY class1ColumnLabel "Class">
......
......@@ -93,6 +93,7 @@
<!ENTITY prodidColumnLabel "제품 신분증">
<!ENTITY sortstringColumnLabel "문자열 정렬">
<!ENTITY uidColumnLabel "사용자 번호">
<!ENTITY cbidColumnLabel "??CardBook id??">
<!ENTITY dispurlColumnLabel "URL 주소">
<!ENTITY versionColumnLabel "버전">
<!ENTITY class1ColumnLabel "수업">
......
......@@ -93,6 +93,7 @@
<!ENTITY prodidColumnLabel "Produkto identifikatorius">
<!ENTITY sortstringColumnLabel "Rūšiuoti eilutę">
<!ENTITY uidColumnLabel "Uid">
<!ENTITY cbidColumnLabel "CardBook id">
<!ENTITY dispurlColumnLabel "Tinklalapis">
<!ENTITY versionColumnLabel "Versija">
<!ENTITY class1ColumnLabel "Klasė">
......
......@@ -93,6 +93,7 @@
<!ENTITY prodidColumnLabel "Prodid">
<!ENTITY sortstringColumnLabel "Sorteerkenmerk">
<!ENTITY uidColumnLabel "Uid">
<!ENTITY cbidColumnLabel "CardBook id">
<!ENTITY dispurlColumnLabel "URL">
<!ENTITY versionColumnLabel "Versie">
<!ENTITY class1ColumnLabel "Klasse">
......
......@@ -93,6 +93,7 @@
<!ENTITY prodidColumnLabel "Prodid">
<!ENTITY sortstringColumnLabel "Sortowanie po">
<!ENTITY uidColumnLabel "Uid">
<!ENTITY cbidColumnLabel "CardBook id">
<!ENTITY dispurlColumnLabel "URL">
<!ENTITY versionColumnLabel "Wersja">
<!ENTITY class1ColumnLabel "Klasa">
......
......@@ -93,6 +93,7 @@
<!ENTITY prodidColumnLabel "Prodid">
<!ENTITY sortstringColumnLabel "Sort string">
<!ENTITY uidColumnLabel "Uid">
<!ENTITY cbidColumnLabel "CardBook id">
<!ENTITY dispurlColumnLabel "URL">
<!ENTITY versionColumnLabel "Versão">
<!ENTITY class1ColumnLabel "Classe">
......
......@@ -93,6 +93,7 @@
<!ENTITY prodidColumnLabel "Identificatorul produsului">
<!ENTITY sortstringColumnLabel "Sortați șirul">
<!ENTITY uidColumnLabel "Uid">
<!ENTITY cbidColumnLabel "CardBook id">
<!ENTITY dispurlColumnLabel "Adresa URL">
<!ENTITY versionColumnLabel "Versiune">
<!ENTITY class1ColumnLabel "Clasă">
......
......@@ -93,6 +93,7 @@
<!ENTITY prodidColumnLabel "Product ID">
<!ENTITY sortstringColumnLabel "Строка для сортировки">
<!ENTITY uidColumnLabel "Uid">
<!ENTITY cbidColumnLabel "CardBook id">
<!ENTITY dispurlColumnLabel "URL">
<!ENTITY versionColumnLabel "Версия">
<!ENTITY class1ColumnLabel "Классификатор доступа">
......
......@@ -93,6 +93,7 @@
<!ENTITY prodidColumnLabel "Prodid">
<!ENTITY sortstringColumnLabel "Niz za razvrščanje">
<!ENTITY uidColumnLabel "Uid">
<!ENTITY cbidColumnLabel "CardBook id">
<!ENTITY dispurlColumnLabel "URL">
<!ENTITY versionColumnLabel "Različica">
<!ENTITY class1ColumnLabel "Razred">
......
......@@ -93,6 +93,7 @@
<!ENTITY prodidColumnLabel "Prodid">
<!ENTITY sortstringColumnLabel "Sorterings stäng">
<!ENTITY uidColumnLabel "Uid">
<!ENTITY cbidColumnLabel "CardBook id">
<!ENTITY dispurlColumnLabel "URL">
<!ENTITY versionColumnLabel "Version">
<!ENTITY class1ColumnLabel "Class">
......
......@@ -93,6 +93,7 @@
<!ENTITY prodidColumnLabel "Danh tính Sản phẩm">
<!ENTITY sortstringColumnLabel "Sắp xếp chuỗi">
<!ENTITY uidColumnLabel "Uid">
<!ENTITY cbidColumnLabel "CardBook id">
<!ENTITY dispurlColumnLabel "Địa chỉ URL">
<!ENTITY versionColumnLabel "Phiên bản">
<!ENTITY class1ColumnLabel "Lớp học">
......
......@@ -6,7 +6,7 @@
<Description about="urn:mozilla:install-manifest">
<em:id>cardbook@vigneau.philippe</em:id>
<em:name>CardBook</em:name>
<em:version>26.2</em:version>
<em:version>26.3</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