• Can you have JS determine logon

    From mhansel739 to All on Tuesday, April 18, 2023 13:16:40
    At this time, I have a weather app that works quite well. But to have it run at logon and have it run as a separate door, I have to setup two separate copies of the app. One of them reads the user's zip code (or uses the system zip code) - this is the one at logon. The other one asks the zip code for the weather the user wants - the external app. Can you, in Javascript for Synchronet, determine if the app is being run at logon or as an external app? Or is there something I am missing? I am relatively new to Javascript, so I could use some pointers. The files for the app are located on my github: https://github.com/mhansel7399/SyncWeather
    Thanks in advance.
    --Matt
  • From Digital Man to mhansel739 on Tuesday, April 18, 2023 13:55:34
    Re: Can you have JS determine logon
    By: mhansel739 to All on Tue Apr 18 2023 01:16 pm

    At this time, I have a weather app that works quite well. But to have it run at logon and have it run as a separate door, I have to setup two separate copies of the app. One of them reads the user's zip code (or uses the system zip code) - this is the one at logon. The other one asks the zip code for the weather the user wants - the external app. Can you, in Javascript for Synchronet, determine if the app is being run at logon or as an external app? Or is there something I am missing? I am relatively new to Javascript, so I could use some pointers.

    I would just check if(bbs.node_action == NODE_LOGN) to check if the user is in the logon process.
    https://synchro.net/docs/jsobjs.html
    Note: Don't confuse with NODE_LOGON (that's a different value for a different purpose).
    --
    digital man (rob)

    Synchronet/BBS Terminology Definition #58:
    PCMS = Programmable Command and Menu Structure (introduced in SBBS v2)
    Norco, CA WX: 63.3°F, 62.0% humidity, 9 mph S wind, 0.00 inches rain/24hrs
  • From mhansel739 to Digital Man on Tuesday, April 18, 2023 13:59:52

    Thanks! I will check that out tonight and post my results!
  • From mhansel739 to Digital Man on Tuesday, April 18, 2023 15:16:16

    I added that piece of code to the system and it works like a charm!!! Thank you for your quick assist on this. I truly appreciate it.
    --Matt
  • From Phigan@TACOPRON to mhansel739 on Tuesday, April 18, 2023 20:45:03
    Re: Can you have JS determine logon
    By: mhansel739 to All on Tue Apr 18 2023 01:16 pm

    the weather the user wants - the external app. Can you, in Javascript for Synchronet, determine if the app is being run at logon or as an external app? Or is there something I am missing? I am relatively new to Javascript,

    Can you make it so it takes command line parameters? That way if you run it with -from-login or something, it does the detection... or -ask-zip makes it asks for the zip without detection.

    ---
    ■ Synchronet ■ TIRED of waiting 2 hours for a taco? GO TO TACOPRONTO.bbs.io
  • From Phigan@TACOPRON to mhansel739 on Tuesday, April 18, 2023 20:46:56
    Re: Can you have JS determine logon
    By: mhansel739 to Digital Man on Tue Apr 18 2023 03:16 pm

    I added that piece of code to the system and it works like a charm!!! Thank you for your quick assist on this. I truly appreciate it.

    Nice. Ignore my suggestion :).

    ---
    ■ Synchronet ■ TIRED of waiting 2 hours for a taco? GO TO TACOPRONTO.bbs.io