mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-09 10:25:08 +00:00
Monotone-Parent: 200aa3ad3746194677c1c162d99fec321f1ecd29
Monotone-Revision: dacf207e0fa21cda9cc795c449e369f77d6a5d28 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-06-28T18:28:33 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -494,21 +494,25 @@ TABLE#messageList THEAD
|
||||
TABLE#messageList TD
|
||||
{ height: 1.2em; }
|
||||
|
||||
TD#messageFlagHeader,
|
||||
TABLE#messageList TD.messageFlagColumn
|
||||
{ width: 1em;
|
||||
text-align: center; }
|
||||
|
||||
TD#subjectHeader,
|
||||
TABLE#messageList TD.tbtv_subject_headercell,
|
||||
TABLE#messageList td.mailer_unreadmailsubject,
|
||||
TABLE#messageList td.mailer_readmailsubject
|
||||
{ width: 40%;
|
||||
min-width: 40%; }
|
||||
|
||||
TD#fromHeader,
|
||||
TABLE#messageList TD.tbtv_from_headercell,
|
||||
TABLE#messageList TD.messageAddressColumn
|
||||
{ width: 35%;
|
||||
overflow: hidden; }
|
||||
|
||||
TD#dateHeader,
|
||||
TABLE#messageList TD.tbtv_date_headercell,
|
||||
TABLE#messageList TD.messageDateColumn
|
||||
{ width: 25%;
|
||||
|
||||
@@ -386,6 +386,7 @@ function onMailboxTreeItemClick(event) {
|
||||
topNode.selectedEntry = this;
|
||||
|
||||
search = {};
|
||||
sorting = {};
|
||||
$("searchValue").value = "";
|
||||
initCriteria();
|
||||
|
||||
@@ -423,7 +424,7 @@ function refreshMailbox() {
|
||||
return false;
|
||||
}
|
||||
|
||||
function openMailbox(mailbox, reload) {
|
||||
function openMailbox(mailbox, reload, idx) {
|
||||
if (mailbox != currentMailbox || reload) {
|
||||
currentMailbox = mailbox;
|
||||
var url = ApplicationBaseURL + mailbox + "/view?noframe=1&desc=1";
|
||||
@@ -458,6 +459,12 @@ function openMailbox(mailbox, reload) {
|
||||
if (searchValue && searchValue.length > 0)
|
||||
url += ("&search=" + search["criteria"]
|
||||
+ "&value=" + searchValue);
|
||||
var sortAttribute = sorting["attribute"];
|
||||
if (sortAttribute && sortAttribute.length > 0)
|
||||
url += ("&sort=" + sorting["attribute"]
|
||||
+ "&asc=" + sorting["ascending"]);
|
||||
if (idx)
|
||||
url += "&idx=" + idx;
|
||||
document.messageListAjaxRequest
|
||||
= triggerAjaxRequest(url, messageListCallback,
|
||||
currentMessages[mailbox]);
|
||||
@@ -474,19 +481,7 @@ function openMailbox(mailbox, reload) {
|
||||
}
|
||||
|
||||
function openMailboxAtIndex(event) {
|
||||
var idx = this.getAttribute("idx");
|
||||
var url = ApplicationBaseURL + currentMailbox + "/view?noframe=1&idx=" + idx;
|
||||
var searchValue = search["value"];
|
||||
if (searchValue && searchValue.length > 0)
|
||||
url += ("&search=" + search["criteria"]
|
||||
+ "&value=" + searchValue);
|
||||
|
||||
if (document.messageListAjaxRequest) {
|
||||
document.messageListAjaxRequest.aborted = true;
|
||||
document.messageListAjaxRequest.abort();
|
||||
}
|
||||
document.messageListAjaxRequest
|
||||
= triggerAjaxRequest(url, messageListCallback);
|
||||
openMailbox(currentMailbox, true, this.getAttribute("idx"));
|
||||
|
||||
preventDefault(event);
|
||||
}
|
||||
@@ -505,7 +500,26 @@ function messageListCallback(http) {
|
||||
row.select();
|
||||
}
|
||||
configureMessageListEvents();
|
||||
configureSortableTableHeaders();
|
||||
if (sorting["attribute"] && sorting["attribute"].length > 0) {
|
||||
var sortHeader;
|
||||
if (sorting["attribute"] == "subject")
|
||||
sortHeader = $("subjectHeader");
|
||||
else if (sorting["attribute"] == "from")
|
||||
sortHeader = $("fromHeader");
|
||||
else if (sorting["attribute"] == "date")
|
||||
sortHeader = $("dateHeader");
|
||||
else
|
||||
sortHeader = null;
|
||||
|
||||
if (sortHeader) {
|
||||
var sortImage = createElement("img", "messageSortImage", "sortImage");
|
||||
sortHeader.insertBefore(sortImage, sortHeader.firstChild);
|
||||
if (sorting["ascending"])
|
||||
sortImage.src = ResourcesURL + "/title_sortdown_12x12.png";
|
||||
else
|
||||
sortImage.src = ResourcesURL + "/title_sortup_12x12.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
log("messageListCallback: problem during ajax request (readyState = " + http.readyState + ", status = " + http.status + ")");
|
||||
@@ -849,18 +863,25 @@ function expandUpperTree(node) {
|
||||
}
|
||||
|
||||
function onHeaderClick(event) {
|
||||
if (document.messageListAjaxRequest) {
|
||||
document.messageListAjaxRequest.aborted = true;
|
||||
document.messageListAjaxRequest.abort();
|
||||
}
|
||||
var link = this.getAttribute("href");
|
||||
url = ApplicationBaseURL + currentMailbox + "/" + link;
|
||||
if (link.indexOf("noframe=") < 0)
|
||||
url += "&noframe=1";
|
||||
var headerId = this.getAttribute("id");
|
||||
var newSortAttribute;
|
||||
if (headerId == "subjectHeader")
|
||||
newSortAttribute = "subject";
|
||||
else if (headerId == "fromHeader")
|
||||
newSortAttribute = "from";
|
||||
else if (headerId == "dateHeader")
|
||||
newSortAttribute = "date";
|
||||
else
|
||||
newSortAttribute = "arrival";
|
||||
|
||||
log ("link: " + link);
|
||||
document.messageListAjaxRequest
|
||||
= triggerAjaxRequest(url, messageListCallback);
|
||||
if (sorting["attribute"] == newSortAttribute)
|
||||
sorting["ascending"] = !sorting["ascending"];
|
||||
else {
|
||||
sorting["attribute"] = newSortAttribute;
|
||||
sorting["ascending"] = true;
|
||||
}
|
||||
|
||||
openMailbox(currentMailbox, true);
|
||||
|
||||
preventDefault(event);
|
||||
}
|
||||
@@ -955,11 +976,24 @@ var messageListData = function(type) {
|
||||
return msgIds;
|
||||
}
|
||||
|
||||
/* a model for a futur refactoring of the sortable table headers mechanism */
|
||||
|
||||
function configureMessageListHeaders(cells) {
|
||||
for (var i = 0; i < cells.length; i++) {
|
||||
var currentCell = $(cells[i]);
|
||||
Event.observe(currentCell, "click",
|
||||
onHeaderClick.bindAsEventListener(currentCell));
|
||||
Event.observe(currentCell, "mousedown", listRowMouseDownHandler);
|
||||
}
|
||||
}
|
||||
|
||||
function configureMessageListEvents() {
|
||||
var messageList = $("messageList");
|
||||
if (messageList) {
|
||||
Event.observe(messageList, "mousedown",
|
||||
onMessageSelectionChange.bindAsEventListener(messageList));
|
||||
|
||||
configureMessageListHeaders(messageList.tHead.rows[0].cells);
|
||||
var cell = messageList.tHead.rows[1].cells[0];
|
||||
if ($(cell).hasClassName("tbtv_navcell")) {
|
||||
var anchors = $(cell).childNodesWithTag("a");
|
||||
@@ -976,7 +1010,7 @@ function configureMessageListEvents() {
|
||||
rows[i].dndGhost = messageListGhost;
|
||||
rows[i].dndDataForType = messageListData;
|
||||
document.DNDManager.registerSource(rows[i]);
|
||||
|
||||
|
||||
for (var j = 0; j < rows[i].cells.length; j++) {
|
||||
var cell = rows[i].cells[j];
|
||||
Event.observe(cell, "mousedown", listRowMouseDownHandler);
|
||||
|
||||
@@ -390,7 +390,8 @@ td.tbtv_actcell
|
||||
TD.headerCell,
|
||||
TD.tbtv_headercell,
|
||||
TD.tbtv_navcell
|
||||
{ background-color: #d4d0c8;
|
||||
{ vertical-align: middle;
|
||||
background-color: #d4d0c8;
|
||||
border-top: 1px solid #fff;
|
||||
border-left: 1px solid #fff;
|
||||
border-right: 2px solid #222;
|
||||
@@ -400,10 +401,13 @@ TD.tbtv_navcell
|
||||
|
||||
TD.headerCell:active,
|
||||
TD.tbtv_headercell:active
|
||||
{ background-color: #DCDAD5;
|
||||
border: 1px solid #9c9a94;
|
||||
-moz-border-bottom-colors: #9c9a94;
|
||||
-moz-border-right-colors: #9c9a94; }
|
||||
{ background-color: #dcdad5;
|
||||
padding-top: 2px;
|
||||
border-top: 1px solid #9c9a94;
|
||||
border-left: 1px solid #9c9a94;
|
||||
border-right: 2px solid #9c9a94;
|
||||
border-bottom: 1px solid #9c9a94;
|
||||
-moz-border-colors: #9c9a94 #000; }
|
||||
|
||||
TD.headerCell SPAN,
|
||||
td.tbtv_headercell SPAN
|
||||
@@ -425,6 +429,7 @@ td.tbtv_headercell a:hover
|
||||
/* background-color: #C4C0B8; */
|
||||
}
|
||||
|
||||
IMG.sortImage,
|
||||
TD.headerCell IMG.tbtv_sortcell,
|
||||
td.tbtv_headercell img.tbtv_sortcell
|
||||
{ float: right;
|
||||
|
||||
@@ -30,6 +30,7 @@ var queryParameters;
|
||||
var activeAjaxRequests = 0;
|
||||
var menus = new Array();
|
||||
var search = {};
|
||||
var sorting = {};
|
||||
|
||||
var weekStartIsMonday = true;
|
||||
|
||||
@@ -108,9 +109,13 @@ function createElement(tagName, id, classes, attributes, htmlAttributes,
|
||||
var newElement = $(document.createElement(tagName));
|
||||
if (id)
|
||||
newElement.setAttribute("id", id);
|
||||
if (classes)
|
||||
for (var i = 0; i < classes.length; i++)
|
||||
newElement.addClassName(classes[i]);
|
||||
if (classes) {
|
||||
if (typeof(classes) == "string")
|
||||
newElement.addClassName(classes);
|
||||
else
|
||||
for (var i = 0; i < classes.length; i++)
|
||||
newElement.addClassName(classes[i]);
|
||||
}
|
||||
if (attributes)
|
||||
for (var i in attributes)
|
||||
newElement[i] = attributes[i];
|
||||
@@ -977,7 +982,7 @@ function unsubscribeFromFolder(folder, refreshCallback, refreshCallbackData) {
|
||||
}
|
||||
|
||||
function listRowMouseDownHandler(event) {
|
||||
preventDefault(event);
|
||||
preventDefault(event);
|
||||
}
|
||||
|
||||
/* tabs */
|
||||
@@ -1266,7 +1271,7 @@ function onPreferencesClick(event) {
|
||||
w.opener = window;
|
||||
w.focus();
|
||||
|
||||
event.preventDefault();
|
||||
preventDefault(event);
|
||||
}
|
||||
|
||||
function configureLinkBanner() {
|
||||
|
||||
Reference in New Issue
Block a user