• Call Built-in Editor from Javascript

    From Blakdeth@MASQBBS to All on Sunday, June 01, 2008 10:07:21
    This might be wishful thinking, but is there a way to call the SBBS built-in editor from a Javascript process? I would love to have the ability to call the built-in editor in much the same way one would call getstr. That is, you would have the option of passing in text to edit, and then the built-in editor
    would return the edited text as a string to the calling process. Thoughts?

    -bd
    --
    Blakdeth
    Masquerade BBS // telnet://masqueradebbs.com
    http://www.masqueradebbs.com // blakdeth@masqueradebbs.com


    ---
    ■ Synchronet ■ Masquerade BBS - http://www.masqueradebbs.com
  • From Digital Man to Blakdeth on Sunday, June 01, 2008 11:50:51
    Re: Call Built-in Editor from Javascript
    By: Blakdeth to All on Sun Jun 01 2008 10:07 am

    This might be wishful thinking, but is there a way to call the SBBS
    built-in editor from a Javascript process? I would love to have the ability to call the built-in editor in much the same way one would call getstr.
    That is, you would have the option of passing in text to edit, and then the built-in editor would return the edited text as a string to the calling process. Thoughts?

    You can use console.editfile() to edit or create a text file (see http://synchro.net/docs/jsobjs.html#console_methods for details) and then read that file into your script with File.readAll().

    digital man (xbox-live: digitlman)

    Snapple "Real Fact" #107:
    You burn more calories sleeping than watching TV.
    Norco, CA WX: 64.2°F, 67% humidity, 0 mph SE wind, 0.00 inches rain/24hrs
  • From Deuce@SYNCNIX to Blakdeth on Sunday, June 01, 2008 13:13:08
    Re: Call Built-in Editor from Javascript
    By: Blakdeth to All on Sun Jun 01 2008 10:07 am

    This might be wishful thinking, but is there a way to call the SBBS
    built-in editor from a Javascript process? I would love to have the ability to call the built-in editor in much the same way one would call getstr.
    That is, you would have the option of passing in text to edit, and then the built-in editor would return the edited text as a string to the calling process. Thoughts?

    Almost, and you can do it...

    console.editfile() and system.temp_dir are a good place to start. Though I don't see a function to generate a temporary filename, so you'll want to either do that or put it in the node directory instead.

    ---
    Synchronet - Jump on the Web 0.2 bandwagon!

    ---
    ■ Synchronet ■ My Brand-New BBS (All the cool SysOps run STOCK!)
  • From Blakdeth@MASQBBS to Digital Man on Monday, June 02, 2008 08:27:04

    This might be wishful thinking, but is there a way to call
    the SBBS built-in editor from a Javascript process? I
    would love to have the abili to call the built-in editor
    in much the same way one would call getstr. That is, you
    would have the option of passing in text to edit, and then
    t built-in editor would return the edited text as a string
    to the calling process. Thoughts?
    You can use console.editfile() to edit or create a text file
    (see http://synchro.net/docs/jsobjs.html#console_methods for
    details) and then re that file into your script with
    File.readAll().

    Thank you digital man and Deuce. I appreciate the input. I will give this a try.

    -bd
    --
    Blakdeth
    Masquerade BBS // telnet://masqueradebbs.com
    http://www.masqueradebbs.com // blakdeth@masqueradebbs.com


    ---
    ■ Synchronet ■ Masquerade BBS - http://www.masqueradebbs.com