Fixes for viewdata input redisplay and bottom line clearing, viewdata input_fields and dynamic_fields added *98#
This commit is contained in:
parent
e72ffdc8a4
commit
d3c8b4c429
@ -2,16 +2,16 @@
|
||||
Installation nodes.
|
||||
|
||||
1. For a new installation - make sure you have logged in first and created your sysop user.
|
||||
- No to creating guest account
|
||||
- No to creating guest account (or set it to a password so it isnt used - it asks questions during login about terminal configuration)
|
||||
2. Setup files
|
||||
- Replace answer.msg in text/ (or make a zero byte file)
|
||||
- in mods/ ln -sf ansitex/main.js login.js
|
||||
- in mods/ ln -sf ansitex/logon.js
|
||||
- in mods/ ln -sf ansitex/main.js ansitex.js
|
||||
- in mods/ baja ansitex/ansitex.src && mv ansitex/ansitex.bin .
|
||||
- in mods/ baja ansitex/ansitex.src && mv ansitex/ansitex.bin . (NOT REQUIRED FROM 3.20a)
|
||||
3 - Create Shell: SCFG->Command Shells->Ansitex (optionally limit to FLAGS, but requires (requirement string) ANSI)
|
||||
- logon.js will force users to ansitex shell - to make a ini config setting for this
|
||||
- Optionally System -> New User Values -> Shells ->Ansitex
|
||||
- Optionally Edit users and change their shell.
|
||||
- Optionally System -> New User Values -> Shells ->Ansitex (NOT REQUIRED with login.js in place)
|
||||
- Optionally Edit users and change their shell. (NOT REQUIRED with logon.js in place)
|
||||
4 - Turn off sysop password required for sysop login
|
||||
- SCFG -> Toggle Options -> Require Sys Pass During Login -> No
|
||||
|
@ -424,15 +424,18 @@ function MsgArea() {
|
||||
try {
|
||||
if (msgbase.open()) {
|
||||
var raw = msgbase.get_msg_body(false,id,false,false,true,true);
|
||||
//log(LOG_DEBUG,'RAW:'+JSON.stringify(raw));
|
||||
|
||||
// Our messages are terminated with \r=== EOF
|
||||
// Our messages are terminated with FRAMES_EOF_MARKER
|
||||
var regex = new RegExp('^(.*)'+FRAMES_EOF_MARKER);
|
||||
//log(LOG_DEBUG,'MARKER:'+regex.test(raw));
|
||||
if (! regex.test(raw))
|
||||
return undefined;
|
||||
|
||||
var regex = new RegExp(FRAMES_EOF_MARKER+'[.\\s\\S]*$');
|
||||
|
||||
var content = JSON.parse(LZString.decompressFromBase64(raw.replace(regex,'')));
|
||||
//log(LOG_DEBUG,'CONTENT:'+JSON.stringify(content));
|
||||
msgbase.close();
|
||||
|
||||
} else {
|
||||
|
23
load/page.js
23
load/page.js
@ -492,15 +492,18 @@ function Page(debug) {
|
||||
// Insert our *_field data (if it is set)
|
||||
function insert_fields(fields,build) {
|
||||
for (var i in fields) {
|
||||
// writeln('- adding:'+fields[i].name+', with value:'+fields[i].value);
|
||||
//log(LOG_DEBUG,'|-- Adding:'+fields[i].name+', with value:'+fields[i].value);
|
||||
|
||||
var content = fields[i].value.split('');
|
||||
|
||||
for (var x=fields[i].x;x<fields[i].x+Math.abs(fields[i].length);x++) {
|
||||
var index = x-fields[i].x;
|
||||
//log(LOG_DEBUG,'|-- i:'+i+', x:'+x+', y:'+fields[i].y);
|
||||
|
||||
if (content[index])
|
||||
build[fields[i].y][x].ch = fields[i].type !== FIELD_PASSWORD ? content[index] : FIELD_PASSWORD_MASK;
|
||||
build[fields[i].y][x].ch = ((fields[i].type !== FIELD_PASSWORD) ? content[index] : FIELD_PASSWORD_MASK);
|
||||
else
|
||||
build[fields[i].y][x].ch = (fields[i].pad ? fields[i].pad : '.');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1241,15 +1244,27 @@ function Page(debug) {
|
||||
break;
|
||||
|
||||
case 2:
|
||||
log(LOG_DEBUG,'|-- Type: '+SESSION_EXT);
|
||||
if ((SESSION_EXT === 'vtx') && contents.dynamic_fields) {
|
||||
log(LOG_DEBUG,'|--- Dynamic Fields: '+contents.dynamic_fields.length);
|
||||
this.dynamic_fields = contents.dynamic_fields;
|
||||
}
|
||||
|
||||
var page = rawtoattrs(contents.content,this.width,this.__window__.body.y,this.__window__.body.x);
|
||||
|
||||
this.__window__.body.__properties__.content = page.content;
|
||||
this.dynamic_fields = page.dynamic_fields;
|
||||
|
||||
if ((SESSION_EXT === 'vtx') && contents.input_fields) {
|
||||
log(LOG_DEBUG, '|--- Input Fields: ' + contents.input_fields.length);
|
||||
this.input_fields = contents.input_fields;
|
||||
|
||||
// Our fields are sorted in x descending order
|
||||
if (page.input_fields.length)
|
||||
} else if (page.input_fields.length)
|
||||
this.input_fields = page.input_fields.sort(function(a,b) { return a.x < b.x ? 1 : -1; });
|
||||
|
||||
if ((SESSION_EXT === 'tex') && page.dynamic_fields)
|
||||
this.dynamic_fields = page.dynamic_fields;
|
||||
|
||||
// Work out frame type
|
||||
this.attrs = contents.attrs;
|
||||
this.cost = contents.cost;
|
||||
|
@ -297,8 +297,8 @@ function rawtoattrs(contents,width,yoffset,xoffset,debug) {
|
||||
// @todo remove the trailing ESC \ to end the field, just use a control code ^B \x02 (Start of Text) and ^C \x03
|
||||
var m = line.match(/^\x1b_(([A-Z]+;[0-9a-z]+)([;]?.+)?)\x1b\\/);
|
||||
if (m !== null) {
|
||||
log(LOG_DEBUG,'Got input field: '+JSON.stringify(m));
|
||||
log(LOG_DEBUG,'ansi:'+JSON.stringify(ansi));
|
||||
log(LOG_DEBUG,'|-- Got input field: '+JSON.stringify(m));
|
||||
//log(LOG_DEBUG,'|-- + ansi:'+JSON.stringify(ansi));
|
||||
// full string that matched
|
||||
match = m.shift();
|
||||
|
||||
@ -356,7 +356,7 @@ function rawtoattrs(contents,width,yoffset,xoffset,debug) {
|
||||
value: '',
|
||||
});
|
||||
|
||||
log(LOG_DEBUG,'input_field:'+JSON.stringify(frame.input_fields.last));
|
||||
log(LOG_DEBUG,'|-- * IF found at ['+x+'x'+y+'], Type: '+fieldtype+', Name: '+field+', Char: '+fieldchar+', Length: '+fieldlen+', Attribute: '+JSON.stringify(ansi));
|
||||
}
|
||||
|
||||
/* parse dynamic value field */
|
||||
|
@ -482,7 +482,7 @@ function SessionProtocol() {
|
||||
|
||||
write_raw(VIEWDATA_HOME+VIEWDATA_UP+msg+
|
||||
((blp > msg.length)
|
||||
? (' '.repeat(blp-msg.length)+(reposition ? VIEWDATA_HOME+VIEWDATA_UP+VIEWDATA_RIGHT.repeat(msg.length) : ''))
|
||||
? (' '.repeat(2+blp-msg.length)+(reposition ? VIEWDATA_HOME+VIEWDATA_UP+VIEWDATA_RIGHT.repeat(msg.length) : ''))
|
||||
: '')
|
||||
);
|
||||
|
||||
@ -542,10 +542,10 @@ function SessionProtocol() {
|
||||
write_raw(VIEWDATA_HOME);
|
||||
|
||||
if (x > 0)
|
||||
write_raw(VIEWDATA_RIGHT.repeat(x));
|
||||
write_raw(VIEWDATA_RIGHT.repeat(x-1));
|
||||
|
||||
if (y > 0)
|
||||
write_raw(VIEWDATA_DOWN.repeat(y));
|
||||
write_raw(VIEWDATA_DOWN.repeat(y-1));
|
||||
}
|
||||
|
||||
this.strlen = function(str) {
|
||||
|
@ -1 +0,0 @@
|
||||
{"version":1,"frame":98,"index":"a","owner":9,"cost":0,"content":"G1swbSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIBtbMzFt2sQbWzFt3BtbMDszMm3axBtbMW3cG1swOzM0bdrEG1sxbdwbWzA7MzZtIBtbMTszM23fG1swbSAbWzMwOzQ3bdrC3NrE3Nog3CAbWzM3OzQwbQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgG1sxOzMxbbMbWzA7MzFt39sbWzE7MzJtsxtbMDszNm0gG1szMm3bG1sxOzM0bS5cG1swOzM0bdwbWzMzbd4bWzFt2xtbMG0gG1szMDs0N20gsyDDX9za39wgG1szNzs0MG0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIBtbMTszMG3ExMTExMTExMTExMQbWzA7MzA7NDdt3Nzc3Nzc3Nzc3BtbMzc7NDBtDQoNCg0KDQoNCg0KDQoNCg0KDQogICAgICAgICAbWzFtLiAgICAgLiAgIBtbMzBtsxtbMG0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAbWzE7MzBtsxtbMG0NCiAgICAgICAbWzFt2r+/wr/avyC/2r8bWzBtIBtbMTszMG2zG1swbSAbWzE7MzFtVVNFUjobWzBtIBtbMW0bX1VTRVI7MjV0O/kbXBtbMG0gICAgICAgICAgICAgICAgG1sxOzMwbbMbWzBtDQogICAgICAgwL+zs7OzsyCzs7MgG1sxOzMwbbMbWzBtICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgG1sxOzMwbbMbWzBtDQogICAgICAgG1sxOzMwbcDZ2cG02dkbWzM3bSAbWzMwbdnZ2RtbMzdtIBtbMzBtsxtbMG0gG1sxOzMxbVBBU1M6G1swbSAbWzFtG19QQVNTOzQwcDv5G1wbWzBtIBtbMTszMG2zG1swbQ0KICAgICAgICAgIBtbMTszMG3E2RtbMG0gICAgICAgG1sxOzMwbbMbWzBtICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgG1sxOzMwbbMbWzBtDQoNCg0KICAgICAgICAgICAgIBtbMTszMG1UbyByZWdpc3RlciBhbiBhY2NvdW50IGVudGVyG1swbSAbWzFtTkVXG1swbSAbWzE7MzBtZm9yIHRoZSB1c2VyIG5hbWUbWzBtDQogICAgICAgICAgICAgICAgG1sxOzMwbVVzZRtbMG0gG1sxOzMybSoqG1swbSAbWzE7MzBtdG8gY2xlYXIgeW91ciBpbnB1dBtbMG0gG1sxOzMybSowMBtbMG0gG1sxOzMwbXRvIHN0YXJ0IGFnYWluG1swbQ0K","isPublic":1,"isAccessible":1,"type":"l","key":[null,"login",null,null,null,null,null,null,null,null],"date":"2020-07-08T05:17:35.174Z"}
|
21
text/tex/98a.ans
Normal file
21
text/tex/98a.ans
Normal file
@ -0,0 +1,21 @@
|
||||
[0m [31mÚÄ[1mÜ[0;32mÚÄ[1mÜ[0;34mÚÄ[1mÜ[0;36m [1;33mß[0m [30;47mÚÂÜÚÄÜÚ Ü [37;40m
|
||||
[1;31m³[0;31mßÛ[1;32m³[0;36m [32mÛ[1;34m.\[0;34mÜ[33mÞ[1mÛ[0m [30;47m ³ Ã_ÜÚßÜ [37;40m
|
||||
[1;30mÄÄÄÄÄÄÄÄÄÄÄÄ[0;30;47mÜÜÜÜÜÜÜÜÜÜ[37;40m
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[1m. . [30m³[0m [1;30m³[0m
|
||||
[1mÚ¿¿Â¿Ú¿ ¿Ú¿[0m [1;30m³[0m [1;31mUSER:[0m [1m_USER;25t;ù\[0m [1;30m³[0m
|
||||
À¿³³³³³ ³³³ [1;30m³[0m [1;30m³[0m
|
||||
[1;30mÀÙÙÁ´ÙÙ[37m [30mÙÙÙ[37m [30m³[0m [1;31mPASS:[0m [1m_PASS;40p;ù\[0m [1;30m³[0m
|
||||
[1;30mÄÙ[0m [1;30m³[0m [1;30m³[0m
|
||||
|
||||
|
||||
[1;30mTo register an account enter[0m [1mNEW[0m [1;30mfor the user name[0m
|
||||
[1;30mUse[0m [1;32m**[0m [1;30mto clear your input[0m [1;32m*00[0m [1;30mto start again[0m
|
@ -1 +0,0 @@
|
||||
{"version":1,"frame":98,"index":"a","owner":9,"cost":0,"content":"ESxsEnxsFHwsEywXN2t/IzM3ayM1ICAgICAgICAgIAIwMDAxMDAwMRF/axJ/ahQvfBN/FzVobyA8PSQsNQcgICAgICAgICAgICAgICAgICARLy4SLyoULC8TLxd1cHpwcXV6cDUgICAgICAgICAgICAgICAgICAgIFZpZGVvdGV4ICAgICAgICAgICAgICAgICAgICAgIA1TaWduIEluICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgAVVzZXIHLi4uLi4uLi4uLi4uLi4uICAgICAgICAgICAgICAgICAgIAFQYXNzBy4uLi4uLi4uLi4uLi4uLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFbnRlcgJORVcHdG8gcmVnaXN0ZXIgbmV3IGFjY291bnQgICAgICAgUHJlc3MCKioHdG8gY2xlYXIgeW91ciBpbnB1dCAgICAgICAgICAgIFByZXNzAiowMAd0byBzdGFydCBhZ2Fpbgo=","isPublic":1,"isAccessible":1,"type":"l","key":[null,"login",null,null,null,null,null,null,null,null],"input_fields": [{"type":"t","length":15,"char":".","name":"USER","y":10,"x":15,"attribute":{},"value":""},{"type":"p","length":15,"char":".","name":"PASS","y":11,"x":15,"attribute":{},"value":""}],"date":"2020-07-08T05:17:35.174Z"}
|
1
text/vtx/98a.bin
Normal file
1
text/vtx/98a.bin
Normal file
@ -0,0 +1 @@
|
||||
,l|l|,,7k#37k#5 00010001kj/|5ho <=$,5 /./*,//upzpquzp5 Videotex
Sign In User............... Pass............... EnterNEWto register new account Press**to clear your input Press*00to start again
|
@ -1,17 +1,31 @@
|
||||
load('ansitex/load/page.js');
|
||||
load('ansitex/load/funcs.js');
|
||||
load('ansitex/load/session/ansitex.js');
|
||||
load('lz-string.js');
|
||||
|
||||
if (argv.length !== 1) {
|
||||
writeln('ERROR: Need a frame ID');
|
||||
if ((argv.length > 2) || (argv.length < 1)) {
|
||||
writeln('ERROR: Need a frame ID and type');
|
||||
exit(1);
|
||||
|
||||
} else {
|
||||
writeln('Showing frame:'+argv[0]);
|
||||
}
|
||||
|
||||
const SESSION_EXT = 'tex';
|
||||
var SESSION_EXT;
|
||||
|
||||
switch (argv[1]) {
|
||||
case 'TEX':
|
||||
case 'tex':
|
||||
SESSION_EXT = 'tex';
|
||||
load('ansitex/load/session/ansitex.js');
|
||||
break;
|
||||
|
||||
case 'VTX':
|
||||
case 'vtx':
|
||||
default:
|
||||
load('ansitex/load/session/viewdata.js');
|
||||
SESSION_EXT = 'vtx';
|
||||
break;
|
||||
}
|
||||
|
||||
var p = new Page();
|
||||
var po = new PageObject(argv[0]);
|
||||
|
Loading…
Reference in New Issue
Block a user