зеркало из https://github.com/mozilla/pjs.git
Added views and sorting.
This commit is contained in:
Родитель
dff0129db7
Коммит
64353113d8
|
@ -68,10 +68,15 @@ function LoadMessage(messageNode)
|
|||
OpenURL(uri);
|
||||
}
|
||||
|
||||
function ChangeFolder(folderNode)
|
||||
function ChangeFolderByDOMNode(folderNode)
|
||||
{
|
||||
var uri = folderNode.getAttribute('id');
|
||||
dump(uri);
|
||||
ChangeFolderByURI(uri);
|
||||
}
|
||||
|
||||
function ChangeFolderByURI(uri)
|
||||
{
|
||||
var tree = frames[0].frames[1].document.getElementById('threadTree');
|
||||
tree.childNodes[5].setAttribute('id', uri);
|
||||
}
|
||||
|
@ -92,3 +97,30 @@ function ComposeMessageWithType(type)
|
|||
ComposeMessage(tree, nodeList, appCore, type);
|
||||
}
|
||||
}
|
||||
|
||||
function SortThreadPane(column, sortKey)
|
||||
{
|
||||
var node = frames[0].frames[1].document.getElementById(column);
|
||||
if(!node)
|
||||
return false;
|
||||
|
||||
var rdfCore = XPAppCoresManager.Find("RDFCore");
|
||||
if (!rdfCore)
|
||||
{
|
||||
rdfCore = new RDFCore();
|
||||
if (!rdfCore)
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
|
||||
rdfCore.Init("RDFCore");
|
||||
|
||||
}
|
||||
|
||||
// sort!!!
|
||||
rdfCore.doSort(node, sortKey, "ascending");
|
||||
|
||||
return(true);
|
||||
|
||||
|
||||
}
|
|
@ -9,7 +9,7 @@
|
|||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
|
||||
<tree rdf:datasources="rdf:mailnews" onclick="return parent.parent.ChangeFolder(event.target.parentNode)">
|
||||
<tree rdf:datasources="rdf:mailnews" onclick="return parent.parent.ChangeFolderByDOMNode(event.target.parentNode)">
|
||||
<treecol rdf:resource="http://home.netscape.com/NC-rdf#Name"/>
|
||||
<treehead>
|
||||
<treeitem>
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
<window xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="MsgStartUp()"
|
||||
onconstruction="MsgStartUp()"
|
||||
title="Messenger"
|
||||
style="width:100%;height:100%">
|
||||
|
|
|
@ -10,21 +10,23 @@
|
|||
|
||||
|
||||
<tree rdf:datasources="rdf:mailnews" id="threadTree" onclick="return parent.parent.LoadMessage(event.target.parentNode)" rdf:containment="http://home.netscape.com/NC-rdf#MessageChild">
|
||||
<treecol rdf:resource="http://home.netscape.com/NC-rdf#Subject"/>
|
||||
<treecol rdf:resource="http://home.netscape.com/NC-rdf#Sender"/>
|
||||
<treecol rdf:resource="http://home.netscape.com/NC-rdf#Date"/>
|
||||
<treecol rdf:resource="http://home.netscape.com/NC-rdf#Status"/>
|
||||
<treecol id="SubjectColumn" rdf:resource="http://home.netscape.com/NC-rdf#Subject"/>
|
||||
<treecol id="AuthorColumn" rdf:resource="http://home.netscape.com/NC-rdf#Sender"/>
|
||||
<treecol id="DateColumn" rdf:resource="http://home.netscape.com/NC-rdf#Date"/>
|
||||
<treecol "id="StatusColumn" rdf:resource="http://home.netscape.com/NC-rdf#Status"/>
|
||||
<treehead>
|
||||
<treeitem>
|
||||
<treecell>Subject</treecell>
|
||||
<treecell>Sender</treecell>
|
||||
<treecell>Date</treecell>
|
||||
<treecell>Status</treecell>
|
||||
<treecell onclick="return parent.parent.SortThreadPane('SubjectColumn', 'http://home.netscape.com/NC-rdf#Subject');">
|
||||
Subject
|
||||
</treecell>
|
||||
<treecell onclick="return parent.parent.SortThreadPane('AuthorColumn', 'http://home.netscape.com/NC-rdf#Sender');">Sender</treecell>
|
||||
<treecell onclick="return parent.parent.SortThreadPane('DateColumn', 'http://home.netscape.com/NC-rdf#Date');">Date</treecell>
|
||||
<treecell onclick="return parent.parent.SortThreadPane('StatusColumn', 'http://home.netscape.com/NC-rdf#Status');">Status</treecell>
|
||||
</treeitem>
|
||||
</treehead>
|
||||
|
||||
|
||||
<treebody id="mailbox://Inbox" name="threadTreeBody">
|
||||
<treebody name="threadTreeBody">
|
||||
<treeitem open="true">
|
||||
</treeitem>
|
||||
</treebody>
|
||||
|
|
|
@ -4,8 +4,13 @@ function MsgStartUp()
|
|||
dump("StartUp: MsgAppCore\n");
|
||||
var appCore = FindMsgAppCore();
|
||||
if (appCore != null) {
|
||||
dump("In MsgStartUp()");
|
||||
dump("Initializing AppCore and setting Window\n");
|
||||
appCore.SetWindow(window);
|
||||
ChangeFolderByURI("mailbox://Inbox");
|
||||
//In the future we'll want to read this in from a preference.
|
||||
MsgViewAllMsgs();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -130,6 +135,63 @@ function MsgMoveMessage(destFolder)
|
|||
}
|
||||
}
|
||||
|
||||
function MsgViewAllMsgs()
|
||||
{
|
||||
dump("MsgViewAllMsgs");
|
||||
|
||||
var tree = frames[0].frames[1].document.getElementById('threadTree');
|
||||
|
||||
var appCore = FindMsgAppCore();
|
||||
if (appCore != null) {
|
||||
appCore.SetWindow(window);
|
||||
appCore.ViewAllMessages(tree.database);
|
||||
}
|
||||
|
||||
//hack to make it get new view.
|
||||
var currentFolder = tree.childNodes[5].getAttribute('id');
|
||||
tree.childNodes[5].setAttribute('id', currentFolder);
|
||||
|
||||
}
|
||||
|
||||
function MsgViewUnreadMsg()
|
||||
{
|
||||
dump("MsgViewUnreadMsgs");
|
||||
|
||||
var tree = frames[0].frames[1].document.getElementById('threadTree');
|
||||
|
||||
var appCore = FindMsgAppCore();
|
||||
if (appCore != null) {
|
||||
appCore.SetWindow(window);
|
||||
appCore.ViewUnreadMessages(tree.database);
|
||||
}
|
||||
|
||||
//hack to make it get new view.
|
||||
var currentFolder = tree.childNodes[5].getAttribute('id');
|
||||
tree.childNodes[5].setAttribute('id', currentFolder);
|
||||
|
||||
|
||||
}
|
||||
|
||||
function MsgSortByDate()
|
||||
{
|
||||
SortThreadPane('DateColumn', 'http://home.netscape.com/NC-rdf#Date');
|
||||
}
|
||||
|
||||
function MsgSortBySender()
|
||||
{
|
||||
SortThreadPane('AuthorColumn', 'http://home.netscape.com/NC-rdf#Sender');
|
||||
}
|
||||
|
||||
function MsgSortByStatus()
|
||||
{
|
||||
SortThreadPane('StatusColumn', 'http://home.netscape.com/NC-rdf#Status');
|
||||
}
|
||||
|
||||
function MsgSortBySubject()
|
||||
{
|
||||
SortThreadPane('SubjectColumn', 'http://home.netscape.com/NC-rdf#Subject');
|
||||
}
|
||||
|
||||
function MsgNewFolder() {}
|
||||
function MsgOpenAttachment() {}
|
||||
function MsgSaveAsFile() {}
|
||||
|
@ -163,20 +225,14 @@ function MsgShowMsgToolbar() {}
|
|||
function MsgShowLocationbar() {}
|
||||
function MsgShowMessage() {}
|
||||
function MsgShowFolders() {}
|
||||
function MsgSortByDate() {}
|
||||
function MsgSortByFlag() {}
|
||||
function MsgSortByPriority() {}
|
||||
function MsgSortBySender() {}
|
||||
function MsgSortBySize() {}
|
||||
function MsgSortByStatus() {}
|
||||
function MsgSortBySubject() {}
|
||||
function MsgSortByThread() {}
|
||||
function MsgSortByUnread() {}
|
||||
function MsgSortByOrderReceived() {}
|
||||
function MsgSortAscending() {}
|
||||
function MsgSortDescending() {}
|
||||
function MsgViewAllMsgs() {}
|
||||
function MsgViewUnreadMsg() {}
|
||||
function MsgViewThreadsUnread() {}
|
||||
function MsgViewWatchedThreadsUnread() {}
|
||||
function MsgViewIgnoreThread() {}
|
||||
|
|
Загрузка…
Ссылка в новой задаче