• Call Built-in Editor from Javascript

    From Blakdeth@VERT/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@VERT 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

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuce@VERT/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@VERT/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