• Getting started with Javascript and Sync, where to go?

    From Sam Alexander@VERT/2400BAUD to All on Sun Apr 12 15:28:17 2015
    Hi all,

    I'm just starting to get more into some Javascript programming at work, and I'd like to start using some of this to write Sync add-ins. Problem though is I'm not sure where to start. Most of the javascript I write at work is for web, so are there any tutorials or simple examples showing how to write basic menus or screens for Sync? Like showing a list, arrowing down or selecting the item by letter, then refreshing the screen with new content, that kind of stuff.

    Also is it easy to save data back to however Sync stores data? I have a few ideas of add-ins I'd like towrite, but most will require saving user data and pulling data from the user's profile.

    Thanks for any suggestions or ideas. Take care.
    Sam

    ---
    þ Synchronet þ 2400 Baud BBS - Waco, Tx - telnet://2400baud.net
  • From Nightfox@VERT/DIGDIST to Sam Alexander on Sun Apr 12 15:55:44 2015
    Re: Getting started with Javascript and Sync, where to go?
    By: Sam Alexander to All on Sun Apr 12 2015 08:28:17

    I'm just starting to get more into some Javascript programming at work, and I'd like to start using some of this to write Sync add-ins. Problem though is I'm not sure where to start. Most of the javascript I write at work is for web, so are there any tutorials or simple examples showing how to write basic menus or screens for Sync? Like showing a list, arrowing down or selecting the item by letter, then refreshing the screen with new content, that kind of stuff.

    I was the same way, I wanted to learn JavaScript (since it's a commonly-used language), and writing some JavaScript mods for Synchronet helped me understand the language better.
    I haven't seen specific tutorials on Synchronet JavaScript, but I think it can be good to look at existing Sync JS mods as an example. If you want an example of item selection from a list & using arrow keys to go up & down, as you mentioned, one of my mods is a couple of file & message area choosers that use a lightbar interface: ftp://www.digitaldistortionbbs.com/bbs/SYNC_JS/ddac_107.zip

    Other than looing at other Sync mods, if you've done some programming already, I think a good place to start is to learn about the language and then try making some simple things with it (in a sort of "sandbox" project) for practice. There are lots of JavaScript tutorials online - Almost all are geared toward a web environment though, but they still can be useful in getting to know the language. Once you start to get familiar with JavaScript, there's some good documentation on Synchronet's JavaScript object model, which lists all the objects & functions that Synchronet provides to JavaScript for interacting with Synchronet:
    http://www.synchro.net/docs/jsobjs.html

    Also is it easy to save data back to however Sync stores data? I have a few ideas of add-ins I'd like towrite, but most will require saving user data and pulling data from the user's profile.

    That Synchronet JavaScript page I linked above describes everything Synchronet makes available to JavaScript.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.com
  • From Sam Alexander@VERT/2400BAUD to Nightfox on Sun Apr 12 19:53:52 2015
    Re: Getting started with Javascript and Sync, where to go?
    By: Nightfox to Sam Alexander on Sun Apr 12 2015 08:55 am

    Re: Getting started with Javascript and Sync, where to go?
    By: Sam Alexander to All on Sun Apr 12 2015 08:28:17 ftp://www.digitaldistortionbbs.com/bbs/SYNC_JS/ddac_107.zip
    That Synchronet JavaScript page I linked above describes everything Synchronet makes available to JavaScript.

    I was hoping you'd reply, I just started reading through some of your JS apps last night, and I even installed SlyEdit on the board I just setup this weekend to see how it works. It's an example of the types of Sync apps I really want to learn how to write. I read through some of your scripts, but I didn't check out the Area Chooser you linked to -- downloading it now.

    Thanks --
    Sam

    ---
    þ Synchronet þ 2400 Baud BBS - Waco, Tx - telnet://2400baud.net
  • From Deuce@VERT/SYNCNIX to Sam Alexander on Tue Apr 14 19:10:47 2015
    Re: Getting started with Javascript and Sync, where to go?
    By: Sam Alexander to All on Sun Apr 12 2015 08:28 am

    Also is it easy to save data back to however Sync stores data? I have a few ideas of add-ins I'd like towrite, but most will require saving user data and pulling data from the user's profile.

    There's a few ways of varying degrees of "easy".

    Simplest for some stuff is the ini*() methods of the File class. More complex is the basic file I/O stuff.

    Then there's the recordfile stuff... looks like it's not documented though, so I wouldn't reccomend it unless you need to store data in a binary format.

    Next up would be using the File class and JSON object to read/write JSON files.

    After that would be the JSON DB stuff from mcmlxxix. Quite nice, but has some configuration requirements and a couple gotchas.

    ---
    http://DuckDuckGo.com/ a better search engine that respects your privacy.
    þ Synchronet þ My Brand-New BBS (All the cool SysOps run STOCK!)