2019-10-03 04:08:48 +00:00
|
|
|
/**
|
|
|
|
* ANSItex definitions
|
|
|
|
*/
|
|
|
|
|
2023-12-24 06:44:02 +00:00
|
|
|
/* Load frames from msgbase */
|
|
|
|
const FRAMES_MSG_BASE = 'vtx_data';
|
|
|
|
/* Load frames from files */
|
|
|
|
const FRAMES_MSG_FILES = true;
|
|
|
|
|
2022-04-10 11:09:59 +00:00
|
|
|
/* Unit of cost */
|
2023-12-24 06:44:02 +00:00
|
|
|
const FRAME_COSTUNIT = 'c';
|
2022-04-10 11:09:59 +00:00
|
|
|
|
|
|
|
/** ACTIONS **/
|
|
|
|
|
|
|
|
/* Exit the script */
|
2023-12-24 06:44:02 +00:00
|
|
|
const ACTION_EXIT = 99;
|
2022-04-10 11:09:59 +00:00
|
|
|
/* Reload the current frame */
|
2023-12-24 06:44:02 +00:00
|
|
|
const ACTION_RELOAD = 1;
|
2022-04-10 11:09:59 +00:00
|
|
|
/* Goto a specific frame */
|
2023-12-24 06:44:02 +00:00
|
|
|
const ACTION_GOTO = 2;
|
2022-04-10 11:09:59 +00:00
|
|
|
/* Goto previous frame */
|
2023-12-24 06:44:02 +00:00
|
|
|
const ACTION_BACKUP = 3;
|
2022-04-10 11:09:59 +00:00
|
|
|
/* Goto next frame */
|
2023-12-24 06:44:02 +00:00
|
|
|
const ACTION_NEXT = 4;
|
2022-04-10 11:09:59 +00:00
|
|
|
/* Terminate the session */
|
2023-12-24 06:44:02 +00:00
|
|
|
const ACTION_TERMINATE = 5;
|
2022-04-10 11:09:59 +00:00
|
|
|
/* Submit form contents */
|
2023-12-24 06:44:02 +00:00
|
|
|
const ACTION_SUBMITRF = 6;
|
2022-04-10 11:09:59 +00:00
|
|
|
/* Star command entry */
|
2023-12-24 06:44:02 +00:00
|
|
|
const ACTION_STAR = 7;
|
2022-04-10 11:09:59 +00:00
|
|
|
/* Edit a frame */
|
2023-12-24 06:44:02 +00:00
|
|
|
const ACTION_EDIT = 8;
|
2022-04-10 11:09:59 +00:00
|
|
|
|
|
|
|
/** MODES **/
|
|
|
|
|
|
|
|
/* Typing * command on baseline */
|
2023-12-24 06:44:02 +00:00
|
|
|
const MODE_BL = 1;
|
2022-04-10 11:09:59 +00:00
|
|
|
/* Field Input */
|
2023-12-24 06:44:02 +00:00
|
|
|
const MODE_FIELD = 2;
|
2022-04-10 11:09:59 +00:00
|
|
|
/* Asking if form should be submitted */
|
2023-12-24 06:44:02 +00:00
|
|
|
const MODE_SUBMITRF = 3;
|
2022-04-10 11:09:59 +00:00
|
|
|
/* Response frame not sent */
|
2023-12-24 06:44:02 +00:00
|
|
|
const MODE_RFNOTSENT = 4;
|
2022-04-10 11:09:59 +00:00
|
|
|
/* Response frame sent */
|
2023-12-24 06:44:02 +00:00
|
|
|
const MODE_RFSENT = 5;
|
2022-04-10 11:09:59 +00:00
|
|
|
/* Response frame error */
|
2023-12-24 06:44:02 +00:00
|
|
|
const MODE_RFERROR = 6;
|
2022-04-10 11:09:59 +00:00
|
|
|
|
|
|
|
/** FRAME TYPES **/
|
|
|
|
|
|
|
|
/* Information Frame, requires no response after viewed */
|
2023-12-24 06:44:02 +00:00
|
|
|
const FRAME_TYPE_INFO = 'i';
|
2022-04-10 11:09:59 +00:00
|
|
|
/* Terminate Frame, contents displayed and then carrier dropped */
|
2023-12-24 06:44:02 +00:00
|
|
|
const FRAME_TYPE_TERMINATE = 't';
|
2022-04-10 11:09:59 +00:00
|
|
|
/**
|
|
|
|
* Frame the calls an External Method
|
|
|
|
* Contents indicate the method to be called with arguments
|
|
|
|
*/
|
2023-12-24 06:44:02 +00:00
|
|
|
const FRAME_TYPE_EXTERNAL = 'x';
|
|
|
|
/**
|
|
|
|
* Frame calls a door
|
|
|
|
* Contents indicate the name of the door
|
|
|
|
*/
|
|
|
|
const FRAME_TYPE_DOOR = 'X';
|
|
|
|
/**
|
|
|
|
* Frame renders a BBS from sbbslist
|
|
|
|
* Contents can be:
|
|
|
|
* + preview(bbs) - to show the BBS preview display
|
|
|
|
* + telnet(bbs) - to telgate to the BBS
|
|
|
|
*/
|
|
|
|
const FRAME_TYPE_BBS = 'b';
|
2022-04-10 11:09:59 +00:00
|
|
|
/**
|
|
|
|
* Response frame, input fields are embedded in the frame and after input the
|
|
|
|
* response will be submitted to the Service Provider, or to a method
|
|
|
|
*/
|
2023-12-24 06:44:02 +00:00
|
|
|
const FRAME_TYPE_RESPONSE = 'r';
|
2022-04-10 11:09:59 +00:00
|
|
|
/* Login frame, enables the user to authenticate to the system, or to a CUG */
|
2023-12-24 06:44:02 +00:00
|
|
|
const FRAME_TYPE_LOGIN = 'l';
|
2022-05-01 07:42:19 +00:00
|
|
|
/* Mail template frames - mail templates will have the user's stats for the area passed to render() */
|
2023-12-24 06:44:02 +00:00
|
|
|
const FRAME_TYPE_MAIL_TEMPLATE = 'm';
|
2022-05-01 07:42:19 +00:00
|
|
|
/* Frame is a message */
|
2023-12-24 06:44:02 +00:00
|
|
|
const FRAME_TYPE_MESSAGE = 'M';
|
2022-04-10 11:09:59 +00:00
|
|
|
|
|
|
|
/* Disable *# going backwards for the following frames */
|
2023-12-24 06:44:02 +00:00
|
|
|
const FRAMES_NO_HISTORY = ['980a','98b','981a','982a','983a','998a'];
|
2022-04-10 11:09:59 +00:00
|
|
|
|
|
|
|
/* Frames prefixed with this are owned by the system */
|
2023-12-24 06:44:02 +00:00
|
|
|
const SYSTEM_OWNER = 9;
|
|
|
|
// @todo can we get this from the message base?
|
|
|
|
const SYSTEM_ZONE = 516;
|
|
|
|
|
2022-04-10 11:09:59 +00:00
|
|
|
/* Time to wait for a key press */
|
2023-12-24 06:44:02 +00:00
|
|
|
const INACTIVE_TIMEOUT = 100000;
|
2022-04-10 11:09:59 +00:00
|
|
|
/* Idle time for un-authenticated users */
|
2023-12-24 06:44:02 +00:00
|
|
|
const INACTIVE_NOLOGIN = 30000;
|
2022-04-10 11:09:59 +00:00
|
|
|
/* Idle time for authenticated users */
|
2023-12-24 06:44:02 +00:00
|
|
|
const INACTIVE_LOGIN = 5*60000;
|
2022-04-10 11:09:59 +00:00
|
|
|
|
|
|
|
/* Home Frame */
|
2023-12-24 06:44:02 +00:00
|
|
|
const FRAME_HOME = {frame: 1,index: 'a'};
|
2022-04-10 11:09:59 +00:00
|
|
|
/* Login Frame */
|
2023-12-24 06:44:02 +00:00
|
|
|
const FRAME_LOGIN = {frame: 98,index: 'a'};
|
2022-04-10 11:09:59 +00:00
|
|
|
/* Registration Frame */
|
2023-12-24 06:44:02 +00:00
|
|
|
const FRAME_REGISTER = {frame: 981,index: 'a'};
|
2022-04-10 11:09:59 +00:00
|
|
|
/* SQRL Login */
|
2023-12-24 06:44:02 +00:00
|
|
|
const FRAME_SQRL = {frame: 982,index: 'a'};
|
2022-04-10 11:09:59 +00:00
|
|
|
/* Login Failed */
|
2023-12-24 06:44:02 +00:00
|
|
|
const FRAME_LOGIN_FAILED = {frame: 983,index: 'a'};
|
2022-04-10 11:09:59 +00:00
|
|
|
/* Home page after authentication */
|
2023-12-24 06:44:02 +00:00
|
|
|
const FRAME_HOME_AUTH = {frame: 98,index: 'b'};
|
2022-04-10 11:09:59 +00:00
|
|
|
/* Home page for initial connection */
|
2023-12-24 06:44:02 +00:00
|
|
|
const FRAME_HOME_CONNECT = {frame: 980,index: 'a'};
|
|
|
|
const FRAME_SYSTEM_ERROR = {frame: 998,index: 'a'};
|
2020-11-01 10:55:32 +00:00
|
|
|
|
2022-04-11 11:44:01 +00:00
|
|
|
/* Attributes saved/loaded from files */
|
2023-12-24 06:44:02 +00:00
|
|
|
const FRAME_SAVE_ATTRS = [
|
|
|
|
'content', // raw source content of a frame (as stored in vtx/tex files)
|
|
|
|
'cost', // integer, frame cost
|
|
|
|
'dynamic_fields', // array of fields
|
|
|
|
'frame', // Page ID,
|
|
|
|
'index', // Page index,
|
|
|
|
'input_fields', // array of fields
|
|
|
|
'isAccessible', // boolean
|
|
|
|
'isPublic', // boolean
|
|
|
|
'key', // array, representing our key actions
|
|
|
|
'type', // frame type
|
|
|
|
'version', // frame version (1)
|
|
|
|
'window' // processed frame data
|
|
|
|
];
|
2022-04-11 11:44:01 +00:00
|
|
|
|
2022-05-01 07:42:19 +00:00
|
|
|
/* The page that has our echomail area reading template */
|
2023-12-25 22:17:19 +00:00
|
|
|
const MAIL_TEMPLATE_FRAME = {frame: 199,index: 'a'};
|
2022-05-01 07:42:19 +00:00
|
|
|
|
|
|
|
/* The page that has our echomail area summary template */
|
2023-12-25 22:17:19 +00:00
|
|
|
const MAIL_TEMPLATE_AREA_SUMMARY = {frame: 198,index: 'a'};
|
2022-05-01 07:42:19 +00:00
|
|
|
|
|
|
|
// The maximum size of embedded dynamic fields in frames
|
2023-12-24 06:44:02 +00:00
|
|
|
const DYNAMIC_FIELD_SIZE_MAX = 50;
|
2022-05-01 07:42:19 +00:00
|
|
|
|
2022-12-09 06:19:33 +00:00
|
|
|
/** ESCAPE CODES **/
|
2023-12-24 06:44:02 +00:00
|
|
|
const ESC = '\x1b';
|