diff --git a/bootstrap.js b/bootstrap.js index a7bd14ccb5397507d199265665b185cadd9d42b5..f2ee890b39bf8e1e915a5b5450dcc5ba4cf68d36 100644 --- a/bootstrap.js +++ b/bootstrap.js @@ -19,6 +19,8 @@ let NROL = new Manager() NROL.name = 'manager' NROL.id = 'NROL39_0' NROL.init() +// this is going to sit in the outbuffer until the view resolves +NROL.sendHunkAsDef(NROL) function bootloop() { NROL.loop() diff --git a/hunks/hidden/view.js b/hunks/hidden/view.js index 6af366a649e677d5c285029f37df63ab1438e890..f734935f75599bf122bfe2d4b0025e7ed18171bd 100644 --- a/hunks/hidden/view.js +++ b/hunks/hidden/view.js @@ -220,7 +220,7 @@ function View() { // donot } else { // case for adding / rming from sim - console.log('UPD8 Force Sim') + this.log('UPD8 Force Sim') let positions = this.getAllHunkPositions() if (positions.length > flnodes.length) { let last = positions.length - 1 @@ -389,14 +389,12 @@ function View() { // not interested in adding the top level's view to itself // TODO probably this is a bugfarm when we go to nest views if (def.dom !== null && def.dom !== undefined && def.id !== 'TLView') { - console.log('a cuttlefish hunk appears') + this.log(`${def.id} UI DOM appears...`, def.dom) try { $(de).append($(def.dom).addClass('cuttlefishhunkdom')) } catch (err) { console.log('error while appending cfhnk to dom', err) } - } else { - console.log('dom w/o cuttlefish') } writeTransform(de, mt) // rm menu if it's around @@ -747,10 +745,10 @@ function View() { // for bringing the dom element over *which is specific to a native manager* // so TODO: add switch for native / nonative managers let data = this.inputs.msgs.data - console.log(this.id, 'has msg', data) let pult = this.inputs.msgs.get() let header = data.header let content = data.content + this.log(`gets msg ${header}`) switch (header) { case 'putcontextoptions': addContextOptions(content) diff --git a/hunks/manager.js b/hunks/manager.js index 7ec23aa7d9d2f420b412567ac20484bcb743437c..2fd7de06defce27c55bf2fd2157473ef06fd1e82 100644 --- a/hunks/manager.js +++ b/hunks/manager.js @@ -4,41 +4,6 @@ js context manager */ -/* -node imports -const Hunk = require('./hunk.js') -let Hunkify = Hunk.Hunkify -let Input = Hunk.Input -let Output = Hunk.Output -let State = Hunk.State - -const fs = require('fs') -*/ - -// code should remain identical to node implementation \/ -/* changes made - - - process.hrtime() / profiling is gone - - profiling question: does not-calling to process.hrtime() reduce the 100% duty cycle on the cpu ? - - running this in the browser with .setimmediate() does *not* poll the cpu all crazy like - - fs. does not exist ... - - - -*/ - -/* - -browser manager *also contains* mucho UI state -i.e. it contains a mirrored list of views ... having def's which are doms - -*/ - -// at the moment: making this header match others, -// maybe Hunkify.writeDefinition(hunk) or something -// and then abstracting fs out, and unfucking logs (in hunkify as well) -// and then scrape and go, and back to watching view to open up... -// towards ... we need to feel confident here, before we can describe messages and plan for cpp - import { Hunkify, Input, Output, State } from './hunks.js' import GoGetter from '../gogetter.js' @@ -447,9 +412,7 @@ function Manager() { // startup by giving ourselves an ID if we haven't been assigned one? // and then adding ourselves to ourselves ? hunks.push(this) - this.log('manager hello, id is', this.id) - console.log(hunks) - this.log(hunks) + this.log(`manager hello, id is ${this.id}`) } this.loop = () => { @@ -457,7 +420,7 @@ function Manager() { let msg = this.inputs.msgs.get() let header = msg.header let content = msg.content - console.log(this.id, 'has msg', msg) + this.log(`gets msg ${header}`) switch (header) { case 'hello': let options = this.getHelloResponses()