You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
476 lines
12 KiB
476 lines
12 KiB
<HTML>
|
|
<HEAD>
|
|
#include "header.inc"
|
|
#include "debug_js.inc"
|
|
#include "common.inc"
|
|
#include "constants.inc"
|
|
#define MAC_IF_DIRECTLAUNCH if(null==parent.idFrameSet0)
|
|
|
|
<TITLE>Remote Assistance</TITLE>
|
|
<meta http-equiv="MSThemeCompatible" content="Yes">
|
|
<LINK id="UI_StyleSheet" REL="stylesheet" TYPE="text/css" HREF="../../Css/rc.css">
|
|
<LINK id="UI_StyleSheet1" REL="stylesheet" TYPE="text/css" HREF="../../Css/RAChat.css">
|
|
<LINK ID=Stylesheet_Ref4 href="hcp://system/css/shared.css" rel=STYLESHEET type=text/css>
|
|
|
|
<script id="LocalScripts" name="LocalScripts" LANGUAGE="Javascript">
|
|
|
|
//
|
|
// Localizable constants, values
|
|
//
|
|
var L_SAYS_Text = " says: \n";
|
|
|
|
//
|
|
// Security check
|
|
//
|
|
function DoLoad()
|
|
{
|
|
var L_ERRACCESSDENIED_Text = "Directly launching this page is not allowed. ";
|
|
|
|
MAC_IF_DIRECTLAUNCH
|
|
{
|
|
idBody.style.visibility = "hidden";
|
|
alert( L_ERRACCESSDENIED_Text );
|
|
return;
|
|
}
|
|
|
|
}
|
|
|
|
function InitChatServer()
|
|
{
|
|
try
|
|
{
|
|
InitTrace();
|
|
TraceFunctEnter("InitChatServer");
|
|
|
|
//
|
|
// enable chat controls on the screen
|
|
//
|
|
idIncomingChatText.disabled=false;
|
|
idchatText.disabled=false;
|
|
|
|
var oNewText = document.createElement("Span");
|
|
|
|
|
|
oNewText.innerHTML = parent.CreateChatGreeting( parent.g_szLocalUser, parent.parent.gHelper );
|
|
idIncomingChatText.appendChild( oNewText );
|
|
|
|
|
|
//
|
|
// Set the Focus on chat control
|
|
//
|
|
idchatText.click();
|
|
idchatText.select();
|
|
idchatText.focus();
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError( parent.L_RCCTL_Text, error );
|
|
}
|
|
|
|
TraceFunctLeave();
|
|
}
|
|
|
|
|
|
function PrintTakeControlMsg( msg )
|
|
{
|
|
TraceFunctEnter("PrintTakeControlMsg");
|
|
|
|
try
|
|
{
|
|
var oP = document.createElement("P");
|
|
idIncomingChatText.appendChild( oP );
|
|
|
|
var oNewText = document.createElement("Span");
|
|
oNewText.innerText = msg;
|
|
idIncomingChatText.appendChild( oNewText );
|
|
|
|
#if 0
|
|
idIncomingChatText.value = idIncomingChatText.value + msg;
|
|
#endif
|
|
|
|
var szTmp = idIncomingChatText.value;
|
|
for( var i = 0; i <= ((szTmp.length / 100)+1); i++ )
|
|
{
|
|
idIncomingChatText.doScroll("scrollbarPageDown");
|
|
}
|
|
SetFocus();
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError( parent.L_RCCTL_Text, error );
|
|
}
|
|
|
|
TraceFunctLeave();
|
|
}
|
|
|
|
//
|
|
// SendChatData: Routine to send chat data
|
|
//
|
|
function SendChatData()
|
|
{
|
|
TraceFunctEnter("SendChatData");
|
|
|
|
try
|
|
{
|
|
if( false == parent.g_bConnected )
|
|
{
|
|
//
|
|
// Not connected
|
|
//
|
|
TraceFunctLeave();
|
|
return;
|
|
}
|
|
|
|
if ( (parent.g_Helpee_oSAFRemoteDesktopSession != null) && ( idchatText.value.length > 0))
|
|
{
|
|
//
|
|
// Send the data across
|
|
//
|
|
parent.g_Helpee_oChatChannel.SendChannelData( idchatText.value );
|
|
|
|
|
|
//
|
|
// Update user's chat history window
|
|
//
|
|
#if 0
|
|
var oNewText = document.createElement("Span");
|
|
oNewText.innerHTML = parent.FormatSendChatText( parent.g_szLocalUser , idchatText.value )
|
|
idIncomingChatText.appendChild( oNewText );
|
|
#endif
|
|
|
|
if( parent.parent.gFrom.length == 0 )
|
|
{
|
|
parent.parent.gFrom = parent.GetLocalUser();
|
|
}
|
|
|
|
#if 0
|
|
idIncomingChatText.value = idIncomingChatText.value + "\n\n" + parent.parent.gFrom +
|
|
L_SAYS_Text + idchatText.value;
|
|
#endif
|
|
|
|
var oP = document.createElement("P");
|
|
idIncomingChatText.appendChild( oP );
|
|
|
|
var oNewText = document.createElement("Span");
|
|
oNewText.innerText = parent.parent.gFrom +
|
|
L_SAYS_Text + idchatText.value;
|
|
idIncomingChatText.appendChild( oNewText );
|
|
|
|
var strText = idIncomingChatText.value;
|
|
for(var i = 0; i <= ((strText.length / 80)+1); i++)
|
|
{
|
|
idIncomingChatText.doScroll("scrollbarPageDown");
|
|
}
|
|
|
|
//
|
|
// Clear up the chat message window
|
|
//
|
|
idchatText.value="";
|
|
|
|
//Get the focus on to the chat box.
|
|
idchatText.click();
|
|
idchatText.select();
|
|
}
|
|
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError( parent.L_ERRFATAL_Text, error );
|
|
}
|
|
|
|
TraceFunctLeave();
|
|
return;
|
|
}
|
|
|
|
|
|
var g_bFirstKey = true;
|
|
|
|
//
|
|
// OnEnter:
|
|
//
|
|
function OnEnter()
|
|
{
|
|
TraceFunctEnter( "OnEnter" );
|
|
|
|
try
|
|
{
|
|
if( false == parent.g_bConnected )
|
|
{
|
|
//
|
|
// Not connected
|
|
//
|
|
TraceFunctLeave();
|
|
return;
|
|
}
|
|
|
|
if (window.event.keyCode == 13)
|
|
{
|
|
SendChatData();
|
|
parent.g_bNewLine = true;
|
|
window.event.returnValue = false;
|
|
}
|
|
|
|
if( true == g_bFirstKey )
|
|
{
|
|
g_bFirstKey = false;
|
|
idIncomingChatText.value = "";
|
|
}
|
|
|
|
SetFocus();
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError( parent.L_RCCTL_Text, error );
|
|
}
|
|
|
|
TraceFunctLeave();
|
|
return;
|
|
}
|
|
|
|
|
|
function UpdateChatHistory( data )
|
|
{
|
|
TraceFunctEnter("UpdateChatHistory");
|
|
try
|
|
{
|
|
if( true == g_bFirstKey )
|
|
{
|
|
g_bFirstKey = false;
|
|
idIncomingChatText.value = "";
|
|
}
|
|
|
|
#if 0
|
|
var oNewText = document.createElement("Span");
|
|
oNewText.innerHTML = parent.FormatSendChatText( parent.parent.gHelper , data )
|
|
idIncomingChatText.appendChild( oNewText );
|
|
idIncomingChatText.value = idIncomingChatText.value + "\n\n" + parent.parent.gHelper +
|
|
parent.L_Expert_Text + L_SAYS_Text + data;
|
|
|
|
#endif
|
|
|
|
var oP = document.createElement("P");
|
|
idIncomingChatText.appendChild( oP );
|
|
|
|
var oNewText = document.createElement("Span");
|
|
oNewText.innerText = parent.parent.gHelper +
|
|
parent.L_Expert_Text + L_SAYS_Text + data;
|
|
idIncomingChatText.appendChild( oNewText );
|
|
|
|
var szTmp = idIncomingChatText.value;
|
|
for( var i = 0; i <= ((szTmp.length / 100) + 1); i++ )
|
|
{
|
|
idIncomingChatText.doScroll("scrollbarPageDown");
|
|
}
|
|
|
|
|
|
DebugTrace("Number of scrolls: " + i);
|
|
SetFocus();
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError( parent.L_RCCTL_Text, error );
|
|
}
|
|
|
|
TraceFunctLeave();
|
|
}
|
|
|
|
|
|
//
|
|
// Cut and Paste truncation code...
|
|
//
|
|
var flag = true;
|
|
function validatePaste()
|
|
{
|
|
TraceFunctEnter("validatePaste");
|
|
try
|
|
{
|
|
if(flag)
|
|
{
|
|
flag = false;
|
|
var sSnapshot = clipboardData.getData("text");
|
|
var lpreText = idchatText.innerText.length;
|
|
|
|
if(IsActiveSelect()) // handles the case of highlighted text
|
|
{
|
|
var selected = element.document.selection.createRange();
|
|
lpreText -= selected.text.length;
|
|
}
|
|
|
|
var sChop = sSnapshot.substring( 0, idchatText.Maxlength-lpreText+1);
|
|
clipboardData.setData("text",sChop);
|
|
document.execCommand("paste"); // calls paste method again
|
|
event.returnValue = false; // cancels the action of the first call
|
|
clipboardData.setData("text",sSnapshot); // restores the clipboard
|
|
}
|
|
else
|
|
{
|
|
flag = true;
|
|
}
|
|
}
|
|
catch(error)
|
|
{
|
|
// Ignore this error
|
|
}
|
|
|
|
TraceFunctLeave();
|
|
}
|
|
|
|
function IsActiveSelect()
|
|
// returns a Boolean if there is currently something selected
|
|
{
|
|
TraceFunctEnter("IsActiveSelect");
|
|
try
|
|
{
|
|
var selected = document.selection.createRange();
|
|
if( selected.text.length > 0 )
|
|
{
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
catch(error)
|
|
{
|
|
// Ignore this error
|
|
}
|
|
|
|
TraceFunctLeave();
|
|
}
|
|
|
|
function document.onkeydown()
|
|
{
|
|
TraceFunctEnter("onkeydown");
|
|
try
|
|
{
|
|
switch( window.event.keyCode ) {
|
|
|
|
case 0x9:
|
|
if(( window.event.srcElement.id == "idchatText")&&(window.event.shiftKey==true))
|
|
{
|
|
parent.frames.idFrameTools.SetRevFocus();
|
|
window.event.returnValue = false;
|
|
}
|
|
if(( window.event.srcElement.id == "idIncomingChatText" )&&(window.event.shiftKey==false))
|
|
{
|
|
parent.frames.idFrameTools.SetFocus();
|
|
window.event.returnValue = false;
|
|
}
|
|
|
|
break;
|
|
}
|
|
}
|
|
catch(error)
|
|
{
|
|
SetFocus();
|
|
window.event.returnValue = false;
|
|
}
|
|
|
|
TraceFunctLeave();
|
|
}
|
|
|
|
|
|
function SetFocus()
|
|
{
|
|
TraceFunctEnter("SetFocus");
|
|
|
|
try
|
|
{
|
|
document.all("idchatText").focus();
|
|
}
|
|
catch(error)
|
|
{
|
|
// Dont care
|
|
}
|
|
|
|
TraceFunctLeave();
|
|
}
|
|
|
|
function SetRevFocus()
|
|
{
|
|
TraceFunctEnter("SetRevFocus");
|
|
|
|
try
|
|
{
|
|
document.all("idIncomingChatText").focus();
|
|
}
|
|
catch(error)
|
|
{
|
|
// Dont care
|
|
}
|
|
|
|
TraceFunctLeave();
|
|
}
|
|
</script>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
</head>
|
|
|
|
<body id="idBody" scroll="no" tabindex=-1 onLoad="DoLoad()" class="sys-homepage-bgcolor">
|
|
<Table cellpadding="10px" cellspacing="0" border=0 class="MaxLayout">
|
|
<TR>
|
|
<TD>
|
|
<TABLE id="T0" name="T0" border=0 cellpadding=0 cellspacing=0 class="MaxLayout">
|
|
<TR id="TR0T0" name="TR0T0">
|
|
<TD id="TD0TR0T0" name="TD0TR0T0" class="styChatTD0TR0T0">
|
|
<TABLE id="T0TD0TR0T0" name="T0TD0TR0T0" cellpadding=0 cellspacing=0 border=0 class="MaxLayout">
|
|
<TR id="TR0T0TD0TR0T0" name="TR0T0TD0TR0T0">
|
|
<TD id="TD0TR0T0TD0TR0T0" name="TD0TR0T0TD0TR0T0" class="styChatTR4 sys-toppane-header-bgcolor sys-font-body-bold sys-toppane-header-color">
|
|
Chat History
|
|
</TD>
|
|
</TR>
|
|
<TR id="TR1T0TD0TR0T0" name="TR1T0TD0TR0T0" >
|
|
<TD id="TD0TR1T0TD0TR0T0" name="TD0TR1T0TD0TR0T0" class="sys-toppane-header-bgcolor" >
|
|
<TEXTAREA id="idIncomingChatText" name="idIncomingChatText" title="Chat history" tabindex=3 class="overflow MaxLayout sys-font-body sys-toppane-bgcolor sys-toppane-color-border styChatTextArea styPadding" disabled readOnly wrap=VIRTUAL multiline="true"></TEXTAREA>
|
|
</TD>
|
|
</TR>
|
|
</TABLE>
|
|
</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD class="height2">
|
|
</TD>
|
|
</TR>
|
|
<TR id="TR1T0" name="TR1T0">
|
|
<TD id="TD0TR1T0" name="TD0TR1T0" class="MaxLayout">
|
|
<TABLE id="T0TD0TR1T0" name="T0TD0TR1T0" cellpadding=0 cellspacing=0 border=0 class="MaxLayout">
|
|
<TR id="TR0T0TD0TR1T0" name="TR0T0TD0TR1T0">
|
|
<TD colspan=2 id="TD0TR0T0TD0TR1T0" name="TD0TR0T0TD0TR1T0" class="styChatTR6 sys-bottompane-header-bgcolor sys-font-body-bold sys-bottompane-header-color">
|
|
Message Entry
|
|
</TD>
|
|
</TR>
|
|
<TR id="TR1T0TD0TR1T0" name="TR1T0TD0TR1T0">
|
|
<TD id="TD0TR1T0TD0TR1T0" name="TD0TR1T0TD0TR1T0" class="styChatTR5TD1 sys-bottompane-header-bgcolor">
|
|
<TEXTAREA class="sys-font-body sys-color-body MaxLayout styChatTextArea styPadding sys-bottompane-bgcolor sys-bottompane-color-border overflow" Maxlength=1024 onpaste="validatePaste();" onkeypress=OnEnter() id="idchatText" name="idchatText" title="Type new message here" tabindex=1 ></TEXTAREA>
|
|
</TD>
|
|
<TD id="TD0TR1T0TD0TR1T0" name="TD0TR1T0TD0TR1T0" class="sys-bottompane-color-border borderNone sys-table-cell-bgcolor5 valigntop">
|
|
<Div class="styChatTR5TD2" title="Send chat message" id="btnSendChat" name="btnSendChat" align="center">
|
|
<A id="S0btnSendChat" name="S0btnSendChat" class="sys-font-body sys-link-normal" href="" onclick="SendChatData();return false;" onkeypress="if((window.event.keyCode == 13)||(window.event.keyCode == 0x20 )) SendChatData();"tabindex=2>
|
|
<img id="I0btnSendChat" name="I0btnSendChat" src="../Common/SendChat.gif" class="BorderNone" onclick="SendChatData();" onkeypress="if((window.event.keyCode == 13)||(window.event.keyCode == 0x20 )) SendChatData();"><BR>
|
|
Send
|
|
</A>
|
|
</Div>
|
|
</TD>
|
|
</TR>
|
|
</TABLE>
|
|
</TD>
|
|
</TR>
|
|
</TABLE>
|
|
</TD>
|
|
</TR>
|
|
</Table>
|
|
</body>
|
|
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|