This commit is contained in:
mscott%netscape.com 2003-03-28 03:57:09 +00:00
Родитель 9a4460838f
Коммит a89eaa1817
46 изменённых файлов: 0 добавлений и 15092 удалений

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

@ -1,284 +0,0 @@
var gMsgFolder;
var gServerTypeFolder = null;
var gPreselectedFolderURI = null;
var gParentMsgWindow = null;
// services used
var RDF;
// corresponds to MSG_FOLDER_FLAG_OFFLINE
const MSG_FOLDER_FLAG_OFFLINE = 0x8000000
// corresponds to MSG_FOLDER_FLAG_CHECK_NEW
const MSG_FOLDER_FLAG_CHECK_NEW = 0x20000000
// corresponds to MSG_FOLDER_FLAG_INBOX
const MSG_FOLDER_FLAG_INBOX = 0x1000
// The folderPropsSink is the class that gets notified of an imap folder's properties
var gFolderPropsSink = {
setFolderType: function(folderTypeString)
{
var typeLabel = document.getElementById("folderType.text");
if (typeLabel)
{
typeLabel.setAttribute("value",folderTypeString);
}
// get the element for the folder type label and set value on it.
},
setFolderTypeDescription: function(folderDescription)
{
var folderTypeLabel = document.getElementById("folderDescription.text");
if (folderTypeLabel)
folderTypeLabel.setAttribute("value", folderDescription);
},
setFolderPermissions: function(folderPermissions)
{
var permissionsLabel = document.getElementById("folderPermissions.text");
if (permissionsLabel)
permissionsLabel.setAttribute("value",folderPermissions);
},
serverDoesntSupportACL : function()
{
var typeLabel = document.getElementById("folderTypeLabel");
if (typeLabel)
typeLabel.setAttribute("hidden", "true");
var permissionsLabel = document.getElementById("permissionsDescLabel");
if (permissionsLabel)
permissionsLabel.setAttribute("hidden", "true");
}
};
function folderPropsOKButtonCallback()
{
if (gMsgFolder)
{
// set charset attributes
var folderCharsetList = document.getElementById("folderCharsetList");
gMsgFolder.charset = folderCharsetList.getAttribute("value");
gMsgFolder.charsetOverride = document.getElementById("folderCharsetOverride").checked;
if(document.getElementById("offline.selectForOfflineFolder").checked ||
document.getElementById("offline.selectForOfflineNewsgroup").checked)
gMsgFolder.setFlag(MSG_FOLDER_FLAG_OFFLINE);
else
gMsgFolder.clearFlag(MSG_FOLDER_FLAG_OFFLINE);
if(document.getElementById("folderCheckForNewMessages").checked)
gMsgFolder.setFlag(MSG_FOLDER_FLAG_CHECK_NEW);
else
gMsgFolder.clearFlag(MSG_FOLDER_FLAG_CHECK_NEW);
}
window.close();
}
function folderPropsOnLoad()
{
dump("folder props loaded"+'\n');
doSetOKCancel(folderPropsOKButtonCallback);
moveToAlertPosition();
RDF = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
// look in arguments[0] for parameters
if (window.arguments && window.arguments[0]) {
if ( window.arguments[0].title ) {
top.window.title = window.arguments[0].title;
}
if ( window.arguments[0].okCallback ) {
top.okCallback = window.arguments[0].okCallback;
}
}
// fill in folder name, based on what they selected in the folder pane
if (window.arguments[0].preselectedURI) {
try {
gPreselectedFolderURI = window.arguments[0].preselectedURI;
}
catch (ex) {
}
}
else {
dump("passed null for preselectedURI, do nothing\n");
}
if(window.arguments[0].name)
{
var name = document.getElementById("name");
name.value = window.arguments[0].name;
// name.setSelectionRange(0,-1);
// name.focusTextField();
}
gServerTypeFolder = window.arguments[0].serverType;
dump("preselectfolder uri = "+gPreselectedFolderURI+'\n');
dump("serverType = "+gServerTypeFolder+'\n');
if (window.arguments && window.arguments[0]) {
if (window.arguments[0].msgWindow) {
gParentMsgWindow = window.arguments[0].msgWindow;
}
}
// this hex value come from nsMsgFolderFlags.h
var folderResource = RDF.GetResource(gPreselectedFolderURI);
if(folderResource)
gMsgFolder = folderResource.QueryInterface(Components.interfaces.nsIMsgFolder);
if (!gMsgFolder)
dump("no gMsgFolder preselectfolder uri = "+gPreselectedFolderURI+'\n');
if (gMsgFolder) {
if (gMsgFolder.flags & MSG_FOLDER_FLAG_OFFLINE) {
if(gServerTypeFolder == "imap" || gServerTypeFolder == "pop3")
document.getElementById("offline.selectForOfflineFolder").checked = true;
if(gServerTypeFolder == "nntp")
document.getElementById("offline.selectForOfflineNewsgroup").checked = true;
}
else {
if(gServerTypeFolder == "imap" || gServerTypeFolder == "pop3")
document.getElementById("offline.selectForOfflineFolder").checked = false;
if(gServerTypeFolder == "nntp")
document.getElementById("offline.selectForOfflineNewsgroup").checked = false;
}
// select the menu item
var folderCharsetList = document.getElementById("folderCharsetList");
var elements = folderCharsetList.getElementsByAttribute("value", gMsgFolder.charset);
folderCharsetList.selectedItem = elements[0];
// set override checkbox
document.getElementById("folderCharsetOverride").checked = gMsgFolder.charsetOverride;
// set check for new mail checkbox
document.getElementById("folderCheckForNewMessages").checked = gMsgFolder.flags & MSG_FOLDER_FLAG_CHECK_NEW;
}
if (gServerTypeFolder == "imap")
{
var imapFolder = gMsgFolder.QueryInterface(Components.interfaces.nsIMsgImapMailFolder);
if (imapFolder)
imapFolder.fillInFolderProps(gFolderPropsSink);
}
// select the initial tab
if (window.arguments[0].tabID) {
// set index for starting panel on the <tabpanel> element
var folderPropTabPanel = document.getElementById("folderPropTabPanel");
folderPropTabPanel.setAttribute("selectedIndex", window.arguments[0].tabIndex);
try {
var tab = document.getElementById(window.arguments[0].tabID);
tab.setAttribute("selected", "true");
}
catch (ex) {}
}
hideShowControls(gServerTypeFolder);
}
function hideShowControls(serverType)
{
var controls = document.getElementsByAttribute("hidable", "true");
var len = controls.length;
for (var i=0; i<len; i++) {
var control = controls[i];
var hideFor = control.getAttribute("hidefor");
if (!hideFor)
throw "this should not happen, things that are hidable should have hidefor set";
var box = getEnclosingContainer(control);
if (!box)
throw "this should not happen, things that are hidable should be in a box";
// hide unsupported server type
// adding support for hiding multiple server types using hideFor="server1,server2"
var hideForBool = false;
var hideForTokens = hideFor.split(",");
for (var j = 0; j < hideForTokens.length; j++) {
if (hideForTokens[j] == serverType) {
hideForBool = true;
break;
}
}
if (hideForBool) {
box.setAttribute("hidden", "true");
}
else {
box.removeAttribute("hidden");
}
}
// hide the priviliges button if the imap folder doesn't have an admin url
// mabye should leave this hidden by default and only show it in this case instead
var imapFolder = gMsgFolder.QueryInterface(Components.interfaces.nsIMsgImapMailFolder);
if (imapFolder)
{
var privilegesButton = document.getElementById("imap.FolderPrivileges");
if (privilegesButton)
{
if (!imapFolder.hasAdminUrl)
privilegesButton.setAttribute("hidden", "true");
}
}
// hide "check for new mail" checkbox if this is inbox
if (gMsgFolder)
{
if (gMsgFolder.flags & MSG_FOLDER_FLAG_INBOX)
{
document.getElementById("folderCheckForNewMessages").setAttribute("hidden", "true");
}
}
}
function getEnclosingContainer(startNode)
{
var parent = startNode;
var box;
while (parent && parent != document)
{
var isContainer = (parent.getAttribute("iscontrolcontainer") == "true");
// remember the FIRST container we encounter, or the first controlcontainer
if (!box || isContainer) box=parent;
// break out with a controlcontainer
if (isContainer) break;
parent = parent.parentNode;
}
return box;
}
function onOfflineFolderDownload()
{
// we need to create a progress window and pass that in as the second parameter here.
gMsgFolder.downloadAllForOffline(null, gParentMsgWindow);
}
function onFolderPrivileges()
{
var imapFolder = gMsgFolder.QueryInterface(Components.interfaces.nsIMsgImapMailFolder);
if (imapFolder)
imapFolder.folderPrivileges(gParentMsgWindow);
// let's try closing the modal dialog to see if it fixes the various problems running this url
window.close();
}

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

@ -1,113 +0,0 @@
<?xml version="1.0"?> <!-- -*- Mode: SGML; indent-tabs-mode: nil; -*- -->
<!--
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.org code.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 2000 Netscape Communications Corporation. All
Rights Reserved.
- Contributor(s): David Bienvenu <bienvenu@netscape.com>
Doron Rosenberg <doronr@naboonline.com>
-->
<?xml-stylesheet href="chrome://messenger/skin/dialogs.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://messenger/locale/folderProps.dtd">
<window
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&folderProps.windowtitle.label;"
onload="folderPropsOnLoad()" style="width: 36em;"
class="dialog">
<script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"></script>
<script type="application/x-javascript" src="chrome://messenger/content/folderProps.js"></script>
<script type="application/x-javascript">
<![CDATA[
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
observerService.notifyObservers(null, "charsetmenu-selected", "other");
]]>
</script>
<keyset id="dialogKeys"/>
<tabbox>
<tabs>
<tab id="GeneralTab" label="&generalInfo.label;"/>
<tab hidefor="pop3,none" hidable="true" id="OfflineTab" label="&folderOfflineTab.label;"/>
<tab hidefor="pop3,none,nntp" hidable="true" id="SharingTab" label="&folderSharingTab.label;"/>
</tabs>
<tabpanels id="folderPropTabPanel">
<vbox>
<hbox id="nameBox" align="center">
<label value="&folderProps.name.label;" for="name"/>
<textbox id="name" readonly="true" flex="1"/>
</hbox>
<vbox>
<hbox align="center" valign="middle">
<label value="&folderCharsetTab.label;" control="folderCharSetList"/>
<menulist id="folderCharsetList" ref="NC:DecodersRoot" datasources="rdf:charset-menu">
<template>
<menupopup>
<menuitem label="rdf:http://home.netscape.com/NC-rdf#Name" value="..." uri="..."/>
</menupopup>
</template>
</menulist>
</hbox>
<checkbox class="indent" id="folderCharsetOverride" label="&folderCharsetOverride.label;" />
<checkbox hidable="true" hidefor="pop3,none,nntp"
class="indent" id="folderCheckForNewMessages"
label="&folderCheckForNewMessages.label;" />
</vbox>
</vbox>
<vbox hidable="true" hidefor="pop3,none" valign="top" align="start">
<vbox>
<checkbox iscontrolcontainer="true" hidable="true"
wsm_persist="true" id="offline.selectForOfflineFolder"
hidefor="nntp" label="&offlineFolder.check.label;" />
<checkbox iscontrolcontainer="true" hidable="true"
wsm_persist="true" id="offline.selectForOfflineNewsgroup"
hidefor="imap" label="&selectofflineNewsgroup.check.label;" />
</vbox>
<button iscontrolcontainer="true" hidable="true" label="&offlineFolder.button.label;"
oncommand="onOfflineFolderDownload();"
id="offline.offlineFolderDownloadButton" hidefor="nntp" orient="right"/>
<button iscontrolcontainer="true" hidable="true" label="&offlineNewsgroup.button.label;"
oncommand="onOfflineFolderDownload();"
id="offline.offlineNewsgroupDownloadButton" hidefor="imap" orient="right"/>
</vbox>
<vbox hidable="true" hidefor="pop3,none,nntp" valign="top" align="start">
<hbox>
<label value="&folderType.label;" id="folderTypeLabel"/>
<label value="" id="folderType.text"/>
</hbox>
<label value="" id="folderDescription.text"/>
<label value=" " />
<label value="&permissionsDesc.label;" id="permissionsDescLabel"/>
<label value="" id="folderPermissions.text"/>
<spacer flex="100%"/>
<button iscontrolcontainer="true" hidable="true" label="&privileges.button.label;"
oncommand="onFolderPrivileges();"
id="imap.FolderPrivileges" hidefor="pop3,none,nntp" orient="right"/>
</vbox>
</tabpanels>
</tabbox>
<hbox align="right" id="okCancelButtonsRight"/>
</window>

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

@ -1,254 +0,0 @@
/* -*- Mode: C++; 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-2001 Netscape Communications Corporation. All
* Rights Reserved.
*/
var gMailOfflinePrefs = null;
var gOfflinePromptsBundle;
var gPromptService;
var gOfflineManager;
function MailOfflineStateChanged(goingOffline)
{
// tweak any mail UI here that needs to change when we go offline or come back online
gFolderJustSwitched = true;
}
function MsgSettingsOffline()
{
window.parent.MsgAccountManager('am-offline.xul');
}
// Init PrefsService
function GetMailOfflinePrefs()
{
// Store the prefs object
try {
var prefsService = Components.classes["@mozilla.org/preferences-service;1"];
if (prefsService)
prefsService = prefsService.getService();
if (prefsService)
gMailOfflinePrefs = prefsService.QueryInterface(Components.interfaces.nsIPrefBranch);
if (!gMailOfflinePrefs)
dump("failed to get prefs service!\n");
}
catch(ex) {
dump("failed to get prefs service!\n");
}
}
// Check for unsent messages
function CheckForUnsentMessages()
{
try
{
var am = Components.classes["@mozilla.org/messenger/account-manager;1"]
.getService(Components.interfaces.nsIMsgAccountManager);
var msgSendlater = Components.classes["@mozilla.org/messengercompose/sendlater;1"]
.getService(Components.interfaces.nsIMsgSendLater);
var identitiesCount, allIdentities, currentIdentity, numMessages, msgFolder;
if(am) {
allIdentities = am.allIdentities;
identitiesCount = allIdentities.Count();
for (var i = 0; i < identitiesCount; i++) {
currentIdentity = allIdentities.QueryElementAt(i, Components.interfaces.nsIMsgIdentity);
msgFolder = msgSendlater.getUnsentMessagesFolder(currentIdentity);
if(msgFolder) {
// if true, descends into all subfolders
numMessages = msgFolder.getTotalMessages(false);
if(numMessages > 0) return true;
}
}
}
}
catch(ex) {
}
return false;
}
// Init nsIPromptService & strings.
function InitPrompts()
{
if(!gPromptService) {
gPromptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService();
gPromptService = gPromptService.QueryInterface(Components.interfaces.nsIPromptService);
}
if (!gOfflinePromptsBundle)
gOfflinePromptsBundle = document.getElementById("bundle_offlinePrompts");
}
// prompt for sending messages while going online, and go online.
function PromptSendMessages()
{
InitPrompts();
InitServices();
if (gPromptService) {
var checkValue = {value:true};
var buttonPressed = gPromptService.confirmEx(window,
gOfflinePromptsBundle.getString('sendMessagesWindowTitle'),
gOfflinePromptsBundle.getString('sendMessagesLabel'),
gPromptService.BUTTON_TITLE_IS_STRING * (gPromptService.BUTTON_POS_0 +
gPromptService.BUTTON_POS_1 + gPromptService.BUTTON_POS_2),
gOfflinePromptsBundle.getString('sendMessagesSendButtonLabel'),
gOfflinePromptsBundle.getString('sendMessagesCancelButtonLabel'),
gOfflinePromptsBundle.getString('sendMessagesNoSendButtonLabel'),
gOfflinePromptsBundle.getString('sendMessagesCheckboxLabel'),
checkValue);
if(buttonPressed == 0) {
gMailOfflinePrefs.setIntPref("offline.send.unsent_messages", !checkValue.value);
gOfflineManager.goOnline(true, true, msgWindow);
return true;
}
if(buttonPressed == 1) {
return false;
}
if(buttonPressed == 2) {
gMailOfflinePrefs.setIntPref("offline.send.unsent_messages", 2*!checkValue.value);
gOfflineManager.goOnline(false, true, msgWindow);
return true;
}
}
return false;
}
// prompt for downlading messages while going offline, and synchronise
function PromptDownloadMessages()
{
InitPrompts();
InitServices();
if(gPromptService) {
var checkValue = {value:true};
var buttonPressed = gPromptService.confirmEx(window,
gOfflinePromptsBundle.getString('downloadMessagesWindowTitle'),
gOfflinePromptsBundle.getString('downloadMessagesLabel'),
gPromptService.BUTTON_TITLE_IS_STRING * (gPromptService.BUTTON_POS_0 +
gPromptService.BUTTON_POS_1 + gPromptService.BUTTON_POS_2),
gOfflinePromptsBundle.getString('downloadMessagesDownloadButtonLabel'),
gOfflinePromptsBundle.getString('downloadMessagesCancelButtonLabel'),
gOfflinePromptsBundle.getString('downloadMessagesNoDownloadButtonLabel'),
gOfflinePromptsBundle.getString('downloadMessagesCheckboxLabel'),
checkValue);
if(buttonPressed == 0) {
gMailOfflinePrefs.setIntPref("offline.download.download_messages", !checkValue.value);
gOfflineManager.synchronizeForOffline(true, true, false, true, msgWindow);
return true;
}
if(buttonPressed == 1) {
return false;
}
if(buttonPressed == 2) {
gMailOfflinePrefs.setIntPref("offline.download.download_messages", 2*!checkValue.value);
gOfflineManager.synchronizeForOffline(false, false, false, true, msgWindow);
return true;
}
}
return false;
}
// online?
function CheckOnline()
{
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
return (!ioService.offline);
}
// Init Pref Service & Offline Manager
function InitServices()
{
if (!gMailOfflinePrefs)
GetMailOfflinePrefs();
if (!gOfflineManager)
GetOfflineMgrService();
}
// Init Offline Manager
function GetOfflineMgrService()
{
if (!gOfflineManager) {
gOfflineManager = Components.classes["@mozilla.org/messenger/offline-manager;1"]
.getService(Components.interfaces.nsIMsgOfflineManager);
}
}
// This function must always return false to prevent toggling of offline state because
// we change the offline state ourselves
function MailCheckBeforeOfflineChange()
{
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
var goingOnline = ioService.offline;
var bundle = srGetStrBundle("chrome://communicator/locale/utilityOverlay.properties");
// messenger.SetWindow(window, msgWindow);
InitServices();
var prefSendUnsentMessages = gMailOfflinePrefs.getIntPref("offline.send.unsent_messages");
var prefDownloadMessages = gMailOfflinePrefs.getIntPref("offline.download.download_messages");
if(goingOnline) {
switch(prefSendUnsentMessages) {
case 0:
if(CheckForUnsentMessages()) {
if(! PromptSendMessages())
return false;
}
else
gOfflineManager.goOnline(false /* sendUnsentMessages */,
true /* playbackOfflineImapOperations */,
msgWindow);
break;
case 1:
gOfflineManager.goOnline(CheckForUnsentMessages() /* sendUnsentMessages */,
true /* playbackOfflineImapOperations */,
msgWindow);
break;
case 2:
gOfflineManager.goOnline(false /* sendUnsentMessages */,
true /* playbackOfflineImapOperations */,
msgWindow);
break;
}
}
else {
// going offline
switch(prefDownloadMessages) {
case 0:
if(! PromptDownloadMessages()) return false;
break;
case 1:
// download news, download mail, send unsent messages, go offline when done, msg window
gOfflineManager.synchronizeForOffline(true, true, false, true, msgWindow);
break;
case 2:
// download news, download mail, send unsent messages, go offline when done, msg window
gOfflineManager.synchronizeForOffline(false, false, false, true, msgWindow);
break;
}
}
return false;
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -1,197 +0,0 @@
<?xml version="1.0"?>
<!--
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.
-->
<?xml-stylesheet href="chrome://messenger/skin/mailWindow2.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/platformMailnewsOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/threadPane.xul"?>
<?xul-overlay href="chrome://messenger/content/folderPane.xul"?>
<?xul-overlay href="chrome://messenger/content/msgHdrViewOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/mailWindowOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/mailOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/contentAreaContextOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/tasksOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/communicatorOverlay.xul"?>
<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
%brandDTD;
<!ENTITY % messengerDTD SYSTEM "chrome://messenger/locale/messenger.dtd" >
%messengerDTD;
]>
<window id="messengerWindow"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:nc="http://home.netscape.com/NC-rdf#"
title="&messengerWindow.title;"
titlemodifier="&titleModifier.label;"
titlemenuseparator="&titleSeparator.label;"
onload="OnLoadMessenger()"
onunload="OnUnloadMessenger()"
width="750"
height="500"
screenX="10" screenY="10"
persist="width height screenX screenY sizemode"
windowtype="mail:3pane">
<stringbundleset id="stringbundleset">
<stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
<stringbundle id="bundle_brand" src="chrome://global/locale/brand.properties"/>
<stringbundle id="bundle_search" src="chrome://messenger/locale/search.properties"/>
</stringbundleset>
<script type="application/x-javascript" src="chrome://messenger/content/widgetglue.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/commandglue.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/shareglue.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/msgViewNavigation.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/mailWindow.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/msgMail3PaneWindow.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/mail3PaneWindowCommands.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/mailContextMenus.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/messengerdnd.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/accountUtils.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/mail-offline.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/contentAreaClick.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsTransferable.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/searchBar.js"/>
<commandset id="mailCommands">
<commandset id="mailFileMenuItems"/>
<commandset id="mailViewMenuItems"/>
<commandset id="mailEditMenuItems"/>
<commandset id="mailEditContextMenuItems"/>
<commandset id="mailSearchMenuItems"/>
<commandset id="mailGoMenuItems"/>
<commandset id="mailMessageMenuItems"/>
<commandset id="mailToolbarItems"/>
<commandset id="mailGetMsgMenuItems"/>
<commandset id="mailMarkMenuItems"/>
<commandset id="mailLabelMenuItems"/>
<commandset id="globalEditMenuItems"/>
<commandset id="selectEditMenuItems"/>
<commandset id="clipboardEditMenuItems"/>
<commandset id="FocusRingUpdate_Mail"
commandupdater="true"
events="focus"
oncommandupdate="FocusRingUpdate_Mail()"/>
<commandset id="tasksCommands"/>
<command id="toggleSidebar"/>
</commandset>
<broadcasterset id="mailBroadcasters">
<!-- File Menu -->
<broadcaster id="Communicator:WorkMode"/>
<!-- Edit Menu -->
</broadcasterset>
<keyset id="mailKeys">
<key id="showHideSidebar"/>
<keyset id="tasksKeys"/>
</keyset>
<popup id="threadPaneContext"/>
<popup id="folderPaneContext"/>
<popup id="attachmentListContext"/>
<tooltip id="attachmentListTooltip"/>
<popup id="emailAddressPopup" popupanchor="bottomleft" onpopupshowing="goUpdateCommand('cmd_createFilterFromPopup')">
<menuitem label="&AddToAddressBook.label;"
accesskey="&AddToAddressBook.accesskey;"
oncommand="AddNodeToAddressBook(document.popupNode)"/>
<menuitem label="&SendMailTo.label;"
accesskey="&SendMailTo.accesskey;"
oncommand="SendMailToNode(document.popupNode)"/>
<menuitem label="&CopyEmailAddress.label;"
accesskey="&CopyEmailAddress.accesskey;"
oncommand="CopyEmailAddress(document.popupNode)"/>
<menuitem label="&CreateFilter.label;"
accesskey="&CreateFilter.accesskey;"
oncommand="CreateFilter(document.popupNode)"
observes="cmd_createFilterFromPopup"/>
</popup>
<popup id="allHeadersPopup" onpopupshowing="return fillAllHeadersPopup(document.popupNode);" popupanchor="bottomleft">
<hbox id="allHeadersPopupContainer">
</hbox>
</popup>
<popup id="messagePaneContext"/>
<toolbox id="mailToolbarToolbox" class="toolbox-top">
<menubar id="mailMenubar"/>
</toolbox>
<!-- The main mail three pane frame -->
<hbox style="height:100px" flex="1">
<vbox flex="1">
<hbox id="mail3PaneVertLayoutBox" persist="collapsed height" flex="1">
<vbox id="folderPaneBox" flex="1" autostretch="always" persist="width">
<tree id="folderTree" flex="1" style="min-width: 100px;" context="folderPaneContext" persist="collapsed width height"/>
</vbox>
<splitter id="gray_vertical_splitter" collapse="before" persist="state">
<grippy/>
</splitter>
<hbox id="messengerBox" persist="collapsed width" flex="2">
<vbox id="searchAndthreadpaneBox" persist="width" flex ="1">
<vbox id="messagesBox" flex="1">
<hbox id="searchBox"/>
<vbox id="threadpaneBox" flex="1" persist="width">
<tree id="threadTree" flex="1" persist="width" style="width:0px" context="threadPaneContext"/>
</vbox>
</vbox>
</vbox>
<hbox id="accountCentralBox" flex="1" persist="width">
<iframe name="accountCentralPane" style="width:0px;" flex="1" src="about:blank"/>
</hbox>
</hbox>
</hbox>
<!-- if you change this id, please change GetThreadAndMessagePaneSplitter() and MsgToggleMessagePane() -->
<splitter id="threadpane-splitter" collapse="after" persist="state"
onmouseup="OnMouseUpThreadAndMessagePaneSplitter()">
<grippy onclick="OnClickThreadAndMessagePaneSplitterGrippy()"/>
</splitter>
<!-- msg header view -->
<vbox id="messagepanebox" flex="4" persist="collapsed height">
<hbox id="msgHeaderView"/>
<!-- message view -->
<browser id="messagepane" context="messagePaneContext"
style="height: 0px; min-height: 1px" flex="1" name="messagepane"
disablehistory="true" type="content-primary" src="about:blank"
disablesecurity="true" onclick="contentAreaClick(event);"/>
</vbox>
</vbox>
</hbox>
<statusbar id="status-bar" class="mailwindow-statusbar">
<statusbarpanel id="unreadMessageCount" style="min-width: 5px"/>
<statusbarpanel id="totalMessageCount" style="min-width: 5px"/>
</statusbar>
</window>

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

@ -1,22 +0,0 @@
<?xml version="1.0"?>
<!-- platform specific commands -->
<?xul-overlay href="chrome://messenger/content/platformMailOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://messenger/locale/mailOverlay.dtd">
<overlay id="mailABOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<commandset id="tasksCommands">
<command id="cmd_newMessage" oncommand="AbNewMessage();"/>
</commandset>
<menupopup id="menu_NewPopup">
<menuitem id="menu_newMessage" position="6" label="&newMessageCmd.label;" key="key_newMessage" accesskey="&newMessageCmd.accesskey;" command="cmd_newMessage"/>
</menupopup>
<keyset id="tasksKeys">
<key id="key_newMessage" key="&newMessageCmd.key;" command="cmd_newMessage" modifiers="accel"/>
</keyset>
</overlay>

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

@ -1,632 +0,0 @@
/* -*- Mode: C++; 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 DoRDFCommand(dataSource, command, srcArray, argumentArray)
{
var commandResource = RDF.GetResource(command);
if(commandResource) {
try {
dataSource.DoCommand(srcArray, commandResource, argumentArray);
}
catch(e) {
if (command == "http://home.netscape.com/NC-rdf#NewFolder") {
throw(e); // so that the dialog does not automatically close.
}
dump("Exception : In mail commands\n");
}
}
}
function ConvertMessagesToResourceArray(messages, resourceArray)
{
dump("fix or remove this\n");
// going away...
}
function GetNewMessages(selectedFolders, compositeDataSource)
{
var numFolders = selectedFolders.length;
if(numFolders > 0)
{
var msgFolder = selectedFolders[0];
//Whenever we do get new messages, clear the old new messages.
if(msgFolder)
{
var nsIMsgFolder = Components.interfaces.nsIMsgFolder;
msgFolder.biffState = nsIMsgFolder.nsMsgBiffState_NoMail;
if (msgFolder.hasNewMessages)
msgFolder.clearNewMessages();
}
if(compositeDataSource)
{
var folderResource = msgFolder.QueryInterface(Components.interfaces.nsIRDFResource);
var folderArray = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray);
folderArray.AppendElement(folderResource);
DoRDFCommand(compositeDataSource, "http://home.netscape.com/NC-rdf#GetNewMessages", folderArray, null);
}
}
else {
dump("Nothing was selected\n");
}
}
function DeleteMessages(compositeDataSource, srcFolder, messages, reallyDelete)
{
dump("fix or remove this\n");
// going away...
}
function CopyMessages(compositeDataSource, srcFolder, destFolder, messages, isMove)
{
dump("fix or remove this\n");
// going away...
}
function getIdentityForServer(server)
{
var identity = null;
if(server) {
// get the identity associated with this server
var identities = accountManager.GetIdentitiesForServer(server);
// dump("identities = " + identities + "\n");
// just get the first one
if (identities.Count() > 0 ) {
identity = identities.GetElementAt(0).QueryInterface(Components.interfaces.nsIMsgIdentity);
}
}
return identity;
}
function GetNextNMessages(folder)
{
if (folder) {
var newsFolder = folder.QueryInterface(Components.interfaces.nsIMsgNewsFolder);
if (newsFolder) {
newsFolder.getNextNMessages(msgWindow);
}
}
}
// type is a nsIMsgCompType and format is a nsIMsgCompFormat
function ComposeMessage(type, format, folder, messageArray)
{
var msgComposeType = Components.interfaces.nsIMsgCompType;
var identity = null;
var newsgroup = null;
var server;
//dump("ComposeMessage folder="+folder+"\n");
try
{
if(folder)
{
// get the incoming server associated with this uri
server = folder.server;
// if they hit new or reply and they are reading a newsgroup
// turn this into a new post or a reply to group.
if (!folder.isServer && server.type == "nntp" && type == msgComposeType.New)
{
type = msgComposeType.NewsPost;
newsgroup = folder.folderURL;
}
identity = getIdentityForServer(server);
// dump("identity = " + identity + "\n");
}
}
catch (ex)
{
dump("failed to get an identity to pre-select: " + ex + "\n");
}
//dump("\nComposeMessage from XUL: " + identity + "\n");
var uri = null;
if (! msgComposeService)
{
dump("### msgComposeService is invalid\n");
return;
}
if (type == msgComposeType.New) //new message
{
//dump("OpenComposeWindow with " + identity + "\n");
// if the addressbook sidebar panel is open and has focus, get
// the selected addresses from it
if (document.commandDispatcher.focusedWindow.document.documentElement.hasAttribute("selectedaddresses"))
NewMessageToSelectedAddresses(type, format, identity);
else
msgComposeService.OpenComposeWindow(null, null, type, format, identity, msgWindow);
return;
}
else if (type == msgComposeType.NewsPost)
{
//dump("OpenComposeWindow with " + identity + " and " + newsgroup + "\n");
msgComposeService.OpenComposeWindow(null, newsgroup, type, format, identity, msgWindow);
return;
}
messenger.SetWindow(window, msgWindow);
var object = null;
if (messageArray && messageArray.length > 0)
{
uri = "";
for (var i = 0; i < messageArray.length; i ++)
{
var messageUri = messageArray[i];
if (type == msgComposeType.Reply || type == msgComposeType.ReplyAll || type == msgComposeType.ForwardInline ||
type == msgComposeType.ReplyToGroup || type == msgComposeType.ReplyToSender ||
type == msgComposeType.ReplyToSenderAndGroup ||
type == msgComposeType.Template || type == msgComposeType.Draft)
{
msgComposeService.OpenComposeWindow(null, messageUri, type, format, identity, msgWindow);
//limit the number of new compose windows to 8. Why 8? I like that number :-)
if (i == 7)
break;
}
else
{
if (i)
uri += ","
uri += messageUri;
}
}
if (type == msgComposeType.ForwardAsAttachment)
msgComposeService.OpenComposeWindow(null, uri, type, format, identity, msgWindow);
}
else
dump("### nodeList is invalid\n");
}
function NewMessageToSelectedAddresses(type, format, identity) {
var abSidebarPanel = document.commandDispatcher.focusedWindow;
var abResultsTree = abSidebarPanel.document.getElementById("abResultsTree");
var abResultsBoxObject = abResultsTree.treeBoxObject;
var abView = abResultsBoxObject.view;
abView = abView.QueryInterface(Components.interfaces.nsIAbView);
var addresses = abView.selectedAddresses;
var params = Components.classes["@mozilla.org/messengercompose/composeparams;1"].createInstance(Components.interfaces.nsIMsgComposeParams);
if (params) {
params.type = type;
params.format = format;
params.identity = identity;
var composeFields = Components.classes["@mozilla.org/messengercompose/composefields;1"].createInstance(Components.interfaces.nsIMsgCompFields);
if (composeFields) {
var addressList = "";
for (var i = 0; i < addresses.Count(); i++) {
addressList = addressList + (i > 0 ? ",":"") + addresses.QueryElementAt(i,Components.interfaces.nsISupportsString).data;
}
composeFields.to = addressList;
params.composeFields = composeFields;
msgComposeService.OpenComposeWindowWithParams(null, params);
}
}
}
function CreateNewSubfolder(chromeWindowURL, preselectedMsgFolder,
dualUseFolders, callBackFunctionName)
{
var preselectedURI;
if(preselectedMsgFolder)
{
var preselectedFolderResource = preselectedMsgFolder.QueryInterface(Components.interfaces.nsIRDFResource);
if(preselectedFolderResource)
preselectedURI = preselectedFolderResource.Value;
dump("preselectedURI = " + preselectedURI + "\n");
}
var dialog = window.openDialog(
chromeWindowURL,
"",
"chrome,titlebar,modal",
{preselectedURI:preselectedURI,
dualUseFolders:dualUseFolders,
okCallback:callBackFunctionName});
}
function NewFolder(name,uri)
{
//dump("uri,name = " + uri + "," + name + "\n");
if (uri && (uri != "") && name && (name != "")) {
var selectedFolderResource = RDF.GetResource(uri);
//dump("selectedFolder = " + uri + "\n");
var compositeDataSource = GetCompositeDataSource("NewFolder");
var folderArray = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray);
var nameArray = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray);
folderArray.AppendElement(selectedFolderResource);
var nameLiteral = RDF.GetLiteral(name);
nameArray.AppendElement(nameLiteral);
DoRDFCommand(compositeDataSource, "http://home.netscape.com/NC-rdf#NewFolder", folderArray, nameArray);
}
else {
dump("no name or nothing selected\n");
}
}
function UnSubscribe(folder)
{
// Unsubscribe the current folder from the newsserver, this assumes any confirmation has already
// been made by the user SPL
var server = folder.server;
var subscribableServer = server.QueryInterface(Components.interfaces.nsISubscribableServer);
subscribableServer.unsubscribe(folder.name);
subscribableServer.commitSubscribeChanges();
}
function Subscribe(preselectedMsgFolder)
{
var preselectedURI;
if(preselectedMsgFolder)
{
var preselectedFolderResource = preselectedMsgFolder.QueryInterface(Components.interfaces.nsIRDFResource);
if(preselectedFolderResource)
preselectedURI = preselectedFolderResource.Value;
dump("preselectedURI = " + preselectedURI + "\n");
}
window.openDialog("chrome://messenger/content/subscribe.xul",
"subscribe", "chrome,modal,titlebar,resizable=yes",
{preselectedURI:preselectedURI,
okCallback:SubscribeOKCallback});
}
function SubscribeOKCallback(changeTable)
{
for (var serverURI in changeTable) {
var folder = GetMsgFolderFromUri(serverURI, true);
var server = folder.server;
var subscribableServer =
server.QueryInterface(Components.interfaces.nsISubscribableServer);
for (var name in changeTable[serverURI]) {
if (changeTable[serverURI][name] == true) {
try {
subscribableServer.subscribe(name);
}
catch (ex) {
dump("failed to subscribe to " + name + ": " + ex + "\n");
}
}
else if (changeTable[serverURI][name] == false) {
try {
subscribableServer.unsubscribe(name);
}
catch (ex) {
dump("failed to unsubscribe to " + name + ": " + ex + "\n");
}
}
else {
// no change
}
}
try {
subscribableServer.commitSubscribeChanges();
}
catch (ex) {
dump("failed to commit the changes: " + ex + "\n");
}
}
}
function SaveAsFile(uri)
{
if (uri) messenger.saveAs(uri, true, null, msgWindow);
}
function SaveAsTemplate(uri, folder)
{
if (uri) {
var identity = getIdentityForServer(folder.server);
messenger.saveAs(uri, false, identity, msgWindow);
}
}
function MarkSelectedMessagesRead(markRead)
{
gDBView.doCommand(markRead ? nsMsgViewCommandType.markMessagesRead : nsMsgViewCommandType.markMessagesUnread);
}
function MarkSelectedMessagesFlagged(markFlagged)
{
gDBView.doCommand(markFlagged ? nsMsgViewCommandType.flagMessages : nsMsgViewCommandType.unflagMessages);
}
function MarkAllMessagesRead(compositeDataSource, folder)
{
var folderResource = folder.QueryInterface(Components.interfaces.nsIRDFResource);
var folderArray = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray);
folderArray.AppendElement(folderResource);
DoRDFCommand(compositeDataSource, "http://home.netscape.com/NC-rdf#MarkAllMessagesRead", folderArray, null);
}
function DownloadFlaggedMessages(compositeDataSource, folder)
{
dump("fix DownloadFlaggedMessages()\n");
}
function DownloadSelectedMessages(compositeDataSource, messages, markFlagged)
{
dump("fix DownloadSelectedMessages()\n");
}
function ViewPageSource(messages)
{
var numMessages = messages.length;
if (numMessages == 0)
{
dump("MsgViewPageSource(): No messages selected.\n");
return false;
}
try {
// First, get the mail session
const mailSessionContractID = "@mozilla.org/messenger/services/session;1";
const nsIMsgMailSession = Components.interfaces.nsIMsgMailSession;
var mailSession = Components.classes[mailSessionContractID].getService(nsIMsgMailSession);
var mailCharacterSet = "charset=" + msgWindow.mailCharacterSet;
for (var i = 0; i < numMessages; i++)
{
// Now, we need to get a URL from a URI
var url = mailSession.ConvertMsgURIToMsgURL(messages[i], msgWindow);
window.openDialog( "chrome://navigator/content/viewSource.xul",
"_blank",
"scrollbars,resizable,chrome,dialog=no",
url,
mailCharacterSet);
}
return true;
} catch (e) {
// Couldn't get mail session
return false;
}
}
function doHelpButton()
{
openHelp("mail-offline-items");
}
// XXX The following junkmail code might be going away or changing
var gJunkmailComponent;
function getJunkmailComponent()
{
if (!gJunkmailComponent) {
gJunkmailComponent = Components.classes['@mozilla.org/messenger/filter-plugin;1?name=junkmail']
.getService(Components.interfaces.nsISupports).wrappedJSObject;
gJunkmailComponent.initComponent();
}
}
function analyze(aMessage, aNextFunction)
{
function callback(aScore) {
}
callback.prototype =
{
onMessageScored: function processNext(aScore)
{
if (aMessage) {
//if (aScore == -1) debugger;
if (aScore == 0) {
aMessage.setStringProperty("score", "0");
}
else if (aScore == 1) {
aMessage.setStringProperty("score", "100");
}
}
aNextFunction();
}
};
// XXX TODO jumping through hoops here.
var messageURI = aMessage.folder.generateMessageURI(aMessage.messageKey) + "?fetchCompleteMessage=true";
var messageURL = mailSession.ConvertMsgURIToMsgURL(messageURI, msgWindow);
gJunkmailComponent.calculate(messageURL, new callback);
}
function analyzeFolder()
{
function processNext()
{
if (messages.hasMoreElements()) {
// XXX TODO jumping through hoops here.
var message = messages.getNext().QueryInterface(Components.interfaces.nsIMsgDBHdr);
while (!message.isRead) {
if (!messages.hasMoreElements()) {
gJunkmailComponent.batchUpdate = false;
return;
}
message = messages.getNext().QueryInterface(Components.interfaces.nsIMsgDBHdr);
}
analyze(message, processNext);
}
else {
gJunkmailComponent.batchUpdate = false;
}
}
getJunkmailComponent();
var folder = GetFirstSelectedMsgFolder();
var messages = folder.getMessages(msgWindow);
gJunkmailComponent.batchUpdate = true;
processNext();
}
function analyzeMessages()
{
function processNext()
{
if (counter < messages.length) {
// XXX TODO jumping through hoops here.
var messageUri = messages[counter];
var message = messenger.messageServiceFromURI(messageUri).messageURIToMsgHdr(messageUri);
++counter;
while (!message.isRead) {
if (counter == messages.length) {
gJunkmailComponent.mBatchUpdate = false;
return;
}
messageUri = messages[counter];
message = messenger.messageServiceFromURI(messageUri).messageURIToMsgHdr(messageUri);
++counter;
}
analyze(message, processNext);
}
else {
gJunkmailComponent.batchUpdate = false;
}
}
getJunkmailComponent();
var messages = GetSelectedMessages();
var counter = 0;
gJunkmailComponent.batchUpdate = true;
processNext();
}
function writeHash()
{
getJunkmailComponent();
gJunkmailComponent.mTable.writeHash();
}
function mark(aMessage, aSpam, aNextFunction)
{
// XXX TODO jumping through hoops here.
var score = aMessage.getStringProperty("score");
var action;
if (aSpam) {
if (score == "100") {
// Marking a spam message as spam does nothing
return;
}
if (score == "0") {
// Marking a non-spam message as spam
action = Components.interfaces.nsIMsgFilterPlugin.hamToSpam;
}
else
action = Components.interfaces.nsIMsgFilterPlugin.unknownToSpam;
}
else {
if (score == "0") {
// Marking a non-spam message as non-spam does nothing
return;
}
if (score == "100") {
// Marking a spam message as non-spam
action = Components.interfaces.nsIMsgFilterPlugin.spamToHam;
}
else
action = Components.interfaces.nsIMsgFilterPlugin.unknownToHam;
}
var messageURI = aMessage.folder.generateMessageURI(aMessage.messageKey) + "?fetchCompleteMessage=true";
var messageURL = mailSession.ConvertMsgURIToMsgURL(messageURI, msgWindow);
gJunkmailComponent.mark(messageURL, action, aNextFunction);
}
function JunkSelectedMessages(setAsJunk)
{
getJunkmailComponent();
var messages = GetSelectedMessages();
// start the batch of messages
//
gJunkmailComponent.batchUpdate = true;
// mark each one
//
for ( var msg in messages ) {
var message = messenger.messageServiceFromURI(messages[msg])
.messageURIToMsgHdr(messages[msg]);
mark(message, setAsJunk, null);
}
// end the batch (tell the component to write out its data)
//
gJunkmailComponent.batchUpdate = false;
// this actually sets the score on the selected messages
// so we need to call it after we call mark()
gDBView.doCommand(setAsJunk ? nsMsgViewCommandType.junk
: nsMsgViewCommandType.unjunk);
}
// temporary
function markFolderAsJunk(aSpam)
{
function processNext()
{
if (messages.hasMoreElements()) {
// Pffft, jumping through hoops here.
var message = messages.getNext().QueryInterface(Components.interfaces.nsIMsgDBHdr);
mark(message, aSpam, processNext);
// now set the score
// XXX TODO invalidate the row
if (aSpam)
message.setStringProperty("score","100");
else
message.setStringProperty("score","0");
}
else {
gJunkmailComponent.batchUpdate = false;
}
}
getJunkmailComponent();
var folder = GetFirstSelectedMsgFolder();
var messages = folder.getMessages(msgWindow);
gJunkmailComponent.batchUpdate = true;
processNext();
}

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

@ -1,534 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* 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) 2000 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributors(s):
* Jan Varga <varga@utcru.sk>
* Hakan Waara <hwaara@chello.se>
*/
//NOTE: gMessengerBundle must be defined and set or this Overlay won't work
// Function to change the highlighted row back to the row that is currently
// outline/dotted without loading the contents of either rows. This is
// triggered when the context menu for a given row is hidden/closed
// (onpopuphiding).
function RestoreSelectionWithoutContentLoad(tree)
{
var treeBoxObj = tree.treeBoxObject;
var treeSelection = treeBoxObj.selection;
// make sure that currentIndex is valid so that we don't try to restore
// a selection of an invalid row.
if((!treeSelection.isSelected(treeSelection.currentIndex)) &&
(treeSelection.currentIndex >= 0))
{
treeSelection.selectEventsSuppressed = true;
treeSelection.select(treeSelection.currentIndex);
treeSelection.selectEventsSuppressed = false;
// Keep track of which row in the thread pane is currently selected.
// This is currently only needed when deleting messages. See
// declaration of var in msgMail3PaneWindow.js.
if(tree.id == "threadTree")
gThreadPaneCurrentSelectedIndex = treeSelection.currentIndex;
}
else if(!gThreadPaneDeleteOrMoveOccurred && (treeSelection.currentIndex < 0))
// Clear the selection in the case of when a folder has just been
// loaded where the message pane does not have a message loaded yet.
// When right-clicking a message in this case and dismissing the
// popup menu (by either executing a menu command or clicking
// somewhere else), the selection needs to be cleared.
// However, if the 'Delete Message' or 'Move To' menu item has been
// selected, DO NOT clear the selection, else it will prevent the
// tree view from refreshing.
treeSelection.clearSelection();
// Need to reset gRightMouseButtonDown to false here because
// TreeOnMouseDown() is only called on a mousedown, not on a key down.
// So resetting it here allows the loading of messages in the messagepane
// when navigating via the keyboard or the toolbar buttons *after*
// the context menu has been dismissed.
gRightMouseButtonDown = false;
}
function threadPaneOnPopupHiding()
{
RestoreSelectionWithoutContentLoad(GetThreadTree());
}
function fillThreadPaneContextMenu()
{
var numSelected = GetNumSelectedMessages();
var isNewsgroup = false;
var selectedMessage = null;
// Clear the global var used to keep track if a 'Delete Message' or 'Move
// To' command has been triggered via the thread pane context menu.
gThreadPaneDeleteOrMoveOccurred = false;
if(numSelected >= 0) {
selectedMessage = GetFirstSelectedMessage();
isNewsgroup = IsNewsMessage(selectedMessage);
}
SetupNewMessageWindowMenuItem("threadPaneContext-openNewWindow", numSelected, false);
SetupEditAsNewMenuItem("threadPaneContext-editAsNew", numSelected, false);
ShowMenuItem("threadPaneContext-sep-open", (numSelected <= 1));
SetupReplyToSenderMenuItem("threadPaneContext-replySender", numSelected, false);
SetupReplyToNewsgroupMenuItem("threadPaneContext-replyNewsgroup", numSelected, isNewsgroup, false);
SetupReplyAllMenuItem("threadPaneContext-replyAll", numSelected, false);
SetupForwardMenuItem("threadPaneContext-forward", numSelected, false);
SetupForwardAsAttachmentMenuItem("threadPaneContext-forwardAsAttachment", numSelected, false);
ShowMenuItem("threadPaneContext-sep-reply", true);
SetupCopyMessageUrlMenuItem("threadPaneContext-copyMessageUrl", numSelected, isNewsgroup, numSelected != 1);
SetupCopyMenuItem("threadPaneContext-copyMenu", numSelected, false);
SetupMoveMenuItem("threadPaneContext-moveMenu", numSelected, isNewsgroup, false);
EnableMenuItem("threadPaneContext-labels", (numSelected >= 1));
SetupSaveAsMenuItem("threadPaneContext-saveAs", numSelected, false);
SetupPrintMenuItem("threadPaneContext-print", numSelected, false);
SetupDeleteMenuItem("threadPaneContext-delete", numSelected, false);
SetupAddSenderToABMenuItem("threadPaneContext-addSenderToAddressBook", numSelected, false);
SetupAddAllToABMenuItem("threadPaneContext-addAllToAddressBook", numSelected, false);
ShowMenuItem("threadPaneContext-sep-edit", (numSelected <= 1));
return(true);
}
function SetupNewMessageWindowMenuItem(menuID, numSelected, forceHide)
{
ShowMenuItem(menuID, (numSelected <= 1) && !forceHide);
EnableMenuItem(menuID, (numSelected == 1));
}
function SetupEditAsNewMenuItem(menuID, numSelected, forceHide)
{
ShowMenuItem(menuID, (numSelected <= 1)&& !forceHide);
EnableMenuItem(menuID, (numSelected == 1));
}
function SetupReplyToSenderMenuItem(menuID, numSelected, forceHide)
{
ShowMenuItem(menuID, (numSelected <= 1)&& !forceHide);
EnableMenuItem(menuID, (numSelected == 1));
}
function SetupReplyToNewsgroupMenuItem(menuID, numSelected, isNewsgroup, forceHide)
{
ShowMenuItem(menuID, (numSelected <= 1) && isNewsgroup && !forceHide);
EnableMenuItem(menuID, (numSelected == 1));
}
function SetupReplyAllMenuItem(menuID, numSelected, forceHide)
{
ShowMenuItem(menuID, (numSelected <= 1) && !forceHide);
EnableMenuItem(menuID, (numSelected == 1));
}
function SetupForwardMenuItem(menuID, numSelected, forceHide)
{
ShowMenuItem(menuID, (numSelected <= 1) && !forceHide);
EnableMenuItem(menuID, (numSelected > 0));
}
function SetupForwardAsAttachmentMenuItem(menuID, numSelected, forceHide)
{
ShowMenuItem(menuID, (numSelected > 1) && !forceHide);
EnableMenuItem(menuID, (numSelected > 1));
}
function SetupMoveMenuItem(menuID, numSelected, isNewsgroup, forceHide)
{
ShowMenuItem(menuID, !isNewsgroup && !forceHide);
var msgFolder = GetLoadedMsgFolder();
// disable move if we can't delete message(s) from this folder
var enableMenuItem = (numSelected > 0) && msgFolder && msgFolder.canDeleteMessages;
EnableMenuItem(menuID, enableMenuItem);
}
function SetupCopyMessageUrlMenuItem(menuID, numSelected, isNewsgroup, forceHide)
{
ShowMenuItem(menuID, isNewsgroup && !forceHide);
EnableMenuItem(menuID, (numSelected > 0));
}
function SetupCopyMenuItem(menuID, numSelected, forceHide)
{
ShowMenuItem(menuID, !forceHide);
EnableMenuItem(menuID, (numSelected > 0));
}
function SetupLabelsMenuItem(menuID, numSelected, forceHide)
{
ShowMenuItem(menuID, (numSelected <= 1) && !forceHide);
EnableMenuItem(menuID, (numSelected == 1));
}
function SetupSaveAsMenuItem(menuID, numSelected, forceHide)
{
ShowMenuItem(menuID, (numSelected <= 1) && !forceHide);
EnableMenuItem(menuID, (numSelected == 1));
}
function SetupPrintMenuItem(menuID, numSelected, forceHide)
{
ShowMenuItem(menuID, !forceHide);
EnableMenuItem(menuID, (numSelected > 0));
}
function SetupAddSenderToABMenuItem(menuID, numSelected, forceHide)
{
ShowMenuItem(menuID, (numSelected <= 1) && !forceHide);
EnableMenuItem(menuID, false);
}
function SetupAddAllToABMenuItem(menuID, numSelected, forceHide)
{
ShowMenuItem(menuID, (numSelected <= 1) && !forceHide);
EnableMenuItem(menuID, false);
}
function SetupDeleteMenuItem(menuID, numSelected, forceHide)
{
// This function is needed for the case where a folder is just loaded (while
// there isn't a message loaded in the message pane), a right-click is done
// in the thread pane. This function will disable enable the 'Delete
// Message' menu item.
ShowMenuItem(menuID, !forceHide);
EnableMenuItem(menuID, (numSelected > 0));
goUpdateCommand('cmd_delete');
}
function folderPaneOnPopupHiding()
{
RestoreSelectionWithoutContentLoad(GetFolderTree());
}
function fillFolderPaneContextMenu()
{
if (IsFakeAccount())
return false;
var folderTree = GetFolderTree();
var startIndex = {};
var endIndex = {};
folderTree.treeBoxObject.selection.getRangeAt(0, startIndex, endIndex);
if (startIndex.value < 0)
return false;
var numSelected = endIndex.value - startIndex.value + 1;
var folderResource = GetFolderResource(folderTree, startIndex.value);
var isServer = GetFolderAttribute(folderTree, folderResource, "IsServer") == 'true';
var serverType = GetFolderAttribute(folderTree, folderResource, "ServerType");
var specialFolder = GetFolderAttribute(folderTree, folderResource, "SpecialFolder");
var canSubscribeToFolder = (serverType == "nntp") || (serverType == "imap");
var isNewsgroup = !isServer && serverType == 'nntp';
var canGetMessages = (isServer && (serverType != "nntp") && (serverType !="none")) || isNewsgroup;
EnableMenuItem("folderPaneContext-properties", !isServer);
ShowMenuItem("folderPaneContext-getMessages", (numSelected <= 1) && canGetMessages);
EnableMenuItem("folderPaneContext-getMessages", true);
ShowMenuItem("folderPaneContext-openNewWindow", (numSelected <= 1) && !isServer);
EnableMenuItem("folderPaneContext-openNewWindow", (true));
SetupRenameMenuItem(folderResource, numSelected, isServer, serverType, specialFolder);
SetupRemoveMenuItem(folderResource, numSelected, isServer, serverType, specialFolder);
SetupCompactMenuItem(folderResource, numSelected);
ShowMenuItem("folderPaneContext-copy-location", !isServer);
ShowMenuItem("folderPaneContext-emptyTrash", (numSelected <= 1) && (specialFolder == 'Trash'));
EnableMenuItem("folderPaneContext-emptyTrash", true);
var showSendUnsentMessages = (numSelected <= 1) && (specialFolder == 'Unsent Messages');
ShowMenuItem("folderPaneContext-sendUnsentMessages", showSendUnsentMessages);
if (showSendUnsentMessages) {
EnableMenuItem("folderPaneContext-sendUnsentMessages", IsSendUnsentMsgsEnabled(folderResource));
}
ShowMenuItem("folderPaneContext-sep-edit", (numSelected <= 1));
SetupNewMenuItem(folderResource, numSelected, isServer, serverType, specialFolder);
ShowMenuItem("folderPaneContext-subscribe", (numSelected <= 1) && canSubscribeToFolder);
EnableMenuItem("folderPaneContext-subscribe", true);
ShowMenuItem("folderPaneContext-sep1", (numSelected <= 1) && !isServer);
// News folder context menu =============================================
ShowMenuItem("folderPaneContext-newsUnsubscribe", (numSelected <= 1) && canSubscribeToFolder && isNewsgroup);
EnableMenuItem("folderPaneContext-newsUnsubscribe", true);
ShowMenuItem("folderPaneContext-markAllRead", (numSelected <= 1) && isNewsgroup);
EnableMenuItem("folderPaneContext-markAllRead", true);
// End of News folder context menu =======================================
ShowMenuItem("folderPaneContext-searchMessages", (numSelected<=1));
EnableMenuItem("folderPaneContext-searchMessages", IsCanSearchMessagesEnabled());
return(true);
}
function SetupRenameMenuItem(folderResource, numSelected, isServer, serverType, specialFolder)
{
var isSpecialFolder = specialFolder != 'none';
var isMail = serverType != 'nntp';
var folderTree = GetFolderTree();
var canRename = GetFolderAttribute(folderTree, folderResource, "CanRename") == "true";
ShowMenuItem("folderPaneContext-rename", (numSelected <= 1) && !isServer && (specialFolder == "none") && canRename);
var folder = GetMsgFolderFromResource(folderResource);
EnableMenuItem("folderPaneContext-rename", !isServer && folder.isCommandEnabled("cmd_renameFolder"));
if(canRename)
{
SetMenuItemLabel("folderPaneContext-rename", gMessengerBundle.getString("renameFolder"));
}
}
function SetupRemoveMenuItem(folderResource, numSelected, isServer, serverType, specialFolder)
{
var isMail = serverType != 'nntp';
var isSpecialFolder = specialFolder != "none";
//Can't currently delete Accounts or special folders.
var showRemove = (numSelected <=1) && (isMail && !isSpecialFolder) && !isServer;
ShowMenuItem("folderPaneContext-remove", showRemove);
if(showRemove)
{
var folder = GetMsgFolderFromResource(folderResource);
EnableMenuItem("folderPaneContext-remove", folder.isCommandEnabled("cmd_delete"));
}
if(isMail && !isSpecialFolder)
{
SetMenuItemLabel("folderPaneContext-remove", gMessengerBundle.getString("removeFolder"));
}
}
function SetupCompactMenuItem(folderResource, numSelected)
{
var folderTree = GetFolderTree();
var canCompact = GetFolderAttribute(folderTree, folderResource, "CanCompact") == "true";
ShowMenuItem("folderPaneContext-compact", (numSelected <=1) && canCompact);
var folder = GetMsgFolderFromResource(folderResource);
EnableMenuItem("folderPaneContext-compact", folder.isCommandEnabled("cmd_compactFolder"));
if(canCompact)
{
SetMenuItemLabel("folderPaneContext-compact", gMessengerBundle.getString("compactFolder"));
}
}
function SetupNewMenuItem(folderResource, numSelected, isServer, serverType, specialFolder)
{
var folderTree = GetFolderTree();
var canCreateNew = GetFolderAttribute(folderTree, folderResource, "CanCreateSubfolders") == "true";
var isInbox = specialFolder == "Inbox";
var isIMAPFolder = GetFolderAttribute(folderTree, folderResource,
"ServerType") == "imap";
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
var showNew = ((numSelected <=1) && (serverType != 'nntp') && canCreateNew) || isInbox;
ShowMenuItem("folderPaneContext-new", showNew);
EnableMenuItem("folderPaneContext-new", !isIMAPFolder || !ioService.offline);
if(showNew)
{
if(isServer || isInbox)
SetMenuItemLabel("folderPaneContext-new", gMessengerBundle.getString("newFolder"));
else
SetMenuItemLabel("folderPaneContext-new", gMessengerBundle.getString("newSubfolder"));
}
}
function ShowMenuItem(id, showItem)
{
var item = document.getElementById(id);
if(item && item.hidden != "true")
item.hidden = !showItem;
}
function EnableMenuItem(id, enableItem)
{
var item = document.getElementById(id);
if(item)
{
var enabled = (item.getAttribute('disabled') !='true');
if(enableItem != enabled)
{
item.setAttribute('disabled', enableItem ? '' : 'true');
}
}
}
function SetMenuItemLabel(id, label)
{
var item = document.getElementById(id);
if(item)
item.setAttribute('label', label);
}
function SetMenuItemAccessKey(id, accessKey)
{
var item = document.getElementById(id);
if(item)
item.setAttribute('accesskey', accessKey);
}
function fillMessagePaneContextMenu()
{
var message = GetLoadedMessage();
var numSelected = (message) ? 1 : 0;
var isNewsgroup = false;
if (numSelected == 1)
isNewsgroup = IsNewsMessage(message);
// don't show mail items for links/images, just show related items.
var hideMailItems = gContextMenu.onImage || gContextMenu.onLink;
SetupEditAsNewMenuItem("messagePaneContext-editAsNew", numSelected, (numSelected == 0 || hideMailItems));
SetupReplyToSenderMenuItem("messagePaneContext-replySender", numSelected, (numSelected == 0 || hideMailItems));
SetupReplyToNewsgroupMenuItem("messagePaneContext-replyNewsgroup", numSelected, isNewsgroup, (numSelected == 0 || hideMailItems));
SetupReplyAllMenuItem("messagePaneContext-replyAll" , numSelected, (numSelected == 0 || hideMailItems));
SetupForwardMenuItem("messagePaneContext-forward", numSelected, (numSelected == 0 || hideMailItems));
SetupCopyMessageUrlMenuItem("messagePaneContext-copyMessageUrl", numSelected, isNewsgroup, (numSelected == 0 || hideMailItems));
SetupCopyMenuItem("messagePaneContext-copyMenu", numSelected, (numSelected == 0 || hideMailItems));
SetupMoveMenuItem("messagePaneContext-moveMenu", numSelected, isNewsgroup, (numSelected == 0 || hideMailItems));
SetupLabelsMenuItem("messagePaneContext-labels", numSelected, (numSelected == 0 || hideMailItems));
SetupSaveAsMenuItem("messagePaneContext-saveAs", numSelected, (numSelected == 0 || hideMailItems));
SetupPrintMenuItem("messagePaneContext-print", numSelected, (numSelected == 0 || hideMailItems));
if (numSelected == 0 || hideMailItems)
ShowMenuItem("messagePaneContext-delete", false)
else {
goUpdateCommand('cmd_delete');
ShowMenuItem("messagePaneContext-delete", true)
}
SetupAddSenderToABMenuItem("messagePaneContext-addSenderToAddressBook", numSelected, (numSelected == 0 || hideMailItems));
SetupAddAllToABMenuItem("messagePaneContext-addAllToAddressBook", numSelected, (numSelected == 0 || hideMailItems));
//Figure out separators
ShowMenuItem("messagePaneContext-sep-open", ShowSeparator("messagePaneContext-sep-open"));
ShowMenuItem("messagePaneContext-sep-reply", ShowSeparator("messagePaneContext-sep-reply"));
ShowMenuItem("messagePaneContext-sep-edit", ShowSeparator("messagePaneContext-sep-edit"));
ShowMenuItem("messagePaneContext-sep-link", ShowSeparator("messagePaneContext-sep-link"));
ShowMenuItem("messagePaneContext-sep-image", ShowSeparator("messagePaneContext-sep-image"));
ShowMenuItem("messagePaneContext-sep-copy", ShowSeparator("messagePaneContext-sep-copy"));
ShowMenuItem("messagePaneContext-sep-labels-1", ShowSeparator("messagePaneContext-sep-labels-1"));
ShowMenuItem("messagePaneContext-sep-labels-2", ShowSeparator("messagePaneContext-sep-labels-2"));
if (!hideMailItems)
ShowMenuItem("messagePaneContext-sep-edit", false);
}
function ShowSeparator(aSeparatorID)
{
var separator = document.getElementById(aSeparatorID);
var sibling = separator.previousSibling;
var siblingID;
var siblingNextHiddenAttrib = separator.nextSibling.getAttribute("hidden");
while (sibling && sibling.localName != "menuseparator") {
siblingID = sibling.getAttribute("id");
// for some reason, context-blockimage and context-unblockimage is not
// hidden on the very first time the context menu is invoked. It's only
// hidden on subsequent triggers of the context menu. Since we're not
// using these two menuitems in mailnews, we can ignore it if encountered.
if ((sibling.getAttribute("hidden") != "true") &&
(siblingNextHiddenAttrib != "true") &&
(siblingID != "context-blockimage") &&
(siblingID != "context-unblockimage"))
return true;
sibling = sibling.previousSibling;
}
return false;
}
function IsMenuItemShowing(menuID)
{
var item = document.getElementById(menuID);
if (item)
return item.hidden != "true";
return false;
}
function CopyFolderUrl()
{
try
{
var folderResource = GetSelectedFolderResource();
if (folderResource)
{
var msgFolder = folderResource.QueryInterface(Components.interfaces.nsIMsgFolder);
var contractid = "@mozilla.org/widget/clipboardhelper;1";
var iid = Components.interfaces.nsIClipboardHelper;
var clipboard = Components.classes[contractid].getService(iid);
clipboard.copyString(msgFolder.folderURL);
}
}
catch (ex)
{
dump("ex="+ex+"\n");
}
}
function CopyMessageUrl()
{
try {
var hdr = gDBView.hdrForFirstSelectedMessage;
var server = hdr.folder.server;
var url;
if (server.isSecure) {
url = "snews://";
}
else {
url = "news://"
}
url += server.hostName;
url += ":";
url += server.port;
url += "/";
url += hdr.messageId;
var contractid = "@mozilla.org/widget/clipboardhelper;1";
var iid = Components.interfaces.nsIClipboardHelper;
var clipboard = Components.classes[contractid].getService(iid);
clipboard.copyString(url);
}
catch (ex) {
dump("ex="+ex+"\n");
}
}

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

@ -1,57 +0,0 @@
<?xml version="1.0"?>
<!-- retrieve generic commands -->
<?xul-overlay href="chrome://messenger/content/mailOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://messenger/locale/mailEditorOverlay.dtd" >
<overlay id="mailEditorOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript">
<![CDATA[
function openComposeWindow(pageUrl, pageTitle)
{
var params = Components.classes["@mozilla.org/messengercompose/composeparams;1"].createInstance(Components.interfaces.nsIMsgComposeParams);
if (params)
{
params.composeFields = Components.classes['@mozilla.org/messengercompose/composefields;1'].createInstance(Components.interfaces.nsIMsgCompFields);
if (params.composeFields)
{
params.composeFields.body = pageUrl;
params.composeFields.subject = pageTitle;
var attachmentData = Components.classes["@mozilla.org/messengercompose/attachment;1"].createInstance(Components.interfaces.nsIMsgAttachment);
if (attachmentData)
{
attachmentData.url = pageUrl;
params.composeFields.addAttachment(attachmentData);
}
params.bodyIsLink = true;
var composeService = Components.classes["@mozilla.org/messengercompose;1"].getService(Components.interfaces.nsIMsgComposeService);
if (composeService)
composeService.OpenComposeWindowWithParams(null, params);
}
}
}
]]>
</script>
<!-- editor specific UI items -->
<menupopup id="menu_NewPopup">
<!-- Command nodes and implemention are in mailOverlay.xul -->
<menuitem id="menu_newMessage" insertafter="menu_newNavigator"/>
<menuitem id="menu_newCard" insertafter="menu_newNavigator"/>
</menupopup>
<menupopup id="menu_FilePopup">
<!-- The command node cmd_editSendPage is in editorOverlay.xul.
Implementation is in ComposerCommands.js
-->
<menuitem id="menu_sendPage" label="&sendPage.label;" accesskey="&sendPage.accesskey;" observes="cmd_editSendPage" insertafter="previewInBrowser"/>
</menupopup>
</overlay>

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

@ -1,15 +0,0 @@
<?xml version="1.0"?>
<!-- retrieve generic commands -->
<?xul-overlay href="chrome://messenger/content/mailOverlay.xul"?>
<overlay id="mailMessengerComposeOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!-- messengercompose specific UI items -->
<menupopup id="menu_NewPopup">
<menuitem id="menu_newCard" position="4"/>
</menupopup>
</overlay>

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

@ -1,15 +0,0 @@
<?xml version="1.0"?>
<!-- retrieve generic commands -->
<?xul-overlay href="chrome://messenger/content/mailOverlay.xul"?>
<overlay id="mailMessengerOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!-- addressbook specific UI items -->
<menupopup id="menu_NewPopup">
<menuitem id="menu_newCard" position="6"/>
</menupopup>
</overlay>

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

@ -1,160 +0,0 @@
<?xml version="1.0"?>
<!-- retrieve generic commands -->
<?xul-overlay href="chrome://messenger/content/mailOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://messenger/locale/mailNavigatorOverlay.dtd" >
<overlay id="mailNavigatorOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript">
<![CDATA[
function getCurrentIdentityKey()
{
try
{
var cwindowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService();
var iwindowManager = Components.interfaces.nsIWindowMediator;
var windowManager = cwindowManager.QueryInterface(iwindowManager);
var mailWindow = windowManager.getMostRecentWindow('mail:3pane');
var folder = mailWindow.GetFirstSelectedMsgFolder();
var server = folder.server;
if (server.type == "nntp")//if the account is a news account use default identity
return null;
else {
var identity = mailWindow.getIdentityForServer(server);
return identity;
}
}
catch(ex) {
return null;
}
}
// attachment: 0 - link
// 1 - page
// 2 - image
function openComposeWindow(url, title, attachment)
{
var params = Components.classes["@mozilla.org/messengercompose/composeparams;1"].createInstance(Components.interfaces.nsIMsgComposeParams);
if (params)
{
params.composeFields = Components.classes['@mozilla.org/messengercompose/composefields;1'].createInstance(Components.interfaces.nsIMsgCompFields);
if (params.composeFields)
{
if (attachment == 0 || attachment == 1)
{
params.composeFields.body = url;
params.composeFields.subject = title;
params.bodyIsLink = true;
}
if (attachment == 1 || attachment == 2)
{
var attachmentData = Components.classes["@mozilla.org/messengercompose/attachment;1"].createInstance(Components.interfaces.nsIMsgAttachment);
if (attachmentData)
{
attachmentData.url = url;
params.composeFields.addAttachment(attachmentData);
}
}
params.identity = getCurrentIdentityKey();
var composeService = Components.classes["@mozilla.org/messengercompose;1"].getService(Components.interfaces.nsIMsgComposeService);
if (composeService)
composeService.OpenComposeWindowWithParams(null, params);
}
}
}
function sendLink(pageUrl, pageTitle)
{
try {
openComposeWindow(pageUrl, pageTitle, 0);
} catch(ex) { dump("Cannot Send Link: " + ex + "\n"); }
}
function sendImage(imageURL)
{
try {
openComposeWindow(imageURL, null, 2);
} catch(ex) { dump("Cannot Send Image: " + ex + "\n"); }
}
function sendPage(aDocument)
{
if (!aDocument)
aDocument = window._content.document;
var pageUrl = aDocument.URL;
var pageTitle = Components.lookupMethod(aDocument, 'title').call(aDocument);
try {
openComposeWindow(pageUrl, pageTitle, 1);
} catch(ex) { dump("Cannot Send Page: " + ex + "\n"); }
}
function initMailContextMenuItems(aEvent)
{
var shouldShowSendPage = !(gContextMenu.onTextInput || gContextMenu.isTextSelected) && !(gContextMenu.onLink && gContextMenu.onImage);
gContextMenu.showItem("context-sendpage", shouldShowSendPage);
gContextMenu.showItem("context-sep-apps", gContextMenu.shouldShowSeparator("context-sep-apps"));
}
var gAddedMailContextMenuPopupListener = false;
function initMailContextMenuPopupListener(aEvent)
{
// This is really lame, but we can't seem to add a bubbling listener to the DOMWindow (!)
if (gAddedMailContextMenuPopupListener)
return;
var popup = document.getElementById("contentAreaContextMenu");
popup.addEventListener("popupshowing", initMailContextMenuItems, false);
gAddedMailContextMenuPopupListener = true;
}
addEventListener("load", initMailContextMenuPopupListener, true);
]]>
</script>
<!-- navigator specific commands -->
<commandset id="tasksCommands">
<command id="cmd_sendPage" oncommand="sendPage();"/>
<command id="Browser:SendLink"
oncommand="sendLink(Components.lookupMethod(window._content, 'location').call(window._content).href,
Components.lookupMethod(window._content.document, 'title').call(window._content.document));"/>
</commandset>
<!-- navigator specific UI items -->
<menupopup id="menu_NewPopup">
<menuitem id="menu_newCard" insertafter="navBeginGlobalNewItems"/>
<menuitem id="menu_newMessage" insertafter="navBeginGlobalNewItems"/>
</menupopup>
<menupopup id="menu_FilePopup">
<menuitem id="menu_sendPage" label="&sendPage.label;" accesskey="&sendPage.accesskey;" command="cmd_sendPage" position="9"/>
<menuitem id="menu_sendLink" label="&sendLinkCmd.label;" accesskey="&sendLinkCmd.accesskey;" command="Browser:SendLink" position="10"/>
</menupopup>
<popup id="contentAreaContextMenu">
<menuitem id="context-sendpage"
label="&contextSendPage.label;"
accesskey="&contextSendPage.accesskey;"
oncommand="sendPage();"
insertafter="context-savepage"/>
<menuitem id="context-sendimage"
label="&contextSendImage.label;"
accesskey="&contextSendImage.accesskey;"
oncommand="sendImage(gContextMenu.imageURL);"
insertafter="context-saveimage"/>
<menu id="frame">
<menupopup id="frame_popup">
<menuitem insertafter="saveframeas"
label="&contextSendFrame.label;"
accesskey="&contextSendFrame.accesskey;"
oncommand="sendPage(gContextMenu.target.ownerDocument);"/>
</menupopup>
</menu>
</popup>
</overlay>

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

@ -1,77 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE window [
<!ENTITY % mailTasksOverlayDTD SYSTEM "chrome://messenger/locale/mailTasksOverlay.dtd" >
%mailTasksOverlayDTD;
]>
<overlay id="mailPrefsOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript">
<![CDATA[
// uses "toOpenWindowByType" function provided by utilityOverlay.js
// which is included by most clients.
function toMessengerWindow()
{
var pref = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
var windowDoc = "chrome://messenger/content/messenger.xul";
try
{
var layoutType = pref.getIntPref("mail.pane_config");
windowDoc = !layoutType ? "chrome://messenger/content/messenger.xul" :
"chrome://messenger/content/mail3PaneWindowVertLayout.xul";
}
catch(ex)
{
}
toOpenWindowByType("mail:3pane", windowDoc);
}
function toAddressBook()
{
toOpenWindowByType("mail:addressbook", "chrome://messenger/content/addressbook/addressbook.xul");
}
function toNewsgroups()
{
dump ("Sorry, command not implemented.\n");
}
function toImport()
{
window.openDialog("chrome://messenger/content/importDialog.xul","importDialog","chrome, modal, titlebar", {importType: "addressbook"});
}
]]>
</script>
<keyset id="tasksKeys">
<key id="key_mail" key="&messengerCmd.commandkey;" command="Tasks:Mail" modifiers="accel"/>
<key id="key_addressbook" key="&addressBookCmd.commandkey;" command="Tasks:AddressBook" modifiers="accel"/>
</keyset>
<commandset id="tasksCommands">
<command id="Tasks:Mail" oncommand="toMessengerWindow();"/>
<command id="Tasks:AddressBook" oncommand="toAddressBook();"/>
</commandset>
<statusbarpanel id="component-bar">
<toolbarbutton class="taskbutton" id="mini-mail" oncommand="toMessengerWindow()"
position="2" tooltiptext="&taskMessenger.tooltip;"/>
<toolbarbutton id="mini-comp" insertafter="mini-mail"/>
<toolbarbutton class="taskbutton" id="mini-addr" oncommand="toAddressBook();"
insertafter="mini-comp" tooltiptext="&taskAddressBook.tooltip;"/>
</statusbarpanel>
<menupopup id="windowPopup">
<menuitem accesskey="&messengerCmd.accesskey;" label="&messengerCmd.label;" key="key_mail" command="Tasks:Mail" id="tasksMenuMail" insertafter="tasksMenuNavigator" class="menuitem-iconic icon-mail16 menu-iconic"/>
<menuitem id="tasksMenuEditor" insertafter="tasksMenuMail"/>
<menuitem label="&addressBookCmd.label;" accesskey="&addressBookCmd.accesskey;" key="key_addressbook" command="Tasks:AddressBook" id="tasksMenuAddressBook" insertafter="tasksMenuEditor" class="menuitem-iconic icon-addressbook16 menu-iconic"/>
</menupopup>
</overlay>

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

@ -1,985 +0,0 @@
<?xml version="1.0"?>
<bindings id="mailBindings"
xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
<!-- dummy widget to force this file to load -->
<binding id="dummy" extends="xul:box"/>
<!-- Message Pane Widgets -->
<!-- mail-toggle-headerfield: non email addrss headers which have a toggle associated with them (i.e. the subject).
use label to set the header name.
use headerValue to set the header value. -->
<binding id="mail-toggle-headerfield">
<content>
<xul:hbox class="headerNameBox" align="start">
<xul:image class="expandHeaderViewButton" xbl:inherits="onclick=ontwistyclick"/>
<xul:spacer flex="1"/>
<xul:label class="headerName" xbl:inherits="value=label"/>
</xul:hbox>
<xul:textbox originalclass="headerValue plain" appendoriginalclass="true" keywordrelated="true" class="headerValue plain" anonid="headerValue" flex="1" readonly="true"/>
</content>
<implementation>
<property name="headerValue" onset="return document.getAnonymousElementByAttribute(this, 'anonid', 'headerValue').value = val;"/>
</implementation>
</binding>
<!-- mail-headerfield: presents standard text header name & value pairs. Don't use this for email addresses.
use label to set the header name.
use headerValue to set the header value. -->
<binding id="mail-headerfield">
<content>
<xul:hbox class="headerNameBox" align="start">
<xul:label class="headerName" xbl:inherits="value=label" flex="1"/>
</xul:hbox>
<xul:textbox originalclass="headerValue plain" appendoriginalclass="true" keywordrelated="true" class="headerValue plain" anonid="headerValue" flex="1" readonly="true"/>
</content>
<implementation>
<property name="headerValue" onset="return document.getAnonymousElementByAttribute(this, 'anonid', 'headerValue').value = val;"/>
</implementation>
</binding>
<binding id="mail-emailheaderfield">
<content>
<xul:hbox class="headerNameBox" align="start">
<xul:label class="headerName" xbl:inherits="value=label" flex="1"/>
</xul:hbox>
<xul:mail-emailaddress anonid="emailAddressNode"/>
</content>
<implementation>
<property name="emailAddressNode" onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'emailAddressNode');"
readonly="true"/>
</implementation>
</binding>
<!-- multi-emailHeaderField: presents multiple emailheaderfields with a toggle -->
<binding id="mail-multi-emailHeaderField">
<content>
<xul:hbox class="headerNameBox" align="start" pack="end">
<xul:image class="addresstwisty" anonid="toggleIcon"
onclick="toggleAddressView();"/>
<xul:label class="headerName" xbl:inherits="value=label"/>
</xul:hbox>
<xul:label class="headerValue" anonid="emailAddresses" flex="1"/>
<xul:label class="headerValue" anonid="longEmailAddresses" flex="1" collapsed="true"/>
</content>
<implementation>
<constructor>
<![CDATA[
this.mLongViewCreated = false;
this.mAddresses = new Array;
]]>
</constructor>
<field name="mLongViewCreated"/>
<field name="mAddresses"/>
<!-- as a perf optimization we are going to keep a cache of email address nodes which we've
created around for the lifetime of the widget. mSizeOfAddressCache controls how many of these
elements we keep around -->
<field name="mSizeOfAddressCache">3</field>
<!-- addAddressView: a public method used to add an address to this widget.
aAddresses is an object with 3 properties: displayName, emailAddress and fullAddress
-->
<method name="addAddressView">
<parameter name="aAddress"/>
<body>
<![CDATA[
this.mAddresses.push(aAddress);
]]>
</body>
</method>
<!-- updateEmailAddressNode: private method used to set properties on an address node -->
<method name="updateEmailAddressNode">
<parameter name="aEmailNode"/>
<parameter name="aAddress"/>
<body>
<![CDATA[
aEmailNode.setAttribute("label", aAddress.fullAddress);
aEmailNode.setTextAttribute("emailAddress", aAddress.emailAddress);
aEmailNode.setTextAttribute("fullAddress", aAddress.fullAddress);
aEmailNode.setTextAttribute("displayName", aAddress.displayName);
try
{
if ("AddExtraAddressProcessing" in top)
AddExtraAddressProcessing(aAddress.emailAddress, aEmailNode);
}
catch(ex)
{
dump("AddExtraAddressProcessing failed: " + ex);
}
]]>
</body>
</method>
<!-- fillCachedAddresses: private method used to fill up any cached pre-existing
emailAddress fields without creating new email address fields. Returns a remainder
for the # of addresses which require new addresses being created.
Invariants: 1) aNumAddressesToShow >= 0 && it is <= mAddresses.length -->
<method name="fillCachedAddresses">
<parameter name="aAddressesNode"/>
<parameter name="aNumAddressesToShow"/>
<body>
<![CDATA[
var numExistingCachedAddresses = aAddressesNode.childNodes.length;
if (!numExistingCachedAddresses)
return this.mAddresses.length; // we couldn't pre fill anything
else if (numExistingCachedAddresses > 1)
numExistingCachedAddresses = (numExistingCachedAddresses + 1)/ 2;
var index = 0;
var numAddressesAdded = 0;
var emailAddressNode;
var commaNode;
while (numAddressesAdded < numExistingCachedAddresses && numAddressesAdded < aNumAddressesToShow)
{
if (index && numExistingCachedAddresses > 1)
{
commaNode = aAddressesNode.childNodes[index++];
if (commaNode)
commaNode.removeAttribute('collapsed');
}
// get the node pointed to by index
emailAddressNode = aAddressesNode.childNodes[index++];
this.updateEmailAddressNode(emailAddressNode, this.mAddresses[numAddressesAdded]);
emailAddressNode.removeAttribute('collapsed');
numAddressesAdded++;
}
// if we have added all of our elements but we still have more cached items in this address node
// then make sure the extra cached copies are collapsed...
numExistingCachedAddresses = aAddressesNode.childNodes.length; // reset
while (index < numExistingCachedAddresses)
{
aAddressesNode.childNodes[index++].setAttribute('collapsed', true);
}
return this.mAddresses.length - numAddressesAdded;
]]>
</body>
</method>
<!-- fillAddressesNode: private method used to create email address nodes for either our short
or long view. aAddressesNode: the div we want to add addresses too.
aNumAddressesToShow: number of addresses to put into the list -->
<method name="fillAddressesNode">
<parameter name="aAddressesNode"/>
<parameter name="aNumAddressesToShow"/>
<body>
<![CDATA[
var numAddresses = this.mAddresses.length;
if (aNumAddressesToShow <= 0 || aNumAddressesToShow > numAddresses) // then show all
aNumAddressesToShow = numAddresses;
// before we try to create email address nodes, try to leverage any cached nodes...
var remainder = this.fillCachedAddresses(aAddressesNode, aNumAddressesToShow);
var index = numAddresses - remainder;
while (index < numAddresses && index < aNumAddressesToShow)
{
var newAddressNode = document.createElement("mail-emailaddress");
if (index)
{
var textNode = document.createElement("text");
textNode.setAttribute("value", ", ");
textNode.setAttribute("class", "emailSeparator");
aAddressesNode.appendChild(textNode);
}
var itemInDocument = aAddressesNode.appendChild(newAddressNode);
this.updateEmailAddressNode(itemInDocument, this.mAddresses[index]);
index++;
}
]]>
</body>
</method>
<property name="emailAddresses" onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'emailAddresses');"
readonly="true"/>
<property name="longEmailAddresses" onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'longEmailAddresses');"
readonly="true"/>
<property name="toggleIcon" onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'toggleIcon');"
readonly="true"/>
<!-- buildView: public method used by callers when they are done adding all the email addresses to the widget
aNumAddressesToShow: total # of addresses to show in the short view -->
<method name="buildViews">
<parameter name="aNumAddressesToShow"/>
<body>
<![CDATA[
// always build the short view...its cheap...
this.fillAddressesNode(this.emailAddresses, aNumAddressesToShow);
// if we are currently toggled to show all the email addresses, build the long one too...
if (this.emailAddresses.collapsed)
this.buildLongView();
// make sure the icon is always visible if we have more than the # of addresses to show
this.toggleIcon.collapsed = this.mAddresses.length <= aNumAddressesToShow;
]]>
</body>
</method>
<!-- buildLongView: private method used for delayed construction of the long view -->
<method name="buildLongView">
<body>
<![CDATA[
if (!this.mLongViewCreated)
{
this.fillAddressesNode(this.longEmailAddresses, -1);
this.mLongViewCreated = true;
}
]]>
</body>
</method>
<method name="toggleAddressView">
<body>
<![CDATA[
var shortNode = this.emailAddresses;
var longNode = this.longEmailAddresses;
var imageNode = this.toggleIcon;
// test to see which if short is already collapsed...
if (shortNode.collapsed)
{
longNode.collapsed = true;
shortNode.collapsed = false;
imageNode.removeAttribute("open");
}
else
{
this.buildLongView();
shortNode.collapsed = true;
longNode.collapsed = false;
imageNode.setAttribute("open", "true");
if (!this.mLongViewCreated)
{
// Need to call UpdateMessageHeaders() because this is the first
// time the long view is being built. This is required in order
// to update the addresses of the long view that might contain
// extra image info.
// It should also only be called from toggleAddressView(), not
// from buildView().
UpdateMessageHeaders();
}
}
]]>
</body>
</method>
<!-- internal method used to clear both our divs -->
<method name="clearChildNodes">
<parameter name="aParentNode"/>
<body>
<![CDATA[
// we want to keep around the first mSizeOfAddressCache email address nodes
// don't forget that we have comma text nodes in there too so really we want to keep
// around cache size * 2 - 1.
var numItemsToPreserve = this.mSizeOfAddressCache * 2 - 1;
var numItemsInNode = aParentNode.childNodes.length;
while (numItemsInNode && (numItemsInNode > numItemsToPreserve))
{
aParentNode.removeChild(aParentNode.childNodes[numItemsInNode-1]);
numItemsInNode = numItemsInNode - 1;
}
]]>
</body>
</method>
<method name="clearEmailAddresses">
<body>
<![CDATA[
// clear out our local state
this.mAddresses = new Array;
this.mLongViewCreated = false;
// remove anything inside of each of our labels....
var parentLabel = this.emailAddresses;
if (parentLabel)
this.clearChildNodes(parentLabel);
parentLabel = this.longEmailAddresses;
if (parentLabel)
this.clearChildNodes(parentLabel);
]]>
</body>
</method>
</implementation>
</binding>
<binding id="mail-emailaddress">
<content popup="emailAddressPopup" context="emailAddressPopup">
<xul:label anonid="emailValue" class="emailDisplayButton plain"
xbl:inherits="value=label,crop"/>
<xul:image class="emailDisplayImage" anonid="emailImage"
context="emailAddressPopup" xbl:inherits="src=image"/>
</content>
<implementation>
<property name="label" onset="this.getPart('emailValue').setAttribute('label',val); return val;"
onget="return this.getPart('emailValue').getAttribute('label');"/>
<property name="crop" onset="this.getPart('emailValue').setAttribute('crop',val); return val;"
onget="return this.getPart('emailValue').getAttribute('crop');"/>
<property name="disabled" onset="this.getPart('emailValue').setAttribute('disabled',val); return val;"
onget="return this.getPart('emailValue').getAttribute('disabled');"/>
<property name="src" onset="this.getPart('emailImage').setAttribute('src',val); return val;"
onget="return this.getPart('emailImage').getAttribute('src');"/>
<property name="imgalign" onset="this.getPart('emailImage').setAttribute('imgalign',val); return val;"
onget="return this.getPart('emailImage').getAttribute('imgalign');"/>
<method name="getPart">
<parameter name="aPartId"/>
<body><![CDATA[
return document.getAnonymousElementByAttribute(this, "anonid", aPartId);
]]></body>
</method>
<method name="setTextAttribute">
<parameter name="attributeName"/>
<parameter name="attributeValue"/>
<body><![CDATA[
this.setAttribute(attributeName, attributeValue);
this.getPart("emailImage").setAttribute(attributeName, attributeValue);
this.getPart("emailValue").setAttribute(attributeName, attributeValue);
]]></body>
</method>
<method name="getTextAttribute">
<parameter name="attributeName"/>
<body><![CDATA[
return this.getPart("emailValue").getAttribute(attributeName);
]]></body>
</method>
<method name="GetIconNode">
<body><![CDATA[
return this.getPart("emailImage");
]]></body>
</method>
</implementation>
</binding>
<binding id="search-menulist-abstract" name="searchMenulistAbstract" extends="xul:box">
<content>
<xul:menulist class="search-menulist" xbl:inherits="flex" oncommand="this.parentNode.onSelect(event)">
<xul:menupopup class="search-menulist-popup"/>
</xul:menulist>
</content>
<implementation>
<field name="internalScope">null</field>
<field readonly="true" name="validityManager">
<![CDATA[
Components.classes['@mozilla.org/mail/search/validityManager;1'].getService(Components.interfaces.nsIMsgSearchValidityManager);
]]>
</field>
<property name="searchScope" onget="return this.internalScope;">
<!-- scope ID - retrieve the table -->
<setter>
<![CDATA[
// if scope isn't changing this is a noop
if (this.internalScope == val) return val;
this.internalScope = val;
this.refreshList();
var targets = this.targets;
if (targets) {
for (var i=0; i< targets.length; i++) {
targets[i].searchScope = val;
}
}
return val;
]]>
</setter>
</property>
<property name="validityTable" readonly="true" onget="return this.validityManager.getTable(this.searchScope)"/>
<property name="valueStrings" readonly="true">
<getter>
<![CDATA[
var strings = new Array;
var ids = this.valueIds;
var pref = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
var hdrs;
try
{
hdrs = pref.getCharPref("mailnews.customHeaders");
}
catch(ex)
{
hdrs=null;
}
var hdrsArray = new Array;
if (hdrs)
{
hdrs = hdrs.replace(/\s+/g,''); //remove white spaces before splitting
hdrsArray = hdrs.split(":");
for (var i = 0; i< hdrsArray.length; i++)
if (!hdrsArray[i])
hdrsArray.splice(i,1); //remove any null elements
}
var bundle = this.stringBundle;
var j=0;
for (var i=0; i<ids.length; i++)
{
if(ids[i] > Components.interfaces.nsMsgSearchAttrib.OtherHeader && hdrs)
strings[i] = hdrsArray[j++];
else
strings[i] = this.stringBundle.GetStringFromID(ids[i]);
}
return strings;
]]>
</getter>
</property>
<property name="targets" readonly="true">
<getter>
<![CDATA[
var forAttrs = this.getAttribute("for");
if (!forAttrs) return null;
var targetIds = forAttrs.split(",");
if (targetIds.length == 0) return null;
var targets = new Array;
var j=0;
for (var i=0; i<targetIds.length;i++) {
var target = document.getElementById(targetIds[i]);
if (target) targets[j++] = target;
}
return targets;
]]>
</getter>
</property>
<!-- value forwards to the internal menulist's "value" attribute -->
<property name="value" onget="return document.getAnonymousNodes(this)[0].selectedItem.getAttribute('value');">
<setter>
<![CDATA[
var menulist = document.getAnonymousNodes(this)[0];
var dataItems = menulist.getElementsByAttribute("value", val);
if (dataItems.length > 0)
menulist.selectedItem = dataItems[0];
// now notify targets of new parent's value
var targets = this.targets;
if (targets) {
for (var i=0; i< targets.length; i++) {
targets[i].parentValue = val;
}
} else {
//dump("Doh! No targets!\n");
}
return val;
]]>
</setter>
</property>
<!-- label forwards to the internal menulist's "label" attribute -->
<property name="label" onget="return document.getAnonymousNodes(this)[0].selectedItem.getAttribute('label');">
</property>
<method name="refreshList">
<body>
<![CDATA[
var menuItemIds = this.valueIds;
var menuItemStrings = this.valueStrings;
var menulist = document.getAnonymousNodes(this)[0];
var popup = menulist.firstChild;
// save our old "value" so we can restore it later
var oldData = menulist.value;
// remove the old popup children
while (popup.hasChildNodes())
popup.removeChild(popup.lastChild);
var newSelection;
var customizePos=-1;
for (var i=0; i<menuItemIds.length; i++)
{
// create the menuitem
if (Components.interfaces.nsMsgSearchAttrib.OtherHeader == menuItemIds[i].toString())
customizePos = i;
else
{
var menuitem = document.createElement("menuitem");
menuitem.setAttribute("label", menuItemStrings[i]);
menuitem.setAttribute("value", menuItemIds[i]);
popup.appendChild(menuitem);
// try to restore the selection
if (!newSelection || oldData == menuItemIds[i].toString())
newSelection = menuitem;
}
}
if (customizePos != -1)
{
var separator = document.createElement("menuseparator");
popup.appendChild(separator);
menuitem = document.createElement("menuitem");
menuitem.setAttribute("label", menuItemStrings[customizePos]);
menuitem.setAttribute("value", menuItemIds[customizePos]);
popup.appendChild(menuitem);
}
// now restore the selection
menulist.selectedItem = newSelection;
]]>
</body>
</method>
<method name="onSelect">
<parameter name="event"/>
<body>
<![CDATA[
var menulist = document.getAnonymousNodes(this)[0];
// notify targets
var targets = this.targets;
if (targets) {
for (var i=0; i< targets.length; i++) {
targets[i].parentValue = menulist.value;
}
}
]]>
</body>
</method>
</implementation>
</binding>
<!-- searchattribute - Subject, Sender, To, CC, etc. -->
<binding id="searchattribute" name="searchAttribute"
extends="chrome://messenger/content/mailWidgets.xml#search-menulist-abstract">
<implementation>
<field name="stringBundle">
<![CDATA[
srGetStrBundle("chrome://messenger/locale/search-attributes.properties");
]]>
</field>
<property name="valueIds" readonly="true">
<getter>
<![CDATA[
var length = new Object;
return this.validityTable.getAvailableAttributes(length);
]]>
</getter>
</property>
<constructor>
<![CDATA[
initializeTermFromId(this.id);
]]>
</constructor>
</implementation>
</binding>
<!-- searchoperator - Contains, Is Less than, etc -->
<binding id="searchoperator" name="searchOperator"
extends="chrome://messenger/content/mailWidgets.xml#search-menulist-abstract">
<implementation>
<field name="searchAttribute">Components.interfaces.nsMsgSearchAttrib.Default</field>
<field name="stringBundle">
<![CDATA[
srGetStrBundle("chrome://messenger/locale/search-operators.properties");
]]>
</field>
<property name="valueIds" readonly="true">
<getter>
<![CDATA[
var length = new Object;
return this.validityTable.getAvailableOperators(this.searchAttribute,length);
]]>
</getter>
</property>
<property name="parentValue">
<setter>
<![CDATA[
if (this.searchAttribute == val && val != Components.interfaces.nsMsgSearchAttrib.OtherHeader) return val;
this.searchAttribute = val;
this.refreshList();
if (val == Components.interfaces.nsMsgSearchAttrib.OtherHeader)
{
window.openDialog('chrome://messenger/content/CustomHeaders.xul', "", 'modal,titlebar,chrome', null);
UpdateAfterCustomHeaderChange();
}
return val;
]]>
</setter>
<getter>
<![CDATA[
return this.searchAttribute;
]]>
</getter>
</property>
</implementation>
</binding>
<!-- searchvalue - a widget which dynamically changes it's user interface
depending on what type of data it's supposed to be showing
currently handles arbitrary text entry, and menulists for priority and
status
-->
<binding id="searchvalue" name="searchValue">
<content>
<xul:textbox flex="1" class="search-value-textbox"/>
<xul:menulist flex="1" class="search-value-menulist">
<xul:menupopup class="search-value-popup">
<xul:menuitem value="2" stringTag="priorityLowest" class="search-value-menuitem"/>
<xul:menuitem value="3" stringTag="priorityLow" class="search-value-menuitem"/>
<xul:menuitem value="4" stringTag="priorityNormal" class="search-value-menuitem"/>
<xul:menuitem value="5" stringTag="priorityHigh" class="search-value-menuitem"/>
<xul:menuitem value="6" stringTag="priorityHighest" class="search-value-menuitem"/>
</xul:menupopup>
</xul:menulist>
<xul:menulist flex="1" class="search-value-menulist">
<xul:menupopup class="search-value-popup">
<xul:menuitem value="2" stringTag="replied" class="search-value-menuitem"/>
<xul:menuitem value="1" stringTag="read" class="search-value-menuitem"/>
<xul:menuitem value="1048576" stringTag="new" class="search-value-menuitem"/>
<xul:menuitem value="65536" stringTag="forwarded" class="search-value-menuitem"/>
</xul:menupopup>
</xul:menulist>
<xul:textbox flex="1" class="search-value-textbox"/>
<xul:menulist flex="1" class="search-value-menulist">
<xul:menupopup ref="moz-abdirectory://" class="search-value-popup" datasources="rdf:addressdirectory">
<xul:template>
<xul:rule>
<xul:menuitem uri="..."
label="rdf:http://home.netscape.com/NC-rdf#DirName"
value="rdf:http://home.netscape.com/NC-rdf#DirUri"/>
</xul:rule>
</xul:template>
</xul:menupopup>
</xul:menulist>
<xul:menulist flex="1" class="search-value-menulist">
<xul:menupopup class="search-value-popup">
<xul:menuitem value="0" class="search-value-menuitem"/>
<xul:menuitem value="1" class="search-value-menuitem"/>
<xul:menuitem value="2" class="search-value-menuitem"/>
<xul:menuitem value="3" class="search-value-menuitem"/>
<xul:menuitem value="4" class="search-value-menuitem"/>
<xul:menuitem value="5" class="search-value-menuitem"/>
</xul:menupopup>
</xul:menulist>
</content>
<implementation>
<field name="internalAttribute">null</field>
<field name="internalValue">null</field>
<!-- parentValue forwards to the attribute -->
<property name="parentValue" onset="return this.searchAttribute=val;"
onget="return this.searchAttribute;"/>
<property name="searchAttribute" onget="return this.internalAttribute;">
<setter>
<![CDATA[
// noop if we're not changing it
if (this.internalAttribute == val) return val;
this.internalAttribute = val;
// we inherit from a deck, so just use it's index attribute
// to hide/show widgets
if (val == Components.interfaces.nsMsgSearchAttrib.Priority)
this.setAttribute("selectedIndex", "1");
else if (val == Components.interfaces.nsMsgSearchAttrib.MsgStatus)
this.setAttribute("selectedIndex", "2");
else if (val == Components.interfaces.nsMsgSearchAttrib.Date)
this.setAttribute("selectedIndex", "3");
else if (val == Components.interfaces.nsMsgSearchAttrib.SenderInAddressBook)
{
var children = document.getAnonymousNodes(this);
var abs = children[4].getElementsByAttribute("value", "moz-abmdbdirectory://abook.mab");
if (abs.length > 0)
children[4].selectedItem = abs[0];
this.setAttribute("selectedIndex", "4");
}
else if (val == Components.interfaces.nsMsgSearchAttrib.Label)
{
var children = document.getAnonymousNodes(this);
var abs = children[5].getElementsByAttribute("value", "1");
if (abs.length > 0)
children[5].selectedItem = abs[0];
this.setAttribute("selectedIndex", "5");
}
else
this.setAttribute("selectedIndex", "0");
return val;
]]>
</setter>
</property>
<property name="value" onget="return this.internalValue;">
<setter>
<![CDATA[
// val is a nsIMsgSearchValue object
this.internalValue = val;
var attrib = val.attrib;
var nsMsgSearchAttrib = Components.interfaces.nsMsgSearchAttrib;
var children = document.getAnonymousNodes(this);
this.searchAttribute = attrib;
if (attrib == nsMsgSearchAttrib.Priority) {
var matchingPriority =
children[1].getElementsByAttribute("value", val.priority);
if (matchingPriority.length > 0)
children[1].selectedItem = matchingPriority[0];
}
else if (attrib == nsMsgSearchAttrib.MsgStatus) {
var matchingStatus =
children[2].getElementsByAttribute("value", val.status);
if (matchingStatus.length > 0)
children[2].selectedItem = matchingStatus[0];
}
else if (attrib == nsMsgSearchAttrib.AgeInDays)
children[0].value = val.age;
else if (attrib == nsMsgSearchAttrib.Date)
children[3].value = convertPRTimeToString(val.date);
else if (attrib == nsMsgSearchAttrib.SenderInAddressBook)
{
var abs = children[4].getElementsByAttribute("value", val.str);
if (abs.length > 0)
children[4].selectedItem = abs[0];
}
else if (attrib == nsMsgSearchAttrib.Label)
{
var labelVal = children[5].getElementsByAttribute("value", val.label);
if (labelVal.length > 0)
children[5].selectedItem = labelVal[0];
}
else
children[0].value = val.str;
return val;
]]>
</setter>
</property>
<method name="save">
<body>
<![CDATA[
var searchValue = this.value;
var searchAttribute = this.searchAttribute;
var nsMsgSearchAttrib = Components.interfaces.nsMsgSearchAttrib;
var children = document.getAnonymousNodes(this);
searchValue.attrib = searchAttribute;
if (searchAttribute == nsMsgSearchAttrib.Priority) {
searchValue.priority = children[1].selectedItem.value;
}
else if (searchAttribute == nsMsgSearchAttrib.MsgStatus)
searchValue.status = children[2].selectedItem.value;
else if (searchAttribute == nsMsgSearchAttrib.AgeInDays)
searchValue.age = children[0].value;
else if (searchAttribute == nsMsgSearchAttrib.Date)
searchValue.date = convertStringToPRTime(children[3].value);
else if (searchAttribute == nsMsgSearchAttrib.SenderInAddressBook)
searchValue.str = children[4].selectedItem.value;
else if (searchAttribute == nsMsgSearchAttrib.Label)
searchValue.label = children[5].selectedItem.value;
else
searchValue.str = children[0].value;
]]>
</body>
</method>
<method name="saveTo">
<parameter name="searchValue"/>
<body>
<![CDATA[
this.internalValue = searchValue;
this.save();
]]>
</body>
</method>
<method name="fillStringsForChildren">
<parameter name="parentNode"/>
<parameter name="bundle"/>
<body>
<![CDATA[
var children = parentNode.childNodes;
var len=children.length;
for (var i=0; i<len; i++) {
var node = children[i];
var stringTag = node.getAttribute("stringTag");
if (stringTag) {
var attr = (node.tagName == "label") ? "value" : "label";
node.setAttribute(attr, bundle.GetStringFromName(stringTag));
}
}
]]>
</body>
</method>
<method name="initialize">
<parameter name="menulist"/>
<parameter name="bundle"/>
<body>
<![CDATA[
this.fillStringsForChildren(menulist.firstChild, bundle);
// to work around bug #78429, set and reset the selectedItem
var item = menulist.selectedItem;
menulist.selectedItem = null;
menulist.selectedItem = item;
]]>
</body>
</method>
<constructor>
<![CDATA[
// initialize strings
var bundle = srGetStrBundle("chrome://messenger/locale/messenger.properties");
// intialize the priority picker
this.initialize(document.getAnonymousNodes(this)[1], bundle);
// initialize the status picker
this.initialize(document.getAnonymousNodes(this)[2], bundle);
// initialize the address book picker
this.initialize(document.getAnonymousNodes(this)[4], bundle);
// initialize the label picker....
var labelStrings = GetLabelStrings();
var children = document.getAnonymousNodes(this)[5].firstChild.childNodes;
// set the label string on each label element...
for (var index = 0; index < 6; index++)
children[index].setAttribute('label', labelStrings[index]);
var datePicker = document.getAnonymousNodes(this)[3];
var searchAttribute = this.searchAttribute;
var nsMsgSearchAttrib = Components.interfaces.nsMsgSearchAttrib;
var time;
if (searchAttribute == nsMsgSearchAttrib.Date)
time = datePicker.value;
else
time = new Date();
datePicker.setAttribute("value",convertDateToString(time));
]]>
</constructor>
</implementation>
<handlers>
<handler event="keypress"><![CDATA[
if (event.keyCode == 13) {
onEnterInSearchTerm();
}
]]></handler>
</handlers>
</binding>
<binding id="searchterm" name="searchTerm" extends="xul:box">
<implementation>
<field name="internalSearchTerm">null</field>
<field name="internalBooleanAnd">null</field>
<!-- the actual nsIMsgSearchTerm object -->
<property name="searchTerm" onget="return this.internalSearchTerm">
<setter>
<![CDATA[
this.internalSearchTerm = val;
var term = val;
// val is a nsIMsgSearchTerm
var searchAttribute=this.searchattribute;
var searchOperator=this.searchoperator;
var searchValue=this.searchvalue;
// now reflect all attributes of the searchterm into the widgets
if (searchAttribute) searchAttribute.value = term.attrib;
if (searchOperator) searchOperator.value = val.op;
if (searchValue) searchValue.value = term.value;
this.booleanAnd = val.booleanAnd;
]]>
</setter>
</property>
<property name="searchScope">
<getter>
<![CDATA[
var searchAttribute = this.searchattribute;
if (searchAttribute)
return searchAttribute.searchScope;
return undefined;
]]>
</getter>
<setter>
<![CDATA[
var searchAttribute = this.searchattribute;
if (searchAttribute) searchAttribute.searchScope=val;
]]>
</setter>
</property>
<!-- the three tags that make up a term - to use, set the
attribute in the XUL to the ID of the term.
-->
<property name="searchattribute"
onget="return document.getElementById(this.getAttribute('searchattribute'));"
onset="this.setAttribute('searchattribute',val.id)"/>
<property name="searchoperator"
onget="return document.getElementById(this.getAttribute('searchoperator'));"
onset="this.setAttribute('searchoperator',val.id)"/>
<property name="searchvalue"
onget="return document.getElementById(this.getAttribute('searchvalue'));"
onset="this.setAttribute('searchvalue',val.id)"/>
<field name="booleanNodes">
<![CDATA[
null;
]]>
</field>
<field name="stringBundle">
<![CDATA[
srGetStrBundle("chrome://messenger/locale/search.properties");
]]>
</field>
<property name="booleanAnd" onget="return this.internalBooleanAnd">
<setter>
<![CDATA[
// whenever you set this, all nodes in booleanNodes
// are updated to reflect the string
if (this.internalBooleanAnd == val) return;
this.internalBooleanAnd = val;
var booleanNodes = this.booleanNodes;
if (!booleanNodes) return;
var stringBundle = this.stringBundle;
var andString = val ? "And" : "Or";
for (var i=0; i<booleanNodes.length; i++) {
try {
var staticString =
stringBundle.GetStringFromName("search" + andString + i);
if (staticString && staticString.length>0)
booleanNodes[i].setAttribute("value", staticString);
} catch (ex) { /* no error, means string not found */}
}
]]>
</setter>
</property>
<method name="save">
<body>
<![CDATA[
var searchTerm = this.searchTerm;
searchTerm.attrib = this.searchattribute.value;
if (this.searchAttribute > nsMsgSearchAttrib.OtherHeader && this.searchAttribute < nsMsgSearchAttrib.kNumMsgSearchAttributes)
searchTerm.arbitraryHeader = this.searchattribute.label;
searchTerm.op = this.searchoperator.value;
if (this.searchvalue.value)
this.searchvalue.save();
else
this.searchvalue.saveTo(searchTerm.value);
searchTerm.value = this.searchvalue.value;
searchTerm.booleanAnd = this.booleanAnd;
]]>
</body>
</method>
<!-- if you have a search term element with no search term -->
<method name="saveTo">
<parameter name="searchTerm"/>
<body>
<![CDATA[
this.internalSearchTerm = searchTerm;
this.save();
]]>
</body>
</method>
</implementation>
</binding>
</bindings>

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

@ -1,617 +0,0 @@
/* -*- 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.
*
* Contributors(s):
* Jan Varga <varga@utcru.sk>
* Håkan Waara (hwaara@chello.se)
*/
//This file stores variables common to mail windows
var messengerContractID = "@mozilla.org/messenger;1";
var statusFeedbackContractID = "@mozilla.org/messenger/statusfeedback;1";
var mailSessionContractID = "@mozilla.org/messenger/services/session;1";
var secureUIContractID = "@mozilla.org/secure_browser_ui;1";
var prefContractID = "@mozilla.org/preferences-service;1";
var msgWindowContractID = "@mozilla.org/messenger/msgwindow;1";
var messenger;
var pref;
var statusFeedback;
var messagePaneController;
var msgWindow;
var msgComposeService;
var accountManager;
var RDF;
var msgComposeType;
var msgComposeFormat;
var mailSession;
var gMessengerBundle;
var gBrandBundle;
var datasourceContractIDPrefix = "@mozilla.org/rdf/datasource;1?name=";
var accountManagerDSContractID = datasourceContractIDPrefix + "msgaccountmanager";
var folderDSContractID = datasourceContractIDPrefix + "mailnewsfolders";
var accountManagerDataSource;
var folderDataSource;
var messagesBox = null;
var accountCentralBox = null;
var gSearchBox = null;
var gAccountCentralLoaded = false;
var gFakeAccountPageLoaded = false;
var gPaneConfig = null;
//End progress and Status variables
// for checking if the folder loaded is Draft or Unsent which msg is editable
var gIsEditableMsgFolder = false;
var gOfflineManager;
// cache the last keywords
var gLastKeywords = "";
function OnMailWindowUnload()
{
RemoveMailOfflineObserver();
var searchSession = GetSearchSession();
if (searchSession)
{
removeGlobalListeners();
if (gPreQuickSearchView) //close the cached pre quick search view
gPreQuickSearchView.close();
}
var dbview = GetDBView();
if (dbview) {
dbview.close();
}
var mailSession = Components.classes[mailSessionContractID].getService();
if(mailSession)
{
mailSession = mailSession.QueryInterface(Components.interfaces.nsIMsgMailSession);
if(mailSession)
{
mailSession.RemoveFolderListener(folderListener);
}
}
mailSession.RemoveMsgWindow(msgWindow);
messenger.SetWindow(null, null);
var msgDS = folderDataSource.QueryInterface(Components.interfaces.nsIMsgRDFDataSource);
msgDS.window = null;
msgDS = accountManagerDataSource.QueryInterface(Components.interfaces.nsIMsgRDFDataSource);
msgDS.window = null;
msgWindow.closeWindow();
}
function CreateMailWindowGlobals()
{
// get the messenger instance
messenger = Components.classes[messengerContractID].createInstance();
messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger);
pref = Components.classes[prefContractID].getService(Components.interfaces.nsIPrefBranch);
//Create windows status feedback
// set the JS implementation of status feedback before creating the c++ one..
window.MsgStatusFeedback = new nsMsgStatusFeedback();
// double register the status feedback object as the xul browser window implementation
window.XULBrowserWindow = window.MsgStatusFeedback;
statusFeedback = Components.classes[statusFeedbackContractID].createInstance();
statusFeedback = statusFeedback.QueryInterface(Components.interfaces.nsIMsgStatusFeedback);
/*
not in use unless we want the lock button back
// try to create and register ourselves with a security icon...
var securityIcon = document.getElementById("security-button");
if (securityIcon) {
// if the client isn't built with psm enabled then we won't have a secure UI to monitor the lock icon
// so be sure to wrap this in a try / catch clause...
try {
var secureUI;
// we may not have a secure UI if psm isn't installed!
if (secureUIContractID in Components.classes) {
secureUI = Components.classes[secureUIContractID].createInstance();
if (secureUI) {
secureUI = secureUI.QueryInterface(Components.interfaces.nsISecureBrowserUI);
secureUI.init(_content, securityIcon);
}
}
}
catch (ex) {}
}
*/
window.MsgWindowCommands = new nsMsgWindowCommands();
//Create message window object
msgWindow = Components.classes[msgWindowContractID].createInstance();
msgWindow = msgWindow.QueryInterface(Components.interfaces.nsIMsgWindow);
msgComposeService = Components.classes['@mozilla.org/messengercompose;1'].getService();
msgComposeService = msgComposeService.QueryInterface(Components.interfaces.nsIMsgComposeService);
mailSession = Components.classes["@mozilla.org/messenger/services/session;1"].getService(Components.interfaces.nsIMsgMailSession);
accountManager = Components.classes["@mozilla.org/messenger/account-manager;1"].getService(Components.interfaces.nsIMsgAccountManager);
RDF = Components.classes['@mozilla.org/rdf/rdf-service;1'].getService();
RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService);
msgComposeType = Components.interfaces.nsIMsgCompType;
msgComposeFormat = Components.interfaces.nsIMsgCompFormat;
gMessengerBundle = document.getElementById("bundle_messenger");
gBrandBundle = document.getElementById("bundle_brand");
//Create datasources
accountManagerDataSource = Components.classes[accountManagerDSContractID].createInstance();
folderDataSource = Components.classes[folderDSContractID].createInstance();
messagesBox = document.getElementById("messagesBox");
accountCentralBox = document.getElementById("accountCentralBox");
gSearchBox = document.getElementById("searchBox");
gPaneConfig = pref.getIntPref("mail.pane_config");
}
function InitMsgWindow()
{
msgWindow.messagePaneController = new nsMessagePaneController();
msgWindow.statusFeedback = statusFeedback;
msgWindow.msgHeaderSink = messageHeaderSink;
msgWindow.SetDOMWindow(window);
mailSession.AddMsgWindow(msgWindow);
}
function AddDataSources()
{
accountManagerDataSource = accountManagerDataSource.QueryInterface(Components.interfaces.nsIRDFDataSource);
folderDataSource = folderDataSource.QueryInterface(Components.interfaces.nsIRDFDataSource);
//to move menu item
SetupMoveCopyMenus('moveMenu', accountManagerDataSource, folderDataSource);
//to copy menu item
SetupMoveCopyMenus('copyMenu', accountManagerDataSource, folderDataSource);
//To FileButton menu
SetupMoveCopyMenus('button-file', accountManagerDataSource, folderDataSource);
//To move and copy menus in message pane context
SetupMoveCopyMenus("messagePaneContext-copyMenu", accountManagerDataSource, folderDataSource);
SetupMoveCopyMenus("messagePaneContext-moveMenu", accountManagerDataSource, folderDataSource);
//Add statusFeedback
var msgDS = folderDataSource.QueryInterface(Components.interfaces.nsIMsgRDFDataSource);
msgDS.window = msgWindow;
msgDS = accountManagerDataSource.QueryInterface(Components.interfaces.nsIMsgRDFDataSource);
msgDS.window = msgWindow;
}
function SetupMoveCopyMenus(menuid, accountManagerDataSource, folderDataSource)
{
var menu = document.getElementById(menuid);
if(menu)
{
menu.database.AddDataSource(accountManagerDataSource);
menu.database.AddDataSource(folderDataSource);
menu.setAttribute('ref', 'msgaccounts:/');
}
}
function dumpProgress() {
var broadcaster = document.getElementById("Messenger:LoadingProgress");
dump( "broadcaster mode=" + broadcaster.getAttribute("mode") + "\n" );
dump( "broadcaster value=" + broadcaster.getAttribute("value") + "\n" );
dump( "meter mode=" + meter.getAttribute("mode") + "\n" );
dump( "meter value=" + meter.getAttribute("value") + "\n" );
}
// We're going to implement our status feedback for the mail window in JS now.
// the following contains the implementation of our status feedback object
function nsMsgStatusFeedback()
{
}
nsMsgStatusFeedback.prototype =
{
// global variables for status / feedback information....
statusTextFld : null,
statusBar : null,
throbber : null,
stopCmd : null,
startTimeoutID : null,
stopTimeoutID : null,
pendingStartRequests : 0,
meteorsSpinning : false,
ensureStatusFields : function()
{
if (!this.statusTextFld ) this.statusTextFld = document.getElementById("statusText");
if (!this.statusBar) this.statusBar = document.getElementById("statusbar-icon");
if(!this.throbber) this.throbber = document.getElementById("navigator-throbber");
if(!this.stopCmd) this.stopCmd = document.getElementById("cmd_stop");
},
// nsIXULBrowserWindow implementation
setJSStatus : function(status)
{
},
setJSDefaultStatus : function(status)
{
},
setOverLink : function(link)
{
this.showStatusString(link);
},
QueryInterface : function(iid)
{
if (iid.equals(Components.interfaces.nsIMsgStatusFeedback) ||
iid.equals(Components.interfaces.nsIXULBrowserWindow))
return this;
throw Components.results.NS_NOINTERFACE;
},
// nsIMsgStatusFeedback implementation.
showStatusString : function(statusText)
{
this.ensureStatusFields();
if ( statusText == "" )
statusText = defaultStatus;
this.statusTextFld.label = statusText;
},
_startMeteors : function()
{
this.ensureStatusFields();
this.meteorsSpinning = true;
this.startTimeoutID = null;
// Turn progress meter on.
this.statusBar.setAttribute("mode","undetermined");
// turn throbber on
this.throbber.setAttribute("busy", true);
//turn on stop button and menu
this.stopCmd.removeAttribute("disabled");
},
startMeteors : function()
{
this.pendingStartRequests++;
// if we don't already have a start meteor timeout pending
// and the meteors aren't spinning, then kick off a start
if (!this.startTimeoutID && !this.meteorsSpinning)
this.startTimeoutID = setTimeout('window.MsgStatusFeedback._startMeteors();', 500);
// since we are going to start up the throbber no sense in processing
// a stop timeout...
if (this.stopTimeoutID)
{
clearTimeout(this.stopTimeoutID);
this.stopTimeoutID = null;
}
},
_stopMeteors : function()
{
if(gTimelineEnabled){
gTimelineService.stopTimer("FolderLoading");
gTimelineService.markTimer("FolderLoading");
gTimelineService.resetTimer("FolderLoading");
}
this.ensureStatusFields();
var msg = gMessengerBundle.getString("documentDone");
this.showStatusString(msg);
defaultStatus = msg;
this.throbber.setAttribute("busy", false);
// Turn progress meter off.
this.statusBar.setAttribute("mode","normal");
this.statusBar.value = 0; // be sure to clear the progress bar
this.statusBar.label = "";
this.stopCmd.setAttribute("disabled", "true");
this.meteorsSpinning = false;
this.stopTimeoutID = null;
},
stopMeteors : function()
{
if (this.pendingStartRequests > 0)
this.pendingStartRequests--;
// if we are going to be starting the meteors, cancel the start
if (this.pendingStartRequests == 0 && this.startTimeoutID)
{
clearTimeout(this.startTimeoutID);
this.startTimeoutID = null;
}
// if we have no more pending starts and we don't have a stop timeout already in progress
// AND the meteors are currently running then fire a stop timeout to shut them down.
if (this.pendingStartRequests == 0 && !this.stopTimeoutID)
{
if (this.meteorsSpinning)
this.stopTimeoutID = setTimeout('window.MsgStatusFeedback._stopMeteors();', 500);
}
},
showProgress : function(percentage)
{
this.ensureStatusFields();
if (percentage >= 0)
{
this.statusBar.setAttribute("mode", "normal");
this.statusBar.value = percentage;
this.statusBar.label = Math.round(percentage) + "%";
}
},
closeWindow : function(percent)
{
}
}
function nsMsgWindowCommands()
{
}
nsMsgWindowCommands.prototype =
{
QueryInterface : function(iid)
{
if(iid.equals(Components.interfaces.nsIMsgWindowCommands))
return this;
throw Components.results.NS_NOINTERFACE;
return null;
},
SelectFolder: function(folderUri)
{
SelectFolder(folderUri);
},
SelectMessage: function(messageUri)
{
SelectMessage(messageUri);
}
}
function nsMessagePaneController()
{
}
nsMessagePaneController.prototype =
{
QueryInterface : function(iid)
{
if(iid.equals(Components.interfaces.nsIMsgMessagePaneController))
return this;
throw Components.results.NS_NOINTERFACE;
return null;
},
clearMsgPane: function()
{
if (gDBView)
setTitleFromFolder(gDBView.msgFolder,null);
else
setTitleFromFolder(null,null);
ClearMessagePane();
}
}
function StopUrls()
{
msgWindow.StopUrls();
}
function loadStartPage() {
try {
var startpageenabled = pref.getBoolPref("mailnews.start_page.enabled");
if (startpageenabled) {
var startpage = pref.getComplexValue("mailnews.start_page.url",
Components.interfaces.nsIPrefLocalizedString).data;
if (startpage != "") {
// first, clear out the charset setting.
messenger.setDisplayCharset("");
GetMessagePaneFrame().location = startpage;
//dump("start message pane with: " + startpage + "\n");
ClearMessageSelection();
}
}
}
catch (ex) {
dump("Error loading start page.\n");
return;
}
}
// 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()
{
try
{
var acctCentralPage = pref.getComplexValue("mailnews.account_central_page.url",
Components.interfaces.nsIPrefLocalizedString).data;
switch (gPaneConfig)
{
case 0:
messagesBox.setAttribute("collapsed", "true");
gSearchBox.setAttribute("collapsed", "true");
accountCentralBox.removeAttribute("collapsed");
window.frames["accountCentralPane"].location = acctCentralPage;
gAccountCentralLoaded = true;
break;
case 1:
var messagePaneBox = document.getElementById("messagepanebox");
messagePaneBox.setAttribute("collapsed", "true");
var searchAndThreadPaneBox = document.getElementById("searchAndthreadpaneBox");
searchAndThreadPaneBox.setAttribute("collapsed", "true");
var threadPaneSplitter = document.getElementById("threadpane-splitter");
threadPaneSplitter.setAttribute("collapsed", "true");
accountCentralBox.removeAttribute("collapsed");
window.frames["accountCentralPane"].location = acctCentralPage;
gAccountCentralLoaded = true;
break;
}
}
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()
{
try
{
switch (gPaneConfig)
{
case 0:
window.frames["accountCentralPane"].location = "about:blank";
accountCentralBox.setAttribute("collapsed", "true");
gSearchBox.removeAttribute("collapsed");
messagesBox.removeAttribute("collapsed");
gAccountCentralLoaded = false;
break;
case 1:
window.frames["accountCentralPane"].location = "about:blank";
accountCentralBox.setAttribute("collapsed", "true");
var messagePaneBox = document.getElementById("messagepanebox");
messagePaneBox.removeAttribute("collapsed");
var searchAndThreadPaneBox = document.getElementById("searchAndthreadpaneBox");
searchAndThreadPaneBox.removeAttribute("collapsed");
var threadPaneSplitter = document.getElementById("threadpane-splitter");
threadPaneSplitter.removeAttribute("collapsed");
gAccountCentralLoaded = false;
break;
}
}
catch (ex)
{
dump("Error hiding AccountCentral page -> " + ex + "\n");
return;
}
}
// Given the server, open the twisty and the set the selection
// on inbox of that server.
// prompt if offline.
function OpenInboxForServer(server)
{
try {
HideAccountCentral();
var inboxFolder = GetInboxFolder(server);
SelectFolder(inboxFolder.URI);
if(CheckOnline())
GetMessagesForInboxOnServer(server);
else {
var option = PromptGetMessagesOffline();
if(option == 0) {
if (!gOfflineManager)
GetOfflineMgrService();
gOfflineManager.goOnline(false /* sendUnsentMessages */,
false /* playbackOfflineImapOperations */,
msgWindow);
GetMessagesForInboxOnServer(server);
}
}
}
catch (ex) {
dump("Error opening inbox for server -> " + ex + "\n");
return;
}
}
function GetSearchSession()
{
if (("gSearchSession" in top) && gSearchSession)
return gSearchSession;
else
return null;
}
function SetKeywords(aKeywords)
{
// we cache the last keywords.
// if there is no chagne, we do nothing.
// most of the time, this will be the case.
if (aKeywords == gLastKeywords)
return;
// these are the UI elements who care about keywords
var elements = document.getElementsByAttribute("keywordrelated","true");
var len = elements.length;
for (var i=0; i<len; i++) {
var element = elements[i];
var originalclass = element.getAttribute("originalclass");
// we use XBL for certain headers.
// if the element has keywordrelated="true"
// but no original class, it's an XBL widget
// so to get the real element, use getAnonymousElementByAttribute()
if (!originalclass) {
element = document.getAnonymousElementByAttribute(element, "keywordrelated", "true");
originalclass = element.getAttribute("originalclass");
}
if (aKeywords) {
if (element.getAttribute("appendoriginalclass") == "true") {
aKeywords += " " + originalclass;
}
element.setAttribute("class", aKeywords);
}
else {
// if no keywords, reset class to the original class
element.setAttribute("class", originalclass);
}
}
// cache the keywords
gLastKeywords = aKeywords;
}

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

@ -1,28 +0,0 @@
<!--
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.
-->
<overlay
xmlns:nc="http://home.netscape.com/NC-rdf#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!-- plug in your mail window extras here.
see http://www.mozilla.org/mailnews/arch/mailwindowextras.html -->
</overlay>

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

@ -1,87 +0,0 @@
<?xml version="1.0"?>
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
<!-- list all the packages being supplied by this jar -->
<RDF:Seq about="urn:mozilla:package:root">
<RDF:li resource="urn:mozilla:package:messenger"/>
</RDF:Seq>
<!-- package information -->
<RDF:Description about="urn:mozilla:package:messenger"
chrome:displayName="Messenger"
chrome:author="mozilla.org"
chrome:name="messenger">
</RDF:Description>
<!-- overlay information -->
<RDF:Seq about="urn:mozilla:overlays">
<RDF:li resource="chrome://communicator/content/pref/preftree.xul"/>
<RDF:li resource="chrome://communicator/content/pref/pref-appearance.xul"/>
<RDF:li resource="chrome://communicator/content/pref/pref-advanced.xul"/>
<RDF:li resource="chrome://communicator/content/tasksOverlay.xul"/>
<RDF:li resource="chrome://navigator/content/navigatorOverlay.xul"/>
<RDF:li resource="chrome://messenger/content/messenger.xul"/>
<RDF:li resource="chrome://messenger/content/mail3PaneWindowVertLayout.xul"/>
<RDF:li resource="chrome://messenger/content/messengercompose/messengercompose.xul"/>
<RDF:li resource="chrome://messenger/content/addressbook/addressbook.xul"/>
<RDF:li resource="chrome://messenger/content/addressbook/abSelectAddressesDialog.xul"/>
<RDF:li resource="chrome://editor/content/editor.xul"/>
</RDF:Seq>
<!-- messenger preferences branches -->
<RDF:Seq about="chrome://communicator/content/pref/preftree.xul">
<RDF:li>chrome://messenger/content/mailPrefsOverlay.xul</RDF:li>
</RDF:Seq>
<!-- messenger startup pref -->
<RDF:Seq about="chrome://communicator/content/pref/pref-appearance.xul">
<RDF:li>chrome://messenger/content/mailPrefsOverlay.xul</RDF:li>
</RDF:Seq>
<!-- messenger js toggle pref -->
<RDF:Seq about="chrome://communicator/content/pref/pref-advanced.xul">
<RDF:li>chrome://messenger/content/mailPrefsOverlay.xul</RDF:li>
</RDF:Seq>
<!-- messenger taskbar/tasks menu items -->
<RDF:Seq about="chrome://communicator/content/tasksOverlay.xul">
<RDF:li>chrome://messenger/content/mailTasksOverlay.xul</RDF:li>
</RDF:Seq>
<!-- messenger items for Navigator -->
<RDF:Seq about="chrome://navigator/content/navigatorOverlay.xul">
<RDF:li>chrome://messenger/content/mailNavigatorOverlay.xul</RDF:li>
</RDF:Seq>
<!-- messenger items for Messenger -->
<RDF:Seq about="chrome://messenger/content/messenger.xul">
<RDF:li>chrome://messenger/content/mailMessengerOverlay.xul</RDF:li>
</RDF:Seq>
<RDF:Seq about="chrome://messenger/content/mail3PaneWindowVertLayout.xul">
<RDF:li>chrome://messenger/content/mailMessengerOverlay.xul</RDF:li>
</RDF:Seq>
<!-- messenger items for Mail Compose -->
<RDF:Seq about="chrome://messenger/content/messengercompose/messengercompose.xul">
<RDF:li>chrome://messenger/content/mailMessengerComposeOverlay.xul</RDF:li>
</RDF:Seq>
<!-- messenger items for Addressbook -->
<RDF:Seq about="chrome://messenger/content/addressbook/addressbook.xul">
<RDF:li>chrome://messenger/content/mailABOverlay.xul</RDF:li>
</RDF:Seq>
<!-- messenger items for Select Addresses dialog -->
<RDF:Seq about="chrome://messenger/content/addressbook/abSelectAddressesDialog.xul">
<RDF:li>chrome://messenger/content/mailOverlay.xul</RDF:li>
</RDF:Seq>
<!-- messenger items for Composer -->
<RDF:Seq about="chrome://editor/content/editor.xul">
<RDF:li>chrome://messenger/content/mailEditorOverlay.xul</RDF:li>
</RDF:Seq>
</RDF:RDF>

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

@ -1,24 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://messenger/skin/messenger.css" type="text/css"?>
<!DOCTYPE window>
<window
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<html:style>
window {
overflow: auto;
}
</html:style>
<vbox style="width: 100%; height: 100%">
<hbox flex="100%">
<html:iframe name="browser.webwindow" width="100%" height="325px" flex="100%"> </html:iframe>
</hbox>
</vbox>
</window>

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

@ -1,903 +0,0 @@
/* -*- Mode: C++; 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.
*/
/* This is where functions related to the standalone message window are kept */
/* globals for a particular window */
var compositeDataSourceContractID = datasourceContractIDPrefix + "composite-datasource";
var gCompositeDataSource;
var gCurrentMessageUri;
var gCurrentFolderUri;
var gThreadPaneCommandUpdater = null;
var gCurrentMessageIsDeleted = false;
var gNextMessageViewIndexAfterDelete = -2;
// the folderListener object
var folderListener = {
OnItemAdded: function(parentItem, item, view) {},
OnItemRemoved: function(parentItem, item, view) {
var parentFolderResource = parentItem.QueryInterface(Components.interfaces.nsIRDFResource);
if(!parentFolderResource)
return;
var parentURI = parentFolderResource.Value;
if(parentURI != gCurrentFolderUri)
return;
var deletedMessageHdr = item.QueryInterface(Components.interfaces.nsIMsgDBHdr);
if (extractMsgKeyFromURI() == deletedMessageHdr.messageKey)
gCurrentMessageIsDeleted = true;
},
OnItemPropertyChanged: function(item, property, oldValue, newValue) {},
OnItemIntPropertyChanged: function(item, property, oldValue, newValue) { },
OnItemBoolPropertyChanged: function(item, property, oldValue, newValue) {},
OnItemUnicharPropertyChanged: function(item, property, oldValue, newValue){},
OnItemPropertyFlagChanged: function(item, property, oldFlag, newFlag) {},
OnItemEvent: function(folder, event) {
if (event.GetUnicode() == "DeleteOrMoveMsgCompleted") {
HandleDeleteOrMoveMsgCompleted(folder);
}
else if (event.GetUnicode() == "DeleteOrMoveMsgFailed") {
HandleDeleteOrMoveMsgFailed(folder);
}
else if (event.GetUnicode() == "msgLoaded") {
OnMsgLoaded(folder, gCurrentMessageUri);
}
}
}
var messagepaneObserver = {
canHandleMultipleItems: false,
onDrop: function (aEvent, aData, aDragSession)
{
var sourceUri = aData.data;
if (sourceUri != gCurrentMessageUri)
{
var msgHdr = GetMsgHdrFromUri(sourceUri);
var folderUri = msgHdr.folder.URI;
if (folderUri != gCurrentFolderUri)
UpdateDBView(folderUri);
SelectMessage(sourceUri);
}
},
onDragOver: function (aEvent, aFlavour, aDragSession)
{
var messagepanebox = document.getElementById("messagepanebox");
messagepanebox.setAttribute("dragover", "true");
},
onDragExit: function (aEvent, aDragSession)
{
var messagepanebox = document.getElementById("messagepanebox");
messagepanebox.removeAttribute("dragover");
},
canDrop: function(aEvent, aDragSession) //allow drop from mail:3pane window only - 4xp
{
var doc = aDragSession.sourceNode.ownerDocument;
var elem = doc.getElementById("messengerWindow");
return (elem && (elem.getAttribute("windowtype") == "mail:3pane"));
},
getSupportedFlavours: function ()
{
var flavourSet = new FlavourSet();
flavourSet.appendFlavour("text/x-moz-message");
return flavourSet;
}
};
function UpdateDBView(folderUri)
{
var dbview = GetDBView(); //close old folder view
if (dbview) {
dbview.close();
}
SelectFolder(folderUri);
CreateView(null); //create new folder view
}
function nsMsgDBViewCommandUpdater()
{}
function UpdateStandAloneMessageCounts()
{
// hook for extra toolbar items
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
observerService.notifyObservers(window, "mail:updateStandAloneMessageCounts", "");
}
nsMsgDBViewCommandUpdater.prototype =
{
updateCommandStatus : function()
{
// the back end is smart and is only telling us to update command status
// when the # of items in the selection has actually changed.
UpdateMailToolbar("dbview, std alone window");
},
displayMessageChanged : function(aFolder, aSubject, aKeywords)
{
setTitleFromFolder(aFolder, aSubject);
gCurrentMessageUri = gDBView.URIForFirstSelectedMessage;
UpdateStandAloneMessageCounts();
SetKeywords(aKeywords);
},
QueryInterface : function(iid)
{
if(iid.equals(Components.interfaces.nsIMsgDBViewCommandUpdater))
return this;
throw Components.results.NS_NOINTERFACE;
return null;
}
}
// from MailNewsTypes.h
const nsMsgKey_None = 0xFFFFFFFF;
function HandleDeleteOrMoveMsgCompleted(folder)
{
dump("In HandleDeleteOrMoveMsgCompleted\n");
var folderResource = folder.QueryInterface(Components.interfaces.nsIRDFResource);
if(!folderResource)
return;
var folderUri = folderResource.Value;
if((folderUri == gCurrentFolderUri) && gCurrentMessageIsDeleted)
{
gDBView.onDeleteCompleted(true);
gCurrentMessageIsDeleted = false;
if (gNextMessageViewIndexAfterDelete != nsMsgKey_None)
{
var nextMstKey = gDBView.getKeyAt(gNextMessageViewIndexAfterDelete);
if (nextMstKey != nsMsgKey_None) {
gDBView.loadMessageByMsgKey(nextMstKey);
}
else {
window.close();
}
}
else
{
// close the stand alone window because there are no more messages in the folder
window.close();
}
}
}
function HandleDeleteOrMoveMsgFailed(folder)
{
var folderResource = folder.QueryInterface(Components.interfaces.nsIRDFResource);
if(!folderResource)
return;
var folderUri = folderResource.Value;
gDBView.onDeleteCompleted(false);
if((folderUri == gCurrentFolderUri) && gCurrentMessageIsDeleted)
{
gCurrentMessageIsDeleted = false;
}
}
function OnLoadMessageWindow()
{
HideMenus();
AddMailOfflineObserver();
CreateMailWindowGlobals();
CreateMessageWindowGlobals();
verifyAccounts(null);
InitMsgWindow();
messenger.SetWindow(window, msgWindow);
InitializeDataSources();
// FIX ME - later we will be able to use onload from the overlay
OnLoadMsgHeaderPane();
try {
var nsIFolderListener = Components.interfaces.nsIFolderListener;
var notifyFlags = nsIFolderListener.removed | nsIFolderListener.event;
mailSession.AddFolderListener(folderListener, notifyFlags);
} catch (ex) {
dump("Error adding to session: " +ex + "\n");
}
var originalView = null;
if(window.arguments)
{
if(window.arguments[0])
{
gCurrentMessageUri = window.arguments[0];
}
else
{
gCurrentMessageUri = null;
}
if(window.arguments[1])
{
gCurrentFolderUri = window.arguments[1];
}
else
{
gCurrentFolderUri = null;
}
if (window.arguments[2])
originalView = window.arguments[2];
}
CreateView(originalView)
setTimeout("var msgKey = extractMsgKeyFromURI(gCurrentMessageUri); gDBView.loadMessageByMsgKey(msgKey); gNextMessageViewIndexAfterDelete = gDBView.msgToSelectAfterDelete; UpdateStandAloneMessageCounts();", 0);
SetupCommandUpdateHandlers();
var messagePaneFrame = top.frames['messagepane'];
if(messagePaneFrame)
messagePaneFrame.focus();
}
function CreateView(originalView)
{
var msgFolder = GetLoadedMsgFolder();
// extract the sort type, the sort order,
var sortType;
var sortOrder;
var viewFlags;
var viewType;
if (originalView)
{
viewType = originalView.viewType;
viewFlags = originalView.viewFlags;
sortType = originalView.sortType;
sortOrder = originalView.sortOrder;
}
else if (msgFolder)
{
var msgDatabase = msgFolder.getMsgDatabase(msgWindow);
if (msgDatabase)
{
var dbFolderInfo = msgDatabase.dBFolderInfo;
sortType = dbFolderInfo.sortType;
sortOrder = dbFolderInfo.sortOrder;
viewFlags = dbFolderInfo.viewFlags;
viewType = dbFolderInfo.viewType;
msgDatabase = null;
dbFolderInfo = null;
}
}
// create a db view
CreateBareDBView(originalView, msgFolder, viewType, viewFlags, sortType, sortOrder);
var uri;
if (gCurrentMessageUri)
uri = gCurrentMessageUri;
else if (gCurrentFolderUri)
uri = gCurrentFolderUri;
else
uri = null;
SetUpToolbarButtons(uri);
// hook for extra toolbar items
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
observerService.notifyObservers(window, "mail:setupToolbarItems", uri);
}
function extractMsgKeyFromURI()
{
var msgKey = -1;
var msgService = messenger.messageServiceFromURI(gCurrentMessageUri);
if (msgService)
{
var msgHdr = msgService.messageURIToMsgHdr(gCurrentMessageUri);
if (msgHdr)
msgKey = msgHdr.messageKey;
}
return msgKey;
}
function HideMenus()
{
var message_menuitem=document.getElementById('menu_showMessage');
if(message_menuitem)
message_menuitem.setAttribute("hidden", "true");
var expandOrCollapseMenu = document.getElementById('menu_expandOrCollapse');
if(expandOrCollapseMenu)
expandOrCollapseMenu.setAttribute("hidden", "true");
var renameFolderMenu = document.getElementById('menu_renameFolder');
if(renameFolderMenu)
renameFolderMenu.setAttribute("hidden", "true");
var viewMessagesMenu = document.getElementById('viewMessagesMenu');
if(viewMessagesMenu)
viewMessagesMenu.setAttribute("hidden", "true");
var openMessageMenu = document.getElementById('openMessageWindowMenuitem');
if(openMessageMenu)
openMessageMenu.setAttribute("hidden", "true");
var viewSortMenu = document.getElementById('viewSortMenu');
if(viewSortMenu)
viewSortMenu.setAttribute("hidden", "true");
var viewThreadedMenu = document.getElementById('menu_showThreads');
if(viewThreadedMenu)
viewThreadedMenu.setAttribute("hidden", "true");
var emptryTrashMenu = document.getElementById('menu_emptyTrash');
if(emptryTrashMenu)
emptryTrashMenu.setAttribute("hidden", "true");
var menuProperties = document.getElementById('menu_properties');
if(menuProperties)
menuProperties.setAttribute("hidden", "true");
var compactFolderMenu = document.getElementById('menu_compactFolder');
if(compactFolderMenu)
compactFolderMenu.setAttribute("hidden", "true");
var trashSeparator = document.getElementById('trashMenuSeparator');
if(trashSeparator)
trashSeparator.setAttribute("hidden", "true");
}
function OnUnloadMessageWindow()
{
// FIX ME - later we will be able to use onunload from the overlay
OnUnloadMsgHeaderPane();
OnMailWindowUnload();
}
function CreateMessageWindowGlobals()
{
gCompositeDataSource = Components.classes[compositeDataSourceContractID].createInstance();
gCompositeDataSource = gCompositeDataSource.QueryInterface(Components.interfaces.nsIRDFCompositeDataSource);
}
function InitializeDataSources()
{
AddDataSources();
//Now add datasources to composite datasource
gCompositeDataSource.AddDataSource(accountManagerDataSource);
gCompositeDataSource.AddDataSource(folderDataSource);
}
function GetSelectedMsgFolders()
{
var folderArray = new Array(1);
var msgFolder = GetLoadedMsgFolder();
if(msgFolder)
{
folderArray[0] = msgFolder;
}
return folderArray;
}
function GetFirstSelectedMessage()
{
return GetLoadedMessage();
}
function GetNumSelectedMessages()
{
if(gCurrentMessageUri)
return 1;
else
return 0;
}
function GetSelectedMessages()
{
var messageArray = new Array(1);
var message = GetLoadedMessage();
if(message) {
messageArray[0] = message;
}
return messageArray;
}
function GetSelectedIndices(dbView)
{
try {
var indicesArray = {};
var length = {};
dbView.getIndicesForSelection(indicesArray,length);
return indicesArray.value;
}
catch (ex) {
dump("ex = " + ex + "\n");
return null;
}
}
function GetLoadedMsgFolder()
{
if(gCurrentFolderUri)
{
var folderResource = RDF.GetResource(gCurrentFolderUri);
if(folderResource)
{
var msgFolder = folderResource.QueryInterface(Components.interfaces.nsIMsgFolder);
return msgFolder;
}
}
return null;
}
function GetLoadedMessage()
{
return gCurrentMessageUri;
}
//Clear everything related to the current message. called after load start page.
function ClearMessageSelection()
{
gCurrentMessageUri = null;
gCurrentFolderUri = null;
UpdateMailToolbar("clear msg, std alone window");
}
function GetCompositeDataSource(command)
{
return gCompositeDataSource;
}
function SetNextMessageAfterDelete()
{
gNextMessageViewIndexAfterDelete = gDBView.msgToSelectAfterDelete;
}
function SelectFolder(folderUri)
{
gCurrentFolderUri = folderUri;
}
function GetMsgHdrFromUri(messageUri)
{
return messenger.messageServiceFromURI(messageUri).messageURIToMsgHdr(messageUri);
}
function SelectMessage(messageUri)
{
var msgHdr = GetMsgHdrFromUri(messageUri);
gDBView.loadMessageByMsgKey(msgHdr.messageKey);
}
function ReloadMessage()
{
gDBView.reloadMessage();
}
function MsgDeleteMessageFromMessageWindow(reallyDelete, fromToolbar)
{
// if from the toolbar, return right away if this is a news message
// only allow cancel from the menu: "Edit | Cancel / Delete Message"
if (fromToolbar)
{
if (isNewsURI(gCurrentFolderUri))
{
// if news, don't delete
return;
}
}
// before we delete
SetNextMessageAfterDelete();
if (reallyDelete)
gDBView.doCommand(nsMsgViewCommandType.deleteNoTrash);
else
gDBView.doCommand(nsMsgViewCommandType.deleteMsg);
}
// MessageWindowController object (handles commands when one of the trees does not have focus)
var MessageWindowController =
{
supportsCommand: function(command)
{
switch ( command )
{
case "cmd_close":
case "cmd_reply":
case "button_reply":
case "cmd_replySender":
case "cmd_replyGroup":
case "cmd_replyall":
case "button_replyall":
case "cmd_forward":
case "button_forward":
case "cmd_forwardInline":
case "cmd_forwardAttachment":
case "cmd_editAsNew":
case "cmd_createFilterFromPopup":
case "cmd_createFilterFromMenu":
case "cmd_delete":
case "cmd_undo":
case "cmd_redo":
case "cmd_killThread":
case "cmd_watchThread":
case "button_delete":
case "button_junk":
case "cmd_shiftDelete":
case "button_print":
case "cmd_print":
case "cmd_printSetup":
case "cmd_saveAsFile":
case "cmd_saveAsTemplate":
case "cmd_viewPageSource":
case "cmd_reload":
case "cmd_getNewMessages":
case "button_getNewMessages":
case "cmd_getMsgsForAuthAccounts":
case "cmd_getNextNMessages":
case "cmd_find":
case "cmd_findAgain":
case "cmd_findPrev":
case "cmd_search":
case "button_mark":
case "cmd_markAsRead":
case "cmd_markAllRead":
case "cmd_markThreadAsRead":
case "cmd_markAsFlagged":
case "cmd_label0":
case "cmd_label1":
case "cmd_label2":
case "cmd_label3":
case "cmd_label4":
case "cmd_label5":
case "button_file":
case "cmd_file":
case "cmd_settingsOffline":
case "cmd_nextMsg":
case "button_next":
case "cmd_nextUnreadMsg":
case "cmd_nextFlaggedMsg":
case "cmd_nextUnreadThread":
case "cmd_previousMsg":
case "cmd_previousUnreadMsg":
case "cmd_previousFlaggedMsg":
return true;
case "cmd_synchronizeOffline":
case "cmd_downloadFlagged":
case "cmd_downloadSelected":
return CheckOnline();
default:
return false;
}
},
isCommandEnabled: function(command)
{
switch ( command )
{
case "cmd_createFilterFromPopup":
case "cmd_createFilterFromMenu":
var loadedFolder = GetLoadedMsgFolder();
if (!(loadedFolder && loadedFolder.server.canHaveFilters))
return false;
case "cmd_delete":
UpdateDeleteCommand();
// fall through
case "button_delete":
case "cmd_shiftDelete":
var loadedFolder = GetLoadedMsgFolder();
return gCurrentMessageUri && loadedFolder && (loadedFolder.canDeleteMessages || isNewsURI(gCurrentFolderUri));
case "button_junk":
return (!isNewsURI(gCurrentFolderUri));
case "cmd_reply":
case "button_reply":
case "cmd_replySender":
case "cmd_replyGroup":
case "cmd_replyall":
case "button_replyall":
case "cmd_forward":
case "button_forward":
case "cmd_forwardInline":
case "cmd_forwardAttachment":
case "cmd_editAsNew":
case "cmd_print":
case "button_print":
case "cmd_saveAsFile":
case "cmd_saveAsTemplate":
case "cmd_viewPageSource":
case "cmd_reload":
case "cmd_find":
case "button_mark":
case "cmd_markAsRead":
case "cmd_markAllRead":
case "cmd_markThreadAsRead":
case "cmd_label0":
case "cmd_label1":
case "cmd_label2":
case "cmd_label3":
case "cmd_label4":
case "cmd_label5":
return(true);
case "cmd_markAsFlagged":
case "button_file":
case "cmd_file":
return ( gCurrentMessageUri != null);
case "cmd_printSetup":
return true;
case "cmd_getNewMessages":
case "button_getNewMessages":
case "cmd_getMsgsForAuthAccounts":
return IsGetNewMessagesEnabled();
case "cmd_getNextNMessages":
return IsGetNextNMessagesEnabled();
case "cmd_downloadFlagged":
case "cmd_downloadSelected":
case "cmd_synchronizeOffline":
return CheckOnline();
case "cmd_settingsOffline":
return IsAccountOfflineEnabled();
case "cmd_close":
case "cmd_nextMsg":
case "button_next":
case "cmd_nextUnreadMsg":
case "cmd_nextUnreadThread":
case "cmd_previousMsg":
case "cmd_previousUnreadMsg":
return true;
case "cmd_findAgain":
case "cmd_findPrev":
return MsgCanFindAgain();
case "cmd_search":
var loadedFolder = GetLoadedMsgFolder();
if (!loadedFolder)
return false;
return loadedFolder.server.canSearchMessages;
case "cmd_undo":
case "cmd_redo":
return SetupUndoRedoCommand(command);
default:
return false;
}
},
doCommand: function(command)
{
// if the user invoked a key short cut then it is possible that we got here for a command which is
// really disabled. kick out if the command should be disabled.
if (!this.isCommandEnabled(command)) return;
var navigationType = nsMsgNavigationType.nextUnreadMessage;
switch ( command )
{
case "cmd_close":
CloseMailWindow();
break;
case "cmd_getNewMessages":
MsgGetMessage();
break;
case "cmd_undo":
messenger.Undo(msgWindow);
break;
case "cmd_redo":
messenger.Redo(msgWindow);
break;
case "cmd_getMsgsForAuthAccounts":
MsgGetMessagesForAllAuthenticatedAccounts();
break;
case "cmd_getNextNMessages":
MsgGetNextNMessages();
break;
case "cmd_reply":
MsgReplyMessage(null);
break;
case "cmd_replySender":
MsgReplySender(null);
break;
case "cmd_replyGroup":
MsgReplyGroup(null);
break;
case "cmd_replyall":
MsgReplyToAllMessage(null);
break;
case "cmd_forward":
MsgForwardMessage(null);
break;
case "cmd_forwardInline":
MsgForwardAsInline(null);
break;
case "cmd_forwardAttachment":
MsgForwardAsAttachment(null);
break;
case "cmd_editAsNew":
MsgEditMessageAsNew();
break;
case "cmd_createFilterFromPopup":
break;// This does nothing because the createfilter is invoked from the popupnode oncommand.
case "cmd_createFilterFromMenu":
MsgCreateFilter();
break;
case "cmd_delete":
MsgDeleteMessageFromMessageWindow(false, false);
break;
case "cmd_shiftDelete":
MsgDeleteMessageFromMessageWindow(true, false);
break;
case "button_junk":
MsgJunk();
break;
case "button_delete":
MsgDeleteMessageFromMessageWindow(false, true);
break;
case "cmd_printSetup":
goPageSetup();
break;
case "cmd_print":
PrintEnginePrint();
break;
case "cmd_saveAsFile":
MsgSaveAsFile();
break;
case "cmd_saveAsTemplate":
MsgSaveAsTemplate();
break;
case "cmd_viewPageSource":
MsgViewPageSource();
break;
case "cmd_reload":
MsgReload();
break;
case "cmd_find":
MsgFind();
break;
case "cmd_findAgain":
MsgFindAgain(false);
break;
case "cmd_findPrev":
MsgFindAgain(true);
break;
case "cmd_search":
MsgSearchMessages();
break;
case "button_mark":
case "cmd_markAsRead":
MsgMarkMsgAsRead(null);
return;
case "cmd_markThreadAsRead":
MsgMarkThreadAsRead();
return;
case "cmd_markAllRead":
MsgMarkAllRead();
return;
case "cmd_markAsFlagged":
MsgMarkAsFlagged(null);
return;
case "cmd_label0":
gDBView.doCommand(nsMsgViewCommandType.label0);
return;
case "cmd_label1":
gDBView.doCommand(nsMsgViewCommandType.label1);
return;
case "cmd_label2":
gDBView.doCommand(nsMsgViewCommandType.label2);
return;
case "cmd_label3":
gDBView.doCommand(nsMsgViewCommandType.label3);
return;
case "cmd_label4":
gDBView.doCommand(nsMsgViewCommandType.label4);
return;
case "cmd_label5":
gDBView.doCommand(nsMsgViewCommandType.label5);
return;
case "cmd_downloadFlagged":
MsgDownloadFlagged();
return;
case "cmd_downloadSelected":
MsgDownloadSelected();
return;
case "cmd_synchronizeOffline":
MsgSynchronizeOffline();
return;
case "cmd_settingsOffline":
MsgSettingsOffline();
return;
case "cmd_nextUnreadMsg":
case "button_next":
performNavigation(nsMsgNavigationType.nextUnreadMessage);
break;
case "cmd_nextUnreadThread":
performNavigation(nsMsgNavigationType.nextUnreadThread);
break;
case "cmd_nextMsg":
performNavigation(nsMsgNavigationType.nextMessage);
break;
case "cmd_nextFlaggedMsg":
performNavigation(nsMsgNavigationType.nextFlagged);
break;
case "cmd_previousMsg":
performNavigation(nsMsgNavigationType.previousMessage);
break;
case "cmd_previousUnreadMsg":
performNavigation(nsMsgNavigationType.previousUnreadMessage);
break;
case "cmd_previousFlaggedMsg":
performNavigation(nsMsgNavigationType.previousFlagged);
break;
}
},
onEvent: function(event)
{
}
};
function performNavigation(type)
{
var resultId = new Object;
var resultIndex = new Object;
var threadIndex = new Object;
gDBView.viewNavigate(type, resultId, resultIndex, threadIndex, true /* wrap */);
// if we found something....display it.
if ((resultId.value != nsMsgKey_None) && (resultIndex.value != nsMsgKey_None))
{
// load the message key
gDBView.loadMessageByMsgKey(resultId.value);
// if we changed folders, the message counts changed.
UpdateStandAloneMessageCounts();
return;
}
// we need to span another folder
CrossFolderNavigation(type, false);
}
function SetupCommandUpdateHandlers()
{
top.controllers.insertControllerAt(0, MessageWindowController);
}
function GetDBView()
{
return gDBView;
}

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

@ -1,144 +0,0 @@
<?xml version="1.0"?>
<!--
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.
-->
<?xml-stylesheet href="chrome://messenger/skin/messageWindow.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/tasksOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/platformMailnewsOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/msgHdrViewOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/mailWindowOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/mailOverlay.xul"?>
<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
%brandDTD;
<!ENTITY % messengerDTD SYSTEM "chrome://messenger/locale/messenger.dtd" >
%messengerDTD;
]>
<window id="messengerWindow"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:nc="http://home.netscape.com/NC-rdf#"
title="&messengerWindow.title;"
titlemodifier="&titleModifier.label;"
titlemenuseparator="&titleSeparator.label;"
onload="OnLoadMessageWindow()"
onunload="OnUnloadMessageWindow()"
width="750"
height="500"
persist="width height screenX screenY sizemode"
windowtype="mail:messageWindow">
<stringbundleset id="stringbundleset">
<stringbundle id="bundle_brand" src="chrome://global/locale/brand.properties"/>
<stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
<stringbundle id="bundle_offlinePrompts" src="chrome://messenger/locale/offline.properties"/>
</stringbundleset>
<!-- XXX: Replace strres.js when nsContextMenu.js is converted -->
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/shareglue.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/commandglue.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/mailWindow.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/messageWindow.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/accountUtils.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/nsContextMenu.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/mailContextMenus.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/contentAreaClick.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/contentAreaUtils.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsTransferable.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/msgViewNavigation.js"/>
<commandset id="mailCommands">
<commandset id="mailFileMenuItems"/>
<commandset id="mailViewMenuItems"/>
<commandset id="mailEditMenuItems"/>
<commandset id="mailSearchMenuItems"/>
<commandset id="mailGoMenuItems"/>
<commandset id="mailMessageMenuItems"/>
<commandset id="mailToolbarItems"/>
<commandset id="mailGetMsgMenuItems"/>
<commandset id="mailMarkMenuItems"/>
<commandset id="mailLabelMenuItems"/>
<commandset id="mailEditContextMenuItems"/>
<commandset id="tasksCommands"/>
<commandset id="commandKeys"/>
</commandset>
<broadcasterset id="mailBroadcasters">
<!-- File Menu -->
<broadcaster id="Communicator:WorkMode"/>
<!-- Edit Menu -->
</broadcasterset>
<keyset id="mailKeys">
<keyset id="tasksKeys"/>
</keyset>
<popupset>
<popup id="emailAddressPopup" popupanchor="bottomleft" onpopupshowing="goUpdateCommand('cmd_createFilterFromPopup')">
<menuitem label="&AddToAddressBook.label;"
accesskey="&AddToAddressBook.accesskey;"
oncommand="AddNodeToAddressBook(document.popupNode)"/>
<menuitem label="&SendMailTo.label;"
accesskey="&SendMailTo.accesskey;"
oncommand="SendMailToNode(document.popupNode)"/>
<menuitem label="&CopyEmailAddress.label;"
accesskey="&CopyEmailAddress.accesskey;"
oncommand="CopyEmailAddress(document.popupNode)"/>
<menuitem label="&CreateFilter.label;"
accesskey="&CreateFilter.accesskey;"
oncommand="CreateFilter(document.popupNode)"
observes="cmd_createFilterFromPopup"/>
</popup>
<popup id="allHeadersPopup" onpopupshowing="return fillAllHeadersPopup(document.popupNode);" popupanchor="bottomleft">
<hbox id="allHeadersPopupContainer"/>
</popup>
<popup id="messagePaneContext"/>
</popupset>
<popup id="attachmentListContext"/>
<toolbox id="mailToolbarToolbox">
<menubar id="mailMenubar"/>
</toolbox>
<!-- msg header view -->
<vbox id="messagesBox" flex="1">
<vbox id="messagepanebox" flex="3" persist="collapsed"
ondragover="nsDragAndDrop.dragOver(event, messagepaneObserver);"
ondragdrop="nsDragAndDrop.drop(event, messagepaneObserver);"
ondragexit="nsDragAndDrop.dragExit(event, messagepaneObserver);">
<hbox id="msgHeaderView"/>
<!-- message view -->
<browser id="messagepane" context="messagePaneContext" style="height: 0px; min-height: 1px" flex="1" name="messagepane"
disableHistory="true" type="content-primary" src="about:blank" onclick="contentAreaClick(event);"/>
</vbox>
</vbox>
<statusbar class="chromeclass-status" id="status-bar"/>
</window>

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

@ -1,71 +0,0 @@
/*
* 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.
*
* Contributor(s):
*
*/
/* ===== messenger.css ==================================================
== Content specific styles for Messenger.
======================================================================= */
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
/* ::::: mail xbl bindings ::::: */
mail-emailaddress {
-moz-binding: url("chrome://messenger/content/mailWidgets.xml#mail-emailaddress");
}
mail-emailheaderfield {
-moz-binding: url("chrome://messenger/content/mailWidgets.xml#mail-emailheaderfield");
}
mail-toggle-headerfield {
-moz-binding: url("chrome://messenger/content/mailWidgets.xml#mail-toggle-headerfield");
}
mail-multi-emailHeaderField {
-moz-binding: url("chrome://messenger/content/mailWidgets.xml#mail-multi-emailHeaderField");
}
mail-headerfield {
-moz-binding: url("chrome://messenger/content/mailWidgets.xml#mail-headerfield");
}
searchattribute {
-moz-binding: url("chrome://messenger/content/mailWidgets.xml#searchattribute");
}
searchoperator {
-moz-binding: url("chrome://messenger/content/mailWidgets.xml#searchoperator");
}
searchvalue {
display: -moz-deck;
-moz-binding: url("chrome://messenger/content/mailWidgets.xml#searchvalue");
}
searchterm {
-moz-binding: url("chrome://messenger/content/mailWidgets.xml#searchterm");
}
dummy.usesMailWidgets {
-moz-binding: url("chrome://messenger/content/mailWidgets.xml#dummy");
}

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

@ -1,187 +0,0 @@
<?xml version="1.0"?>
<!--
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.
-->
<?xml-stylesheet href="chrome://messenger/skin/mailWindow1.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/platformMailnewsOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/threadPane.xul"?>
<?xul-overlay href="chrome://messenger/content/folderPane.xul"?>
<?xul-overlay href="chrome://messenger/content/msgHdrViewOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/mailWindowOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/mailOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/contentAreaContextOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/tasksOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/communicatorOverlay.xul"?>
<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
%brandDTD;
<!ENTITY % messengerDTD SYSTEM "chrome://messenger/locale/messenger.dtd" >
%messengerDTD;
]>
<window id="messengerWindow"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:nc="http://home.netscape.com/NC-rdf#"
title="&messengerWindow.title;"
titlemodifier="&titleModifier.label;"
titlemenuseparator="&titleSeparator.label;"
onload="OnLoadMessenger()"
onunload="OnUnloadMessenger()"
width="750"
height="500"
screenX="10" screenY="10"
persist="width height screenX screenY sizemode"
windowtype="mail:3pane">
<stringbundleset id="stringbundleset">
<stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
<stringbundle id="bundle_brand" src="chrome://global/locale/brand.properties"/>
<stringbundle id="bundle_search" src="chrome://messenger/locale/search.properties"/>
</stringbundleset>
<script type="application/x-javascript" src="chrome://messenger/content/widgetglue.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/commandglue.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/shareglue.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/msgViewNavigation.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/mailWindow.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/msgMail3PaneWindow.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/mail3PaneWindowCommands.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/mailContextMenus.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/messengerdnd.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/accountUtils.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/msgAccountCentral.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/mail-offline.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/searchBar.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/contentAreaClick.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsTransferable.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/>
<commandset id="mailCommands">
<commandset id="mailFileMenuItems"/>
<commandset id="mailViewMenuItems"/>
<commandset id="mailEditMenuItems"/>
<commandset id="mailEditContextMenuItems"/>
<commandset id="mailSearchMenuItems"/>
<commandset id="mailGoMenuItems"/>
<commandset id="mailMessageMenuItems"/>
<commandset id="mailToolbarItems"/>
<commandset id="mailGetMsgMenuItems"/>
<commandset id="mailMarkMenuItems"/>
<commandset id="mailLabelMenuItems"/>
<commandset id="globalEditMenuItems"/>
<commandset id="selectEditMenuItems"/>
<commandset id="clipboardEditMenuItems"/>
<commandset id="FocusRingUpdate_Mail"
commandupdater="true"
events="focus"
oncommandupdate="FocusRingUpdate_Mail()"/>
<commandset id="tasksCommands"/>
<command id="toggleSidebar"/>
</commandset>
<broadcasterset id="mailBroadcasters">
<!-- File Menu -->
<broadcaster id="Communicator:WorkMode"/>
<!-- Edit Menu -->
</broadcasterset>
<keyset id="mailKeys">
<key id="showHideSidebar"/>
<keyset id="tasksKeys"/>
</keyset>
<popup id="threadPaneContext"/>
<popup id="folderPaneContext"/>
<popup id="attachmentListContext"/>
<tooltip id="attachmentListTooltip"/>
<popup id="emailAddressPopup" popupanchor="bottomleft" onpopupshowing="goUpdateCommand('cmd_createFilterFromPopup')">
<menuitem label="&AddToAddressBook.label;"
accesskey="&AddToAddressBook.accesskey;"
oncommand="AddNodeToAddressBook(document.popupNode)"/>
<menuitem label="&SendMailTo.label;"
accesskey="&SendMailTo.accesskey;"
oncommand="SendMailToNode(document.popupNode)"/>
<menuitem label="&CopyEmailAddress.label;"
accesskey="&CopyEmailAddress.accesskey;"
oncommand="CopyEmailAddress(document.popupNode)"/>
<menuitem label="&CreateFilter.label;"
accesskey="&CreateFilter.accesskey;"
oncommand="CreateFilter(document.popupNode)"
observes="cmd_createFilterFromPopup"/>
</popup>
<popup id="allHeadersPopup" onpopupshowing="return fillAllHeadersPopup(document.popupNode);" popupanchor="bottomleft">
<hbox id="allHeadersPopupContainer">
</hbox>
</popup>
<popup id="messagePaneContext"/>
<toolbox id="mailToolbarToolbox" class="toolbox-top">
<menubar id="mailMenubar"/>
</toolbox>
<hbox style="height:100px" flex="1">
<vbox id="folderPaneBox" flex="1" autostretch="always" persist="width">
<tree id="folderTree" flex="1" style="min-width: 100px;" context="folderPaneContext" persist="collapsed width height"/>
</vbox>
<splitter id="gray_vertical_splitter" collapse="before" persist="state">
<grippy/>
</splitter>
<vbox id="messengerBox" flex="1" persist="width">
<vbox id="accountCentralBox" flex="1">
<iframe name="accountCentralPane" flex="1" src="about:blank"/>
</vbox>
<vbox id="messagesBox" flex="1">
<hbox id="searchBox"/>
<tree id="threadTree" flex="2" persist="height" style="height:0px" context="threadPaneContext"/>
<!-- if you change this id, please change GetThreadAndMessagePaneSplitter() and MsgToggleMessagePane() -->
<splitter collapse="after" persist="state"
onmouseup="OnMouseUpThreadAndMessagePaneSplitter()"
id="threadpane-splitter">
<grippy onclick="OnClickThreadAndMessagePaneSplitterGrippy()"/>
</splitter>
<vbox id="messagepanebox" flex="3" persist="collapsed height" onclick="contentAreaClick(event);">
<hbox id="msgHeaderView"/>
<browser id="messagepane" context="messagePaneContext"
style="height: 0px; min-height: 1px" flex="1" name="messagepane"
disablehistory="true" type="content-primary" src="about:blank"
disablesecurity="true"/>
</vbox>
</vbox>
</vbox>
</hbox>
<statusbar id="status-bar" class="chromeclass-status mailwindow-statusbar">
<statusbarpanel id="unreadMessageCount" style="min-width: 5px"/>
<statusbarpanel id="totalMessageCount" style="min-width: 5px"/>
</statusbar>
</window>

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

@ -1,437 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* 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.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* disttsc@bart.nl
* jarrod.k.gray@rose-hulman.edu
* Jan Varga <varga@utcru.sk>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
// cache these services
var RDF = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService().QueryInterface(Components.interfaces.nsIRDFService);
var dragService = Components.classes["@mozilla.org/widget/dragservice;1"].getService().QueryInterface(Components.interfaces.nsIDragService);
var nsIDragService = Components.interfaces.nsIDragService;
function debugDump(msg)
{
// uncomment for noise
//dump(msg+"\n");
}
function CanDropOnFolderTree(index)
{
var dragSession = null;
var dragFolder = false;
dragSession = dragService.getCurrentSession();
if (! dragSession)
return false;
var flavorSupported = dragSession.isDataFlavorSupported("text/x-moz-message") || dragSession.isDataFlavorSupported("text/x-moz-folder");
var trans = Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);
if (! trans)
return false;
trans.addDataFlavor("text/x-moz-message");
trans.addDataFlavor("text/x-moz-folder");
var folderTree = GetFolderTree();
var targetResource = GetFolderResource(folderTree, index);
var targetUri = targetResource.Value;
var targetFolder = targetResource.QueryInterface(Components.interfaces.nsIMsgFolder);
var targetServer = targetFolder.server;
var sourceServer;
var sourceResource;
for (var i = 0; i < dragSession.numDropItems; i++)
{
dragSession.getData (trans, i);
var dataObj = new Object();
var dataFlavor = new Object();
var len = new Object();
try
{
trans.getAnyTransferData (dataFlavor, dataObj, len );
}
catch (ex)
{
continue; //no data so continue;
}
if (dataObj)
dataObj = dataObj.value.QueryInterface(Components.interfaces.nsISupportsString);
if (! dataObj)
continue;
// pull the URL out of the data object
var sourceUri = dataObj.data.substring(0, len.value);
if (! sourceUri)
continue;
if (dataFlavor.value == "text/x-moz-message")
{
sourceResource = null;
var isServer = GetFolderAttribute(folderTree, targetResource, "IsServer");
if (isServer == "true")
{
debugDump("***isServer == true\n");
return false;
}
// canFileMessages checks no select, and acl, for imap.
var canFileMessages = GetFolderAttribute(folderTree, targetResource, "CanFileMessages");
if (canFileMessages != "true")
{
debugDump("***canFileMessages == false\n");
return false;
}
var hdr = messenger.messageServiceFromURI(sourceUri).messageURIToMsgHdr(sourceUri);
if (hdr.folder == targetFolder)
return false;
break;
}
// we should only get here if we are dragging and dropping folders
dragFolder = true;
sourceResource = RDF.GetResource(sourceUri);
var sourceFolder = sourceResource.QueryInterface(Components.interfaces.nsIMsgFolder);
sourceServer = sourceFolder.server;
if (targetUri == sourceUri)
return false;
//don't allow drop on different imap servers.
if (sourceServer != targetServer && targetServer.type == "imap")
return false;
//don't allow immediate child to be dropped to it's parent
if (targetFolder.URI == sourceFolder.parent.URI)
{
debugDump(targetFolder.URI + "\n");
debugDump(sourceFolder.parent.URI + "\n");
return false;
}
var isAncestor = sourceFolder.isAncestorOf(targetFolder);
// don't allow parent to be dropped on its ancestors
if (isAncestor)
return false;
}
if (dragFolder)
{
//first check these conditions then proceed further
debugDump("***isFolderFlavor == true \n");
// no copy for folder drag
if (dragSession.dragAction == nsIDragService.DRAGDROP_ACTION_COPY)
return false;
var canCreateSubfolders = GetFolderAttribute(folderTree, targetResource, "CanCreateSubfolders");
// if cannot create subfolders then a folder cannot be dropped here
if (canCreateSubfolders == "false")
{
debugDump("***canCreateSubfolders == false \n");
return false;
}
var serverType = GetFolderAttribute(folderTree, targetResource, "ServerType");
// if we've got a folder that can't be renamed
// allow us to drop it if we plan on dropping it on "Local Folders"
// (but not within the same server, to prevent renaming folders on "Local Folders" that
// should not be renamed)
var srcCanRename = GetFolderAttribute(folderTree, sourceResource, "CanRename");
if (srcCanRename == "false") {
if (sourceServer == targetServer)
return false;
if (serverType != "none")
return false;
}
}
//message or folder
if (flavorSupported)
{
dragSession.canDrop = true;
return true;
}
return false;
}
function CanDropBeforeAfterFolderTree(index, before)
{
return false;
}
function DropOnFolderTree(row, orientation)
{
if (orientation != Components.interfaces.nsITreeView.inDropOn)
return false;
var folderTree = GetFolderTree();
var targetResource = GetFolderResource(folderTree, row);
var targetUri = targetResource.Value;
debugDump("***targetUri = " + targetUri + "\n");
var dragSession = dragService.getCurrentSession();
if (! dragSession )
return false;
var trans = Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);
trans.addDataFlavor("text/x-moz-message");
trans.addDataFlavor("text/x-moz-folder");
var list = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray);
var dropMessage;
var sourceUri;
var sourceResource;
var sourceFolder;
var sourceServer;
for (var i = 0; i < dragSession.numDropItems; i++)
{
dragSession.getData (trans, i);
var dataObj = new Object();
var flavor = new Object();
var len = new Object();
trans.getAnyTransferData(flavor, dataObj, len);
if (dataObj)
dataObj = dataObj.value.QueryInterface(Components.interfaces.nsISupportsString);
if (! dataObj)
continue;
// pull the URL out of the data object
sourceUri = dataObj.data.substring(0, len.value);
if (! sourceUri)
continue;
debugDump(" Node #" + i + ": drop " + sourceUri + " to " + targetUri + "\n");
// only do this for the first object, either they are all messages or they are all folders
if (i == 0)
{
if (flavor.value == "text/x-moz-folder")
{
sourceResource = RDF.GetResource(sourceUri);
sourceFolder = sourceResource.QueryInterface(Components.interfaces.nsIMsgFolder);
dropMessage = false; // we are dropping a folder
}
else if (flavor.value == "text/x-moz-message")
dropMessage = true;
}
else {
if (!dropMessage)
dump("drag and drop of multiple folders isn't supported\n");
}
if (dropMessage) {
// from the message uri, get the appropriate messenger service
// and then from that service, get the msgDbHdr
list.AppendElement(messenger.messageServiceFromURI(sourceUri).messageURIToMsgHdr(sourceUri));
}
else {
// Prevent dropping of a node before, after, or on itself
if (sourceResource == targetResource)
continue;
list.AppendElement(sourceResource);
}
}
if (list.Count() < 1)
return false;
var isSourceNews = false;
isSourceNews = isNewsURI(sourceUri);
var targetFolder = targetResource.QueryInterface(Components.interfaces.nsIMsgFolder);
var targetServer = targetFolder.server;
if (dropMessage) {
var sourceMsgHdr = list.GetElementAt(0).QueryInterface(Components.interfaces.nsIMsgDBHdr);
sourceFolder = sourceMsgHdr.folder;
sourceResource = sourceFolder.QueryInterface(Components.interfaces.nsIRDFResource);
sourceServer = sourceFolder.server;
try {
if (isSourceNews) {
// news to pop or imap is always a copy
messenger.CopyMessages(GetFolderDatasource(), sourceResource, targetResource, list, false);
}
else {
var dragAction = dragSession.dragAction;
if (dragAction == nsIDragService.DRAGDROP_ACTION_COPY)
messenger.CopyMessages(GetFolderDatasource(), sourceResource, targetResource, list, false);
else if (dragAction == nsIDragService.DRAGDROP_ACTION_MOVE)
messenger.CopyMessages(GetFolderDatasource(), sourceResource, targetResource, list, true);
}
}
catch (ex) {
dump("failed to copy messages: " + ex + "\n");
}
}
else {
sourceServer = sourceFolder.server;
try
{
messenger.CopyFolders(GetFolderDatasource(), targetResource, list, (sourceServer == targetServer));
}
catch(ex)
{
dump ("Exception : CopyFolders " + ex + "\n");
}
}
return true;
}
function BeginDragFolderTree(event)
{
debugDump("BeginDragFolderTree\n");
if (event.originalTarget.localName != "treechildren")
return false;
var folderTree = GetFolderTree();
var row = {};
var col = {};
var elt = {};
folderTree.treeBoxObject.getCellAt(event.clientX, event.clientY, row, col, elt);
if (row.value == -1)
return false;
var folderResource = GetFolderResource(folderTree, row.value);
if (GetFolderAttribute(folderTree, folderResource, "IsServer") == "true")
{
debugDump("***IsServer == true\n");
return false;
}
// do not allow the drag when news is the source
if (GetFolderAttribute(folderTree, folderResource, "ServerType") == "nntp")
{
debugDump("***ServerType == nntp\n");
return false;
}
var selectedFolders = GetSelectedFolders();
return BeginDragTree(event, folderTree, selectedFolders, "text/x-moz-folder");
}
function BeginDragThreadPane(event)
{
debugDump("BeginDragThreadPane\n");
var threadTree = GetThreadTree();
var selectedMessages = GetSelectedMessages();
//A message can be dragged from one window and dropped on another window
//therefore setNextMessageAfterDelete() here
//no major disadvantage even if it is a copy operation
SetNextMessageAfterDelete();
return BeginDragTree(event, threadTree, selectedMessages, "text/x-moz-message");
}
function BeginDragTree(event, tree, selArray, flavor)
{
var dragStarted = false;
var transArray = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray);
if ( !transArray )
return false;
// let's build the drag region
var region = null;
try {
region = Components.classes["@mozilla.org/gfx/region;1"].createInstance(Components.interfaces.nsIScriptableRegion);
region.init();
var obo = tree.treeBoxObject;
var bo = obo.treeBody.boxObject;
var obosel= obo.selection;
var rowX = bo.x;
var rowY = bo.y;
var rowHeight = obo.rowHeight;
var rowWidth = bo.width;
//add a rectangle for each visible selected row
for (var i = obo.getFirstVisibleRow(); i <= obo.getLastVisibleRow(); i ++)
{
if (obosel.isSelected(i))
region.unionRect(rowX, rowY, rowWidth, rowHeight);
rowY = rowY + rowHeight;
}
//and finally, clip the result to be sure we don't spill over...
if(!region.isEmpty())
region.intersectRect(bo.x, bo.y, bo.width, bo.height);
} catch(ex) {
dump("Error while building selection region: " + ex + "\n");
region = null;
}
var count = selArray.length;
debugDump("selArray.length = " + count + "\n");
for (i = 0; i < count; ++i ) {
var trans = Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);
if (!trans)
return false;
var genTextData = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
if (!genTextData)
return false;
trans.addDataFlavor(flavor);
// get id (url)
var id = selArray[i];
genTextData.data = id;
debugDump(" ID #" + i + " = " + id + "\n");
trans.setTransferData ( flavor, genTextData, id.length * 2 ); // doublebyte byte data
// put it into the transferable as an |nsISupports|
var genTrans = trans.QueryInterface(Components.interfaces.nsISupports);
transArray.AppendElement(genTrans);
}
dragService.invokeDragSession ( event.target, transArray, region, nsIDragService.DRAGDROP_ACTION_COPY +
nsIDragService.DRAGDROP_ACTION_MOVE );
dragStarted = true;
return(!dragStarted); // don't propagate the event if a drag has begun
}

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

@ -1,261 +0,0 @@
/* -*- Mode: C++; 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.
*/
var selectedServer = null;
var nsPrefBranch = null;
function OnInit()
{
var title = null;
var titleElement = null;
var brandName = null;
var acctType = null;
var acctName = null;
var brandBundle;
var messengerBundle;
try {
if (!nsPrefBranch) {
var prefService = Components.classes["@mozilla.org/preferences-service;1"];
prefService = prefService.getService();
prefService = prefService.QueryInterface(Components.interfaces.nsIPrefService);
nsPrefBranch = prefService.getBranch(null);
}
}
catch (ex) {
dump("error getting pref service. "+ex+"\n");
}
// Set the header for the page.
// Title containts the brand name of the application and the account
// type (mail/news) and the name of the account
try {
// Get title element from the document
titleElement = document.getElementById("AccountCentralTitle");
// Get the brand name
brandBundle = document.getElementById("bundle_brand");
brandName = brandBundle.getString("brandShortName");
// Get the account type
messengerBundle = document.getElementById("bundle_messenger");
selectedServer = GetSelectedServer();
var serverType = selectedServer.type;
if (serverType == "nntp")
acctType = messengerBundle.getString("newsAcctType");
else
acctType = messengerBundle.getString("mailAcctType");
// Get the account name
var msgFolder = GetSelectedMsgFolder();
acctName = msgFolder.prettyName;
title = messengerBundle.getFormattedString("acctCentralTitleFormat",
[brandName,
acctType,
acctName]);
titleElement.setAttribute("value", title);
// Display and collapse items presented to the user based on account type
var protocolInfo = Components.classes["@mozilla.org/messenger/protocol/info;1?type=" + serverType];
protocolInfo = protocolInfo.getService(Components.interfaces.nsIMsgProtocolInfo);
ArrangeAccountCentralItems(selectedServer, protocolInfo, msgFolder);
}
catch(ex) {
dump("Error -> " + ex + "\n");
}
}
// Show items in the AccountCentral page depending on the capabilities
// of the given account
function ArrangeAccountCentralItems(server, protocolInfo, msgFolder)
{
try {
/***** Email header and items : Begin *****/
// Read Messages
var canGetMessages = protocolInfo.canGetMessages;
SetItemDisplay("ReadMessages", canGetMessages);
// Compose Messages link
var showComposeMsgLink = protocolInfo.showComposeMsgLink;
SetItemDisplay("ComposeMessage", showComposeMsgLink);
// Junk mail settings
var canControlJunkEmail = protocolInfo.canGetIncomingMessages && protocolInfo.canGetMessages && false; // && false, until ready for prime time
SetItemDisplay("JunkSettingsMail", canControlJunkEmail);
var displayEmailHeader = canGetMessages || showComposeMsgLink || canControlJunkEmail;
// Display Email header, only if any of the items are displayed
SetItemDisplay("EmailHeader", displayEmailHeader);
/***** Email header and items : End *****/
/***** News header and items : Begin *****/
// Subscribe to Newsgroups
var canSubscribe = (msgFolder.canSubscribe) && !(protocolInfo.canGetMessages);
SetItemDisplay("SubscribeNewsgroups", canSubscribe);
// Junk news settings
var canControlJunkNews = protocolInfo.canGetIncomingMessages && !(protocolInfo.canGetMessages) && false; // && false, until ready for prime time
SetItemDisplay("JunkSettingsNews", canControlJunkNews);
var displayNewsHeader = canSubscribe || canControlJunkNews;
// Display News header, only if any of the items are displayed
SetItemDisplay("NewsHeader", displayNewsHeader);
/***** News header and items : End *****/
// If neither of above sections exist, collapse section separators
if (!(displayNewsHeader || displayEmailHeader)) {
CollapseSectionSeparators("MessagesSection.separator", false);
}
/***** Accounts : Begin *****/
var canShowCreateAccount = !nsPrefBranch.prefIsLocked("mail.disable_new_account_addition");
SetItemDisplay("CreateAccount", canShowCreateAccount);
/***** Accounts : End *****/
/***** Advanced Features header and items : Begin *****/
// Search Messages
var canSearchMessages = server.canSearchMessages;
SetItemDisplay("SearchMessages", canSearchMessages);
// Create Filters
var canHaveFilters = server.canHaveFilters;
SetItemDisplay("CreateFilters", canHaveFilters);
// Offline Settings
var supportsOffline = (server.offlineSupportLevel != 0);
SetItemDisplay("OfflineSettings", supportsOffline);
var displayAdvFeatures = canSearchMessages || canHaveFilters || supportsOffline;
// Display Adv Features header, only if any of the items are displayed
SetItemDisplay("AdvancedFeaturesHeader", displayAdvFeatures);
/***** Advanced Featuers header and items : End *****/
}
catch (ex) {
dump("Error is setting AccountCentral Items : " + ex + "\n");
}
}
// Collapse the item if the item feature is not supported
function SetItemDisplay(elemId, displayThisItem)
{
if (!displayThisItem) {
var elem = document.getElementById(elemId);
elem.setAttribute("collapsed", true);
var separatorId = elemId + ".separator";
var elemSeparator = document.getElementById(separatorId);
elemSeparator.setAttribute("collapsed", true);
}
}
// Collapse section separators
function CollapseSectionSeparators(separatorBaseId)
{
for (var i=1; i <= 3; i++) {
var separatorId = separatorBaseId + i;
var separator = document.getElementById(separatorId);
separator.setAttribute("collapsed", true);
}
}
// From the current folder tree, return the selected server
function GetSelectedServer()
{
var folderURI = window.parent.GetSelectedFolderURI();
var server = GetServer(folderURI);
return server;
}
// From the current folder tree, return the selected folder
function GetSelectedMsgFolder()
{
var folderURI = window.parent.GetSelectedFolderURI();
var msgFolder = window.parent.GetMsgFolderFromUri(folderURI, true);
return msgFolder;
}
// Open Inbox for selected server.
// If needed, open th twsity and select Inbox.
function ReadMessages()
{
try {
window.parent.OpenInboxForServer(selectedServer);
}
catch(ex) {
dump("Error -> " + ex + "\n");
}
}
// Trigger composer for a new message
function ComposeAMessage(event)
{
window.parent.MsgNewMessage(null);
}
// Open AccountManager to view settings for a given account
// selectPage: the xul file name for the viewing page,
// null for the account main page, other pages are
// 'am-server.xul', 'am-copies.xul', 'am-offline.xul',
// 'am-addressing.xul','am-advanced.xul', 'am-smtp.xul'
function ViewSettings(selectPage)
{
window.parent.MsgAccountManager(selectPage);
}
// Open AccountWizard to create an account
function CreateNewAccount()
{
window.parent.msgOpenAccountWizard();
}
// Bring up search interface for selected account
function SearchMessages()
{
window.parent.MsgSearchMessages();
}
// Open filters window
function CreateMsgFilters()
{
window.parent.MsgFilters(null);
}
// Open Subscribe dialog
function SubscribeNewsgroups()
{
window.parent.MsgSubscribe();
}
// Open junk mail settings dialog
function JunkSettings()
{
window.parent.MsgJunkMail();
}

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

@ -1,159 +0,0 @@
<?xml version="1.0"?>
<!--
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.
-->
<?xml-stylesheet href="chrome://messenger/skin/accountCentral.css" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd">
%brandDTD;
<!ENTITY % acctCentralDTD SYSTEM "chrome://messenger/locale/msgAccountCentral.dtd">
%acctCentralDTD;
]>
<page
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="OnInit();">
<stringbundle id="bundle_brand" src="chrome://global/locale/brand.properties"/>
<stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
<stringbundle id="bundle_prefs" src="chrome://messenger/locale/prefs.properties"/>
<script type="application/x-javascript" src="chrome://messenger/content/AccountManager.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/accountUtils.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/commandglue.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/mailWindowOverlay.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/mailWindow.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/msgMail3PaneWindow.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/widgetglue.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/msgAccountCentral.js"/>
<grid flex="1" id="acctCentralGrid">
<columns>
<column flex="40" id="acctCentralActionsColumn"/>
<column flex="60" id="acctCentralHelpDataColumn"/>
</columns>
<rows>
<row id="acctCentralHeaderRow">
<label id="AccountCentralTitle"/>
</row>
<separator/>
<row id="EmailHeader" class="acctCentralTitleRow">
<hbox class="acctCentralRowTitleBox">
<description>&emailSectionHdr.label;</description>
</hbox>
</row>
<separator id="EmailHeader.separator" class="thin"/>
<row id="ReadMessages" class="acctCentralRow">
<hbox>
<label class="acctCentralText acctCentralLinkText" value="&readMsgsLink.label;" onclick="ReadMessages();"/>
</hbox>
</row>
<separator id="ReadMessages.separator" class="thin"/>
<row id="ComposeMessage" class="acctCentralRow">
<hbox>
<label class="acctCentralText acctCentralLinkText" value="&composeMsgLink.label;" onclick="ComposeAMessage();"/>
</hbox>
</row>
<separator id="ComposeMessage.separator" class="thin"/>
<row id="JunkSettingsMail" class="acctCentralRow">
<hbox>
<label class="acctCentralText acctCentralLinkText" value="&junkSettings.label;" onclick="JunkSettings();"/>
</hbox>
</row>
<separator id="JunkSettingsMail.separator" class="thin"/>
<row id="NewsHeader" class="acctCentralTitleRow">
<hbox class="acctCentralRowTitleBox">
<description>&newsSectionHdr.label;</description>
</hbox>
</row>
<separator id="NewsHeader.separator" class="thin"/>
<row id="SubscribeNewsgroups" class="acctCentralRow">
<hbox>
<label class="acctCentralText acctCentralLinkText" value="&subscribeNewsLink.label;" onclick="SubscribeNewsgroups();"/>
</hbox>
</row>
<separator id="SubscribeNewsgroups.separator" class="thin"/>
<row id="JunkSettingsNews" class="acctCentralRow">
<hbox>
<label class="acctCentralText acctCentralLinkText" value="&junkSettings.label;" onclick="JunkSettings();"/>
</hbox>
</row>
<separator id="JunkSettingsNews.separator" class="thin"/>
<separator id="MessagesSection.separator1"/>
<separator id="MessagesSection.separator2"/>
<separator id="MessagesSection.separator3"/>
<row id="AccountsHeader" class="acctCentralTitleRow">
<hbox class="acctCentralRowTitleBox">
<description>&accountsSectionHdr.label;</description>
</hbox>
</row>
<separator id="AccountsHeader.separator" class="thin"/>
<row id="AccountSettings" class="acctCentralRow">
<hbox>
<label class="acctCentralText acctCentralLinkText" value="&settingsLink.label;" onclick="ViewSettings(null);"/>
</hbox>
</row>
<separator id="AccountSettings.separator" class="thin"/>
<row id="CreateAccount" class="acctCentralRow">
<hbox>
<label class="acctCentralText acctCentralLinkText" value="&newAcctLink.label;" onclick="CreateNewAccount();"/>
</hbox>
</row>
<separator id="CreateAccount.separator" class="thin"/>
<separator id="AccountsSection.separator1"/>
<separator id="AccountsSection.separator2"/>
<separator id="AccountsSection.separator3"/>
<row id="AdvancedFeaturesHeader" class="acctCentralTitleRow">
<hbox class="acctCentralRowTitleBox">
<description>&advFeaturesSectionHdr.label;</description>
</hbox>
</row>
<separator id="AdvancedFeaturesHeader.separator" class="thin"/>
<row id="SearchMessages" class="acctCentralRow">
<hbox>
<label class="acctCentralText acctCentralLinkText" value="&searchMsgsLink.label;" onclick="SearchMessages();"/>
</hbox>
</row>
<separator id="SearchMessages.separator" class="thin"/>
<row id="CreateFilters" class="acctCentralRow">
<hbox>
<label class="acctCentralText acctCentralLinkText" value="&filtersLink.label;" onclick="CreateMsgFilters();"/>
</hbox>
</row>
<separator id="CreateFilters.separator" class="thin"/>
<row id="OfflineSettings" class="acctCentralRow">
<hbox>
<label class="acctCentralText acctCentralLinkText" value="&offlineLink.label;" onclick="ViewSettings('am-offline.xul');"/>
</hbox>
</row>
<separator id="OfflineSettings.separator" class="thin"/>
</rows>
</grid>
</page>

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

@ -1,121 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* 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.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Alec Flett <alecf@netscape.com>
* Seth Spitzer <sspitzer@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
var gMessengerBundle;
// call this from dialog onload() to set the menu item to the correct value
function MsgFolderPickerOnLoad(pickerID)
{
var uri = null;
try {
uri = window.arguments[0].preselectedURI;
}
catch (ex) {
uri = null;
}
if (uri) {
//dump("on loading, set titled button to " + uri + "\n");
// verify that the value we are attempting to
// pre-flight the menu with is valid for this
// picker type
var msgfolder = GetMsgFolderFromUri(uri, true);
if (!msgfolder) return;
var verifyFunction = null;
switch (pickerID) {
case "msgNewFolderPicker":
verifyFunction = msgfolder.canCreateSubfolders;
break;
case "msgRenameFolderPicker":
verifyFunction = msgfolder.canRename;
break;
default:
verifyFunction = msgfolder.canFileMessages;
break;
}
if (verifyFunction) {
SetFolderPicker(uri,pickerID);
}
}
}
function PickedMsgFolder(selection,pickerID)
{
var selectedUri = selection.getAttribute('id');
SetFolderPicker(selectedUri,pickerID);
}
function SetFolderPicker(uri,pickerID)
{
var picker = document.getElementById(pickerID);
var msgfolder = GetMsgFolderFromUri(uri, true);
if (!msgfolder)
return;
var selectedValue = null;
var serverName;
if (msgfolder.isServer)
selectedValue = msgfolder.name;
else {
if (msgfolder.server)
serverName = msgfolder.server.prettyName;
else {
dump("Can't find server for " + uri + "\n");
serverName = "???";
}
if (pickerID == "runFiltersFolder")
selectedValue = msgfolder.name;
else {
if (!gMessengerBundle)
gMessengerBundle = document.getElementById("bundle_messenger");
selectedValue = gMessengerBundle.getFormattedString("verboseFolderFormat",
[msgfolder.name, serverName]);
}
}
picker.setAttribute("label",selectedValue);
picker.setAttribute("uri",uri);
}

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

@ -1,568 +0,0 @@
<?xml version="1.0"?>
<!--
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.
-->
<?xml-stylesheet href="chrome://messenger/skin/folderMenus.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://messenger/locale/msgFolderPickerOverlay.dtd">
<overlay id="msgFolderPicker"
xmlns:nc="http://home.netscape.com/NC-rdf#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<stringbundleset id="stringbundleset">
<stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
</stringbundleset>
<script type="application/x-javascript" src="chrome://messenger/content/msgFolderPickerOverlay.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/widgetglue.js"/>
<menulist label="&newfolderclickhere.label;" id="msgNewFolderPicker"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending"
datasources="rdf:msgaccountmanager rdf:mailnewsfolders"
ref="msgaccounts:/">
<template>
<rule nc:CanCreateSubfolders="true" nc:CanCreateFoldersOnServer="true" iscontainer="true" isempty="false">
<menupopup class="menulist-menupopup">
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="PickedMsgFolder(event.target,'msgNewFolderPicker')"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup>
<menuitem label="&newfolderchoosethis.label;"
oncommand="PickedMsgFolder(event.target.parentNode.parentNode,'msgNewFolderPicker')"/>
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:CanCreateFoldersOnServer="false"/>
<!-- no subfolders for some inboxes -->
<rule nc:CanCreateSubfolders="false" iscontainer="true" isempty="true">
<menupopup>
<menuitem disabled="true" uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"/>
</menupopup>
</rule>
<rule nc:CanCreateSubfolders="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="PickedMsgFolder(event.target,'msgNewFolderPicker')"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"/>
</menupopup>
</rule>
</template>
<menupopup />
</menulist>
<menulist label="&renamefolderclickhere.label;" uri=""
id="msgRenameFolderPicker"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending"
datasources="rdf:msgaccountmanager rdf:mailnewsfolders"
ref="msgaccounts:/">
<template>
<rule nc:CanRename="true" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="PickedMsgFolder(event.target,'msgRenameFolderPicker')"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup class="menulist-menupopup">
<menuitem label="&renamefolderchoosethis.label;"
oncommand="PickedMsgFolder(event.target.parentNode.parentNode,'msgRenameFolderPicker')"/>
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:CanRename="false" nc:ServerType="nntp">
<!-- don't show nntp servers in the rename dialog -->
</rule>
<rule nc:CanRename="false" iscontainer="true" isempty="false">
<!-- note, there is no "file here" -->
<menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="PickedMsgFolder(event.target,'msgRenameFolderPicker')"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup class="menulist-menupopup"/>
</menu>
</menupopup>
</rule>
<!-- this makes the special folders that you can't rename
like TRASH and INBOX show up, but they are disabled -->
<rule nc:CanRename="false" iscontainer="true" isempty="true">
<menupopup>
<menuitem disabled="true" uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"/>
</menupopup>
</rule>
<rule nc:CanRename="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="PickedMsgFolder(event.target,'msgRenameFolderPicker')"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"/>
</menupopup>
</rule>
</template>
<menupopup />
</menulist>
<menulist label="&choosefolderclickhere.label;" uri="" id="msgFccFolderPicker"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending"
datasources="rdf:msgaccountmanager rdf:mailnewsfolders"
ref="msgaccounts:/">
<template>
<rule nc:CanFileMessages="true" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="PickedMsgFolder(event.target,'msgFccFolderPicker')"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup class="menulist-menupopup">
<menuitem label="&filemessageschoosethis.label;"
oncommand="PickedMsgFolder(event.target.parentNode.parentNode,'msgFccFolderPicker')"/>
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessagesOnServer="false">
<!-- don't show servers (nntp & any others) which does not allow message filing -->
</rule>
<rule nc:CanFileMessages="false" iscontainer="true" isempty="false">
<!-- note, there is no "file here" -->
<menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="PickedMsgFolder(event.target,'msgFccFolderPicker')"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup class="menulist-menupopup"/>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="PickedMsgFolder(event.target,'msgFccFolderPicker')"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"/>
</menupopup>
</rule>
</template>
<menupopup />
</menulist>
<menulist label="&choosefolderclickhere.label;" uri=""
id="msgDraftsFolderPicker"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending"
datasources="rdf:msgaccountmanager rdf:mailnewsfolders"
ref="msgaccounts:/">
<template>
<rule nc:CanFileMessages="true" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="PickedMsgFolder(event.target,'msgDraftsFolderPicker')"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup class="menulist-menupopup">
<menuitem label="&filemessageschoosethis.label;"
oncommand="PickedMsgFolder(event.target.parentNode.parentNode,'msgDraftsFolderPicker')"/>
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessagesOnServer="false">
<!-- don't show servers (nntp & any others) which does not allow message filing -->
</rule>
<rule nc:CanFileMessages="false" iscontainer="true" isempty="false">
<!-- note, there is no "file here" -->
<menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="PickedMsgFolder(event.target,'msgDraftsFolderPicker')"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup class="menulist-menupopup"/>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="PickedMsgFolder(event.target,'msgDraftsFolderPicker')"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"/>
</menupopup>
</rule>
</template>
<menupopup />
</menulist>
<menulist label="&choosefolderclickhere.label;" uri=""
id="msgStationeryFolderPicker"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending"
datasources="rdf:msgaccountmanager rdf:mailnewsfolders"
ref="msgaccounts:/">
<template>
<rule nc:CanFileMessages="true" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="PickedMsgFolder(event.target,'msgStationeryFolderPicker')"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup class="menulist-menupopup">
<menuitem label="&filemessageschoosethis.label;"
oncommand="PickedMsgFolder(event.target.parentNode.parentNode,'msgStationeryFolderPicker')"/>
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessagesOnServer="false">
<!-- don't show servers (nntp & any others) which does not allow message filing -->
</rule>
<rule nc:CanFileMessages="false" iscontainer="true" isempty="false">
<!-- note, there is no "file here" -->
<menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="PickedMsgFolder(event.target,'msgStationeryFolderPicker')"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup class="menulist-menupopup"/>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="PickedMsgFolder(event.target,'msgStationeryFolderPicker')"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"/>
</menupopup>
</rule>
</template>
<menupopup />
</menulist>
<menulist label="&chooseaccountclickhere.label;"
uri="" id="actionTargetAccount"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending"
datasources="rdf:msgaccountmanager rdf:mailnewsfolders"
ref="msgaccounts:/">
<template>
<rule nc:IsServer="true" nc:CanCreateFoldersOnServer="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic"
label="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="PickedMsgFolder(event.target,'actionTargetAccount')"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"
CanCreateFoldersOnServer="rdf:http://home.netscape.com/NC-rdf#CanCreateFoldersOnServer"/>
</menupopup>
</rule>
</template>
<menupopup />
</menulist>
<menulist label="&chooseaccountclickhere.label;"
uri="" id="msgFccAccountPicker"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending"
datasources="rdf:msgaccountmanager rdf:mailnewsfolders"
ref="msgaccounts:/">
<template>
<rule nc:IsServer="true" nc:CanCreateFoldersOnServer="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic"
label="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="PickedMsgFolder(event.target,'msgFccAccountPicker')"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"
CanCreateFoldersOnServer="rdf:http://home.netscape.com/NC-rdf#CanCreateFoldersOnServer"/>
</menupopup>
</rule>
</template>
<menupopup />
</menulist>
<menulist label="&chooseaccountclickhere.label;"
uri="" id="msgDraftsAccountPicker"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending"
datasources="rdf:msgaccountmanager rdf:mailnewsfolders"
ref="msgaccounts:/">
<template>
<rule nc:IsServer="true" nc:CanCreateFoldersOnServer="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic"
label="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="PickedMsgFolder(event.target,'msgDraftsAccountPicker')"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"
CanCreateFoldersOnServer="rdf:http://home.netscape.com/NC-rdf#CanCreateFoldersOnServer"/>
</menupopup>
</rule>
</template>
<menupopup />
</menulist>
<menulist label="&chooseaccountclickhere.label;"
uri="" id="msgStationeryAccountPicker"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending"
datasources="rdf:msgaccountmanager rdf:mailnewsfolders"
ref="msgaccounts:/">
<template>
<rule nc:IsServer="true" nc:CanCreateFoldersOnServer="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic"
label="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="PickedMsgFolder(event.target,'msgStationeryAccountPicker')"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"
CanCreateFoldersOnServer="rdf:http://home.netscape.com/NC-rdf#CanCreateFoldersOnServer"/>
</menupopup>
</rule>
</template>
<menupopup />
</menulist>
<menulist id="searchableFolders"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending"
datasources="rdf:msgaccountmanager rdf:mailnewsfolders"
ref="msgaccounts:/">
<template>
<rule iscontainer="true" isempty="false" nc:CanSearchMessages="true">
<menupopup>
<menu uri="..."
class="folderMenuItem menu-iconic"
oncommand="onChooseFolder(event.target)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"
label="rdf:http://home.netscape.com/NC-rdf#Name">
<menupopup class="menulist-menupopup">
<menuitem label="&filemessageschoosethis.label;"
oncommand="onChooseFolder(event.target.parentNode.parentNode)"/>
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:CanSearchMessages="true">
<menupopup>
<menuitem uri="..." value="..."
class="folderMenuItem menuitem-iconic"
oncommand="onChooseFolder(event.target)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"
label="rdf:http://home.netscape.com/NC-rdf#Name"/>
</menupopup>
</rule>
</template>
</menulist>
<menulist id="actionTargetFolder"
containment="http://home.netscape.com/NC-rdf#child"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending"
datasources="rdf:msgaccountmanager rdf:mailnewsfolders"
ref="msgaccounts:/">
<template>
<rule nc:CanFileMessagesOnServer="false">
<!-- don't show servers (nntp & any others) which does not allow message filing -->
</rule>
<rule nc:CanFileMessages="true" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..."
class="folderMenuItem menu-iconic"
oncommand="PickedMsgFolder(event.target,'actionTargetFolder')"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"
label="rdf:http://home.netscape.com/NC-rdf#Name">
<menupopup class="menulist-menupopup">
<menuitem label="&filemessageschoosethis.label;"
oncommand="PickedMsgFolder(event.target.parentNode.parentNode,'actionTargetFolder')"/>
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="false" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..."
class="folderMenuItem menu-iconic"
oncommand="PickedMsgFolder(event.target,'actionTargetFolder')"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"
label="rdf:http://home.netscape.com/NC-rdf#Name">
<menupopup class="menulist-menupopup"/>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="true">
<menupopup>
<menuitem uri="..." value="..."
class="folderMenuItem menuitem-iconic"
oncommand="PickedMsgFolder(event.target,'actionTargetFolder')"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"
label="rdf:http://home.netscape.com/NC-rdf#Name"/>
</menupopup>
</rule>
</template>
<menupopup/>
</menulist>
<menulist id="runFiltersFolder"
containment="http://home.netscape.com/NC-rdf#child"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending"
datasources="rdf:msgaccountmanager rdf:mailnewsfolders">
<template>
<rule nc:NoSelect="false" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..."
class="folderMenuItem menu-iconic"
oncommand="PickedMsgFolder(event.target,'runFiltersFolder')"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"
label="rdf:http://home.netscape.com/NC-rdf#Name">
<menupopup class="menulist-menupopup">
<menuitem label="&filemessageschoosethis.label;"
oncommand="PickedMsgFolder(event.target.parentNode.parentNode,'runFiltersFolder')"/>
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:NoSelect="true" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..."
class="folderMenuItem menu-iconic"
oncommand="PickedMsgFolder(event.target,'runFiltersFolder')"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"
label="rdf:http://home.netscape.com/NC-rdf#Name">
<menupopup class="menulist-menupopup"/>
</menu>
</menupopup>
</rule>
<rule nc:NoSelect="false">
<menupopup>
<menuitem uri="..." value="..."
class="folderMenuItem menuitem-iconic"
oncommand="PickedMsgFolder(event.target,'runFiltersFolder')"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"
label="rdf:http://home.netscape.com/NC-rdf#Name"/>
</menupopup>
</rule>
</template>
<menupopup/>
</menulist>
</overlay>

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

@ -1,33 +0,0 @@
/* -*- Mode: C++; 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.
*/
/////////////////////////////////////////////////////////////////////
// If we want to do any special processing for each email address
// we show in the msg header view overlay, we can isolate it in this file.
// (Remember to include it in msgHdrViewOverlay.xul)
//////////////////////////////////////////////////////////////////////
// AddExtraAddressProcessing --> If you want to add any extra
// customizations for a given address you can insert it here.
// emailAddress --> is the email address in question
// addressButton --> the button in the UI that we have created
// to represent this email address. this is probably what you want
// to modify / poke.

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -1,150 +0,0 @@
<?xml version="1.0"?>
<!--
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.
-->
<!DOCTYPE window SYSTEM "chrome://messenger/locale/msgHdrViewOverlay.dtd">
<?xml-stylesheet href="chrome://messenger/skin/messageHeader.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/messageKeywords.css" type="text/css"?>
<overlay xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script src="chrome://messenger/content/msgHdrViewAddresses.js"/>
<script src="chrome://messenger/content/msgHdrViewOverlay.js"/>
<!-- drag and drop -->
<script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsTransferable.js"/>
<stringbundleset id="stringbundleset">
<stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
</stringbundleset>
<popup id="attachmentListContext" onpopupshowing="return onShowAttachmentContextMenu();">
<menuitem id="context-openAttachment" label="&openAttachmentCmd.label;" accesskey="&openAttachmentCmd.accesskey;"
oncommand="handleAttachmentSelection('openAttachment');"/>
<menuitem id="context-saveAttachment" label="&saveAsAttachmentCmd.label;" accesskey="&saveAsAttachmentCmd.accesskey;"
oncommand="handleAttachmentSelection('saveAttachment');"/>
<menuseparator/>
<menuitem id="context-saveAllAttachments" oncommand="SaveAllAttachments();" label="&saveAllAttachmentsCmd.label;" accesskey="&saveAllAttachmentsCmd.accesskey;"/>
</popup>
<popup id="attachmentMenuList">
<menuseparator/>
<menuitem label="&saveAllAttachmentsCmd.label;" accesskey="&saveAllAttachmentsCmd.accesskey;" oncommand="SaveAllAttachments();"/>
</popup>
<tooltip id="attachmentListTooltip"
onpopupshowing="return FillInAttachmentTooltip(document.tooltipNode);"/>
<hbox id="msgHeaderView" keywordrelated="true" originalclass="none" persist="state">
<grid id="collapsedHeaderView" class="header-part1" keywordrelated="true" originalclass="header-part1" flex="1" collapsed="true">
<rows>
<row flex="1"/>
</rows>
<columns>
<column class="collapsedToggleHdrBox">
<hbox align="start">
<image id="toggleHeaderView" class="collapsedHeaderViewButton"
onclick="ToggleHeaderView();"/>
</hbox>
</column>
<column id="collapsedsubjectBox" collapsed="true" flex="1">
<hbox>
<label class="collapsedHeaderDisplayName" value="&subjectField.label;"/>
<textbox id="collapsedsubjectValue" keywordrelated="true" class="collapsedHeaderValue plain" originalclass="collapsedHeaderValue plain" readonly="true" crop="right" appendoriginalclass="true" flex="1"/>
</hbox>
</column>
<column id="collapsedfromBox" collapsed="true">
<hbox align="start">
<label class="collapsedHeaderDisplayName" value="&fromField.label;"/>
<mail-emailaddress id="collapsedfromValue" flex="1"/>
</hbox>
</column>
<column id = "collapseddateBox" collapsed="true">
<hbox align="start">
<textbox id="collapseddateValue" keywordrelated="true" class="collapsedHeaderValue plain" originalclass="collapsedHeaderValue plain" appendoriginalclass="true" readonly="true"/>
</hbox>
</column>
<column id="collapsedKeywordBox">
<hbox align="start">
<image id="collapsedKeywordImage" keywordrelated="true" originalclass="none"/>
</hbox>
</column>
<column id="collapsedAttachmentBox" collapsed="true">
<hbox align="start">
<image id="collapsedAttachment" class="collapsedAttachmentButton" onclick="ToggleHeaderView();" />
</hbox>
</column>
</columns>
</grid>
<hbox id="expandedHeaderView" class="header-part1" keywordrelated="true" originalclass="header-part1" flex="1" collapsed="true">
<vbox id="expandedHeaders" flex="1">
<mail-toggle-headerfield keywordrelated="true" id="expandedsubjectBox" class="subjectvalue" label="&subjectField.label;" ontwistyclick="ToggleHeaderView();" collapsed="true"/>
<mail-emailheaderfield id="expandedfromBox" label="&fromField.label;" collapsed="true"/>
<mail-emailheaderfield id="expandedreply-toBox" label="&replyToField.label;" collapsed="true"/>
<mail-headerfield keywordrelated="true" id="expandeddateBox" label="&dateField.label;" collapsed="true"/>
<mail-multi-emailHeaderField id="expandedtoBox" label="&toField.label;" collapsed="true"/>
<mail-multi-emailHeaderField id="expandedccBox" label="&ccField.label;" collapsed="true"/>
<mail-multi-emailHeaderField id="expandedbccBox" label="&bccField.label;" collapsed="true"/>
<mail-headerfield keywordrelated="true" id="expandednewsgroupsBox" label="&newsgroupsField.label;" collapsed="true"/>
<mail-headerfield keywordrelated="true" id="expandedfollowup-toBox" label="&followupToField.label;" collapsed="true"/>
<mail-headerfield keywordrelated="true" id="expandeduser-agentBox" label="&userAgentField.label;" collapsed="true"/>
</vbox>
<vbox id="expandedKeywordBox">
<spacer flex="1"/>
<image id="expandedKeywordImage" keywordrelated="true" originalclass="none" />
<spacer flex="1"/>
</vbox>
<vbox id="editMessageBox" class="header-part1" keywordrelated="true" originalclass="header-part1" collapsed="true">
<spacer flex="1"/>
<button id="editMessageButton" label="&editMessage.label;" oncommand="MsgComposeDraftMessage()"/>
<spacer flex="1"/>
</vbox>
<vbox autostretch="never">
<spacer flex="1"/>
<image style="padding: 5px" id="fromBuddyIcon"/>
<spacer flex="1"/>
</vbox>
<vbox id="expandedAttachmentBox" class="header-part1" keywordrelated="true" originalclass="header-part1" collapsed="true">
<label id="attachmentText" value="&attachmentsTree.label;" crop="right"/>
<listbox id="attachmentList" flex="2"
onclick="attachmentListClick(event);" ondraggesture="nsDragAndDrop.startDrag(event,attachmentAreaDNDObserver);" ondragover="nsDragAndDrop.dragOver(event, attachmentAreaDNDObserver);" context="attachmentListContext"/>
</vbox>
</hbox>
</hbox>
</overlay>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -1,97 +0,0 @@
/* -*- Mode: C++; 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.
*/
/* This is where functions related to the print engine are kept */
/* globals for a particular window */
var printEngineContractID = "@mozilla.org/messenger/msgPrintEngine;1";
var printEngineWindow;
var printEngine;
var printSettings = null;
/* Functions related to startup */
function OnLoadPrintEngine()
{
PrintEngineCreateGlobals();
InitPrintEngineWindow();
printEngine.startPrintOperation(printSettings);
}
function OnUnloadPrintEngine()
{
}
function PrintEngineCreateGlobals()
{
/* get the print engine instance */
printEngine = Components.classes[printEngineContractID].createInstance();
printEngine = printEngine.QueryInterface(Components.interfaces.nsIMsgPrintEngine);
}
function InitPrintEngineWindow()
{
/* Tell the nsIPrintEngine object what window is rendering the email */
printEngine.setWindow(window);
/* hide the printEngine window. see bug #73995 */
printEngine.showWindow(false);
/* See if we got arguments.
* Window was opened via window.openDialog. Copy argument
* and perform compose initialization
*/
if ( window.arguments && window.arguments[0] != null ) {
var numSelected = window.arguments[0];
var uriArray = window.arguments[1];
var statusFeedback = window.arguments[2];
if (window.arguments[3]) {
printSettings = window.arguments[3].QueryInterface(Components.interfaces.nsIPrintSettings);
if (printSettings) {
printSettings.isCancelled = false;
}
}
printEngine.setStatusFeedback(statusFeedback);
if (numSelected > 0) {
printEngine.setPrintURICount(numSelected);
for (var i = 0; i < numSelected; i++) {
printEngine.addPrintURI(uriArray[i]);
//dump(uriArray[i] + "\n");
}
}
}
}
function ClearPrintEnginePane()
{
if (window.frames["printengine"].location != "about:blank")
window.frames["printengine"].location = "about:blank";
}
function StopUrls()
{
printEngine.stopUrls();
}
function PrintEnginePrint()
{
printEngineWindow = window.openDialog("chrome://messenger/content/msgPrintEngine.xul", "", "chrome,dialog=no,all,centerscreen");
}

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

@ -1,43 +0,0 @@
<?xml version="1.0"?>
<!--
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.
-->
<?xml-stylesheet href="chrome://messenger/skin/dialogs.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
<window id="printEngineWin"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:nc="http://home.netscape.com/NC-rdf#"
onload="OnLoadPrintEngine()"
onunload="OnUnloadPrintEngine()"
width="500"
height="500"
windowtype="mail:printEngine">
<!-- XXX: utilityOverlay.xul uses strres.js - once it is converted, this should be removed-->
<script src="chrome://global/content/strres.js"/>
<script src="chrome://messenger/content/msgPrintEngine.js"/>
<!-- The main display frame -->
<iframe id="printengine" style="height: 0px" flex="1" name="printengine" type="content" src="about:blank" />
</window>

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

@ -1,112 +0,0 @@
<?xml version="1.0"?>
<!--
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 Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-2001 Netscape Communications Corporation. All
Rights Reserved.
Contributors:
dianesun@netscape.com
Hkan Waara <hwaara@chello.se>
-->
<?xml-stylesheet href="chrome://messenger/skin/dialogs.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/folderPane.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://messenger/locale/msgSynchronize.dtd" >
<dialog xmlns:nc="http://home.netscape.com/NC-rdf#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="select-offline"
title="&MsgSelect.label;"
width="450" height="400"
persist="width height"
buttons="accept,cancel,help"
onload="selectOnLoad();"
ondialogaccept="return selectOkButton();"
ondialogcancel="return selectCancelButton();"
ondialoghelp="return doHelpButton();">
<script src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/mailWindowOverlay.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/commandglue.js"/>
<stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
<stringbundle id="bundle_brand" src="chrome://global/locale/brand.properties"/>
<script type="application/x-javascript" src="chrome://messenger/content/mailCommands.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/mailWindow.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/msgMail3PaneWindow.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/msgSynchronize.js"/>
<script type="application/x-javascript" src="chrome://help/content/contextHelp.js"/>
<keyset id="keyset"/>
<description class="desc">&MsgSelectDesc.label;</description>
<tree id="synchronizeTree" flex="1" hidecolumnpicker="true"
datasources="rdf:msgaccountmanager rdf:mailnewsfolders" ref="msgaccounts:/" flags="dont-build-content"
onclick="onSynchronizeClick(event);">
<template>
<rule>
<conditions>
<treeitem uri="?container"/>
<member container="?container" child="?member"/>
<triple subject="?member" predicate="http://home.netscape.com/NC-rdf#SupportsOffline" object="true"/>
</conditions>
<bindings>
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#FolderTreeName"
object="?folderTreeName" />
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#FolderTreeName?sort=true"
object="?folderTreeNameSort" />
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#SpecialFolder"
object="?specialFolder" />
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#IsServer"
object="?isServer" />
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#IsSecure"
object="?isSecure" />
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#ServerType"
object="?serverType" />
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#Synchronize"
object="?synchronize" />
</bindings>
<action>
<treechildren>
<treeitem uri="?member">
<treerow>
<treecell label="?folderTreeName"
properties="specialFolder-?specialFolder isServer-?isServer isSecure-?isSecure serverType-?serverType"/>
<treecell properties="synchronize-?synchronize isServer-?isServer"/>
</treerow>
</treeitem>
</treechildren>
</action>
</rule>
</template>
<treecols>
<treecol id="folderNameCol" flex="5" persist="hidden width" label="&MsgSelectItems.label;" primary="true" />
<splitter class="tree-splitter"/>
<treecol id="syncCol" flex="1" persist="hidden width" label="&MsgSelectInd.label;" />
</treecols>
</tree>
</dialog>

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

@ -1,203 +0,0 @@
/* -*- 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 Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributors:
* dianesun@netscape.com
*/
var gSyncMail = false;
var gSyncNews = false;
var gSendMessage = true;
var gWorkOffline = false;
var gSynchronizeTree = null;
var gAccountManager = null;
var gParentMsgWindow;
var gMsgWindow;
var gInitialFolderStates = {};
// RDF needs to be defined for GetFolderAttribute in msgMail3PaneWindow.js
var RDF = Components.classes['@mozilla.org/rdf/rdf-service;1'].getService().QueryInterface(Components.interfaces.nsIRDFService);
const MSG_FOLDER_FLAG_OFFLINE = 0x8000000;
function OnLoad()
{
if (window.arguments && window.arguments[0]) {
if (window.arguments[0].msgWindow) {
gParentMsgWindow = window.arguments[0].msgWindow;
}
}
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
gSyncMail = prefs.getBoolPref("mailnews.offline_sync_mail");
gSyncNews = prefs.getBoolPref("mailnews.offline_sync_news");
gSendMessage = prefs.getBoolPref("mailnews.offline_sync_send_unsent");
gWorkOffline = prefs.getBoolPref("mailnews.offline_sync_work_offline");
document.getElementById("syncMail").checked = gSyncMail;
document.getElementById("syncNews").checked = gSyncNews;
document.getElementById("sendMessage").checked = gSendMessage;
document.getElementById("workOffline").checked = gWorkOffline;
return true;
}
function syncOkButton()
{
gSyncMail = document.getElementById("syncMail").checked;
gSyncNews = document.getElementById("syncNews").checked;
gSendMessage = document.getElementById("sendMessage").checked;
gWorkOffline = document.getElementById("workOffline").checked;
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
prefs.setBoolPref("mailnews.offline_sync_mail", gSyncMail);
prefs.setBoolPref("mailnews.offline_sync_news", gSyncNews);
prefs.setBoolPref("mailnews.offline_sync_send_unsent", gSendMessage);
prefs.setBoolPref("mailnews.offline_sync_work_offline", gWorkOffline);
if( gSyncMail || gSyncNews || gSendMessage || gWorkOffline) {
var offlineManager = Components.classes["@mozilla.org/messenger/offline-manager;1"].getService(Components.interfaces.nsIMsgOfflineManager);
if(offlineManager)
offlineManager.synchronizeForOffline(gSyncNews, gSyncMail, gSendMessage, gWorkOffline, gParentMsgWindow)
}
return true;
}
function OnSelect()
{
top.window.openDialog("chrome://messenger/content/msgSelectOffline.xul", "", "centerscreen,chrome,modal,titlebar,resizable=yes");
return true;
}
function selectOkButton()
{
return true;
}
function selectCancelButton()
{
for (var resourceValue in gInitialFolderStates) {
var resource = RDF.GetResource(resourceValue);
var folder = resource.QueryInterface(Components.interfaces.nsIMsgFolder);
if (gInitialFolderStates[resourceValue])
folder.setFlag(MSG_FOLDER_FLAG_OFFLINE);
else
folder.clearFlag(MSG_FOLDER_FLAG_OFFLINE);
}
return true;
}
function selectOnLoad()
{
gMsgWindow = Components.classes[msgWindowContractID].createInstance(Components.interfaces.nsIMsgWindow);
gMsgWindow.SetDOMWindow(window);
gAccountManager = Components.classes["@mozilla.org/messenger/account-manager;1"].getService(Components.interfaces.nsIMsgAccountManager);
gSynchronizeTree = document.getElementById('synchronizeTree');
SortSynchronizePane('folderNameCol', '?folderTreeNameSort');
}
function SortSynchronizePane(column, sortKey)
{
var node = FindInWindow(window, column);
if(!node) {
dump('Couldnt find sort column\n');
return;
}
node.setAttribute("sort", sortKey);
node.setAttribute("sortDirection", "natural");
gSynchronizeTree.treeBoxObject.view.cycleHeader(column, node);
}
function FindInWindow(currentWindow, id)
{
var item = currentWindow.document.getElementById(id);
if(item)
return item;
for(var i = 0; i < currentWindow.frames.length; i++) {
var frameItem = FindInWindow(currentWindow.frames[i], id);
if(frameItem)
return frameItem;
}
return null;
}
function onSynchronizeClick(event)
{
// we only care about button 0 (left click) events
if (event.button != 0)
return;
var row = {}
var col = {}
var elt = {}
gSynchronizeTree.treeBoxObject.getCellAt(event.clientX, event.clientY, row, col, elt);
if (row.value == -1)
return;
if (elt.value == "twisty") {
var folderResource = GetFolderResource(gSynchronizeTree, row.value);
var msgFolder = folderResource.QueryInterface(Components.interfaces.nsIMsgFolder);
if (!(gSynchronizeTree.treeBoxObject.view.isContainerOpen(row.value))) {
var serverType = GetFolderAttribute(gSynchronizeTree, folderResource, "ServerType");
// imap is the only server type that does folder discovery
if (serverType != "imap") return;
if (GetFolderAttribute(gSynchronizeTree, folderResource, "IsServer") == "true") {
var server = msgFolder.server;
server.performExpand(gMsgWindow);
}
else {
var imapFolder = folderResource.QueryInterface(Components.interfaces.nsIMsgImapMailFolder);
if (imapFolder) {
imapFolder.performExpand(gMsgWindow);
}
}
}
}
else {
if (col.value == "syncCol") {
UpdateNode(GetFolderResource(gSynchronizeTree, row.value), row.value);
}
}
}
function UpdateNode(resource, row)
{
var folder = resource.QueryInterface(Components.interfaces.nsIMsgFolder);
if (folder.isServer)
return;
if (!(resource.Value in gInitialFolderStates)) {
gInitialFolderStates[resource.Value] = folder.getFlag(MSG_FOLDER_FLAG_OFFLINE);
}
folder.toggleFlag(MSG_FOLDER_FLAG_OFFLINE);
}

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

@ -1,62 +0,0 @@
<?xml version="1.0"?>
<!--
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 Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-2001 Netscape Communications Corporation. All
Rights Reserved.
Contributors:
dianesun@netscape.com
Håkan Waara <hwaara@chello.se>
-->
<?xml-stylesheet href="chrome://messenger/skin/dialogs.css" type="text/css"?>
<!DOCTYPE dialog SYSTEM "chrome://messenger/locale/msgSynchronize.dtd" >
<dialog xmlns:NC="http://home.netscape.com/NC-rdf#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="msg-synchronizer"
title="&MsgSynchronize.label;"
onload="OnLoad();"
style="width: 35em;"
ondialogaccept="return syncOkButton();">
<script src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/mailWindowOverlay.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/mailCommands.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/msgMail3PaneWindow.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/msgSynchronize.js"/>
<keyset id="keyset"/>
<label hidden="true" wsm_persist="true" id="server.type"/>
<description class="desc">&MsgSyncDesc.label;</description>
<separator class="thin"/>
<label value="&MsgSyncDirections.label;"/>
<vbox class="indent" align="start">
<checkbox id="syncMail" hidable="true" hidefor="pop3" label="&syncTypeMail.label;"/>
<checkbox id="syncNews" label="&syncTypeNews.label;"/>
</vbox>
<vbox align="start">
<checkbox id="sendMessage" label="&sendMessage.label;"/>
<checkbox id="workOffline" label="&workOffline.label;"/>
</vbox>
<separator class="thin"/>
<hbox align="right">
<button id="select" label="&selectButton.label;" oncommand="OnSelect();"/>
</hbox>
</dialog>

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

@ -1,280 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* 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.
*/
/* This file contains the js functions necessary to implement view navigation within the 3 pane. */
//NOTE: gMessengerBundle must be defined and set or this Overlay won't work
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService();
promptService = promptService.QueryInterface(Components.interfaces.nsIPromptService);
var accountManager = Components.classes["@mozilla.org/messenger/account-manager;1"].getService(Components.interfaces.nsIMsgAccountManager);
// we need the account manager datasource for when trying
// to figure out which account is next in the folder pane.
var gAccountManagerDataSource = Components.classes["@mozilla.org/rdf/datasource;1?name=msgaccountmanager"].createInstance().QueryInterface(Components.interfaces.nsIRDFDataSource);
// we can't compare the name to determine the order in the folder pane
// we need to compare the value of the sort resource,
// as that's what we use to sort on in the folder pane
var gNameProperty = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService).GetResource("http://home.netscape.com/NC-rdf#Name?sort=true");
function compareServerSortOrder(server1, server2)
{
var sortValue1, sortValue2;
try {
var res1 = RDF.GetResource(server1.URI);
sortValue1 = gAccountManagerDataSource.GetTarget(res1, gNameProperty, true).QueryInterface(Components.interfaces.nsIRDFLiteral).Value;
}
catch (ex) {
dump("XXX ex " + server1.URI + "," + ex + "\n");
sortValue1 = "";
}
try {
var res2 = RDF.GetResource(server2.URI);
sortValue2 = gAccountManagerDataSource.GetTarget(res2, gNameProperty, true).QueryInterface(Components.interfaces.nsIRDFLiteral).Value;
}
catch (ex) {
dump("XXX ex " + server2.URI + "," + ex + "\n");
sortValue2 = "";
}
if (sortValue1 < sortValue2)
return -1;
else if (sortValue1 > sortValue2)
return 1;
else
return 0;
}
function compareFolderSortKey(folder1, folder2)
{
return folder1.compareSortKeys(folder2);
}
function GetSubFoldersInFolderPaneOrder(folder)
{
var subFolderEnumerator = folder.GetSubFolders();
var done = false;
var msgFolders = Array();
// get all the subfolders
while (!done) {
try {
var element = subFolderEnumerator.currentItem();
var msgFolder = element.QueryInterface(Components.interfaces.nsIMsgFolder);
msgFolders[msgFolders.length] = msgFolder;
subFolderEnumerator.next();
}
catch (ex) {
done = true;
}
}
// sort the subfolders
msgFolders.sort(compareFolderSortKey);
return msgFolders;
}
function FindNextChildFolder(folder)
{
// if there is unread mail in the trash, sent, drafts, unsent messages
// or templates folders, we ignore it
// when doing cross folder "next" navigation
if (IsSpecialFolder(folder, MSG_FOLDER_FLAG_TRASH | MSG_FOLDER_FLAG_SENTMAIL | MSG_FOLDER_FLAG_DRAFTS | MSG_FOLDER_FLAG_QUEUE | MSG_FOLDER_FLAG_TEMPLATES))
return null;
if (folder.getNumUnread(false) > 0)
return folder;
if (folder.getNumUnread(true) > 0) {
var subFolders = GetSubFoldersInFolderPaneOrder(folder);
for (var i = 0; i < subFolders.length; i++) {
folder = FindNextChildFolder(subFolders[i]);
if (folder)
return folder;
}
}
return null;
}
function FindNextFolder()
{
// look for the next folder, this will only look on the current account
// and below us, in the folder pane
// note use of gDBView restricts this function to message folders
// otherwise you could go next unread from a server
var folder = FindNextChildFolder(gDBView.msgFolder);
if (folder)
return folder;
// didn't find folder in children
// go up to the parent, and start at the folder after the current one
// unless we are at a server, in which case bail out.
for (folder = gDBView.msgFolder; !folder.isServer; ) {
var parent = folder.parent;
var msgFolders = GetSubFoldersInFolderPaneOrder(parent);
for (var i = 0; i < msgFolders.length; i++)
if (msgFolders[i].URI == folder.URI)
break;
// the current folder is at index i
// start at the next folder after that, if there is one
while (++i < msgFolders.length) {
folder = FindNextChildFolder(msgFolders[i]);
if (folder)
return folder;
}
// none at this level after the current folder. go up.
folder = parent;
}
// nothing in the current account, start with the next account (below)
// and try until we hit the bottom of the folder pane
// start at the account after the current account
var rootFolders = GetRootFoldersInFolderPaneOrder();
for (i = 0; i < rootFolders.length; i++) {
if (rootFolders[i].URI == gDBView.msgFolder.server.serverURI)
break;
}
for (var j = i + 1; j < rootFolders.length; j++) {
folder = FindNextChildFolder(rootFolders[j]);
if (folder)
return folder;
}
// if nothing from the current account down to the bottom
// (of the folder pane), start again at the top.
for (j = 0; j <= i; j++) {
folder = FindNextChildFolder(rootFolders[j]);
if (folder)
return folder;
}
return null;
}
function GetRootFoldersInFolderPaneOrder()
{
var allServers = accountManager.allServers;
var numServers = allServers.Count();
var serversMsgFolders = Array(numServers);
for (var i = 0; i < numServers; i++)
serversMsgFolders[i] = allServers.GetElementAt(i).QueryInterface(Components.interfaces.nsIMsgIncomingServer).rootMsgFolder;
// sort accounts, so they are in the same order as folder pane
serversMsgFolders.sort(compareServerSortOrder);
return serversMsgFolders;
}
function CrossFolderNavigation(type, supportsFolderPane )
{
if (type != nsMsgNavigationType.nextUnreadMessage) {
// only do cross folder navigation for "next unread message"
return null;
}
var nextMode = pref.getIntPref("mailnews.nav_crosses_folders");
// 0: "next" goes to the next folder, without prompting
// 1: "next" goes to the next folder, and prompts (the default)
// 2: "next" does nothing when there are no unread messages
// not crossing folders, don't find next
if (nextMode == 2) return null;
var folder = FindNextFolder();
if (folder && (gDBView.msgFolder.URI != folder.URI)) {
switch (nextMode) {
case 0:
// do this unconditionally
gNextMessageAfterLoad = type;
if (supportsFolderPane)
SelectFolder(folder.URI);
break;
case 1:
default:
var promptText = gMessengerBundle.getFormattedString("advanceNextPrompt", [ folder.name ], 1);
if (promptService.confirm(window, promptText, promptText)) {
gNextMessageAfterLoad = type;
if (supportsFolderPane)
SelectFolder(folder.URI);
}
break;
}
}
return folder;
}
function ScrollToMessage(type, wrap, selectMessage)
{
try {
var treeView = gDBView.QueryInterface(Components.interfaces.nsITreeView);
var treeSelection = treeView.selection;
var currentIndex = treeSelection.currentIndex;
var resultId = new Object;
var resultIndex = new Object;
var threadIndex = new Object;
gDBView.viewNavigate(type, resultId, resultIndex, threadIndex, true /* wrap */);
// only scroll and select if we found something
if ((resultId.value != nsMsgViewIndex_None) && (resultIndex.value != nsMsgViewIndex_None)) {
if (selectMessage){
treeSelection.select(resultIndex.value);
}
EnsureRowInThreadTreeIsVisible(resultIndex.value);
return true;
}
else {
return false;
}
}
catch (ex) {
return false;
}
}
function GoNextMessage(type, startFromBeginning)
{
try {
var succeeded = ScrollToMessage(type, startFromBeginning, true);
if (!succeeded) {
CrossFolderNavigation(type, true);
}
}
catch (ex) {
dump("GoNextMessage ex = " + ex + "\n");
}
SetFocusThreadPaneIfNotOnMessagePane();
}

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

@ -1,107 +0,0 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Contributor(s):
* Fabian Guisset <hidday@geocities.com>
*/
const FOLDERS = 1;
const MESSAGES = 2;
var dialog;
function onLoad()
{
var arguments = window.arguments[0];
dialog = {};
dialog.OKButton = document.getElementById("ok");
dialog.nameField = document.getElementById("name");
dialog.nameField.focus();
// call this when OK is pressed
dialog.okCallback = arguments.okCallback;
// pre select the folderPicker, based on what they selected in the folder pane
dialog.picker = document.getElementById("msgNewFolderPicker");
MsgFolderPickerOnLoad("msgNewFolderPicker");
// can folders contain both folders and messages?
if (arguments.dualUseFolders) {
dialog.folderType = FOLDERS | MESSAGES;
// hide the section when folder contain both folders and messages.
var newFolderTypeBox = document.getElementById("newFolderTypeBox");
newFolderTypeBox.setAttribute("hidden", "true");
} else {
// set our folder type by calling the default selected type's oncommand
var selectedFolderType = document.getElementById("folderGroup").selectedItem;
eval(selectedFolderType.getAttribute("oncommand"));
}
moveToAlertPosition();
doEnabling();
doSetOKCancel(onOK, onCancel);
}
function onOK()
{
var name = dialog.nameField.value;
var uri = dialog.picker.getAttribute("uri");
// do name validity check?
// make sure name ends in "/" if folder to create can only contain folders
if ((dialog.folderType == FOLDERS) && name.charAt(name.length-1) != "/")
dialog.okCallback(name + "/", uri);
else
dialog.okCallback(name, uri);
return true;
}
function onCancel()
{
// close the window
return true;
}
function onFoldersOnly()
{
dialog.folderType = FOLDERS;
}
function onMessagesOnly()
{
dialog.folderType = MESSAGES;
}
function doEnabling()
{
if (dialog.nameField.value && dialog.picker.getAttribute("uri")) {
if (dialog.OKButton.disabled)
dialog.OKButton.disabled = false;
} else {
if (!dialog.OKButton.disabled)
dialog.OKButton.disabled = true;
}
}

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

@ -1,82 +0,0 @@
<?xml version="1.0"?>
<!--
- 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.
-
- Contributor(s):
- Fabian Guisset <hidday@geocities.com>
-->
<?xml-stylesheet href="chrome://messenger/skin/dialogs.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/msgFolderPickerOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://messenger/locale/newFolderDialog.dtd">
<window xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&newFolderDialog.title;"
class="dialog"
onload="onLoad();">
<stringbundleset id="stringbundleset"/>
<script type="application/x-javascript" src="chrome://messenger/content/mailCommands.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/newFolderDialog.js"/>
<keyset id="dialogKeys"/>
<vbox>
<spacer flex="1"/>
<label value="&name.label;" accesskey="&name.accesskey;" control="name"/>
<textbox tabindex="0" id="name" oninput="doEnabling();"/>
<separator/>
<label value="&description.label;" accesskey="&description.accesskey;" control="msgNewFolderPicker"/>
<menulist id="msgNewFolderPicker" oncommand="doEnabling();"/>
<vbox id="newFolderTypeBox">
<separator class="thin"/>
<label value="&folderRestriction1.label;"/>
<label value="&folderRestriction2.label;"/>
<separator class="thin"/>
<radiogroup id="folderGroup">
<radio oncommand="onFoldersOnly();" label="&foldersOnly.label;"/>
<radio oncommand="onMessagesOnly();" label="&messagesOnly.label;" selected="true"/>
<spacer flex="100%"/>
</radiogroup>
</vbox>
<spacer flex="1"/>
<separator/>
<hbox id="okCancelButtonsRight"/>
</vbox>
</window>

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

@ -1,74 +0,0 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Contributor(s):
* Fabian Guisset <hidday@geocities.com>
*/
var dialog;
function onLoad()
{
var arguments = window.arguments[0];
dialog = {};
dialog.OKButton = document.getElementById("ok");
dialog.nameField = document.getElementById("name");
dialog.nameField.value = arguments.name;
dialog.nameField.select();
dialog.nameField.focus();
// call this when OK is pressed
dialog.okCallback = arguments.okCallback;
// pre select the folderPicker, based on what they selected in the folder pane
dialog.preselectedFolderURI = arguments.preselectedURI;
moveToAlertPosition();
doEnabling();
doSetOKCancel(onOK, onCancel);
}
function onOK()
{
dialog.okCallback(dialog.nameField.value, dialog.preselectedFolderURI);
return true;
}
function onCancel()
{
// close the window
return true;
}
function doEnabling()
{
if (dialog.nameField.value) {
if (dialog.OKButton.disabled)
dialog.OKButton.disabled = false;
} else {
if (!dialog.OKButton.disabled)
dialog.OKButton.disabled = true;
}
}

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

@ -1,57 +0,0 @@
<?xml version="1.0"?> <!-- -*- Mode: xml; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- -->
<!--
- 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.
-
- Contributor(s):
- Fabian Guisset <hidday@geocities.com>
-->
<?xml-stylesheet href="chrome://messenger/skin/dialogs.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/msgFolderPickerOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://messenger/locale/renameFolderDialog.dtd">
<window xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&renameFolderDialog.title;"
class="dialog"
onload="onLoad();">
<stringbundleset id="stringbundleset"/>
<script type="application/x-javascript" src="chrome://messenger/content/mailCommands.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/renameFolderDialog.js"/>
<keyset id="dialogKeys"/>
<vbox>
<spacer flex="100%"/>
<label value="&rename.label;" accesskey="&rename.accesskey;" control="name"/>
<textbox tabindex="0" id="name" oninput="doEnabling();"/>
<spacer flex="100%"/>
<hbox id="okCancelButtons"/>
</vbox>
</window>

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

@ -1,391 +0,0 @@
/* -*- 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.
*
* Original Author:
* Navin Gupta <naving@netscape.com>
*
* Contributor(s):
*
*/
var gSearchSession = null;
var gPreQuickSearchView = null;
var gSearchTimer = null;
var gViewSearchListener;
var gNumOfSearchHits = 0;
var gSearchBundle;
var gStatusBar = null;
var gSearchInProgress = false;
var gSearchInput = null;
var gClearButton = null;
var gDefaultSearchViewTerms = null;
var gQSViewIsDirty = false;
// nsIMsgSearchNotify object
var gSearchNotificationListener =
{
onSearchHit: function(header, folder)
{
gNumOfSearchHits++;
},
onSearchDone: function(status)
{
var statusMsg;
// if there are no hits, it means no matches were found in the search.
if (gNumOfSearchHits == 0) {
statusMsg = gSearchBundle.getString("searchFailureMessage");
}
else
{
if (gNumOfSearchHits == 1)
statusMsg = gSearchBundle.getString("searchSuccessMessage");
else
statusMsg = gSearchBundle.getFormattedString("searchSuccessMessages", [gNumOfSearchHits]);
gNumOfSearchHits = 0;
}
statusFeedback.showProgress(0);
statusFeedback.showStatusString(statusMsg);
gStatusBar.setAttribute("mode","normal");
gSearchInProgress = false;
},
onNewSearch: function()
{
statusFeedback.showProgress(0);
statusFeedback.showStatusString(gSearchBundle.getString("searchingMessage"));
gStatusBar.setAttribute("mode","undetermined");
gSearchInProgress = true;
}
}
function getDocumentElements()
{
gSearchBundle = document.getElementById("bundle_search");
gStatusBar = document.getElementById('statusbar-icon');
gClearButton = document.getElementById('clearButton');
GetSearchInput();
}
function addListeners()
{
gViewSearchListener = gDBView.QueryInterface(Components.interfaces.nsIMsgSearchNotify);
gSearchSession.registerListener(gViewSearchListener);
}
function removeListeners()
{
gSearchSession.unregisterListener(gViewSearchListener);
}
function removeGlobalListeners()
{
removeListeners();
gSearchSession.removeFolderListener(folderListener);
gSearchSession.unregisterListener(gSearchNotificationListener);
}
function initializeGlobalListeners()
{
gSearchSession.addFolderListener(folderListener);
// Setup the javascript object as a listener on the search results
gSearchSession.registerListener(gSearchNotificationListener);
}
function createQuickSearchView()
{
if(gDBView.viewType != nsMsgViewType.eShowQuickSearchResults) //otherwise we are already in quick search view
{
var treeView = gDBView.QueryInterface(Components.interfaces.nsITreeView); //clear selection
treeView.selection.clearSelection();
gPreQuickSearchView = gDBView;
CreateDBView(gDBView.msgFolder, nsMsgViewType.eShowQuickSearchResults, nsMsgViewFlagsType.kNone, gDBView.sortType, gDBView.sortOrder);
}
}
function initializeSearchBar()
{
createQuickSearchView();
if (!gSearchSession)
{
getDocumentElements();
var searchSessionContractID = "@mozilla.org/messenger/searchSession;1";
gSearchSession = Components.classes[searchSessionContractID].createInstance(Components.interfaces.nsIMsgSearchSession);
initializeGlobalListeners();
}
else
{
if (gSearchInProgress)
{
onSearchStop();
gSearchInProgress = false;
}
removeListeners();
}
addListeners();
}
function onEnterInSearchBar()
{
if (gSearchInput.value == "")
{
if (gDBView.viewType == nsMsgViewType.eShowQuickSearchResults)
{
statusFeedback.showStatusString("");
disableQuickSearchClearButton();
if (gDefaultSearchViewTerms)
{
if (gQSViewIsDirty)
{
initializeSearchBar();
onSearch(gDefaultSearchViewTerms);
}
}
else
restorePreSearchView();
}
gQSViewIsDirty = false;
return;
}
initializeSearchBar();
gClearButton.setAttribute("disabled", false); //coming into search enable clear button
ClearThreadPaneSelection();
ClearMessagePane();
onSearch(null);
gQSViewIsDirty = false;
}
function restorePreSearchView()
{
var selectedHdr = null;
//save selection
try
{
selectedHdr = gDBView.hdrForFirstSelectedMessage;
}
catch (ex)
{}
//we might have to sort the view coming out of quick search
var sortType = gDBView.sortType;
var sortOrder = gDBView.sortOrder;
var viewFlags = gDBView.viewFlags;
var folder = gDBView.msgFolder;
gDBView.close();
gDBView = null;
if (gPreQuickSearchView)
{
gDBView = gPreQuickSearchView;
if (sortType != gDBView.sortType || sortOrder != gDBView.sortOrder)
{
gDBView.sort(sortType, sortOrder);
UpdateSortIndicators(sortType, sortOrder);
}
gPreQuickSearchView = null;
}
else //create default view type
CreateDBView(folder, nsMsgViewType.eShowAllThreads, viewFlags, sortType, sortOrder);
RerootThreadPane();
//now restore selection
if (selectedHdr)
{
gDBView.selectMsgByKey(selectedHdr.messageKey);
var treeView = gDBView.QueryInterface(Components.interfaces.nsITreeView);
var selectedIndex = treeView.selection.currentIndex;
if (selectedIndex >= 0) //scroll
EnsureRowInThreadTreeIsVisible(selectedIndex);
else
ClearMessagePane();
}
else
ScrollToMessage(nsMsgNavigationType.firstNew, true, false /* selectMessage */);
}
function onSearch(aSearchTerms)
{
RerootThreadPane();
if (aSearchTerms)
createSearchTermsWithList(aSearchTerms);
else
createSearchTerms();
gDBView.searchSession = gSearchSession;
try
{
gSearchSession.search(msgWindow);
}
catch(ex)
{
dump("Search Exception\n");
}
}
function createSearchTermsWithList(aTermsArray)
{
var nsMsgSearchScope = Components.interfaces.nsMsgSearchScope;
var nsMsgSearchAttrib = Components.interfaces.nsMsgSearchAttrib;
var nsMsgSearchOp = Components.interfaces.nsMsgSearchOp;
gSearchSession.clearScopes();
var searchTerms = gSearchSession.searchTerms;
var searchTermsArray = searchTerms.QueryInterface(Components.interfaces.nsISupportsArray);
searchTermsArray.Clear();
var selectedFolder = GetThreadPaneFolder();
gSearchSession.addScopeTerm(nsMsgSearchScope.offlineMail, selectedFolder);
// add each item in termsArray to the search session
var termsArray = aTermsArray.QueryInterface(Components.interfaces.nsISupportsArray);
for (var i = 0; i < termsArray.Count(); i++)
gSearchSession.appendTerm(termsArray.GetElementAt(i).QueryInterface(Components.interfaces.nsIMsgSearchTerm));
}
function createSearchTerms()
{
var nsMsgSearchScope = Components.interfaces.nsMsgSearchScope;
var nsMsgSearchAttrib = Components.interfaces.nsMsgSearchAttrib;
var nsMsgSearchOp = Components.interfaces.nsMsgSearchOp;
// create an i supports array to store our search terms
var searchTermsArray = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray);
var selectedFolder = GetThreadPaneFolder();
var term = gSearchSession.createTerm();
var value = term.value;
value.str = gSearchInput.value;
term.value = value;
term.attrib = nsMsgSearchAttrib.Subject;
term.op = nsMsgSearchOp.Contains;
term.booleanAnd = false;
searchTermsArray.AppendElement(term);
// fill in the 2nd term
term = gSearchSession.createTerm();
if (IsSpecialFolder(selectedFolder, MSG_FOLDER_FLAG_SENTMAIL | MSG_FOLDER_FLAG_DRAFTS | MSG_FOLDER_FLAG_QUEUE))
term.attrib = nsMsgSearchAttrib.ToOrCC;
else
term.attrib = nsMsgSearchAttrib.Sender;
value = term.value;
value.str = gSearchInput.value;
term.value = value;
term.op = nsMsgSearchOp.Contains;
term.booleanAnd = false;
searchTermsArray.AppendElement(term);
// now append the default view criteria to the quick search so we don't lose any default
// view information
if (gDefaultSearchViewTerms)
{
var isupports = null;
var searchTerm;
var termsArray = gDefaultSearchViewTerms.QueryInterface(Components.interfaces.nsISupportsArray);
for (var i = 0; i < termsArray.Count(); i++)
{
isupports = termsArray.GetElementAt(i);
searchTerm = isupports.QueryInterface(Components.interfaces.nsIMsgSearchTerm);
searchTermsArray.AppendElement(searchTerm);
}
}
createSearchTermsWithList(searchTermsArray);
// now that we've added the terms, clear out our input array
searchTermsArray.Clear();
}
function onAdvancedSearch()
{
MsgSearchMessages();
}
function onSearchStop()
{
gSearchSession.interruptSearch();
}
function onSearchKeyPress(event)
{
// 13 == return
if (event && event.keyCode == 13)
onSearchInput(true);
}
function onSearchInput(returnKeyHit)
{
if (gSearchTimer) {
clearTimeout(gSearchTimer);
gSearchTimer = null;
}
// only select the text when the return key was hit
if (returnKeyHit) {
GetSearchInput();
gSearchInput.select();
onEnterInSearchBar();
}
else {
gSearchTimer = setTimeout("onEnterInSearchBar();", 800);
}
}
function onClearSearch()
{
var focusedElement = gLastFocusedElement; // save of the last focused element so that focus can be restore
Search("");
focusedElement.focus();
}
function disableQuickSearchClearButton()
{
if (gClearButton)
gClearButton.setAttribute("disabled", true); //going out of search disable clear button
}
function Search(str)
{
GetSearchInput();
if (str != gSearchInput.value)
gQSViewIsDirty = true;
gSearchInput.value = str; //on input does not get fired for some reason
onSearchInput(true);
}

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

@ -1,66 +0,0 @@
/* -*- Mode: C++; 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.
*/
/*
* code in here is generic, shared utility code across all messenger
* components. There should be no command or widget specific code here
*/
function NewBrowserWindow() {}
function NewBlankPage() {}
function TemplatePage() {}
function WizardPage() {}
function CharacterSet(){}
function MessengerSetDefaultCharacterSet(aCharset)
{
// dump(aCharset);dump("\n");
messenger.SetDocumentCharset(aCharset);
msgWindow.mailCharacterSet = aCharset;
msgWindow.charsetOverride = true;
// folder charset to be set by folder property not by charset menu
// var folderResource = GetSelectedFolderResource();
// SetFolderCharset(folderResource, aCharset);
// RefreshThreadPane();
// DO NOT try to reload the message here. we do this automatically now in
// messenger.SetDocumentCharset. You'll just break things and reak havoc
// if you call MsgReload() here...
}
function PrintPreview() {
dump("PrintPreview()\n");
try {
messenger.DoPrintPreview();
}
catch (ex) {
dump("failed to print preview\n");
}
}
function Print() {
dump("Print()\n");
try {
messenger.DoPrint();
}
catch (ex) {
dump("failed to print\n");
}
}

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

@ -1,535 +0,0 @@
var gSubscribeTree = null;
var gSearchTree;
var okCallback = null;
var gChangeTable = {};
var gServerURI = null;
var gSubscribableServer = null;
var gStatusBar = null;
var gNameField = null;
var gNameFieldLabel = null;
var gFolderDelimiter = ".";
var gStatusFeedback = new nsMsgStatusFeedback;
var gSubscribeDeck = null;
var gSearchView = null;
var gSearchTreeBoxObject = null;
// the rdf service
var RDF = Components.classes['@mozilla.org/rdf/rdf-service;1'].getService(Components.interfaces.nsIRDFService);
var subscribeDS = RDF.GetDataSource("rdf:subscribe");
// get the "subscribed" atom
var atomService = Components.classes["@mozilla.org/atom-service;1"].getService().QueryInterface(Components.interfaces.nsIAtomService);
var gSubscribedAtom = atomService.getAtom("subscribed").QueryInterface(Components.interfaces.nsISupports);
var gSubscribeBundle;
function goDoCommand()
{
}
function Stop()
{
//dump("Stop()\n")
if (gSubscribableServer) {
gSubscribableServer.stopPopulating(msgWindow);
}
}
function SetServerTypeSpecificTextValues()
{
if (!gServerURI) return;
var serverType = GetMsgFolderFromUri(gServerURI, true).server.type;
// set the server specific ui elements
var stringName = "foldersheaderfor-" + serverType;
var stringval = gSubscribeBundle.getString(stringName);
var element = document.getElementById("nameColumn");
element.setAttribute('label',stringval);
element = document.getElementById("nameColumn2");
element.setAttribute('label',stringval);
//set the delimiter
try {
gFolderDelimiter = gSubscribableServer.delimiter;
}
catch (ex) {
//dump(ex + "\n");
gFolderDelimiter = ".";
}
}
function onServerClick(event)
{
var item = event.target;
gServerURI = item.id;
//dump("gServerURI="+gServerURI+"\n");
SetUpTree(false);
SetServerTypeSpecificTextValues();
}
function SetUpServerMenu()
{
//dump("SetUpServerMenu()\n");
var serverMenu = document.getElementById("serverMenu");
var menuitems = serverMenu.getElementsByAttribute("id", gServerURI);
try {
//dump("gServerURI="+gServerURI+"\n");
//dump("menuitems="+menuitems+"\n");
//dump("menuitems[0]="+menuitems[0]+"\n");
//dump("serverMenu="+serverMenu+"\n");
serverMenu.selectedItem = menuitems[0];
}
catch (ex) {
//dump("failed to set the selected server: " + ex + "\n");
}
SetServerTypeSpecificTextValues();
}
var MySubscribeListener = {
OnDonePopulating: function() {
gStatusFeedback.showProgress(0);
gStatusFeedback.showStatusString("");
gStatusBar.setAttribute("mode","normal");
// only re-root the tree, if it is null.
// otherwise, we are in here because we are populating
// a part of the tree
var refValue = gSubscribeTree.getAttribute('ref');
if (!refValue) {
//dump("root subscribe tree at: "+ gServerURI +"\n");
gSubscribeTree.database.AddDataSource(subscribeDS);
gSubscribeTree.setAttribute('ref',gServerURI);
}
}
};
function SetUpTree(forceToServer)
{
//dump("SetUpTree()\n");
gStatusBar = document.getElementById('statusbar-icon');
if (!gServerURI) return;
var folder = GetMsgFolderFromUri(gServerURI, true);
var server = folder.server;
try {
CleanUpSearchView();
gSubscribableServer = server.QueryInterface(Components.interfaces.nsISubscribableServer);
gSubscribeTree.setAttribute('ref',null);
// enable (or disable) the search related UI
EnableSearchUI();
// clear out the text field when switching server
gNameField.value = "";
// since there is no text, switch to the non-search view...
SwitchToNormalView();
gSubscribeTree.database.RemoveDataSource(subscribeDS);
gSubscribableServer.subscribeListener = MySubscribeListener;
gStatusFeedback.showProgress(0);
gStatusFeedback.showStatusString(gSubscribeBundle.getString("pleaseWaitString"));
gStatusBar.setAttribute("mode","undetermined");
gSubscribableServer.startPopulating(msgWindow, forceToServer);
}
catch (ex) {
//dump("failed to populate subscribe ds: " + ex + "\n");
}
}
function SubscribeOnUnload()
{
try {
CleanUpSearchView();
gSubscribeTree.database.RemoveDataSource(subscribeDS);
}
catch (ex) {
dump("failed to remove the subscribe ds: " + ex + "\n");
}
}
function EnableSearchUI()
{
if (gSubscribableServer.supportsSubscribeSearch) {
gNameField.removeAttribute('disabled');
gNameFieldLabel.removeAttribute('disabled');
}
else {
gNameField.setAttribute('disabled',true);
gNameFieldLabel.setAttribute('disabled',true);
}
}
function SubscribeOnLoad()
{
//dump("SubscribeOnLoad()\n");
gSubscribeBundle = document.getElementById("bundle_subscribe");
gSubscribeTree = document.getElementById("subscribeTree");
gSearchTree = document.getElementById("searchTree");
gSearchTreeBoxObject = document.getElementById("searchTree").treeBoxObject;
gNameField = document.getElementById("namefield");
gNameFieldLabel = document.getElementById("namefieldlabel");
gSubscribeDeck = document.getElementById("subscribedeck");
msgWindow = Components.classes[msgWindowContractID].createInstance(Components.interfaces.nsIMsgWindow);
msgWindow.statusFeedback = gStatusFeedback;
msgWindow.SetDOMWindow(window);
// look in arguments[0] for parameters
if (window.arguments && window.arguments[0]) {
if ( window.arguments[0].okCallback ) {
top.okCallback = window.arguments[0].okCallback;
}
}
gServerURI = null;
if (window.arguments[0].preselectedURI) {
var uri = window.arguments[0].preselectedURI;
//dump("subscribe: got a uri," + uri + "\n");
var folder = GetMsgFolderFromUri(uri, true);
//dump("folder="+folder+"\n");
//dump("folder.server="+folder.server+"\n");
try {
CleanUpSearchView();
gSubscribableServer = folder.server.QueryInterface(Components.interfaces.nsISubscribableServer);
// enable (or disable) the search related UI
EnableSearchUI();
gServerURI = folder.server.serverURI;
}
catch (ex) {
//dump("not a subscribable server\n");
CleanUpSearchView();
gSubscribableServer = null;
gServerURI = null;
}
}
if (!gServerURI) {
//dump("subscribe: no uri\n");
//dump("xxx todo: use the default news server. right now, I'm just using the first server\n");
var serverMenu = document.getElementById("serverMenu");
var menuitems = serverMenu.getElementsByTagName("menuitem");
if (menuitems.length > 1) {
gServerURI = menuitems[1].id;
}
else {
//dump("xxx todo none of your servers are subscribable\n");
//dump("xxx todo fix this by disabling subscribe if no subscribable server or, add a CREATE SERVER button, like in 4.x\n");
return;
}
}
SetUpServerMenu();
SetUpTree(false);
gNameField.focus();
}
function subscribeOK()
{
//dump("in subscribeOK()\n")
if (top.okCallback) {
top.okCallback(top.gChangeTable);
}
Stop();
if (gSubscribableServer) {
gSubscribableServer.subscribeCleanup();
}
return true;
}
function subscribeCancel()
{
Stop();
if (gSubscribableServer) {
gSubscribableServer.subscribeCleanup();
}
return true;
}
function SetState(name,state)
{
var changed = gSubscribableServer.setState(name, state);
if (changed)
StateChanged(name,state);
}
function changeTableRecord(server, name, state)
{
this.server = server;
this.name = name;
this.state = state;
}
function StateChanged(name,state)
{
if (gServerURI in gChangeTable) {
if (name in gChangeTable[gServerURI]) {
var oldValue = gChangeTable[gServerURI][name];
if (oldValue != state)
delete gChangeTable[gServerURI][name];
}
else {
gChangeTable[gServerURI][name] = state;
}
}
else {
gChangeTable[gServerURI] = {};
gChangeTable[gServerURI][name] = state;
}
}
function InSearchMode()
{
// search is the second card in the deck
return (gSubscribeDeck.getAttribute("selectedIndex") == "1");
}
function SearchOnClick(event)
{
// we only care about button 0 (left click) events
if (event.button != 0 || event.originalTarget.localName != "treechildren") return;
var row = {}, colID = {}, childElt = {};
gSearchTreeBoxObject.getCellAt(event.clientX, event.clientY, row, colID, childElt);
if (row.value == -1 || row.value > gSearchView.rowCount-1)
return;
if (colID.value == "subscribedColumn2") {
if (event.detail != 2) {
// single clicked on the check box
// (in the "subscribedColumn2" column) reverse state
// if double click, do nothing
ReverseStateFromRow(row.value);
}
} else if (event.detail == 2) {
// double clicked on a row, reverse state
ReverseStateFromRow(row.value);
}
// invalidate the row
InvalidateSearchTreeRow(row.value);
}
function ReverseStateFromRow(row)
{
// to determine if the row is subscribed or not,
// we get the properties for the "subscribedColumn2" cell in the row
// and look for the "subscribed" property
// if the "subscribed" atom is in the list of properties
// we are subscribed
var properties = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray);
gSearchView.getCellProperties(row, "subscribedColumn2", properties);
var isSubscribed = (properties.GetIndexOf(gSubscribedAtom) != -1);
SetStateFromRow(row, !isSubscribed);
}
function SetStateFromRow(row, state)
{
var name = gSearchView.getCellText(row,"nameColumn2");
// we need to escape the name because
// some news servers have newsgroups with non ASCII names
// we need to escape those name before calling SetState()
SetState(escape(name), state);
}
function SetSubscribeState(state)
{
try {
// we need to iterate over the tree selection, and set the state for
// all rows in the selection
var inSearchMode = InSearchMode();
var view = inSearchMode ? gSearchView : gSubscribeTree.view;
var colId = inSearchMode ? "nameColumn2" : "nameColumn";
var sel = view.selection;
for (var i = 0; i < sel.getRangeCount(); ++i) {
var start = {}, end = {};
sel.getRangeAt(i, start, end);
for (var k = start.value; k <= end.value; ++k) {
if (inSearchMode)
SetStateFromRow(k, state);
else {
var rowRes = gSubscribeTree.builderView.getResourceAtIndex(k);
var name = GetRDFProperty(rowRes, "Name");
SetState(name, state);
}
}
}
if (inSearchMode) {
// force a repaint
InvalidateSearchTree();
}
}
catch (ex) {
dump("SetSubscribedState failed: " + ex + "\n");
}
}
function ReverseStateFromNode(row)
{
var rowRes = gSubscribeTree.builderView.getResourceAtIndex(row);
var isSubscribed = GetRDFProperty(rowRes, "Subscribed");
var name = GetRDFProperty(rowRes, "Name");
SetState(name, isSubscribed != "true");
}
function GetRDFProperty(aRes, aProp)
{
var propRes = RDF.GetResource("http://home.netscape.com/NC-rdf#"+aProp);
var valueRes = gSubscribeTree.database.GetTarget(aRes, propRes, true);
return valueRes ? valueRes.QueryInterface(Components.interfaces.nsIRDFLiteral).Value : null;
}
function SubscribeOnClick(event)
{
// we only care about button 0 (left click) events
if (event.button != 0 || event.originalTarget.localName != "treechildren")
return;
var row = {}, col = {}, obj = {};
gSubscribeTree.treeBoxObject.getCellAt(event.clientX, event.clientY, row, col, obj);
if (row.value == -1 || row.value > (gSubscribeTree.view.rowCount - 1))
return;
if (event.detail == 2) {
// only toggle subscribed state when double clicking something
// that isn't a container
if (!gSubscribeTree.view.isContainer(row.value)) {
ReverseStateFromNode(row.value);
return;
}
}
else if (event.detail == 1)
{
if (obj.value == "twisty") {
if (gSubscribeTree.view.isContainerOpen(row.value)) {
var uri = gSubscribeTree.builderView.getResourceAtIndex(row.value).Value;
gStatusFeedback.showProgress(0);
gStatusFeedback.showStatusString(gSubscribeBundle.getString("pleaseWaitString"));
gStatusBar.setAttribute("mode", "undetermined");
gSubscribableServer.startPopulatingWithUri(msgWindow, true /* force to server */, uri);
}
}
else {
// if the user single clicks on the subscribe check box, we handle it here
if (col.value == "subscribedColumn")
ReverseStateFromNode(row.value);
}
}
}
function Refresh()
{
// clear out the textfield's entry on call of Refresh()
gNameField.value = "";
// force it to talk to the server
SetUpTree(true);
}
function InvalidateSearchTreeRow(row)
{
gSearchTreeBoxObject.invalidateRow(row);
}
function InvalidateSearchTree()
{
gSearchTreeBoxObject.invalidate();
}
function SwitchToNormalView()
{
// the first card in the deck is the "normal" view
gSubscribeDeck.setAttribute("selectedIndex","0");
}
function SwitchToSearchView()
{
// the second card in the deck is the "search" view
gSubscribeDeck.setAttribute("selectedIndex","1");
}
function Search()
{
var searchValue = gNameField.value;
if (searchValue.length && gSubscribableServer.supportsSubscribeSearch) {
SwitchToSearchView();
gSubscribableServer.setSearchValue(searchValue);
if (!gSearchView && gSubscribableServer) {
gSearchView = gSubscribableServer.QueryInterface(Components.interfaces.nsITreeView);
gSearchView.selection = null;
gSearchTreeBoxObject.view = gSearchView;
}
}
else {
SwitchToNormalView();
}
}
function CleanUpSearchView()
{
if (gSearchView) {
gSearchView.selection = null;
gSearchView = null;
}
}
function onSearchTreeKeyPress(event)
{
// for now, only do something on space key
if (event.charCode != KeyEvent.DOM_VK_SPACE)
return;
var treeSelection = gSearchView.selection;
for (var i=0;i<treeSelection.getRangeCount();i++) {
var start = {}, end = {};
treeSelection.getRangeAt(i,start,end);
for (var k=start.value;k<=end.value;k++)
ReverseStateFromRow(k);
// force a repaint
InvalidateSearchTree();
}
}
function onSubscribeTreeKeyPress(event)
{
// for now, only do something on space key
if (event.charCode != KeyEvent.DOM_VK_SPACE)
return;
var treeSelection = gSubscribeTree.view.selection;
for (var i=0;i<treeSelection.getRangeCount();i++) {
var start = {}, end = {};
treeSelection.getRangeAt(i,start,end);
for (var k=start.value;k<=end.value;k++)
ReverseStateFromNode(k);
}
}
function doHelpButton()
{
openHelp("mail-subscribe");
}

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

@ -1,294 +0,0 @@
/* -*- Mode: C++; 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.
*
* Contributor(s):
* Jan Varga (varga@utcru.sk)
* Håkan Waara (hwaara@chello.se)
*/
/*
* widget-specific wrapper glue. There should be one function for every
* widget/menu item, which gets some context (like the current selection)
* and then calls a function/command in commandglue
*/
//The eventual goal is for this file to go away and its contents to be brought into
//mailWindowOverlay.js. This is currently being done.
//NOTE: gMessengerBundle must be defined and set or this Overlay won't work
function ConvertDOMListToResourceArray(nodeList)
{
var result = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray);
for (var i=0; i<nodeList.length; i++) {
result.AppendElement(nodeList[i].resource);
}
return result;
}
function GetSelectedFolderURI()
{
var folderTree = GetFolderTree();
var selection = folderTree.treeBoxObject.selection;
if (selection.count == 1)
{
var startIndex = {};
var endIndex = {};
selection.getRangeAt(0, startIndex, endIndex);
var folderResource = GetFolderResource(folderTree, startIndex.value);
return folderResource.Value;
}
return null;
}
function MsgRenameFolder()
{
var preselectedURI = GetSelectedFolderURI();
var folderTree = GetFolderTree();
var name = GetFolderNameFromUri(preselectedURI, folderTree);
dump("preselectedURI = " + preselectedURI + "\n");
var dialog = window.openDialog(
"chrome://messenger/content/renameFolderDialog.xul",
"newFolder",
"chrome,titlebar,modal",
{preselectedURI: preselectedURI,
okCallback: RenameFolder, name: name});
}
function RenameFolder(name,uri)
{
dump("uri,name = " + uri + "," + name + "\n");
var folderTree = GetFolderTree();
if (folderTree)
{
if (uri && (uri != "") && name && (name != ""))
{
var selectedFolder = GetResourceFromUri(uri);
if (gDBView)
gCurrentlyDisplayedMessage = gDBView.currentlyDisplayedMessage;
ClearThreadPane();
ClearMessagePane();
folderTree.treeBoxObject.selection.clearSelection();
try
{
messenger.RenameFolder(GetFolderDatasource(), selectedFolder, name);
}
catch(e)
{
SelectFolder(selectedFolder.URI); //restore selection
throw(e); // so that the dialog does not automatically close
dump ("Exception : RenameFolder \n");
}
}
else
{
dump("no name or nothing selected\n");
}
}
else
{
dump("no folder tree\n");
}
}
function MsgEmptyTrash()
{
var folderTree = GetFolderTree();
var startIndex = {};
var endIndex = {};
folderTree.treeBoxObject.selection.getRangeAt(0, startIndex, endIndex);
if (startIndex.value >= 0)
{
var folderResource = GetFolderResource(folderTree, startIndex.value);
try {
messenger.EmptyTrash(GetFolderDatasource(), folderResource);
}
catch(e)
{
dump ("Exception : messenger.EmptyTrash \n");
}
}
}
function MsgCompactFolder(isAll)
{
// Get the selected folders.
var selectedFolders = GetSelectedMsgFolders();
if (selectedFolders.length == 1)
{
var selectedFolder = selectedFolders[0];
var resource = selectedFolder.QueryInterface(Components.interfaces.nsIRDFResource);
if (selectedFolder.server.type != "imap") //can be local only
{
var msgfolder = resource.QueryInterface(Components.interfaces.nsIMsgFolder);
var expungedBytes = msgfolder.expungedBytes;
if (expungedBytes > 0)
{
if (gDBView)
{
gCurrentlyDisplayedMessage = gDBView.currentlyDisplayedMessage;
}
ClearThreadPaneSelection();
ClearThreadPane();
ClearMessagePane();
}
else
{
if (!isAll) //you have one local folder with no room to compact
return;
}
}
try
{
messenger.CompactFolder(GetFolderDatasource(), resource, isAll);
}
catch(ex)
{
dump("Exception : messenger.CompactFolder : " + ex + "\n");
}
}
}
function MsgFolderProperties()
{
var preselectedURI = GetSelectedFolderURI();
var serverType = GetMsgFolderFromUri(preselectedURI, true).server.type;
var folderTree = GetFolderTree();
var name = GetFolderNameFromUri(preselectedURI, folderTree);
var windowTitle = gMessengerBundle.getString("folderProperties");
var dialog = window.openDialog(
"chrome://messenger/content/folderProps.xul",
"",
"chrome,centerscreen,titlebar,modal",
{preselectedURI:preselectedURI, serverType:serverType,
msgWindow:msgWindow, title:windowTitle,
okCallback:FolderProperties,
tabID:"", tabIndex:0, name:name});
}
function FolderProperties(name, uri)
{
}
function MsgToggleMessagePane()
{
//OnClickThreadAndMessagePaneSplitter is based on the value before the splitter is toggled.
OnClickThreadAndMessagePaneSplitterGrippy();
MsgToggleSplitter("threadpane-splitter");
}
function MsgToggleSplitter(id)
{
var splitter = document.getElementById(id);
var state = splitter.getAttribute("state");
if (state == "collapsed")
splitter.setAttribute("state", null);
else
splitter.setAttribute("state", "collapsed")
}
function NotifyQuitApplication()
{
var ObserverService = Components.classes["@mozilla.org/observer-service;1"].getService();
ObserverService = ObserverService.QueryInterface(Components.interfaces.nsIObserverService);
if (ObserverService)
{
try
{
ObserverService.notifyObservers(null, "quit-application", null);
}
catch (ex)
{
// dump("no observer found \n");
}
}
}
function LastToClose()
{
var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService();
var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator);
var enumerator = windowManagerInterface.getEnumerator( null );
var count = 0;
while ( enumerator.hasMoreElements() && count < 2 )
{
var windowToClose = enumerator.getNext();
count++;
}
if (count == 1)
return true;
else
return false;
}
function MsgSetFolderCharset()
{
MsgFolderProperties()
}
// Given a URI we would like to return corresponding message folder here.
// An additonal input param which specifies whether or not to check folder
// attributes (like if there exists a parent or is it a server) is also passed
// to this routine. Qualifying against those checks would return an existing
// folder. Callers who don't want to check those attributes will specify the
// same and then this routine will simply return a msgfolder. This scenario
// applies to a new imap account creation where special folders are created
// on demand and hence needs to prior check of existence.
function GetMsgFolderFromUri(uri, checkFolderAttributes)
{
//dump("GetMsgFolderFromUri of " + uri + "\n");
var msgfolder = null;
try {
var resource = GetResourceFromUri(uri);
msgfolder = resource.QueryInterface(Components.interfaces.nsIMsgFolder);
if (checkFolderAttributes) {
if (!(msgfolder && (msgfolder.parent || msgfolder.isServer))) {
msgfolder = null;
}
}
}
catch (ex) {
//dump("failed to get the folder resource\n");
}
return msgfolder;
}
function GetResourceFromUri(uri)
{
var RDF = Components.classes['@mozilla.org/rdf/rdf-service;1'].getService();
RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService);
var resource = RDF.GetResource(uri);
return resource;
}