🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: DOVE-Net.Synchronet_Javascript
2 messages
2 total messages Started by "Nightfox" (VERT Wed, 29 Jan 2025 12:39
Replacing a text string to execute JS code directly
#339
Author: "Nightfox" (VERT
Date: Wed, 29 Jan 2025 12:39
9 lines
787 bytes
Hi DM,

In the strings from text.dat, I know you can use @EXEC:..@ to have it run a JS or Baja module, but is there a way to have it directly execute a block of JS code instead of executing a file?  In my most recent update to DDMsgReader, it replaces the AreYouThere string with an empty string so that the contents of the screen aren't affected, but I was also thinking of having it execute some JS code so that I'd have some more control on where the string is displayed, etc.  I could have it execute a separate .js with @EXEC@, but I'm not sure I'd want to add a separate .js just for that. I'm wondering if there's a way to have it directly execute a block of JS code when used with bbs.replace_text()?

Nightfox

---
 þ Synchronet þ Digital Distortion: digitaldistortionbbs.com
.
Replacing a text string to execute JS code directly
#340
Author: "Digital Man" (V
Date: Wed, 29 Jan 2025 13:15
27 lines
1516 bytes
  Re: Replacing a text string to execute JS code directly
  By: Nightfox to Digital Man on Wed Jan 29 2025 12:39 pm

 > Hi DM,

 > In the strings from text.dat, I know you can use @exec:..@ to have it run a
 > JS or Baja module, but is there a way to have it directly execute a block of
 > JS code instead of executing a file?  In my most recent update to
 > DDMsgReader, it replaces the AreYouThere string with an empty string so that
 > the contents of the screen aren't affected, but I was also thinking of
 > having it execute some JS code so that I'd have some more control on where
 > the string is displayed, etc.  I could have it execute a separate .js with
 > @EXEC@, but I'm not sure I'd want to add a separate .js just for that. I'm
 > wondering if there's a way to have it directly execute a block of JS code
 > when used with bbs.replace_text()?

Not exactly as @-codes are pretty restrictive as to the contents (e.g. no space characters), so it'be pretty hard to put a code block within an @-code. One possibility is to define a JS property with a getter function and then you can invoke that getter function with the JS:propname @-code: https://wiki.synchro.net/custom:atcodes#external_content
--
                                            digital man (rob)

Synchronet/BBS Terminology Definition #45:
IMAP = Internet Message Access Protocol
Norco, CA WX: 57.0øF, 60.0% humidity, 5 mph W wind, 0.00 inches rain/24hrs

---
 þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads