Select Git revision
bootstrap.js 1.43 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
function bootloop() {
// js u wyldin ! (this is probably slow)
//let go = true
try {
NROL.loop()
} catch (err) {
//go = false
console.error('top level err:', err)
}
setTimeout(bootloop)
}
// want handles on this we think ?
let View = {}
window.onload = () => {
console.log('BOOTUP')
NROL.addHunk('view', 'tlview').then((view) => {
// console.log('ADDHUNK VIEW RESOLVES')
View = view
view.isTopLevelView = true
// not really sure about this yet
$(View.dom).attr('id', 'NROLVIEW')
$('#wrapper').get(0).append(View.dom)
}).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, 150)
}).catch((err) => {
console.log(err)
})
}