Files
Mozilla/mozilla/mailnews/compose/resources/content/askSendFormat.js
ducarroz%netscape.com 47f700dad9 Fix for PDT+ 28451. We need to preset return value in case user close dialog using the close box. R=hangas, A=phil
git-svn-id: svn://10.0.0.236/trunk@61446 18797224-902f-48f8-a5cc-f745e15eee43
2000-02-22 22:35:26 +00:00

76 lines
2.1 KiB
JavaScript

var msgCompSendFormat = Components.interfaces.nsIMsgCompSendFormat;
var param = null;
function Startup()
{
/* dump("Startup()\n"); */
if (window.arguments && window.arguments[0] && window.arguments[0])
{
param = window.arguments[0];
param.abort = true; //if the user hit the close box, we will abort.
if (param.action)
{
//Set the default radio array value
var element = document.getElementById("SendPlainTextAndHtml");
element.checked = true;
//change the button label
labels = document.getElementById("okCancelButtons");
element = document.getElementById("ok");
element.setAttribute("value", labels.getAttribute("button1Label"));
element = document.getElementById("cancel");
element.setAttribute("value", labels.getAttribute("button2Label"));
element = document.getElementById("Button2");
element.setAttribute("value", labels.getAttribute("button3Label"));
element.setAttribute("style", "display:inline");
element.setAttribute("disabled", "true");
element = document.getElementById("Button3");
element.setAttribute("value", labels.getAttribute("button4Label"));
element.setAttribute("style", "display:inline");
element.setAttribute("disabled", "true");
//set buttons action
doSetOKCancel(Send, DontSend, Recipients, Help);
moveToAlertPosition();
}
}
else
{
dump("error, no return object registered\n");
}
}
function Send()
{
if (param)
{
if (document.getElementById("SendPlainTextAndHtml").checked)
param.action = msgCompSendFormat.Both;
else if (document.getElementById("SendPlainTextOnly").checked)
param.action = msgCompSendFormat.PlainText;
else if (document.getElementById("SendHtmlOnly").checked)
param.action = msgCompSendFormat.HTML;
param.abort = false;
}
return true;
}
function DontSend()
{
if (param)
param.abort = true;
return true;
}
function Recipients()
{
return false;
}
function Help()
{
return false;
}