Skip to content

Commit

Permalink
Merge branch 'master' of ../cvs/exec
Browse files Browse the repository at this point in the history
  • Loading branch information
RealDeuce committed Apr 27, 2020
2 parents a56f6b0 + 0f552f6 commit 235f0ea
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 120 deletions.
17 changes: 6 additions & 11 deletions exec/avatar_chooser.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// $Id: avatar_chooser.js,v 1.31 2020/04/25 09:29:24 rswindell Exp $
// $Id: avatar_chooser.js,v 1.32 2020/04/27 02:15:02 rswindell Exp $

load('sbbsdefs.js');
load('frame.js');
Expand Down Expand Up @@ -334,16 +334,11 @@ function CollectionLister(dir, parent_frame) {
}

function display_collection_info(sauce, fn) {

function crlf() {
frames.info.cleartoeol();
frames.info.crlf();
}
frames.info.home();
frames.info.putmsg('Author: ' + (sauce.author.length ? sauce.author : 'Unknown')); crlf();
frames.info.putmsg('Group: ' + (sauce.group.length ? sauce.group : 'Unknown')); crlf();
frames.info.putmsg('Avatars: ' + Math.floor(sauce.rows / avatar_lib.defs.height)); crlf();
frames.info.putmsg('ICE Colors: ' + (sauce.ice_color ? 'Yes' : 'No')); crlf();
frames.info.erase(' ');
frames.info.putmsg('Author: ' + (sauce.author.length ? sauce.author : 'Unknown') + '\r\n');
frames.info.putmsg('Group: ' + (sauce.group.length ? sauce.group : 'Unknown') + '\r\n');
frames.info.putmsg('Avatars: ' + Math.floor(sauce.rows / avatar_lib.defs.height) + '\r\n');
frames.info.putmsg('ICE Colors: ' + (sauce.ice_color ? 'Yes' : 'No') + '\r\n');
frames.info.putmsg('Updated: ' + sauce.date.toLocaleDateString());

const f = new File(fn);
Expand Down
46 changes: 11 additions & 35 deletions exec/ftn-setup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// $Id: ftn-setup.js,v 1.10 2020/04/25 09:22:01 rswindell Exp $
// $Id: ftn-setup.js,v 1.11 2020/04/27 02:10:25 rswindell Exp $

load('sbbsdefs.js');
load('frame.js');
Expand Down Expand Up @@ -62,57 +62,33 @@ frame.cycle();

var key;
var zone;
var high_water = 0;
console.ungetstr(KEY_UP);
while (!js.terminated) {
key = console.getkey();
if (key.toLowerCase() == 'q') break;
tree.getcmd(key);
if (key == KEY_UP || key == KEY_DOWN || key == KEY_HOME || key == KEY_END) {
zone = tree.currentItem.__ftn_setup;
function crlf() {
info_frame.cleartoeol();
info_frame.crlf();
}
info_frame.home();
info_frame.putmsg('\1h\1w' + zone.name);
crlf();
info_frame.erase(' ');
info_frame.putmsg('\1h\1w' + zone.name + '\r\n');
if (zone.desc) {
info_frame.putmsg('\1n\1w' + zone.desc);
crlf();
crlf();
info_frame.putmsg('\1n\1w' + zone.desc + '\r\n\r\n');
}
if (zone.info) {
info_frame.putmsg('\1h\1cInformation\1w:');
crlf();
info_frame.putmsg('\1n' + zone.info);
crlf();
crlf();
info_frame.putmsg('\1h\1cInformation\1w:\r\n');
info_frame.putmsg('\1n' + zone.info + '\r\n\r\n');
}
if (zone.coord) {
info_frame.putmsg('\1h\1cCoordinator\1w:');
crlf();
info_frame.putmsg('\1n' + zone.coord);
crlf();
crlf();
info_frame.putmsg('\1h\1cCoordinator\1w:\r\n');
info_frame.putmsg('\1n' + zone.coord + '\r\n\r\n');
}
if (zone.email) {
info_frame.putmsg('\1h\1cEmail\1w:');
crlf();
info_frame.putmsg('\1n' + zone.email);
crlf();
crlf();
info_frame.putmsg('\1h\1cEmail\1w:\r\n');
info_frame.putmsg('\1n' + zone.email + '\r\n\r\n');
}
if (addrs[zone._zone_number]) {
info_frame.putmsg('\1h\1rExisting address found: ' + addrs[zone._zone_number]);
crlf();
info_frame.putmsg('\1h\1rExisting address found: ' + addrs[zone._zone_number] + '\r\n');
}
var y = info_frame.cursor.y;
while(high_water > y) {
crlf();
high_water--;
}
high_water = y;
}
if (frame.cycle()) console.gotoxy(console.screen_columns, console.screen_rows);
}
Expand Down
82 changes: 41 additions & 41 deletions exec/load/frame.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $Id: frame.js,v 1.87 2020/04/27 02:04:54 rswindell Exp $ */
/* $Id: frame.js,v 1.88 2020/04/27 02:11:57 mcmlxxix Exp $ */

/**
Javascript Frame Library
Expand Down Expand Up @@ -1674,22 +1674,6 @@ function Cursor(x,y,frame) {
y:undefined,
frame:undefined
}
this.__defineGetter__("x", function() {
return this.__properties__.x;
});
this.__defineSetter__("x", function(x) {
if(isNaN(x))
throw("invalid x coordinate: " + x);
this.__properties__.x = x;
});
this.__defineGetter__("y", function() {
return this.__properties__.y;
});
this.__defineSetter__("y", function(y) {
if(isNaN(y))
throw("invalid y coordinate: " + y);
this.__properties__.y = y;
});

if(frame instanceof Frame)
this.__properties__.frame = frame;
Expand All @@ -1700,37 +1684,32 @@ function Cursor(x,y,frame) {
this.y = y;
}

Cursor.prototype.__defineGetter__("x", function() {
return this.__properties__.x;
});
Cursor.prototype.__defineSetter__("x", function(x) {
if(isNaN(x))
throw("invalid x coordinate: " + x);
this.__properties__.x = x;
});
Cursor.prototype.__defineGetter__("y", function() {
return this.__properties__.y;
});
Cursor.prototype.__defineSetter__("y", function(y) {
if(isNaN(y))
throw("invalid y coordinate: " + y);
this.__properties__.y = y;
});



/* self-validating scroll offset object */
function Offset(x,y,frame) {
this.__properties__ = {
x:undefined,
y:undefined,
frame:undefined
}
this.__defineGetter__("x", function() {
return this.__properties__.x;
});
this.__defineSetter__("x", function(x) {
if(x == undefined)
throw("invalid x offset: " + x);
else if(x < 0)
x = 0;
/* else if(x > this.__properties__.frame.data_width - this.__properties__.frame.width)
x = this.__properties__.frame.data_width - this.__properties__.frame.width;
*/ this.__properties__.x = x;
});
this.__defineGetter__("y", function() {
return this.__properties__.y;
});
this.__defineSetter__("y", function(y) {
if(y == undefined)
throw("invalid y offset: " + y);
else if(y < 0)
y = 0;
/* else if(y > this.__properties__.frame.data_height - this.__properties__.frame.height)
y = this.__properties__.frame.data_height - this.__properties__.frame.height;
*/ this.__properties__.y = y;
});

if(frame instanceof Frame)
this.__properties__.frame = frame;
Expand All @@ -1740,3 +1719,24 @@ function Offset(x,y,frame) {
this.x = x;
this.y = y;
}

Offset.prototype.__defineGetter__("x", function() {
return this.__properties__.x;
});
Offset.prototype.__defineSetter__("x", function(x) {
if(x == undefined)
throw("invalid x offset: " + x);
else if(x < 0)
x = 0;
this.__properties__.x = x;
});
Offset.prototype.__defineGetter__("y", function() {
return this.__properties__.y;
});
Offset.prototype.__defineSetter__("y", function(y) {
if(y == undefined)
throw("invalid y offset: " + y);
else if(y < 0)
y = 0;
this.__properties__.y = y;
});
44 changes: 11 additions & 33 deletions exec/xtrn-setup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// $Id: xtrn-setup.js,v 1.7 2020/04/25 09:22:01 rswindell Exp $
// $Id: xtrn-setup.js,v 1.8 2020/04/27 02:10:25 rswindell Exp $
// vi: tabstop=4

load('sbbsdefs.js');
Expand Down Expand Up @@ -63,53 +63,31 @@ frame.cycle();

var key;
var xtrn;
var high_water = 0;
console.ungetstr(KEY_UP);
while (!js.terminated) {
key = console.getkey();
if (key.toLowerCase() == 'q') break;
tree.getcmd(key);
function crlf() {
info_frame.cleartoeol();
info_frame.crlf();
}
if (key == KEY_UP || key == KEY_DOWN || key == KEY_HOME || key == KEY_END) {
xtrn = tree.currentItem.__xtrn_setup;
info_frame.home();
info_frame.putmsg('\x01h\x01w' + xtrn.Name);
crlf();
info_frame.erase(' ');
info_frame.putmsg('\x01h\x01w' + xtrn.Name + '\r\n');
if (xtrn.Desc) {
info_frame.cleartoeol();
info_frame.putmsg('\x01n\x01w' + xtrn.Desc);
crlf();
info_frame.putmsg('\x01n\x01w' + xtrn.Desc + '\r\n');
}
crlf();
info_frame.crlf();
if (xtrn.By) {
info_frame.putmsg('\x01h\x01cBy\x01w:');
crlf();
info_frame.putmsg('\x01w' + xtrn.By);
crlf();
crlf();
info_frame.putmsg('\x01h\x01cBy\x01w:\r\n');
info_frame.putmsg('\x01w' + xtrn.By + '\r\n\r\n');
}
if (xtrn.Cats) {
info_frame.putmsg('\x01h\x01cCategories\x01w:');
crlf();
info_frame.putmsg('\x01n' + xtrn.Cats);
crlf();
crlf();
info_frame.putmsg('\x01h\x01cCategories\x01w:\r\n');
info_frame.putmsg('\x01n' + xtrn.Cats + '\r\n\r\n');
}
if (xtrn.Subs) {
info_frame.putmsg('\x01h\x01cSubcategories\x01w:');
crlf();
info_frame.putmsg('\x01n' + xtrn.Subs);
crlf();
}
var y = info_frame.cursor.y;
while(high_water > y) {
crlf();
high_water--;
info_frame.putmsg('\x01h\x01cSubcategories\x01w:\r\n');
info_frame.putmsg('\x01n' + xtrn.Subs + '\r\n');
}
high_water = y;
}
if (frame.cycle()) console.gotoxy(console.screen_columns, console.screen_rows);
}
Expand Down

0 comments on commit 235f0ea

Please sign in to comment.