Commit ac7c0c71 authored by CardBook's avatar CardBook

version 27.5

parent 9386a516
......@@ -165,43 +165,6 @@
</hbox>
</groupbox>
<groupbox>
<caption label="&emailsCollectionLabel;" tooltiptext="&emailsCollectionTooltip;"/>
<hbox flex="1">
<vbox flex="1">
<hbox flex="1">
<tree id="emailsCollectionTree" class="cardbookTreeChildrenConfigClass" hidecolumnpicker="true" flex="1" seltype="single" enableColumnDrag="false" editable="true" onselect="wdw_cardbookConfiguration.selectEmailsCollection();" sortDirection="ascending" sortResource="emailsCollectionMailName">
<treecols id="emailsCollectionTreeCols">
<treecol id="emailsCollectionEnabled" label="&emailsCollectionEnabledLabel;" type="checkbox" persist="width ordinal hidden" style="text-align:center" editable="true"/>
<splitter class="tree-splitter"/>
<treecol id="emailsCollectionId" flex="1" hidden="true" persist="width ordinal hidden" style="text-align:left" editable="false"/>
<splitter class="tree-splitter"/>
<treecol id="emailsCollectionMailName" label="&emailsCollectionMailNameLabel;" flex="1" persist="width ordinal hidden" onclick="wdw_cardbookConfiguration.sortTreesFromCol(event, this, 'emailsCollectionTree');" style="text-align:left" editable="false"/>
<splitter class="tree-splitter"/>
<treecol id="emailsCollectionMailId" flex="1" hidden="true" persist="width ordinal hidden" style="text-align:left" editable="false"/>
<splitter class="tree-splitter"/>
<treecol id="emailsCollectionABName" label="&emailsCollectionABNameLabel;" flex="1" onclick="wdw_cardbookConfiguration.sortTreesFromCol(event, this, 'emailsCollectionTree');" persist="width ordinal hidden" style="text-align:left" editable="false"/>
<splitter class="tree-splitter"/>
<treecol id="emailsCollectionDirPrefId" flex="1" hidden="true" persist="width ordinal hidden" style="text-align:left" editable="false"/>
<splitter class="tree-splitter"/>
<treecol id="emailsCollectionCatName" label="&emailsCollectionCatNameLabel;" flex="1" onclick="wdw_cardbookConfiguration.sortTreesFromCol(event, this, 'emailsCollectionTree');" hidden="false" persist="width ordinal hidden" style="text-align:left" editable="false"/>
<splitter class="tree-splitter"/>
<treecol id="emailsCollectionCatId" flex="1" hidden="true" persist="width ordinal hidden" style="text-align:left" editable="false"/>
</treecols>
<treechildren id="emailsCollectionTreeChildren" ondblclick="wdw_cardbookConfiguration.doubleClickTree(event, 'emailsCollectionTree');"/>
</tree>
</hbox>
</vbox>
<hbox align="top">
<vbox flex="1">
<button id="addEmailsCollectionLabel" label="&addEmailsCollectionLabel;" accesskey="&addEmailsCollectionAccesskey;" oncommand="wdw_cardbookConfiguration.addEmailsCollection();"/>
<button id="renameEmailsCollectionLabel" label="&renameEmailsCollectionLabel;" accesskey="&renameEmailsCollectionAccesskey;" oncommand="wdw_cardbookConfiguration.renameEmailsCollection();" disabled="true"/>
<button id="deleteEmailsCollectionLabel" label="&deleteEmailsCollectionLabel;" accesskey="&deleteEmailsCollectionAccesskey;" oncommand="wdw_cardbookConfiguration.deleteEmailsCollection();" disabled="true"/>
</vbox>
</hbox>
</hbox>
</groupbox>
<groupbox>
<caption label="&logGroupboxLabel;"/>
<hbox align="center">
......@@ -707,7 +670,7 @@
accesskey="&useOnlyEmailAccesskey;"
preference="extensions.cardbook.useOnlyEmail"/>
</groupbox>
<separator class="thin"/>
<groupbox flex="1">
<caption label="&attachVCardGroupboxLabel;"/>
<separator class="thin"/>
......@@ -747,6 +710,43 @@
</hbox>
</hbox>
</groupbox>
<groupbox flex="1">
<caption label="&emailsCollectionLabel;" tooltiptext="&emailsCollectionTooltip;"/>
<hbox flex="1">
<vbox flex="1">
<hbox flex="1">
<tree id="emailsCollectionTree" class="cardbookTreeChildrenConfigClass" hidecolumnpicker="true" flex="1" seltype="single" enableColumnDrag="false" editable="true" onselect="wdw_cardbookConfiguration.selectEmailsCollection();" sortDirection="ascending" sortResource="emailsCollectionMailName">
<treecols id="emailsCollectionTreeCols">
<treecol id="emailsCollectionEnabled" label="&emailsCollectionEnabledLabel;" type="checkbox" persist="width ordinal hidden" style="text-align:center" editable="true"/>
<splitter class="tree-splitter"/>
<treecol id="emailsCollectionId" flex="1" hidden="true" persist="width ordinal hidden" style="text-align:left" editable="false"/>
<splitter class="tree-splitter"/>
<treecol id="emailsCollectionMailName" label="&emailsCollectionMailNameLabel;" flex="1" persist="width ordinal hidden" onclick="wdw_cardbookConfiguration.sortTreesFromCol(event, this, 'emailsCollectionTree');" style="text-align:left" editable="false"/>
<splitter class="tree-splitter"/>
<treecol id="emailsCollectionMailId" flex="1" hidden="true" persist="width ordinal hidden" style="text-align:left" editable="false"/>
<splitter class="tree-splitter"/>
<treecol id="emailsCollectionABName" label="&emailsCollectionABNameLabel;" flex="1" onclick="wdw_cardbookConfiguration.sortTreesFromCol(event, this, 'emailsCollectionTree');" persist="width ordinal hidden" style="text-align:left" editable="false"/>
<splitter class="tree-splitter"/>
<treecol id="emailsCollectionDirPrefId" flex="1" hidden="true" persist="width ordinal hidden" style="text-align:left" editable="false"/>
<splitter class="tree-splitter"/>
<treecol id="emailsCollectionCatName" label="&emailsCollectionCatNameLabel;" flex="1" onclick="wdw_cardbookConfiguration.sortTreesFromCol(event, this, 'emailsCollectionTree');" hidden="false" persist="width ordinal hidden" style="text-align:left" editable="false"/>
<splitter class="tree-splitter"/>
<treecol id="emailsCollectionCatId" flex="1" hidden="true" persist="width ordinal hidden" style="text-align:left" editable="false"/>
</treecols>
<treechildren id="emailsCollectionTreeChildren" ondblclick="wdw_cardbookConfiguration.doubleClickTree(event, 'emailsCollectionTree');"/>
</tree>
</hbox>
</vbox>
<hbox align="top">
<vbox flex="1">
<button id="addEmailsCollectionLabel" label="&addEmailsCollectionLabel;" accesskey="&addEmailsCollectionAccesskey;" oncommand="wdw_cardbookConfiguration.addEmailsCollection();"/>
<button id="renameEmailsCollectionLabel" label="&renameEmailsCollectionLabel;" accesskey="&renameEmailsCollectionAccesskey;" oncommand="wdw_cardbookConfiguration.renameEmailsCollection();" disabled="true"/>
<button id="deleteEmailsCollectionLabel" label="&deleteEmailsCollectionLabel;" accesskey="&deleteEmailsCollectionAccesskey;" oncommand="wdw_cardbookConfiguration.deleteEmailsCollection();" disabled="true"/>
</vbox>
</hbox>
</hbox>
</groupbox>
</prefpane>
<prefpane id="birthdaylistTab" label="&birthdaylistTabLabel;" index="birthdaylist">
......
......@@ -307,7 +307,7 @@
<menuitem id="importCardsFromDirFromAccountsOrCats" label="&importCardFromDirLabel;" oncommand="wdw_cardbook.importCardsFromDir();"/>
</menupopup>
<menupopup id="cardsTreeContextMenu" onpopupshowing="return wdw_cardbook.cardsTreeContextShowing();">
<menupopup id="cardsTreeContextMenu" onpopupshowing="return wdw_cardbook.cardsTreeContextShowing(event);">
<menuitem id="addContactFromCards" label="&cardbookToolbarAddContactButtonLabel;" oncommand="wdw_cardbook.newKey();"/>
<menuitem id="addListFromCards" label="&cardbookToolbarAddListButtonLabel;" oncommand="wdw_cardbook.createList();"/>
<menuitem id="editCardFromCards" label="&cardbookToolbarEditButtonLabel;" oncommand="wdw_cardbook.editCard();"/>
......
......@@ -56,7 +56,7 @@
class="cardbookTreeClass cardbookAccountTreeClass"
seltype="single"
flex="1" editable="true" context="accountsOrCatsTreeContextMenu" enableColumnDrag="false"
hidecolumnpicker="true" onkeyup="wdw_cardbook.selectAccountOrCatInNoSearch();">
hidecolumnpicker="true" onkeyup="wdw_cardbook.selectAccountOrCatInNoSearch();" onclick="wdw_cardbook.selectAccountOrCatInNoSearch();">
<treecols>
<treecol id="accountEnabled" type="checkbox" editable="true" width="17" hideheader="true" persist="width ordinal hidden" tooltiptext="&enableAccountsTooltip;"/>
<treecol id="accountTypeCheckbox" type="checkbox" editable="false" width="20" hideheader="true" persist="width ordinal hidden"/>
......@@ -68,7 +68,7 @@
<treecol id="dummyForScroll" type="checkbox" persist="width ordinal hidden" width="17" hideheader="true"/>
</treecols>
<treechildren id="accountsOrCatsTreeChildren" flex="1" ondragstart="wdw_cardbook.startDrag(event, this);" ondrop="wdw_cardbook.dragCards(event);"
onclick="wdw_cardbook.selectAccountOrCatInNoSearch();" ondblclick="wdw_cardbook.doubleClickAccountOrCat(event);"/>
ondblclick="wdw_cardbook.doubleClickAccountOrCat(event);"/>
</tree>
</vbox>
......
......@@ -89,7 +89,7 @@ if ("undefined" == typeof(ovl_synchro)) {
prefs.setCharPref("accountsShown", "all");
prefs.setCharPref("accountShown", "");
prefs.setCharPref("uncategorizedCards", "");
prefs.setCharPref("addonVersion", "27.4");
prefs.setCharPref("addonVersion", "27.5");
},
lEventTimerSync : { notify: function(lTimerSync) {
......
......@@ -13,6 +13,7 @@ if ("undefined" == typeof(wdw_cardbook)) {
currentValue : "",
currentFirstVisibleRow : 0,
currentLastVisibleRow : 0,
currentAccountId : "",
cutAndPaste : "",
currentCopiedEntry : [],
cardbookrefresh : false,
......@@ -193,18 +194,22 @@ if ("undefined" == typeof(wdw_cardbook)) {
},
selectAccountOrCatInNoSearch: function () {
wdw_cardbook.clearAccountOrCat();
wdw_cardbook.setNoSearchMode();
if (cardbookRepository.cardbookAccounts.length == 0) {
return;
}
var myTree = document.getElementById('accountsOrCatsTree');
var mySelectedIndex = myTree.currentIndex;
if (mySelectedIndex !== -1) {
if (mySelectedIndex != -1) {
var myAccountId = myTree.view.getCellText(mySelectedIndex, {id: "accountId"});
} else {
var myAccountId = myTree.view.getCellText(0, {id: "accountId"});
}
if (wdw_cardbook.currentAccountId == myAccountId) {
return;
}
wdw_cardbook.currentAccountId = myAccountId;
wdw_cardbook.clearAccountOrCat();
wdw_cardbook.clearCard();
var myDirPrefId = cardbookUtils.getAccountId(myAccountId);
cardbookPreferences.setStringPref("extensions.cardbook.accountShown", myDirPrefId);
......@@ -1564,6 +1569,7 @@ if ("undefined" == typeof(wdw_cardbook)) {
document.getElementById('cardbookSearchInput').setAttribute('tabindex', '1');
document.getElementById('cardsTree').setAttribute('tabindex', '2');
wdw_cardbook.setNoComplexSearchMode();
wdw_cardbook.currentAccountId = "";
cardbookRepository.cardbookSearchMode = "SEARCH";
},
......@@ -2434,7 +2440,7 @@ if ("undefined" == typeof(wdw_cardbook)) {
cardbookContactsMenuContextShowing: function () {
cardbookUtils.addCardsToCategoryMenuSubMenu('cardbookContactsMenuCategoriesMenuPopup');
wdw_cardbook.enableOrDisableElement(['cardbookContactsMenuFindEvents'], true);
if (cardbookRepository.cardbookAccounts.length == 0) {
if (cardbookDirTree.visibleData.length == 0) {
wdw_cardbook.enableOrDisableElement(['cardbookContactsMenuToEmailCards', 'cardbookContactsMenuCcEmailCards', 'cardbookContactsMenuBccEmailCards', 'cardbookContactsMenuFindEmails', 'cardbookContactsMenuLocalizeCards',
'cardbookContactsMenuOpenURL', 'cardbookContactsMenuCutCards', 'cardbookContactsMenuCopyCards', 'cardbookContactsMenuPasteCards', 'cardbookContactsMenuPasteEntry',
'cardbookContactsMenuPrint', 'cardbookContactsMenuExportCardsToFile',
......@@ -2598,8 +2604,9 @@ if ("undefined" == typeof(wdw_cardbook)) {
}
},
cardsTreeContextShowing: function () {
cardsTreeContextShowing: function (aEvent) {
if (cardbookUtils.displayColumnsPicker()) {
wdw_cardbook.selectCard(aEvent);
wdw_cardbook.cardsTreeContextShowingNext();
return true;
} else {
......@@ -2608,7 +2615,7 @@ if ("undefined" == typeof(wdw_cardbook)) {
},
cardsTreeContextShowingNext: function () {
if (cardbookRepository.cardbookAccounts.length == 0) {
if (cardbookDirTree.visibleData.length == 0) {
wdw_cardbook.enableOrDisableElement(['toEmailCardsFromCards', 'ccEmailCardsFromCards', 'bccEmailCardsFromCards', 'shareCardsByEmailFromCards', 'findEmailsFromCards', 'findEventsFromCards',
'localizeCardsFromCards', 'openURLFromCards', 'cutCardsFromCards', 'copyCardsFromCards', 'pasteCardsFromCards', 'pasteEntryFromCards', 'exportCardsToFileFromCards',
'exportCardsToDirFromCards', 'mergeCardsFromCards', 'duplicateCardsFromCards', 'convertListToCategoryFromCards', 'categoriesFromCards', 'printFromCards'], true);
......@@ -2822,7 +2829,12 @@ if ("undefined" == typeof(wdw_cardbook)) {
wdw_cardbook.disableCardDeletion();
wdw_cardbook.disableCardIM();
} else {
if (cardbookRepository.cardbookSearchMode === "SEARCH" || cardbookRepository.cardbookComplexSearchMode === "SEARCH") {
if (cardbookDirTree.visibleData.length == 0) {
wdw_cardbook.disableCardCreation();
wdw_cardbook.disableCardModification();
wdw_cardbook.disableCardDeletion();
wdw_cardbook.disableCardIM();
} else if (cardbookRepository.cardbookSearchMode === "SEARCH" || cardbookRepository.cardbookComplexSearchMode === "SEARCH") {
wdw_cardbook.enableCardCreation();
if (cardbookUtils.getSelectedCardsCount() >= 2 || cardbookUtils.getSelectedCardsCount() == 0) {
wdw_cardbook.disableCardModification();
......@@ -2889,28 +2901,18 @@ if ("undefined" == typeof(wdw_cardbook)) {
if (aParams && aParams.search(/^accountid:/) != -1) {
myAccountId = aParams.replace(/^accountid:/, "");
} else {
var myTree = document.getElementById('accountsOrCatsTree');
var mySelectedIndex = myTree.currentIndex;
if (mySelectedIndex !== -1) {
try {
myAccountId = myTree.view.getCellText(mySelectedIndex, {id: "accountId"});
} catch (e) { return; }
myAccountId = wdw_cardbook.currentAccountId;
}
// if it does not exist anymore, take the first one if it exists
if (!(cardbookRepository.cardbookDisplayCards[cardbookUtils.getAccountId(myAccountId)])) {
if (cardbookRepository.cardbookAccounts.length != 0) {
var myTree = document.getElementById('accountsOrCatsTree');
myAccountId = myTree.view.getCellText(0, {id: "accountId"});
} else {
try {
myAccountId = myTree.view.getCellText(0, {id: "accountId"});
} catch (e) { return; }
myAccountId = "";
}
}
}
// if it does not exist anymore, take the first one if it exists
if (!(cardbookRepository.cardbookDisplayCards[cardbookUtils.getAccountId(myAccountId)])) {
if (cardbookRepository.cardbookAccounts.length != 0) {
var myTree = document.getElementById('accountsOrCatsTree');
myAccountId = myTree.view.getCellText(0, {id: "accountId"});
} else {
myAccountId = "";
}
}
// get selected cards
var listOfSelectedCard = [];
......
......@@ -6,7 +6,7 @@
<Description about="urn:mozilla:install-manifest">
<em:id>cardbook@vigneau.philippe</em:id>
<em:name>CardBook</em:name>
<em:version>27.4</em:version>
<em:version>27.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