|
|
<HTML> <HEAD> #include "header.inc" #include "debug_js.inc" #include "common.inc" #include "constants.inc"
<TITLE>Remote Assistance</TITLE> <meta http-equiv="MSThemeCompatible" content="Yes"> <LINK id="UI_StyleSheet1" name="UI_StyleSheet1" REL="stylesheet" TYPE="text/css" HREF="../../Css/rc.css"> <LINK id="UI_StyleSheet2" name="UI_StyleSheet2" 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 LANGUAGE="Javascript" > var g_oSAFRemoteAssistanceHelper = null;
/* * Localizeable Constants, Text and Messages */ var L_cszExpertID_Text = "\n Helper> "; var L_SAYS_Text = " says: \n ";
/*++ Control handling routines --*/
#ifdef _BVT
function ChatBVT() { try { var oNewText = document.createElement("Span"); oNewText.innerHTML = parent.FormatChatMsg( "1. CHAT BVT: " ); idIncomingChatText.appendChild( oNewText );
parent.g_oBVT[ parent.g_iTest ].TEST = "Test " + parent.g_iTest + " CHAT"; var oDate = new Date(); parent.g_oBVT[ parent.g_iTest ].START_TIME = oDate.toLocaleString();
// // CHAT BVT // g_oSAFRemoteAssistanceHelper.m_oChatChannel.SendChannelData( c_szChatBVT ); g_bFirstKey = false; } catch(error) { FatalError( error.description, error ); }
}
function TakeControlBVT() { // // REMOTE CONTROL BVT // try { var oNewText = document.createElement("Span"); oNewText.innerHTML = parent.FormatChatMsg( "2. TAKE CONTROL BVT: " ); idIncomingChatText.appendChild( oNewText );
parent.g_oBVT[ parent.g_iTest ].TEST = "Test " + parent.g_iTest + " TAKE CONTROL"; var oDate = new Date(); parent.g_oBVT[ parent.g_iTest ].START_TIME = oDate.toLocaleString();
g_oSAFRemoteAssistanceHelper.m_oChatChannel.SendChannelData( c_szTakeControlBVT );
parent.frames.idFrameTools.Helper_TakeControl(); } catch(error) { FatalError( error.description, error ); } }
function ReleaseControlBVT() { // // RELEASE CONTROL BVT // try { var oNewText = document.createElement("Span"); oNewText.innerHTML = parent.FormatChatMsg( "3. RELEASE CONTROL BVT: " ); idIncomingChatText.appendChild( oNewText );
parent.g_oBVT[ parent.g_iTest ].TEST = "Test " + parent.g_iTest + " RELEASE CONTROL"; var oDate = new Date(); parent.g_oBVT[ parent.g_iTest ].START_TIME = oDate.toLocaleString();
g_oSAFRemoteAssistanceHelper.m_oChatChannel.SendChannelData( c_szReleaseControlBVT );
parent.frames.idFrameTools.Helper_TakeControl(); } catch(error) { FatalError( error.description, error ); } }
function ActualSizeBVT() { // // ACTUAL SIZE BVT // try { var oNewText = document.createElement("Span"); oNewText.innerHTML = parent.FormatChatMsg( "4. SMART SCALING( Actual Size) BVT: " ); idIncomingChatText.appendChild( oNewText );
parent.g_oBVT[ parent.g_iTest ].TEST = "Test " + parent.g_iTest + " SMART SCALING( Actual Size)"; var oDate = new Date(); parent.g_oBVT[ parent.g_iTest ].START_TIME = oDate.toLocaleString();
parent.frames.idFrameStatus.ActualSize();
Helper_UpdateChatHistory( c_szBVTPASS ); setTimeout("ScaleToWindowBVT()", 10000); } catch(error) { FatalError( error.description, error ); } }
function ScaleToWindowBVT() { // // SCALE TO WINDOW BVT // try { var oNewText = document.createElement("Span"); oNewText.innerHTML = parent.FormatChatMsg( "4. SMART SCALING( Scale to Window) BVT: " ); idIncomingChatText.appendChild( oNewText );
parent.g_oBVT[ parent.g_iTest ].TEST = "Test " + parent.g_iTest + " SMART SCALING( Scale to Window)"; var oDate = new Date(); parent.g_oBVT[ parent.g_iTest ].START_TIME = oDate.toLocaleString();
parent.frames.idFrameStatus.ScaleToWindow();
Helper_UpdateChatHistory( c_szBVTPASS ); setTimeout("DisconnectBVT()", 10000); } catch(error) { FatalError( error.description, error ); } }
function DisconnectBVT() { // // DISCONNECT BVT // try { var oNewText = document.createElement("Span"); oNewText.innerHTML = parent.FormatChatMsg( "4. DISCONNECT BVT: " ); idIncomingChatText.appendChild( oNewText );
g_oSAFRemoteAssistanceHelper.m_oChatChannel.SendChannelData( c_szDisconnectBVT );
parent.g_oBVT[ parent.g_iTest ].TEST = "Test " + parent.g_iTest + " DISCONNECT"; var oDate = new Date(); parent.g_oBVT[ parent.g_iTest ].START_TIME = oDate.toLocaleString();
parent.frames.idFrameTools.Helper_QuitMethod(); } catch(error) { FatalError( error.description, error ); } } #endif
// // Helper_InitializeRAChatClient: Stuff done when the RCControl page is loaded // function Helper_InitializeRAChatClient() { TraceFunctEnter("InitializeRAChatClient"); try { InitTrace(); g_oSAFRemoteAssistanceHelper = parent.g_oSAFRemoteAssistanceHelper;
// // Setup the Chat Channel // parent.Helper_SetupChatChannel();
// // enable chat controls on the screen // idIncomingChatText.disabled=false; idchatText.disabled=false;
#ifdef _BVT if( true == g_oSAFRemoteAssistanceHelper.m_bBVT ) { setTimeout("ChatBVT()", 5000); } else { var oNewText = document.createElement("Span"); oNewText.innerHTML = parent.CreateChatGreeting( g_oSAFRemoteAssistanceHelper.m_szLocalUser, g_oSAFRemoteAssistanceHelper.m_szUserName ); idIncomingChatText.appendChild( oNewText ); } #else var oNewText = document.createElement("Span"); oNewText.innerHTML = parent.CreateChatGreeting( g_oSAFRemoteAssistanceHelper.m_szLocalUser, g_oSAFRemoteAssistanceHelper.m_szUserName ); idIncomingChatText.appendChild( oNewText ); #endif
// // Set the Focus on chat control // setTimeout("idchatText.focus()", 0); } catch(error) { parent.FatalError( parent.L_RCCTL_Text, error); }
TraceFunctLeave(); return; }
var g_bTyping = false; var g_bFirstKey = true;
// // Helper_OnEnter: This is fired when Expert hits <ENTER> in the chat message window // function Helper_OnEnter() { try { if( parent.frames.idFrameScreen.g_oSAFRemoteAssistanceHelper.m_bConnected == false ) { // // Disconnected // return; }
if (window.event.keyCode == 13) { // // Send chat data to user // Helper_SendChatData(); window.event.returnValue = false; }
if( (window.event.keyCode >= 0x48) && (window.event.keyCode <= 0x90) && (false == g_bTyping )) { g_bTyping = true; parent.Helper_SendControlCommand( c_szTYPINGSTART ); }
if( true == g_bFirstKey ) { g_bFirstKey = false; idIncomingChatText.value = ""; }
} catch(error) { parent.FatalError( parent.L_RCCTL_Text, error ); } }
// // Helper_SendChatData sends chat data to remote machine // function Helper_SendChatData() { TraceFunctEnter("Helper_SendChatData"); try { if( parent.frames.idFrameScreen.g_oSAFRemoteAssistanceHelper.m_bConnected == false ) { // // Disconnected // return; }
if ((parent.frames.idFrameTools.g_oSAFRemoteAssistanceHelper.m_oSAFRemoteDesktopClient != null) && ( parent.frames.idFrameChat.idchatText.value.length > 0 )) { // // Send chat data to user // parent.frames.idFrameTools.g_oSAFRemoteAssistanceHelper.m_oChatChannel.SendChannelData( parent.frames.idFrameChat.idchatText.value ); // // Update chat history window // if(parent.frames.idFrameTools.g_oSAFRemoteAssistanceHelper.m_szLocalUser.length == 0) { parent.frames.idFrameTools.g_oSAFRemoteAssistanceHelper.m_szLocalUser = L_cszExpertID_Text; } #if 0 var oNewText = document.createElement("Span"); oNewText.innerHTML = parent.FormatSendChatText( parent.frames.idFrameTools.g_oSAFRemoteAssistanceHelper.m_szLocalUser , idchatText.value ) idIncomingChatText.appendChild( oNewText );
idIncomingChatText.value = idIncomingChatText.value + "\n\n" + parent.frames.idFrameTools.g_oSAFRemoteAssistanceHelper.m_szLocalUser + parent.L_Expert_Text + L_SAYS_Text + idchatText.value;
#endif
var oP = document.createElement("P"); idIncomingChatText.appendChild( oP ); var oNewText = document.createElement("Span"); oNewText.innerText = parent.frames.idFrameTools.g_oSAFRemoteAssistanceHelper.m_szLocalUser + parent.L_Expert_Text + L_SAYS_Text + idchatText.value;
idIncomingChatText.appendChild( oNewText );
// // Clear chat msg window // idchatText.value=""; // // Reset the focus // idchatText.focus(); // // Scroll down // var szTmp = idIncomingChatText.value; for( var i = 0; i <= ((szTmp.length / 100) + 1); i++ ) { idIncomingChatText.doScroll("scrollbarPageDown"); }
g_bTyping = false; } } catch(error) { parent.FatalError( parent.L_RCCTL_Text, error ); }
TraceFunctLeave(); return; }
// // Helper_UpdateChatHistory: Updates the history pane with message from helpee // function Helper_UpdateChatHistory( szMsg ) { try { if( true == g_bFirstKey ) { g_bFirstKey = false; idIncomingChatText.value = ""; }
#if 0 var oNewText = document.createElement("Span"); oNewText.innerHTML = parent.FormatSendChatText( g_oSAFRemoteAssistanceHelper.m_szUserName, szMsg ); idIncomingChatText.appendChild( oNewText );
idIncomingChatText.value = idIncomingChatText.value + "\n\n" + g_oSAFRemoteAssistanceHelper.m_szUserName + L_SAYS_Text + szMsg; #endif
var oP = document.createElement("P"); idIncomingChatText.appendChild( oP );
var oNewText = document.createElement("Span"); if( null != g_oSAFRemoteAssistanceHelper) { oNewText.innerText = "\n\n" + g_oSAFRemoteAssistanceHelper.m_szUserName + L_SAYS_Text + szMsg; } else { oNewText.innerText = szMsg; } 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); #ifdef _BVT if( (true == g_oSAFRemoteAssistanceHelper.m_bBVT )&&( (szMsg == c_szBVTPASS) || (szMsg == c_szBVTFAIL) )) { parent.ReportBVTResult( szMsg ); switch( parent.g_iTest ) { case 2: setTimeout("TakeControlBVT()", 10000); break;
case 3: setTimeout("ReleaseControlBVT()", 10000); break;
case 4: setTimeout("ActualSizeBVT()", 10000); break; } } #endif } catch(error) { parent.FatalError( parent.L_RCCTL_Text, error ); } }
// // Security Check // function DoLoad() { var L_ERRACCESSDENIED_Text = "Directly launching this page is not allowed. ";
MAC_IF_DIRECTLAUNCH_CLIENT { idBody.style.visibility = "hidden"; alert( L_ERRACCESSDENIED_Text ); return; } }
// // Cut and Paste truncation code... // var flag = true; function 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 } }
function IsActiveSelect() // returns a Boolean if there is currently something selected { try { var selected = document.selection.createRange(); if( selected.text.length > 0 ) { return true; } else { return false; } } catch(error) { // Ignore this error } }
function document.onkeydown() { try { switch( window.event.keyCode ) {
case 0x9: if(( window.event.srcElement.id == "idchatimg" )&&(window.event.shiftKey == false)) { parent.frames.idFrameStatus.SetFocus(); window.event.returnValue = false; } if(( window.event.srcElement.id == "idchatText" )&&(window.event.shiftKey == true)) { parent.frames.idFrameStatus.SetRevFocus(); window.event.returnValue = false; } break; } } catch(error) { SetFocus(); window.event.returnValue = false; } }
function SetFocus() { try { document.all("idchatText").focus(); } catch(error) { //alert("error: " + error.description); Ignore } }
</script> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head>
<body id="idBody" scroll="no" tabindex=-1 onmouseover="" 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 class="MaxLayout"> <TR id="TR0T0TD0TR0T0" name="TR0T0TD0TR0T0"> <TD id="TD0TR0T0TD0TR0T0" name="TD0TR0T0TD0TR0T0" class="styChatTR4 sys-toppane-header-bgcolor"> <Table id="idContainer" name="idContainer" cellspacing="0px" cellpadding="0px" border=0 class="MaxLayout"> <TR> <TD id="s0TD0TR0T0TD0TR0T0" name="s0TD0TR0T0TD0TR0T0" class="sys-font-body-bold sys-toppane-header-color width1"> Chat History </TD> <TD class="sys-font-body sys-toppane-header-color width2" id="btnHideChat" name="btnHideChat" align="right"> Hide <IMG id="idchatimg" name="idchatimg" tabindex=4 onkeydown="if (event.keyCode==13){idchatimg.onclick();}" onclick="idchatimg.focus();parent.frames.idFrameStatus.Helper_HideChat();" title="Hide chat window" src="../Common/hide-chat.gif" class="vAlign"> </TD> </TR> </Table> </TD> </TR> <TR id="TR1T0TD0TR0T0" name="TR1T0TD0TR0T0"> <TD id="TD0TR1T0TD0TR0T0" name="TD0TR1T0TD0TR0T0" class="sys-toppane-header-bgcolor"> <TEXTAREA id=idIncomingChatText title="Chat history" tabindex=3 class="overflow MaxLayout sys-font-body sys-toppane-bgcolor sys-toppane-color-border styChatTextArea styPadding" disabled name="idIncomingChatText" 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 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="Helper_OnEnter()" id="idchatText" title="Type new message here" tabindex=1 name="idchatText"></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="Helper_SendChatData();return false;" onkeypress="if((window.event.keyCode == 13)||(window.event.keyCode == 0x20 )){Helper_SendChatData();}" tabindex=2> <img id="I0btnSendChat" name="I0btnSendChat" src="../Common/SendChat.gif" class="BorderNone" onclick="Helper_SendChatData();" onkeypress="if((window.event.keyCode == 13)||(window.event.keyCode == 0x20 )){Helper_SendChatData();}"><BR> Send </A> </Div> </TD> </TR> </TABLE> </TD> </TR> </TABLE> </TD> </TR> </Table> </body> </html>
|