Skip to content
Snippets Groups Projects
Select Git revision
  • f452f3f4c1eefc3d5d5008c4cde5d30f03b3bb81
  • master default protected
2 results

pi.js

Blame
  • bootstrap.js 2.26 KiB
    // IDDE sends msgs to manager, does display etc
    // starts with a native manager
    
    /* codename NROL39 aka cuttlefish */
    /* aka the teuthologist */
    
    // this is toplevel, UI is meta-hunk
    // we run loop where UI passes messages to bower manager
    // this is like the manager 'bootstrap' file ?
    
    import Manager from './hunks/manager.js'
    
    // this is the TL
    // but heirarchichally, we can slave views to managers ...
    // views push messages to managers ...
    
    // our invisible overlord
    let NROL = new Manager()
    NROL.name = 'nrol'
    // init sets type and ind,
    NROL.init()
    // this is going to sit in the outbuffer until the view resolves
    
    // runs the loop inside of V8's loop: this way our interpreter is non-blocking
    // for other js async business
    function bootloop() {
      // js u wyldin ! (this is probably slow)
      try {
        NROL.loop()
      } catch (err) {
        console.error('ERR @ top of loop:', err)
      }
      setTimeout(bootloop)
    }
    
    // want handles on this we think ?
    let view = {}
    let land
    
    window.onload = () => {
      console.log('BOOTUP')
      NROL.addHunk('view', null, 'tlview').then((vw) => {
        // console.log('ADDHUNK VIEW RESOLVES')
        // gotta git this
        view = vw
        $('#wrapper').get(0).append(view.dom)
        view.onload()
        view.makeTopLevel()
        console.log("MTL'd")
      }).then(() => {
        // outHunkIndex, outIndex, inHunkIndex, inIndex, debug
        NROL.addLink(1, 0, 0, 0, false)
        NROL.addLink(0, 0, 1, 0, false)
        bootloop()
        // kick this later
        setTimeout(() => {
          view.refresh().then(() => {
            // if you make links work properly (directionfull)
            // you can just pin view outputs to the left, collected,
            // and the rest should sort itself out
            view.defs[0].floaters[0].fixTo(700,200)
            view.defs[1].unwrap()
            view.defs[1].floaters[0].fixTo(400, 100)
            //view.defs[1].floaters[1].fixTo(800, 300)
            // xtra
            /*
              view.patchset.mergePatch('nttport').then(() => {
                let nlink = view.defs.find((cnd) => {
                  return cnd.type === 'link'
                })