Re: Re: Bullshit
By: Michael Long to alt.bbs.synchronet on Wed Oct 14 2020 20:35:17
I was able to do a proof of concept by adding these lines in frame.js
contents = contents.replace('@CLS@', '')
.replace('@CLEAR@', '')
.replace(/(?:@(.+?)@)/g, function(match, rcontents, rinput) {
return bbs.atcode(rcontents);
});
This was discussed at length here very recently, within the past month.
Anything that clears the screen or a line will need special handling. I'm not sure if it should be filtered out altogether or if it should clear the Frame it is written to.
Anything that repositions the cursor needs to be handled specially. I'm not sure if it should be filtered out altogether or if cursor movement should be handled relative to the Frame in question.
Whatever file you're loading might be useless or appear garbled if cls/cursor-movement sequences are discarded. It'd be better to handle these properly, but a bit trickier.
This needs to be an opt-in feature. Some @ codes (EXEC, EXEC_XTRN, etc.) are problematic. Probably okay in something like Bullshit where only the sysop is providing the content, but not so good in any Frame that is displaying content from an arbitrary source.
If possible, this feature shouldn't be exclusive to Frame.load(). If Frame supports @ codes, it might as well support them everywhere. (I suspect 'contents' in your example is the contents of a file that's just been read.)
Lastly, lots of stuff depends on frame.js, so on top of being opt-in, this change needs to be non-breaking. Frame should act exactly as it did before unless @-code support is switched on.
So if you're going to work on this, please keep all of that in mind. If not, it's on my mental to-do list and I'll get to it when I get to it.
---
echicken
electronic chicken bbs - bbs.electronicchicken.com
� Synchronet � electronic chicken bbs - bbs.electronicchicken.com