Commit 1462399d authored by CardBook's avatar CardBook

version 20.8

parent 4a456be6
......@@ -43,6 +43,9 @@ overlay chrome://messenger/content/messenger.xul chrome://cardbook/content/filt
# support for filter messages
overlay chrome://messenger/content/FilterEditor.xul chrome://cardbook/content/filters/ovl_filterEditor.xul
overlay chrome://messenger/content/SearchDialog.xul chrome://cardbook/content/filters/ovl_filterEditor.xul
overlay chrome://messenger/content/mailViewSetup.xul chrome://cardbook/content/filters/ovl_filterEditor.xul
overlay chrome://messenger/content/virtualFolderProperties.xul chrome://cardbook/content/filters/ovl_filterEditor.xul
# support for Lightning attendees
overlay chrome://calendar/content/calendar-event-dialog-attendees.xul chrome://cardbook/content/lightning/ovl_lightningAttendees.xul
......
......@@ -8,7 +8,20 @@ if ("undefined" == typeof(wdw_addressbooksAdd)) {
gValidateURL : false,
gValidateDescription : "Validation module",
gStandardAddressbooks : [],
gSearchDefinition : {},
initSearchDefinition: function () {
if (cardbookRepository.cardbookComplexSearch[window.arguments[0].searchId]) {
wdw_addressbooksAdd.gSearchDefinition['searchAB'] = cardbookRepository.cardbookComplexSearch[window.arguments[0].searchId].searchAB;
wdw_addressbooksAdd.gSearchDefinition['matchAll'] = cardbookRepository.cardbookComplexSearch[window.arguments[0].searchId].matchAll;
wdw_addressbooksAdd.gSearchDefinition['rules'] = JSON.parse(JSON.stringify(cardbookRepository.cardbookComplexSearch[window.arguments[0].searchId].rules));
} else {
wdw_addressbooksAdd.gSearchDefinition['searchAB'] = true;
wdw_addressbooksAdd.gSearchDefinition['matchAll'] = 'and';
wdw_addressbooksAdd.gSearchDefinition['rules'] = [["","","",""]];
}
},
loadWizard: function () {
Components.utils.import("chrome://cardbook/content/cardbookRepository.js");
let stringBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"].getService(Components.interfaces.nsIStringBundleService);
......@@ -19,6 +32,7 @@ if ("undefined" == typeof(wdw_addressbooksAdd)) {
wdw_addressbooksAdd.loadStandardAddressBooks();
document.getElementById('addressbook-wizard').goTo("welcomePage");
} else if (window.arguments[0].action == "search") {
wdw_addressbooksAdd.initSearchDefinition();
document.getElementById('addressbook-wizard').goTo("searchPage");
} else {
document.getElementById('addressbook-wizard').goTo("initialPage");
......@@ -249,27 +263,46 @@ if ("undefined" == typeof(wdw_addressbooksAdd)) {
wdw_addressbooksAdd.gType = document.getElementById('remotePageType').selectedItem.value;
},
searchPageAdvance: function () {
wdw_addressbooksAdd.gType = "SEARCH";
wdw_addressbooksAdd.gTypeFile = cardbookComplexSearch.getSearch();
constructComplexSearch: function () {
cardbookElementTools.loadAddressBooks("addressbookMenupopup", "addressbookMenulist", wdw_addressbooksAdd.gSearchDefinition.searchAB, true, true, true, false);
cardbookComplexSearch.loadMatchAll(wdw_addressbooksAdd.gSearchDefinition.matchAll);
cardbookComplexSearch.constructDynamicRows("searchTerms", wdw_addressbooksAdd.gSearchDefinition.rules, "3.0");
document.getElementById('searchTerms_0_valueBox').focus();
},
checkSearch: function () {
cardbookComplexSearch.initComplexSearch(window.arguments[0].searchId);
if (window.arguments[0].searchId != null && window.arguments[0].searchId !== undefined && window.arguments[0].searchId != "") {
document.getElementById('addressbook-wizard').canAdvance = true;
} else {
document.getElementById('addressbook-wizard').canAdvance = false;
}
function checkTerms(event) {
wdw_addressbooksAdd.constructComplexSearch();
document.getElementById('addressbook-wizard').canAdvance = false;
function checkTerms() {
if (cardbookComplexSearch.getSearch() != "") {
document.getElementById('addressbook-wizard').canAdvance = true;
} else {
document.getElementById('addressbook-wizard').canAdvance = false;
}
};
checkTerms();
document.getElementById('searchTerms').addEventListener("input", checkTerms, false);
document.getElementById('searchTerms').addEventListener("command", checkTerms, false);
document.getElementById('searchTerms').addEventListener("click", checkTerms, false);
},
searchPageAdvance: function () {
wdw_addressbooksAdd.gType = "SEARCH";
wdw_addressbooksAdd.gTypeFile = cardbookComplexSearch.getSearch();
var relative = wdw_addressbooksAdd.gTypeFile.match("^searchAB:([^:]*):searchAll:([^:]*)(.*)");
wdw_addressbooksAdd.gSearchDefinition.searchAB = relative[1];
if (relative[2] == "true") {
wdw_addressbooksAdd.gSearchDefinition.matchAll = true;
} else {
wdw_addressbooksAdd.gSearchDefinition.matchAll = false;
}
var tmpRuleArray = relative[3].split(/:case:/);
wdw_addressbooksAdd.gSearchDefinition.rules = [];
for (var i = 1; i < tmpRuleArray.length; i++) {
var relative = tmpRuleArray[i].match("([^:]*):field:([^:]*):term:([^:]*):value:([^:]*)");
wdw_addressbooksAdd.gSearchDefinition.rules.push([relative[1], relative[2], relative[3], relative[4]]);
}
},
showPassword: function () {
......
......@@ -321,9 +321,9 @@
<vbox flex="1" align="center">
<hbox flex="1" align="center">
<vbox flex="1" align="center">
<button class="cardbookButtonClass" id="appendlistavailableCardsTreeButton" label="&buttonAppendToListLabel;"
<button id="appendlistavailableCardsTreeButton" label="&buttonAppendToListLabel;"
accesskey="&buttonAppendToListAccesskey;" oncommand="wdw_cardEdition.modifyLists(this);"/>
<button class="cardbookButtonClass" id="deletelistaddedCardsTreeButton" label="&buttonRemoveFromListLabel;"
<button id="deletelistaddedCardsTreeButton" label="&buttonRemoveFromListLabel;"
accesskey="&buttonRemoveFromListAccesskey;" oncommand="wdw_cardEdition.modifyLists(this);"/>
</vbox>
</hbox>
......
......@@ -485,10 +485,10 @@ if ("undefined" == typeof(cardbookElementTools)) {
}
},
addMenuTermlist: function (aParent, aType, aIndex, aValue, aParameters) {
addMenuTermlist: function (aParent, aType, aIndex, aVersion, aValue, aParameters) {
var aMenulist = document.createElement('menulist');
aParent.appendChild(aMenulist);
aMenulist.setAttribute('id', aType + '_' + aIndex + '_menulistTerm');
aMenulist.setAttribute('id', aType + '_' + aIndex + '_' + aVersion + '_menulistTerm');
for (var prop in aParameters) {
aMenulist.setAttribute(prop, aParameters[prop]);
}
......@@ -521,6 +521,8 @@ if ("undefined" == typeof(cardbookElementTools)) {
return;
}
cardbookComplexSearch.showOrHideForEmpty(this.id);
var myIdArray = this.id.split('_');
cardbookComplexSearch.disableButtons(myIdArray[0], myIdArray[1], myIdArray[2]);
};
aMenulist.addEventListener("command", fireMenuTerm, false);
},
......
......@@ -139,8 +139,6 @@ var cardbookRepository = {
cardbookDynamicCssRules : {},
cardbookUncategorizedCards : "",
cardbookCollectedCards : "",
cardbookCollectedCardsId : "Collected",
cardbookMailPopularityFile : "mailPopularityIndex.txt",
......@@ -912,6 +910,22 @@ var cardbookRepository = {
cardbookRepository.addCategoryToCard(aCard, aNewCategoryName);
},
renameUncategorized: function(aOldCategoryName, aNewCategoryName) {
for (var i = 0; i < cardbookRepository.cardbookAccounts.length; i++) {
if (!cardbookRepository.cardbookAccounts[i][1] && cardbookRepository.cardbookAccounts[i][0] == aOldCategoryName) {
cardbookRepository.cardbookAccounts[i][0] = aNewCategoryName;
cardbookRepository.cardbookAccounts[i][4] = cardbookRepository.cardbookAccounts[i][4].replace("::"+aOldCategoryName,"::"+aNewCategoryName);
} else if (cardbookRepository.cardbookAccounts[i][1] && cardbookRepository.cardbookAccounts[i][5]) {
for (var j = 0; j < cardbookRepository.cardbookAccountsCategories[cardbookRepository.cardbookAccounts[i][4]].length; j++) {
if (cardbookRepository.cardbookAccountsCategories[cardbookRepository.cardbookAccounts[i][4]][j] == aOldCategoryName) {
cardbookRepository.cardbookAccountsCategories[cardbookRepository.cardbookAccounts[i][4]][j] = aNewCategoryName;
}
}
}
}
cardbookRepository.cardbookUncategorizedCards = aNewCategoryName;
},
removeCategoryFromDisplay: function(aCategory) {
delete cardbookRepository.cardbookDisplayCards[aCategory];
},
......
......@@ -2271,7 +2271,7 @@ if ("undefined" == typeof(cardbookSynchronization)) {
} else if (myPrefType === "CACHE") {
cardbookRepository.cardbookDirRequest[aDirPrefId]++;
var myDir = cardbookRepository.getLocalDirectory();
myDir.append(cardbookRepository.cardbookCollectedCardsId);
myDir.append("Collected");
cardbookSynchronization.loadDir(myDir, "", aDirPrefId, aMode, "");
cardbookSynchronization.waitForDirFinished(aDirPrefId, myPrefName, aMode);
}
......
......@@ -281,24 +281,14 @@ if ("undefined" == typeof(cardbookTypes)) {
disableButtons: function (aType, aIndex, aVersion) {
if (aIndex == 0) {
if (document.getElementById(aType + '_' + aIndex + '_valueBox').value == "") {
if (document.getElementById(aType + '_' + aIndex + '_menulistTerm')) {
if (document.getElementById(aType + '_' + aIndex + '_menulistTerm').selectedItem.value == "IsntEmpty" ||
document.getElementById(aType + '_' + aIndex + '_menulistTerm').selectedItem.value == "IsEmpty") {
document.getElementById(aType + '_' + aIndex + '_' + aVersion + '_cardbookaddButton').disabled = false;
document.getElementById(aType + '_' + aIndex + '_' + aVersion + '_cardbookremoveButton').disabled = true;
} else {
document.getElementById(aType + '_' + aIndex + '_' + aVersion + '_cardbookaddButton').disabled = true;
document.getElementById(aType + '_' + aIndex + '_' + aVersion + '_cardbookremoveButton').disabled = true;
}
} else {
document.getElementById(aType + '_' + aIndex + '_' + aVersion + '_cardbookaddButton').disabled = true;
document.getElementById(aType + '_' + aIndex + '_' + aVersion + '_cardbookremoveButton').disabled = true;
}
document.getElementById(aType + '_' + aIndex + '_' + aVersion + '_cardbookremoveButton').disabled = true;
document.getElementById(aType + '_' + aIndex + '_' + aVersion + '_cardbookaddButton').disabled = true;
} else {
document.getElementById(aType + '_' + aIndex + '_' + aVersion + '_cardbookaddButton').disabled = false;
document.getElementById(aType + '_' + aIndex + '_' + aVersion + '_cardbookremoveButton').disabled = false;
}
} else {
document.getElementById(aType + '_0_' + aVersion + '_cardbookremoveButton').disabled = false;
for (var i = 0; i < aIndex; i++) {
document.getElementById(aType + '_' + i + '_' + aVersion + '_cardbookaddButton').disabled = true;
document.getElementById(aType + '_' + i + '_' + aVersion + '_cardbookdownButton').disabled = false;
......
......@@ -92,14 +92,14 @@ if ("undefined" == typeof(cardbookComplexSearch)) {
}
},
getAllArray: function (aType) {
getAllArray: function (aType, aVersion) {
var i = 0;
var myResult = [];
while (true) {
if (document.getElementById(aType + '_' + i + '_hbox')) {
var mySearchCase = document.getElementById(aType + '_' + i + '_menulistCase').selectedItem.value;
var mySearchObj = document.getElementById(aType + '_' + i + '_menulistObj').selectedItem.value;
var mySearchTerm = document.getElementById(aType + '_' + i + '_menulistTerm').selectedItem.value;
var mySearchTerm = document.getElementById(aType + '_' + i + '_' + aVersion + '_menulistTerm').selectedItem.value;
var mySearchValue = document.getElementById(aType + '_' + i + '_valueBox').value;
myResult.push([mySearchCase, mySearchObj, mySearchTerm, mySearchValue]);
i++;
......@@ -110,6 +110,32 @@ if ("undefined" == typeof(cardbookComplexSearch)) {
return myResult;
},
disableButtons: function (aType, aIndex, aVersion) {
if (aIndex == 0) {
if (document.getElementById(aType + '_' + aIndex + '_valueBox').value == "") {
if (document.getElementById(aType + '_' + aIndex + '_' + aVersion + '_menulistTerm').selectedItem.value == "IsntEmpty" ||
document.getElementById(aType + '_' + aIndex + '_' + aVersion + '_menulistTerm').selectedItem.value == "IsEmpty") {
document.getElementById(aType + '_' + aIndex + '_' + aVersion + '_cardbookaddButton').disabled = false;
document.getElementById(aType + '_' + aIndex + '_' + aVersion + '_cardbookremoveButton').disabled = false;
} else {
document.getElementById(aType + '_' + aIndex + '_' + aVersion + '_cardbookaddButton').disabled = true;
document.getElementById(aType + '_' + aIndex + '_' + aVersion + '_cardbookremoveButton').disabled = true;
}
} else {
document.getElementById(aType + '_' + aIndex + '_' + aVersion + '_cardbookaddButton').disabled = false;
document.getElementById(aType + '_' + aIndex + '_' + aVersion + '_cardbookremoveButton').disabled = false;
}
} else {
document.getElementById(aType + '_0_' + aVersion + '_cardbookremoveButton').disabled = false;
for (var i = 0; i < aIndex; i++) {
document.getElementById(aType + '_' + i + '_' + aVersion + '_cardbookaddButton').disabled = true;
document.getElementById(aType + '_' + i + '_' + aVersion + '_cardbookdownButton').disabled = false;
}
}
document.getElementById(aType + '_' + aIndex + '_' + aVersion + '_cardbookdownButton').disabled = true;
document.getElementById(aType + '_0_' + aVersion + '_cardbookupButton').disabled = true;
},
showOrHideForEmpty: function (aId) {
var myIdArray = aId.split('_');
if (document.getElementById(aId).selectedItem.value == "IsEmpty" || document.getElementById(aId).selectedItem.value == "IsntEmpty") {
......@@ -133,7 +159,7 @@ if ("undefined" == typeof(cardbookComplexSearch)) {
cardbookElementTools.addMenuCaselist(aHBox, aType, aIndex, aArray[0], {flex: "1"});
cardbookElementTools.addMenuObjlist(aHBox, aType, aIndex, aArray[1], {flex: "1"});
cardbookElementTools.addMenuTermlist(aHBox, aType, aIndex, aArray[2], {flex: "1"});
cardbookElementTools.addMenuTermlist(aHBox, aType, aIndex, aVersion, aArray[2], {flex: "1"});
cardbookElementTools.addKeyTextbox(aHBox, aType + '_' + aIndex + '_valueBox', aArray[3], {flex: "1"}, aVersion, aIndex);
function fireUpButton(event) {
......@@ -141,7 +167,7 @@ if ("undefined" == typeof(cardbookComplexSearch)) {
return;
}
var myIdArray = this.id.split('_');
var myAllValuesArray = cardbookComplexSearch.getAllArray(myIdArray[0]);
var myAllValuesArray = cardbookComplexSearch.getAllArray(myIdArray[0], myIdArray[2]);
if (myAllValuesArray.length <= 1) {
return;
}
......@@ -158,7 +184,7 @@ if ("undefined" == typeof(cardbookComplexSearch)) {
return;
}
var myIdArray = this.id.split('_');
var myAllValuesArray = cardbookComplexSearch.getAllArray(myIdArray[0]);
var myAllValuesArray = cardbookComplexSearch.getAllArray(myIdArray[0], myIdArray[2]);
if (myAllValuesArray.length <= 1) {
return;
}
......@@ -175,7 +201,7 @@ if ("undefined" == typeof(cardbookComplexSearch)) {
return;
}
var myIdArray = this.id.split('_');
var myAllValuesArray = cardbookComplexSearch.getAllArray(myIdArray[0]);
var myAllValuesArray = cardbookComplexSearch.getAllArray(myIdArray[0], myIdArray[2]);
cardbookElementTools.deleteRowsType(myIdArray[0]);
if (myAllValuesArray.length == 0) {
cardbookComplexSearch.constructDynamicRows(myIdArray[0], myAllValuesArray, myIdArray[2]);
......@@ -192,7 +218,7 @@ if ("undefined" == typeof(cardbookComplexSearch)) {
}
var myIdArray = this.id.split('_');
var myValue = document.getElementById(myIdArray[0] + '_' + myIdArray[1] + '_valueBox').value;
var myTerm = document.getElementById(myIdArray[0] + '_' + myIdArray[1] + '_menulistTerm').selectedItem.value;
var myTerm = document.getElementById(myIdArray[0] + '_' + myIdArray[1] + '_' + myIdArray[2] + '_menulistTerm').selectedItem.value;
if (myValue == "" && myTerm !== "IsEmpty" && myTerm !== "IsntEmpty") {
return;
}
......@@ -201,8 +227,8 @@ if ("undefined" == typeof(cardbookComplexSearch)) {
};
cardbookElementTools.addEditButton(aHBox, aType, aIndex, aVersion, "add", fireAddButton);
cardbookTypes.disableButtons(aType, aIndex, aVersion);
cardbookComplexSearch.showOrHideForEmpty(aType + '_' + aIndex + '_menulistTerm');
cardbookComplexSearch.showOrHideForEmpty(aType + '_' + aIndex + '_' + aVersion + '_menulistTerm');
cardbookComplexSearch.disableButtons(aType, aIndex, aVersion);
},
constructDynamicRows: function (aType, aArray, aVersion) {
......@@ -215,19 +241,6 @@ if ("undefined" == typeof(cardbookComplexSearch)) {
}
},
initComplexSearch: function (aDirPrefId) {
if (cardbookRepository.cardbookComplexSearch[aDirPrefId]) {
cardbookElementTools.loadAddressBooks("addressbookMenupopup", "addressbookMenulist", cardbookRepository.cardbookComplexSearch[aDirPrefId].searchAB, true, true, true, false);
cardbookComplexSearch.loadMatchAll(cardbookRepository.cardbookComplexSearch[aDirPrefId].matchAll);
cardbookComplexSearch.constructDynamicRows("searchTerms", cardbookRepository.cardbookComplexSearch[aDirPrefId].rules, "3.0");
} else {
cardbookElementTools.loadAddressBooks("addressbookMenupopup", "addressbookMenulist", "allAddressBooks", true, true, true, false);
cardbookComplexSearch.loadMatchAll("and");
cardbookComplexSearch.constructDynamicRows("searchTerms", [["","","",""]], "3.0");
}
document.getElementById('searchTerms_0_valueBox').focus();
},
loadCards: function (aComplexSearchDirPrefId) {
if (cardbookRepository.cardbookComplexSearch[aComplexSearchDirPrefId]) {
for (j in cardbookRepository.cardbookCards) {
......@@ -294,7 +307,7 @@ if ("undefined" == typeof(cardbookComplexSearch)) {
var searchAll = document.getElementById('booleanAndGroup').selectedItem.value == "and" ? "true" : "false";
result = result + ":searchAll:" + searchAll;
var found = false;
var allRules = cardbookComplexSearch.getAllArray("searchTerms");
var allRules = cardbookComplexSearch.getAllArray("searchTerms", "3.0");
for (var i = 0; i < allRules.length; i++) {
if (allRules[i][2] == "IsEmpty") {
found = true;
......
......@@ -684,10 +684,11 @@ if ("undefined" == typeof(wdw_cardbookConfiguration)) {
},
addOrg: function () {
var myListBox = document.getElementById('orgListbox');
var myArgs = {type: "", context: "Org", typeAction: ""};
var myValidationList = JSON.parse(JSON.stringify(wdw_cardbookConfiguration.allOrg));
var myArgs = {type: "", context: "Org", typeAction: "", validationList: myValidationList};
var myWindow = window.openDialog("chrome://cardbook/content/wdw_cardbookRenameField.xul", "", "chrome,modal,resizable,centerscreen", myArgs);
if (myArgs.typeAction == "SAVE" && myArgs.type != "") {
var myListBox = document.getElementById('orgListbox');
wdw_cardbookConfiguration.allOrg = [];
for (var i = 0; i < myListBox.itemCount; i++) {
wdw_cardbookConfiguration.allOrg.push(myListBox.getItemAtIndex(i).getAttribute("value"));
......@@ -704,7 +705,8 @@ if ("undefined" == typeof(wdw_cardbookConfiguration)) {
return;
} else {
var myItem = myListBox.getSelectedItem(0);
var myArgs = {type: myItem.getAttribute("value"), context: "Org", typeAction: ""};
var myValidationList = JSON.parse(JSON.stringify(wdw_cardbookConfiguration.allOrg));
var myArgs = {type: myItem.getAttribute("value"), context: "Org", typeAction: "", validationList: myValidationList};
var myWindow = window.openDialog("chrome://cardbook/content/wdw_cardbookRenameField.xul", "", "chrome,modal,resizable,centerscreen", myArgs);
if (myArgs.typeAction == "SAVE" && myArgs.type != "") {
wdw_cardbookConfiguration.allOrg = [];
......
......@@ -742,32 +742,49 @@ if ("undefined" == typeof(wdw_cardbookContactsSidebar)) {
document.getElementById("editCard").disabled=true;
} else {
if (listOfUid[0][0] == "CATCARDBOOK") {
var mySepPosition = listOfUid[0][1].indexOf("::",0);
var myCategory = listOfUid[0][1].substr(mySepPosition+2,listOfUid[0][1].length);
if (myCategory == cardbookRepository.cardbookUncategorizedCards) {
document.getElementById("editCard").disabled=true;
var myAccountArray = listOfUid[0][1].split("::");
var myDirPrefId = myAccountArray[0];
var cardbookPrefService = new cardbookPreferenceService(myDirPrefId);
if (cardbookPrefService.getReadOnly()) {
wdw_cardbookContactsSidebar.disableCardModification();
} else {
document.getElementById("editCard").disabled=false;
wdw_cardbookContactsSidebar.enableCardModification();
}
} else if (listOfUid[0][0] == "CARDCARDBOOK" || listOfUid[0][0] == "LISTCARDBOOK") {
var myDirPrefId = listOfUid[0][1].dirPrefId;
var cardbookPrefService = new cardbookPreferenceService(myDirPrefId);
if (cardbookPrefService.getReadOnly()) {
wdw_cardbookContactsSidebar.disableCardModification();
} else {
wdw_cardbookContactsSidebar.enableCardModification();
}
} else {
document.getElementById("editCard").disabled=false;
wdw_cardbookContactsSidebar.enableCardModification();
}
}
document.getElementById("toEmail").disabled=false;
document.getElementById("ccEmail").disabled=false;
document.getElementById("bccEmail").disabled=false;
document.getElementById("replytoEmail").disabled=false;
document.getElementById("deleteCard").disabled=false;
} else {
document.getElementById("toEmail").disabled=true;
document.getElementById("ccEmail").disabled=true;
document.getElementById("bccEmail").disabled=true;
document.getElementById("replytoEmail").disabled=true;
document.getElementById("deleteCard").disabled=true;
document.getElementById("editCard").disabled=true;
wdw_cardbookContactsSidebar.disableCardModification();
}
},
disableCardModification: function () {
document.getElementById("editCard").disabled=true;
document.getElementById("deleteCard").disabled=true;
},
enableCardModification: function () {
document.getElementById("editCard").disabled=false;
document.getElementById("deleteCard").disabled=false;
},
loadPanel: function () {
myCardBookObserver.register();
myCardBookPrefObserver.register();
......
......@@ -64,12 +64,12 @@
<vbox flex="1" align="center">
<hbox flex="1" align="center">
<vbox flex="1" align="center">
<button class="cardbookButtonClass" id="appendlistavailableColumnsTreeButton" label="&buttonAppendToListLabel;"
<button id="appendlistavailableColumnsTreeButton" label="&buttonAppendToListLabel;"
accesskey="&buttonAppendToListAccesskey;" oncommand="wdw_csvTranslator.modifyLists(this);"/>
<button class="cardbookButtonClass" id="deletelistaddedColumnsTreeButton" label="&buttonRemoveFromListLabel;"
<button id="deletelistaddedColumnsTreeButton" label="&buttonRemoveFromListLabel;"
accesskey="&buttonRemoveFromListAccesskey;" oncommand="wdw_csvTranslator.modifyLists(this);"/>
<button class="cardbookButtonClass" id="upAddedColumnsTreeButton" label="↑" oncommand="wdw_csvTranslator.upColumns();"/>
<button class="cardbookButtonClass" id="downAddedColumnsTreeButton" label="↓" oncommand="wdw_csvTranslator.downColumns(this);"/>
<button id="upAddedColumnsTreeButton" label="↑" oncommand="wdw_csvTranslator.upColumns();"/>
<button id="downAddedColumnsTreeButton" label="↓" oncommand="wdw_csvTranslator.downColumns(this);"/>
</vbox>
</hbox>
</vbox>
......
......@@ -38,6 +38,7 @@ if ("undefined" == typeof(cardbookTabType)) {
maxTabs: 1,
openTab: function(aTab, aArgs) {
aTab.title = aArgs["title"];
ovl_cardbookLayout.orientPanes();
},
showTab: function(aTab) {
......@@ -56,7 +57,6 @@ if ("undefined" == typeof(cardbookTabType)) {
restoreTab: function(aTabmail, aState) {
var strBundle = document.getElementById("cardbook-strings");
aState.title = strBundle.getString("cardbookTitle");
ovl_cardbookLayout.orientPanes();
aTabmail.openTab('cardbook', aState);
},
......
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/searchBox.css" type="text/css"?>
<!-- for the icons of the CardBook main toolbar -->
<?xml-stylesheet href="chrome://messenger/skin/primaryToolbar.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/addressbook/addressbook.css" type="text/css"?>
<?xml-stylesheet href="chrome://cardbook-os/skin/cardbookToolbarButtons.css" type="text/css"?>
<!DOCTYPE window [
......
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css" ?>
<?xml-stylesheet href="chrome://cardbook/skin/cardbookMain.css" type="text/css"?>
<?xml-stylesheet href="chrome://cardbook/skin/cardbookButtons.css" type="text/css"?>
<?xml-stylesheet href="chrome://cardbook/skin/cardbookCheckboxes.css" type="text/css"?>
<?xml-stylesheet href="chrome://cardbook/skin/cardbookTreeChildrens.css" type="text/css"?>
<!-- for the preference star -->
......
......@@ -5,11 +5,23 @@ if ("undefined" == typeof(ovl_synchro)) {
lEventTimerSync : { notify: function(lTimerSync) {
if (!cardbookRepository.firstLoad) {
let stringBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"].getService(Components.interfaces.nsIStringBundleService);
let strBundle = stringBundleService.createBundle("chrome://cardbook/locale/cardbook.properties");
cardbookRepository.cardbookUncategorizedCards = strBundle.GetStringFromName("uncategorizedCards");
cardbookRepository.cardbookCollectedCards = strBundle.GetStringFromName("collectedCards");
// setting uncategorizedCards
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
try {
cardbookRepository.cardbookUncategorizedCards = prefs.getComplexValue("extensions.cardbook.uncategorizedCards", Components.interfaces.nsISupportsString).data;
if (cardbookRepository.cardbookUncategorizedCards == "") {
throw "CardBook no uncategorizedCards";
}
}
catch (e) {
let stringBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"].getService(Components.interfaces.nsIStringBundleService);
let strBundle = stringBundleService.createBundle("chrome://cardbook/locale/cardbook.properties");
cardbookRepository.cardbookUncategorizedCards = strBundle.GetStringFromName("uncategorizedCards");
var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
str.data = cardbookRepository.cardbookUncategorizedCards;
prefs.setComplexValue("extensions.cardbook.uncategorizedCards", Components.interfaces.nsISupportsString, str);
}
// setting preferEmailPref for getting usefull emails
cardbookRepository.preferEmailPref = prefs.getBoolPref("extensions.cardbook.preferEmailPref");
// migration functions (should be removed)
......
This diff is collapsed.
if ("undefined" == typeof(wdw_cardbookRenameField)) {
var wdw_cardbookRenameField = {
setNotification: function(aReasonCode) {
var notificationBox = document.getElementById("errorNotifications");
if (aReasonCode == "OK") {
notificationBox.removeAllNotifications();
} else {
let existingBox = notificationBox.getNotificationWithValue(aReasonCode);
if (!existingBox) {
var strBundle = document.getElementById("cardbook-strings");
var aReason = strBundle.getFormattedString("valueAlreadyExists", [document.getElementById('typeTextBox').value]);
notificationBox.appendNotification(aReason, aReasonCode, null, notificationBox.PRIORITY_WARNING_MEDIUM, null);
notificationBox.getNotificationWithValue(aReasonCode).setAttribute("hideclose", "true");
}
}
},
validate: function () {
var myValidationList = JSON.parse(JSON.stringify(window.arguments[0].validationList));
function filterOriginal(element) {
return (element != document.getElementById('typeTextBox').value);
}
myValidationList = myValidationList.filter(filterOriginal);
if (myValidationList.length != window.arguments[0].validationList.length) {
wdw_cardbookRenameField.setNotification("existingValue");
return false;
} else {
wdw_cardbookRenameField.setNotification("OK");
return true;
}
},
load: function () {
var strBundle = document.getElementById("cardbook-strings");
document.title = strBundle.getString("wdw_cardbookRenameField" + window.arguments[0].context + "Title");
......@@ -10,9 +40,11 @@ if ("undefined" == typeof(wdw_cardbookRenameField)) {
},
save: function () {
window.arguments[0].type = document.getElementById('typeTextBox').value.trim();
window.arguments[0].typeAction="SAVE";
close();
if (wdw_cardbookRenameField.validate()) {
window.arguments[0].type = document.getElementById('typeTextBox').value.trim();
window.arguments[0].typeAction="SAVE";
close();
}
},
cancel: function () {
......
......@@ -32,12 +32,15 @@
<rows>
<row align="center">
<label id="typeLabel" control="typeTextBox"/>
<textbox id="typeTextBox"/>
<textbox id="typeTextBox" oninput="wdw_cardbookRenameField.validate();"/>
</row>
</rows>
</grid>
</vbox>
</hbox>
<hbox flex="1">
<notificationbox id="errorNotifications" flex="1"/>
</hbox>
<hbox>
<spacer flex="1"/>
......
......@@ -361,10 +361,10 @@ toUpperCase=Převést na velká
toLowerCase=Převést na malá
wdw_cardbookRenameFieldOrgTitle=Editor organizace
wdw_cardbookRenameFieldCatTitle=Editor kategorií
wdw_cardbookRenameFieldEditCatTitle=Editor kategorií
wdw_cardbookRenameFieldAddCatTitle=Přidat novou kategorii
OrgLabel=Typ
CatLabel=Kategorie
EditCatLabel=Kategorie
AddCatLabel=Kategorie
wdw_cardbookConfigurationAddEmailsRestrictionTitle=Definice omezení e-mailového účtu
......@@ -402,3 +402,5 @@ dateFormatsMLabel=M
dateFormatsYLabel=Y
customLabel=Položka
valueAlreadyExists=??The value %S already exists??
......@@ -361,10 +361,10 @@ toUpperCase=Markierten Text in Großbuchstaben umwandeln
toLowerCase=Markierten Text in Kleinbuchstaben umwandeln
wdw_cardbookRenameFieldOrgTitle=Bearbeitung der Organisation
wdw_cardbookRenameFieldCatTitle=Bearbeitung der Kategorien
wdw_cardbookRenameFieldEditCatTitle=Bearbeitung der Kategorien
wdw_cardbookRenameFieldAddCatTitle=Neue Kategorie anlegen
OrgLabel=Typ
CatLabel=Kategorie
EditCatLabel=Kategorie
AddCatLabel=Kategorie
wdw_cardbookConfigurationAddEmailsRestrictionTitle=Beschränkungen festlegen
......@@ -402,3 +402,5 @@ dateFormatsMLabel=M
dateFormatsYLabel=Y
customLabel=Benutzerdef
valueAlreadyExists=??The value %S already exists??
......@@ -361,10 +361,10 @@ toUpperCase=Put in uppercase
toLowerCase=Put in lowercase
wdw_cardbookRenameFieldOrgTitle=Organization editor
wdw_cardbookRenameFieldCatTitle=Categories editor
wdw_cardbookRenameFieldEditCatTitle=Categories editor
wdw_cardbookRenameFieldAddCatTitle=Add a new category
OrgLabel=Type
CatLabel=Category
EditCatLabel=Category
AddCatLabel=Category
wdw_cardbookConfigurationAddEmailsRestrictionTitle=Mail Account Restriction Definition
......@@ -402,3 +402,5 @@ dateFormatsMLabel=M
dateFormatsYLabel=Y
customLabel=Custom
valueAlreadyExists=The value %S already exists
......@@ -361,10 +361,10 @@ toUpperCase=Mettre en majuscule
toLowerCase=Mettre en minuscule
wdw_cardbookRenameFieldOrgTitle=Modification des informations professionnelles
wdw_cardbookRenameFieldCatTitle=Modification des catégories
wdw_cardbookRenameFieldEditCatTitle=Modification des catégories
wdw_cardbookRenameFieldAddCatTitle=Ajouter une nouvelle catégorie
OrgLabel=Type
CatLabel=Catégorie
EditCatLabel=Catégorie
AddCatLabel=Catégorie
wdw_cardbookConfigurationAddEmailsRestrictionTitle=Définition d'une restriction sur un compte courrier
......@@ -402,3 +402,5 @@ dateFormatsMLabel=M
dateFormatsYLabel=Y
customLabel=Divers
valueAlreadyExists=La valeur %S est déjà présente
......@@ -361,10 +361,10 @@ toUpperCase=Nagybetűs átalakítása
toLowerCase=Kisbetűs átalakítása
wdw_cardbookRenameFieldOrgTitle=Szervezet szerkesztő
wdw_cardbookRenameFieldCatTitle=Kategória szerkesztő
wdw_cardbookRenameFieldEditCatTitle=Kategória szerkesztő
wdw_cardbookRenameFieldAddCatTitle=Kategória hozzáadás
OrgLabel=Típus
CatLabel=Kategória
EditCatLabel=Kategória
AddCatLabel=Kategória
wdw_cardbookConfigurationAddEmailsRestrictionTitle=Postafiók korlátozások meghatározása
......@@ -402,3 +402,5 @@ dateFormatsMLabel=H