Bug 289483: Add a <deck> for control of tbird display mode, for extension

and other use. r=mscott, a=caillon.
This commit is contained in:
shaver%mozilla.org 2005-04-20 14:55:03 +00:00
Родитель c76005a134
Коммит 7f75264704
4 изменённых файлов: 62 добавлений и 38 удалений

Просмотреть файл

@ -202,7 +202,7 @@ function ChangeFolderByURI(uri, viewType, viewFlags, sortType, sortOrder)
msgWindow.openFolder = null;
ClearThreadPane();
// Load AccountCentral page here.
ShowAccountCentral();
@ -218,16 +218,7 @@ function ChangeFolderByURI(uri, viewType, viewFlags, sortType, sortOrder)
}
// If the user clicks on msgfolder, time to display thread pane and message pane.
// Hide AccountCentral page
if (gAccountCentralLoaded)
{
HideAccountCentral();
}
if (gFakeAccountPageLoaded)
{
HideFakeAccountPage();
}
ShowThreadPane();
gCurrentLoadingFolderURI = uri;
gNextMessageAfterDelete = null; // forget what message to select, if any

Просмотреть файл

@ -511,11 +511,16 @@ function loadStartPage()
}
}
// Display AccountCentral page when users clicks on the Account Folder.
// When AccountCentral page need to be shown, we need to hide
// the box containing threadPane, splitter and messagePane.
// Load iframe in the AccountCentral box with corresponding page
function ShowAccountCentral()
{
document.getElementById("displayDeck").selectedPanel = accountCentralBox;
}
// When AccountCentral is shown via the displayDeck, we need to switch the
// displayDeck to show the accountCentralBox, collapse all the other
// UI elements that aren't meaningful for AccountCentral, and finally
// load the iframe in the AccountCentral box with corresponding page.
function ShowingAccountCentral()
{
try
{
@ -524,9 +529,6 @@ function ShowAccountCentral()
GetMessagePane().collapsed = true;
document.getElementById("threadpane-splitter").collapsed = true;
gSearchBox.collapsed = true;
GetThreadTree().collapsed = true;
document.getElementById("accountCentralBox").collapsed = false;
window.frames["accountCentralPane"].location = acctCentralPage;
@ -538,32 +540,57 @@ function ShowAccountCentral()
catch (ex)
{
dump("Error loading AccountCentral page -> " + ex + "\n");
return;
}
}
// Display thread and message panes with splitter when user tries
// to read messages by clicking on msgfolders. Hide AccountCentral
// box and display message box.
function HideAccountCentral()
function HidingAccountCentral()
{
try
{
window.frames["accountCentralPane"].location = "about:blank";
document.getElementById("accountCentralBox").collapsed = true;
GetThreadTree().collapsed = false;
gSearchBox.collapsed = false;
var threadPaneSplitter = document.getElementById("threadpane-splitter");
threadPaneSplitter.collapsed = false;
GetMessagePane().collapsed = threadPaneSplitter.getAttribute("state") == "collapsed";
gAccountCentralLoaded = false;
}
catch (ex)
{
dump("Error hiding AccountCentral page -> " + ex + "\n");
return;
}
gAccountCentralLoaded = false;
}
function ShowThreadPane()
{
document.getElementById("displayDeck").selectedPanel =
document.getElementById("threadPaneBox");
}
function ShowingThreadPane()
{
gSearchBox.collapsed = false;
var threadPaneSplitter = document.getElementById("threadpane-splitter");
threadPaneSplitter.collapsed = false;
GetMessagePane().collapsed =
(threadPaneSplitter.getAttribute("state") == "collapsed");
}
function HidingThreadPane()
{
ClearThreadPane();
}
function ObserveDisplayDeckChange(event)
{
var deck = document.getElementById("displayDeck");
var nowSelected = null;
try { nowSelected = deck.selectedPanel.id; } catch (ex) { }
if (nowSelected == "threadPaneBox")
ShowingThreadPane();
else
HidingThreadPane();
if (nowSelected == "accountCentralBox")
ShowingAccountCentral();
else
HidingAccountCentral();
}
// Given the server, open the twisty and the set the selection
@ -572,7 +599,7 @@ function HideAccountCentral()
function OpenInboxForServer(server)
{
try {
HideAccountCentral();
ShowThreadPane();
var inboxFolder = GetInboxFolder(server);
SelectFolder(inboxFolder.URI);

Просмотреть файл

@ -166,7 +166,7 @@
<toolbox id="mail-toolbox" class="toolbox-top">
</toolbox>
<!-- when we move to the alternate 3-pane, mailContentWrapper gets toggled to a vertical orientation -->
<box id="mailContentWrapper" orient="horizontal" flex="1">
@ -304,6 +304,9 @@
<box orient="vertical" id="messagesBox" flex="1">
<hbox id="messengerBox" flex="1" minheight="100" height="100" persist="height">
<deck id="displayDeck" flex="1" selectedIndex="0"
onselect="ObserveDisplayDeckChange(event)">
<!-- first panel is the threadPane -->
<vbox id="threadPaneBox" flex="1">
<tree id="threadTree" persist="lastfoldersent" flex="2" enableColumnDrag="true" _selectDelay="500" class="plain focusring" lastfoldersent="false"
disableKeyNavigation="true"
@ -374,10 +377,13 @@
</treecols>
<treechildren ondraggesture="BeginDragThreadPane(event);"/>
</tree>
<vbox id="accountCentralBox" flex="1" collapsed="true">
<iframe name="accountCentralPane" width="150" flex="1" src="about:blank"/>
</vbox>
</vbox>
<!-- second panel in displayDeck is Account Central -->
<vbox id="accountCentralBox" flex="1">
<iframe name="accountCentralPane" width="150" flex="1" src="about:blank"/>
</vbox>
<!-- extensions may overlay in additional panels; don't assume that there are only 2! -->
</deck> <!-- displayDeck -->
</hbox>
<!-- if you change this id, please change GetThreadAndMessagePaneSplitter() and MsgToggleMessagePane() -->

Просмотреть файл

@ -793,7 +793,7 @@ function delayedOnLoadMessenger()
CreateMailWindowGlobals();
verifyAccounts(null);
HideAccountCentral();
ShowThreadPane();
InitMsgWindow();
messenger.SetWindow(window, msgWindow);