Free 14-Day Evaluations    
Product Downloads    

Sign in     


DESKTOP MOBILE DOWNLOAD PURCHASE SUPPORT INFO COMPANY
 Home  >>  Documentation  >>  TinyTERM AX for Web  >>  UNIX Sample HTML Page

TinyTERM AX UNIX for Web Sample HTML Page

The following is a sample HTML page for loading TinyTERM AX UNIX for Web. It will need to be edited for use in a specific environment, as described in the in-line documentation.

TinyTERM AX 3270 Sample HTML Page TinyTERM AX 5250 Sample HTML Page TinyTERM AX UNIX Sample HTML Page

<html> <title>TinyTERM AX UNIX</title> <body onload="setup()"> <!-- TinyTERM AX UNIX for Web HTML Configuration File v4.8.1_5595 - 07-12-2013 For questions or support, see http://www.centurysoftware.com/help/ax or email support@censoft.com, phone +1 801 268 3088x6 This file provides the preset connection settings used for running TinyTERM AX for Web in Internet Explorer. It must be edited by the web administrator and sets emulator type, network protocol used, optional automatic connecting, and whether hostname/username/password are preset or entered before connection. There are three sections for configuration: 1. Form Input HTML Section for entering hostname, username and password before connecting. 2. Object HTML Section for entering TinyTERM AX ClassID and position (changes each version) 3. Script Settings Section for entering license key, emulator type, connection protocol and other settings. --> <!-- Form Input HTML Section This form requests hostname, username and password. The username and password are only used for SSH connections, and should be removed for non-SSH connections. If the host input field is removed below, the host specified in the Script Settings Section will be used and an automatic connection will occur. --> <form name='kg'> <font face="Arial"><bold> <table> <tr> <td align=right>Connect To:</td> <td> <input type='text' name='host' id='host' size='40' maxlength='80' value='' /> </td> <td> <input type='button' id="submit" value='Connect' name='submit' onclick="conndisconn()"> </td> <td> <div id='status'><font color=red>Disconnected</font> </div> </td> </tr> <tr> <td align=right>SSH Username:</td> <td> <input type='text' name='username' id='username' size='30' maxlength='80' value='' /> </td> </tr> <tr> <td align=right>SSH Password:</td> <td> <input type='text' name='password' id='password' size='30' maxlength='80' value='' /> </td> </tr> </table> </bold></font> </form> <!-- Object HTML Section The CLSID below must be updated whenever the TinyTERM AX for Web .CAB file is updated. This is because the browser will cache all CLSID objects and would not retrieve the updated ActiveX control stored in the .CAB file. The size of the emulation window can be changed by changing the align parameter below. --> <object id="cente" classid="CLSID:6241D543-a3fc-11d1-a554-0080c8634064" codebase="ttaxunix.cab#version=1,0,0,0" align="center" border="0" width="100%" height="80%"> </object> <!-- Script Settings Section This section must be modified by the web administrator to set the terminal emulation type, connection protocol, and other pre-configured parameters for the browser emulation session. --> <script type='text/javascript' language='javascript'> function setup() { // Change the company name and license key below with values provided you // by Century Software in the line below. // This will also need to be changed on each version number change. AddLicenseKey("Company Name", "ABCDEF-12345-GHIJK-67890-LMNOP"); // Protocol for connection type (telnet, SSH or SSL/TLS) // ConnectionType is 0 is for telnet, 5 for SSH and 4 is for SSL/TLS cente.connectionType = 0; // Fill in the hostname between the quotes in the next line to force an immediate connection. // If left blank, the hostname will be pulled from the Form Input HTML Section above. cente.node = ""; // Set the network port to connect to. Leave at 0 to automatically // select based on the connectionType set above. cente.netport = 0; /* Set the TinyTERM AX UNIX terminal emulation type: 0 ADM1 1 ANSI 2 AT386 3 IBM 3101 4 PCTERM 5 SCOANSI 6 TTY 7 TV912 8 TV925 9 TV950 10 VT100 11 Linux 12 VT220 13 VT220-7 14 VT320 15 VT320-7 16 VT420 17 Wyse 50 18 Wyse 60 19 Wyse 60-25 20 IBM 3151 21 IBM 3151-25 28 ADDS ViewPoint 29 WYCOL */ cente.Emulation = 12; // SSH-specific settings. // Set the username in the quotes below. If left blank, the username // will be pulled from the Form Input HTML Section above. cente.username = ""; // Set the password in the quotes below. If left blank, the password // will be pulled from the Form Input HTML Section above. cente.password = ""; // The SSHSetup() function sets up some SSH settings that aren't commonly changed. SSHSetup(); // End of SSH-specific settings // Load the keyboard map. Only Default is available in this version. LoadKeyboard("Default"); /* Load the desired codepage. Available values are: STD 437 MS-DOS Latin US 1252 Windows Latin 1 (ANSI) (FONT) 1252 Windows Latin 1 (ANSI) (Polish) Czech Output 8859-2 Latin II Easter European 7-bit HP Roman 8 HP Roman 9 Latin-Greek 7-bit Polish Output 8859-2 Latin II STD 1250 Windows Latin 2 (Central Europe) STD 1251 Windows Cyrillic (Slavic) STD 1252 Windows Latin 1 (ANSI) STD 1252 Windows Latin 1 (ANSI)(French) STD 1252 Windows Latin 1 (ANSI)(German) STD 1252 Windows Latin 1 (ANSI)(United Kingdom) STD 1253 Windows Greek STD 1254 Windows Turkish STD 210 PC Greek (437G) STD 220 PC Spanish (National Spain) STD 737 PC Greek STD 850 MS-DOS Latin 1 STD 852 MS-DOS Latin 2 STD 855 PC Cyrillic STD 857 PC Modern Turkish STD 858 MS-DOS Latin 1 STD 860 MS-DOS Portuguese STD 861 PC Icelandic STD 863 MS-DOS French Canada STD 865 MS-DOS Nordic STD 866 PC Cyrillic STD DEC Cyrillic STD DEC Greek 1287 STD DEC ISO Latin NR 1 Right STD DEC Multinational Left STD DEC Multinational Right STD DEC Supplemental STD DEC Turkish 128 STD ISO 8859-1 Latin I STD ISO 8859-1 Latin II STD ISO 8859-15 Latin 9 STD ISO 8859-5 Latin/Cyrillic STD ISO 8859-7 Greek STD ISO 8859-9 Turkish STD ISO-IEC 8859-5 Cyrillic STD Polish CSK STD Polish Mazovia STD Polish Police STD Russian Alternative STD Russian ANSI STD Russian KOI-8 */ LoadCodepage("STD 437 MS-DOS Latin US"); // This will display a startup banner with version number on startup. // Comment out to leave the screen blank. DisplayBanner(); // This will customize the key mappings. AddKeyMap(); // This sets up attribute display. SetDefaultAttributes(); // The following will pre-fill in the HTML form using any hardcoded values you changed above. // If you don't want this behavior, comment out the next line FillHTMLForm(); // If the host HTML form element is missing, auto-connect if(!document.getElementById("host")) connect(); // This command checks to see if TinyTERM is disconnected when the window is closed. // If TinyTERM is connected, a warning dialog pops up. window.onbeforeunload = checkForClose; } function checkForClose(e) { if(cente.IsConnected) { var msg = "This action will cause you to be disconnected from the host"; return msg; } } // This function sets some not-so-commonly used SSH settings. function SSHSetup() { // Available SSH cypher types // 0 - none // 1 - DES // 2 - 3DES (default) // 3 - Blowfish cente.SSHCypherType = 3; // Range 0 (none) to 9 (maximum) cente.SSHCompressionLevel = 9; // Specify an RSA or DSA public key file here cente.SSHPubKey = ""; // 0 is any, 1 is SSH2 only cente.MajorSSHVersion = 0; // If uncommented, an RSA or DSA key may be entered here as a plain-text string // Do not include any line breaks in the key // cente.SSHPubKey = "ssh-rsa AAAAB3NzaC1yc2EAA etc." } // This function configures custom key mappings. function AddKeyMap() { // This line activates Alt keys in the terminal emulator, such as Alt-F1. // Comment out to use Alt keys for Internet Explorer. cente.useAlt = 1; // If uncommented, this line maps the F12 function key to send the string ABCDE. // cente.AddKeyMapping("<F12>=ABCDE"); // The same format may be used to map most other keyboard keys. // The keyname may be any of the following when placed in in angle brackets <> : // F1 – F12 (Function keys 1 – 12) // AF1 – AF12 (Alt-Function keys: hold the Alt key and hit F1 – F12) // SF1 – SF12 (Shift-Function keys) // CF1 - CF12 (Ctrl-Function keys) // CSF1 – CSF12 (Ctrl-Shift-Function keys) // ALTA – ALTZ (Alt keys a-z, Windows may override) // KP0 – KP9, KP+, … (keypad number and symbol keys, NumLock must be on) // UP, DOWN, LEFT, RIGHT (Arrow keys) // HOME, END, PGUP, PGDN (Named keys) } // // END OF NORMALLY CHANGED SETTINGS // Please do not change the code below without a thorough understanding // function LoadKeyboard(section) { // The following will load the specified section from keyboard.dat in the current directory // The blank first parameter sets a special key handling mode for browsers cente.LoadKeyboard("", section + ".keyboard"); } function LoadCodepage(section) { // Load code page from specified section in codepage.dat in the current directory cente.SetEmInCP("",section); cente.SetEmOutCP("",section); cente.SetKbdCP("",section); // These three lines add the TinyTERM fonts for proper character display cente.AddFont("termcs1","","STD TERM TCS1",0); cente.AddFont("termcs2","","STD TERM TCS2",1); cente.AddFont("termcs3","","STD TERM TCS3",2); } var licenseStatus; function AddLicenseKey(regName, licenseKey) { var ret; ret = cente.AddLicenseKey(regName, licenseKey); switch(ret) { case 0x04: licenseStatus = "[EVAL EXPIRED]"; break; case 0x20: licenseStatus = "[LICENSE NOT FOR THIS VERSION]"; break; case 0x08: licenseStatus = "[INVALID LICENSE KEY]"; break; case 0x03: licenseStatus = "[EVAL WILL EXPIRE SOON]"; break; case 0x01: // License OK licenseStatus = ""; break; default: licenseStatus = "[UNLICENSED]"; break; } } function DisplayBanner() { cente.displayNL("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" + "TinyTERM AX UNIX for Web v" + cente.version); cente.display(licenseStatus); } function connect() { var hostname, username, password, button; var ret; hostname = cente.node; username = cente.username; password = cente.password; if(hostname == "" && document.getElementById("host")) hostname = document.getElementById("host").value; if(username == "" && document.getElementById("username")) username = document.getElementById("username").value; if(password == "" && document.getElementById("password")) password = document.getElementById("password").value; button = document.getElementById("submit"); if(hostname == "") { alert("Please enter a hostname"); return; } cente.node = hostname; // No proxy cente.ProxyType = 0; // If netport is set to 0, automatically select the network port. // Set to 22 for SSH, 23 for telnet, 995 for SSL if(cente.netport == 0) { if(cente.ConnectionType == 5) cente.netport = 22; // SSH else if(cente.ConnectionType == 0) cente.netport = 23; // Telnet else cente.netport = 995; // SSL } // As with hostname, username and password can be explicitly specified as quoted strings cente.username = username; cente.password = password; ret = cente.connect(); setStatus("<font color=blue>Connecting to " + hostname + "</font>"); cente.focus(); button.value = "Disconnect"; } // Called when the Connect/Disconnect button is pressed function conndisconn() { if(cente.IsConnected) disconnect(); else connect(); } function disconnect() { if(cente.IsConnected) { cente.Disconnect(); } } function setStatus(msg) { document.getElementById("status").innerHTML = msg; } // Fills in the HTML form from the current te control settings function FillHTMLForm() { if(cente.node != "" && document.getElementById("host")) { document.getElementById("host").value = cente.node; } if(cente.username != "" && document.getElementById("username")) { document.getElementById("username").value = cente.node; } if(cente.password != "" && document.getElementById("password")) { document.getElementById("password").value = cente.node; } } function SetDefaultAttributes() { var i; // These settings initialize text attributes: BOLD, REVERSE, BLINK, UNDERLINE // as well as all the various combinations of them. // Changing these settings is not recommended. cente.SetTextAttribute(0,0); cente.SetTextAttribute(1,2097152); cente.SetTextAttribute(2,524288); cente.SetTextAttribute(3,262144); cente.SetTextAttribute(4,65536); cente.SetTextAttribute(5,2621440); cente.SetTextAttribute(6,2359296); cente.SetTextAttribute(7,2162688); cente.SetTextAttribute(8,786432); cente.SetTextAttribute(9,589824); cente.SetTextAttribute(10,327680); cente.SetTextAttribute(11,2883584); cente.SetTextAttribute(12,2686976); cente.SetTextAttribute(13,2424832); cente.SetTextAttribute(14,851968); cente.SetTextAttribute(15,2949120); // The following block sets the colors for each attribute, starting with the default colors. // The available foreground colors (cente.SetFGColor) are: // 1 Black // 2 Blue // 3 Green // 4 Cyan // 5 Red // 6 Magenta // 7 Brown // 8 White // 9 Light Gray // 10 Light Blue // 11 Light Green // 12 Light Cyan // 13 Light Red // 14 Light Magenta // 15 Yellow // 16 Light White // Backgrounds colors (cente.SetBGColor) are limited to numbers 1-8. cente.SetFGColor(0,15); cente.SetBGColor(0,2); for(i=1; i<16; i++) { cente.SetFGColor(i,0); cente.SetBGColor(i,0); } } </script> <script for="cente" event="EDisconnect()"> // Handles disconnect events. On error, displays a message specifying what failed. var msg; var button; var hostname; hostname = document.getElementById("host").value; if(cente.LastError != 0) { switch(cente.LastError) { case 627: case 628: // Automatically accept fingerprint prompting cente.FingerPrint = hostname; cente.connect(); return; case 614: msg = "Invalid address"; break; case 961: msg = "Login refused by server"; break; case 10060: msg = "Connection timeout"; break; case 10061: msg = "Connection refused"; break; case 10054: msg = "Connection reset by peer"; break; default: msg = "Unknown error connecting"; break; } alert(msg + " (" + cente.LastError + ")"); } setStatus("<font color=red>Disconnected</font>"); button = document.getElementById("submit"); button.value = "Connect"; </script> <script for="cente" event="EConnect()"> // Changes status display to show hostname that's currently connected. var hostname; var button; button = document.getElementById("submit"); button.value = "Disconnect"; hostname = document.getElementById("host").value; setStatus("<font color=green>Connected to " + hostname + "</font>"); </script> </body> </html>
  Copyright © 2024 Century Software, Inc. All Rights Reserved  TERMS OF USE PRIVACY POLICY EULA