• exec/load/scrollbox.js

    From echicken@VERT to CVS commit on Saturday, October 12, 2019 21:54:40
    exec/load scrollbox.js NONE 1.1
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv29056

    Added Files:
    scrollbox.js
    Log Message:
    Client-side scroll area (full-width, variable height) to display stuff
    from a file, a string, or an array of strings. Because it does various
    bits of rewrap magic it's probably not suitable for all content. Good
    for my gopher client, though.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From echicken@VERT to CVS commit on Saturday, October 12, 2019 22:12:19
    exec/load scrollbox.js 1.1 1.2
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv32753

    Modified Files:
    scrollbox.js
    Log Message:
    Faster redraw after an element transform if overall row count unchanged.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From echicken@VERT to CVS commit on Saturday, October 12, 2019 22:14:13
    exec/load scrollbox.js 1.2 1.3
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv602

    Modified Files:
    scrollbox.js
    Log Message:
    Don't prevent redraw of last line of content.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From echicken@VERT to CVS commit on Saturday, October 12, 2019 22:39:37
    exec/load scrollbox.js 1.3 1.4
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv4120

    Modified Files:
    scrollbox.js
    Log Message:
    Make load_file and load_string actually work.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Nightfox@VERT/DIGDIST to echicken on Sunday, October 13, 2019 12:28:35
    Re: exec/load/scrollbox.js
    By: echicken to CVS commit on Sat Oct 12 2019 09:54 pm

    scrollbox.js
    Log Message:
    Client-side scroll area (full-width, variable height) to display stuff from a file, a string, or an array of strings. Because it does various bits of rewrap magic it's probably not suitable for all content. Good
    for my gopher client, though.

    Is that significantly different from frame.js and scrollbar.js?

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com
  • From echicken@VERT/ECBBS to Nightfox on Sunday, October 13, 2019 16:51:59
    Re: exec/load/scrollbox.js
    By: Nightfox to echicken on Sun Oct 13 2019 12:28:35

    Is that significantly different from frame.js and scrollbar.js?

    Absolutely. There are situations where one of these is better than the other.

    ScrollBox is good if you want to display a lot of text and let the user scroll it within a window. It's faster and more efficient than Frame for this purpose - this is a scenario where Frame tends to run out of memory and is extremely sluggish.

    scrollbar.js provides ScrollBar for Frame, so it's not useful here. (It does have a legacy non-frame Scrollbar object in it, but I didn't use it. I gave ScrollBox its own scrollbar, which is about 12 lines of code.)

    Frame is way more powerful than this and is useful for a lot of other things.

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com
    þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.com
  • From Nightfox@VERT/DIGDIST to echicken on Sunday, October 13, 2019 15:58:41
    Re: exec/load/scrollbox.js
    By: echicken to Nightfox on Sun Oct 13 2019 04:51 pm

    Absolutely. There are situations where one of these is better than the other.

    ScrollBox is good if you want to display a lot of text and let the user scroll it within a window. It's faster and more efficient than Frame for this purpose - this is a scenario where Frame tends to run out of memory and is extremely sluggish.

    Interesting.. I've used frame.js for my message reader in some cases (frame.js seems to parse ANSI a little better), and I use frame.js in SlyVote as well. I use it mainly for displaying text messages to let the user scroll through it. I'm wondering if ScrollBox would be better for that.. I haven't seen any messages (or poll vote results) that are big enough to make Frame run out of memory though.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com
  • From echicken@VERT/ECBBS to Nightfox on Sunday, October 13, 2019 22:32:45
    Re: exec/load/scrollbox.js
    By: Nightfox to echicken on Sun Oct 13 2019 15:58:41

    SlyVote as well. I use it mainly for displaying text messages to let the (frame.js seems to parse ANSI a little better), and I use frame.js in SlyVote as well. I use it mainly for displaying text messages to let the user scroll through it. I'm wondering if ScrollBox would be better for

    If Frame is getting the job done already, it's probably not worth the switch. ScrollBox does not handle ANSI (and it would take a fair bit of effort to make it do so), so it might not be right for you.

    ScrollBox takes a text file, string, or array of strings and presents it in a scrollable window. The window takes the full width of the terminal, but can be (almost) any height and start on (almost) any row. The paragraphs of the file or string, or the elements of the array, are rewrapped to the terminal width. You can scroll to or modify any paragraph from the source material as long as you know its original index. ScrollBox keeps a map of which paragraphs from the source occupy which row(s) in its window.

    This was basically created to serve the needs of my Gopher client but with an eye to being reusable elsewhere. (The rewrapping, indexing, and on the fly transformation of text are crucial to being able to do lightbar-style navigation on content of arbitrary length and width.)

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com
    þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.com
  • From echicken@VERT to CVS commit on Sunday, October 13, 2019 21:12:40
    exec/load scrollbox.js 1.4 1.5
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv26004

    Modified Files:
    scrollbox.js
    Log Message:
    home / end / page up / page down



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From echicken@VERT to CVS commit on Monday, October 14, 2019 09:58:33
    exec/load scrollbox.js 1.5 1.6
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv6681

    Modified Files:
    scrollbox.js
    Log Message:
    Improved end / page up / page down



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From echicken@VERT to CVS commit on Monday, October 14, 2019 15:07:46
    exec/load scrollbox.js 1.6 1.7
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv15031

    Modified Files:
    scrollbox.js
    Log Message:
    Allow setting P_* modes that will be passed to console.putmsg.
    Use P_NOPAUSE with console.putmsg instead of turning off pause globally.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From echicken@VERT to CVS commit on Tuesday, May 05, 2020 19:48:43
    exec/load scrollbox.js 1.7 1.8
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv9452

    Modified Files:
    scrollbox.js
    Log Message:
    Added line_map property, mapping a line in the displayed document
    (post word-wrap) to a line from the source document/array.
    Added mouse support to getcmd (scrolling, left click).
    If it returns a number, that's the line (from the original document)
    that was clicked. This needs some enhancement.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From echicken@VERT to CVS commit on Tuesday, May 05, 2020 19:55:40
    exec/load scrollbox.js 1.8 1.9
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv11178

    Modified Files:
    scrollbox.js
    Log Message:
    If it was a left click, return an object.
    Currently this only has a 'line' property, being which line from the
    source document was clicked.
    It may later become useful to report which position in the original
    string was clicked, or what word, etc.



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