/////////////////////////////////////////////////////////////////// // // KEYBOARD EVENT // /////////////////////////////////////////////////////////////////// var isCTRL = false ; var isSHIFT = false ; var isALT = false ; var isESC = false ; var keyBoardTimer = null ; var vtIntervalID = null ; var keyBuf = "" ; var codeStack = new Array(); var codeChar ; function keydown(evt) { // KEY DOWN is always the first event, followed // by KEY PRESS, then KEY UP. // // We always send from the KEY PRESS event // // If followed by a KEY PRESS / KEY UP sequence, // then the code we want is from the KEY PRESS, // otherwise we take the KEY DOWN code. // // Examples: // // a = D65 P97 U65 - take 97 // A = D16 D65 P65 U65 U16 - take 65 // ^a = D17 D65 P97 U65 U17 - take 97-96=1 // ^A = D17 D16 U65 P65 U65 U16 U17 - take 65-64=1 // BS = D8 P8 U8 - take 8 // DEL = D46 P46 U46 - treat like BS // -> = D39 P39 U39 - make [A // ESC = D27 P27 U27 - take 27 // TAB = D9 P9 U9 - take 9 // / = D191 P47 P191 U191 - take 47, not 191! // \ = D220 P92 U220 - take 92 // | = D16 D220 P124 U220 U16 - take 124 // // CTRL - 17 // SHIFT - 16 // ALT - 18 // UP - 38 // DOWN - 40 // LEFT - 37 // RIGHT - 39 // INSERT - 45 // HOME - 36 // PAGEUP - 33 // DELETE - 46 // END - 35 // PAGEDN - 34 // F1-F12 - 112 - 123 // ESC - 27 // TAB - 9 evt = (evt) ? evt : event; var keyDownCode; var target = (evt.target) ? evt.target : evt.srcElement; if ( target.tagName != "HTML" && target.tagName != "TD" ) return true ; //if ( target.className != "vtdisplay" ) return true ; if ( evt.which ) keyDownCode = evt.which ; else if ( evt.keyCode ) keyDownCode = evt.keyCode ; else if ( evt.charCode ) keyDownCode = evt.charCode ; else return true ; //hsputs ( "KEYDown = "+ keyDownCode ) ; if ( keyDownCode == 8 || keyDownCode == 127 ) { keyDownCode = 127 ; //hsputs ( "BS = "+ keyDownCode ) ; vt ( keyDownCode ) ; return false ; } if ( isCTRL ) { if ( keyDownCode > 64 ) { if ( keyDownCode > 96 ) keyDownCode -= 96 ; else keyDownCode -=64 ; //hsputs ( "CTRL/"+ keyDownCode ) ; vt ( keyDownCode ) ; return false ; } } if ( isSHIFT ) { if ( keyDownCode > 64 ) return true ; } if ( isALT ) { if ( keyDownCode > 64 ) return true ; } isESC = false ; var k = keyDownCode ; switch ( k ) { case 16 : //hsputs ( "set shift"); isSHIFT = true ; break ; case 17: //hsputs ( "set ctrl"); isCTRL = true ; break ; case 18 : isALT = true ; break ; case 38 : //hsputs ( "Up arrow"); if ( isDOM_HS ) hscall2 ( 'vt_driver', 'OUT_VT_ESC', 'A' ) ; else if ( isAJAX_HS ) esc(65) ; isESC = true ; return false ; case 40: if ( isDOM_HS ) hscall2 ( 'vt_driver', 'OUT_VT_ESC', 'B' ) ; else if ( isAJAX_HS ) esc(66) ; isESC = true ; return false ; case 39: if ( isDOM_HS ) hscall2 ( 'vt_driver', 'OUT_VT_ESC', 'C' ) ; else if ( isAJAX_HS ) esc(67) ; isESC = true ; return false ; case 37: if ( isDOM_HS ) hscall2 ( 'vt_driver', 'OUT_VT_ESC', 'D' ) ; else if ( isAJAX_HS ) esc(68) ; isESC = true ; return false ; } return true ; } function keypress(evt) { // If we get a key press, its the character we // want, provided that evt = (evt) ? evt : event; var keyPressCode ; var target = (evt.target) ? evt.target : evt.srcElement; if ( target.tagName != "HTML" && target.tagName != "TD" ) return true ; //if ( target.className != "vtdisplay" ) return true ; if ( evt.which ) keyPressCode = evt.which ; else if ( evt.keyCode ) keyPressCode = evt.keyCode ; else if ( evt.charCode ) keyPressCode = evt.charCode ; else return true; //hsputs ( "KEYPress = "+ keyPressCode ) ; if ( keyPressCode == 8 ) return false; if ( keyPressCode > 127 ) return true ; if ( isESC || isCTRL ) return false ; // Send the code vt ( keyPressCode ) ; // Do not let the browser interpret the code return false ; } function keyup(evt) { evt = (evt) ? evt : event; var keyUpCode = 0; keyUpSent = false ; var target = (evt.target) ? evt.target : evt.srcElement; if ( target.tagName != "HTML" && target.tagName != "TD" ) return true ; //if ( target.className != "vtdisplay" ) return true ; if ( evt.which ) keyUpCode = evt.which ; else if ( evt.keyCode ) keyUpCode = evt.keyCode ; else if ( evt.charCode ) keyUpCode = evt.charCode ; else return true ; //hsputs ( "KEYUP = "+ keyUpCode ) ; if ( keyUpCode == 16 ) isSHIFT = false ; else if ( keyUpCode == 17 ) isCTRL = false ; else if ( keyUpCode == 18 ) isALT = false ; return true ; } // Turn selected element on function clickVT(evt) { evt = (evt) ? evt : event; var target = (evt.target) ? evt.target : evt.srcElement; var tag = (target.tagName) ? target.tagName : "" ; if ( tag == "TD" ) { var tok = target.title ; if ( tok != "" && tok != " " ) { //var x = tok.split("::") ; //alert ( tok ) ; if ( vt_insertMode ) vt_input.value += " " + tok ; else vt_input.value = tok ; } return false ; } } // Focus on an element function focusVT(evt) { evt = (evt) ? evt : event; var target = (evt.target) ? evt.target : evt.srcElement; //if ( target != theEventElement ) return ; target.focus() ; return false ; } // Blur an element function blurVT(evt) { evt = (evt) ? evt : event; var target = (evt.target) ? evt.target : evt.srcElement; //if ( target != theEventElement ) return ; target.blur() ; return false ; } // Function to save a keystroke on a stack function vt( charCode ) { codeStack.push( charCode ) ; // Two hunderd milliseconds silence, then we'll flush the buffer if ( keyBoardTimer == null ) keyBoardTimer = window.setTimeout("flushKeys()",200) ; } function esc( charCode ) { codeStack.push ( 27 ) ; // ESC //codeStack.push ( 48 ) ; // 0 codeStack.push ( 91 ) ; // [ vt ( charCode ) ; } // Function to flush the stack, releasing the key strokes function flushKeys() { // Cancel the timer. if ( keyBoardTimer != null ) window.clearTimeout(keyBoardTimer) ; keyBoardTimer = null ; if ( codeStack.length == 0 ) return ; if ( !isDOM_HS ) { // For AJAX VT, if the keyBuf is not clear, // then we have to wait for an outstanding http request. if ( keyBuf != "" ) { // But first check to see if the xmlHttpRequests went awry, then fix them do_checkup() ; // Maybe its clear now? if ( keyBuf != "" ) return ; } } // Populate the keyBuf, then call issueKey to output it. keyBuf = "{" ; comma = "" ; while ( codeChar = codeStack.shift() ) { keyBuf += comma + codeChar ; comma = "," ; } keyBuf += "}" ; if ( isDOM_HS ) hscall ( 'vt_driver', 'OUT_VT_KEY', keyBuf ) ; else if ( isAJAX_HS ) issueKey ( ) ; } /////////////////////////////////////////////////////////////////// // // VT200 VIDEO TERMINAL TABLE EMULATION SECTION // /////////////////////////////////////////////////////////////////// // The frame is the entire vt screen var vt_frame = null ; var vt_movie = null ; // It has: // 1. screen (table) // 2. (control) panel var vt_table = null ; var vt_input = null ; var vt_control = null ; var vt_navigation = null ; //var vt_status = null ; var vt_asctime = null ; // The control panel has 3 elements // 1. (nav)igation // 2. control (panel) // 3. (connect) panel var vt_nav = null ; var vt_panel = null ; var vt_connect = null ; // DOM elements var vt_bytesIn = null ; var vt_bytesOut = null ; // Other VT elements var vt_reverseVideo = 0 ; var vt_insertMode = 0 ; var vt_doReset = 0 ; var vt_pageNo = 1 ; var vt_lineNo = 1 ; var vt_page = null ; var vt_line = null ; var vt_home = null ; var vt_recycle = null ; var vt_nopaging = true ; var VT_MAX_ROWS = 24 ; var VT_MAX_COLS = 132 ; var rowMap = new Array(VT_MAX_ROWS) ; var cellId = new Array(VT_MAX_ROWS*VT_MAX_COLS) ; var nonScrollEnd = 0 ; //var labelStack = new Array(132) ; //var prevToken = "" ; //var prevRow = 0 ; var tokenContext = "" ; function createVT () { // Part 1. Create the VT display (vt_table) // A 24x132 table yes, but its got JPG borders, // so its really 26x134. vttable = document.createElement("TABLE"); vttable.setAttribute( "id","vt_table"); vttable.setAttribute( "border",0); vttable.setAttribute( "cellSpacing",0); vttable.setAttribute( "cellPadding",0); //vttable.setAttribute( "bgColor","#c0c0c0"); myTBODY = document.createElement("TBODY"); for ( row=0; row<26; row++ ) { myTR=document.createElement("TR"); for ( col=0; col<134; col++ ) { myTD=document.createElement("TD"); myTD.setAttribute("id","r"+row+"c"+col); if ( row == 0 ) { if ( col == 0 ) { myIMG = document.createElement ( "img" ) ; myIMG.setAttribute("src","images/block.jpg"); myIMG.style.width="6px"; myIMG.style.height="10px"; myTD.appendChild(myIMG) ; } else if ( col == 133 ) { myIMG = document.createElement ( "img" ) ; myIMG.setAttribute("src","images/block.jpg"); myIMG.style.width="6px"; myIMG.style.height="10px"; myTD.appendChild(myIMG) ; } else if ( col < 81 ) { myIMG = document.createElement ( "img" ) ; myIMG.setAttribute("src","images/block.jpg"); myIMG.style.width="6px"; myIMG.style.height="10px"; myTD.appendChild(myIMG) ; myTD.setAttribute("background","images/skinnyblock.jpg"); } else { myTD.setAttribute("background","images/skinnyblock.jpg"); } } else if ( row == 25 ) { if ( col == 0 ) { myIMG = document.createElement ( "img" ) ; myIMG.setAttribute("src","images/block.jpg"); myIMG.style.width="6px"; myIMG.style.height="10px"; myTD.appendChild(myIMG) ; } else if ( col == 133 ) { myIMG = document.createElement ( "img" ) ; myIMG.setAttribute("src","images/block.jpg"); myIMG.style.width="6px"; myIMG.style.height="10px"; myTD.appendChild(myIMG) ; } else if ( col < 81 ) { myIMG = document.createElement ( "img" ) ; myIMG.setAttribute("src","images/block.jpg"); myIMG.style.width="6px"; myIMG.style.height="10px"; myTD.appendChild(myIMG) ; myTD.setAttribute("background","images/skinnyblock.jpg"); } else { myTD.setAttribute("background","images/skinnyblock.jpg"); } } else { // Row 1 through 24 if ( col == 0 ) { myIMG = document.createElement ( "img" ) ; myIMG.setAttribute("src","images/block.jpg"); myIMG.style.width="6px"; myIMG.style.height="10px"; myTD.appendChild(myIMG) ; } else if ( col == 133 ) { myIMG = document.createElement ( "img" ) ; myIMG.setAttribute("src","images/block.jpg"); myIMG.style.width="6px"; myIMG.style.height="10px"; myTD.appendChild(myIMG) ; } else { myTD.setAttribute("className","vtdisplay"); } } myTR.appendChild(myTD); } myTBODY.appendChild(myTR); } vttable.appendChild(myTBODY); //////////////////////////// // // CONNECTION panel // //////////////////////////// ////////////////////////////////////////////////// // // Host: _________ Port: ____________ // ////////////////////////////////////////////////// myTABLE = document.createElement("TABLE"); myTABLE.setAttribute( "border",0); myTABLE.setAttribute( "cellSpacing",0); myTABLE.setAttribute( "cellPadding",2); myTBODY = document.createElement("TBODY"); myTR=document.createElement("TR"); myTD=document.createElement("TD"); myTD.setAttribute( "background","images/brushed.jpg"); myTD.style.fontFamily = "Arial" ; myTD.style.fontSize = "8px" ; myTEXT=document.createTextNode("Host:"); myTD.appendChild(myTEXT); myTR.appendChild(myTD); myTD=document.createElement("TD"); myTD.style.fontFamily = "Arial" ; myTD.style.fontSize = "10px" ; myTD.setAttribute( "background","images/brushed.jpg"); myINPUT = document.createElement("INPUT"); myINPUT.style.fontSize = "10px" ; myINPUT.setAttribute("id","vt_host"); myINPUT.setAttribute("name","vt_host"); myINPUT.setAttribute("value","localhost"); myINPUT.setAttribute("size",10); myTD.appendChild(myINPUT); myTR.appendChild(myTD); myTD=document.createElement("TD"); myTD.style.fontFamily = "Arial" ; myTD.style.fontSize = "8px" ; myTD.setAttribute( "background","images/brushed.jpg"); myTEXT=document.createTextNode("Port:"); myTD.appendChild(myTEXT); myTR.appendChild(myTD); myTD=document.createElement("TD"); myTD.style.fontFamily = "Arial" ; myTD.setAttribute( "background","images/brushed.jpg"); myTD.style.fontSize = "10px" ; myINPUT = document.createElement("INPUT"); myINPUT.style.fontSize = "10px" ; myINPUT.setAttribute("id","vt_port"); myINPUT.setAttribute("name","vt_port"); myINPUT.setAttribute("value",23); myINPUT.setAttribute("size",2); myTD.appendChild(myINPUT); myTR.appendChild(myTD); ////////////////////////////////////////////////// // // [Connect] [Disconnect] // ////////////////////////////////////////////////// myTD=document.createElement("TD"); myTD.style.fontFamily = "Arial" ; myTD.style.fontSize = "10px" ; myTD.setAttribute("align","center"); myTD.setAttribute( "background","images/brushed.jpg"); myTD.setAttribute("colSpan",4); myINPUT = document.createElement("INPUT"); myINPUT.style.fontSize = "10px" ; myINPUT.setAttribute("type","submit"); myINPUT.setAttribute("name","connect"); myINPUT.setAttribute("value","Connect"); myINPUT.onclick = vtConnect ; myTD.appendChild(myINPUT); myINPUT = document.createElement("INPUT"); myINPUT.style.fontSize = "10px" ; myINPUT.setAttribute("type","reset"); myINPUT.setAttribute("name","disconnect"); myINPUT.setAttribute("value","Disconnect"); myINPUT.onclick = vtDisconnect ; myTD.appendChild(myINPUT); myTR.appendChild(myTD); myTBODY.appendChild(myTR); myTABLE.appendChild(myTBODY); ////////////////////////////////////////////////// // // Make the panel // ////////////////////////////////////////////////// vt_connect = document.createElement("TABLE"); vt_connect.setAttribute( "border",0); vt_connect.setAttribute( "cellSpacing",0); vt_connect.setAttribute( "cellPadding",1); vt_connect.setAttribute( "background","images/brushed_dark.jpg"); myTBODY = document.createElement("TBODY"); myTR=document.createElement("TR"); myTD=document.createElement("TD"); myTD.setAttribute( "background","images/brushed.jpg"); myTD.appendChild(myTABLE); ; myTR.appendChild(myTD); myTBODY.appendChild(myTR); vt_connect.appendChild(myTBODY); //////////////////////////// // // Middle CONTROL panel // //////////////////////////// ////////////////////////////////////////////////// // // ____________________ [Send] // ////////////////////////////////////////////////// myTABLE1 = document.createElement("TABLE"); myTABLE1.setAttribute( "botder",0); myTABLE1.setAttribute( "cellSpacing",0); myTABLE1.setAttribute( "cellPadding",2); myTBODY = document.createElement("TBODY"); myTR=document.createElement("TR"); myTD=document.createElement("TD"); myTD.style.fontFamily = "Arial" ; myTD.style.fontSize = "10px" ; myTD.setAttribute( "background","images/brushed.jpg"); myINPUT = document.createElement("INPUT"); myINPUT.style.fontSize = "10px" ; myINPUT.setAttribute("id","vt_input"); myINPUT.setAttribute("name","vt_input"); myINPUT.setAttribute("value",""); myINPUT.setAttribute("size",30); myTD.appendChild(myINPUT); myTR.appendChild(myTD); myTBODY.appendChild(myTR); myTD=document.createElement("TD"); myTD.style.fontFamily = "Arial" ; myTD.style.fontSize = "10px" ; myTD.setAttribute("align","right"); myTD.setAttribute( "background","images/brushed.jpg"); myINPUT = document.createElement("INPUT"); myINPUT.style.fontSize = "10px" ; myINPUT.setAttribute("type","submit"); myINPUT.setAttribute("name","send"); myINPUT.setAttribute("value","Send"); myINPUT.onclick = issueSend ; myTD.appendChild(myINPUT); myTR.appendChild(myTD); myTBODY.appendChild(myTR); myTABLE1.appendChild(myTBODY); ////////////////////////////////////////////////// // // // ////////////////////////////////////////////////// myTABLE2 = document.createElement("TABLE"); myTABLE2.setAttribute( "border",0); myTABLE2.setAttribute( "cellSpacing",0); myTABLE2.setAttribute( "cellPadding",2); myTBODY = document.createElement("TBODY"); myTR=document.createElement("TR"); myTD=document.createElement("TD"); myTD.setAttribute( "background","images/brushed.jpg"); // home page myINPUT = document.createElement ( "INPUT" ) ; myINPUT.setAttribute("type","image"); myINPUT.setAttribute("src","images/home.gif"); myINPUT.style.width = 24 ; myINPUT.style.height = 24 ; myINPUT.onclick = do_home_page ; myINPUT.onmouseout = disable_paging ; myINPUT.onmouseover = enable_paging ; myTD.appendChild(myINPUT) ; myTR.appendChild(myTD); myTD=document.createElement("TD") ; myTD.setAttribute( "background","images/brushed.jpg"); myTD.setAttribute("align","center"); myINPUT = document.createElement ( "INPUT" ) ; myINPUT.setAttribute("type","image"); myINPUT.setAttribute("src","images/rv.gif"); myINPUT.onclick = do_rv ; myTD.appendChild(myINPUT) ; myTR.appendChild(myTD); myTD=document.createElement("TD") ; myTD.setAttribute( "background","images/brushed.jpg"); myTD.setAttribute("align","center"); myINPUT = document.createElement ( "INPUT" ) ; myINPUT.setAttribute("type","image"); myINPUT.setAttribute("src","images/insert.gif"); myINPUT.onclick = do_insert ; myTD.appendChild(myINPUT) ; myTR.appendChild(myTD); myTD=document.createElement("TD") ; myTD.setAttribute( "background","images/brushed.jpg"); myTD.setAttribute("align","center"); myINPUT = document.createElement ( "INPUT" ) ; myINPUT.setAttribute("type","image"); myINPUT.setAttribute("src","images/move.gif"); myINPUT.onclick = do_checkup ; myTD.appendChild(myINPUT) ; myTR.appendChild(myTD); myTD=document.createElement("TD") ; myTD.setAttribute( "background","images/brushed.jpg"); myTEXT = document.createTextNode(" "); myTD.appendChild(myTEXT) ; myTR.appendChild(myTD); myTD=document.createElement("TD"); myTD.setAttribute("align","right"); myTD.style.fontFamily="Arial" ; myTD.style.fontSize="10px" ; myTD.setAttribute( "background","images/brushed.jpg"); myDIV = document.createElement("DIV"); myDIV.setAttribute("id","vt_bytesIn"); myDIV.style.border = "inset" ; myTEXT=document.createTextNode("0"); myDIV.appendChild(myTEXT); myTD.appendChild(myDIV); myTR.appendChild(myTD); myTD=document.createElement("TD"); myTD.setAttribute("align","left"); myTD.setAttribute( "background","images/brushed.jpg"); myTD.style.fontFamily="Arial" ; myTD.style.fontSize="10px" ; myTD.style.fontWeight = "bold" ; myTEXT=document.createTextNode("in"); myTD.appendChild(myTEXT); myTR.appendChild(myTD); myTD=document.createElement("TD"); myTD.setAttribute("align","right"); myTD.style.fontFamily="Arial" ; myTD.style.fontSize="10px" ; myTD.setAttribute( "background","images/brushed.jpg"); myDIV = document.createElement("DIV"); myDIV.setAttribute("id","vt_bytesOut"); myDIV.style.border = "inset" ; myTEXT=document.createTextNode("0"); myDIV.appendChild(myTEXT); myTD.appendChild(myDIV); myTR.appendChild(myTD); myTD=document.createElement("TD"); myTD.setAttribute("align","left"); myTD.style.fontFamily="Arial" ; myTD.style.fontSize="10px" ; myTD.style.fontWeight = "bold" ; myTD.setAttribute( "background","images/brushed.jpg"); myTEXT=document.createTextNode("out"); myTD.appendChild(myTEXT); myTR.appendChild(myTD); myTD=document.createElement("TD"); myTD.setAttribute( "background","images/brushed.jpg"); myTEXT = document.createTextNode(" "); myTD.appendChild(myTEXT) ; myTR.appendChild( myTD ) ; myTD=document.createElement("TD"); myTD.setAttribute( "background","images/brushed.jpg"); vt_asctime = document.createElement("DIV"); vt_asctime.style.fontFamily="Arial" ; vt_asctime.style.fontSize="10px" ; vt_asctime.style.border = "outset" ; myTEXT = document.createTextNode("") ; vt_asctime.appendChild( myTEXT ) ; myTD.appendChild( vt_asctime ) ; myTR.appendChild( myTD ) ; myTBODY.appendChild(myTR); myTABLE2.appendChild (myTBODY); ////////////////////////////////////////////////// // // Make the control panel // ////////////////////////////////////////////////// myTABLE = document.createElement("TABLE"); myTABLE.setAttribute( "border",0); myTABLE.setAttribute( "cellSpacing",0); myTABLE.setAttribute( "cellPadding",0); myTBODY = document.createElement("TBODY"); myTR=document.createElement("TR"); myTD=document.createElement("TD"); myTD.setAttribute( "background","images/brushed.jpg"); myTD.appendChild(myTABLE1) ; myTR.appendChild(myTD); myTBODY.appendChild(myTR) ; vt_panel = document.createElement("TABLE"); vt_panel.setAttribute( "border",0); vt_panel.setAttribute( "cellSpacing",0); vt_panel.setAttribute( "cellPadding",1); vt_panel.setAttribute( "background","images/brushed_dark.jpg"); vt_panel.appendChild ( myTBODY ) ; ////////////////////////////////////////////////// // // Navigator // ////////////////////////////////////////////////// // Paging myTABLE1 = document.createElement("TABLE"); myTABLE1.setAttribute( "border",0); myTABLE1.setAttribute( "cellSpacing",0); myTABLE1.setAttribute( "cellPadding",2); myTBODY = document.createElement("TBODY"); myTR=document.createElement("TR"); myTD=document.createElement("TD"); myTD.setAttribute( "background","images/brushed.jpg"); myTD.setAttribute("align","left"); myTR.appendChild(myTD); myTD=document.createElement("TD"); myTD.setAttribute( "background","images/brushed.jpg"); myTD.setAttribute( "align","center"); myINPUT = document.createElement ( "INPUT" ) ; myINPUT.setAttribute("type","image"); myINPUT.setAttribute("src","images/prevpage.gif"); myINPUT.onclick = do_prev_page ; myINPUT.onmouseout = disable_paging ; myINPUT.onmouseover = enable_paging ; myTD.appendChild(myINPUT) ; myTR.appendChild(myTD); myTD=document.createElement("TD"); myTD.setAttribute( "background","images/brushed.jpg"); myTD.setAttribute( "align","center"); myINPUT = document.createElement ( "INPUT" ) ; myINPUT.setAttribute("type","image"); myINPUT.setAttribute("src","images/scrolldown.gif"); myINPUT.onclick = do_scroll_down ; myINPUT.onmouseout = disable_paging ; myINPUT.onmouseover = enable_paging ; myTD.appendChild(myINPUT) ; myTR.appendChild(myTD); myTD=document.createElement("TD"); myTD.setAttribute( "background","images/brushed.jpg"); myTD.setAttribute( "align","center"); myINPUT = document.createElement ( "INPUT" ) ; myINPUT.setAttribute("type","image"); myINPUT.setAttribute("src","images/page.gif"); myINPUT.onclick = do_current_page ; myINPUT.onmouseout = disable_paging ; myINPUT.onmouseover = enable_paging ; myTD.appendChild(myINPUT) ; myTR.appendChild(myTD); myTD=document.createElement("TD"); myTD.setAttribute( "background","images/brushed.jpg"); myTD.setAttribute( "align","center"); myINPUT = document.createElement ( "INPUT" ) ; myINPUT.setAttribute("type","image"); myINPUT.setAttribute("src","images/scrollup.gif"); myINPUT.onclick = do_scroll_up ; myINPUT.onmouseout = disable_paging ; myINPUT.onmouseover = enable_paging ; myTD.appendChild(myINPUT) ; myTR.appendChild(myTD); myTD=document.createElement("TD"); myTD.setAttribute( "background","images/brushed.jpg"); myTD.setAttribute( "align","center"); myINPUT = document.createElement ( "INPUT" ) ; myINPUT.setAttribute("type","image"); myINPUT.setAttribute("src","images/nextpage.gif"); myINPUT.onclick = do_next_page ; myINPUT.onmouseout = disable_paging ; myINPUT.onmouseover = enable_paging ; myTD.appendChild(myINPUT) ; myTR.appendChild(myTD); myTD=document.createElement("TD"); myTD.setAttribute( "background","images/brushed.jpg"); myTD.setAttribute("align","right"); myTD.style.fontFamily="Arial" ; myTD.style.fontSize="10px" ; myTD.style.fontWeight = "bold" ; myTEXT=document.createTextNode("Page: "); myTD.appendChild(myTEXT); myTR.appendChild(myTD); myTD=document.createElement("TD"); myTD.setAttribute( "background","images/brushed.jpg"); myTD.setAttribute("align","left"); myTD.style.fontFamily="Arial" ; myTD.style.fontSize="10px" ; myDIV = document.createElement("DIV"); myDIV.setAttribute("id","vt_page"); myTEXT=document.createTextNode("0"); myDIV.appendChild(myTEXT); myTD.appendChild(myDIV); myTR.appendChild(myTD); myTD=document.createElement("TD"); myTD.setAttribute( "background","images/brushed.jpg"); myTD.setAttribute("align","right"); myTD.style.fontFamily="Arial" ; myTD.style.fontSize="10px" ; myTD.style.fontWeight = "bold" ; myTEXT=document.createTextNode("Line: "); myTD.appendChild(myTEXT); myTR.appendChild(myTD); myTD=document.createElement("TD"); myTD.setAttribute( "background","images/brushed.jpg"); myTD.setAttribute("align","left"); myTD.style.fontFamily="Arial" ; myTD.style.fontSize="10px" ; myDIV = document.createElement("DIV"); myDIV.setAttribute("id","vt_line"); myTEXT=document.createTextNode("0"); myDIV.appendChild(myTEXT); myTD.appendChild(myDIV); myTR.appendChild(myTD); myTBODY.appendChild( myTR ) ; myTABLE1.appendChild( myTBODY ) ; // Icon selections myTABLE3 = document.createElement("TABLE"); myTABLE3.setAttribute( "border",0); myTABLE3.setAttribute( "cellSpacing",0); myTABLE3.setAttribute( "cellPadding",0); myTBODY = document.createElement("TBODY"); myTR=document.createElement("TR"); // keypad1 icon //myINPUT = document.createElement ( "INPUT" ) ; //myINPUT.setAttribute("type","image"); //myINPUT.setAttribute("src","images/keypad1.gif"); //myINPUT.onclick = do_keypad1 ; //myTD=document.createElement("TD"); //myTD.appendChild(myINPUT) ; //myTR.appendChild(myTD); //myTD=document.createElement("TD") ; //myTEXT = document.createTextNode(" "); //myTD.appendChild(myTEXT) ; //myTR.appendChild(myTD); // keypad2 icon //myINPUT = document.createElement ( "INPUT" ) ; //myINPUT.setAttribute("type","image"); //myINPUT.setAttribute("src","images/keypad2.gif"); //myINPUT.onclick = do_keypad2 ; //myTD=document.createElement("TD"); //myTD.appendChild(myINPUT) ; //myTR.appendChild(myTD); //myTD=document.createElement("TD") ; //myTEXT = document.createTextNode(" "); //myTD.appendChild(myTEXT) ; //myTR.appendChild(myTD); myTBODY.appendChild(myTR); myTABLE3.appendChild(myTBODY); // Now add the three tables into 1 myTABLE = document.createElement("TABLE"); myTABLE.setAttribute( "border",0); myTABLE.setAttribute( "cellSpacing",0); myTABLE.setAttribute( "cellPadding",0); myTBODY = document.createElement("TBODY"); myTR=document.createElement("TR"); myTD=document.createElement("TD") ; myTD.setAttribute( "background","images/brushed.jpg"); myTEXT = document.createTextNode(" "); myTD.appendChild(myTEXT) ; myTR.appendChild(myTD); myTD=document.createElement("TD"); myTD.setAttribute( "background","images/brushed.jpg"); myTD.setAttribute("align","left"); myTD.appendChild( myTABLE3 ) ; myTR.appendChild( myTD ) ; myTD=document.createElement("TD"); myTD.setAttribute( "background","images/brushed.jpg"); myTD.setAttribute("align","right"); myTD.appendChild( myTABLE1 ) ; myTR.appendChild( myTD ) ; myTD=document.createElement("TD") ; myTD.setAttribute( "background","images/brushed.jpg"); myTEXT = document.createTextNode(" "); myTD.appendChild(myTEXT) ; myTR.appendChild(myTD); myTBODY.appendChild ( myTR ) ; myTABLE.appendChild ( myTBODY ) ; vt_nav = document.createElement("TABLE") ; vt_nav.setAttribute( "border",0); vt_nav.setAttribute( "cellSpacing",0); vt_nav.setAttribute( "cellPadding",0); vt_nav.setAttribute( "background","images/brushed_dark.jpg"); myTBODY = document.createElement("TBODY"); myTR=document.createElement("TR"); myTD=document.createElement("TD"); myTD.setAttribute("align","center"); myTD.setAttribute( "background","images/brushed.jpg"); myTD.appendChild(myTABLE) ; myTR.appendChild(myTD); myTD=document.createElement("TD"); myTD.setAttribute( "background","images/brushed.jpg"); myTD.appendChild(myTABLE2) ; myTR.appendChild(myTD); myTBODY.appendChild(myTR); vt_nav.appendChild(myTBODY); ////////////////////////////////////////////////// // // Put it all together // ////////////////////////////////////////////////// vt_navigation = document.createElement("TABLE"); vt_navigation.setAttribute( "border",0); vt_navigation.setAttribute( "cellSpacing",0); vt_navigation.setAttribute( "cellPadding",0); vt_navigation.setAttribute( "background","images/brushed.jpg"); myTBODY = document.createElement("TBODY"); myTR=document.createElement("TR"); myTD=document.createElement("TD"); myTD.setAttribute ( "align", "left" ) ; myTD.setAttribute( "id", "vt_nav") ; myTD.setAttribute( "background","images/brushed.jpg"); myTD.appendChild ( vt_nav ) ; myTR.appendChild(myTD); myTD=document.createElement("TD"); myTD.setAttribute( "background","images/brushed.jpg"); myTR.appendChild(myTD); myTBODY.appendChild(myTR); vt_navigation.appendChild(myTBODY); vt_control = document.createElement("TABLE"); vt_control.setAttribute( "border",0); vt_control.setAttribute( "cellSpacing",0); vt_control.setAttribute( "cellPadding",0); vt_control.setAttribute( "background","images/brushed.jpg"); myTBODY = document.createElement("TBODY"); myTR=document.createElement("TR"); myTD=document.createElement("TD"); myTD.setAttribute ( "align", "left" ) ; myTD.setAttribute( "background","images/brushed.jpg"); myTD.setAttribute( "id", "vt_control") ; myTD.appendChild ( vt_panel ) ; myTR.appendChild(myTD); myTD=document.createElement("TD"); myTD.setAttribute( "background","images/brushed.jpg"); myTD.setAttribute ( "align", "right" ) ; myTD.appendChild ( vt_connect ) ; myTD.setAttribute ( "align", "left" ) ; myTD.setAttribute( "id", "vt_connect") ; myTR.appendChild(myTD); myTD=document.createElement("TD"); myTD.setAttribute( "background","images/brushed.jpg"); myTR.appendChild(myTD); myTBODY.appendChild(myTR); vt_control.appendChild(myTBODY); // Create the frame to hold the VT display // and VT_CONTROL vt_frame = document.createElement("TABLE"); vt_frame.setAttribute( "id","vt_frame"); vt_frame.setAttribute( "border",0); vt_frame.setAttribute( "cellSpacing",0); vt_frame.setAttribute( "cellPadding",0); myTBODY = document.createElement("TBODY"); // Row 1. The navigation panel myTR=document.createElement("TR"); myTD=document.createElement("TD"); myTD.setAttribute( "background","images/brushed.jpg"); myTD.appendChild( vt_navigation ) ; myTR.appendChild( myTD ) ; myTBODY.appendChild ( myTR ) ; // Row 2. The VT display myTR=document.createElement("TR"); myTD=document.createElement("TD"); myTD.appendChild( vttable ) ; myTR.appendChild( myTD ) ; myTBODY.appendChild ( myTR ) ; // Row 3. The VT control panel myTR=document.createElement("TR"); myTD=document.createElement("TD"); myTD.setAttribute( "background","images/brushed.jpg"); myTD.appendChild( vt_control ) ; myTR.appendChild( myTD ) ; myTBODY.appendChild ( myTR ) ; vt_frame.appendChild ( myTBODY ) ; } // Set event capture for Navigator 4 function setNSVTEvents( theElement ) { if ( theElement.captureEvents ) theElement.captureEvents( Event.KEYUP | Event.KEYDOWN | Event.KEYPRESS | Event.MOUSEOVER | Event.MOUSEOUT | Event.MOUSEDOWN ) ; } function initVTEventHandlers( theElement ) { if (document.layers) setNSVTEvents(theElement); theElement.onkeyup = keyup ; theElement.onkeydown = keydown ; theElement.onkeypress = keypress ; theElement.onmouseover = focusVT ; theElement.onmouseout = blurVT ; theElement.onmousedown = clickVT; } // Called from vt_driver.hyp function cacheTableCells () { var row ; var col ; var id ; var x ; var obj; for ( row=0;rowstartrow; i-- ) { rowMap [i-1] = rowMap[i-2] ; } rowMap[startrow-1] = ir ; } // Array is 2x2x2x2 var colorArray = new Array ( // Normal rendition, black screen, not blinking "white","black", // Normal rendition, black screen, blinking "white","red", // Normal rendition, white screen, not blinking "black","white", // Normal rendition, white screen, blinking "red","white", // Reverse rendition, black screen, not blinking "blue","white", // Reverse rendition, black screen, blinking "green","white", // Reverse rendition, white screen, not blinking "white","blue", // Reverse rendition, white screen, blinking "white","green" ) ; function updatecell( row, col, colspan, rendition, flags3, reverseVideo, graphics, text ) { var i, j, c, n, x, y ; var code ; var obj ; var child ; var img ; var src ; var isLINEDRAW ; var isQUICKCHART ; var isBOLD ; var isREVERSE ; var isUNDERSCORE ; var isBLINKING ; var ir = rowMap[row-1] ; var ic = col-1; var isWhiteBground = (flags3 & 64) ; //alert ( row + ":" + col + ":" + ir + ":" + ic ) ; var isDAC = ( graphics == 0 || graphics == 2 ) ; var isDSG = ( graphics == 1 ) ; var isDCS = ( graphics == 3 ) ; //alert( "r="+row+"col="+col+"span="+colspan+ // "graphics="+graphics+"flags3="+flags3+"text="+text ) if ( reverseVideo ) isWhiteBground = !isWhiteBground ; if ( text == "" ) text = " " ; n = text.length ; var isHREF = false ; var lookingForStart = true ; var token = '' ; //if ( row != prevRow ) { //prevToken = '' ; //prevRow = row ; //} for ( i=0;i 94 && code < 127 ) ; isQUICKCHART = ( isDCS && code > 32 && code < 127 ) ; if ( isLINEDRAW ) { img = document.createElement ( "img" ) ; if ( isWhiteBground ) src = "images/dsg_"+code+".jpg" ; else src = "images/dsg_"+code+"r.jpg" ; img.setAttribute( "src", src ) ; child = obj.firstChild ; if ( child ) obj.replaceChild( img, child ) ; else obj.appendChild( img ) ; } else if ( isQUICKCHART ) { img = document.createElement ( "img" ) ; if ( isWhiteBground ) src = "images/dc4t"+(code-32)+".jpg" ; else src = "images/dc4t"+(code-32)+"r.jpg" ; img.setAttribute( "src", src ) ; child = obj.firstChild ; if ( child ) obj.replaceChild( img, child ) ; else obj.appendChild( img ) ; } else { // Text or HREF in the cell // obj is a TD // child is a previous 'a' or a child = obj.firstChild ; var textNode = document.createTextNode(c) ; if ( lookingForStart ) { if ( c != ' ' ) { j = text.indexOf ( ' ', i ) ; if ( j == -1 ) j = n ; else j++ ; //if ( token != '' ) prevToken = token ; token = text.substring ( i, j ) ; //if ( row <= nonScrollEnd ) { // labelToken[i] = token ; //} j = token.length ; if ( token.substr ( j-1, 1 ) == ':' ) { tokenContext = token.substr ( 0, j-1 ) ; } lookingForStart = false ; isHREF = true ; } else { isHREF = false ; } } else { if ( c == ' ' ) { lookingForStart = true ; isHREF = false ; } else { isHREF = true ; } } if ( child ) { // Replace child with textNode obj.replaceChild( textNode, child ) ; } else { // No previous child, just add textNode obj.appendChild( textNode ) ; } // 'obj' is either a TD or an A if ( isHREF ) obj.title = token ; else obj.title = ' ' ; isBOLD = ( rendition & 1 ) ; isREVERSE = ( rendition & 2 ) ; isUNDERSCORE = ( rendition & 4 ) ; isBLINKING = ( rendition & 8 ) ; // Check for BOLD rendition if ( isBOLD ) obj.style.fontWeight = "bold" ; else obj.style.fontWeight = "normal" ; //obj.style.fontSize = ".75em" ; //obj.style.fontFamily = "monospaced" ; // Check for UNDERSCORE rendition if ( isUNDERSCORE ) obj.style.textDecoration = "underline" ; else obj.style.textDecoration = "none" ; y = 0 ; if ( isREVERSE ) y += 8 ; if ( isWhiteBground ) y +=4 ; if ( isBLINKING ) y += 2 ; obj.style.color = colorArray[ y ] ; obj.style.backgroundColor = colorArray [ y+1 ] ; } } } ///////////////////////////////////////////////////////////// // // CURSOR FLASHING // ////////////////////////////////////////////////////////////// var flashIntervalID = null ; var isFlashed = false ; var cursor_row = 1 ; var cursor_col = 1 ; var cursor_chr = " " ; var cursor_rend = 0 ; var cursor_graphics = 0 ; var cursor_flags3 = 0 ; var cursor_reverse_video = 0 ; var cursor_unflags3 = 64 ; function setFlash( new_cursor_row, new_cursor_col, new_cursor_chr, new_cursor_rend, new_cursor_graphics, new_cursor_flags3, reverse_video ) { // First, stop all flashing stopFlash() ; // Next, turn off previous flash if in flash state if ( isFlashed ) { updatecell ( cursor_row, cursor_col, 1, cursor_rend, cursor_flags3, cursor_reverse_video, cursor_graphics, cursor_chr ) isFlashed = false ; } // Now we can set the next flash point cursor_row = new_cursor_row ; cursor_col = new_cursor_col ; cursor_chr = new_cursor_chr ; cursor_rend = new_cursor_rend ; cursor_graphics = new_cursor_graphics ; cursor_reverse_video = reverse_video ; if ( new_cursor_flags3 & 64 ) { cursor_flags3 = 64 cursor_unflags3 = 0 ; } else { cursor_flags3 = 0 cursor_unflags3 = 64 ; } } function startFlash() { if ( flashIntervalID == null ) flashIntervalID = window.setInterval("flashCell()",1000) ; } function stopFlash() { if ( flashIntervalID != null ) { window.clearInterval(flashIntervalID) ; flashIntervalID = null ; } } function flashCell() { if ( isFlashed ) { // Unflash it updatecell ( cursor_row, cursor_col, 1, cursor_rend, cursor_flags3, cursor_reverse_video, cursor_graphics, cursor_chr ) ; isFlashed = false ; } else { // Flash it updatecell ( cursor_row, cursor_col, 1, cursor_rend, cursor_unflags3, cursor_reverse_video, cursor_graphics, cursor_chr ) ; isFlashed = true ; } } ///////////////////////////////////////////////////////////// // // CONNECT and DISCONNECT Interfaces // ////////////////////////////////////////////////////////////// var httpConRequest ; var httpDisRequest ; var httpGetRequest ; var httpGet1Request ; var httpGet2Request ; var httpPutRequest ; var httpPut1Request ; var httpPut2Request ; var MAX_REQUESTS = 9 ; var httpCmdReqArray = new Array(); function vtConnect() { var vt_host = getRawObject("vt_host"); var vt_port = getRawObject("vt_port"); var data = //""+ "" + vt_host.value + "" + vt_port.value + "" ; httpConRequest = new HttpXMLRequest ( 'conHandler','conTimeout' ) ; httpConRequest.loadXMLDocAsync ( "POST", "CONNECT_VT", data, 5000 ) ; return ; } function conHandler( request ) { var xmlcon = request.responseXML.getElementsByTagName("xmldata")[0]; if ( !xmlcon ) { alert ( "Error: XML not : ", request.responseText ) ; return ; } issueGet() ; } function conTimeout() { alert ( "Failed to connect" ) ; } function issueGet() { // This is both the timeout function and the one // we launch the alternating get requests. // Switch reqeuest objects ; if ( httpGetRequest == httpGet1Request ) { httpGetRequest = httpGet2Request ; } else { httpGetRequest = httpGet1Request ; } var data = //""+ "GET" ; // Five second timeout, then cancel request and issue it again. httpGetRequest.loadXMLDocAsync( "POST","/OUT_VT",data, 7000 ) ; } function timeoutPut() { // This is the timeout function and the one // we launch the alternating put requests. // If there is nothing to send, then don't issue another // request. if ( keyBuf == "" ) return ; // Otherwise, keep sending issueKey() ; } function issuePut( buf, format ) { // This is both the timeout function and the one // we launch the alternating key requests. // Switch reqeuest objects ; if ( httpPutRequest == httpPut1Request ) { httpPutRequest = httpPut2Request ; } else { httpPutRequest = httpPut1Request ; } // Issue new request var data = //""+ "" + buf + "" + format + "" ; // Three second timeout, then cancel request and issue again, only // if there is more data to send. httpPutRequest.loadXMLDocAsync( "POST","/OUT_VT",data, 3000 ) ; } function issueKey() { issuePut ( keyBuf, "KEY" ) ; // keyBuf won't be cleared until the response has come back. } function issueSend() { issuePut ( vt_input.value, "PUT" ) ; vt_input.value = "" ; } function getHandler ( request ) { // Asynchronous input var xmlget = request.responseXML.getElementsByTagName("xmldata"); if ( xmlget && xmlget.length > 0 ) { processActions ( xmlget ) ; // Always re-Issue another GET request issueGet() ; } } function cmdHandler ( request ) { // Result from page or scroll operation var xmlcmd = request.responseXML.getElementsByTagName("xmldata"); if ( xmlcmd && xmlcmd.length > 0 ) { processActions ( xmlcmd ) ; // Do nothing more. } } function putHandler ( request ) { // Result fron key stroke operation var xmlput = request.responseXML.getElementsByTagName("xmldata"); if ( xmlput && xmlput.length > 0 ) { processActions ( xmlput ) ; // Clear the keyBuf, so more keys can be sent keyBuf = "" ; // Determine if there are any more characters to send flushKeys() ; } } function processActions( xmldata ) { //var output = "Data received:\n" ; // Get array of tags for first (and only) element "xmldata" var pNodes = xmldata[0].childNodes ; var np, nn, nv ; var cp, cpn, cn, cv ; var gp, gpn, gn, gv ; for ( var i=0; i 0 ) gv = cv[0].nodeValue ; else gv = "" ; if ( cn == "row" ) x_row = parseInt(gv) ; else if ( cn == "col" ) x_col = parseInt(gv) ; else if ( cn == "rendition" ) x_rendition = parseInt(gv) ; else if ( cn == "graphics" ) x_graphics = parseInt(gv) ; else if ( cn == "flags3" ) x_flags3 = parseInt(gv); else if ( cn == "chr" ) x_chr = gv ; //output += cn + "=" + gv + "\n" ; } setFlash( x_row, x_col, x_chr, x_rendition, x_graphics, x_flags3, vt_reverseVideo ) ; } else if ( nn == "actions" && np.firstChild ) { var x_row = 1; var x_col = 1 ; var x_text = " "; var x_colspan = 1 ; var x_rendition = 0 ; var x_flags3 = 0 ; var x_graphics = 0 ; var x_startrow = 1 ; var x_endrow = 24 ; nv = np.firstChild.nodeName ; // Get array of tags for element "actions" var cNodes = np.childNodes ; for ( var j=0; j 0 ) gv = gpn[0].nodeValue ; else gv = "" ; if ( gn == "row" ) x_row = parseInt(gv) ; else if ( gn == "col" ) x_col = parseInt(gv) ; else if ( gn == "colspan" ) x_colspan = parseInt(gv) ; else if ( gn == "rendition" ) x_rendition = parseInt(gv) ; else if ( gn == "graphics" ) x_graphics = parseInt(gv) ; else if ( gn == "flags3" ) x_flags3 = parseInt(gv); else if ( gn == "text" ) x_text = gv ; //output += gn + "=" + gv + "\n" ; } // Call updatecell updatecell ( x_row, x_col, x_colspan, x_rendition, x_flags3, vt_reverseVideo, x_graphics, x_text ) ; } else if ( cn == "scrollup" || cn == "scrolldown" ) { cpn = cp.childNodes ; for ( var k=0; k 0 ) gv = gpn[0].nodeValue ; else gv = "" ; if ( gn == "startrow" ) x_startrow = parseInt(gv) ; else if ( gn == "endrow" ) x_endrow = parseInt(gv) ; //alert ( gn + "=" + gv ) ; } if ( cn == "scrollup" ) scrollup ( x_startrow, x_endrow ) ; else scrolldown ( x_startrow, x_endrow ) ; } } } } //alert ( output ) ; startFlash() ; } function vtDisconnect() { httpGetRequest.abort() ; httpDisRequest = new HttpXMLRequest( '','' ) ; httpDisRequest.loadXMLDocSync( "POST","/DISCONNECT_VT","",5000) ; } ///////////////////////////////////////////////////////////// // // PAGING Interfaces // ////////////////////////////////////////////////////////////// function page( pageval, lineval ) { child = vt_page.firstChild ; pn = document.createTextNode ( pageval ) ; vt_page.replaceChild( pn, child ) ; child = vt_line.firstChild ; ln = document.createTextNode ( lineval ) ; vt_line.replaceChild( ln, child ) ; // Point to next available request object var nextRequest = httpCmdReqArray[requestIndex++] ; if ( requestIndex == MAX_REQUESTS ) requestIndex = 0 ; // Issue new request var data = //""+ "" + pageval + "" + lineval + "" ; // We do care about the reply, we'll give it 3 seconds nextRequest.loadXMLDocAsync( "POST","/PAGE_VT", data, 3000 ) ; } function do_current_page(evt) { if ( vt_nopaging ) return ; vt_pageNo = 0 ; vt_lineNo = 1 ; page ( vt_pageNo, vt_lineNo ) ; } function do_home_page(evt) { if ( vt_nopaging ) return ; vt_pageNo = 1 ; vt_lineNo = 1 ; page ( vt_pageNo, vt_lineNo ) ; } function disable_paging(evt) { vt_nopaging = true ; } function enable_paging(evt) { vt_nopaging = false ; } function do_prev_page(evt) { if ( vt_nopaging ) return ; if ( vt_pageNo > 1 ) vt_pageNo-- ; vt_lineNo = 1 ; page ( vt_pageNo, vt_lineNo ) ; } function do_next_page(evt) { if ( vt_nopaging ) return ; vt_pageNo++ ; vt_lineNo = 1 ; page ( vt_pageNo, vt_lineNo ) ; } function do_scroll_up(evt) { if ( vt_nopaging ) return ; if ( vt_lineNo > 1 ) vt_lineNo-- ; page ( vt_pageNo, vt_lineNo ) ; } function do_scroll_down(evt) { if ( vt_nopaging ) return ; if ( vt_lineNo < 23 ) vt_lineNo++ ; page ( vt_pageNo, vt_lineNo ) ; } /* function do_keypad1() { } function do_keypad2() { } */ function do_rv() { vt_reverseVideo = !vt_reverseVideo ; //alert ( "reverse video is now "+vt_reverseVideo ) ; } function do_insert(evt) { vt_insertMode = !vt_insertMode ; } function do_checkup(evt) { // Make sure keyboard handlers are working setHandlers() ; // Make sure the "Get" requests are working if ( httpGet1Request.getReadyState() == 0 && httpGet2Request.getReadyState() == 0 ) issueGet() ; // Make sure the "Put" requests are working if ( httpPut1Request.getReadyState() == 0 && httpPut2Request.getReadyState() == 0 && keyBuf != "" ) issueKey() ; //vtIntervalID = window.setInterval("do_checkup()",2000) ; } ///////////////////////////////////////////////////////////// // // Initialization // ////////////////////////////////////////////////////////////// function initAjaxVT() { // Create vt_frame and vt_table createVT() ; //alert ( "VT AJAX" ) ; var vt_ajax = getRawObject('vt_ajax') ; child = vt_ajax.firstChild ; if ( child ) vt_ajax.replaceChild( vt_frame, child ) ; else vt_ajax.appendChild( vt_frame ) ; // VT interface included vt_input = getRawObject('vt_input') ; vt_table = getRawObject('vt_table') ; vt_bytesIn = getRawObject('vt_bytesIn') ; vt_bytesOut = getRawObject('vt_bytesOut') ; vt_page = getRawObject('vt_page'); vt_line = getRawObject('vt_line'); setHandlers() ; cacheTableCells() ; for ( var i=0; i