F
fAnSKyer
I want to use a program in C# or whatever language to controll the
following JS html.
What the following code did is
document.write ('<input type="button"
value="'+langString(strSEND)+
'" onClick="SendClosedCaptionText
(document.myForm.message1)">')
document.write ('</input>')
send caption via a function which uses the JAR
I am a newbie for JS, and really have no idea what should i do.
Can somebody give me idea or give me some examples? Thanks a lot
<html>
<head>
<!--#include file="a_common.ssi" -->
<script>ClearLastSubmitedData();</script>
<script language="JavaScript" src="apicmd.js"></script>
</head>
<script>
var nextPage = null;
var backPage = null;
var form = "myForm";
var group = null;
var action = "";
var g_lastIndexSent = 0;
var historyIndex = 0;
var kHistorySize = 10;
var history = new Array ()
function ShowHistory (newValue)
{
var index
var historyString = ""
history [historyIndex] = newValue
// For each array element that exists append it to the string
for (index = historyIndex; history[index]; index--)
{
historyString = history[index] + "<br>" + historyString
}
document.getElementById ("history").innerHTML = historyString
// Remove the last element if there are more than kHistorySize
historyIndex++
if (historyIndex >= kHistorySize)
{
history [historyIndex - kHistorySize] = null
}
}
function SendClosedCaptionText (object)
{
if (object.value != "")
{
if (ExtendedAsciiOnly (object))
{
APICMD ("screen near")
eval(document.ClosedCaptionApplet.writeClosedCaption(object.value))
ShowHistory (object.value)
object.value = ""
}
}
object.focus ()
}
var kReturnEvent = 13
function OnKeyCode (evt, object)
{
var keyCode = evt.which ? evt.which : evt.keyCode;
// If the user hits the enter key send the text
switch (keyCode)
{
case kReturnEvent:
SendClosedCaptionText (object)
break
}
//return !(window.event && window.event.keyCode == 13);
return !(window.event && keyCode == kReturnEvent);
}
AddBodyStart (langString(strCLOSEDCAP), form, group, action)
</script>
<tr>
<td align="center">
<table cellpadding="0" cellspacing="0">
<tr><td class="ccHistory" id="history"></td></tr>
<tr>
<td align="center">
<input type="text" name="message1" maxlength="127"
size="100"
onKeyDown="return OnKeyCode(event, this)">
</input>
<applet codebase="." archive="closedcaption.jar"
name="ClosedCaptionApplet"
code="polycom.closedcaption.ClosedCaptionApplet.class"
height=0 width=0 mayscript>
</applet>
</td>
</tr>
<tr>
<td align="center">
<script>
document.write ('<input type="button"
value="'+langString(strSEND)+
'" onClick="SendClosedCaptionText
(document.myForm.message1)">')
document.write ('</input>')
</script>
</td>
</tr>
</table>
</td>
</tr>
<iframe src="testframe.htm" name="hideme" height="0px"
width="0px" marginwidth="0px" scrolling="no" frameborder="no"></
iframe>
<script>
AddDataTableScreenAndBodyEnd (backPage, nextPage, false, false);
</script>
</html>
following JS html.
What the following code did is
document.write ('<input type="button"
value="'+langString(strSEND)+
'" onClick="SendClosedCaptionText
(document.myForm.message1)">')
document.write ('</input>')
send caption via a function which uses the JAR
I am a newbie for JS, and really have no idea what should i do.
Can somebody give me idea or give me some examples? Thanks a lot
<html>
<head>
<!--#include file="a_common.ssi" -->
<script>ClearLastSubmitedData();</script>
<script language="JavaScript" src="apicmd.js"></script>
</head>
<script>
var nextPage = null;
var backPage = null;
var form = "myForm";
var group = null;
var action = "";
var g_lastIndexSent = 0;
var historyIndex = 0;
var kHistorySize = 10;
var history = new Array ()
function ShowHistory (newValue)
{
var index
var historyString = ""
history [historyIndex] = newValue
// For each array element that exists append it to the string
for (index = historyIndex; history[index]; index--)
{
historyString = history[index] + "<br>" + historyString
}
document.getElementById ("history").innerHTML = historyString
// Remove the last element if there are more than kHistorySize
historyIndex++
if (historyIndex >= kHistorySize)
{
history [historyIndex - kHistorySize] = null
}
}
function SendClosedCaptionText (object)
{
if (object.value != "")
{
if (ExtendedAsciiOnly (object))
{
APICMD ("screen near")
eval(document.ClosedCaptionApplet.writeClosedCaption(object.value))
ShowHistory (object.value)
object.value = ""
}
}
object.focus ()
}
var kReturnEvent = 13
function OnKeyCode (evt, object)
{
var keyCode = evt.which ? evt.which : evt.keyCode;
// If the user hits the enter key send the text
switch (keyCode)
{
case kReturnEvent:
SendClosedCaptionText (object)
break
}
//return !(window.event && window.event.keyCode == 13);
return !(window.event && keyCode == kReturnEvent);
}
AddBodyStart (langString(strCLOSEDCAP), form, group, action)
</script>
<tr>
<td align="center">
<table cellpadding="0" cellspacing="0">
<tr><td class="ccHistory" id="history"></td></tr>
<tr>
<td align="center">
<input type="text" name="message1" maxlength="127"
size="100"
onKeyDown="return OnKeyCode(event, this)">
</input>
<applet codebase="." archive="closedcaption.jar"
name="ClosedCaptionApplet"
code="polycom.closedcaption.ClosedCaptionApplet.class"
height=0 width=0 mayscript>
</applet>
</td>
</tr>
<tr>
<td align="center">
<script>
document.write ('<input type="button"
value="'+langString(strSEND)+
'" onClick="SendClosedCaptionText
(document.myForm.message1)">')
document.write ('</input>')
</script>
</td>
</tr>
</table>
</td>
</tr>
<iframe src="testframe.htm" name="hideme" height="0px"
width="0px" marginwidth="0px" scrolling="no" frameborder="no"></
iframe>
<script>
AddDataTableScreenAndBodyEnd (backPage, nextPage, false, false);
</script>
</html>