Commit 45a122f3 authored by CardBook's avatar CardBook

version 24.5

parent 6f2173bc
......@@ -2,6 +2,8 @@
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://cardbook/skin/cardbookMain.css" type="text/css"?>
<?xml-stylesheet href="chrome://cardbook/skin/cardbookAddressBooks.css" type="text/css"?>
<!-- for the icons of the CardBook menus -->
<?xml-stylesheet href="chrome://cardbook-os/skin/cardbookMenuIcons.css" type="text/css"?>
<!-- for the small-button class -->
<?xml-stylesheet href="chrome://messenger/skin/searchDialog.css" type="text/css"?>
<!-- for the minimonth class -->
......@@ -59,9 +61,9 @@
<menupopup id="imageCardContextMenu" onpopupshowing="wdw_imageEdition.imageCardContextShowing();">
<menuitem id="addImageCardFromFile" label="&addImageCardFromFileLabel;" oncommand="wdw_imageEdition.addImageCardFromFile();"/>
<menuitem id="addImageCardFromClipboard" label="&addImageCardFromClipboardLabel;" oncommand="wdw_imageEdition.addImageCardFromClipboard();"/>
<menuitem id="addImageCardFromUrl" label="&addImageCardFromUrlLabel;" oncommand="wdw_imageEdition.addImageCardFromUrl();"/>
<menuitem id="pasteImageCard" label="&pasteImageCardLabel;" oncommand="wdw_imageEdition.pasteImageCard();"/>
<menuitem id="saveImageCard" label="&saveImageCardLabel;" oncommand="wdw_imageEdition.saveImageCard();"/>
<menuitem id="copyImageCard" label="&copyImageCardLabel;" oncommand="wdw_imageEdition.copyImageCard();"/>
<menuitem id="deleteImageCard" label="&deleteImageCardLabel;" oncommand="wdw_imageEdition.deleteImageCard();"/>
</menupopup>
......@@ -127,7 +129,9 @@
<vbox align="center" width="170px">
<hbox id="imageBox" align="center" height="170px">
<html:img id="imageForSizing" hidden="true"/>
<image id="defaultCardImage" context="imageCardContextMenu" ondblclick="wdw_imageEdition.addImageCardFromFile();"/>
<image id="defaultCardImage" context="imageCardContextMenu" ondblclick="wdw_imageEdition.addImageCardFromFile();"
ondrop="wdw_imageEdition.dragImageCard(event);" ondragenter="wdw_imageEdition.checkDragImageCard(event);"
ondragover="wdw_imageEdition.checkDragImageCard(event);"/>
</hbox>
</vbox>
</hbox>
......
......@@ -890,7 +890,7 @@ if ("undefined" == typeof(cardbookUtils)) {
}
}
document.getElementById('defaultCardImage').src = "";
wdw_imageEdition.clearImageCard();
cardbookElementTools.deleteRows('addedCardsGroupbox');
cardbookElementTools.deleteRows('mailPopularityGroupbox');
},
......@@ -1899,12 +1899,7 @@ if ("undefined" == typeof(cardbookUtils)) {
clipboardSet: function (aText, aMessage) {
let ss = Components.classes['@mozilla.org/supports-string;1'].createInstance(Components.interfaces.nsISupportsString);
if (!ss)
return;
let trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
if (!trans)
return;
let clipid = Components.interfaces.nsIClipboard;
let clipboard = Components.classes['@mozilla.org/widget/clipboard;1'].getService(clipid);
......@@ -1924,7 +1919,6 @@ if ("undefined" == typeof(cardbookUtils)) {
clipboardGet: function () {
try {
let clipboard = Services.clipboard;
let trans = Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);
trans.addDataFlavor("text/unicode");
......@@ -2034,7 +2028,7 @@ if ("undefined" == typeof(cardbookUtils)) {
cleanEtag: function (aEtag) {
if (aEtag) {
if (aEtag.indexOf("https://") == 0 || aEtag.indexOf("http://") == 0 ) {
if (aEtag.startsWith("https://") || aEtag.startsWith("http://") ) {
// for open-exchange
var myEtagArray = aEtag.split("/");
aEtag = myEtagArray[myEtagArray.length - 1];
......@@ -2744,7 +2738,7 @@ if ("undefined" == typeof(cardbookUtils)) {
cardbookUtils.setCardUUID(aCard);
}
var windowsList = Services.wm.getEnumerator("CardBook:contactEditionWindow");
var found = false
var found = false;
while (windowsList.hasMoreElements()) {
var myWindow = windowsList.getNext();
if (myWindow.arguments[0] && myWindow.arguments[0].cardIn && myWindow.arguments[0].cardIn.cbid == aCard.cbid) {
......
......@@ -74,7 +74,7 @@ if ("undefined" == typeof(wdw_cardbookContactsSidebar)) {
columnName = myTree.getAttribute("sortResource");
}
switch(columnName) {
case "Fn":
case "GeneratedName":
columnArray=0;
break;
case "AB":
......@@ -123,7 +123,7 @@ if ("undefined" == typeof(wdw_cardbookContactsSidebar)) {
cycleHeader: function(idx) { return false },
isEditable: function(idx, column) { return false },
getCellText: function(idx, column) {
if (column.id == "Fn") return wdw_cardbookContactsSidebar.searchResults[idx][0];
if (column.id == "GeneratedName") return wdw_cardbookContactsSidebar.searchResults[idx][0];
else if (column.id == "AB") return wdw_cardbookContactsSidebar.searchResults[idx][1];
else if (column.id == "Emails") return wdw_cardbookContactsSidebar.searchResults[idx][2];
},
......
......@@ -90,10 +90,10 @@
<separator class="thin"/>
<tree id="abResultsTree" class="plain" flex="1" context="cardProperties" persist="height sortDirection sortResource" sortDirection="ascending" sortResource="Fn"
<tree id="abResultsTree" class="plain" flex="1" context="cardProperties" persist="height sortDirection sortResource" sortDirection="ascending" sortResource="GeneratedName"
onclick="wdw_cardbookContactsSidebar.sortTrees(event);">
<treecols id="abResultsTreeCols">
<treecol id="Fn" label="&nameLabel;" flex="1" persist="width ordinal hidden" editable="false"/>
<treecol id="GeneratedName" label="&nameLabel;" flex="1" persist="width ordinal hidden" editable="false"/>
<splitter class="tree-splitter"/>
<treecol id="AB" label="&ABLabel;" flex="1" hidden="true" persist="width ordinal hidden" editable="false"/>
<splitter class="tree-splitter"/>
......
......@@ -75,8 +75,9 @@ if ("undefined" == typeof(ovl_filters)) {
}
if (aSearchOp == Components.interfaces.nsMsgSearchOp.IsntInAB) {
return !matches;
} else {
return matches;
}
return matches;
},
onLoad: function () {
......@@ -199,10 +200,17 @@ if ("undefined" == typeof(ovl_filters)) {
// true && false => false
// true || false => true
match: function (aMsgHdr, aSearchValue, aSearchOp) {
return (ovl_filters._matchEmails(aMsgHdr.author, aSearchValue, aSearchOp) ||
ovl_filters._matchEmails(aMsgHdr.recipients, aSearchValue, aSearchOp) ||
ovl_filters._matchEmails(aMsgHdr.ccList, aSearchValue, aSearchOp) ||
ovl_filters._matchEmails(aMsgHdr.bccList, aSearchValue, aSearchOp));
if (aSearchOp == Components.interfaces.nsMsgSearchOp.IsntInAB) {
return (ovl_filters._matchEmails(aMsgHdr.author, aSearchValue, aSearchOp) &&
ovl_filters._matchEmails(aMsgHdr.recipients, aSearchValue, aSearchOp) &&
ovl_filters._matchEmails(aMsgHdr.ccList, aSearchValue, aSearchOp) &&
ovl_filters._matchEmails(aMsgHdr.bccList, aSearchValue, aSearchOp));
} else {
return (ovl_filters._matchEmails(aMsgHdr.author, aSearchValue, aSearchOp) ||
ovl_filters._matchEmails(aMsgHdr.recipients, aSearchValue, aSearchOp) ||
ovl_filters._matchEmails(aMsgHdr.ccList, aSearchValue, aSearchOp) ||
ovl_filters._matchEmails(aMsgHdr.bccList, aSearchValue, aSearchOp));
}
}
};
MailServices.filters.addCustomTerm(searchAll);
......
......@@ -233,7 +233,9 @@ if ("undefined" == typeof(wdw_findDuplicates)) {
changed = true;
}
if (changed) {
wdw_findDuplicates.load();
wdw_findDuplicates.gResults.splice(myId, 1)
wdw_findDuplicates.loadCssRules();
wdw_findDuplicates.displayResults();
}
};
aButton.addEventListener("click", fireButton, false);
......
......@@ -22,6 +22,7 @@
<!ENTITY % orgDTD SYSTEM "chrome://cardbook/locale/wdw_orgEdition.dtd"> %orgDTD;
<!ENTITY % adrDTD SYSTEM "chrome://cardbook/locale/wdw_adrEdition.dtd"> %adrDTD;
<!ENTITY % listsDTD SYSTEM "chrome://cardbook/locale/wdw_lists.dtd"> %listsDTD;
<!ENTITY % imagesDTD SYSTEM "chrome://cardbook/locale/wdw_images.dtd"> %imagesDTD;
<!ENTITY % logDTD SYSTEM "chrome://cardbook/locale/wdw_logEdition.dtd"> %logDTD;
<!ENTITY % configurationDTD SYSTEM "chrome://cardbook/locale/wdw_cardbookConfiguration.dtd"> %configurationDTD;
]>
......@@ -353,8 +354,12 @@
<menuitem id="exportCardsToDirFromCards" label="&exportCardToDirLabel;" oncommand="wdw_cardbook.exportCardsFromCards(this);"/>
</menupopup>
<menupopup id="imageCardContextMenu">
<menuitem id="saveImageCard" label="&saveImageCardLabel;" oncommand="wdw_imageEdition.saveImageCard();"/>
<menuitem id="copyImageCard" label="&copyImageCardLabel;" oncommand="wdw_imageEdition.copyImageCard();"/>
</menupopup>
<menupopup id="listsContextMenu" onpopupshowing="wdw_cardbook.cardListContextShowing(event);">
<menuitem id="editCardFromList" label="&editCardFromListLabel;" oncommand="wdw_cardbook.editCardFromList();"/>
</menupopup>
</overlay>
......@@ -36,6 +36,7 @@
<menupopup id="urlTreeContextMenu"/>
<menupopup id="accountsOrCatsTreeContextMenu"/>
<menupopup id="cardsTreeContextMenu"/>
<menupopup id="imageCardContextMenu"/>
<menupopup id="listsContextMenu"/>
<hbox id="mainHbox" flex="1">
......@@ -218,7 +219,7 @@
<vbox id="imageBox" align="center" width="170px">
<hbox align="center" height="170px">
<html:img id="imageForSizing" hidden="true"/>
<image id="defaultCardImage"/>
<image id="defaultCardImage" context="imageCardContextMenu"/>
</hbox>
</vbox>
<vbox flex="1">
......
......@@ -94,7 +94,7 @@ if ("undefined" == typeof(ovl_synchro)) {
prefs.setCharPref("accountsShown", "all");
prefs.setCharPref("accountShown", "");
prefs.setCharPref("uncategorizedCards", "");
prefs.setCharPref("addonVersion", "28.3");
prefs.setCharPref("addonVersion", "28.5");
},
lEventTimerSync : { notify: function(lTimerSync) {
......
......@@ -243,8 +243,16 @@ if ("undefined" == typeof(wdw_cardbook)) {
if (cardbookPreferences.getType(myCurrentDirPrefId) == "SEARCH" && cardbookPreferences.getEnabled(myCurrentDirPrefId)) {
wdw_cardbook.setComplexSearchMode(myCurrentDirPrefId);
}
cardbookUtils.setSelectedAccount(aAccountOrCat, wdw_cardbook.currentFirstVisibleRow, wdw_cardbook.currentLastVisibleRow);
// for the columns
if (wdw_cardbook.currentAccountId == aAccountOrCat) {
return;
}
wdw_cardbook.currentAccountId = aAccountOrCat;
cardbookPreferences.setStringPref("extensions.cardbook.accountShown", myCurrentDirPrefId);
cardbookUtils.setColumnsStateForAccount(myCurrentDirPrefId);
},
displaySearch: function (aListOfCards) {
......@@ -1601,7 +1609,17 @@ if ("undefined" == typeof(wdw_cardbook)) {
openLogEdition: function () {
if (cardbookUtils.getBroadcasterOnCardBook()) {
var myWindow = window.openDialog("chrome://cardbook/content/wdw_logEdition.xul", "", cardbookRepository.windowParams);
var windowsList = Services.wm.getEnumerator("CardBook:logEditionWindow");
var found = false;
while (windowsList.hasMoreElements()) {
var myWindow = windowsList.getNext();
myWindow.focus();
found = true;
break;
}
if (!found) {
var myWindow = window.openDialog("chrome://cardbook/content/wdw_logEdition.xul", "", cardbookRepository.windowParams);
}
}
},
......
......@@ -11,6 +11,7 @@
onclose="wdw_logEdition.cancel();"
id="wdw_logEdition" title="&wdw_logEditionTitle;"
persist="screenX screenY width height"
windowtype="CardBook:logEditionWindow"
style="min-width:400px;min-height:100px;">
<stringbundleset id="stringbundleset"/>
......
<!ENTITY addImageCardFromFileLabel "Přidat obrázek ze souboru">
<!ENTITY addImageCardFromClipboardLabel "Přidat obrázek ze schránky">
<!ENTITY addImageCardFromUrlLabel "Přidat obrázek z URL ve schránce">
<!ENTITY pasteImageCardLabel "Vložit obrázek">
<!ENTITY saveImageCardLabel "Uložit obrázek">
<!ENTITY copyImageCardLabel "Kopírovat obrázek">
<!ENTITY deleteImageCardLabel "Smazat obrázek">
<!ENTITY addImageCardFromFileLabel "Tilføj billede fra en fil">
<!ENTITY addImageCardFromClipboardLabel "Tilføj billede fra udklipsholderen">
<!ENTITY addImageCardFromUrlLabel "Tilføj billede fra en URL i udklipsholderen">
<!ENTITY pasteImageCardLabel "Indsæt billede">
<!ENTITY saveImageCardLabel "Gem billede">
<!ENTITY copyImageCardLabel "Kopier billede">
<!ENTITY deleteImageCardLabel "Slet billede">
<!ENTITY addImageCardFromFileLabel "Bild aus Datei hinzufügen">
<!ENTITY addImageCardFromClipboardLabel "Bild aus der Zwischenablage hinzufügen">
<!ENTITY addImageCardFromUrlLabel "Bild aus einer URL in der Zwischenablage hinzufügen">
<!ENTITY pasteImageCardLabel "Bild einfügen">
<!ENTITY saveImageCardLabel "Bild speichern">
<!ENTITY copyImageCardLabel "Bild kopieren">
<!ENTITY deleteImageCardLabel "Bild löschen">
<!ENTITY addImageCardFromFileLabel "Προσθήκη εικόνας από ένα αρχείο">
<!ENTITY addImageCardFromClipboardLabel "Προσθέστε εικόνα από το πρόχειρο">
<!ENTITY addImageCardFromUrlLabel "Προσθήκη εικόνας από μια διεύθυνση παγκόσμιο εντοπισμό πόρων πρόχειρου">
<!ENTITY pasteImageCardLabel "Επικόλληση εικόνας">
<!ENTITY saveImageCardLabel "Αποθήκευση εικόνας">
<!ENTITY copyImageCardLabel "Αντιγραφή εικόνας">
<!ENTITY deleteImageCardLabel "Διαγράψτε την εικόνα">
<!ENTITY addImageCardFromFileLabel "Add image from a file">
<!ENTITY addImageCardFromClipboardLabel "Add image from the clipboard">
<!ENTITY addImageCardFromUrlLabel "Add image from a clipboarded URL">
<!ENTITY saveImageCardLabel "Save image">
<!ENTITY deleteImageCardLabel "Delete image">
<!ENTITY pasteImageCardLabel "Paste Image">
<!ENTITY saveImageCardLabel "Save Image">
<!ENTITY copyImageCardLabel "Copy Image">
<!ENTITY deleteImageCardLabel "Delete Image">
<!ENTITY addImageCardFromFileLabel "Ajouter une image depuis un fichier">
<!ENTITY addImageCardFromClipboardLabel "Ajouter une image depuis le presse-papier">
<!ENTITY addImageCardFromUrlLabel "Ajouter une image depuis une URL copiée">
<!ENTITY pasteImageCardLabel "Coller une image">
<!ENTITY saveImageCardLabel "Sauver l'image">
<!ENTITY copyImageCardLabel "Copier l’image">
<!ENTITY deleteImageCardLabel "Supprimer l'image">
<!ENTITY addImageCardFromFileLabel "Dodaj sliku iz dosjea">
<!ENTITY addImageCardFromClipboardLabel "Dodaj sliku iz isječaka">
<!ENTITY addImageCardFromUrlLabel "Dodaj sliku s URL isječka">
<!ENTITY pasteImageCardLabel "Zalijepite sliku">
<!ENTITY saveImageCardLabel "Sašuvaj sliku">
<!ENTITY copyImageCardLabel "Kopiraj sliku">
<!ENTITY deleteImageCardLabel "Izbriši sliku">
<!ENTITY addImageCardFromFileLabel "Kép hozzáadása fájlból">
<!ENTITY addImageCardFromClipboardLabel "Kép hozzáadása a vágólapról">
<!ENTITY addImageCardFromUrlLabel "Kép hozzáadása vágólapra webcímet">
<!ENTITY pasteImageCardLabel "Kép beillesztése">
<!ENTITY saveImageCardLabel "Kép mentése">
<!ENTITY copyImageCardLabel "Kép másolása">
<!ENTITY deleteImageCardLabel "Kép törlése">
<!ENTITY addImageCardFromFileLabel "Tambahkan gambar dari sebuah file">
<!ENTITY addImageCardFromClipboardLabel "Tambahkan gambar dari papan klip">
<!ENTITY addImageCardFromUrlLabel "Tambahkan gambar dari URL papan klip">
<!ENTITY pasteImageCardLabel "Tempel Gambar">
<!ENTITY saveImageCardLabel "Simpan Gambar">
<!ENTITY copyImageCardLabel "Salin Gambar">
<!ENTITY deleteImageCardLabel "Hapus Gambar">
<!ENTITY addImageCardFromFileLabel "Aggiungi immagine da file">
<!ENTITY addImageCardFromClipboardLabel "Aggiungi immagine da appunti">
<!ENTITY addImageCardFromUrlLabel "Aggiungi immagine da URL negli appunti">
<!ENTITY pasteImageCardLabel "Incolla immagine">
<!ENTITY saveImageCardLabel "Salva immagine">
<!ENTITY copyImageCardLabel "Copia immagine">
<!ENTITY deleteImageCardLabel "Elimina immagine">
<!ENTITY addImageCardFromFileLabel "ファイルからイメージを追加する">
<!ENTITY addImageCardFromClipboardLabel "クリップボードから画像を追加する">
<!ENTITY addImageCardFromUrlLabel "クリップボードのユニフォームリソースロケータ「URL」から画像を追加する">
<!ENTITY pasteImageCardLabel "画像を貼り付け">
<!ENTITY saveImageCardLabel "画像を保存">
<!ENTITY copyImageCardLabel "画像をコピー">
<!ENTITY deleteImageCardLabel "画像を削除する">
<!ENTITY addImageCardFromFileLabel "파일머지 연락처에서 이미지 추가">
<!ENTITY addImageCardFromClipboardLabel "클립 보드에서 이미지 추가">
<!ENTITY addImageCardFromUrlLabel "클립 보드 URL에서 이미지 추가">
<!ENTITY pasteImageCardLabel "이미지 붙여 넣기">
<!ENTITY saveImageCardLabel "이미지를 저장">
<!ENTITY copyImageCardLabel "이미지 복사">
<!ENTITY deleteImageCardLabel "이미지 삭제">
<!ENTITY addImageCardFromFileLabel "Pridėti nuotrauką iš failo">
<!ENTITY addImageCardFromClipboardLabel "Įtraukti vaizdą iš iškarpinės">
<!ENTITY addImageCardFromUrlLabel "Pridėti vaizdą iš iškarpinės URL">
<!ENTITY pasteImageCardLabel "Įklijuoti paveikslėlį">
<!ENTITY saveImageCardLabel "Išsaugoti paveikslėlį">
<!ENTITY copyImageCardLabel "Kopijuoti paveikslą">
<!ENTITY deleteImageCardLabel "Pašalinti vaizdą">
<!ENTITY addImageCardFromFileLabel "Afbeelding toevoegen uit bestand">
<!ENTITY addImageCardFromClipboardLabel "Afbeelding toevoegen van prikbord">
<!ENTITY addImageCardFromUrlLabel "Afbeelding toevoegen van URL op prikbord">
<!ENTITY pasteImageCardLabel "Afbeelding plakken">
<!ENTITY saveImageCardLabel "Afbeelding opslaan">
<!ENTITY copyImageCardLabel "Afbeelding kopiëren">
<!ENTITY deleteImageCardLabel "Afbeelding verwijderen">
<!ENTITY addImageCardFromFileLabel "Dodaj obraz z pliku">
<!ENTITY addImageCardFromClipboardLabel "Dodaj obraz ze schowka">
<!ENTITY addImageCardFromUrlLabel "Dodaj obraz z adresu URL w schowku">
<!ENTITY pasteImageCardLabel "Wklej obraz">
<!ENTITY saveImageCardLabel "Zapisz obraz">
<!ENTITY copyImageCardLabel "Kopiuj obraz">
<!ENTITY deleteImageCardLabel "Usuń obraz">
<!ENTITY addImageCardFromFileLabel "Adicionar imagem de ficheiro">
<!ENTITY addImageCardFromClipboardLabel "Adicionar imagem do clipboard">
<!ENTITY addImageCardFromUrlLabel "Adicionar imagem de URL">
<!ENTITY pasteImageCardLabel "Colar a Imagem">
<!ENTITY saveImageCardLabel "Guardar imagem">
<!ENTITY copyImageCardLabel "Copiar imagem">
<!ENTITY deleteImageCardLabel "Apagar imagem">
<!ENTITY addImageCardFromFileLabel "Adăugați o imagine din fișier">
<!ENTITY addImageCardFromClipboardLabel "Adăugați o imagine din clipboard">
<!ENTITY addImageCardFromUrlLabel "Adăugați imaginea din adresa URL în clipboard">
<!ENTITY pasteImageCardLabel "Lipiți imaginea">
<!ENTITY saveImageCardLabel "Salvează imaginea">
<!ENTITY copyImageCardLabel "Copiază imaginea">
<!ENTITY deleteImageCardLabel "Ștergeți imaginea">
<!ENTITY addImageCardFromFileLabel "Добавить изображение из файла">
<!ENTITY addImageCardFromClipboardLabel "Добавить изображение из буфера обмена">
<!ENTITY addImageCardFromUrlLabel "Добавить изображение из URL из буфера обмена">
<!ENTITY pasteImageCardLabel "Вставить изображение">
<!ENTITY saveImageCardLabel "Сохранить изображение">
<!ENTITY copyImageCardLabel "Копировать изображение">
<!ENTITY deleteImageCardLabel "Удалить изображение">
<!ENTITY addImageCardFromFileLabel "Dodaj sliko iz datotke">
<!ENTITY addImageCardFromClipboardLabel "Dodaj sliko z odložišča">
<!ENTITY addImageCardFromUrlLabel "Dodaj sliko iz URL-ja na odložišču">
<!ENTITY pasteImageCardLabel "Prilepite sliko">
<!ENTITY saveImageCardLabel "Shrani sliko">
<!ENTITY copyImageCardLabel "Kopiraj sliko">
<!ENTITY deleteImageCardLabel "Izbriši sliko">
<!ENTITY addImageCardFromFileLabel "Lägg till bild från fil">
<!ENTITY addImageCardFromClipboardLabel "Lägg till bild från Urklipp">
<!ENTITY addImageCardFromUrlLabel "Lägg till bild från Urklipps länk">
<!ENTITY pasteImageCardLabel "Klistra in bild">
<!ENTITY saveImageCardLabel "Spara bild">
<!ENTITY copyImageCardLabel "Kopiera bild">
<!ENTITY deleteImageCardLabel "Ta bort bild">
<!ENTITY addImageCardFromFileLabel "Thêm ảnh từ Tập tin">
<!ENTITY addImageCardFromClipboardLabel "Thêm ảnh từ Khay nhớ tạm">
<!ENTITY addImageCardFromUrlLabel "Thêm ảnh từ Khay nhớ tạm Địa chỉ URL">
<!ENTITY pasteImageCardLabel "Dán Ảnh">
<!ENTITY saveImageCardLabel "Lưu Ảnh">
<!ENTITY copyImageCardLabel "Sao chép Ảnh">
<!ENTITY deleteImageCardLabel "Xóa Ảnh">
......@@ -31,12 +31,21 @@
list-style-image: url("moz-icon://stock/gtk-close?size=menu&state=disabled");
}
#saveImageCard {
list-style-image: url("moz-icon://stock/gtk-save-as?size=menu");
}
#saveImageCard[disabled] {
list-style-image: url("moz-icon://stock/gtk-save-as?size=menu&state=disabled");
}
#deleteImageCard,
#deleteCard,
#removeCatFromAccountsOrCats,
#cardbookContactsMenuRemoveCard,
#removeCardFromCards {
list-style-image: url("moz-icon://stock/gtk-delete?size=menu");
}
#deleteImageCard[disabled],
#deleteCard[disabled],
#removeCatFromAccountsOrCats[disabled],
#cardbookContactsMenuRemoveCard[disabled],
......@@ -55,6 +64,7 @@
list-style-image: url("moz-icon://stock/gtk-cut?size=menu&state=disabled");
}
#copyImageCard,
#copyadrTree,
#copytelTree,
#copyemailTree,
......@@ -65,6 +75,7 @@
#copyCardsFromCards {
list-style-image: url("moz-icon://stock/gtk-copy?size=menu");
}
#copyImageCard[disabled],
#copyadrTree[disabled],
#copytelTree[disabled],
#copyemailTree[disabled],
......@@ -76,6 +87,7 @@
list-style-image: url("moz-icon://stock/gtk-copy?size=menu&state=disabled");
}
#pasteImageCard,
#cardbookContactsMenuPasteEntry,
#pasteEntryFromCards,
#cardbookContactsMenuPasteCards,
......@@ -83,6 +95,7 @@
#pasteCardsFromCards {
list-style-image: url("moz-icon://stock/gtk-paste?size=menu");
}
#pasteImageCard[disabled],
#cardbookContactsMenuPasteEntry[disabled],
#pasteEntryFromCards[disabled],
#cardbookContactsMenuPasteCards[disabled],
......
......@@ -547,95 +547,95 @@ cardbookAutocompleteSearch.prototype = {
},
startSearchFor: function startSearchFor(aSearchString, aDirEntry, aStyle) {
try {
var uri = aDirEntry.uri;
var context;
if (uri in this.LDAPContexts) {
context = this.LDAPContexts[uri];
} else {
context = {};
context.style = aStyle;
context.showAddressbookComments = cardbookPreferences.getBoolPref("extensions.cardbook.autocompleteShowAddressbook");
context.bookName = aDirEntry.name;
context.book = MailServices.ab.getDirectory(uri).QueryInterface(Components.interfaces.nsIAbLDAPDirectory);
var uri = aDirEntry.uri;
var context;
if (uri in this.LDAPContexts) {
context = this.LDAPContexts[uri];
} else {
context = {};
context.style = aStyle;
context.showAddressbookComments = cardbookPreferences.getBoolPref("extensions.cardbook.autocompleteShowAddressbook");
context.bookName = aDirEntry.name;
context.book = MailServices.ab.getDirectory(uri).QueryInterface(Components.interfaces.nsIAbLDAPDirectory);
context.numQueries = 0;
context.query = Components.classes["@mozilla.org/addressbook/ldap-directory-query;1"]
.createInstance(Components.interfaces.nsIAbDirectoryQuery);
context.attributes = Components.classes["@mozilla.org/addressbook/ldap-attribute-map;1"]
.createInstance(Components.interfaces.nsIAbLDAPAttributeMap);
context.attributes.setAttributeList("DisplayName", context.book.attributeMap.getAttributeList("DisplayName", {}), true);
context.attributes.setAttributeList("PrimaryEmail", context.book.attributeMap.getAttributeList("PrimaryEmail", {}), true);
LDAPAbCardFormatter.requiredPropertiesFromBook(context.book).forEach(function(aProperty) {
var alreadyMapped = context.attributes.getAttributeList(aProperty);
if (alreadyMapped) {
return;
}
context.attributes.setAttributeList(aProperty, context.book.attributeMap.getAttributeList(aProperty, {}), true);
}, this);
context.listener = {
// nsIAbDirSearchListener
context.numQueries = 0;
context.query = Components.classes["@mozilla.org/addressbook/ldap-directory-query;1"]
.createInstance(Components.interfaces.nsIAbDirectoryQuery);
context.attributes = Components.classes["@mozilla.org/addressbook/ldap-attribute-map;1"]
.createInstance(Components.interfaces.nsIAbLDAPAttributeMap);
context.attributes.setAttributeList("DisplayName", context.book.attributeMap.getAttributeList("DisplayName", {}), true);
context.attributes.setAttributeList("PrimaryEmail", context.book.attributeMap.getAttributeList("PrimaryEmail", {}), true);
LDAPAbCardFormatter.requiredPropertiesFromBook(context.book).forEach(function(aProperty) {
var alreadyMapped = context.attributes.getAttributeList(aProperty);
if (alreadyMapped) {
onSearchFinished: (function onSearchFinished(aResult, aErrorMsg) {
context.numQueries--;
if (!context || context.stopped || context.numQueries > 0) {
return;
}
context.attributes.setAttributeList(aProperty, context.book.attributeMap.getAttributeList(aProperty, {}), true);
}, this);
context.listener = {
// nsIAbDirSearchListener
onSearchFinished: (function onSearchFinished(aResult, aErrorMsg) {
context.numQueries--;
if (!context || context.stopped || context.numQueries > 0) {
return;
}
context.finished = true;
context.result = aResult;
context.errorMsg = aErrorMsg;
context.finished = true;
context.result = aResult;
context.errorMsg = aErrorMsg;
if (Object.keys(this.LDAPContexts).some(function(aURI) {
return !this.LDAPContexts[aURI].finished;
}, this)) {
return;
}
if (Object.keys(this.LDAPContexts).some(function(aURI) {
return !this.LDAPContexts[aURI].finished;
}, this)) {
return;
}
return this.onSearchFinished(aResult, aErrorMsg, context);
}).bind(this),
onSearchFoundCard: (function onSearchFoundCard(aCard) {
if (!context || context.stopped) {
return;
}
return this.onSearchFoundCard(aCard, context);
}).bind(this)
};
return this.onSearchFinished(aResult, aErrorMsg, context);
}).bind(this),
this.LDAPContexts[uri] = context;
}
let args = Components.classes["@mozilla.org/addressbook/directory/query-arguments;1"]
.createInstance(Components.interfaces.nsIAbDirectoryQueryArguments);
onSearchFoundCard: (function onSearchFoundCard(aCard) {
if (!context || context.stopped) {
return;
}
return this.onSearchFoundCard(aCard, context);
}).bind(this)
};
this.LDAPContexts[uri] = context;
}
let filterTemplate = context.book.getStringValue("autoComplete.filterTemplate", "");
if (!filterTemplate) {
filterTemplate = "(|(cn=%v1*%v2-*)(mail=%v1*%v2-*)(sn=%v1*%v2-*))";
}
let args = Components.classes["@mozilla.org/addressbook/directory/query-arguments;1"]
.createInstance(Components.interfaces.nsIAbDirectoryQueryArguments);
let ldapSvc = Components.classes["@mozilla.org/network/ldap-service;1"]
.getService(Components.interfaces.nsILDAPService);
let filter = ldapSvc.createFilter(1024, filterTemplate, "", "", "", aSearchString);
if (!filter) {
throw new Error("Filter string is empty, check if filterTemplate variable is valid in prefs.js.");
}
args.typeSpecificArg = context.attributes;
args.querySubDirectories = true;
args.filter = filter;
let filterTemplate = context.book.getStringValue("autoComplete.filterTemplate", "");
if (!filterTemplate) {
filterTemplate = "(|(cn=%v1*%v2-*)(mail=%v1*%v2-*)(sn=%v1*%v2-*))";
}
context.finished = false;
context.stopped = false;
context.result = null;
context.errorMsg = null;
context.numQueries++;
let ldapSvc = Components.classes["@mozilla.org/network/ldap-service;1"]
.getService(Components.interfaces.nsILDAPService);
let filter = ldapSvc.createFilter(1024, filterTemplate, "", "", "", aSearchString);
if (!filter) {
throw new Error("Filter string is empty, check if filterTemplate variable is valid in prefs.js.");
}
args.typeSpecificArg = context.attributes;
args.querySubDirectories = true;
args.filter = filter;
context.finished = false;
context.stopped = false;
context.result = null;
context.errorMsg = null;
context.numQueries++;
try {
context.contextId = context.query.doQuery(context.book, args, context.listener, context.book.maxHits, 0);
} catch(error) {
Components.utils.reportError("cardbookAutocompleteSearch.startSearchFor : " + error);
// throw error;
Components.utils.reportError("cardbookAutocompleteSearch.startSearchFor context.query.doQuery : " + error);
context.listener.onSearchFinished(context.result, error);
}
},
......
......@@ -6,7 +6,7 @@
<Description about="urn:mozilla:install-manifest">
<em:id>cardbook@vigneau.philippe</em:id>
<em:name>CardBook</em:name>
<em:version>28.3</em:version>
<em:version>28.5</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