Free 14-Day Evaluations    
Product Downloads    

Sign in     

 Home  >>  Documentation  >>  TinyTERM AX for Web  >>  3270 Sample HTML Page

TinyTERM AX 3270 for Web Sample HTML Page

The following is a sample HTML page for loading TinyTERM AX 3270 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 3270</title> <body onload="setup()"> <!-- TinyTERM AX 3270 for Web HTML Configuration File v4.8.1_5595 - 07-12-2013 For questions or support, see or email, 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> </table> </bold></font> </form> <!-- The following item puts a Print Screen button and color controls just above the TE control --> <div id="print_color_form" style="height: 55px"> <input type='button' id="print" value='Print Screen' name='print' onclick="PrintScreen()"> <select id="attribute"></select> Text: <select id="foregroundcolor" name="foregroundColor"></select> Background: <select id="backgroundcolor" name="backgroundColor"></select> </div> <script type="text/javascript" language="javascript" src="jquery-1.10.1.min.js"></script> <script type="text/javascript" language="javascript" src="jquery.colourPicker.js"></script> <script type="text/javascript" language="javascript" src="json3.min.js"></script> <script type="text/javascript" language="javascript" src="century-local-settings.js"></script> <link href="jquery.colourPicker.css" rel="stylesheet"> <!-- 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:B80CF68E-58A9-11D2-8006-444553540000" codebase=",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 or SSL/TLS) // ConnectionType is 0 is for telnet 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 3270 terminal emulation type: // 23 IBM 3278-2 (24x80) // 24 IBM 3278-3 (32x80) // 25 IBM 3278-4 (43x80) // 26 IBM 3278-5 (27x132) cente.Emulation = 23; // Load the keyboard map. Available values are: // Default // Reflection // PCOMM LoadKeyboard("Default"); // Load the codepage map. Only Default is available in this version. LoadCodepage("Default"); // This will customize the key mappings. AddKeyMap(); // This will display a startup banner with version number on startup. // Comment out to leave the screen blank. DisplayBanner(); // 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; // If uncommented, this function changes certain IBM identifier characters. // The first argument is the opening delimiter for DBCS characters. // The second argument is the closing delimiter for DBCS characters. // The third argument is the fill character for blanked fields, such as passwords. // cente.SetIBMChars(" "," ","*"); // This command loads the color settings and saves them for the individual user. CenturyLoadLocalSettings(); } function checkForClose(e) { if(cente.IsConnected) { var msg = "This action will cause you to be disconnected from the host"; return msg; } } // 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; // This line maps Ctrl-W to the paste-continue function. // All values available for the Paste() method are: // 0x00 Insert characters as if typed from keyboard. // 0x01 Continue to paste existing data as long as input fields permit. // 0x02 Stop paste at end of current field. // 0x04 Newline advances to next field and continues paste. Overrides 0x02 if set. // 0x08 Allow cursor to wrap to top of screen to continue paste. // These values are additive, so that 0x05 combines 0x04 and 0x01 behaviors // Also, right-clicking the emulator window provides a Copy/Paste menu. // That paste is equivalent to value 0x00. cente.AddKeyMapping("<^W>=<COMMAND>cente.paste(0x05);"); // 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) // // The key value after the equals sign = can be a text string, a TinyTERM script command as seen above, // or a TN3270 key value in angle brackets <> : // 8 Backspace // 9 Tab // 13 Enter // 276 Up // 277 Down // 278 Right // 279 Left // 280 Home // 300 Insert // 301 Delete // 1120-1143 PF1 to PF24 // 1144-1146 PA1 to PA3 // 1147 Back Tab // 1148 Clear // 1149 Erase Input // 1150 Erase End of Field // 1151 Attn // 1153 New Line // 1162 Field Mark // 1163 Dup } // // 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 + ".3270keyboard"); } function LoadCodepage(section) { // 3270 codepage remapping not yet available } function PrintScreen() { // The following will print the contents of the emulator screen // It uses the default print settings in Internet Explorer cente.PrintScreen(); } 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 3270 for Web v" + cente.version); cente.display(licenseStatus); } function connect() { var hostname, button; var ret; hostname = cente.node; if(hostname == "" && document.getElementById("host")) hostname = document.getElementById("host").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 23 for telnet, 995 for SSL if(cente.netport == 0) { if(cente.ConnectionType == 0) cente.netport = 23; // Telnet else cente.netport = 995; // SSL } 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; } } </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 © 2023 Century Software, Inc. All Rights Reserved  TERMS OF USE PRIVACY POLICY EULA