• First World Problems.

    From Accession@VERT/PHARCYDE to Digital Man on Thu Mar 3 17:01:10 2016
    Hello Digital Man,ããWhat would the *correct* way be to run nano from a javascript?ããI've tried..ããsystem.exec("/usr/bin/nano"); ãbbs.exec("/usr/bin/nano",mode=EX_NATIVE); ãã..and neither of them seem to work. Synchronet runs as root so permissions are not an issue.ããIf it isn't possible, or shouldn't be done, then I was wondering if some kind of stacking could be done in the "External Editor" section. Say if you used the same internal code for two External Editor entries, it would run the first one, then the second?ããI'm trying to run a javascript (which tinkers with /sbbs/node?/MSGTMP) before nano loads, but during the same process. And while the script seems to work fine when NOT trying to load nano in it (it rewrites MSGTMP and posts the reply, but without nano able to load, the reply is unable to be edited), and nano will load from the External Editors menu by itself, I'd like to do both in one shot if at all possible.ããRegards,ãNickãã--- GoldED+/LNX 1.1.5-b20160201ã þ Synchronet þ thePharcyde_ telnet://bbs.pharcyde.org (Wisconsin)ã
  • From Digital Man@VERT to Accession on Thu Mar 3 18:21:49 2016
    Re: First World Problems.ã By: Accession to Digital Man on Thu Mar 03 2016 05:01 pmãã > Hello Digital Man,ã >ã > What would the *correct* way be to run nano from a javascript?ã >ã > I've tried..ã >ã > system.exec("/usr/bin/nano");ã > bbs.exec("/usr/bin/nano",mode=EX_NATIVE);ã >ã > ..and neither of them seem to work. Synchronet runs as root so permissionsã > are not an issue.ããBoth of these will execute "/usr/bin/nano". But if you want the input/output toãbe intercepted and sent to the remote user, you'll need use either bbs.exec()ãwith the EX_INR and EX_OUTR flags set (for input and output redirection), likeãso:ã bbs.exec("/usr/bin/nano", EX_NATIVE|EX_INR|EX_OUTR);ããBut the best way to run an external editor is to configure it as an externalãeditor (in SCFG) and run it from JS with console.editfile(filename);ãã digital manããSynchronet "Real Fact" #78:ã172 Synchronet Match Maker registrations were sold (@$69) between 1995 and 1996.ãNorco, CA WX: 63.5øF, 70.0% humidity, 4 mph E wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
  • From Accession@VERT/PHARCYDE to Digital Man on Fri Mar 4 16:27:42 2016
    Hello Digital,ããOn 03 Mar 16 18:21, Digital Man wrote to Accession:ãã >> system.exec("/usr/bin/nano");ã >> bbs.exec("/usr/bin/nano",mode=EX_NATIVE);ã >>ã >> ..and neither of them seem to work. Synchronet runs as root soã >> permissions are not an issue.ãã DM> Both of these will execute "/usr/bin/nano". But if you want theã DM> input/output to be intercepted and sent to the remote user, you'llã DM> need use either bbs.exec() with the EX_INR and EX_OUTR flags set (forã DM> input and output redirection), likeã DM> so:ã DM> bbs.exec("/usr/bin/nano", EX_NATIVE|EX_INR|EX_OUTR);ããThis worked! And oddly enough worked awesome at that!ãã DM> But the best way to run an external editor is to configure it as anã DM> external editor (in SCFG) and run it from JS withã DM> console.editfile(filename);ããNot sure I understand what you mean here. By "run it from JS" you mean nano?ããI suppose I should explain what is going on. I asked Nightfox if he could rip out the function in SlyEdit that reformats MSGTMP with quoted initials, so I could offer up nano as a message editor as well (and possibly even vim in the future), since they can be used in "restricted" mode where nothing on the disk can be altered except the file loaded, ie: MSGTMP.ããSo after all of that is done, and a new formatted MSGTMP is created, the JS runs nano, where you can edit and save, and then the JS posts the message and exits back to the BBS.ããSo if there's a better way than the first option above you gave, by all means explain it to me in laman's terms and I'll give that a shot as well. :)ããRegards,ãNickãã--- GoldED+/LNX 1.1.5-b20160201ã þ Synchronet þ thePharcyde_ telnet://bbs.pharcyde.org (Wisconsin)ã
  • From Digital Man@VERT to Accession on Sat Mar 5 19:35:05 2016
    Re: Re: First World Problems.ã By: Accession to Digital Man on Fri Mar 04 2016 04:27 pmãã > Hello Digital,ã >ã > On 03 Mar 16 18:21, Digital Man wrote to Accession:ã >ã > >> system.exec("/usr/bin/nano");ã > >> bbs.exec("/usr/bin/nano",mode=EX_NATIVE);ã > >>ã > >> ..and neither of them seem to work. Synchronet runs as root soã > >> permissions are not an issue.ã >ã > DM> Both of these will execute "/usr/bin/nano". But if you want theã > DM> input/output to be intercepted and sent to the remote user, you'llã > DM> need use either bbs.exec() with the EX_INR and EX_OUTR flags set (forã > DM> input and output redirection), likeã > DM> so:ã > DM> bbs.exec("/usr/bin/nano", EX_NATIVE|EX_INR|EX_OUTR);ã >ã > This worked! And oddly enough worked awesome at that!ã >ã > DM> But the best way to run an external editor is to configure it as anã > DM> external editor (in SCFG) and run it from JS withã > DM> console.editfile(filename);ã >ã > Not sure I understand what you mean here. By "run it from JS" you mean nano?ããThe editor. The console.editfile() method uses whatever editor the user hasãselected as their preferred editor to edit the filename passed.ãã > I suppose I should explain what is going on. I asked Nightfox if he couldã > rip out the function in SlyEdit that reformats MSGTMP with quoted initials,ã > so I could offer up nano as a message editor as well (and possibly even vimã > in the future), since they can be used in "restricted" mode where nothing onã > the disk can be altered except the file loaded, ie: MSGTMP.ã >ã > So after all of that is done, and a new formatted MSGTMP is created, the JSã > runs nano, where you can edit and save, and then the JS posts the messageã > and exits back to the BBS.ã >ã > So if there's a better way than the first option above you gave, by allã > means explain it to me in laman's terms and I'll give that a shot as well.ããIt sounds like you want to use SlyEdit as a quoter, but not an editor? There'sãreally no built-in method in Synchronet to do that (support externalã"quoters"). If you just want to use nano as an editor and don't need anythingãfrom SlyEdit, the proper way would be to configure nano in SCFG->ExternalãPrograms->External Editors.ãã digital manããSynchronet "Real Fact" #35:ãSynchronet's Windows DLLs are built with Microsoft Visual Studio/C++.ãNorco, CA WX: 59.6øF, 84.0% humidity, 3 mph ESE wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
  • From Accession@VERT/PHARCYDE to Digital Man on Sun Mar 6 06:10:09 2016
    Hello Digital Man,ãã Ac>> Not sure I understand what you mean here. By "run it from JS" you meanã Ac>> nano? ãã DM> The editor. The console.editfile() method uses whatever editor the userã DM> has selected as their preferred editor to edit the filename passed.ããEven when nano itself is not configured in External Editors? I don't see how the JS could know that the user is actually selecting nano as their editor. See below..ãã Ac>> I suppose I should explain what is going on. I asked Nightfox if heã Ac>> could rip out the function in SlyEdit that reformats MSGTMP withã Ac>> quoted initials, so I could offer up nano as a message editor as wellã Ac>> (and possibly even vim in the future), since they can be used inã Ac>> "restricted" mode where nothing on the disk can be altered except theã Ac>> file loaded, ie: MSGTMP. ã ã Ac>> So after all of that is done, and a new formatted MSGTMP is created,ã Ac>> the JS runs nano, where you can edit and save, and then the JS postsã Ac>> the message and exits back to the BBS.ãã Ac>> So if there's a better way than the first option above you gave, byã Ac>> all means explain it to me in laman's terms and I'll give that a shotã Ac>> as well. ãã DM> It sounds like you want to use SlyEdit as a quoter, but not an editor?ããSomething like that. Basically only the function of SlyEdit that retreives the name in the TO field for initials, and quote/reformat/rewrap function of SlyEdit is being used here, so "SlyEdit" as a whole is not being used, correct.ãã DM> There's really no built-in method in Synchronet to do that (supportã DM> external "quoters"). If you just want to use nano as an editor and don'tã DM> need anything from SlyEdit, the proper way would be to configure nano inã DM> SCFG->External Programs->External Editors.ããUnderstood. What we've done here is basically strip those mentioned functions out of SlyEdit, and along with some added error checking as well as checking to make sure QUOTES.TXT is present (if not, edit the message as "new"), and check for modifications to MSGTMP (if not, abort the message), and then nano is ran from the script using bbs.exec().ããSo basically I think we've gotten it to the point where you can run ?msgQuoteWrap.js "/usr/bin/nano [-opts]" %f from the command line in External Editors, the script takes care of the options and editor you choose,aand away you go!ããWith this being said, vi(m) also seems to work, although it seems some of the backspace/delete stuff may have to be tinkered with on my end, but that's minimal.ããRegards,ãNickãã---ã þ Synchronet þ thePharcyde_ telnet://bbs.pharcyde.org (Wisconsin)ã
  • From Nightfox@VERT/DIGDIST to Accession on Sun Mar 6 16:55:19 2016
    Re: Re: First World Problems.ã By: Accession to Digital Man on Sun Mar 06 2016 06:10:09ãã DM>> The editor. The console.editfile() method uses whatever editor theã DM>> user has selected as their preferred editor to edit the filenameã DM>> passed. ãã Ac> Even when nano itself is not configured in External Editors? I don't seeã Ac> how the JS could know that the user is actually selecting nano as theirã Ac> editor.ããFor console.editfile(), the editor would need to be configured in ExternalãEditors. So to do that with Nano, Nano would need to be set up in ExternalãEditors and the user would have had to select it as their editor. ãconsole.editfile() is simply a function that tells Synchronet to let the userãedit a file with whatever editor they've chosen.ããNightfoxãã---ã þ Synchronet þ Digital Distortion: digitaldistortionbbs.comã
  • From Accession@VERT/PHARCYDE to Nightfox on Sun Mar 6 21:22:51 2016
    Hello Nightfox,ããOn 06 Mar 16 16:55, Nightfox wrote to Accession:ãã Ac>> Even when nano itself is not configured in External Editors? Iã Ac>> don't see how the JS could know that the user is actuallyã Ac>> selecting nano as their editor.ãã Ni> For console.editfile(), the editor would need to be configured inã Ni> External Editors. So to do that with Nano, Nano would need to be setã Ni> up in External Editors and the user would have had to select it asã Ni> their editor. console.editfile() is simply a function that tellsã Ni> Synchronet to let the user edit a file with whatever editor they'veã Ni> chosen.ããAh okay. So in our case this isn't an option. Seems the way we're doing it may be the easiest and best suitable for what I'm trying to accomplish.ããRegards,ãNickãã--- GoldED+/LNX 1.1.5-b20160201ã þ Synchronet þ thePharcyde_ telnet://bbs.pharcyde.org (Wisconsin)ã
  • From Digital Man@VERT to Accession on Sun Mar 6 20:29:43 2016
    Re: Re: First World Problems.ã By: Accession to Digital Man on Sun Mar 06 2016 06:10 amãã > Hello Digital Man,ã >ã > Ac>> Not sure I understand what you mean here. By "run it from JS" you meanã > Ac>> nano?ã >ã > DM> The editor. The console.editfile() method uses whatever editor the userã > DM> has selected as their preferred editor to edit the filename passed.ã >ã > Even when nano itself is not configured in External Editors? I don't see howã > the JS could know that the user is actually selecting nano as their editor.ã > See below..ããNo, nano would have to be configured as an external editor in SCFG.ãã digital manããSynchronet "Real Fact" #58:ãSynchronet apparel and merchandise can be purchased at cafepress.com/synchronetãNorco, CA WX: 54.8øF, 73.0% humidity, 3 mph ESE wind, 0.20 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã