349 lines
		
	
	
		
			7.1 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			349 lines
		
	
	
		
			7.1 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <HTML>
 | |
| <!--
 | |
| Copyright (c) 2000 Microsoft Corporation
 | |
| -->
 | |
| <HEAD>
 | |
| <TITLE>Remote Assistance</TITLE>
 | |
| <meta http-equiv="MSThemeCompatible" content="Yes">
 | |
| <LINK id="UI_StyleSheet" REL="stylesheet" TYPE="text/css" HREF="../../Css/rc.css">
 | |
| <script LANGUAGE="Javascript" >
 | |
| var g_oSAFRemoteAssistanceHelper	= null;
 | |
| 
 | |
| /*++
 | |
| 	Control handling routines
 | |
| --*/
 | |
| 
 | |
| //
 | |
| // Helper_InitializeRAChatClient: Stuff done when the RCControl page is loaded  
 | |
| //
 | |
| function Helper_InitializeRAChatClient()
 | |
| {	
 | |
| 	parent.TraceFunctEnter("InitializeRAChatClient");
 | |
| 	
 | |
| 	try
 | |
| 	{
 | |
| 		if( parent.g_oSAFRemoteAssistanceHelper == null)
 | |
| 		{
 | |
| 			//
 | |
| 			// Undocked, floating...
 | |
| 			//
 | |
| 			var vArgs = window.dialogArguments;
 | |
| 			
 | |
| 			//
 | |
| 			// Obtain the Helper Context passed as Parameter
 | |
| 			//
 | |
| 			g_oSAFRemoteAssistanceHelper = vArgs[0];
 | |
| 		}
 | |
| 		else
 | |
| 		{
 | |
| 			//
 | |
| 			// Docked
 | |
| 			//
 | |
| 			g_oSAFRemoteAssistanceHelper = parent.g_oSAFRemoteAssistanceHelper;
 | |
| 		}
 | |
| 
 | |
| 		//
 | |
| 		// Setup the Chat Channel
 | |
| 		//
 | |
| 		parent.Helper_SetupChatChannel();
 | |
| 
 | |
| 		//
 | |
| 		// Resize chat window 
 | |
| 		//
 | |
| 		idChatServerLayer.style.visibility = "visible";
 | |
| 		Helper_ResizeChat();
 | |
| 
 | |
| 				
 | |
| 		//
 | |
| 		// enable chat controls on the screen
 | |
| 		//
 | |
| 		idIncomingChatText.disabled=false;
 | |
| 		idchatText.disabled=false;
 | |
| 		//btnSendChat.disabled=false;
 | |
|  
 | |
| 		//
 | |
| 		// Set the Focus on chat control
 | |
| 		//
 | |
| 		idChatServerLayer.focus();
 | |
| 		idchatText.click();
 | |
| 		idchatText.select();
 | |
| 		idchatText.focus();
 | |
| 
 | |
| 	}
 | |
| 	catch(error)
 | |
| 	{
 | |
| 		parent.FatalError(error.description, error);
 | |
| 	}
 | |
| 
 | |
| 	parent.TraceFunctLeave();
 | |
| 	return;
 | |
| }
 | |
| 
 | |
| 
 | |
| //
 | |
| // Helper_HideChatWindow
 | |
| //
 | |
| function Helper_HideChatWindow()
 | |
| {
 | |
| 	idChatServerLayer.style.visibility = "hidden";
 | |
| }
 | |
| 
 | |
| 
 | |
| //
 | |
| // Helper_showChatWindow
 | |
| //
 | |
| function Helper_ShowChatWindow()
 | |
| {
 | |
| 	idChatServerLayer.style.visibility = "visible";
 | |
| }
 | |
| 
 | |
| 
 | |
| //
 | |
| // Resizes the helper chat window
 | |
| //
 | |
| function Helper_ResizeChat()
 | |
| {
 | |
|   if( null == parent.TraceFunctEnter )
 | |
|   {
 | |
| 	return;
 | |
|   }		
 | |
| 	try
 | |
| 	{
 | |
| 		idChatServerLayer.style.width   = idBody.clientWidth;
 | |
| 		idChatServerLayer.style.height	= idBody.clientHeight;
 | |
| 		//idHistory.height = (idBody.clientHeight * 30) / 52;
 | |
| 	}
 | |
| 	catch(error)
 | |
| 	{
 | |
| 		//
 | |
| 		// Dont care
 | |
| 		//
 | |
| 	}
 | |
|   
 | |
| }
 | |
| 
 | |
| 
 | |
| //
 | |
| // 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
 | |
| 			//
 | |
| 			parent.frames.idFrameTools.Helper_SendChatData();
 | |
| 			window.event.returnValue = false;
 | |
| 		}
 | |
| 	}
 | |
| 	catch(error)
 | |
| 	{
 | |
| 		parent.FatalError( error.description );
 | |
| 	}
 | |
| }
 | |
| 
 | |
| 
 | |
| //
 | |
| // Helper_UpdateChatHistory: Updates the history pane with message from helpee
 | |
| //
 | |
| function Helper_UpdateChatHistory( szMsg )
 | |
| {
 | |
| 	try
 | |
| 	{
 | |
| 		idIncomingChatText.value = idIncomingChatText.value + "\n " + g_oSAFRemoteAssistanceHelper.m_szUserName + ":\n   ";
 | |
| 		idIncomingChatText.value = idIncomingChatText.value + szMsg; 
 | |
| 
 | |
| 		idIncomingChatText.doScroll("scrollbarPageDown");
 | |
| 	}
 | |
| 	catch(error)
 | |
| 	{
 | |
| 		parent.FatalError( error.description );
 | |
| 	}
 | |
| }
 | |
| 
 | |
| 
 | |
| //
 | |
| // TopScroll:	Scrolls History up
 | |
| //
 | |
| function TopScroll()
 | |
| {
 | |
| 	if(window.event.srcElement.id == "idChatTopScroll")
 | |
| 	{
 | |
| 		idchatText.doScroll("scrollbarUp");
 | |
| 	}
 | |
| 	else
 | |
| 	{
 | |
| 		idIncomingChatText.doScroll("scrollbarUp");
 | |
| 	}
 | |
| }
 | |
| 
 | |
| 
 | |
| //
 | |
| // BottomScroll: Scrolls History down
 | |
| //
 | |
| function BottomScroll()
 | |
| {
 | |
| 	if(window.event.srcElement.id == "idChatBottomScroll")
 | |
| 	{
 | |
| 		idchatText.doScroll("scrollbarDown");
 | |
| 	}
 | |
| 	else
 | |
| 	{
 | |
| 		idIncomingChatText.doScroll("scrollbarDown");
 | |
| 	}
 | |
| }
 | |
| 
 | |
| //
 | |
| // Security Check
 | |
| //
 | |
| function DoLoad()
 | |
| {
 | |
| 	var L_ERRACCESSDENIED_MSG	= "Directly launching this page is not allowed. ";
 | |
| 
 | |
| 	if( null == parent.TraceFunctEnter )
 | |
| 	{
 | |
| 		idBody.style.visibility = "hidden";
 | |
| 		alert( L_ERRACCESSDENIED_MSG );
 | |
| 		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()
 | |
| {
 | |
| 	if ((window.event.keyCode==8)&&(window.event.srcElement.id != "idchatText"))
 | |
| 	{
 | |
| 		window.event.returnValue=false;
 | |
| 	}		
 | |
| 	if ((window.event.shiftKey==true)&&(window.event.keyCode==9))
 | |
| 	{
 | |
| 		parent.frames("idFrameStatus").document.all("idchatimg").focus();		
 | |
| 		parent.frames("idFrameStatus").document.all("btnHelp").focus();
 | |
| 		window.event.returnValue=false;				
 | |
| 	}
 | |
| 	else if ((window.event.keyCode==9)&&(window.event.srcElement.id=="idchatText"))
 | |
| 	{
 | |
| 		if(parent.frames("idFrameTools").frameElement.height > 0)
 | |
| 		{
 | |
| 		parent.frames("idFrameTools").document.all("btnTakeCtrl").focus();
 | |
| 		parent.frames("idFrameTools").document.all("btnSendChat").focus();			}
 | |
| 		window.event.returnValue=false;			
 | |
| 	}
 | |
| 	else if ((window.event.keyCode==9)&&(window.event.srcElement.id=="idIncomingChatText"))
 | |
| 	{
 | |
| 		idchatText.focus();
 | |
| 		window.event.returnValue=false;	
 | |
| 	}
 | |
| }
 | |
| 
 | |
| </script>
 | |
| 
 | |
| 
 | |
| <title>Remote Assistance Chat Window</title>
 | |
| <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 | |
| </head>
 | |
| <body id="idBody" scroll="no" tabindex=-1 onresize="Helper_ResizeChat()" onmouseover="" onLoad="DoLoad()">
 | |
| <DIV id="idChatServerLayer" class="MaxLayout">
 | |
| 	<TABLE border=0 cellpadding=0 cellspacing=0 class="ChatClientTable" >
 | |
| 		<TR id=idHistoryRow>
 | |
| 			<TD id=idHistory class="ChatClientTR2TD">
 | |
| 				<TEXTAREA id=idIncomingChatText title="Chat history" tabindex=-1 class="styText ChatClientTextArea MaxLayout Overflow"  disabled name=idIncomingChatText readOnly wrap=VIRTUAL multiline="true"></TEXTAREA>
 | |
| 			</TD>
 | |
| 		</TR>
 | |
| 		
 | |
| 		<TR> 
 | |
| 			<TD class="ChatClientTR4"> </TD> 
 | |
| 		</TR>
 | |
| 
 | |
| 		<TR  id=idChatTextRow valign="top" align="middle"> 
 | |
| 			<TD class="ChatClientTR5">
 | |
| 				<TEXTAREA Maxlength=1024 onpaste="validatePaste();" onkeypress=Helper_OnEnter() id=idchatText title="type new message here" tabindex=1 class="styText ChatClientTextArea MaxLayout Overflow" name=idchatText></TEXTAREA>
 | |
| 			</TD>
 | |
| 		</TR>
 | |
| 	</TABLE>
 | |
| </DIV>
 | |
| 
 | |
| </body>
 | |
| </html>
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 |