gecko/embedding/browser/activex/tests/plugin/calendar_scripted.htm

81 lines
2.8 KiB
HTML

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<title>Mozilla Plugin Test Page</title>
<link rel="stylesheet" type="text/css" href="mozilla.css">
</head>
<body>
<p>This page is designed for Communicator 4.x, Netscape 7.x or
Mozilla 1.x with the Mozilla ActiveX plugin installed! You also need
to have the MS calendar control installed to see anything</p>
<p>
<!-- The object tag is used to add controls to the page. The width and height
parameters specify the control dimensions. The control is initialised
with parameters
of the form param_SomeControlProperty="value".
-->
<embed
name="cal"
TYPE="application/x-oleobject"
ALIGN="baseline" BORDER="0"
WIDTH="300" HEIGHT="300"
CLSID="{8E27C92B-1264-101C-8A2F-040224009C02}"
PARAM_BACKCOLOR="16776960"
>
</p>
<form action="#" method="post">
<input type="button" value="<< Last Month" onclick="prevMonth()"></input>
<input type="button" value="Next Month >>" onclick="nextMonth()"></input><br>
<input type="button" value="<< Last Day" onclick="prevDay()"></input>
<input type="button" value="Next Day >>" onclick="nextDay()"></input><br>
Change the current day: <input name="day_to_set" type="text" size="3" value="1"></input>
<input type="button" value="Set" onclick="setDay()"></input><br>
<input type="button" value="Refresh" onclick="getDay()"></input><br>
<input type="button" value="Sanity test" onclick="document.cal.x(1)"></input><br>
These tests should cause exceptions by calling with duff property names etc.</br>
<input type="button" value="Invoke (no such method)" onclick="document.cal.invoke('blah')"></input>
<input type="button" value="Invoke (bad args)" onclick="document.cal.invoke('nextMonth', 20, 200)"></input>
<input type="button" value="setProperty (no such method)" onclick="document.cal.setProperty('dayz', 20)"></input>
<input type="button" value="setProperty (bad args)" onclick="document.cal.setProperty('day', 'xxxx')"></input>
</form>
<p>
<script>
document.write("<p>Number of embeds in page = " + document.embeds.length + "</p>");
// document.write("<p>Plugin isActive = " + document.cal.isActive() + "</p>");
// document.write("<p>Plugin window =" + document.cal.getWindow() + "</p>");
function prevMonth()
{
document.cal.invoke("previousMonth");
}
function nextMonth()
{
document.cal.invoke("nextMonth");
}
function prevDay()
{
document.cal.invoke("previousDay");
}
function nextDay()
{
document.cal.invoke("nextDay");
}
function setDay()
{
document.cal.setProperty("day", document.forms[0].elements["day_to_set"].value);
}
function getDay()
{
document.forms[0].elements["day_to_set"].value = document.cal.getProperty("day");
}
</script>
</p>
</body>
</html>