1. 29 Dec, 2022 2 commits
  2. 03 Dec, 2022 1 commit
    • Rob Swindell's avatar
      Add output line pacing support (delay before sending LF) · 48a8573d
      Rob Swindell authored
      New LINEDELAY and LINEDELAY:n @-codes
      Another way to pace the terminal output of long display (e.g. ANSI) files. LINEDELAY enables a 1/10th of a second delay before the sending of all LF chars. LINEDELAY:n sets the line_delay duration explicitly to a value in 1/100ths of a second units. So LINEDELAY and LINEDELAY:10 are equivalent. LINEDELAY:0 turns line-pacing off. The original line pacing value is always restored after a printfile/putmsg operation.
      
      New JS console.line_delay property (milliseconds) to control via JS. Setting this to a really high value would be bad. Some range enforcement should be added to this and many other console control values (TODO).
      48a8573d
  3. 04 Jul, 2022 1 commit
  4. 15 Jun, 2022 1 commit
  5. 11 Jun, 2022 1 commit
    • Rob Swindell's avatar
      Add console.progress() method · 22f3aa78
      Rob Swindell authored
      This exposes the Synchronet internal sbbs_t::progress() method used to
      display a progress indication bar, e.g. "[ Scanning 10.0% ]" with the bar
      backfill effect (when supported by the terminal).
      22f3aa78
  6. 05 Apr, 2021 1 commit
  7. 04 Apr, 2021 2 commits
  8. 03 Apr, 2021 1 commit
  9. 02 Apr, 2021 1 commit
    • Deucе's avatar
      Initial work on setTimeout() · ad635a64
      Deucе authored
      This appears to work and the event handler *should* work on other
      event types already.
      
      Note, this is *nix-only due to the use of poll().  select() will
      need to be used for Windows to keep XP compatability.
      ad635a64
  10. 22 Feb, 2021 1 commit
  11. 15 Feb, 2021 2 commits
  12. 22 Jan, 2021 1 commit
    • Rob Swindell's avatar
      Optionally distinguish between timeout and NUL inkey() result · bec4667e
      Rob Swindell authored
      Some terminals can send NUL (ASCII 0), e.g. hitting Ctrl-Space in Apple iTerm. Allow users of inkey() (in C++ or JS) to optionally detect the difference by specifying the K_NUL mode flag. In JS, console.inkey() will return null upon timeout (rather than "") when the K_NUL mode flag is used and return an empty string ("") upon receipt of NUL (ASCII 0).
      
      The default is the previous behavior where a timeout and the receipt of a NUL character appear the same to the caller of inkey().
      bec4667e
  13. 07 Nov, 2020 2 commits
  14. 13 Sep, 2020 1 commit
    • Rob Swindell's avatar
      Fixes to printfile and printtail methods · ac3d3173
      Rob Swindell authored
      Throw an exception if no filename is specified (rather than just abort the
      script by returning JS_FALSE).
      
      The return value is supposed to be a bool, not an int (JS_TRUE != JSVAL_TRUE).
      ac3d3173
  15. 16 Aug, 2020 1 commit
  16. 24 May, 2020 1 commit
    • rswindell's avatar
      Addd console.mouse_mode (bit-field) property for visibility/control of sbbs... · b1b8ce5a
      rswindell authored
      Addd console.mouse_mode (bit-field) property for visibility/control of sbbs internal ANSI-mouse-reporting mode flags (should not normally need to set this).
      console.getxy() now works with non-ANSI terminals and returns false if for some reason the request fails (e.g. ANSI cursor position report timeout).
      b1b8ce5a
  17. 14 May, 2020 1 commit
    • rswindell's avatar
      No longer dynamically allocate compiled access requirment (AR) strings for configuration items. · 110cc8ac
      rswindell authored
      SCFG for Win32 is linked against a load_cfg lib that builds withOUT SCFG defined, so these compiled AR elements were allocated and then many SCFG operations (e.g. copy/paste, create new) would copy the allocated ARs to another configuration and then be subjected to double-free upon exit/clean-up (resulting in exception or crash).
      Just get rid of this cruft and some other related RAM-byte-saving hold-overs from the MS-DOS days.
      110cc8ac
  18. 12 May, 2020 1 commit
    • rswindell's avatar
      As part of the rev 1.147 (add mouse hot sport support) commit, I made what I... · a96b9402
      rswindell authored
      As part of the rev 1.147 (add mouse hot sport support) commit, I made what I thought was a harmless change to the JS console.clear() implementation, I changed the call to sbbs->CLS to sbbs->clearscreen(). The sbbs->CLS macro calls outchar(FF) which check the line-counter and does the auto-pause before screen-clear. A direct call to sbbs->clearscreen() does not.
      Just in case someone actually wants the new (but unexpected behavior), I added an optional boolean parameter to console.clear(), autopause (default to true). Pass false if you want to defeat the autopause functionality. This should be effectively the same as setting the console.line_counter = 0 before calling console.clear(), but it also totally bypasses sbbs_t::outchar,
      so there could be other differences I'm not thinking of.
      Anyway, this fixes the lack of auto-screen pauses in JS mods recently introduced.
      a96b9402
  19. 09 May, 2020 2 commits
    • rswindell's avatar
      058294a5
    • rswindell's avatar
      Both hungry/liberal hot-spots and strict hot-spots can be defined now, at the... · 6f16fafe
      rswindell authored
      Both hungry/liberal hot-spots and strict hot-spots can be defined now, at the same time. For Nelgin.
      Use ^A` to define a single-char strict hot-spot using Ctrl-A codes. Unfortunately, this usurps the "home" Ctrl-A code which nothing seems to use but has now been changed to ^A'.
      Use ` instead of ~ in mnemonics to define strict single-char hot-spots (also displays the cmd key in [] instead () on non ANSI/PETSCII terms).
      Use @` instead of @~ codes to define strict hot-keys.
      Use HOT:STRICT @-code to declare a strict hot-key color.
      Use HOT:HUNGRY @-code to toggle back to hungry color-defined hot-keys (the default).
      New optional boolean argument to JS console.add_hotkey(), hungry = true by default.
      6f16fafe
  20. 08 May, 2020 3 commits
    • rswindell's avatar
      Add sbbs_t::keybuf_space() and keybuf_level() · a5b0f07f
      rswindell authored
      and JS console.keyboard_buffer_space() and keyboard_buffer_level()
      ... for tracking the number of character spaces used and available in the the (unget)keyboard input buffer.
      a5b0f07f
    • rswindell's avatar
      Resolve GCC warning: unused variable 'argv' · 885eda66
      rswindell authored
      885eda66
    • rswindell's avatar
      Add mouse hot spot support: · 87c9982c
      rswindell authored
      - hot spots are clickable screen areas (e.g. in menus and prompts) that   generate key-strokes
      - commands may be from 1 to 127 ASCII-characters in length
      - currently using the X10 mouse reporting mode, may change
      - all mnemonics strings (~Example) are automatically hot-spots
      - The new ~ @-code defines a hot spot
      - Any screen-clear operation clears all hot spots
      - sbbs now tracks the current screen (cursor position) row
      - eliminated the old "tos" (top-of-screen) boolean (row == 0 indicates "tos")
      - created an sbbs_t::ungetstr() method
      - keep track if in pause (hit a key) prompt, for special mouse behavior
      
      new JS console object:
      - row property
      - tos property is now read-only (and deprecated)
      - new methods:
        add_hotspot()
        clear_hotspots()
        scroll_hotspots()
      
      redrwstr() gets some UTF8 touch-ups as part of this commit. <shrug>
      87c9982c
  21. 30 Apr, 2020 1 commit
    • rswindell's avatar
      Support JavaScript property name expansion using JS:<name> @-code where name is · c9c42c87
      rswindell authored
      the name of a scalar property in either the current scope (by default) or the
      scope of the object passed to:
      - bbs.menu()
      - console.putmsg()
      - console.printfile()
      - console.printtail()
      
      The 'name' cannot be an array element (e.g. myprop[0]) or a nested object
      reference (e.g. myobj.myprop): just a single property name that can be
      converted to a string.
      
      Also, bbs.menu() now accepts an optional print-mode argument (default: P_NONE).
      c9c42c87
  22. 06 Apr, 2020 1 commit
    • rswindell's avatar
      Fix bug introduced in rev 1.142 with the additional/optional arguments to the · f1dfe106
      rswindell authored
      yesno() and noyes() methods:
      We need to check the argument count before using the second (optional)
      argument or else it has some garbage/left-over value from some previous JS
      function call. And no, just increasing the argument count in the method table
      isn't enough. :-(
      Reported by echicken and DaiTengu, thanks!
      f1dfe106
  23. 19 Mar, 2020 1 commit
    • rswindell's avatar
      console.getkeys() had a couple of bugs: · 49eef9c4
      rswindell authored
      - you couldn't specify a maxnum value of 0 (it would get overridden to ~0)
      - you couldn't specify a mode argument value without also specifying a non-zero
        maxnum value
      49eef9c4
  24. 02 Mar, 2020 1 commit
  25. 01 Mar, 2020 1 commit
    • rswindell's avatar
      sbbs_t::yesno() and noyes() and their JS equivalents (console.yesno/noyes) · 07f31378
      rswindell authored
      now accept an optional print-mode (a.k.a. pmode) argument to provide more
      control over the printing that happens in these functions/methods.
      The immediate use is for P_NOCRLF to stop the newline from being printed
      after a yes or no response (e.g. in a full-screen UI), but there could be other
      uses.
      07f31378
  26. 08 Oct, 2019 1 commit
  27. 21 Sep, 2019 1 commit
    • rswindell's avatar
      sbbs_t::center() and thusly JS console.center() now accepts an optional · 77f2c366
      rswindell authored
      "width" argument (in columns), defaults the user's current screen column-width
      but you can now over-ride this value when an additional/optional argument.
      Also, center() now clears-to-EOL before sending the CRLF to the terminal.
      Hopefully this doesn't mess up anyone's existing use of center().
      77f2c366
  28. 10 Sep, 2019 1 commit
  29. 21 Aug, 2019 1 commit
    • rswindell's avatar
      Always use a passthru (proxy) socket when executing external programs that · 53884cce
      rswindell authored
      use socket I/O (e.g. sexyz, door32.sys doors, sync-xsdk doors) - not just when
      the client is connected via SSH. This solves a number of problems:
      - programs that change socket options
      - programs that don't support non-CP437 charsets (e.g. PETSCII, UTF-8)
      - programs that don't support Telnet-IAC escaping
      
      This greatly simplifies (reduces the need for) input_thread locking.
      
      The passthru_thread now handles chunks of up to 4000 bytes per transfer
      between socket and ringbuf, instead of a char at a time, greatly improving the
      performance.
      53884cce
  30. 05 Aug, 2019 2 commits
  31. 04 Aug, 2019 1 commit
    • rswindell's avatar
      More UTF-8 fun: · 3313a87e
      rswindell authored
      - bstrlen() moved to sbbs_t, accepts an option pmode argument so it can account
        for UTF-8 encoded strings correctly
      - JS console.strlen() now accepts an optional pmode argument (e.g. P_UTF8)
      - Renamed sbbs_t::utf8_to_cp437 to sbbs_t::print_utf8_as_cp437
      - Create/use msghdr_hfield() to perform UTF-8->CP437 conversions as needed for
        printing/copying UTF-8 encoded message header fields.
      - Defined XTRN_UTF8 misc setting flag. If a message editor does *not* have this
        flag, it is assumed to *not* support UTF-8. Will likely use this for UTF-8
        doors as some point too (none known to exist, yet).
      3313a87e
  32. 03 Aug, 2019 1 commit