revert my accidental changes to this file over the weekend.

This commit is contained in:
ben%netscape.com 2000-09-06 02:21:59 +00:00
Родитель e7e0471036
Коммит 0dd21b8b28
1 изменённых файлов: 101 добавлений и 16 удалений

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

@ -1,47 +1,132 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
var msgCompSendFormat = Components.interfaces.nsIMsgCompSendFormat; var msgCompSendFormat = Components.interfaces.nsIMsgCompSendFormat;
var msgCompConvertible = Components.interfaces.nsIMsgCompConvertible;
var changeDefault = false; /* Set default selection following
the recommendation. Some people think, the
default should *always* be the same. */
var param = null; var param = null;
function Startup() function Startup()
{ {
if (window.arguments && window.arguments[0] && window.arguments[0]) if (window.arguments && window.arguments[0])
{ {
var defaultElement = document.getElementById("SendPlainTextOnly");
// used only if changeDefault == false
// maybe make that a (default) pref
param = window.arguments[0]; param = window.arguments[0];
param.abort = true; //if the user hit the close box, we will abort. param.abort = true; //if the user hit the close box, we will abort.
if (param.action) if (param.action)
{ {
//Set the default radio array value // Set the question label
var group = document.getElementById("mailDefaultHTMLAction"); var labeldeck = document.getElementById("mailSendFormatExplanation");
var element = document.getElementById("SendPlainTextAndHtml"); var icon = document.getElementById("convertDefault");
group.selectedItem= element; switch (param.convertible)
group.data = element.data; {
case msgCompConvertible.Plain:
// We shouldn't be here at all
labeldeck.setAttribute("index", 1);
// No icon
break;
case msgCompConvertible.Yes:
labeldeck.setAttribute("index", 1);
icon.setAttribute("id", "convertYes");
break;
case msgCompConvertible.Altering:
labeldeck.setAttribute("index", 2);
icon.setAttribute("id", "convertAltering");
break;
case msgCompConvertible.No:
labeldeck.setAttribute("index", 3);
icon.setAttribute("id", "convertNo");
break;
}
// Set the default radio array value and recommendation
var group = document.getElementById("mailDefaultHTMLAction");
var element;
var recommlabels = document.getElementById("hiddenLabels");
var label;
var setrecomm = false;
switch (param.action)
{
case msgCompSendFormat.AskUser:
//setrecomm = false;
break;
case msgCompSendFormat.PlainText:
element = document.getElementById("SendPlainTextOnly");
//label = recommlabels.getAttribute("plainTextOnlyRecommendedLabel");
label = document.getElementById("plainTextOnlyRecommended");
// elements for "recommended" are a workaround for bug 49623
setrecomm = true;
break;
case msgCompSendFormat.Both:
element = document.getElementById("SendPlainTextAndHtml");
//label = recommlabels.getAttribute("plainTextAndHtmlRecommendedLabel");
label = document.getElementById("plainTextAndHtmlRecommended");
setrecomm = true;
break;
case msgCompSendFormat.HTML:
element = document.getElementById("SendHtmlOnly");
//label = recommlabels.getAttribute("htmlOnlyRecommendedLabel");
label = document.getElementById("htmlOnlyRecommended");
setrecomm = true;
break;
}
if (setrecomm)
{
/*
dump(element.getAttribute("value"));
element.setAttribute("value", label);
element.setAttribute("value", "foo");
dump(element.getAttribute("value"));
*/
label.removeAttribute("hidden");
if (changeDefault)
{
group.selectedItem = element;
group.data = element.data;
}
}
if (!changeDefault)
{
group.selectedItem = defaultElement;
group.data = defaultElement.data;
}
//change the button label //change the button label
labels = document.getElementById("okCancelButtons"); var buttonlabels = document.getElementById("okCancelButtons");
element = document.getElementById("ok"); element = document.getElementById("ok");
element.setAttribute("value", labels.getAttribute("button1Label")); element.setAttribute("value", buttonlabels.getAttribute("button1Label"));
element = document.getElementById("cancel"); element = document.getElementById("cancel");
element.setAttribute("value", labels.getAttribute("button2Label")); element.setAttribute("value", buttonlabels.getAttribute("button2Label"));
/* /*
element = document.getElementById("Button2"); element = document.getElementById("Button2");
element.setAttribute("value", labels.getAttribute("button3Label")); element.setAttribute("value", buttonlabels.getAttribute("button3Label"));
element.removeAttribute("hidden"); element.removeAttribute("hidden");
element.setAttribute("disabled", "true"); element.setAttribute("disabled", "true");
element = document.getElementById("Button3"); element = document.getElementById("Button3");
element.setAttribute("value", labels.getAttribute("button4Label")); element.setAttribute("value", buttonlabels.getAttribute("button4Label"));
element.removeAttribute("hidden"); element.removeAttribute("hidden");
element.setAttribute("disabled", "true"); element.setAttribute("disabled", "true");
*/ */
//set buttons action //set buttons action
doSetOKCancel(Send, DontSend, Recipients, Help); doSetOKCancel(Send, Cancel, Recipients, Help);
/* XXX Don't deliberately move windos around, compare bug 28260. Also, for any reason, the window will finally sit outside the visible screen for me. /BenB
//At this point, we cannot position the window because it still doesn't have a width and a height.
//Let move it out of the screen and then move it back at the right position, this after the first refresh.
window.moveTo(32000, 32000);
setTimeout("moveToAlertPosition();", 0);
*/
// moveToAlertPosition();
moveToAlertPosition();
} }
} }
else else
{ {
dump("error, no return object registered\n"); dump("error, no return object registered\n");
} }
} }
function Send() function Send()
@ -59,7 +144,7 @@ function Send()
return true; return true;
} }
function DontSend() function Cancel()
{ {
if (param) if (param)
param.abort = true; param.abort = true;