% % insure node js window running/stopped % % stack: [ node-cmd ] turn-on partial-win-title % false !JS.Started "ConsoleWindowClass" % % identify the comm sender's browser window % % stack: document-title window-class % *indyfinf % % optional items included if window exists % stack: [ handle ] [ full-name ] [ class ] exists % dup !JS.Exists { !JS.Class "closd" log)( !JS.Caption !JS.Handle % % already running, see if close desired % { % % wants run, do nothing % pop } { % % wants closed, turn off nodejs window % _JS.Handle "close" log)( Win.Close pop } ifelse } { % % no such nodejs, start it if desired % { % % run the node command line % *runsminf true !JS.Started } { % % do not start nodejs command % } ifelse } ifelse