Commit 6b899729 authored by Mechtilde's avatar Mechtilde

Imported Upstream version 3.3.1

parent 01cbcb2b
#!/bin/sh
version=`sed -n -e "s/.*<em:version>\(.*\)<\/em:version>/\1/p" install.rdf`
zip -r exchangecalendar-$version.xpi * -x \*.git \*.xpi \*.sh
......@@ -26,6 +26,10 @@ overlay chrome://calendar/content/calendar-event-dialog-attendees.xul chrome://e
overlay chrome://messenger/content/messenger.xul chrome://exchangecalendar/content/OutOfOfficeMenu.xul
overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://exchangecalendar/content/addressingWidgetOverlay.xul
overlay chrome://messenger/content/preferences/preferences.xul chrome://exchangecalendar/content/extra-priority-preferences.xul
overlay chrome://messenger/content/messenger.xul chrome://exchangecalendar/content/priority-display.xul
overlay chrome://messenger/content/messenger.xul chrome://exchangecalendar/content/invite-style.xul
locale exchangecalendar nl locale/exchangecalendar/nl/
locale exchangecalendar en-US locale/exchangecalendar/en-US/
locale exchangecalendar fr-FR locale/exchangecalendar/fr-FR/
......
......@@ -97,7 +97,17 @@ exchForewardEvent.prototype = {
erForewardItemRequestOK : function _erForewardItemRequestOK(aForewardItemRequest, aResp)
{
alert(aResp);
if(aResp){
var title="Forwarding Event";
var msg=aResp;
var image = "chrome://exchangecalendar/skin/notify-icon.png";
var win = Components.classes['@mozilla.org/embedcomp/window-watcher;1'].
getService(Components.interfaces.nsIWindowWatcher).
openWindow(null, 'chrome://global/content/alerts/alert.xul',
'_blank', 'chrome,titlebar=no,popup=yes', null);
win.arguments = [image, title, msg, true, ''];
}
},
erForewardItemRequestError: function _erForewardItemRequestError(aForewardItemRequest, aCode, aMsg)
......
......@@ -95,8 +95,8 @@ try{
onLoad: function _onLoad()
{
//onLoad();
if (this._window.arguments[0].calendarEvent.calendar.type != "exchangecalendar") {
this._document.getElementById("exchWebService-body-editor").setAttribute("scrollbars","yes");
if (this._window.arguments[0].calendarEvent.calendar.type != "exchangecalendar") {
if (this._document.getElementById("item-description")) {
this._document.getElementById("item-description").hidden = false;
}
......@@ -225,6 +225,7 @@ try{
this._document.getElementById("exchWebService-details-separator").hidden = true;
this._document.getElementById("event-grid-location-row").hidden = false;
this._document.getElementById("event-grid-recurrence-row").hidden=false;
// Clear reminder select list for todo
this._document.getElementById("reminder-none-separator").hidden = false;
......
......@@ -179,13 +179,17 @@ exchCheck4Lightning.prototype = {
updaterCallBack: function _updaterCallBack(aResult)
{
if (aResult.versionChanged <= 0) {
this.globalFunctions.LOG("No new version available.");
if (aResult.versionChanged <= 0) {
if(aResult.error){
this.globalFunctions.LOG("updaterCallBack: Unable to fetch from url");
}
this.globalFunctions.LOG("updaterCallBack: No new version available.");
}
else {
this.globalFunctions.LOG("New version available.");
this.globalFunctions.LOG(" ++ Version:"+aResult.updateDetails.newVersion);
this.globalFunctions.LOG(" ++ URL:"+aResult.updateDetails.updateURL);
this.globalFunctions.LOG("updaterCallBack: New version available.");
this.globalFunctions.LOG("updaterCallBack: ++ Version:"+aResult.updateDetails.newVersion);
this.globalFunctions.LOG("updaterCallBack: ++ URL:"+aResult.updateDetails.updateURL);
var self = this;
if (this.globalFunctions.safeGetBoolPref(null, "extensions.1st-setup.others.warnAboutNewAddOnVersion", true, true)) {
// this.lightningAlertTimer2.initWithCallback(function(aResult){ self.lightningAlertCallback2(aResult);}, 15000, this.lightningAlertTimer2.TYPE_ONE_SHOT);
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE prefwindow SYSTEM "chrome://exchangecalendar/locale/extra-priority.dtd">
<?xml-stylesheet href="chrome://exchangecalendar/content/extras-preferences.css"?>
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefwindow id="MailPreferences">
<prefpane id="extra-pane" label="&prefwindow.title;" >
<preferences>
<preference id="extensions.extras.Iconify"
name="extensions.extras.Iconify"
type="bool"/>
<preference id="extensions.extras.ShadeHigh"
name="extensions.extras.ShadeHigh"
type="bool"/>
<preference id="extensions.extras.ShadeLow"
name="extensions.extras.ShadeLow"
type="bool"/>
<preference id="extensions.extras.tagImportant"
name="extensions.extras.tagImportant"
type="bool"/>
<preference id="extensions.extras.HighestColor"
name="extensions.extras.HighestColor"
type="unichar"/>
<preference id="extensions.extras.HighColor"
name="extensions.extras.HighColor"
type="unichar"/>
<preference id="extensions.extras.LowColor"
name="extensions.extras.LowColor"
type="unichar"/>
<preference id="extensions.extras.LowestColor"
name="extensions.extras.LowestColor"
type="unichar"/>
</preferences>
<tabbox flex="1">
<tabs>
<tab label="&general.label;"/>
</tabs>
<tabpanels flex="1">
<tabpanel flex="1">
<vbox>
<checkbox id="iconify-checkbox"
preference="extensions.extras.Iconify"
label="&iconify.label;"/>
<checkbox id="shade-high-checkbox"
preference="extensions.extras.ShadeHigh"
label="&shadeHigh.label;"/>
<checkbox id="shade-low-checkbox"
preference="extensions.extras.ShadeLow"
label="&shadeLow.label;"/>
<checkbox id="mark-imp-checkbox"
preference="extensions.extras.tagImportant"
label="&tagImportant.label;"/>
</vbox>
<hbox>
<groupbox flex="1">
<caption label="&pref.color;"/>
<hbox align="center" style="margin-top: 5px">
<label value="&highestColor.label;" control="foregroundtextmenu"/>
<spacer flex="1"/>
<colorpicker type="button" palettename="standard"
preference="extensions.extras.HighestColor"/>
</hbox>
<hbox align="center" style="margin-top: 5px">
<label value="&lowestColor.label;" control="unvisitedlinkmenu"/>
<spacer flex="1"/>
<colorpicker type="button" palettename="standard"
preference="extensions.extras.LowestColor"/>
</hbox>
<separator class="thin"/>
</groupbox>
<groupbox flex="1">
<caption label=" "/>
<hbox align="center" style="margin-top: 5px">
<label value="&highColor.label;" control="backgroundmenu"/>
<spacer flex="1"/>
<colorpicker type="button" palettename="standard"
preference="extensions.extras.HighestColor"/>
</hbox>
<hbox align="center" style="margin-top: 5px">
<label value="&lowColor.label;" control="visitedlinkmenu"/>
<spacer flex="1"/>
<colorpicker type="button" palettename="standard"
preference="extensions.extras.LowestColor"/>
</hbox>
<separator class="thin"/>
<hbox align="center">
</hbox>
</groupbox>
</hbox>
</tabpanel>
</tabpanels>
</tabbox>
</prefpane>
</prefwindow>
</overlay>
radio[pane=extra-pane] {
list-style-image: url("chrome://exchangecalendar/skin/extra-icon.png");
}
.inviteColumnHeader {
list-style-image: url("chrome://exchangecalendar/skin/threadcol-invite.gif");
}
\ No newline at end of file
Components.utils.import("resource:///modules/gloda/mimemsg.js");
function showIconsAsInviteColumn(){}
showIconsAsInviteColumn.prototype.execute = function(){
var extrasObserver = {
observe: function(aMsgFolder, aTopic, aData) {
if (gDBView) {
var columnHandler = {
getCellText: function(row, col) {},
getSortStringForRow: function(hdr) {
var Subject = hdr.mime2DecodedSubject;
var isInviteMail= hdr.getStringProperty("isInviteMail");
if( isInviteMail == "true" ){
var res = Subject.match(/Accepted:/);
if(!res){
res = Subject.match(/Declined:/);
}
else{
return "accepted";
}
if(!res){
res = Subject.match(/Tentative:/);
}
else{
return "declined";
}
if(!res){
res = Subject.match(/Canceled:/);
}
else{
return "tentative";
}
if(!res){
res = Subject.match(/Updated:/);
}
else{
return "updated";
}
if(!res){
res = Subject.match(/Event Invitation:/);
}
else{
return "updated";
}
return "invited";
}
},
isString: function() { return true; },
getImageSrc: function(row, col) {
var hdr = gDBView.getMsgHdrAt(row);
var Subject = hdr.mime2DecodedSubject;
var msgFolder=hdr.folder;
var isInviteMail= hdr.getStringProperty("isInviteMail");
if( ( isInviteMail == "false" ) || ( isInviteMail == "true" ) ) {
}
else {
var self=this;
setTimeout( function(){ tmpMailTools.fetchMail(hdr); } ,0);
setTimeout( function(row,col){ self.getImageSrc(row,col); } ,5000);
}
/* if( isInviteMail == "" ){
MsgHdrToMimeMessage(hdr, null, function (hdr, aMimeMessage) {
try {
let attachments = aMimeMessage.allUserAttachments || aMimeMessage.allAttachments;
if ( attachments.length == 1){
for (let [index, att] in Iterator(attachments))
{
if ( att.name == "invite.ics" ){
hdr.setStringProperty("isInviteMail","true");
}
}
}
} catch (err) {}
}, true ,{examineEncryptedParts:true,}); // true means force the message into being downloaded... this might take some time!
} */ //Thunderbird crashes during new account.
if( isInviteMail == "true" ){
var res = Subject.match(/Accepted:/);
if(!res){
res = Subject.match(/Declined:/);
}
else{
return "chrome://exchangeCalendar/skin/accepted.png";
}
if(!res){
res = Subject.match(/Tentative:/);
}
else{
return "chrome://exchangeCalendar/skin/declined.png";
}
if(!res){
res = Subject.match(/Canceled:/);
}
else{
return "chrome://exchangeCalendar/skin/tentative.png";
}
if(!res){
res = Subject.match(/Updated:/);
}
else{
return "chrome://exchangeCalendar/skin/updated.png";
}
if(!res){
res = Subject.match(/Event Invitation:/);
}
else{
return "chrome://exchangeCalendar/skin/updated.png";
}
return "chrome://exchangeCalendar/skin/invited.png";
}
},
getSortLongForRow: function(hdr) {},
isEditable: function(row, col) {
return false;
},
getCellProperties: function(row, col, properties) {
return properties;
},
cycleCell: function(row, col) {
},
getRowProperties: function(row, properties) {
return properties;
}
};
try {
columnHandler.old = gDBView.getColumnHandler("inviteCol");
}
catch (ex) {}
gDBView.addColumnHandler("inviteCol", columnHandler);
}//ifend
}
};
var ObserverService = Cc["@mozilla.org/observer-service;1"]
.getService(Ci.nsIObserverService);
ObserverService.addObserver( extrasObserver, "MsgCreateDBView", false);
};
function mailTools(aWindow,aDocument) {
this._window = aWindow;
this._document = aDocument;
try{
this.msgHdrs = [] ;
this.working = null;
}catch(e){}
}
mailTools.prototype.getMailBody = function(aMsgHdr,aCallback) {
if( this.working ){
let callback=aCallback;
let uri=aMsgHdr.folder.getUriForMsg(aMsgHdr);
var messageStream = Components.classes["@mozilla.org/network/sync-stream-listener;1"].createInstance()
.QueryInterface(Components.interfaces.nsIInputStream);
var inputStream = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance()
.QueryInterface(Components.interfaces.nsIScriptableInputStream);
let messageService = messenger.messageServiceFromURI(uri);
inputStream.init(messageStream);
try {
messageService.streamMessage(uri, messageStream, null, null, false, "");
} catch (e) {
this.working=false;
}
let body = "";
inputStream.available();
while (inputStream.available()) {
body = body + inputStream.read(512);
}
inputStream.close();
messageStream.close();
callback(aMsgHdr,body);
this.working=false;
}
return;
}
mailTools.prototype.markMailAsInvite = function(aMsgHdr,bodyPlain){
var self=this;
var searchString = 'Content-Type: text/calendar;';
let result = bodyPlain.match(/Content-Type: text\/calendar;/g);
if( result == searchString ){
//setting header string to identify invitation mail
aMsgHdr.setStringProperty("isInviteMail","true");
}
else
{
aMsgHdr.setStringProperty("isInviteMail","false");
}
self.working=true;
return;
}
mailTools.prototype.fetchMail = function(oneMsgHdr){
//dump("\nxxxx fetchMail To be Processed : " + this.msgHdrs.length );
if( this.msgHdrs.length > 10 ) {
this.msgHdrs.shift();
this.msgHdrs.push(oneMsgHdr);
return;
}else
{
this.msgHdrs.push(oneMsgHdr);
}
if( this.msgHdrs.length < 1 ) return;
if ( this.working != true ) {
while ( this.msgHdrs.length > 0 ){
if( this.working == true ) continue;
this.working=true;
var self=this;
var aMsgHdr=this.msgHdrs.pop();
let isInviteMail=aMsgHdr.getStringProperty("isInviteMail");
if( ( isInviteMail == "false" ) || ( isInviteMail == "true" ) ) {
this.working=false;
continue;
}
else{
//call to analyze change body
this.getMailBody(aMsgHdr,function(aMsgHdr,bodyPlain){ self.markMailAsInvite(aMsgHdr,bodyPlain);}) ;
}
}
}
return;
}
mailTools.prototype.onLoad = function(){
var self=this;
this.newMailListener = {
msgAdded: function(aMsgHdr) {
setTimeout( function(){ self.fetchMail(aMsgHdr); } ,3000);
}
};
var notificationService = Components.classes["@mozilla.org/messenger/msgnotificationservice;1"]
.getService(Components.interfaces.nsIMsgFolderNotificationService);
notificationService.addListener(this.newMailListener, notificationService.msgAdded);
}
var tmpShowIconsAsInviteColumn = new showIconsAsInviteColumn();
var tmpMailTools = new mailTools(window,document);
window.addEventListener("load",tmpShowIconsAsInviteColumn.execute(),false);
window.addEventListener("load",tmpMailTools.onLoad(),false);
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://exchangecalendar/content/invite-style.css" type="text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://exchangecalendar/locale/inviteStyle.dtd">
<overlay xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script src="chrome://exchangecalendar/content/invite-style.js"/>
<tree id="threadTree">
<treecols id="threadCols">
<treecol id="inviteCol" name="inviteCol" class="treecol-image inviteColumnHeader" persist="hidden ordinal width"
label="&label.inviteCol;" currentView="unthreaded" tooltiptext="&tooltip.inviteCol;" fixed="true" width="25" sort="inviteCol" sortActive="true" sortDirection="ascending"/>
<splitter class="tree-splitter"/>
</treecols>
</tree>
</overlay>
\ No newline at end of file
......@@ -228,8 +228,7 @@ exchOOFSettings.prototype = {
setOofSettingsOK: function _setOofSettingsOK(aGetUserOofSettingsRequest)
{
this._document.getElementById("exchWebService-load-error-message").value = this.globalFunctions.getString("calExchangeCalendar", "ecSavedOofSettings", [], "exchangecalendar");
alert("Settings saved.");
this.infoPopup( this._document.title ,"Settings saved.");
this.getOofSettings();
},
......@@ -243,6 +242,15 @@ exchOOFSettings.prototype = {
},
infoPopup:function _infoPopup(title, msg) {
var image = "chrome://exchangecalendar/skin/notify-icon.png";
var win = Components.classes['@mozilla.org/embedcomp/window-watcher;1'].
getService(Components.interfaces.nsIWindowWatcher).
openWindow(null, 'chrome://global/content/alerts/alert.xul',
'_blank', 'chrome,titlebar=no,popup=yes', null);
win.arguments = [image, title, msg, true, ''];
},
}
var tmpOOFSettings = new exchOOFSettings(document, window);
......
This diff is collapsed.
/* Enhanced priority display */
var Cu=Components.utils;
var Cc=Components.classes;
var Ci=Components.interfaces;
Components.utils.import("resource://app/modules/gloda/public.js");
Components.utils.import("resource://app/modules/gloda/explattr.js");
Components.utils.import("resource:///modules/iteratorUtils.jsm");
var importantTag;
function getImportantTag(){
var tagService = Components.classes["@mozilla.org/messenger/tagservice;1"]
.getService(Components.interfaces.nsIMsgTagService);
var tagArray = tagService.getAllTags({});
for (var i = 0; i < tagArray.length; ++i)
{
var taginfo = tagArray[i];
if( taginfo.tag === "Important" ){
importantTag=taginfo.key;
return;
}
}
}
function tag(hdr){
if(importantTag){
toggleMessageTagPostEwsUpdate(importantTag, "addKeywordsToMessages" ,hdr); }
}
function gCP(pref) {
var prefService = Cc["@mozilla.org/preferences-service;1"]
.getService(Ci.nsIPrefService);
return prefService.getCharPref("extensions.extras." + pref);
}
function gBP(pref) {
var prefService = Cc["@mozilla.org/preferences-service;1"]
.getService(Ci.nsIPrefService);
return prefService.getBoolPref("extensions.extras." + pref);
}
function toggleMessageTagPostEwsUpdate(key, addKey,hdr) {
var messages = Components.classes["@mozilla.org/array;1"].createInstance(Components.interfaces.nsIMutableArray);
var msg = Components.classes["@mozilla.org/array;1"].createInstance(Components.interfaces.nsIMutableArray);
var selectedMessages = gFolderDisplay.selectedMessages;
var toggler = addKey ? "addKeywordsToMessages" : "removeKeywordsFromMessages";
var prevHdrFolder = null;
// this crudely handles cross-folder virtual folders with selected messages
// that spans folders, by coalescing consecutive msgs in the selection
// that happen to be in the same folder. nsMsgSearchDBView does this
// better, but nsIMsgDBView doesn't handle commands with arguments,
// and (un)tag takes a key argument.
for (var i = 0; i < selectedMessages.length; ++i) {
var msgHdr = hdr;
if (msgHdr.label) {
// Since we touch all these messages anyway, migrate the label now.
// If we don't, the thread tree won't always show the correct tag state,
// because resetting a label doesn't update the tree anymore...
msg.clear();
msg.appendElement(msgHdr, false);
msgHdr.folder.addKeywordsToMessages(msg, "$label" + msgHdr.label);
msgHdr.label = 0;
// remove legacy label
}
if (prevHdrFolder != msgHdr.folder) {
if (prevHdrFolder)
prevHdrFolder[toggler](messages, key);
messages.clear();
prevHdrFolder = msgHdr.folder;
}
messages.appendElement(msgHdr, false);
}
if (prevHdrFolder)
prevHdrFolder[toggler](messages, key);
}
function enhancePriority(){
this._document=document;
this._window=window;
}
enhancePriority.prototype={
execute:function _execute() {
var extrasObserver = {
observe: function(aMsgFolder, aTopic, aData) {
if (gDBView) {
var columnHandler = {
getCellText: function(row, col) {
if (gBP("Iconify"))
return "";
return gDBView.cellTextForColumn(row, "priorityCol");
},
getSortStringForRow: function(hdr) {
if (columnHandler.old)
return columnHandler.old.getSortStringForRow(hdr);
return null;