See ChangeLog.

Monotone-Parent: 1ea08f6ec84d602c5e78b6c440e2f7d6297a82cd
Monotone-Revision: 61b12be970a9603306d37277ee431b6fd5ab89cd

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2011-12-02T07:22:47
maint-2.0.2
Francis Lachapelle 2011-12-02 07:22:47 +00:00
parent c2229901b9
commit 03625e4aae
30 changed files with 904 additions and 240 deletions

View File

@ -1,3 +1,36 @@
2011-12-05 Francis Lachapelle <flachapelle@inverse.ca>
* UI/WebServerResources/MailerUI.js (deleteSelectedMessages)
(onMailboxTreeItemClick, onMessageSelecitionChange)
(configureMessageListEvents): update the message content div only
if it exists (will be hidden in single-window mode).
* UI/WebServerResources/UIxContactsUserFolders.js
(initUserFoldersWindow): registered "click" event on new Done button.
* UI/WebServerResources/UIxMailEditor.js (onContactAdd): show
contacts in a pane instead of a new window.
(onContactFolderChange): new method to update the contacts list
when changing contacts folder from the new popup menu.
(configureDragHandle): new method to allow the new contacts pane
to be resizable.
(onMailEditorResize): was onWindowResize. Now computes the space
used by the search contacts pane.
* UI/WebServerResources/ContactsUI.js (getMenus): the function now
overloads the returning array with the menus defined by the
previously defined function with the same name. Used in
UIxMailEditor.wox that loads both MailerUI.js and ContactsUI.js.
(contactsListCallback): added support for 2-column view. Also
used in mail editor to refresh the new contacts pane.
(initContacts, onContactSelectionChange): don't update contactView when the div
doesn't exist.
(configureDraggables): don't allow drag'n'drop when the folders
list doesn't exist.
* UI/MainUI/UIxLoading.m: new class for empty template used when
loading the iframe in single-window mode.
2011-12-05 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/Scheduler/UIxComponentEditor.m (-setCategory): ensure that
@ -70,6 +103,18 @@
resulting string to @"" when the unicode or string pointers are
NULL.
2011-11-28 Francis Lachapelle <flachapelle@inverse.ca>
* UI/SOGoUI/UIxComponent.m (-singleWindowModeEnabled): new method
that returns true if the single-window mode is enabled. This mode
can be forced by setting the cookie "SOGoWindowMode" to "single".
* UI/MailerUI/UIxMailEditor.m (-contactFolders)
(-personalContactInfos, -setCurrentFolder:, -currentContactFolderId)
(-currentContactFolderName, -currentContactFolderOwner)
(-currentContactFolderClass): getters/setters for new contacts
pane in the mail editor.
2011-11-28 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* OpenChange/MAPIStoreContext.m

16
NEWS
View File

@ -1,3 +1,19 @@
1.3-201112DD (1.3.11)
---------------------
New Features
- new experimental feature to force popup windows to appear in an iframe -- this mode
can be forced by setting the cookie "SOGoWindowMode" to "single"
Enhancements
- contacts from the email editor now appear in a pane, like in Thunderbird
- added DanishDenmark translation - thanks to Altibox
- updated German translation
- updated SpanishArgentina translation
- updated SpanishSpain translation
Bug Fixes
-
1.3-20111130 (1.3.10)
---------------------
New Features

View File

@ -39,6 +39,7 @@
@class NSDictionary;
@class NSString;
@class WOContext;
@class SOGoContactFolders;
@interface SOGoUserFolder : SOGoFolder
@ -58,6 +59,9 @@
- (BOOL) collectionDavKey: (NSString *) key
matches: (NSString *) value;
- (SOGoContactFolders *) privateContacts: (NSString *) _key
inContext: (WOContext *) _ctx;
@end
#endif /* __SOGo_SOGoUserFolder_H__ */

View File

@ -10,7 +10,7 @@
),
(
{ link = "#";
onclick = "return onContactAdd(null);";
onclick = "return onContactAdd(this);";
image = "tb-compose-contacts-flat-24x24.png";
cssClass = "tbicon_addressbook";
label = "Contacts";
@ -35,5 +35,12 @@
image = "options.png";
cssClass = "tbicon_options";
label = "Options"; }
),
(
{ link = "#";
isSafe = NO;
onclick = "return onCloseButtonClick(event);";
label = "Close";
image = "tb-mail-stop-flat-24x24.png"; }
)
)

View File

@ -0,0 +1,67 @@
( /* the toolbar groups -*-cperl-*- */
( // first group
{ link = "#";
image = "tb-mail-getmail-flat-24x24.png";
cssClass = "tbicon_getmail";
label = "Get Mail";
onclick = "return refreshMailbox(this);";
tooltip = "Get new messages"; },
{ link = "#";
isSafe = NO;
image = "tb-mail-write-flat-24x24.png";
onclick = "return onComposeMessage();";
cssClass = "tbicon_compose";
label = "Write";
tooltip = "Create a new message"; },
),
( // second group
{ link = "#";
onclick = "return openMessageWindowsForSelection('reply');";
isSafe = NO;
image = "tb-mail-reply-flat-24x24.png";
cssClass = "tbicon_reply";
label = "Reply";
tooltip = "Reply to the message"; },
{ link = "#";
onclick = "return openMessageWindowsForSelection('replyall');";
isSafe = NO;
image = "tb-mail-replyall-flat-24x24.png";
cssClass = "tbicon_replyall";
label = "Reply All";
tooltip = "Reply to sender and all recipients"; },
{ link = "#";
onclick = "return openMessageWindowsForSelection('forward');";
isSafe = NO;
image = "tb-mail-forward-flat-24x24.png";
cssClass = "tbicon_forward";
label = "Forward";
tooltip = "Forward selected message"; },
),
( // third group
{ link = "#";
isSafe = NO;
onclick = "onMenuDeleteMessage(event);";
// enabled = showMarkDeletedButton;
image = "tb-mail-delete-flat-24x24.png";
cssClass = "tbicon_delete";
label = "Delete";
tooltip = "Delete selected message or folder"; },
// { link = "#";
// isSafe = NO;
// image = "tb-mail-junk-flat-24x24.png";
// cssClass = "tbicon_junk";
// label = "Junk";
// tooltip = "Mark the selected messages as junk"; },
),
(
{ link = "#";
onclick = "return onPrintCurrentMessage(event);";
cssClass = "tbicon_print";
image = "tb-mail-print-flat-24x24.png";
label = "Print";
tooltip = "Print this message"; },
)
)

View File

@ -1,29 +1,6 @@
( /* the toolbar groups -*-cperl-*- */
( /* first group */
{ link = "#";
image = "tb-mail-getmail-flat-24x24.png";
cssClass = "tbicon_getmail";
label = "Get Mail";
onclick = "return refreshMailbox(this);";
tooltip = "Get new messages"; },
{ link = "#";
isSafe = NO;
image = "tb-mail-write-flat-24x24.png";
onclick = "return onComposeMessage();";
cssClass = "tbicon_compose";
label = "Write";
tooltip = "Create a new message"; },
{ link = "#";
target = "addressbook";
onclick = "openAddressbook(this);return false;";
image = "tb-mail-addressbook-flat-24x24.png";
cssClass = "tbicon_addressbook";
label = "Addressbook";
tooltip = "Go to address book"; },
),
( // second group
( // first group
{ link = "#";
onclick = "return openMessageWindowsForSelection('reply');";
isSafe = NO;
@ -47,7 +24,7 @@
tooltip = "Forward selected message"; },
),
( // third group
( // second group
{ link = "#";
isSafe = NO;
onclick = "onMenuDeleteMessage(event);";
@ -71,4 +48,11 @@
label = "Print";
tooltip = "Print this message"; },
),
(
{ link = "#";
isSafe = NO;
onclick = "return onCloseButtonClick(event);";
label = "Close";
image = "tb-mail-stop-flat-24x24.png"; }
)
)

View File

@ -1,6 +1,6 @@
/*
Copyright (C) 2004-2005 SKYRIX Software AG
Copyright (C) 2008-2010 Inverse inc.
Copyright (C) 2008-2011 Inverse inc.
This file is part of SOGo.
@ -47,15 +47,19 @@
#import <NGMime/NGMimeType.h>
#import <SOGo/SOGoUserDefaults.h>
#import <Mailer/SOGoDraftObject.h>
#import <Mailer/SOGoMailFolder.h>
#import <Mailer/SOGoMailAccount.h>
#import <Mailer/SOGoMailAccounts.h>
#import <SOGo/SOGoUser.h>
#import <SOGo/SOGoUserFolder.h>
#import <SOGo/NSArray+Utilities.h>
#import <SOGo/NSDictionary+Utilities.h>
#import <SOGo/WOResourceManager+SOGo.h>
#import <SOGoUI/UIxComponent.h>
#import <Mailer/SOGoDraftObject.h>
#import <Mailer/SOGoMailFolder.h>
#import <Mailer/SOGoMailAccount.h>
#import <Mailer/SOGoMailAccounts.h>
#import <Contacts/SOGoContactFolders.h>
#import <Contacts/SOGoContactFolder.h>
#import <Contacts/SOGoContactSourceFolder.h>
/*
UIxMailEditor
@ -80,6 +84,7 @@
NSString *priority;
NSString *receipt;
id item;
id currentFolder;
/* these are for the inline attachment list */
NSString *attachmentName;
@ -108,6 +113,7 @@ static NSArray *infoKeys = nil;
{
priority = @"NORMAL";
receipt = nil;
currentFolder = nil;
}
return self;
@ -131,6 +137,7 @@ static NSArray *infoKeys = nil;
[attachmentName release];
[attachmentNames release];
[attachedFiles release];
[currentFolder release];
[super dealloc];
}
@ -386,6 +393,61 @@ static NSArray *infoKeys = nil;
return [self valuesForKeys:infoKeys];
}
/* contacts search */
- (NSArray *) contactFolders
{
SOGoContactFolders *folderContainer;
folderContainer = (SOGoContactFolders *) [[[self clientObject] lookupUserFolder] privateContacts: @"Contacts"
inContext: nil];
return [folderContainer subFolders];
}
- (NSArray *) personalContactInfos
{
SOGoContactFolders *folderContainer;
id <SOGoContactFolder> folder;
NSArray *contactInfos;
folderContainer = (SOGoContactFolders *) [[[self clientObject] lookupUserFolder] privateContacts: @"Contacts"
inContext: nil];
folder = [folderContainer lookupPersonalFolder: @"personal" ignoringRights: YES];
contactInfos = [folder lookupContactsWithFilter: nil
onCriteria: nil
sortBy: @"c_cn"
ordering: NSOrderedAscending];
return contactInfos;
}
- (void) setCurrentFolder: (id) _currentFolder
{
ASSIGN (currentFolder, _currentFolder);
}
- (NSString *) currentContactFolderId
{
return [NSString stringWithFormat: @"/%@", [currentFolder nameInContainer]];
}
- (NSString *) currentContactFolderName
{
return [currentFolder displayName];
}
- (NSString *) currentContactFolderOwner
{
return [currentFolder ownerInContext: context];
}
- (NSString *) currentContactFolderClass
{
return ([currentFolder isKindOfClass: [SOGoContactSourceFolder class]]
? @"remote" : @"local");
}
/* requests */
- (BOOL) shouldTakeValuesFromRequest: (WORequest *) request

View File

@ -73,7 +73,7 @@
slots = {
toolbar = {
protectedBy = "View";
value = "SOGoMailObject.toolbar";
value = "SOGoMailFolder.toolbar";
};
};
methods = {
@ -184,7 +184,7 @@
slots = {
toolbar = {
protectedBy = "View";
value = "SOGoMailObject.toolbar";
value = "SOGoMailFolder.toolbar";
};
};
methods = {
@ -329,7 +329,7 @@
slots = {
toolbar = {
protectedBy = "View";
value = "SOGoMailObject.toolbar";
value = "SOGoMailFolder.toolbar";
};
};
methods = {
@ -369,7 +369,7 @@
slots = {
toolbar = {
protectedBy = "View";
value = "SOGoMailObject.toolbar";
value = "SOGoMailFolder.toolbar";
};
};
methods = {

View File

@ -0,0 +1,35 @@
/* UIxLoading.h - this file is part of SOGo
*
* Copyright (C) 2011 Inverse inc.
*
* Author: Francis Lachapelle <flachapelle@inverse.ca>
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef UIXLOADING_H
#define UIXLOADING_H
#import <SOGoUI/UIxComponent.h>
@interface UIxLoading : UIxComponent
{
}
@end
#endif /* UIXLOADING_H */

View File

@ -0,0 +1,37 @@
/* UIxLoading.m - this file is part of SOGo
*
* Copyright (C) 2011 Inverse inc.
*
* Author: Francis Lachapelle <flachapelle@inverse.ca>
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#import <Foundation/NSString.h>
#import "UIxLoading.h"
@implementation UIxLoading
- (NSString *) doctype
{
return (@"<?xml version=\"1.0\"?>\n"
@"<!DOCTYPE html"
@" PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\""
@" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">");
}
@end

View File

@ -144,6 +144,10 @@
pageName = "SOGoRootPage";
actionName = "changePassword";
};
loading = {
protectedBy = "<public>";
pageName = "UIxLoading";
};
GET = { // more or less a hack, see README of dbd
protectedBy = "<public>";
pageName = "SOGoRootPage";

View File

@ -6,7 +6,7 @@
{ link = "#";
isSafe = NO;
label = "Close";
onclick = "window.close(); return false;";
onclick = "return onCloseButtonClick();";
image = "tb-mail-stop-flat-24x24.png"; }
)
)

View File

@ -447,6 +447,24 @@ static NSMutableArray *abbrMonthLabelKeys = nil;
inContext: context]);
}
- (BOOL) singleWindowModeEnabled
{
//WEClientCapabilities *cc;
NSString *value;
BOOL result;
//cc = [[context request] clientCapabilities];
//NSLog(@"User agent = %@, Type = %@, OS = %@, CPU = %@, Browser major version = %i", [cc userAgent], [cc userAgentType], [cc os], [cc cpu], [cc majorVersion]);
value = [[context request] cookieValueForKey: @"SOGoWindowMode"];
result = ([value isEqualToString: @"single"]);
NSLog(@"Single window mode %@", result?@"enabled":@"disabled");
return result;
}
/* SoUser */
- (NSString *) shortUserNameForDisplay

View File

@ -17,5 +17,7 @@
<div id="buttons">
<a id="addButton" class="button actionButton disabled" href="#">
<span><var:string label:value="Add..." /></span></a>
<a id="doneButton" class="button" name="done">
<span><var:string label:value="Done"/></span></a>
</div>
</var:component>

View File

@ -11,7 +11,7 @@
title="panelTitle"
const:popup="YES"
const:userDefaultsKeys="SOGoMailComposeMessageType,SOGoMailReplyPlacement,SOGoMailSignature"
const:jsFiles="UIxMailToSelection.js,ckeditor/ckeditor.js,SOGoAutoCompletion.js">
const:jsFiles="UIxMailToSelection.js,ckeditor/ckeditor.js,SOGoAutoCompletion.js,ContactsUI.js">
<script type="text/javascript">
var mailIsReply = <var:string value="isMailReply"/>;
var sourceUID = <var:string value="sourceUID"/>;
@ -49,6 +49,58 @@
</ul>
</div>
<div id="contacts" style="display: none;">
<div id="leftPanel">
<div id="contactsSearch">
<label><var:string label:value="Address Book:" /></label>
<var:popup const:name="contactFolder" const:id="contactFolder"
list="contactFolders"
item="currentFolder"
string="currentContactFolderName"
value="currentContactFolderId"
/>
<label><var:string label:value="Search For:"/></label>
<var:component className="UIxContactsFilterPanel" qualifier="qualifier" />
<div id="contactsListContent">
<table id="contactsList" cellspacing="0">
<thead>
<tr class="tableview">
<!-- localize -->
<td class="tbtv_headercell sortableTableHeader" id="nameHeader"
><img id="messageSortImage" class="sortImage" rsrc:src="arrow-up.png"
/><var:string label:value="Name"
/></td
><td class="tbtv_headercell sortableTableHeader" id="mailHeader"
><var:string label:value="Email"/></td
></tr>
</thead>
<tbody id="contactsListTbody">
<var:foreach list="personalContactInfos" item="currentContact">
<tr var:class="currentContactClasses"
var:categories="currentContact.c_categories"
var:id="currentContact.c_name"
var:contactname="currentContact.c_cn">
<td class="displayName" var:title="currentContact.c_cn"><var:string value="currentContact.c_cn" const:escapeHTML="YES" /></td>
<td var:title="currentContact.c_mail"><var:string value="currentContact.c_mail"/></td>
</tr>
</var:foreach>
</tbody>
</table>
</div>
<div class="contactSelection">
<var:component className="UIxContactsMailerSelection" />
</div>
</div>
</div>
<div class="dragHandle" id="hiddenDragHandle"><!-- space --></div>
</div>
<div id="rightPanel">
<form const:href="" name="pageform" enctype="multipart/form-data" autocomplete="off">
<input type="hidden" name="priority" id="priority" var:value="priority"/>
<input type="hidden" name="receipt" id="receipt" var:value="receipt"/>
@ -88,4 +140,5 @@
<textarea id="text" name="text" rows="30" var:value="text"></textarea>
<!-- img rsrc:src="tbird_073_compose.png" alt="screenshot" / -->
</form>
</div>
</var:component>

View File

@ -3,16 +3,20 @@
<container xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:rsrc="OGo:url"
><var:string var:value="doctype" const:escapeHTML="NO" />
<html><head><!-- space --></head>
<html>
<head>
<script type="text/javascript" rsrc:src="prototype.js"><!-- space --></script>
<script type="text/javascript" rsrc:src="generic.js"><!-- space --></script>
</head>
<body style="background-color: #dbdad5;"
><script type="text/javascript"
><var:if condition="hasRefreshMethod">
if (window.opener) {
window.opener.setTimeout('<var:string value="refreshMethod" const:escapeHTML="NO" />;', 50);
}
var p = <var:if condition="singleWindowModeEnabled">parent</var:if><var:if condition="singleWindowModeEnabled" const:negate="YES">window.opener</var:if>;
if (p) p.setTimeout('<var:string value="refreshMethod" const:escapeHTML="NO" />;', 50);
</var:if>
window.close();
onCloseButtonClick();
</script>
</body>
</html>

View File

@ -201,11 +201,15 @@ TABLE#contactsList
-khtml-user-select: none;
width: 100%; }
TABLE#contactsList TBODY TD
{ cursor: pointer; }
TABLE#contactsList TD,
TABLE#contactsList TH
{ overflow: hidden;
line-height: 16px;
height: 18px;
text-overflow: ellipsis;
white-space: nowrap; } /* pre, normal, nowrap */
TABLE#contactsList TH

View File

@ -35,7 +35,7 @@ function openContactsFolder(contactsFolder, reload, idx) {
if ((contactsFolder && contactsFolder != Contact.currentAddressBook)
|| reload) {
Contact.currentAddressBook = contactsFolder;
var url = URLForFolderID(Contact.currentAddressBook) +
var url = URLForFolderID(Contact.currentAddressBook, "Contacts") +
"/view?noframe=1";
var searchValue = search["value"];
@ -63,6 +63,7 @@ function openContactsFolder(contactsFolder, reload, idx) {
document.contactsListAjaxRequest.aborted = true;
document.contactsListAjaxRequest.abort();
}
document.contactsListAjaxRequest
= triggerAjaxRequest(url, contactsListCallback, selection);
}
@ -77,6 +78,7 @@ function contactsListCallback(http) {
var table = $("contactsList");
var tbody = table.tBodies[0];
var rows = tbody.getElementsByTagName("TR");
var fullView = (table.tHead.rows[0].cells.length > 2);
var data = [];
if (http.responseText.length > 0)
data = http.responseText.evalJSON(true);
@ -96,9 +98,11 @@ function contactsListCallback(http) {
var cells = row.getElementsByTagName("TD");
$(cells[0]).update(contact["c_cn"]);
$(cells[1]).update(contact["c_mail"]);
$(cells[2]).update(contact["c_screenname"]);
$(cells[3]).update(contact["c_o"]);
$(cells[4]).update(contact["c_telephonenumber"]);
if (fullView) {
$(cells[2]).update(contact["c_screenname"]);
$(cells[3]).update(contact["c_o"]);
$(cells[4]).update(contact["c_telephonenumber"]);
}
}
// Add extra rows
@ -119,26 +123,31 @@ function contactsListCallback(http) {
null,
row);
cell.appendChild(document.createTextNode(contact["c_cn"]));
cell.title = contact["c_cn"];
cell = document.createElement("td");
row.appendChild(cell);
if (contact["c_mail"])
if (contact["c_mail"]) {
cell.appendChild(document.createTextNode(contact["c_mail"]));
cell.title = contact["c_mail"];
}
cell = document.createElement("td");
row.appendChild(cell);
if (contact["c_screenname"])
cell.appendChild(document.createTextNode(contact["c_screenname"]));
if (fullView) {
cell = document.createElement("td");
row.appendChild(cell);
if (contact["c_screenname"])
cell.appendChild(document.createTextNode(contact["c_screenname"]));
cell = document.createElement("td");
row.appendChild(cell);
if (contact["c_o"])
cell.appendChild(document.createTextNode(contact["c_o"]));
cell = document.createElement("td");
row.appendChild(cell);
if (contact["c_o"])
cell.appendChild(document.createTextNode(contact["c_o"]));
cell = document.createElement("td");
row.appendChild(cell);
if (contact["c_telephonenumber"])
cell.appendChild(document.createTextNode(contact["c_telephonenumber"]));
cell = document.createElement("td");
row.appendChild(cell);
if (contact["c_telephonenumber"])
cell.appendChild(document.createTextNode(contact["c_telephonenumber"]));
}
}
configureDraggables();
@ -180,9 +189,9 @@ function contactsListCallback(http) {
}
// Restore selection and scroll to first selected node
tbody.refreshSelectionByIds();
var selection = http.callbackData;
if (selection) {
tbody.refreshSelectionByIds(selection);
for (var i = 0; i < selection.length; i++) {
var row = $(selection[i]);
if (row) {
@ -406,21 +415,23 @@ function onContactRowDblClick(event) {
}
function onContactSelectionChange(event) {
var contactView = $("contactView");
if (event) {
// Update rows selection
var t = getTarget(event);
onRowClick(event, t);
}
var rows = this.parentNode.getSelectedRowsId();
if (contactView) {
var rows = this.parentNode.getSelectedRowsId();
if (rows.length == 1) {
var node = $(rows[0]);
loadContact(node.getAttribute('id'));
}
else if (rows.length > 1) {
$('contactView').update();
Contact.currentContact = null;
if (rows.length == 1) {
var node = $(rows[0]);
loadContact(node.getAttribute('id'));
}
else if (rows.length > 1) {
$('contactView').update();
Contact.currentContact = null;
}
}
}
@ -626,10 +637,11 @@ function refreshCurrentFolder() {
openContactsFolder(Contact.currentAddressBook, true);
}
/* Only used in UIxMailEditor */
function onConfirmContactSelection(event) {
var tag = this.getAttribute("name");
var folderLi = $(Contact.currentAddressBook);
var currentAddressBookName = folderLi.innerHTML;
var folder = $("contactFolder");
var currentAddressBookName = folder.textContent;
var selectorList = null;
var initialValues = null;
@ -644,9 +656,8 @@ function onConfirmContactSelection(event) {
else {
var cname = '' + rows[i].readAttribute("contactname");
var email = '' + rows[i].cells[1].innerHTML;
window.opener.addContact(tag, currentAddressBookName + '/' + cname,
cid, cname, email);
addContact(tag, currentAddressBookName + '/' + cname,
cid, cname, email);
}
}
@ -657,7 +668,7 @@ function onConfirmContactSelection(event) {
}
function addListToOpener (tag, aBookId, aBookName, listId) {
var url = ApplicationBaseURL + "/" + aBookId + "/" + listId + "/properties";
var url = UserFolderURL + "Contacts/" + aBookId + "/" + listId + "/properties";
triggerAjaxRequest (url, addListToOpenerCallback, {
"aBookId": aBookId,
"aBookName": aBookName,
@ -669,8 +680,8 @@ function addListToOpenerCallback (http) {
var received = http.responseText.evalJSON (true);
for (var i = 0; i < received.length; i++) {
var contact = received[i];
window.opener.addContact(data.tag, data.aBookName + '/' + contact[1],
contact[0], contact[1], contact[2]);
addContact(data.tag, data.aBookName + '/' + contact[1],
contact[0], contact[1], contact[2]);
}
}
@ -1161,7 +1172,11 @@ function onContactMenuPrepareVisibility() {
return true;
}
function getMenus() {
var originalGetMenus = null;
if (typeof getMenus == 'function') {
originalGetMenus = getMenus;
}
getMenus = function() {
var menus = {};
menus["contactFoldersMenu"] = new Array(onAddressBookModify, "-", newContact,
newList, "-",
@ -1184,6 +1199,12 @@ function getMenus() {
if (contactMenu)
contactMenu.prepareVisibility = onContactMenuPrepareVisibility;
if (originalGetMenus) {
var originalMenus = originalGetMenus();
if (originalMenus)
menus = Object.extend(menus, originalMenus);
}
return menus;
}
@ -1197,15 +1218,6 @@ function configureSelectionButtons() {
}
}
function onWindowResize(event) {
var handle = $("dragHandle");
if (handle)
handle.adjust();
handle = $("rightDragHandle");
if (handle)
handle.adjust();
}
function onDocumentKeydown(event) {
var target = Event.element(event);
if (target.tagName != "INPUT") {
@ -1297,23 +1309,36 @@ function initContacts(event) {
table.multiselect = true;
var tbody = $(table.tBodies[0]);
tbody.on("click", onContactSelectionChange);
tbody.on("dblclick", onContactRowDblClick);
tbody.on("selectstart", listRowMouseDownHandler);
tbody.on("contextmenu", onContactContextMenu);
if ($("contactView")) {
tbody.on("dblclick", onContactRowDblClick);
tbody.on("selectstart", listRowMouseDownHandler);
tbody.on("contextmenu", onContactContextMenu);
resetCategoriesMenu();
TableKit.Resizable.init(table, {'trueResize' : true, 'keepWidth' : true});
}
configureSortableTableHeaders(table);
TableKit.Resizable.init(table, {'trueResize' : true, 'keepWidth' : true});
resetCategoriesMenu();
}
onWindowResize.defer();
Event.observe(window, "resize", onWindowResize);
if (typeof onWindowResize != 'function') {
// When loaded from the mail editor, onWindowResize is
// already registered
onWindowResize.defer();
Event.observe(window, "resize", onWindowResize);
}
// Default sort options
sorting["attribute"] = "c_cn";
sorting["ascending"] = true;
}
function onWindowResize(event) {
var handle = $("dragHandle");
if (handle)
handle.adjust();
handle = $("rightDragHandle");
if (handle)
handle.adjust();
}
function resetCategoriesMenu() {
var menu = $("categoriesMenu");
if (menu) {
@ -1431,23 +1456,25 @@ function unsetCategoryOnNode(contactNode, category) {
}
function configureDraggables() {
var mainElement = $("dragDropVisual");
Draggables.empty ();
if ($("contactFolders")) {
var mainElement = $("dragDropVisual");
Draggables.empty();
if (mainElement == null) {
mainElement = new Element ("div", {id: "dragDropVisual"});
document.body.appendChild(mainElement);
mainElement.absolutize ();
}
mainElement.hide();
if (mainElement == null) {
mainElement = new Element ("div", {id: "dragDropVisual"});
document.body.appendChild(mainElement);
mainElement.absolutize();
}
mainElement.hide();
new Draggable ("dragDropVisual",
{ handle: "contactsList",
onStart: startDragging,
onEnd: stopDragging,
onDrag: whileDragging,
scroll: window
new Draggable ("dragDropVisual",
{ handle: "contactsList",
onStart: startDragging,
onEnd: stopDragging,
onDrag: whileDragging,
scroll: window
});
}
}
function configureDroppables() {

View File

@ -261,8 +261,10 @@ Element.addMethods({
element.selectedIds = null;
},
refreshSelectionByIds: function(element) {
refreshSelectionByIds: function(element, selectedIds) {
element = $(element);
if (selectedIds)
element.selectedIds = selectedIds;
if (element.selectedIds) {
for (var i = 0; i < element.selectedIds.length; i++) {
//var e = element.down('#'+element.selectedIds[i]); // buggy with IE

View File

@ -900,4 +900,4 @@ A#iCalendarDeleteFromCalendar
A#iCalendarAddToCalendar
{ border-left: 2px solid #E6E7E6;
margin-left: 5px;}
margin-left: 5px;}

View File

@ -35,8 +35,12 @@ var messageCheckTimer;
/* We need to override this method since it is adapted to GCS-based folder
references, which we do not use here */
function URLForFolderID(folderID) {
var url = ApplicationBaseURL + encodeURI(folderID.substr(1));
function URLForFolderID(folderID, application) {
if (application)
application = UserFolderURL + application + "/";
else
application = ApplicationBaseURL;
var url = application + encodeURI(folderID.substr(1));
if (url[url.length-1] == '/')
url = url.substr(0, url.length-1);
@ -53,6 +57,7 @@ function openMessageWindow(msguid, url) {
markMailReadInWindow(window, msguid);
}
var msgWin = openMailComposeWindow(url, wId);
msgWin.focus();
Mailer.popups.push(msgWin);
@ -395,7 +400,7 @@ function onDocumentKeydown(event) {
var divDimensions = viewPort.getDimensions();
var centerOffset = divDimensions.height/2;
var rowScrollOffset = nextRow.cumulativeScrollOffset();
var divBottom = divDimensions.height + rowScrollOffset.top;
var divBottom = divDimensions.height + rowScrollOffset.top;
var rowBottom = nextRow.offsetTop + nextRow.getHeight();
if (divBottom < rowBottom)
@ -458,7 +463,7 @@ function deleteSelectedMessages(sender) {
deleteCachedMessage(path);
if (Mailer.currentMessages[Mailer.currentMailbox] == uid) {
messageContent.innerHTML = '';
if (messageContent) messageContent.innerHTML = '';
Mailer.currentMessages[Mailer.currentMailbox] = null;
}
@ -490,7 +495,7 @@ function deleteSelectedMessages(sender) {
}
}
}
else {
else if (messageContent) {
messageContent.innerHTML = '';
}
Mailer.dataTable.remove(uid);
@ -623,7 +628,8 @@ function onMailboxTreeItemClick(event) {
Mailer.currentMailboxType = this.parentNode.getAttribute("datatype");
if (Mailer.currentMailboxType == "account" || Mailer.currentMailboxType == "additional") {
Mailer.currentMailbox = mailbox;
$("messageContent").innerHTML = '';
var messageContent = $("messageContent");
if (messageContent) messageContent.innerHTML = '';
$("messageCountHeader").childNodes[0].innerHTML = '&nbsp;';
Mailer.dataTable._emptyTable();
updateWindowTitle();
@ -772,7 +778,7 @@ function openMailbox(mailbox, reload) {
if (!reload) {
var messageContent = $("messageContent");
messageContent.innerHTML = '';
if (messageContent) messageContent.innerHTML = '';
$("messageCountHeader").childNodes[0].innerHTML = '&nbsp;';
lastClickedRow = -1; // from generic.js
}
@ -1171,11 +1177,11 @@ function onMessageSelectionChange(event) {
}
else if (t.className == 'messageUnreadColumn') {
mailListToggleMessagesRead(t.parentNode);
return true;
return false;
}
else if (t.className == 'messageFlagColumn') {
mailListToggleMessagesFlagged(t.parentNode);
return true;
return false;
}
}
}
@ -1185,15 +1191,16 @@ function onMessageSelectionChange(event) {
// Update rows selection
onRowClick(event, t);
var messageContent = $("messageContent");
var rows = this.getSelectedRowsId();
if (rows.length == 1) {
var idx = rows[0].substr(4);
if (Mailer.currentMessages[Mailer.currentMailbox] != idx) {
Mailer.currentMessages[Mailer.currentMailbox] = idx;
loadMessage(idx);
if (messageContent) loadMessage(idx);
}
}
else if (rows.length > 1)
else if (rows.length > 1 && messageContent)
$('messageContent').innerHTML = '';
return true;
@ -1206,6 +1213,10 @@ function loadMessage(msguid) {
}
var div = $('messageContent');
if (div == null)
// Single-window mode
return false;
var cachedMessage = getCachedMessage(msguid);
var row = $("row_" + msguid);
var seenStateHasChanged = row && row.hasClassName('mailer_unreadmail');
@ -1852,6 +1863,7 @@ function refreshMessage(mailbox, messageUID) {
function configureMessageListEvents() {
var headerTable = $("messageListHeader");
var dataTable = $("messageListBody");
var messageContent = $("messageContent");
if (headerTable)
// Sortable columns
@ -1859,8 +1871,16 @@ function configureMessageListEvents() {
if (dataTable) {
dataTable.multiselect = true;
dataTable.observe("click", onMessageSelectionChange);
dataTable.observe("dblclick", onMessageDoubleClick);
if (messageContent) {
dataTable.observe("click", onMessageSelectionChange);
dataTable.observe("dblclick", onMessageDoubleClick);
}
else {
// Single-window mode
dataTable.observe("click", function(e) {
onMessageSelectionChange.bind(this)(e) &&
onMessageDoubleClick.bind(this)(e); });
}
dataTable.observe("selectstart", listRowMouseDownHandler);
dataTable.observe("contextmenu", onMessageContextMenu);
}
@ -1890,6 +1910,7 @@ function onMessageListResize(event) {
}
function onWindowResize(event) {
log ("resize mailer");
var handle = $("verticalDragHandle");
if (handle)
handle.adjust();

View File

@ -131,8 +131,7 @@ function onFnNewValue(event) {
function onEditorCancelClick(event) {
this.blur();
preventDefault(event);
window.close();
onCloseButtonClick(event);
}
function onEditorSubmitClick(event) {

View File

@ -259,8 +259,10 @@ function onFolderSearchKeyDown(event) {
function initUserFoldersWindow() {
var searchValue = $("searchValue");
searchValue.observe("keydown", onFolderSearchKeyDown);
var addButton = $("addButton");
addButton.observe("click", onConfirmFolderSelection);
$("addButton").observe("click", onConfirmFolderSelection);
$("doneButton").observe("click", onCloseButtonClick);
searchValue.focus();
}

View File

@ -67,6 +67,8 @@ DIV#windowButtons
vertical-align: middle;
text-align: right; }
INPUT.textField
{ width: 100%; }
DIV#buttons
{ position: fixed;

View File

@ -142,11 +142,6 @@ function resetTableActions() {
}
}
function onEditorCancelClick(event) {
preventDefault(event);
window.close();
}
function onEditorSubmitClick(event) {
if (validateListEditor())
$("mainForm").submit();
@ -168,7 +163,7 @@ function initListEditor() {
resetTableActions();
$("referenceAdd").observe("click", onReferenceAdd);
$("referenceDelete").observe("click", onReferenceDelete);
$("cancelButton").observe("click", onEditorCancelClick);
$("cancelButton").observe("click", onCloseButtonClick);
$("submitButton").observe("click", onEditorSubmitClick);
Event.observe(document, "keydown", onDocumentKeydown);

View File

@ -1,5 +1,30 @@
/* CSS for compose panel */
DIV#leftPanel
{ position: absolute;
top: 52px;
left: 0px;
width: 15em;
bottom: 0px;
overflow: hidden; }
DIV#rightPanel
{ position: absolute;
top: 48px;
left: 0em;
right: 0px;
bottom: 0px;
margin-left: 5px;
overflow: hidden; }
DIV#hiddenDragHandle
{ cursor: e-resize;
border: 0px;
top: 52px;
left: 15em;
width: 5px;
bottom: 0; }
div#compose_panel div table
{ padding: 2px; }
@ -82,8 +107,7 @@ div#compose_internetmarker
border-style: solid; }
div#headerArea
{ border-top: 1px solid #fff;
padding: 5px 0px; }
{ padding: 5px 0px; }
div#headerArea div.addressList
{ max-height: 10em;
@ -110,7 +134,7 @@ hr.fieldSeparator
width: 100%; }
input.currentAttachment
{ position: absolute;
{ position: fixed;
top: 1em;
right: 1em; }
@ -169,3 +193,70 @@ UL#attachments LI IMG
TEXTAREA#text
{ display: none;
background: #fff; }
/* Contacts search pane */
DIV#contactsSearch
{ border-right: 1px solid #fff;
padding-top: 5px;
padding-bottom: 5px;
margin-left: 5px; }
DIV#contactsSearch LABEL
{ display: block;
margin: 0 0 5px 0; }
SELECT#contactFolder
{ margin-bottom: 5px; }
INPUT#searchValue
{ position: absolute;
top: 6.2em;
left: 5px;
right: 0px; /* doesn't work in FF */
display: block;
width: auto; }
DIV#contactsListContent
{ position: absolute;
top: 9em;
left: 0px;
right: 0px;
bottom: 0px;
margin: 0;
border-right: 1px solid #fff;
background-color: #fff; }
TABLE#contactsList
{ width: 100%; }
TABLE#contactsList TD,
TABLE#contactsList TH
{ overflow: hidden;
line-height: 16px;
height: 18px;
text-overflow: ellipsis;
white-space: nowrap; }
TABLE#contactsList TD#nameHeader,
TABLE#contactsList TD#mailHeader
{ width: 50%;
max-width: 50%; }
DIV.contactSelection
{
z-index: 10;
background: inherit;
position: absolute;
bottom: 0em;
padding: 1em;
left: 0px;
right: 0px;
height: 90px;
text-align: right;
background: #E6E7E6;
border-top: 1px solid #fff;
border-left: 0px;
border-right: 0px;
border-bottom: 0px;
}

View File

@ -3,7 +3,6 @@
var contactSelectorAction = 'mailer-contacts';
var attachmentCount = 0;
var MailEditor = {
addressBook: null,
currentField: null,
selectedIndex: -1,
delay: 750,
@ -12,24 +11,21 @@ var MailEditor = {
textFirstFocus: true
};
function onContactAdd() {
var selector = null;
var selectorURL = '?popup=YES&selectorId=mailer-contacts';
if (MailEditor.addressBook && MailEditor.addressBook.open && !MailEditor.addressBook.closed)
MailEditor.addressBook.focus();
else {
var urlstr = ApplicationBaseURL
+ "../Contacts/"
+ contactSelectorAction + selectorURL;
MailEditor.addressBook = window.open(urlstr, "_blank",
"width=640,height=400,resizable=1,scrollbars=0");
MailEditor.addressBook.selector = selector;
MailEditor.addressBook.opener = self;
MailEditor.addressBook.focus();
function onContactAdd(button) {
var div = $("contacts");
if (div.visible()) {
$("contacts").hide();
$("rightPanel").setStyle({ left: "0" });
$(button).removeClassName("active");
}
return false;
else {
$("rightPanel").setStyle({ left: $("leftPanel").getStyle("width") });
$("contacts").show();
$(button).addClassName("active");
}
$("hiddenDragHandle").adjust();
onMailEditorResize(null);
}
function addContact(tag, fullContactName, contactId, contactName, contactEmail) {
@ -60,11 +56,16 @@ function addContact(tag, fullContactName, contactId, contactName, contactEmail)
var select = $(td.childNodesWithTag("select")[0]);
select.value = neededOptionValue;
insertContact($("addr_" + currentIndex), contactName, contactEmail);
onWindowResize(null);
onMailEditorResize(null);
}
}
}
function onContactFolderChange(event) {
initCriteria();
openContactsFolder(this.value);
}
function mailIsRecipient(mailto) {
var isRecipient = false;
@ -157,11 +158,15 @@ function onPostComplete(response) {
if (response && response.length > 0) {
var jsonResponse = response.evalJSON();
if (jsonResponse["status"] == "success") {
if (window.opener && window.opener.refreshMessage) {
window.opener.refreshMessage(jsonResponse["sourceFolder"],
jsonResponse["messageID"]);
}
window.close();
var p;
if (window.frameElement && window.frameElement.id)
p = parent;
if (window.opener && window.opener.refreshMessage)
p = window.opener;
if (p && p.refreshMessage)
p.refreshMessage(jsonResponse["sourceFolder"],
jsonResponse["messageID"]);
onCloseButtonClick();
}
else {
var message = jsonResponse["message"];
@ -174,7 +179,7 @@ function onPostComplete(response) {
}
}
else {
window.close();
onCloseButtonClick();
}
}
@ -207,7 +212,7 @@ function clickedEditorAttach() {
if (!area.style.display) {
area.setStyle({ display: "block" });
onWindowResize(null);
onMailEditorResize(null);
}
var inputs = area.getElementsByTagName("input");
var attachmentName = "attachment" + attachmentCount;
@ -355,6 +360,18 @@ function initAddresses() {
});
}
/* Overwrites function of MailerUI.js */
function configureDragHandle() {
var handle = $("hiddenDragHandle");
if (handle) {
handle.addInterface(SOGoDragHandlesInterface);
handle.leftMargin = 100;
handle.leftBlock=$("leftPanel");
handle.rightBlock=$("rightPanel");
handle.observe("handle:dragged", onMailEditorResize);
}
}
function initMailEditor() {
if (composeMode != "html" && $("text"))
$("text").style.display = "block";
@ -396,6 +413,8 @@ function initMailEditor() {
initializePriorityMenu();
configureDragHandle();
var composeMode = UserDefaults["SOGoMailComposeMessageType"];
if (composeMode == "html") {
CKEDITOR.replace('text',
@ -415,9 +434,13 @@ function initMailEditor() {
focusCKEditor();
}
Event.observe(window, "resize", onWindowResize);
$("contactFolder").observe("change", onContactFolderChange);
Event.observe(window, "resize", onMailEditorResize);
Event.observe(window, "beforeunload", onMailEditorClose);
onWindowResize.defer();
onMailEditorResize.defer();
}
function focusCKEditor(event) {
@ -459,7 +482,6 @@ function onMenuCheckReturnReceipt(event) {
else {
this.removeClassName("_chosen");
}
var receiptInput = $("receipt");
receiptInput.value = (enabled ? "true" : "false") ;
}
@ -562,12 +584,13 @@ function onSelectOptions(event) {
}
}
function onWindowResize(event) {
function onMailEditorResize(event) {
if (!document.pageform)
return;
var textarea = document.pageform.text;
var rowheight = (Element.getHeight(textarea) / textarea.rows);
var headerarea = $("headerArea");
var totalwidth = $("rightPanel").getWidth();
var attachmentsarea = $("attachmentsArea");
var attachmentswidth = 0;
@ -585,15 +608,15 @@ function onWindowResize(event) {
}
// Resize subject field
subjectinput.setStyle({ width: (window.width()
subjectinput.setStyle({ width: (totalwidth
- $(subjectfield).getWidth()
- attachmentswidth
- 12) + 'px' });
- 17) + 'px' });
// Resize from field
$("fromSelect").setStyle({ width: (window.width()
$("fromSelect").setStyle({ width: (totalwidth
- $("fromField").getWidth()
- attachmentswidth
- 10) + 'px' });
- 15) + 'px' });
// Resize address fields
var addresslist = $('addressList');
@ -608,7 +631,7 @@ function onWindowResize(event) {
if (composeMode == "html") {
var editor = $('cke_text');
if (editor == null) {
onWindowResize.defer();
onMailEditorResize.defer();
return;
}
var ck_top = $("cke_top_text");
@ -628,25 +651,26 @@ function onWindowResize(event) {
}
else
textarea.rows = Math.floor((window.height() - textarea.offsetTop) / rowheight);
// Resize search contacts addressbook selector
if ($("contacts").visible())
$("contactFolder").setStyle({ width: ($("contactsSearch").getWidth() - 10) + "px" });
}
function onMailEditorClose(event) {
if (window.shouldPreserve)
window.shouldPreserve = false;
else {
if (window.opener && window.opener.open && !window.opener.closed) {
var url = "" + window.location;
var parts = url.split("/");
parts[parts.length-1] = "delete";
url = parts.join("/");
var url = "" + window.location;
var parts = url.split("/");
parts[parts.length-1] = "delete";
url = parts.join("/");
if (window.frameElement && window.frameElement.id)
parent.deleteDraft(url);
else if (window.opener && window.opener.open && !window.opener.closed)
window.opener.deleteDraft(url);
}
}
if (MailEditor.addressBook && MailEditor.addressBook.open
&& !MailEditor.addressBook.closed)
MailEditor.addressBook.close();
Event.stopObserving(window, "beforeunload", onMailEditorClose);
}

View File

@ -565,6 +565,8 @@ DIV.dialog
DIV.dialog > DIV
{ border: 1px solid #444;
-webkit-box-shadow: 0 5px 10px rgba(0,0,0,.5);
box-shadow: 0 5px 10px rgba(0,0,0,.5);
background-color: #fff;
padding: 5px;
padding-bottom: 26px; }
@ -617,14 +619,23 @@ DIV.dialog.none P
DIV.dialog.none P.prompt
{ text-align: right; }
DIV#bgFrameDiv
{ position: absolute;
top: 0px; left: 0px;
bottom: 0px;
right: 0px;
z-index: 2;
background: -webkit-radial-gradient(ellipse cover,rgba(0, 0, 0, .1) 0,rgba(0, 0, 0, .1) 20%,rgba(0, 0, 0, .7) 80%);
background: -moz-linear-gradient(top, rgba(0, 0, 0, .5), rgba(0, 0, 0, .1)); }
DIV#bgDialogDiv
{ position: absolute;
top: 0px; left: 0px;
bottom: 0px;
right: 0px;
z-index: 2;
opacity: .3;
background-color: #555 !important; }
background: -webkit-radial-gradient(ellipse cover,rgba(0, 0, 0, .1) 0,rgba(0, 0, 0, .1) 20%,rgba(0, 0, 0, .7) 80%);
background: -moz-linear-gradient(top, rgba(0, 0, 0, .5), rgba(0, 0, 0, .1)); }
DIV#uploadDialog,
DIV#uploadResults
@ -886,6 +897,36 @@ IFRAME.hidden,
DIV.tab
{ display: none; }
DIV#popupFrame
{ position: absolute;
top: 40px;
bottom: 40px;
left: 15%;
right: 15%;
padding: 4px;
z-index: 2000;
background-color: #E6E7E6;
-webkit-border-radius: 4px 4px 0 0;
border-radius: 4px 4px 0 0;
-webkit-box-shadow: 0 5px 10px rgba(0,0,0,.5);
box-shadow: 0 5px 10px rgba(0,0,0,.5);
}
DIV#popupFrame.small
{ left: 30%;
right: 30%;
}
DIV#popupFrame > IFRAME
{ margin: 0;
padding: 0;
color: #000;
background-color: #E6E7E6;
border: 0;
-webkit-border-radius: 4px 4px 0 0;
border-radius: 4px 4px 0 0;
}
DIV.tabsContainer DIV.active
{ display: block; }

View File

@ -1,7 +1,7 @@
/* generic.js - this file is part of SOGo
Copyright (C) 2005 SKYRIX Software AG
Copyright (C) 2006-2010 Inverse
Copyright (C) 2006-2011 Inverse
SOGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
@ -161,46 +161,108 @@ function openUserFolderSelector(callback, type) {
if (! urlstr.endsWith('/'))
urlstr += '/';
urlstr += ("../../" + UserLogin + "/Contacts/userFolders");
var w = window.open(urlstr, "_blank",
"width=322,height=250,resizable=1,scrollbars=0,location=0");
w.opener = window;
window.userFolderCallback = callback;
window.userFolderType = type;
w.focus();
var div = $("popupFrame");
if (div) {
if (!div.hasClassName("small"))
div.addClassName("small");
var iframe = div.down("iframe");
iframe.src = urlstr;
iframe.id = "folderSelectorFrame";
var bgDiv = $("bgFrameDiv");
if (bgDiv) {
bgDiv.show();
}
else {
bgDiv = createElement("div", "bgFrameDiv", ["bgMail"]);
document.body.appendChild(bgDiv);
}
div.show();
}
else {
var w = window.open(urlstr, "_blank",
"width=322,height=250,resizable=1,scrollbars=0,location=0");
w.opener = window;
window.userFolderCallback = callback;
window.userFolderType = type;
w.focus();
}
}
function openContactWindow(url, wId) {
if (!wId)
wId = "_blank";
else
wId = sanitizeWindowName(wId);
var div = $("popupFrame");
if (div) {
if (!div.hasClassName("small"))
div.addClassName("small");
var iframe = div.down("iframe");
iframe.src = url;
iframe.id = "contactEditorFrame";
var bgDiv = $("bgFrameDiv");
if (bgDiv) {
bgDiv.show();
}
else {
bgDiv = createElement("div", "bgFrameDiv");
document.body.appendChild(bgDiv);
}
div.show();
var w = window.open(url, wId,
"width=450,height=530,resizable=0,location=0");
w.focus();
return div;
}
else {
if (!wId)
wId = "_blank";
else
wId = sanitizeWindowName(wId);
return w;
var w = window.open(url, wId,
"width=450,height=530,resizable=0,location=0");
w.focus();
return w;
}
}
function openMailComposeWindow(url, wId) {
var parentWindow = this;
var div = $("popupFrame");
if (div) {
if (div.hasClassName("small"))
div.removeClassName("small");
var iframe = div.down("iframe");
iframe.src = url;
iframe.id = "messageCompositionFrame";
var bgDiv = $("bgFrameDiv");
if (bgDiv) {
bgDiv.show();
}
else {
bgDiv = createElement("div", "bgFrameDiv");
document.body.appendChild(bgDiv);
}
div.show();
if (!wId)
wId = "_blank";
else
wId = sanitizeWindowName(wId);
return div;
}
else {
var parentWindow = this;
if (document.body.hasClassName("popup"))
parentWindow = window.opener;
if (!wId)
wId = "_blank";
else
wId = sanitizeWindowName(wId);
var w = parentWindow.open(url, wId,
"width=680,height=520,resizable=1,scrollbars=1,toolbar=0,"
+ "location=0,directories=0,status=0,menubar=0"
+ ",copyhistory=0");
if (document.body.hasClassName("popup"))
parentWindow = window.opener;
w.focus();
var w = parentWindow.open(url, wId,
"width=680,height=520,resizable=1,scrollbars=1,toolbar=0,"
+ "location=0,directories=0,status=0,menubar=0"
+ ",copyhistory=0");
return w;
w.focus();
return w;
}
}
function openMailTo(senderMailTo) {
@ -580,7 +642,7 @@ function onRowClick(event, target) {
else
// Not a list; stop here
return true;
var initialSelection = $(node.parentNode).getSelectedNodesId();
if (initialSelection && initialSelection.length > 0
&& initialSelection.indexOf(node.id) >= 0
@ -803,10 +865,17 @@ function toggleLogConsole(event) {
function log(message) {
if (!logWindow) {
logWindow = window;
try {
while (logWindow.opener && logWindow.opener_logMessage)
logWindow = logWindow.opener;
if (window.frameElement && window.frameElement.id) {
logWindow = parent.window;
while (logWindow.frameElement && window.frameElement.id)
logWindow = logWindow.parent.window;
}
else {
logWindow = window;
while (logWindow.opener && logWindow.opener._logMessage)
logWindow = logWindow.opener;
}
}
catch(e) {}
}
@ -945,8 +1014,8 @@ function popupSearchMenu(event) {
var popup = $(menuId);
offset = Position.positionedOffset(this);
popup.setStyle({ top: this.offsetHeight + "px",
left: (offset[0] + 3) + "px",
popup.setStyle({ top: (offset.top + this.getHeight()) + "px",
left: (offset.left + 3) + "px",
visibility: "visible" });
document.currentPopupMenu = popup;
@ -958,6 +1027,9 @@ function setSearchCriteria(event) {
var searchValue = $("searchValue");
var searchCriteria = $("searchCriteria");
if (searchValue.ghostPhrase == searchValue.value)
searchValue.value = "";
searchValue.ghostPhrase = this.innerHTML;
searchCriteria.value = this.getAttribute('id');
@ -975,13 +1047,6 @@ function setSearchCriteria(event) {
}
}
function checkSearchValue(event) {
var searchValue = $("searchValue");
if (searchValue.value == searchValue.ghostPhrase)
searchValue.value = "";
}
function configureSearchField() {
var searchValue = $("searchValue");
@ -1368,6 +1433,8 @@ function initMenus() {
var menuDIV = $(menuID);
if (menuDIV)
initMenu(menuDIV, menus[menuID]);
else
log("Can't find menu " + menuID);
}
}
}
@ -1429,7 +1496,8 @@ function getTopWindow() {
var currentWindow = window;
while (!topWindow) {
if (currentWindow.document.body.hasClassName("popup")
&& currentWindow.opener)
&& currentWindow.opener
&& currentWindow.opener.getTopWindow)
currentWindow = currentWindow.opener;
else
topWindow = currentWindow;
@ -1535,6 +1603,23 @@ function onLoadHandler(event) {
onFinalLoadHandler();
}
function onCloseButtonClick(event) {
if (event)
Event.stop(event);
if (window.frameElement && window.frameElement.id) {
var div = parent$("popupFrame");
div.hide();
div.down("iframe").src = "/SOGo/loading";
parent$("bgFrameDiv").hide();
}
else {
window.close();
}
return false;
}
function onBodyClickContextMenu(event) {
var target = $(event.target);
if (!(target
@ -1562,12 +1647,32 @@ function onLinkBannerClick() {
function onPreferencesClick(event) {
var urlstr = UserFolderURL + "preferences";
var w = window.open(urlstr, "_blank",
"width=580,height=450,resizable=1,scrollbars=0,location=0");
w.opener = window;
w.focus();
var div = $("popupFrame");
if (div) {
if (div.hasClassName("small"))
div.removeClassName("small");
var iframe = div.down("iframe");
iframe.src = urlstr;
iframe.id = "preferencesFrame";
var bgDiv = $("bgFrameDiv");
if (bgDiv) {
bgDiv.show();
}
else {
bgDiv = createElement("div", "bgFrameDiv", ["bgMail"]);
document.body.appendChild(bgDiv);
}
div.show(); //setStyle({display: "block"});
}
else {
var w = window.open(urlstr, "_blank",
"width=580,height=450,resizable=1,scrollbars=0,location=0");
w.opener = window;
w.focus();
}
preventDefault(event);
return false;
}
function configureLinkBanner() {
@ -1688,7 +1793,14 @@ function onFinalLoadHandler(event) {
}
function parent$(element) {
return this.opener.document.getElementById(element);
var div = $("popupFrame");
if (div)
p = parent.document;
else
p = this.opener.document;
return p.getElementById(element);
}
/* stubs */
@ -1710,12 +1822,7 @@ function _(key) {
value = labels[key];
}
else {
var topWindow = null;
if (!topWindow) {
topWindow = window;
while (topWindow.opener)
topWindow = topWindow.opener;
}
var topWindow = getTopWindow();
if (topWindow && topWindow.clabels && topWindow.clabels[key])
value = topWindow.clabels[key];
}

View File

@ -6,6 +6,9 @@ FORM
{ padding: 0px;
margin: 0px; }
DIV#loginScreen A.button SPAN
{ padding: 0; }
/* generic */
SPAN.disabledToolbarButton
@ -38,8 +41,13 @@ DIV.tabsContainer > DIV.scrollToolbar > A > SPAN
DIV.dialog.none DIV
{ padding-bottom: 0px; }
DIV#popupFrame IFRAME
{ height: expression(document.body.clientHeight - 88 + "px") }
DIV#bgFrameDiv,
DIV#bgDialogDiv
{ filter: alpha(opacity=30); }
{ background-color: #555;
filter: alpha(opacity=40); }
/* MailerUI */
@ -176,7 +184,10 @@ A.smallToolbarButton SPAN, A.smallToolbarButton:hover SPAN
A.toolbarButton:active SPAN {
background-position: auto; /*broken*/
}
A.toolbarButton, A.toolbarButton SPAN, A.button, A.button SPAN
A.toolbarButton, A.toolbarButton SPAN
{ color: #fff; }
A.button, A.button SPAN
{ color: #262B33; }
DIV#toolbar