New page/window now working

This commit is contained in:
2023-12-27 22:24:20 +11:00
parent 7b34decb49
commit d9b056c5cd
8 changed files with 188 additions and 235 deletions

View File

@@ -371,7 +371,7 @@ function rawtoattrs(contents,width,yoffset,xoffset,debug) {
// We are interested in our field match
var df = m.shift().split(';');
log(LOG_DEBUG,'- DF found at ['+x+'x'+y+'], Field: '+df[0]+', Length: '+df[1]+', Pad:'+df[2]);
log(LOG_DEBUG,'|--* DF found at ['+x+'x'+y+'], Field: '+df[0]+', Length: '+df[1]+', Pad:'+df[2]);
// If we are padding our field with a char, we need to add that back to line
// @todo validate if this goes beyond our width (and if scrolling not enabled)
line = (df[2] ? df[2] : '_').repeat(Math.abs(df[1]))+line;

View File

@@ -6,7 +6,7 @@ const FRAME_HEIGHT = 22;
const FRAME_PROVIDER_LENGTH = 23;
const FRAME_PAGE_LENGTH = 11;
const FRAME_COST_LENGTH = 6;
const FRAME_ATTR_LENGTH = 0; // Space that an attribute takes
const FRAME_ATTR_LENGTH = 1; // Space that an attribute takes
const VIEWDATA_LEFT = '\x08';
const VIEWDATA_RIGHT = '\x09';
@@ -552,34 +552,6 @@ function SessionProtocol() {
return str.replace(/\x1b/g,'').length;
};
/*
// Render the frame to the user
this.render=function(withHeader) {
log(LOG_DEBUG,'- VIEWDATA FRAME');
owner = base64_decode(this.owner);
header = VIEWDATA_DOWN;
//log(LOG_DEBUG,' - FRAME User: ['+JSON.stringify(user)+']');
// Dont show the page number on system login page
if (user.number || (this.type !== FRAME_TYPE_LOGIN && FRAMES_NO_HISTORY.indexOf(this.page) === -1)) {
log(LOG_DEBUG,' - Owner: ['+this.pageowner+'] ('+this.strlen(videotex(this.pageownerlogo))+')');
cost = (this.isAccessible ? this.cost+FRAME_COSTUNIT : ' -');
header = videotex(this.pageownerlogo)+' '.repeat(this.settings.FRAME_HEADER-this.strlen(videotex(this.pageownerlogo)))+
(this.isAccessible ? ascii(27)+'G' : ascii(27)+'A')+this.page+' '.repeat(this.settings.FRAME_PAGENUM-this.page.length)+
ascii(27)+'B'+' '.repeat(this.settings.FRAME_COST-cost.toString().length+1)+cost;
}
//console.status |= CON_RAW_IN;
write_raw(VIEWDATA_CLS);
write_raw(header);
return write_raw(videotex(base64_decode(this.content)));
};
*/
this.qrcode = function(qr) {
// Render the body
var qrcode = VIEWDATA_HOME+VIEWDATA_DOWN.repeat(5);