• Re: Javascript for dummie

    From Nelgin@VERT/EOTLBBS to All on Mon Dec 6 18:53:00 2021
    On Tue, 7 Dec 2021 04:10:20 -0500
    "echicken" <echicken@VERT/ECBBS> wrote:

    Re: Javascript for dummies like me
    By: Sys64738 to echicken on Mon Dec 06 2021 18:05:26

    I think you understand exactly what I'm getting at. It's the
    JavaScript info that is HTML/CSS-centric that I'm trying to weed
    my way through.

    Hate to say it, but you just have to power through it. You'll
    eventually get a feel for what information is portable and what is
    tied to a certain domain.


    Pretty much what I did. Just take some existing code, there are plenty
    of examples in /sbbs/exec from small utilities to full blown apps.
    You'll definitely want to refer to the jsobjs file. This is the link
    between js and synchronet.

    Maybe look at one of the menus. It's pretty easy and uses a few
    features like getting the users time and security levels, presenting
    menus and files and the like.

    DM also has a few videos on programming that are worth a look.

    The bottom line is, figure something you want to do and carve away at
    it. You can even do a basic outline in English then figure the
    javascript to replace it.

    like

    get users age
    if they're older than 21 set the 1M flag (for mature content)
    if they're older then 50 then set the 2O flags for Old Fart.
    Also, if it's their birthday then announce it by displaying
    an ansi birthday card


    Then plug that in somewhere in the login sequence.
    --
    End Of The Line BBS - Plano, TX
    telnet endofthelinebbs.com 23
    ---
    þ Synchronet þ End Of The Line BBS - endofthelinebbs.com
  • From Nelgin@VERT/EOTLBBS to All on Fri Dec 10 11:12:00 2021
    On Fri, 10 Dec 2021 08:35:07 -0600
    "Sys64738" <sys64738@VERT/TXNET1> wrote:


    However, the concept of people making up their own commands seems
    like a taking a long walk on a short pier. SYS64738

    Maybe you should quit while you're ahead...
    --
    End Of The Line BBS - Plano, TX
    telnet endofthelinebbs.com 23
    ---
    þ Synchronet þ End Of The Line BBS - endofthelinebbs.com
  • From Tracker1@VERT/TRN to Sys64738 on Mon Dec 13 13:20:00 2021
    On 12/7/21 08:03, Sys64738 wrote:
    I use notepad++ on Windows and vim or geany on Linux. The editor
    doesn't have to recognize an object/method/property for you to
    use it.

    I started out just using plain notepad. Since this is all new to me,
    I thought that I might benefit from the hints/debugging features from
    an editor.

    However, it seems that programming has become less uniform and less
    certain since the years when I was most involved (80's-90's). The
    paved roads of years past seem to have not been maintained and people
    often find themselves cutting their own path to get to where they want
    to go.

    In your opinion, would that be an accurate assessment?

    I would use at least Notepad++ or another more feature-rich text editor
    over plain notepad...

    JS is pretty feature rich and the module syntax is pretty solid. For
    better or worse, a lot of the work in Synchronet predates the changes
    towards ES5 and ES6/ES2015 by a few years. Including a few bits that
    were done differently in the SpiderMonkey engine used vs. what became
    the standard. Like for-each and getter/setter syntax, which are widely
    used in Synchronet scripts.

    A lot of the object model naming and mapping are close to 1:1 to the underlying C libraries in Synchronet... so it will feel a little alien
    in places, compared to modern JS tooling. Event Enigma 1/2 has some
    rough edges and is on a much newer JS platform, but not nearly as
    feature rich as Synchronet.
    --
    Michael J. Ryan - tracker1@roughneckbbs.com
    ---
    þ Synchronet þ Roughneck BBS - roughneckbbs.com
  • From Tracker1@VERT/TRN to Sys64738 on Mon Dec 13 13:23:00 2021
    On 12/8/21 22:37, Sys64738 wrote:

    No doubt, the tools are far better. However, there doesn't seem to be
    as much consistency in the syntax of the programming languages that
    I've observed. Such as with "console.print" as an example. I'm not understanding why that command wouldn't be universal and a common
    command within JavaScript.

    I'm not sure, but I think the start of JS in Synchronet may pre-date the console object in the browser.

    Also, what would you expect console.log to do? Should it show to the host/server side, or to the client/user? It's not necessarily clear in
    this case.
    --
    Michael J. Ryan - tracker1@roughneckbbs.com
    ---
    þ Synchronet þ Roughneck BBS - roughneckbbs.com
  • From Tracker1@VERT/TRN to Sys64738 on Mon Dec 13 13:28:00 2021
    On 12/10/21 07:35, Sys64738 wrote:
    The console object defined in Synchronet's JS API might have fairly
    different requirements than for other contexts. When developing JS
    for a web browser, there is a 'console' object, but that's a totally
    different thing. The JS console object for Synchronet is for the
    text-based interface

    I understand what you're saying. Thanks for explaining.

    However, the concept of people making up their own commands seems like
    a taking a long walk on a short pier.

    `console` isn't part of the JavaScript language... things like `document.querySelector` aren't either. They're part of the running environment. In the case of the prior two examples a Browser.

    The BBS runtime environment(s) are different, and will have different
    features defined. What would you expect document.querySelector('body')
    to do with a telnet user? It's not the same...

    That said... for (var i=0; i< 10; i)) { ... } ... ARE part of the
    language definition.
    --
    Michael J. Ryan - tracker1@roughneckbbs.com
    ---
    þ Synchronet þ Roughneck BBS - roughneckbbs.com
  • From The Lizard Master@VERT/NITEEYES to Tracker1 on Tue Dec 14 03:45:00 2021
    Re: Re: Javascript for dummies like me
    By: Tracker1 to Sys64738 on Mon Dec 13 2021 06:20 pm

    I started out just using plain notepad. Since this is all new to me,
    I thought that I might benefit from the hints/debugging features from
    an editor.
    I would use at least Notepad++ or another more feature-rich text editor
    over plain notepad...

    Also check out sublimetext - https://www.sublimetext.com/

    I think that might be up his alley.

    ---TLM

    ---
    þ Synchronet þ Nite Eyes BBS - To make people happy about my tagline everywhere...
  • From MRO@VERT/BBSESINF to The Lizard Master on Tue Dec 14 04:06:00 2021
    Re: Re: Javascript for dummies like me
    By: The Lizard Master to Tracker1 on Tue Dec 14 2021 08:45 am

    Re: Re: Javascript for dummies like me
    By: Tracker1 to Sys64738 on Mon Dec 13 2021 06:20 pm

    I started out just using plain notepad. Since this is all new to me,
    I thought that I might benefit from the hints/debugging features from an editor.
    I would use at least Notepad++ or another more feature-rich text editor over plain notepad...

    Also check out sublimetext - https://www.sublimetext.com/

    I think that might be up his alley.


    that's kinda ugly. i'm sure it has theme support. i suggest editpad pro
    ---
    þ Synchronet þ ::: BBSES.info - free BBS services :::