Monotone-Parent: 642c3f094e45b7be777dcf2dd60e04f120f02df4

Monotone-Revision: 04980f497e9c317b4d93db9ab0dae2f1e8e464ba

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2007-08-14T22:09:20
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Francis Lachapelle 2007-08-14 22:09:20 +00:00
parent 0d4428e270
commit 8e42f79fd2
11 changed files with 86 additions and 65 deletions

3
NEWS
View File

@ -9,7 +9,8 @@
- added support for limiting LDAP queries with the SOGoLDAPQueryLimit and
the SOGoLDAPSizeLimit settings;
- fixed a bug where folders starting with digits would not be displayed;
- improved IE7 and Safari support: priority menus, attendees selector;
- improved IE7 and Safari support: priority menus, attendees selector,
search fields, textarea sizes;
- added the ability to print messages from the mailer toolbar;
- added the ability to use and configure SMTP as the email transport instead
of sendmail;

View File

@ -29,7 +29,7 @@
<var:foreach list="contactInfos" item="currentContact">
<tr class="tableview"
var:id="currentContact.c_name"
var:contactname="displayName"
var:contactname="currentContact.displayName"
var:contactid="currentContact.c_uid"
onclick="return onContactRowClick(event, this);"
ondblclick="return onContactRowDblClick(event, this);"

View File

@ -52,7 +52,7 @@
/></span></div>
</div>
<!-- separator line -->
<textarea name="text" var:value="text" />
<textarea name="text" rows="30" var:value="text" />
<!-- img rsrc:src="tbird_073_compose.png" alt="screenshot" / -->
</form>
</var:component>

View File

@ -33,14 +33,14 @@ function validateEditorInput(sender) {
function openContactsFolder(contactsFolder, reload, idx) {
if ((contactsFolder && contactsFolder != currentContactFolder)
|| reload) {
currentContactFolder = contactsFolder; log("openContactsFolder " + contactsFolder);
currentContactFolder = contactsFolder;
var url = URLForFolderID(currentContactFolder) +
"/view?noframe=1";
var searchValue = search["value"];
if (searchValue && searchValue.length > 0)
url += ("&search=" + search["criteria"]
+ "&value=" + searchValue);
+ "&value=" + escape(searchValue));
var sortAttribute = sorting["attribute"];
if (sortAttribute && sortAttribute.length > 0)
url += ("&sort=" + sorting["attribute"]
@ -139,43 +139,46 @@ function contactsListCallback(http) {
function onContactFoldersContextMenu(event) {
var menu = $("contactFoldersMenu");
Event.observe(menu, "hideMenu", onContactFoldersContextMenuHide, false);
//Event.observe(menu, "hideMenu", onContactFoldersContextMenuHide, false);
Event.observe(menu, "mousedown", onContactFoldersContextMenuHide, false);
popupMenu(event, "contactFoldersMenu", this);
var topNode = $("contactFolders");
var selectedNodes = topNode.getSelectedRows();
topNode.menuSelectedRows = selectedNodes;
for (var i = 0; i < selectedNodes.length; i++)
selectedNodes[i].deselect();
$(selectedNodes[i]).deselect();
topNode.menuSelectedEntry = this;
this.select();
$(this).select();
}
function onContactContextMenu(event, element) {
var menu = $("contactMenu");
Event.observe(menu, "hideMenu", onContactContextMenuHide, false);
//Event.observe(menu, "hideMenu", onContactContextMenuHide, false);
Event.observe(menu, "mousedown", onContactContextMenuHide, false);
//document.documentElement.onclick = onContactContextMenuHide;
popupMenu(event, "contactMenu", element);
var topNode = $("contactsList");
var selectedNodes = topNode.getSelectedRows();
topNode.menuSelectedRows = selectedNodes;
for (var i = 0; i < selectedNodes.length; i++)
selectedNodes[i].deselect();
$(selectedNodes[i]).deselect();
topNode.menuSelectedEntry = element;
element.select();
$(element).select();
}
function onContactContextMenuHide(event) {
var topNode = $("contactsList");
if (topNode.menuSelectedEntry) {
topNode.menuSelectedEntry.deselect();
$(topNode.menuSelectedEntry).deselect();
topNode.menuSelectedEntry = null;
}
if (topNode.menuSelectedRows) {
var nodes = topNode.menuSelectedRows;
for (var i = 0; i < nodes.length; i++)
nodes[i].select();
$(nodes[i]).select();
topNode.menuSelectedRows = null;
}
}
@ -437,7 +440,7 @@ function onFolderSelectionChange() {
}
}
function refreshCurrentFolder() { log("refreshCurrentFolder");
function refreshCurrentFolder() {
openContactsFolder(currentContactFolder, true);
}

View File

@ -307,9 +307,9 @@ TABLE.mailer_fieldtable
top: 0px;
left: 0px;
padding-top: .5em;
padding-bottom: .5em;
overflow-y: auto;
overflow-x: hidden;
height: 7.5em;
border-bottom: 1px solid #808080;
background: #d4d0c8;
}

View File

@ -31,7 +31,7 @@ function openMessageWindow(msguid, url) {
}
function onMessageDoubleClick(event) {
resetSelection(window);
//resetSelection(window);
var msguid = this.parentNode.id.substr(4);
return openMessageWindow(msguid,
@ -45,12 +45,6 @@ function toggleMailSelect(sender) {
row.className = sender.checked ? "tableview_selected" : "tableview";
}
function clearSearch(sender) {
var searchField = window.$("search");
if (searchField) searchField.value="";
return true;
}
function openAddressbook(sender) {
var urlstr;
@ -393,7 +387,7 @@ function openMailbox(mailbox, reload, idx) {
var searchValue = search["value"];
if (searchValue && searchValue.length > 0)
url += ("&search=" + search["criteria"]
+ "&value=" + searchValue);
+ "&value=" + escape(searchValue));
var sortAttribute = sorting["attribute"];
if (sortAttribute && sortAttribute.length > 0)
url += ("&sort=" + sorting["attribute"]

View File

@ -1427,21 +1427,6 @@ function onCalendarRemove(event) {
preventDefault(event);
}
function configureSearchField() {
var searchValue = $("searchValue");
Event.observe(searchValue, "mousedown",
onSearchMouseDown.bindAsEventListener(searchValue));
Event.observe(searchValue, "click",
popupSearchMenu.bindAsEventListener(searchValue));
Event.observe(searchValue, "blur",
onSearchBlur.bindAsEventListener(searchValue));
Event.observe(searchValue, "focus",
onSearchFocus.bindAsEventListener(searchValue));
Event.observe(searchValue, "keydown",
onSearchKeyDown.bindAsEventListener(searchValue));
}
function configureLists() {
var list = $("tasksList");
list.multiselect = true;

View File

@ -114,4 +114,5 @@ DIV.pageContent TEXTAREA
left: 0em;
right: 0em;
bottom: 0em;
top: 17em; }
top: 17em;
width: 100%; }

View File

@ -30,9 +30,8 @@ function addContact(tag, fullContactName, contactId, contactName, contactEmail)
var stop = false;
var counter = 0;
var currentRow = $('row_' + counter);
while (currentRow
&& !stop) {
var currentValue = currentRow.childNodesWithTag("span")[1].childNodesWithTag("input")[0].value;
while (currentRow && !stop) {
var currentValue = $(currentRow.childNodesWithTag("span")[1]).childNodesWithTag("input")[0].value;
if (currentValue == neededOptionValue) {
stop = true;
insertContact($("addr_" + counter), contactName, contactEmail);
@ -231,9 +230,12 @@ function initMailEditor() {
var list = $("attachments");
$(list).attachMenu("attachmentsMenu");
var elements = list.childNodesWithTag("li");
for (var i = 0; i < elements.length; i++)
for (var i = 0; i < elements.length; i++) {
Event.observe(elements[i], "click",
onRowClick.bindAsEventListener(elements[i]));
}
onWindowResize(null);
Event.observe(window, "resize", onWindowResize);
}
function getMenus() {
@ -264,4 +266,14 @@ function onSelectAllAttachments() {
nodes[i].select();
}
function onWindowResize(event) {
var textarea = document.pageform.text;
var windowheight = (typeof self.innerHeight == "number" ? self.innerHeight : document.body.clientHeight);
var textareaoffset = textarea.offsetTop;
var rowheight = (Element.getHeight(textarea) / textarea.rows);
textarea.rows = Math.round((windowheight - textareaoffset) / rowheight);
log ("onWindowResize new number of rows = " + textarea.rows);
}
addEvent(window, 'load', initMailEditor);

View File

@ -3,3 +3,12 @@ function onPrintCurrentMessage(event) {
preventDefault(event);
}
function initMailerPopup(event) {
var headerTable = document.getElementsByClassName('mailer_fieldtable')[0];
var contentDiv = document.getElementsByClassName('mailer_mailcontent')[0];
contentDiv.setStyle({ 'top': (Element.getHeight(headerTable) + headerTable.offsetTop) + 'px' });
}
addEvent(window, 'load', initMailerPopup);

View File

@ -524,8 +524,8 @@ function popupMenu(event, menuId, target) {
hideMenu(document.currentPopupMenu);
var popup = $(menuId);
var menuTop = event.pageY;
var menuLeft = event.pageX;
var menuTop = Event.pointerY(event);
var menuLeft = Event.pointerX(event);
var heightDiff = (window.innerHeight
- (menuTop + popup.offsetHeight));
if (heightDiff < 0)
@ -541,6 +541,7 @@ function popupMenu(event, menuId, target) {
visibility: "visible" });
document.currentPopupMenu = popup;
Event.observe(document.body, "click", onBodyClickMenuHandler);
preventDefault(event);
@ -571,7 +572,7 @@ function onBodyClickMenuHandler(event) {
preventDefault(event);
}
function hideMenu(menuNode) {
function hideMenu(menuNode) { //log ("hideMenu");
var onHide;
if (menuNode.submenu) {
@ -590,13 +591,17 @@ function hideMenu(menuNode) {
menuNode.parentMenu = null;
}
if (document.initEvent) {
var onhideEvent = document.createEvent("UIEvents");
onhideEvent.initEvent("hideMenu", false, true);
if (document.createEvent) {
var onhideEvent;
if (isSafari())
onhideEvent = document.createEvent("UIEvents");
else // Mozilla
onhideEvent = document.createEvent("Events");
onhideEvent.initEvent("mousedown", false, true);
menuNode.dispatchEvent(onhideEvent);
}
else if (document.createEventObject) {
// TODO: add support for IE
else if (document.createEventObject) { // IE
menuNode.fireEvent("onmousedown");
}
}
@ -759,8 +764,10 @@ function checkDropDown(event) {
/* search field */
function popupSearchMenu(event) {
var menuId = this.getAttribute("menuid");
relX = event.pageX - $(this).cascadeLeftOffset();
relY = event.pageY - $(this).cascadeTopOffset();
var offset = Position.cumulativeOffset(this);
relX = Event.pointerX(event) - offset[0];
relY = Event.pointerY(event) - offset[1];
if (event.button == 0
&& relX < 24) {
@ -771,8 +778,9 @@ function popupSearchMenu(event) {
hideMenu(document.currentPopupMenu);
var popup = $(menuId);
offset = Position.positionedOffset(this);
popup.setStyle({ top: this.offsetHeight + "px",
left: (this.offsetLeft + 3) + "px",
left: (offset[0] + 3) + "px",
visibility: "visible" });
document.currentPopupMenu = popup;
@ -781,8 +789,8 @@ function popupSearchMenu(event) {
}
function setSearchCriteria(event) {
searchValue = $("searchValue");
searchCriteria = $("searchCriteria");
var searchValue = $("searchValue");
var searchCriteria = $("searchCriteria");
searchValue.setAttribute("ghost-phrase", this.innerHTML);
searchCriteria.value = this.getAttribute('id');
@ -804,6 +812,8 @@ function onSearchChange() {
function configureSearchField() {
var searchValue = $("searchValue");
if (!searchValue) return;
Event.observe(searchValue, "mousedown",
onSearchMouseDown.bindAsEventListener(searchValue));
Event.observe(searchValue, "click",
@ -818,8 +828,8 @@ function configureSearchField() {
function onSearchMouseDown(event) {
var superNode = this.parentNode.parentNode.parentNode;
relX = (event.pageX - superNode.offsetLeft - this.offsetLeft);
relY = (event.pageY - superNode.offsetTop - this.offsetTop);
relX = (Event.pointerX(event) - superNode.offsetLeft - this.offsetLeft);
relY = (Event.pointerY(event) - superNode.offsetTop - this.offsetTop);
if (relY < 24) {
event.cancelBubble = true;
@ -840,12 +850,13 @@ function onSearchFocus() {
}
function onSearchBlur(event) {
var ghostPhrase = this.getAttribute("ghost-phrase");
// log ("search blur: '" + this.value + "'");
if (!this.value) {
var ghostPhrase = this.getAttribute("ghost-phrase");
//log ("search blur: '" + this.value + "'");
if (!this.value) {
this.setAttribute("modified", "");
this.setStyle({ color: "#aaa" });
this.value = ghostPhrase;
refreshCurrentFolder();
} else if (this.value == ghostPhrase) {
this.setAttribute("modified", "");
this.setStyle({ color: "#aaa" });
@ -862,9 +873,12 @@ function onSearchKeyDown(event) {
this.timer = setTimeout("onSearchFormSubmit()", 1000);
}
function onSearchFormSubmit(event) { log("generic.onSearchFormSubmit")
function onSearchFormSubmit(event) {
var searchValue = $("searchValue");
var searchCriteria = $("searchCriteria");
var ghostPhrase = searchValue.getAttribute('ghost-phrase');
if (searchValue.value == ghostPhrase) return;
search["criteria"] = searchCriteria.value;
search["value"] = searchValue.value;
@ -876,6 +890,8 @@ function initCriteria() {
var searchCriteria = $("searchCriteria");
var searchValue = $("searchValue");
if (!searchValue) return;
var searchOptions = $("searchOptions").childNodesWithTag("li");
if (searchOptions.length > 0) {
var firstChild = searchOptions[0];
@ -1035,7 +1051,7 @@ function initMenus() {
function initMenu(menuDIV, callbacks) {
var lis = $(menuDIV.childNodesWithTag("ul")[0]).childNodesWithTag("li");
for (var j = 0; j < lis.length; j++) {
var node = lis[j];
var node = $(lis[j]);
Event.observe(node, "mousedown", listRowMouseDownHandler, false);
var callback = callbacks[j];
if (callback) {
@ -1228,9 +1244,9 @@ function onLoadHandler(event) {
queryParameters = parseQueryParameters('' + window.location);
if (!$(document.body).hasClassName("popup")) {
initLogConsole();
initCriteria();
configureSearchField();
}
initCriteria();
configureSearchField();
initMenus();
initTabs();
configureDragHandles();