2001-09-28 20:14:13 +00:00
|
|
|
/* -*- 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
|
2000-06-16 07:43:42 +00:00
|
|
|
*
|
2001-09-28 20:14:13 +00:00
|
|
|
* 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/
|
2000-06-16 07:43:42 +00:00
|
|
|
*
|
2001-09-28 20:14:13 +00:00
|
|
|
* 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.
|
2000-06-16 07:43:42 +00:00
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2001-09-28 20:14:13 +00:00
|
|
|
* 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.
|
2000-06-16 07:43:42 +00:00
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Alec Flett <alecf@netscape.com>
|
2001-09-28 20:14:13 +00:00
|
|
|
*
|
|
|
|
* 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 ***** */
|
2000-06-16 07:43:42 +00:00
|
|
|
|
2001-02-22 23:32:13 +00:00
|
|
|
var gMessengerBundle;
|
2000-06-16 07:43:42 +00:00
|
|
|
|
fix for #17402, stationary -> stationery.
r=alecf
major fixes for the new folder / rename folder / subscribe dialogs.
we no longer use an html select for the folder picker.
now we use cascading menu popups, like the copy and move menus.
this fixes a lot of bugs, and allows pre-flighting to finally work.
our folder data source has some new properies:
CanFileMessages, CanSubscribe, CanRename, and CanCreateSubfolders
we use these to determine what cascading menu to build, what to disable, etc.
also, nsMessenger::NewFolder() and nsMessenger::RenameFolder() were changes to
take a nsIRDFResource instead of a nsIDOMXULElement. Before we were
passing through to the back end the selected xul element, now we pass
the resource in.
other cool side effects:
in the copy & move menus, you don't get the choice to file or copy to a server, on folders
in the rename dialog, you can't pick a server, on a folder
in the new folder dialog, you can't pick the imap inbox. (* more needs to be done here.)
bugs fixed: #14773, #14254, #20599, #20646
r=alecf
a couple bullet proofing fixes to prevent some crashes reported on fullcircle
r=bienvenu
1999-12-03 08:10:09 +00:00
|
|
|
// 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) {
|
1999-12-04 18:29:05 +00:00
|
|
|
//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
|
2001-12-10 07:44:03 +00:00
|
|
|
var msgfolder = GetMsgFolderFromUri(uri, true);
|
1999-12-04 18:29:05 +00:00
|
|
|
if (!msgfolder) return;
|
|
|
|
|
|
|
|
var verifyFunction = null;
|
|
|
|
|
1999-12-24 09:18:36 +00:00
|
|
|
switch (pickerID) {
|
|
|
|
case "msgNewFolderPicker":
|
|
|
|
verifyFunction = msgfolder.canCreateSubfolders;
|
|
|
|
break;
|
|
|
|
case "msgRenameFolderPicker":
|
|
|
|
verifyFunction = msgfolder.canRename;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
verifyFunction = msgfolder.canFileMessages;
|
|
|
|
break;
|
1999-12-04 18:29:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (verifyFunction) {
|
|
|
|
SetFolderPicker(uri,pickerID);
|
|
|
|
}
|
fix for #17402, stationary -> stationery.
r=alecf
major fixes for the new folder / rename folder / subscribe dialogs.
we no longer use an html select for the folder picker.
now we use cascading menu popups, like the copy and move menus.
this fixes a lot of bugs, and allows pre-flighting to finally work.
our folder data source has some new properies:
CanFileMessages, CanSubscribe, CanRename, and CanCreateSubfolders
we use these to determine what cascading menu to build, what to disable, etc.
also, nsMessenger::NewFolder() and nsMessenger::RenameFolder() were changes to
take a nsIRDFResource instead of a nsIDOMXULElement. Before we were
passing through to the back end the selected xul element, now we pass
the resource in.
other cool side effects:
in the copy & move menus, you don't get the choice to file or copy to a server, on folders
in the rename dialog, you can't pick a server, on a folder
in the new folder dialog, you can't pick the imap inbox. (* more needs to be done here.)
bugs fixed: #14773, #14254, #20599, #20646
r=alecf
a couple bullet proofing fixes to prevent some crashes reported on fullcircle
r=bienvenu
1999-12-03 08:10:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function PickedMsgFolder(selection,pickerID)
|
|
|
|
{
|
|
|
|
var selectedUri = selection.getAttribute('id');
|
1999-12-04 18:29:05 +00:00
|
|
|
SetFolderPicker(selectedUri,pickerID);
|
fix for #17402, stationary -> stationery.
r=alecf
major fixes for the new folder / rename folder / subscribe dialogs.
we no longer use an html select for the folder picker.
now we use cascading menu popups, like the copy and move menus.
this fixes a lot of bugs, and allows pre-flighting to finally work.
our folder data source has some new properies:
CanFileMessages, CanSubscribe, CanRename, and CanCreateSubfolders
we use these to determine what cascading menu to build, what to disable, etc.
also, nsMessenger::NewFolder() and nsMessenger::RenameFolder() were changes to
take a nsIRDFResource instead of a nsIDOMXULElement. Before we were
passing through to the back end the selected xul element, now we pass
the resource in.
other cool side effects:
in the copy & move menus, you don't get the choice to file or copy to a server, on folders
in the rename dialog, you can't pick a server, on a folder
in the new folder dialog, you can't pick the imap inbox. (* more needs to be done here.)
bugs fixed: #14773, #14254, #20599, #20646
r=alecf
a couple bullet proofing fixes to prevent some crashes reported on fullcircle
r=bienvenu
1999-12-03 08:10:09 +00:00
|
|
|
}
|
|
|
|
|
1999-12-04 18:29:05 +00:00
|
|
|
function SetFolderPicker(uri,pickerID)
|
fix for #17402, stationary -> stationery.
r=alecf
major fixes for the new folder / rename folder / subscribe dialogs.
we no longer use an html select for the folder picker.
now we use cascading menu popups, like the copy and move menus.
this fixes a lot of bugs, and allows pre-flighting to finally work.
our folder data source has some new properies:
CanFileMessages, CanSubscribe, CanRename, and CanCreateSubfolders
we use these to determine what cascading menu to build, what to disable, etc.
also, nsMessenger::NewFolder() and nsMessenger::RenameFolder() were changes to
take a nsIRDFResource instead of a nsIDOMXULElement. Before we were
passing through to the back end the selected xul element, now we pass
the resource in.
other cool side effects:
in the copy & move menus, you don't get the choice to file or copy to a server, on folders
in the rename dialog, you can't pick a server, on a folder
in the new folder dialog, you can't pick the imap inbox. (* more needs to be done here.)
bugs fixed: #14773, #14254, #20599, #20646
r=alecf
a couple bullet proofing fixes to prevent some crashes reported on fullcircle
r=bienvenu
1999-12-03 08:10:09 +00:00
|
|
|
{
|
2001-02-22 23:32:13 +00:00
|
|
|
if (!gMessengerBundle)
|
|
|
|
gMessengerBundle = document.getElementById("bundle_messenger");
|
|
|
|
|
fix for #17402, stationary -> stationery.
r=alecf
major fixes for the new folder / rename folder / subscribe dialogs.
we no longer use an html select for the folder picker.
now we use cascading menu popups, like the copy and move menus.
this fixes a lot of bugs, and allows pre-flighting to finally work.
our folder data source has some new properies:
CanFileMessages, CanSubscribe, CanRename, and CanCreateSubfolders
we use these to determine what cascading menu to build, what to disable, etc.
also, nsMessenger::NewFolder() and nsMessenger::RenameFolder() were changes to
take a nsIRDFResource instead of a nsIDOMXULElement. Before we were
passing through to the back end the selected xul element, now we pass
the resource in.
other cool side effects:
in the copy & move menus, you don't get the choice to file or copy to a server, on folders
in the rename dialog, you can't pick a server, on a folder
in the new folder dialog, you can't pick the imap inbox. (* more needs to be done here.)
bugs fixed: #14773, #14254, #20599, #20646
r=alecf
a couple bullet proofing fixes to prevent some crashes reported on fullcircle
r=bienvenu
1999-12-03 08:10:09 +00:00
|
|
|
var picker = document.getElementById(pickerID);
|
2001-12-10 07:44:03 +00:00
|
|
|
var msgfolder = GetMsgFolderFromUri(uri, true);
|
fix for #17402, stationary -> stationery.
r=alecf
major fixes for the new folder / rename folder / subscribe dialogs.
we no longer use an html select for the folder picker.
now we use cascading menu popups, like the copy and move menus.
this fixes a lot of bugs, and allows pre-flighting to finally work.
our folder data source has some new properies:
CanFileMessages, CanSubscribe, CanRename, and CanCreateSubfolders
we use these to determine what cascading menu to build, what to disable, etc.
also, nsMessenger::NewFolder() and nsMessenger::RenameFolder() were changes to
take a nsIRDFResource instead of a nsIDOMXULElement. Before we were
passing through to the back end the selected xul element, now we pass
the resource in.
other cool side effects:
in the copy & move menus, you don't get the choice to file or copy to a server, on folders
in the rename dialog, you can't pick a server, on a folder
in the new folder dialog, you can't pick the imap inbox. (* more needs to be done here.)
bugs fixed: #14773, #14254, #20599, #20646
r=alecf
a couple bullet proofing fixes to prevent some crashes reported on fullcircle
r=bienvenu
1999-12-03 08:10:09 +00:00
|
|
|
|
1999-12-04 01:43:12 +00:00
|
|
|
if (!msgfolder) return;
|
|
|
|
|
fix for #17402, stationary -> stationery.
r=alecf
major fixes for the new folder / rename folder / subscribe dialogs.
we no longer use an html select for the folder picker.
now we use cascading menu popups, like the copy and move menus.
this fixes a lot of bugs, and allows pre-flighting to finally work.
our folder data source has some new properies:
CanFileMessages, CanSubscribe, CanRename, and CanCreateSubfolders
we use these to determine what cascading menu to build, what to disable, etc.
also, nsMessenger::NewFolder() and nsMessenger::RenameFolder() were changes to
take a nsIRDFResource instead of a nsIDOMXULElement. Before we were
passing through to the back end the selected xul element, now we pass
the resource in.
other cool side effects:
in the copy & move menus, you don't get the choice to file or copy to a server, on folders
in the rename dialog, you can't pick a server, on a folder
in the new folder dialog, you can't pick the imap inbox. (* more needs to be done here.)
bugs fixed: #14773, #14254, #20599, #20646
r=alecf
a couple bullet proofing fixes to prevent some crashes reported on fullcircle
r=bienvenu
1999-12-03 08:10:09 +00:00
|
|
|
var selectedValue = null;
|
2000-12-16 00:42:48 +00:00
|
|
|
var serverName;
|
fix for #17402, stationary -> stationery.
r=alecf
major fixes for the new folder / rename folder / subscribe dialogs.
we no longer use an html select for the folder picker.
now we use cascading menu popups, like the copy and move menus.
this fixes a lot of bugs, and allows pre-flighting to finally work.
our folder data source has some new properies:
CanFileMessages, CanSubscribe, CanRename, and CanCreateSubfolders
we use these to determine what cascading menu to build, what to disable, etc.
also, nsMessenger::NewFolder() and nsMessenger::RenameFolder() were changes to
take a nsIRDFResource instead of a nsIDOMXULElement. Before we were
passing through to the back end the selected xul element, now we pass
the resource in.
other cool side effects:
in the copy & move menus, you don't get the choice to file or copy to a server, on folders
in the rename dialog, you can't pick a server, on a folder
in the new folder dialog, you can't pick the imap inbox. (* more needs to be done here.)
bugs fixed: #14773, #14254, #20599, #20646
r=alecf
a couple bullet proofing fixes to prevent some crashes reported on fullcircle
r=bienvenu
1999-12-03 08:10:09 +00:00
|
|
|
|
|
|
|
if (msgfolder.isServer)
|
|
|
|
selectedValue = msgfolder.name;
|
2000-01-04 05:20:35 +00:00
|
|
|
else {
|
2000-06-16 07:43:42 +00:00
|
|
|
if (msgfolder.server)
|
2000-12-16 00:42:48 +00:00
|
|
|
serverName = msgfolder.server.prettyName;
|
|
|
|
else {
|
|
|
|
dump("Cant' find server for " + uri + "\n");
|
|
|
|
serverName = "???";
|
|
|
|
}
|
2000-06-16 07:43:42 +00:00
|
|
|
|
2001-04-11 05:36:01 +00:00
|
|
|
selectedValue = gMessengerBundle.getFormattedString("verboseFolderFormat",
|
|
|
|
[msgfolder.name,
|
|
|
|
serverName]);
|
2000-01-04 05:20:35 +00:00
|
|
|
}
|
fix for #17402, stationary -> stationery.
r=alecf
major fixes for the new folder / rename folder / subscribe dialogs.
we no longer use an html select for the folder picker.
now we use cascading menu popups, like the copy and move menus.
this fixes a lot of bugs, and allows pre-flighting to finally work.
our folder data source has some new properies:
CanFileMessages, CanSubscribe, CanRename, and CanCreateSubfolders
we use these to determine what cascading menu to build, what to disable, etc.
also, nsMessenger::NewFolder() and nsMessenger::RenameFolder() were changes to
take a nsIRDFResource instead of a nsIDOMXULElement. Before we were
passing through to the back end the selected xul element, now we pass
the resource in.
other cool side effects:
in the copy & move menus, you don't get the choice to file or copy to a server, on folders
in the rename dialog, you can't pick a server, on a folder
in the new folder dialog, you can't pick the imap inbox. (* more needs to be done here.)
bugs fixed: #14773, #14254, #20599, #20646
r=alecf
a couple bullet proofing fixes to prevent some crashes reported on fullcircle
r=bienvenu
1999-12-03 08:10:09 +00:00
|
|
|
|
2001-03-30 02:06:46 +00:00
|
|
|
picker.setAttribute("label",selectedValue);
|
fix for #17402, stationary -> stationery.
r=alecf
major fixes for the new folder / rename folder / subscribe dialogs.
we no longer use an html select for the folder picker.
now we use cascading menu popups, like the copy and move menus.
this fixes a lot of bugs, and allows pre-flighting to finally work.
our folder data source has some new properies:
CanFileMessages, CanSubscribe, CanRename, and CanCreateSubfolders
we use these to determine what cascading menu to build, what to disable, etc.
also, nsMessenger::NewFolder() and nsMessenger::RenameFolder() were changes to
take a nsIRDFResource instead of a nsIDOMXULElement. Before we were
passing through to the back end the selected xul element, now we pass
the resource in.
other cool side effects:
in the copy & move menus, you don't get the choice to file or copy to a server, on folders
in the rename dialog, you can't pick a server, on a folder
in the new folder dialog, you can't pick the imap inbox. (* more needs to be done here.)
bugs fixed: #14773, #14254, #20599, #20646
r=alecf
a couple bullet proofing fixes to prevent some crashes reported on fullcircle
r=bienvenu
1999-12-03 08:10:09 +00:00
|
|
|
picker.setAttribute("uri",uri);
|
|
|
|
}
|