merge of 'aa5015ff0079b6856954284a0b566fd85c428a93'

and 'd894e5477e189d935a994c87418e92db405deacb'

Monotone-Parent: aa5015ff0079b6856954284a0b566fd85c428a93
Monotone-Parent: d894e5477e189d935a994c87418e92db405deacb
Monotone-Revision: ec44ffcb951f3db4e0041a44e56a9f0d5df4ef3b

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-08-06T14:24:02
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau 2010-08-06 14:24:02 +00:00
commit 44a7a9b099
11 changed files with 199 additions and 160 deletions

View file

@ -1,9 +1,26 @@
2010-08-06 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/SOGo/SOGoDomainDefaults.m
(-mailAuxiliaryUserAccountsEnabled): new method returning a BOOL
describing whether the domain users can access auxiliary mail
accounts.
* SoObjects/SOGo/SOGoUserDefaults.m (-setAuxiliaryMailAccounts:)
(auxiliaryMailAccounts): new methods that receives and returns an
NSArray of NSDictionary describing the user's auxiliary mail
accounts.
* UI/WebServerResources/HTMLElement.js: (deselectAll): if the
container has a "selectedElements" attribute, then it's no longer
required to wander through the "selectedIds" attribute. This fixes
a strange bug on IE when modifying the selection on LI lists.
2010-08-05 Francis Lachapelle <flachapelle@inverse.ca>
* UI/WebServerResources/SOGoResizableTable.js
(computeColumnsWidths): was previous part of saveColumnsState.
Used when the user hasn't modify the columns widths but the local "ratios"
hash still need to be built.
Used when the user hasn't modify the columns widths but the local
"ratios" hash still need to be built.
2010-08-04 Francis Lachapelle <flachapelle@inverse.ca>

View file

@ -37,6 +37,8 @@
- (NSArray *) userSources;
- (BOOL) mailAuxiliaryUserAccountsEnabled;
- (NSString *) mailDomain;
- (NSString *) imapServer;
- (NSString *) imapAclStyle;

View file

@ -98,6 +98,11 @@
return [self stringForKey: @"OCSFolderInfoURL"];
}
- (BOOL) mailAuxiliaryUserAccountsEnabled
{
return [self boolForKey: @"SOGoMailAuxiliaryUserAccountsEnabled"];
}
- (NSString *) mailDomain
{
return [self stringForKey: @"SOGoMailDomain"];

View file

@ -122,6 +122,9 @@ extern NSString *SOGoWeekStartFirstFullWeek;
- (void) setMailUseOutlookStyleReplies: (BOOL) newValue;
- (BOOL) mailUseOutlookStyleReplies;
- (void) setAuxiliaryMailAccounts: (NSArray *) newAccounts;
- (NSArray *) auxiliaryMailAccounts;
- (void) setCalendarCategories: (NSArray *) newValues;
- (NSArray *) calendarCategories;

View file

@ -511,6 +511,16 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek";
return [self boolForKey: @"SOGoMailUseOutlookStyleReplies"];
}
- (void) setAuxiliaryMailAccounts: (NSArray *) newAccounts
{
[self setObject: newAccounts forKey: @"AuxiliaryMailAccounts"];
}
- (NSArray *) auxiliaryMailAccounts
{
return [self arrayForKey: @"AuxiliaryMailAccounts"];
}
- (void) setCalendarCategories: (NSArray *) newValues
{
[self setObject: newValues forKey: @"SOGoCalendarCategories"];

View file

@ -229,8 +229,9 @@ Element.addMethods({
for (var i = 0; i < element.selectedElements.length; i++)
element.selectedElements[i].removeClassName('_selected');
element.selectedElements = null;
element.selectedIds = null;
}
if (element.selectedIds) {
else if (element.selectedIds) {
for (var i = 0; i < element.selectedIds.length; i++) {
var e = element.down('#' + element.selectedIds[i]);
if (e && e.hasClassName('_selected'))

View file

@ -1,66 +1,64 @@
/* -*- Mode: java; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
var MailerUIdTreeExtension = {
elementCounter: 1,
folderIcons: { account: "tbtv_account_17x17.png",
inbox: "tbtv_inbox_17x17.png",
sent: "tbtv_sent_17x17.png",
draft: "tbtv_drafts_17x17.png",
trash: "tbtv_trash_17x17.png" },
folderNames: { inbox: _("InboxFolderName"),
sent: _("SentFolderName"),
draft: _("DraftsFolderName"),
trash: _("TrashFolderName") },
_addFolderNode: function (parent, name, fullName, type, unseen) {
var icon = this.folderIcons[type];
if (icon)
icon = ResourcesURL + "/" + icon;
else
icon = "";
var displayName = this.folderNames[type];
var hasUnseen = false;
if (!displayName)
displayName = name;
if (typeof unseen != "undefined") {
hasUnseen = true;
displayName += "<span id=\"unseenCount\"> (<span>" + parseInt(unseen) + "</span>)</span>";
}
this.add(this.elementCounter, parent, displayName, 1, '#', fullName,
type, '', '', icon, icon, hasUnseen);
this.elementCounter++;
},
_addFolder: function (parent, folder) {
var thisCounter = this.elementCounter;
this._addFolderNode(parent, folder.displayName, folder.fullName(), folder.type, folder.unseen);
for (var i = 0; i < folder.children.length; i++)
this._addFolder(thisCounter, folder.children[i]);
},
addMailAccount: function (mailAccount) {
this._addFolder(0, mailAccount);
},
setCookie: function(cookieName, cookieValue, expires, path, domain, secure) {
},
getCookie: function(cookieName) {
return ("");
},
updateCookie: function () {
if (Mailer.foldersStateTimer)
clearTimeout(Mailer.foldersStateTimer);
Mailer.foldersStateTimer = setTimeout('saveFoldersState()', 3000); // 3 seconds
},
getFoldersState: function () {
var expandedFolders = new Array();
for (var n = 0; n < this.aNodes.length; n++) {
if (this.aNodes[n]._io && this.aNodes[n].pid != this.root.id) {
expandedFolders.push(this.aNodes[n].dataname);
}
elementCounter: 1,
folderIcons: { account: "tbtv_account_17x17.png",
inbox: "tbtv_inbox_17x17.png",
sent: "tbtv_sent_17x17.png",
draft: "tbtv_drafts_17x17.png",
trash: "tbtv_trash_17x17.png" },
folderNames: { inbox: _("InboxFolderName"),
sent: _("SentFolderName"),
draft: _("DraftsFolderName"),
trash: _("TrashFolderName") },
_addFolderNode: function (parent, name, fullName, type, unseen) {
var icon = this.folderIcons[type];
if (icon)
icon = ResourcesURL + "/" + icon;
else
icon = "";
var displayName = this.folderNames[type];
var hasUnseen = false;
if (!displayName)
displayName = name;
if (typeof unseen != "undefined") {
hasUnseen = true;
displayName += "<span id=\"unseenCount\"> (<span>" + parseInt(unseen) + "</span>)</span>";
}
this.add(this.elementCounter, parent, displayName, 1, '#', fullName,
type, '', '', icon, icon, hasUnseen);
this.elementCounter++;
},
_addFolder: function (parent, folder) {
var thisCounter = this.elementCounter;
this._addFolderNode(parent, folder.displayName, folder.fullName(), folder.type, folder.unseen);
for (var i = 0; i < folder.children.length; i++)
this._addFolder(thisCounter, folder.children[i]);
},
addMailAccount: function (mailAccount) {
this._addFolder(0, mailAccount);
},
setCookie: function(cookieName, cookieValue, expires, path, domain, secure) {
},
getCookie: function(cookieName) {
return ("");
},
updateCookie: function () {
if (Mailer.foldersStateTimer)
clearTimeout(Mailer.foldersStateTimer);
Mailer.foldersStateTimer = setTimeout('saveFoldersState()', 3000); // 3 seconds
},
getFoldersState: function () {
var expandedFolders = new Array();
for (var n = 0; n < this.aNodes.length; n++) {
if (this.aNodes[n]._io && this.aNodes[n].pid != this.root.id) {
expandedFolders.push(this.aNodes[n].dataname);
}
}
return expandedFolders.toJSON();
},
autoSync: function() {
this.config.useCookies = true;
}
return expandedFolders.toJSON();
},
autoSync: function() {
this.config.useCookies = true;
}
};
Object.extend(dTree.prototype, MailerUIdTreeExtension);

View file

@ -1,17 +1,16 @@
/* -*- Mode: java; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*--------------------------------------------------|
| dTree 2.05 | www.destroydrop.com/javascript/tree/ |
|---------------------------------------------------|
| Copyright (c) 2002-2003 Geir Landrö |
| |
| This script can be used freely as long as all |
| copyright messages are intact. |
| |
| Updated: 17.04.2003 |
|--------------------------------------------------*/
| dTree 2.05 | www.destroydrop.com/javascript/tree/ |
|---------------------------------------------------|
| Copyright (c) 2002-2003 Geir Landrö |
| |
| This script can be used freely as long as all |
| copyright messages are intact. |
| |
| Updated: 17.04.2003 |
|--------------------------------------------------*/
/* The content of attribute values should be quoted properly by using the
equivalent entities. */
equivalent entities. */
function dTreeQuote(str) {
return (str
.replace(/&/g, "&amp;")
@ -23,48 +22,48 @@ function dTreeQuote(str) {
// Node object
function Node(id, pid, name, isParent, url, dataname, datatype, title, target,
icon, iconOpen, open, hasUnseen) {
this.isParent = isParent;
this.id = id;
this.pid = pid;
this.name = name;
this.url = url;
this.title = title;
this.target = target;
this.icon = icon;
this.iconOpen = iconOpen;
this.dataname = dataname;
this.datatype = datatype;
this.hasUnseen = hasUnseen;
this._io = open || false;
this._is = false;
this._ls = false;
this._hc = false;
this._ai = 0;
this._p;
this.isParent = isParent;
this.id = id;
this.pid = pid;
this.name = name;
this.url = url;
this.title = title;
this.target = target;
this.icon = icon;
this.iconOpen = iconOpen;
this.dataname = dataname;
this.datatype = datatype;
this.hasUnseen = hasUnseen;
this._io = open || false;
this._is = false;
this._ls = false;
this._hc = false;
this._ai = 0;
this._p;
};
// Tree object
function dTree(objName) {
this.obj = objName;
this.config = {
target: null,
useCookies: false
target: null,
useCookies: false
};
this.icon = {
root: 'img/base.gif',
folder: 'img/folder.gif',
folderOpen: 'img/folderopen.gif',
node: 'img/page.gif',
empty: 'img/empty.gif',
line: 'img/line.gif',
join: 'img/join.gif',
joinBottom: 'img/joinbottom.gif',
plus: 'img/plus.gif',
plusBottom: 'img/plusbottom.gif',
minus: 'img/minus.gif',
minusBottom: 'img/minusbottom.gif',
nlPlus: 'img/nolines_plus.gif',
nlMinus: 'img/nolines_minus.gif'
root: 'img/base.gif',
folder: 'img/folder.gif',
folderOpen: 'img/folderopen.gif',
node: 'img/page.gif',
empty: 'img/empty.gif',
line: 'img/line.gif',
join: 'img/join.gif',
joinBottom: 'img/joinbottom.gif',
plus: 'img/plus.gif',
plusBottom: 'img/plusbottom.gif',
minus: 'img/minus.gif',
minusBottom: 'img/minusbottom.gif',
nlPlus: 'img/nolines_plus.gif',
nlMinus: 'img/nolines_minus.gif'
};
this.images = {};
this.objects = {};
@ -74,7 +73,7 @@ function dTree(objName) {
this.selectedNode = null;
this.selectedFound = false;
this.completed = false;
return this;
};
@ -115,7 +114,7 @@ dTree.prototype = {
this.objects['namespan'] = new Element ("span", {"class": "nodeName"});
this.objects['image'] = new Element ("img");
},
// Open/close all nodes
openAll: function() {
@ -131,7 +130,7 @@ dTree.prototype = {
div.id = this.obj;
div.addClassName ("dtree");
if (this.config.useCookies)
this.selectedNode = this.getSelected();
this.selectedNode = this.getSelected();
this.addNode (this.root, div);
if (!this.selectedFound) this.selectedNode = null;
this.completed = true;
@ -166,26 +165,26 @@ dTree.prototype = {
this.aNodes[nodeId] = node;
if (this.root.id != node.pid) {
var div = this.objects['nodediv'].cloneNode (true);
if (node.datatype)
div.writeAttribute ("datatype", dTreeQuote(node.datatype));
if (node.datatype)
div.writeAttribute ("datatype", dTreeQuote(node.datatype));
if (node.dataname)
div.writeAttribute ("dataname", dTreeQuote(node.dataname));
div.writeAttribute ("dataname", dTreeQuote(node.dataname));
this.indent (node, nodeId, div);
var link = this.objects['nodelink'].cloneNode (true);
link.id = 's' + this.obj + nodeId;
link.href = dTreeQuote(node.url);
if (node.title)
link.writeAttribute ("title", dTreeQuote(node.title));
link.writeAttribute ("title", dTreeQuote(node.title));
if (node.target)
link.writeAttribute ("target", dTreeQuote(node.target));
link.writeAttribute ("target", dTreeQuote(node.target));
link.observe ("click", this.s.bindAsEventListener(this, parseInt(nodeId)));
if (!node.icon)
node.icon = (this.root.id == node.pid) ?
if (!node.icon)
node.icon = (this.root.id == node.pid) ?
this.icon.root : ((node._hc) ? this.icon.folder : this.icon.node);
if (!node.iconOpen)
node.iconOpen = (node._hc) ?
if (!node.iconOpen)
node.iconOpen = (node._hc) ?
this.icon.folderOpen : this.icon.node;
if (this.root.id == node.pid) {
@ -199,28 +198,28 @@ dTree.prototype = {
var span = this.objects['namespan'].cloneNode (true);
if (!node.isParent)
span.addClassName ("leaf");
span.addClassName ("leaf");
if (node.hasUnseen)
span.addClassName ("unseen");
span.addClassName ("unseen");
span.update (node.name);
link.appendChild (img);
link.appendChild (span);
div.appendChild (link);
if (container)
container.appendChild (div);
container.appendChild (div);
else
rc = div;
rc = div;
}
if (node._hc) {
var div = this.objects['clipdiv'].cloneNode (true);
div.id = 'd' + this.obj + nodeId;
div.setStyle ({"display":
((this.root.id == node.pid || node._io) ?
'block' : 'none')});
div.setStyle ({"display":
((this.root.id == node.pid || node._io) ?
'block' : 'none')});
this.addNode(node, div);
if (container)
container.appendChild (div);
container.appendChild (div);
}
this.aIndent.pop();
return rc;
@ -230,8 +229,8 @@ dTree.prototype = {
indent: function(node, nodeId, container) {
if (this.root.id != node.pid) {
for (var n=0; n<this.aIndent.length; n++) {
var img = (this.aIndent[n] == 1) ?
this.images['line'] : this.images['empty'];
var img = (this.aIndent[n] == 1) ?
this.images['line'] : this.images['empty'];
container.appendChild (img.cloneNode (true));
}
(node._ls) ? this.aIndent.push(0) : this.aIndent.push(1);
@ -241,9 +240,9 @@ dTree.prototype = {
link.observe ("click", this.o.bindAsEventListener(this, parseInt(nodeId)));
var img;
if (node._io)
img = ((node._ls) ? this.images['minusbottom'] : this.images['minus']);
img = ((node._ls) ? this.images['minusbottom'] : this.images['minus']);
else
img = ((node._ls) ? this.images['plusbottom'] : this.images['plus']);
img = ((node._ls) ? this.images['plusbottom'] : this.images['plus']);
img = img.cloneNode (true);
img.id = 'j' + this.obj + nodeId;
link.appendChild (img);
@ -275,7 +274,7 @@ dTree.prototype = {
// Highlights the selected node
s: function(id, withEvent) {
if (withEvent)
id = withEvent;
id = withEvent;
var cn = this.aNodes[id];
if (this.selectedNode != id) {
if (this.selectedNode || this.selectedNode==0) {
@ -292,12 +291,12 @@ dTree.prototype = {
// Toggle Open or close
o: function(id, withEvent) {
if (withEvent)
id = withEvent;
id = withEvent;
var cn = this.aNodes[id];
this.nodeStatus(!cn._io, id, cn._ls);
cn._io = !cn._io;
if (this.config.useCookies) this.updateCookie();
return false;
},
@ -349,18 +348,18 @@ dTree.prototype = {
if (this.aNodes[n].pid == node.id && this.aNodes[n]._hc) {
if (this.aNodes[n]._io) this.nodeStatus(false, n, this.aNodes[n]._ls);
this.aNodes[n]._io = false;
this.closeAllChildren(this.aNodes[n]);
this.closeAllChildren(this.aNodes[n]);
}
}
},
// Change the status of a node(open or closed)
nodeStatus: function(status, id, bottom) {
eDiv = document.getElementById('d' + this.obj + id);
if (eDiv) {
eJoin = $('j' + this.obj + id);
eIcon = document.getElementById('i' + this.obj + id);
eIcon.src = (status) ? this.aNodes[id].iconOpen : this.aNodes[id].icon;
eIcon = document.getElementById('i' + this.obj + id);
eIcon.src = (status) ? this.aNodes[id].iconOpen : this.aNodes[id].icon;
eJoin.src = ((status)?((bottom)?this.icon.minusBottom:this.icon.minus):((bottom)?this.icon.plusBottom:this.icon.plus));
eDiv.style.display = (status) ? 'block': 'none';
}
@ -373,7 +372,7 @@ dTree.prototype = {
this.setCookie('co'+this.obj, 'cookieValue', yesterday);
this.setCookie('cs'+this.obj, 'cookieValue', yesterday);
},
// [Cookie] Sets value in a cookie
setCookie: function(cookieName, cookieValue, expires, path, domain, secure) {
document.cookie =
@ -408,7 +407,7 @@ dTree.prototype = {
}
this.setCookie('co' + this.obj, str);
},
// [Cookie] Checks if a node id is in a cookie
isOpen: function(id) {
var aOpen = this.getCookie('co' + this.obj).split('.');
@ -420,18 +419,18 @@ dTree.prototype = {
// If Push and pop is not implemented by the browser
if (!Array.prototype.push) {
Array.prototype.push = function array_push() {
for(var i=0;i<arguments.length;i++)
this[this.length]=arguments[i];
return this.length;
}
Array.prototype.push = function array_push() {
for(var i=0;i<arguments.length;i++)
this[this.length]=arguments[i];
return this.length;
}
};
if (!Array.prototype.pop) {
Array.prototype.pop = function array_pop() {
lastElement = this[this.length-1];
this.length = Math.max(this.length-1,0);
return lastElement;
}
Array.prototype.pop = function array_pop() {
lastElement = this[this.length-1];
this.length = Math.max(this.length-1,0);
return lastElement;
}
};

View file

@ -591,12 +591,11 @@ DIV.dialog.none H3
DIV#bgDialogDiv
{ position: absolute;
margin: auto;
top: 0; left: 0;
width: 100%; height: 100%;
z-index: 9999;
top: 0px; left: 0px;
bottom: 0px;
right: 0px;
opacity: .3;
background-color: #000!important; }
background-color: #555 !important; }
DIV#uploadDialog,
DIV#uploadResults
@ -956,4 +955,4 @@ DIV.bottomToolbar A.bottomButton SPAN:active
/* modalbox */
DIV#modalbox SPAN
{ float: right; }
{ float: right; }

View file

@ -566,9 +566,10 @@ function popupMenu(event, menuId, target) {
menuLeft -= (popup.offsetWidth + 1);
var isVisible = true;
if (popup.prepareVisibility)
if (popup.prepareVisibility) {
if (!popup.prepareVisibility())
isVisible = false;
}
Event.stop(event);
if (isVisible) {
@ -1010,8 +1011,9 @@ function popupToolbarMenu(node, menuId) {
hideMenu(document.currentPopupMenu);
var popup = $(menuId);
if (popup.prepareVisibility)
if (popup.prepareVisibility) {
popup.prepareVisibility();
}
var offset = $(node).cumulativeOffset();
var top = offset.top + node.offsetHeight;

View file

@ -7,6 +7,9 @@ FORM
margin: 0px; }
/* generic */
DIV#bgDialogDiv
{ filter: alpha(opacity=30); }
SPAN.disabledToolbarButton
{ filter: alpha(opacity=40); }