Skip to content
Snippets Groups Projects
Select Git revision
  • a880aa3087e429a567cd65a852b4242173d76dcf
  • master default
  • neil
  • hpgl
  • sw-shawn-liu
  • ppa
  • fran
  • trotec-port
  • fs-hotfix
  • jake
  • ml-mods
  • fabmo-app
12 results

files.html

Blame
  • terminal.js 1.05 KiB
    // boilerplate atkapi header
    const InOut = require('../../lib/jsunit.js')
    let Input = InOut.Input
    let Output = InOut.Output
    let State = InOut.State
    
    // a constructor, a fn, a javascript mess
    function Terminal() {
    
        var terminal = {
            // descriptions are used in UI
            description: {
                name: 'Terminal',
                alt: 'txt input'
            }
        }
    
        terminal.state = State()
        terminal.state.uiInput = 'line in here !'
    
        terminal.inputs = {
            lineIn: Input('string', newInput)
        }
    
        terminal.outputs = {
            lineOut: Output('string')
        }
    
        // we'll occasionally want a hook here to do stuff when a state variable is changed
        // these will fire if we change them internally, or if they're changed from the ui
        
        terminal.state.onChange('uiInput', function(){
            terminal.outputs.lineOut.emit(terminal.state.uiInput)
        })
        
        // internal funcs?
    
        function liChange(value){
            //
        }
    
        function newInput(str){
            // 
        }
    
        return terminal
    }
    
    // exports 
    module.exports = Terminal