Commit ee7a7a3c authored by CardBook's avatar CardBook

version 22.8

parent 7104127c
manifest components/cardbookAutocompleteSearch.manifest
resource cardbook-modules modules/
content cardbook chrome/content/
locale cardbook cs chrome/locale/cs/
locale cardbook da chrome/locale/da/
locale cardbook de chrome/locale/de/
locale cardbook en-US chrome/locale/en-US/
locale cardbook fr chrome/locale/fr/
locale cardbook hu chrome/locale/hu/
locale cardbook it chrome/locale/it/
locale cardbook nl chrome/locale/nl/
locale cardbook pl chrome/locale/pl/
locale cardbook pt-PT chrome/locale/pt-PT/
locale cardbook ru chrome/locale/ru/
locale cardbook sl chrome/locale/sl/
skin cardbook classic/1.0 chrome/skin/
skin cardbook-os classic/1.0 chrome/skin/unix/ os=Linux
skin cardbook-os classic/1.0 chrome/skin/windows/ os=WINNT
skin cardbook-os classic/1.0 chrome/skin/mac/ os=Darwin
# support for customizing toolbars
style chrome://global/content/customizeToolbar.xul chrome://cardbook/skin/toolbarButton.css
style chrome://global/content/customizeToolbar.xul chrome://cardbook-os/skin/cardbookToolbarButtons.css
# support for CardBook, yellow stars, creation from emails, formatting email fields
overlay chrome://messenger/content/messenger.xul chrome://cardbook/content/ovl_cardbook.xul
overlay chrome://messenger/content/messenger.xul chrome://cardbook/content/ovl_cardbookContexts.xul
# support for CardBook menu in composition window
overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://cardbook/content/ovl_cardbookComposeMsg.xul
# support for collected mail
overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://cardbook/content/collected/ovl_collected.xul
# support for expanding list
overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://cardbook/content/lists/ovl_list.xul
# support for search engines
overlay chrome://messenger/content/messenger.xul chrome://cardbook/content/filters/ovl_filters.xul
# 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
overlay chrome://lightning/content/lightning-menus.xul chrome://cardbook/content/lightning/ovl_lightningMenus.xul
# support for birthdays
overlay chrome://messenger/content/messenger.xul chrome://cardbook/content/birthdays/ovl_birthdays.xul
# support for importing attachments
overlay chrome://messenger/content/messenger.xul chrome://cardbook/content/attachments/ovl_attachments.xul
# support for attaching a vCard
overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://cardbook/content/attachvCard/ovl_attachvCard.xul
# support for CardBook Tab
overlay chrome://messenger/content/messenger.xul chrome://cardbook/content/ovl_cardbookTab.xul
# support for Contacts sidebar
overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://cardbook/content/contactsSidebar/ovl_cardbookContactsSidebarMain.xul
# support for the message window
overlay chrome://messenger/content/messageWindow.xul chrome://cardbook/content/ovl_cardbookContexts.xul
manifest components/cardbookAutocompleteSearch.manifest
resource cardbook-modules modules/
content cardbook chrome/content/
locale cardbook cs chrome/locale/cs/
locale cardbook da chrome/locale/da/
locale cardbook de chrome/locale/de/
locale cardbook en-US chrome/locale/en-US/
locale cardbook fr chrome/locale/fr/
locale cardbook hu chrome/locale/hu/
locale cardbook it chrome/locale/it/
locale cardbook nl chrome/locale/nl/
locale cardbook pl chrome/locale/pl/
locale cardbook pt-PT chrome/locale/pt-PT/
locale cardbook ru chrome/locale/ru/
locale cardbook sl chrome/locale/sl/
skin cardbook classic/1.0 chrome/skin/
skin cardbook-os classic/1.0 chrome/skin/unix/ os=Linux
skin cardbook-os classic/1.0 chrome/skin/windows/ os=WINNT
skin cardbook-os classic/1.0 chrome/skin/mac/ os=Darwin
# support for customizing toolbars
style chrome://global/content/customizeToolbar.xul chrome://cardbook/skin/toolbarButton.css
style chrome://global/content/customizeToolbar.xul chrome://cardbook-os/skin/cardbookToolbarButtons.css
# support for CardBook, yellow stars, creation from emails, formatting email fields
overlay chrome://messenger/content/messenger.xul chrome://cardbook/content/ovl_cardbook.xul
overlay chrome://messenger/content/messenger.xul chrome://cardbook/content/ovl_cardbookContexts.xul
# support for CardBook menu in composition window
overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://cardbook/content/ovl_cardbookComposeMsg.xul
# support for collected mail
overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://cardbook/content/collected/ovl_collected.xul
# support for expanding list
overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://cardbook/content/lists/ovl_list.xul
# support for search engines
overlay chrome://messenger/content/messenger.xul chrome://cardbook/content/filters/ovl_filters.xul
# 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
overlay chrome://lightning/content/lightning-menus.xul chrome://cardbook/content/lightning/ovl_lightningMenus.xul
# support for birthdays
overlay chrome://messenger/content/messenger.xul chrome://cardbook/content/birthdays/ovl_birthdays.xul
# support for importing attachments
overlay chrome://messenger/content/messenger.xul chrome://cardbook/content/attachments/ovl_attachments.xul
# support for attaching a vCard
overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://cardbook/content/attachvCard/ovl_attachvCard.xul
# support for CardBook Tab
overlay chrome://messenger/content/messenger.xul chrome://cardbook/content/ovl_cardbookTab.xul
# support for Contacts sidebar
overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://cardbook/content/contactsSidebar/ovl_cardbookContactsSidebarMain.xul
# support for the message window
overlay chrome://messenger/content/messageWindow.xul chrome://cardbook/content/ovl_cardbookContexts.xul
if ("undefined" == typeof(wdw_newGoogleToken)) {
var wdw_newGoogleToken = {
closeKO: function () {
Components.utils.import("chrome://cardbook/content/cardbookRepository.js");
cardbookRepository.cardbookGoogleRefreshTokenError[window.arguments[0].dirPrefId]++;
cardbookRepository.cardbookGoogleRefreshTokenResponse[window.arguments[0].dirPrefId]++;
cardbookRepository.cardbookServerSyncResponse[window.arguments[0].dirPrefId]++;
close();
}
};
};
\ No newline at end of file
if ("undefined" == typeof(wdw_newGoogleToken)) {
var wdw_newGoogleToken = {
closeKO: function () {
Components.utils.import("chrome://cardbook/content/cardbookRepository.js");
cardbookRepository.cardbookGoogleRefreshTokenError[window.arguments[0].dirPrefId]++;
cardbookRepository.cardbookGoogleRefreshTokenResponse[window.arguments[0].dirPrefId]++;
cardbookRepository.cardbookServerSyncResponse[window.arguments[0].dirPrefId]++;
close();
}
};
};
......@@ -44,9 +44,6 @@ if ("undefined" == typeof(ovl_attachments)) {
},
loadAttachment: function(aAttachment, aDirPrefId) {
var loader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"].getService(Components.interfaces.mozIJSSubScriptLoader);
loader.loadSubScript("chrome://cardbook/content/cardbookSynchronization.js");
loader.loadSubScript("chrome://cardbook/content/cardbookUtils.js");
var myFileArray = aAttachment.name.split(".");
var myExtension = myFileArray[myFileArray.length-1];
if (myExtension.toLowerCase() == "vcf") {
......@@ -90,7 +87,10 @@ if ("undefined" == typeof(ovl_attachments)) {
}
}
}
}
};
var loader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"].getService(Components.interfaces.mozIJSSubScriptLoader);
loader.loadSubScript("chrome://cardbook/content/cardbookSynchronization.js");
loader.loadSubScript("chrome://cardbook/content/cardbookUtils.js");
};
// for the displaying or not import into CardBook for all attachments
......
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xul-overlay href="chrome://cardbook/content/ovl_cardbookStringBundle.xul"?>
<!DOCTYPE overlay SYSTEM "chrome://cardbook/locale/ovl_cardbook.dtd">
<overlay id="ovl_attachments"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<stringbundleset id="stringbundleset"/>
<script src="chrome://cardbook/content/cardbookUtils.js"/>
<script src="chrome://cardbook/content/wdw_log.js"/>
<script src="chrome://cardbook/content/mailContact/ovl_cardbookMailContacts.js"/>
<script src="chrome://cardbook/content/attachments/ovl_attachments.js"/>
<menupopup id="attachmentSaveAllMultipleMenu" >
<menu id="attachments1CardBookImport" label="&addAllAttachementsToCardBookMenuLabel;" insertafter="button-saveAllAttachments">
<menupopup id="attachments1CardBookImportPopup"/>
</menu>
</menupopup>
<menupopup id="attachmentSaveAllSingleMenu" >
<menu id="attachment1CardBookImport" label="&addAttachementToCardBookMenuLabel;" insertafter="button-saveAttachment">
<menupopup id="attachment1CardBookImportPopup"/>
</menu>
</menupopup>
<menupopup id="attachmentListContext" >
<menu id="attachments2CardBookImport" label="&addAllAttachementsToCardBookMenuLabel;" insertafter="context-saveAllAttachments">
<menupopup id="attachments2CardBookImportPopup"/>
</menu>
</menupopup>
<menupopup id="attachmentItemContext" >
<menu id="attachment2CardBookImport" label="&addAttachementToCardBookMenuLabel;" insertafter="context-saveAttachment">
<menupopup id="attachment2CardBookImportPopup"/>
</menu>
</menupopup>
</overlay>
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xul-overlay href="chrome://cardbook/content/ovl_cardbookStringBundle.xul"?>
<!DOCTYPE overlay SYSTEM "chrome://cardbook/locale/ovl_cardbook.dtd">
<overlay id="ovl_attachments"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<stringbundleset id="stringbundleset"/>
<script src="chrome://cardbook/content/cardbookUtils.js"/>
<script src="chrome://cardbook/content/wdw_log.js"/>
<script src="chrome://cardbook/content/mailContact/ovl_cardbookMailContacts.js"/>
<script src="chrome://cardbook/content/attachments/ovl_attachments.js"/>
<menupopup id="attachmentSaveAllMultipleMenu" >
<menu id="attachments1CardBookImport" label="&addAllAttachementsToCardBookMenuLabel;" insertafter="button-saveAllAttachments">
<menupopup id="attachments1CardBookImportPopup"/>
</menu>
</menupopup>
<menupopup id="attachmentSaveAllSingleMenu" >
<menu id="attachment1CardBookImport" label="&addAttachementToCardBookMenuLabel;" insertafter="button-saveAttachment">
<menupopup id="attachment1CardBookImportPopup"/>
</menu>
</menupopup>
<menupopup id="attachmentListContext" >
<menu id="attachments2CardBookImport" label="&addAllAttachementsToCardBookMenuLabel;" insertafter="context-saveAllAttachments">
<menupopup id="attachments2CardBookImportPopup"/>
</menu>
</menupopup>
<menupopup id="attachmentItemContext" >
<menu id="attachment2CardBookImport" label="&addAttachementToCardBookMenuLabel;" insertafter="context-saveAttachment">
<menupopup id="attachment2CardBookImportPopup"/>
</menu>
</menupopup>
</overlay>
if ("undefined" == typeof(ovl_attachvCard)) {
var ovl_attachvCard = {
attachvCard: function () {
Components.utils.import("chrome://cardbook/content/cardbookRepository.js");
cardbookUtils.jsInclude(["chrome://cardbook/content/preferences/cardbookPreferences.js"]);
var cardbookPrefService = new cardbookPreferenceService();
var selected = document.getElementById("msgIdentity").selectedItem;
var key = selected.getAttribute("identitykey");
var result = [];
result = cardbookPrefService.getAllVCards();
for (var i = 0; i < result.length; i++) {
var resultArray = result[i].split("::");
if (resultArray[0] == "true") {
if (resultArray[1] == key || resultArray[1] == "allMailAccounts") {
var myFilename = resultArray[4];
if (cardbookRepository.cardbookCards[resultArray[2]+"::"+resultArray[3]]) {
var myCard = cardbookRepository.cardbookCards[resultArray[2]+"::"+resultArray[3]];
var attachment = Components.classes["@mozilla.org/messengercompose/attachment;1"].createInstance(Components.interfaces.nsIMsgAttachment);
attachment.contentType = "text/vcard";
attachment.name = myFilename;
var myFile = cardbookUtils.getTempFile();
myFile.append("cardbook-send-messages");
myFile.append(myFilename);
if (myFile.exists() && myFile.isFile()) {
try {
myFile.remove(true);
} catch(e) {
cardbookUtils.formatStringForOutput("errorAttachingFile", [myFile.path, e], "Error");
return;
}
}
cardbookSynchronization.writeContentToFile(myFile.path, cardbookUtils.getvCardForEmail(myCard), "UTF8");
if (myFile.exists() && myFile.isFile()) {
attachment.url = "file:///" + myFile.path;
gMsgCompose.compFields.addAttachment(attachment);
} else {
cardbookUtils.formatStringForOutput("errorAttachingFile", [myFile.path], "Error");
}
}
}
}
}
}
}
};
window.addEventListener("compose-send-message", function(e) { ovl_attachvCard.attachvCard(e); }, true);
if ("undefined" == typeof(ovl_attachvCard)) {
var ovl_attachvCard = {
attachvCard: function () {
Components.utils.import("chrome://cardbook/content/cardbookRepository.js");
var cardbookPrefService = new cardbookPreferenceService();
var selected = document.getElementById("msgIdentity").selectedItem;
var key = selected.getAttribute("identitykey");
var result = [];
result = cardbookPrefService.getAllVCards();
for (var i = 0; i < result.length; i++) {
var resultArray = result[i].split("::");
if (resultArray[0] == "true") {
if (resultArray[1] == key || resultArray[1] == "allMailAccounts") {
var myFilename = resultArray[4];
if (cardbookRepository.cardbookCards[resultArray[2]+"::"+resultArray[3]]) {
var myCard = cardbookRepository.cardbookCards[resultArray[2]+"::"+resultArray[3]];
var attachment = Components.classes["@mozilla.org/messengercompose/attachment;1"].createInstance(Components.interfaces.nsIMsgAttachment);
attachment.contentType = "text/vcard";
attachment.name = myFilename;
var myFile = cardbookUtils.getTempFile();
myFile.append("cardbook-send-messages");
myFile.append(myFilename);
if (myFile.exists() && myFile.isFile()) {
try {
myFile.remove(true);
} catch(e) {
cardbookUtils.formatStringForOutput("errorAttachingFile", [myFile.path, e], "Error");
return;
}
}
cardbookSynchronization.writeContentToFile(myFile.path, cardbookUtils.getvCardForEmail(myCard), "UTF8");
if (myFile.exists() && myFile.isFile()) {
attachment.url = "file:///" + myFile.path;
gMsgCompose.compFields.addAttachment(attachment);
} else {
cardbookUtils.formatStringForOutput("errorAttachingFile", [myFile.path], "Error");
}
}
}
}
}
}
};
var loader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"].getService(Components.interfaces.mozIJSSubScriptLoader);
loader.loadSubScript("chrome://cardbook/content/preferences/cardbookPreferences.js");
};
window.addEventListener("compose-send-message", function(e) { ovl_attachvCard.attachvCard(e); }, true);
if ("undefined" == typeof(ovl_birthdays)) {
var ovl_birthdays = {
lTimerPopup : null,
lPopupShowed : 0,
lEventTimerPopup : { notify: function(lTimerPopup) {
if (cardbookBirthdaysUtils.getPref("extensions.cardbook.showPeriodicPopup")) {
var popupTime = cardbookBirthdaysUtils.getPref("extensions.cardbook.periodicPopupIime");
var dateOfToday = new Date();
var dateOfTodayHour = (dateOfToday.getHours()<10?'0':'') + dateOfToday.getHours();
var dateOfTodayMin = (dateOfToday.getMinutes()<10?'0':'') + dateOfToday.getMinutes();
var checkTime = dateOfTodayHour.toString() + dateOfTodayMin.toString();
var EmptyParamRegExp1 = new RegExp("(.*)([^0-9])(.*)", "ig");
if (popupTime.replace(EmptyParamRegExp1, "$1")!=popupTime) {
var checkPopupHour = popupTime.replace(EmptyParamRegExp1, "$1");
var checkPopupMin = popupTime.replace(EmptyParamRegExp1, "$3");
if (checkPopupHour < 10 && checkPopupHour.length == 1) {
checkPopupHour = "0" + checkPopupHour;
}
if (checkPopupMin < 10 && checkPopupMin.length == 1) {
checkPopupMin = "0" + checkPopupMin;
}
var checkPopupTime = checkPopupHour.toString() + checkPopupMin.toString();
}
if ((checkTime == checkPopupTime) && (ovl_birthdays.lPopupShowed == 0)) {
ovl_birthdays.lPopupShowed++;
ovl_birthdays.onShowPopup();
} else if ((ovl_birthdays.lPopupShowed > 0) && (ovl_birthdays.lPopupShowed < 8)) {
ovl_birthdays.lPopupShowed++;
} else {
ovl_birthdays.lPopupShowed=0;
}
}
} },
onLoad: function() {
Components.utils.import("chrome://cardbook/content/cardbookRepository.js");
if (cardbookBirthdaysUtils.getPref("extensions.cardbook.showPopupOnStartup")) {
ovl_birthdays.onShowPopup();
}
if (cardbookBirthdaysUtils.getPref("extensions.cardbook.syncWithLightningOnStartup")) {
Components.utils.import("resource://gre/modules/AddonManager.jsm");
AddonManager.getAddonByID(cardbookRepository.LIGHTNING_ID, ovl_birthdays.displaySyncListAddon);
}
},
displayBirthdayList: function() {
Components.utils.import("chrome://cardbook/content/cardbookRepository.js");
if (cardbookRepository.cardbookBirthdayPopup == 0) {
cardbookRepository.cardbookBirthdayPopup++;
var MyWindows = window.openDialog("chrome://cardbook/content/birthdays/wdw_birthdayList.xul", "", "chrome,centerscreen,modal,resizable");
cardbookRepository.cardbookBirthdayPopup--;
}
},
displaySyncListAddon: function(addon) {
if (addon && addon.isActive) {
cardbookBirthdaysUtils.syncWithLightning();
}
},
displaySyncList: function() {
var MyWindows = window.openDialog("chrome://cardbook/content/birthdays/wdw_birthdaySync.xul", "", "chrome,centerscreen,modal,resizable");
},
onShowPopup: function() {
var maxDaysUntilNextBirthday = cardbookBirthdaysUtils.getPref("extensions.cardbook.numberOfDaysForSearching");
cardbookBirthdaysUtils.loadBirthdays(maxDaysUntilNextBirthday);
var lshowPopupEvenIfNoBirthday = cardbookBirthdaysUtils.getPref("extensions.cardbook.showPopupEvenIfNoBirthday");
if ((cardbookBirthdaysUtils.lBirthdayList.length>0) || lshowPopupEvenIfNoBirthday) {
ovl_birthdays.displayBirthdayList();
}
}
};
ovl_birthdays.lTimerPopup = Components.classes["@mozilla.org/timer;1"].createInstance(Components.interfaces.nsITimer);
ovl_birthdays.lTimerPopup.initWithCallback(ovl_birthdays.lEventTimerPopup, 10000, Components.interfaces.nsITimer.TYPE_REPEATING_SLACK);
}
\ No newline at end of file
if ("undefined" == typeof(ovl_birthdays)) {
var ovl_birthdays = {
lTimerPopup : null,
lPopupShowed : 0,
lEventTimerPopup : { notify: function(lTimerPopup) {
if (cardbookBirthdaysUtils.getPref("extensions.cardbook.showPeriodicPopup")) {
var popupTime = cardbookBirthdaysUtils.getPref("extensions.cardbook.periodicPopupIime");
var dateOfToday = new Date();
var dateOfTodayHour = (dateOfToday.getHours()<10?'0':'') + dateOfToday.getHours();
var dateOfTodayMin = (dateOfToday.getMinutes()<10?'0':'') + dateOfToday.getMinutes();
var checkTime = dateOfTodayHour.toString() + dateOfTodayMin.toString();
var EmptyParamRegExp1 = new RegExp("(.*)([^0-9])(.*)", "ig");
if (popupTime.replace(EmptyParamRegExp1, "$1")!=popupTime) {
var checkPopupHour = popupTime.replace(EmptyParamRegExp1, "$1");
var checkPopupMin = popupTime.replace(EmptyParamRegExp1, "$3");
if (checkPopupHour < 10 && checkPopupHour.length == 1) {
checkPopupHour = "0" + checkPopupHour;
}
if (checkPopupMin < 10 && checkPopupMin.length == 1) {
checkPopupMin = "0" + checkPopupMin;
}
var checkPopupTime = checkPopupHour.toString() + checkPopupMin.toString();
}
if ((checkTime == checkPopupTime) && (ovl_birthdays.lPopupShowed == 0)) {
ovl_birthdays.lPopupShowed++;
ovl_birthdays.onShowPopup();
} else if ((ovl_birthdays.lPopupShowed > 0) && (ovl_birthdays.lPopupShowed < 8)) {