зеркало из https://github.com/mozilla/pjs.git
move out threadpane-specific code so it can be reused in the search dialog for #33101 r=putterman
This commit is contained in:
Родитель
7db93f5a1e
Коммит
d466f3d433
|
@ -23,6 +23,7 @@
|
|||
messenger.xul
|
||||
folderPane.xul
|
||||
threadPane.xul
|
||||
threadPane.js
|
||||
mailWindowOverlay.xul
|
||||
mail3PaneWindowVertLayout.xul
|
||||
mailWindowOverlay.js
|
||||
|
|
|
@ -47,6 +47,7 @@ CHROME_CONTENT = \
|
|||
messageWindow.js \
|
||||
folderPane.xul \
|
||||
threadPane.xul \
|
||||
threadPane.js \
|
||||
msgHdrViewOverlay.xul \
|
||||
msgHdrViewOverlay.js \
|
||||
msgHdrViewAddresses.js \
|
||||
|
|
|
@ -565,75 +565,6 @@ function MsgDeleteFolder()
|
|||
}
|
||||
|
||||
//3pane related commands. Need to go in own file. Putting here for the moment.
|
||||
function MsgSortByDate()
|
||||
{
|
||||
SortThreadPane('DateColumn', 'http://home.netscape.com/NC-rdf#Date', null, true, null);
|
||||
}
|
||||
|
||||
function MsgSortBySender()
|
||||
{
|
||||
SortThreadPane('AuthorColumn', 'http://home.netscape.com/NC-rdf#Sender', 'http://home.netscape.com/NC-rdf#Date', true, null);
|
||||
}
|
||||
|
||||
function MsgSortByRecipient()
|
||||
{
|
||||
SortThreadPane('AuthorColumn', 'http://home.netscape.com/NC-rdf#Recipient', 'http://home.netscape.com/NC-rdf#Date', true, null);
|
||||
}
|
||||
|
||||
function MsgSortByStatus()
|
||||
{
|
||||
SortThreadPane('StatusColumn', 'http://home.netscape.com/NC-rdf#Status', 'http://home.netscape.com/NC-rdf#Date', true, null);
|
||||
}
|
||||
|
||||
function MsgSortBySubject()
|
||||
{
|
||||
SortThreadPane('SubjectColumn', 'http://home.netscape.com/NC-rdf#Subject', 'http://home.netscape.com/NC-rdf#Date', true, null);
|
||||
}
|
||||
|
||||
function MsgSortByFlagged()
|
||||
{
|
||||
SortThreadPane('FlaggedButtonColumn', 'http://home.netscape.com/NC-rdf#Flagged', 'http://home.netscape.com/NC-rdf#Date', true, null);
|
||||
}
|
||||
|
||||
function MsgSortByPriority()
|
||||
{
|
||||
SortThreadPane('PriorityColumn', 'http://home.netscape.com/NC-rdf#Priority', 'http://home.netscape.com/NC-rdf#Date',true, null);
|
||||
}
|
||||
|
||||
function MsgSortBySize()
|
||||
{
|
||||
SortThreadPane('SizeColumn', 'http://home.netscape.com/NC-rdf#Size', 'http://home.netscape.com/NC-rdf#Date', true, null);
|
||||
}
|
||||
|
||||
function MsgSortByUnread()
|
||||
{
|
||||
SortThreadPane('UnreadColumn', 'http://home.netscape.com/NC-rdf#TotalUnreadMessages','http://home.netscape.com/NC-rdf#Date', true, null);
|
||||
}
|
||||
|
||||
function MsgSortByOrderReceived()
|
||||
{
|
||||
SortThreadPane('OrderReceivedColumn', 'http://home.netscape.com/NC-rdf#OrderReceived','http://home.netscape.com/NC-rdf#Date', true, null);
|
||||
}
|
||||
|
||||
function MsgSortByRead()
|
||||
{
|
||||
SortThreadPane('UnreadButtonColumn', 'http://home.netscape.com/NC-rdf#HasUnreadMessages','http://home.netscape.com/NC-rdf#Date', true, null);
|
||||
}
|
||||
|
||||
function MsgSortByTotal()
|
||||
{
|
||||
SortThreadPane('TotalColumn', 'http://home.netscape.com/NC-rdf#TotalMessages', 'http://home.netscape.com/NC-rdf#Date', true, null);
|
||||
}
|
||||
|
||||
function MsgSortAscending()
|
||||
{
|
||||
dump("not implemented yet.\n");
|
||||
}
|
||||
function MsgSortDescending()
|
||||
|
||||
{
|
||||
dump("not implemented yet.\n");
|
||||
}
|
||||
|
||||
function MsgNextMessage()
|
||||
{
|
||||
|
@ -701,10 +632,6 @@ function MsgViewUnreadMsg()
|
|||
RefreshThreadTreeView();
|
||||
}
|
||||
|
||||
function MsgSortByThread()
|
||||
{
|
||||
ChangeThreadView()
|
||||
}
|
||||
|
||||
function FillInFolderTooltip(cellNode)
|
||||
{
|
||||
|
|
|
@ -42,6 +42,7 @@ CHROME_CONTENT = \
|
|||
.\messageWindow.js \
|
||||
.\folderPane.xul \
|
||||
.\threadPane.xul \
|
||||
.\threadPane.js \
|
||||
.\msgHdrViewOverlay.xul \
|
||||
.\msgHdrViewOverlay.js \
|
||||
.\msgHdrViewAddresses.js \
|
||||
|
|
|
@ -0,0 +1,167 @@
|
|||
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code, released
|
||||
* March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*/
|
||||
|
||||
function ThreadPaneOnClick(event)
|
||||
{
|
||||
var targetclass = event.target.getAttribute('class');
|
||||
debug('targetclass = ' + targetclass + '\n');
|
||||
|
||||
if (targetclass == 'tree-cell-twisty') {
|
||||
// The twisty is nested three below the treeitem:
|
||||
// <treeitem>
|
||||
// <treerow>
|
||||
// <treecell>
|
||||
// <titledbutton class="tree-cell-twisty"> <!-- anonymous -->
|
||||
var treeitem = event.target.parentNode.parentNode.parentNode;
|
||||
var open = treeitem.getAttribute('open');
|
||||
if(open == "true")
|
||||
{
|
||||
//open all of the children of the treeitem
|
||||
msgNavigationService.OpenTreeitemAndDescendants(treeitem);
|
||||
}
|
||||
}
|
||||
else if(event.detail == 2)
|
||||
{
|
||||
dump("Howdy partner.\n");
|
||||
ThreadPaneDoubleClick(event.target.parentNode.parentNode);
|
||||
}
|
||||
}
|
||||
|
||||
function ThreadPaneDoubleClick(treeitem)
|
||||
{
|
||||
if(IsSpecialFolderSelected("Drafts"))
|
||||
{
|
||||
var loadedFolder = GetLoadedMsgFolder();
|
||||
var messageArray = GetSelectedMessages();
|
||||
|
||||
ComposeMessage(msgComposeType.Draft, msgComposeFormat.Default, loadedFolder, messageArray);
|
||||
}
|
||||
else if(IsSpecialFolderSelected("Templates"))
|
||||
{
|
||||
var loadedFolder = GetLoadedMsgFolder();
|
||||
var messageArray = GetSelectedMessages();
|
||||
ComposeMessage(msgComposeType.Template, msgComposeFormat.Default, loadedFolder, messageArray);
|
||||
}
|
||||
else
|
||||
{
|
||||
var messageUri = treeitem.getAttribute("id");
|
||||
MsgOpenNewWindowForMessage(messageUri, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function MsgSortByDate()
|
||||
{
|
||||
SortThreadPane('DateColumn', 'http://home.netscape.com/NC-rdf#Date', null, true, null);
|
||||
}
|
||||
|
||||
function MsgSortBySender()
|
||||
{
|
||||
SortThreadPane('AuthorColumn', 'http://home.netscape.com/NC-rdf#Sender', 'http://home.netscape.com/NC-rdf#Date', true, null);
|
||||
}
|
||||
|
||||
function MsgSortByRecipient()
|
||||
{
|
||||
SortThreadPane('AuthorColumn', 'http://home.netscape.com/NC-rdf#Recipient', 'http://home.netscape.com/NC-rdf#Date', true, null);
|
||||
}
|
||||
|
||||
function MsgSortByStatus()
|
||||
{
|
||||
SortThreadPane('StatusColumn', 'http://home.netscape.com/NC-rdf#Status', 'http://home.netscape.com/NC-rdf#Date', true, null);
|
||||
}
|
||||
|
||||
function MsgSortBySubject()
|
||||
{
|
||||
SortThreadPane('SubjectColumn', 'http://home.netscape.com/NC-rdf#Subject', 'http://home.netscape.com/NC-rdf#Date', true, null);
|
||||
}
|
||||
|
||||
function MsgSortByFlagged()
|
||||
{
|
||||
SortThreadPane('FlaggedButtonColumn', 'http://home.netscape.com/NC-rdf#Flagged', 'http://home.netscape.com/NC-rdf#Date', true, null);
|
||||
}
|
||||
|
||||
function MsgSortByPriority()
|
||||
{
|
||||
SortThreadPane('PriorityColumn', 'http://home.netscape.com/NC-rdf#Priority', 'http://home.netscape.com/NC-rdf#Date',true, null);
|
||||
}
|
||||
|
||||
function MsgSortBySize()
|
||||
{
|
||||
SortThreadPane('SizeColumn', 'http://home.netscape.com/NC-rdf#Size', 'http://home.netscape.com/NC-rdf#Date', true, null);
|
||||
}
|
||||
|
||||
function MsgSortByUnread()
|
||||
{
|
||||
SortThreadPane('UnreadColumn', 'http://home.netscape.com/NC-rdf#TotalUnreadMessages','http://home.netscape.com/NC-rdf#Date', true, null);
|
||||
}
|
||||
|
||||
function MsgSortByOrderReceived()
|
||||
{
|
||||
SortThreadPane('OrderReceivedColumn', 'http://home.netscape.com/NC-rdf#OrderReceived','http://home.netscape.com/NC-rdf#Date', true, null);
|
||||
}
|
||||
|
||||
function MsgSortByRead()
|
||||
{
|
||||
SortThreadPane('UnreadButtonColumn', 'http://home.netscape.com/NC-rdf#HasUnreadMessages','http://home.netscape.com/NC-rdf#Date', true, null);
|
||||
}
|
||||
|
||||
function MsgSortByTotal()
|
||||
{
|
||||
SortThreadPane('TotalColumn', 'http://home.netscape.com/NC-rdf#TotalMessages', 'http://home.netscape.com/NC-rdf#Date', true, null);
|
||||
}
|
||||
|
||||
function MsgSortAscending()
|
||||
{
|
||||
dump("not implemented yet.\n");
|
||||
}
|
||||
function MsgSortDescending()
|
||||
|
||||
{
|
||||
dump("not implemented yet.\n");
|
||||
}
|
||||
|
||||
function MsgSortByThread()
|
||||
{
|
||||
ChangeThreadView()
|
||||
}
|
||||
|
||||
function ChangeThreadView()
|
||||
{
|
||||
var folder = GetSelectedFolder();
|
||||
|
||||
var threadColumn = document.getElementById('ThreadColumnHeader');
|
||||
if(threadColumn)
|
||||
{
|
||||
var currentView = threadColumn.getAttribute('currentView');
|
||||
if(currentView== 'threaded')
|
||||
{
|
||||
ShowThreads(false);
|
||||
if(folder)
|
||||
folder.setAttribute('threaded', "");
|
||||
}
|
||||
else if(currentView == 'unthreaded')
|
||||
{
|
||||
ShowThreads(true);
|
||||
if(folder)
|
||||
folder.setAttribute('threaded', "true");
|
||||
}
|
||||
RefreshThreadTreeView();
|
||||
}
|
||||
}
|
|
@ -30,7 +30,7 @@ Rights Reserved.
|
|||
>
|
||||
|
||||
<script src="chrome://global/content/treePopups.js"/>
|
||||
|
||||
<script src="chrome://messenger/content/threadPane.js"/>
|
||||
|
||||
|
||||
<tree datasources="rdf:null" id="threadTree"
|
||||
|
|
Загрузка…
Ссылка в новой задаче