From 9b6372806319c3dffadec4bb263b22c646633e73 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 5 Aug 2010 17:42:24 +0000 Subject: [PATCH 1/5] reindentation Monotone-Parent: 96aed5aa92f481740bda8d0b5c68aa4b21c762f0 Monotone-Revision: 08ba91165e5b501f48a2277fb30cb5f4624c9e39 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-05T17:42:24 Monotone-Branch: ca.inverse.sogo --- UI/WebServerResources/MailerUIdTree.js | 120 ++++++++++++------------- 1 file changed, 59 insertions(+), 61 deletions(-) diff --git a/UI/WebServerResources/MailerUIdTree.js b/UI/WebServerResources/MailerUIdTree.js index 591107cc3..77e50f3bb 100644 --- a/UI/WebServerResources/MailerUIdTree.js +++ b/UI/WebServerResources/MailerUIdTree.js @@ -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 += " (" + parseInt(unseen) + ")"; - } - 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 += " (" + parseInt(unseen) + ")"; + } + 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); From c1a74a3ae70ce8ce2c708b7adfe5d8371e7ce674 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 5 Aug 2010 17:43:43 +0000 Subject: [PATCH 2/5] reindentation Monotone-Parent: 08ba91165e5b501f48a2277fb30cb5f4624c9e39 Monotone-Revision: 8bd35931f4458c8afad7fa3cb3f169897d94d25b Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-05T17:43:43 Monotone-Branch: ca.inverse.sogo --- UI/WebServerResources/dtree.js | 175 ++++++++++++++++----------------- 1 file changed, 87 insertions(+), 88 deletions(-) diff --git a/UI/WebServerResources/dtree.js b/UI/WebServerResources/dtree.js index b0527647c..804d192be 100644 --- a/UI/WebServerResources/dtree.js +++ b/UI/WebServerResources/dtree.js @@ -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, "&") @@ -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 Date: Fri, 6 Aug 2010 12:37:28 +0000 Subject: [PATCH 3/5] Monotone-Parent: e7d394203e99a74856b665487e4681aa70114480 Monotone-Revision: 398264edd129900ccebb2b98453a9554c39010b4 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-06T12:37:28 Monotone-Branch: ca.inverse.sogo --- UI/WebServerResources/generic.css | 11 +++++------ UI/WebServerResources/generic.js | 6 ++++-- UI/WebServerResources/iefixes.css | 3 +++ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/UI/WebServerResources/generic.css b/UI/WebServerResources/generic.css index 54b86f9cd..f476a0cdf 100644 --- a/UI/WebServerResources/generic.css +++ b/UI/WebServerResources/generic.css @@ -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; } \ No newline at end of file +{ float: right; } diff --git a/UI/WebServerResources/generic.js b/UI/WebServerResources/generic.js index e3c939bb9..ca67478a8 100644 --- a/UI/WebServerResources/generic.js +++ b/UI/WebServerResources/generic.js @@ -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; diff --git a/UI/WebServerResources/iefixes.css b/UI/WebServerResources/iefixes.css index af643466f..6b2144d9e 100644 --- a/UI/WebServerResources/iefixes.css +++ b/UI/WebServerResources/iefixes.css @@ -7,6 +7,9 @@ FORM margin: 0px; } /* generic */ +DIV#bgDialogDiv +{ filter: alpha(opacity=30); } + SPAN.disabledToolbarButton { filter: alpha(opacity=40); } From eabd9d5a8e08cd8fede0dd9c2a566448f36e0491 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 6 Aug 2010 12:40:57 +0000 Subject: [PATCH 4/5] Monotone-Parent: 398264edd129900ccebb2b98453a9554c39010b4 Monotone-Revision: e0a770df71cd2e2fd2884aae657ca3a8e0e6a722 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-06T12:40:57 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 7 +++++++ UI/WebServerResources/HTMLElement.js | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0818b5e56..c4f5d30ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-08-06 Wolfgang Sourdeau + + * 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-04 Francis Lachapelle * UI/WebServerResources/generic.js (createDialog): when the diff --git a/UI/WebServerResources/HTMLElement.js b/UI/WebServerResources/HTMLElement.js index 40ea11718..a8454588b 100644 --- a/UI/WebServerResources/HTMLElement.js +++ b/UI/WebServerResources/HTMLElement.js @@ -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')) From 87028555202c546a745da0f6234beb616eb1c21f Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 6 Aug 2010 12:45:02 +0000 Subject: [PATCH 5/5] Monotone-Parent: e0a770df71cd2e2fd2884aae657ca3a8e0e6a722 Monotone-Revision: 65a935a868913d9a39d46a15dec1fdb508cbf72f Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-06T12:45:02 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 10 ++++++++++ SoObjects/SOGo/SOGoDomainDefaults.h | 2 ++ SoObjects/SOGo/SOGoDomainDefaults.m | 5 +++++ SoObjects/SOGo/SOGoUserDefaults.h | 3 +++ SoObjects/SOGo/SOGoUserDefaults.m | 10 ++++++++++ 5 files changed, 30 insertions(+) diff --git a/ChangeLog b/ChangeLog index c4f5d30ef..da0e31974 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2010-08-06 Wolfgang Sourdeau + * 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 diff --git a/SoObjects/SOGo/SOGoDomainDefaults.h b/SoObjects/SOGo/SOGoDomainDefaults.h index 76ed304fb..66c04eabe 100644 --- a/SoObjects/SOGo/SOGoDomainDefaults.h +++ b/SoObjects/SOGo/SOGoDomainDefaults.h @@ -37,6 +37,8 @@ - (NSArray *) userSources; +- (BOOL) mailAuxiliaryUserAccountsEnabled; + - (NSString *) mailDomain; - (NSString *) imapServer; - (NSString *) imapAclStyle; diff --git a/SoObjects/SOGo/SOGoDomainDefaults.m b/SoObjects/SOGo/SOGoDomainDefaults.m index 2d5f17f6c..02445a855 100644 --- a/SoObjects/SOGo/SOGoDomainDefaults.m +++ b/SoObjects/SOGo/SOGoDomainDefaults.m @@ -98,6 +98,11 @@ return [self stringForKey: @"OCSFolderInfoURL"]; } +- (BOOL) mailAuxiliaryUserAccountsEnabled +{ + return [self boolForKey: @"SOGoMailAuxiliaryUserAccountsEnabled"]; +} + - (NSString *) mailDomain { return [self stringForKey: @"SOGoMailDomain"]; diff --git a/SoObjects/SOGo/SOGoUserDefaults.h b/SoObjects/SOGo/SOGoUserDefaults.h index a23901adf..f4940fa35 100644 --- a/SoObjects/SOGo/SOGoUserDefaults.h +++ b/SoObjects/SOGo/SOGoUserDefaults.h @@ -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; diff --git a/SoObjects/SOGo/SOGoUserDefaults.m b/SoObjects/SOGo/SOGoUserDefaults.m index bfaa27d63..bdd10a13e 100644 --- a/SoObjects/SOGo/SOGoUserDefaults.m +++ b/SoObjects/SOGo/SOGoUserDefaults.m @@ -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"];