• SBBS Web

    From Mortifis@1:103/705 to All on Mon Feb 11 13:40:21 2019
    First, my apologies for sounding ADAF, my coding history is TP7 and AMP ...

    'ben playing with a custom theme for my site and haven't been able to get things the way I'd like (starting with the root/index.ssjs file ... so I got to
    thinking, how would one start with an index.html and include *.ssjs & *.js files? I tried using the standard:
    <script myscript="server"> load('some.js');
    ... do some half baked s...tuff ...
    </script> ... likely a few other type thingies

    but ain't getting squat for output.

    Anyone care to help an ol'dog learn some new tricks?

    ---
    þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From echicken@1:103/705 to Mortifis on Mon Feb 11 13:10:49 2019
    Re: SBBS Web
    By: Mortifis to All on Mon Feb 11 2019 13:40:21

    got to thinking, how would one start with an index.html and include
    *.ssjs
    & *.js files? I tried using the standard:

    Don't get tripped up by client-side vs. server-side JS for starters:

    <script myscript="server"> load('some.js');
    ... do some half baked s...tuff ...
    </script> ... likely a few other type thingies

    This would be part of the HTML document that's sent to the client. The server won't do any magic on that load() statement. The client's browser would try to
    call a function named 'load', and presumably produce an error.

    The .ssjs scripts are executed on the server side, so:

    load('some.js');
    writeln('<html><body>');

    var poop = some_server_side_function(); // Let's say it returns string 'poop'

    writeln(poop);
    writeln('</body></html>');

    That'd do some stuff on the server and send some stuff to the browser.

    Alternately you can use a .xjs file, which is an HTML document with some SSJS embedded that the server will process/render and then send to the client:

    <html>
    <body>
    <?xjs
    load('some.js');
    var poop = some_server_side_function();

    <h1><?xjs write(poop); ?></h1>
    <script type="text/javascript">
    // Let's mix client and server-side JS for added confusion
    alert('<xjs write(poop); ?>');
    </script>
    </body>
    </html>

    This is similar to inline PHP.

    If you just send a .html file, the server won't do anything special with it; it'll just be transferred to the browser as-is.

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com - 416-425-5435

    ---
    þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.com
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Mortifis@1:103/705 to echicken on Mon Feb 11 15:27:00 2019
    Re: SBBS Web
    By: Mortifis to All on Mon Feb 11 2019 13:40:21

    got to thinking, how would one start with an index.html and include *.ssjs
    & *.js files? I tried using the standard:

    Don't get tripped up by client-side vs. server-side JS for starters:

    <script myscript="server"> load('some.js');
    ... do some half baked s...tuff ...
    </script> ... likely a few other type thingies

    This would be part of the HTML document that's sent to the client. The server won't do any magic on that load() statement. The client's browser would try to
    call a function named 'load', and presumably produce an error.

    other than no output the only error was no output of my half baked scruff ..


    The .ssjs scripts are executed on the server side, so:

    load('some.js');
    writeln('<html><body>');

    var poop = some_server_side_function(); // Let's say it returns string 'poop'

    which is what it will return :-P


    writeln(poop);
    writeln('</body></html>');

    That'd do some stuff on the server and send some stuff to the browser.

    Alternately you can use a .xjs file, which is an HTML document with some SSJS embedded that the server will process/render and then send to the client:


    ...

    <html>
    <body>
    <?xjs
    load('some.js');
    var poop = some_server_side_function();

    <h1><?xjs write(poop); ?></h1>
    <script type="text/javascript">
    // Let's mix client and server-side JS for added confusion
    alert('<xjs write(poop); ?>');
    </script>
    </body>
    </html>

    This is similar to inline PHP.


    seems promising ... though it would be more fortuitous if I just took the time to learn js/ssjs ... in meantime ... thank you I will try that ... oh, is there
    anything I need to pre-load ( ie: for php I need php installed to use <?php ...?> to have an xjs execute?

    ---
    echicken

    Thanks, EC

    ---
    þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From echicken@1:103/705 to Mortifis on Mon Feb 11 15:07:16 2019
    Re: Re: SBBS Web
    By: Mortifis to echicken on Mon Feb 11 2019 15:27:00

    other than no output the only error was no output of my half baked scruff ..

    The error would have shown up in the console (dev tools) of your browser, if at
    all.

    oh, is there anything I need to pre-load ( ie: for php I need php installed to use <?php ...?> to have an xjs execute?

    Nothing to install - SSJS support is baked into the Synchronet webserver. There is ctrl/web_handler.ini which is a part of the process, but an XJS handler is configured in there by default:

    xjs = xjs_handler.js

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com - 416-425-5435
    þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.com
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Digital Man@1:103/705 to Mortifis on Mon Feb 11 15:26:16 2019
    Re: SBBS Web
    By: Mortifis to All on Mon Feb 11 2019 01:40 pm

    First, my apologies for sounding ADAF, my coding history is TP7 and AMP ...

    'ben playing with a custom theme for my site and haven't been able to get things the way I'd like (starting with the root/index.ssjs file ... so I
    got
    to thinking, how would one start with an index.html and include *.ssjs & *.js files? I tried using the standard:
    <script myscript="server"> load('some.js');
    ... do some half baked s...tuff ...
    </script> ... likely a few other type thingies

    but ain't getting squat for output.

    Anyone care to help an ol'dog learn some new tricks?

    Have you read this page? http://wiki.synchro.net/server:web

    digital man

    This Is Spinal Tap quote #44:
    It really, it does disturb me, but i'll rise above it; I'm a professional. Norco, CA WX: 60.2øF, 30.0% humidity, 2 mph NW wind, 0.02 inches rain/24hrs
    --- SBBSecho 3.06-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Mortifis@1:103/705 to echicken on Wed Feb 13 14:36:29 2019
    I was looking through webv4 directory, where is the Who's Online Other Systems called from?

    ---
    þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Digital Man@1:103/705 to Mortifis on Wed Feb 13 18:03:47 2019
    Re: SBBS Web
    By: Mortifis to echicken on Wed Feb 13 2019 02:36 pm

    I was looking through webv4 directory, where is the Who's Online Other Systems called from?

    Looks like: sidebar/001-nodelist.xjs

    digital man

    Synchronet "Real Fact" #88:
    SBBSecho v3.00 was first committed to cvs.synchro.net on Apr-11-2016.
    Norco, CA WX: 50.7øF, 78.0% humidity, 1 mph WSW wind, 0.03 inches rain/24hrs --- SBBSecho 3.06-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Mortifis@1:103/705 to Digital Man on Thu Feb 14 10:53:50 2019
    Re: SBBS Web
    By: Mortifis to echicken on Wed Feb 13 2019 02:36 pm

    I was looking through webv4 directory, where is the Who's Online Other Systems called from?

    Looks like: sidebar/001-nodelist.xjs

    I had 'scooped' sidebar/001-nodelist.xjs and plopped it in my theme members for
    use but it seems to require being called somehow because I am getting a blank page so was wondering how does webv4 interact with 001.nodelist.xjs ?

    ---
    þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From echicken@1:103/705 to Mortifis on Thu Feb 14 22:08:18 2019
    Re: Re: SBBS Web
    By: Mortifis to Digital Man on Thu Feb 14 2019 10:53:50

    I had 'scooped' sidebar/001-nodelist.xjs and plopped it in my theme members for use but it seems to require being called somehow because I am

    I'm not quite sure what this means. Can you elaborate?

    getting a blank page so was wondering how does webv4 interact with 001.nodelist.xjs ?

    The layout file (index.xjs) uses some helpers from a library (web/lib/sidebar.js) to load every html/ssjs/xjs file it finds in the web/sidebar/ directory. The order in which they're loaded is based on the filenames, hence the convention of prefixing them with some numbers.

    Pages and sidebar modules aren't complete HTML documents. They're just snippets meant to be included in a larger page. I have no idea how these would
    work if you're trying to use them with the Runemaster web UI, or how best to go
    about doing that. (I also have zero interest in making that work.)

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com - 416-425-5435
    þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.com
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Mortifis@1:103/705 to echicken on Fri Feb 15 14:06:44 2019
    Re: Re: SBBS Web
    By: Mortifis to Digital Man on Thu Feb 14 2019 10:53:50

    I had 'scooped' sidebar/001-nodelist.xjs and plopped it in my theme members for use but it seems to require being called somehow because I am

    I'm not quite sure what this means. Can you elaborate?


    I am playing writing a web interface and had asked how to display the online users on other bbses similar to webv4 didebar

    2 wrongs don't make a right, but 3 left turns will get you back on the freeway!

    ---
    þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Digital Man@1:103/705 to Mortifis on Fri Feb 15 22:14:27 2019
    Re: Re: SBBS Web
    By: Mortifis to echicken on Fri Feb 15 2019 02:06 pm

    Re: Re: SBBS Web
    By: Mortifis to Digital Man on Thu Feb 14 2019 10:53:50

    I had 'scooped' sidebar/001-nodelist.xjs and plopped it in my theme members for use but it seems to require being called somehow
    because
    I am

    I'm not quite sure what this means. Can you elaborate?


    I am playing writing a web interface and had asked how to display the
    online
    users on other bbses similar to webv4 didebar

    You can see exec/nodelist-html.js for a simple (very old) example.

    digital man

    Synchronet "Real Fact" #74:
    Vertrauen went online (as a WWIV BBS running on a 10MHz PC-XT clone) in 1988. Norco, CA WX: 48.1øF, 95.0% humidity, 4 mph E wind, 0.09 inches rain/24hrs
    --- SBBSecho 3.06-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)