mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-25 09:57:32 +09:00
Issue #1258 - Part 1: Import mailnews, ldap, and mork from comm-esr52.9.1
This commit is contained in:
parent
23e0d82436
commit
e400f4130a
1564 changed files with 510348 additions and 0 deletions
85
mailnews/base/content/newFolderDialog.js
Normal file
85
mailnews/base/content/newFolderDialog.js
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
var FOLDERS = 1;
|
||||
var MESSAGES = 2;
|
||||
var dialog;
|
||||
|
||||
function onLoad()
|
||||
{
|
||||
var windowArgs = window.arguments[0];
|
||||
|
||||
dialog = {};
|
||||
|
||||
dialog.nameField = document.getElementById("name");
|
||||
dialog.nameField.focus();
|
||||
|
||||
// call this when OK is pressed
|
||||
dialog.okCallback = windowArgs.okCallback;
|
||||
|
||||
// pre select the folderPicker, based on what they selected in the folder pane
|
||||
dialog.folder = windowArgs.folder;
|
||||
try {
|
||||
document.getElementById("MsgNewFolderPopup").selectFolder(windowArgs.folder);
|
||||
} catch(ex) {
|
||||
// selected a child folder
|
||||
document.getElementById("msgNewFolderPicker")
|
||||
.setAttribute("label", windowArgs.folder.prettyName);
|
||||
}
|
||||
|
||||
// can folders contain both folders and messages?
|
||||
if (windowArgs.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"));
|
||||
}
|
||||
|
||||
doEnabling();
|
||||
}
|
||||
|
||||
function onFolderSelect(event) {
|
||||
dialog.folder = event.target._folder;
|
||||
document.getElementById("msgNewFolderPicker")
|
||||
.setAttribute("label", dialog.folder.prettyName);
|
||||
}
|
||||
|
||||
function onOK()
|
||||
{
|
||||
var name = dialog.nameField.value;
|
||||
var uri = dialog.folder;
|
||||
|
||||
// do name validity check?
|
||||
|
||||
// make sure name ends in "/" if folder to create can only contain folders
|
||||
if ((dialog.folderType == FOLDERS) && !name.endsWith("/"))
|
||||
dialog.okCallback(name + "/", dialog.folder);
|
||||
else
|
||||
dialog.okCallback(name, dialog.folder);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function onFoldersOnly()
|
||||
{
|
||||
dialog.folderType = FOLDERS;
|
||||
}
|
||||
|
||||
function onMessagesOnly()
|
||||
{
|
||||
dialog.folderType = MESSAGES;
|
||||
}
|
||||
|
||||
function doEnabling()
|
||||
{
|
||||
document.documentElement.getButton("accept").disabled = !dialog.nameField.value;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue