Skip to content
Snippets Groups Projects
bootstrap.js 1.33 KiB
Newer Older
  • Learn to ignore specific revisions
  • // IDDE sends msgs to manager, does display etc
    
    Jake Read's avatar
    Jake Read committed
    // 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 ?
    
    Jake Read's avatar
    Jake Read committed
    
    import Manager from './hunks/manager.js'
    
    // this is the TL
    
    // but heirarchichally, we can slave views to managers ...
    // views push messages to managers ...
    
    Jake Read's avatar
    Jake Read committed
    
    // our invisible overlord
    let NROL = new Manager()
    
    NROL.name = 'manager'
    
    Jake Read's avatar
    Jake Read committed
    NROL.id = 'NROL39_0'
    
    NROL.init()
    
    // this is going to sit in the outbuffer until the view resolves
    
    Jake Read's avatar
    Jake Read committed
    
    function bootloop() {
    
    Jake Read's avatar
    Jake Read committed
        // js u wyldin !
        try{
          NROL.loop()
        } catch (err) {
          console.log('top level err:', err)
        }
    
    Jake Read's avatar
    Jake Read committed
        setTimeout(bootloop)
    }
    
    
    // want handles on this we think ?
    
    Jake Read's avatar
    Jake Read committed
    let View = {}
    
    
    window.onload = () => {
        console.log('BOOTUP')
    
        NROL.addHunk('view', 'TLView').then((view) => {
    
            // console.log('ADDHUNK VIEW RESOLVES')
    
            $(View.dom).attr('id', 'NROLVIEW')
    
            $('#wrapper').get(0).append(View.dom)
        }).then(() => {
            NROL.addLink(View.id, 'msgs', NROL.id, 'msgs')
            NROL.addLink(NROL.id, 'msgs', View.id, 'msgs')
            bootloop()
    
            // kick this later
            setTimeout(View.refresh, 150)
    
    Jake Read's avatar
    Jake Read committed
        }).catch((err) => {
            console.log(err)