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 - added support for limiting LDAP queries with the SOGoLDAPQueryLimit and
the SOGoLDAPSizeLimit settings; the SOGoLDAPSizeLimit settings;
- fixed a bug where folders starting with digits would not be displayed; - 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 print messages from the mailer toolbar;
- added the ability to use and configure SMTP as the email transport instead - added the ability to use and configure SMTP as the email transport instead
of sendmail; of sendmail;

View File

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

View File

@ -52,7 +52,7 @@
/></span></div> /></span></div>
</div> </div>
<!-- separator line --> <!-- 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" / --> <!-- img rsrc:src="tbird_073_compose.png" alt="screenshot" / -->
</form> </form>
</var:component> </var:component>

View File

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

View File

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

View File

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

View File

@ -1427,21 +1427,6 @@ function onCalendarRemove(event) {
preventDefault(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() { function configureLists() {
var list = $("tasksList"); var list = $("tasksList");
list.multiselect = true; list.multiselect = true;

View File

@ -114,4 +114,5 @@ DIV.pageContent TEXTAREA
left: 0em; left: 0em;
right: 0em; right: 0em;
bottom: 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 stop = false;
var counter = 0; var counter = 0;
var currentRow = $('row_' + counter); var currentRow = $('row_' + counter);
while (currentRow while (currentRow && !stop) {
&& !stop) { var currentValue = $(currentRow.childNodesWithTag("span")[1]).childNodesWithTag("input")[0].value;
var currentValue = currentRow.childNodesWithTag("span")[1].childNodesWithTag("input")[0].value;
if (currentValue == neededOptionValue) { if (currentValue == neededOptionValue) {
stop = true; stop = true;
insertContact($("addr_" + counter), contactName, contactEmail); insertContact($("addr_" + counter), contactName, contactEmail);
@ -231,9 +230,12 @@ function initMailEditor() {
var list = $("attachments"); var list = $("attachments");
$(list).attachMenu("attachmentsMenu"); $(list).attachMenu("attachmentsMenu");
var elements = list.childNodesWithTag("li"); 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", Event.observe(elements[i], "click",
onRowClick.bindAsEventListener(elements[i])); onRowClick.bindAsEventListener(elements[i]));
}
onWindowResize(null);
Event.observe(window, "resize", onWindowResize);
} }
function getMenus() { function getMenus() {
@ -264,4 +266,14 @@ function onSelectAllAttachments() {
nodes[i].select(); 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); addEvent(window, 'load', initMailEditor);

View File

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