diff --git a/README.md b/README.md index 4a104ce29c578b494ba600abe28edde633c399c4..1ebdc428b6bdaf15ad0c3b69df40d94618959fe4 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,18 @@ Native Cuttlefish 'Hunks' are given access to a DOM/div element, making them nic  +# Usage + +To run Cuttlefish, I install node.js, and then it's http-server package. To install node.js, you can follow instructions [on the Nautilus page](https://gitlab.cba.mit.edu/squidworks/nautilus) and then run: + +``npm install -g http-server`` + +Now, from the cuttlefish directory, you should be able to do: + +``http-server`` + +And a small program will start up, serving the files in the directory to any browser that you point at the address it lists. Now you're running cuttlefish. + ## The Latest I'm excited about this, so here's an image: @@ -181,12 +193,16 @@ From there, I think the most important work to do is developing the hunks themse # Scratch ok, this is about to be rad, and useable (yay) +- global organize ... +- or just stick to saving systems, loading systems ? - basic load -> merge program -> ponyo dev - ok, quit, write, draw machine borked: --> items pushing at edge of window now bork themselves +-> items pushing at edge of window now bork themselves (killed the resize mechanism, want it back?) +-> rectangular collision detection could use some tunning... ++ force, maybe tune relative link strength ? -> refresh view / removing hunks all borked due to floaters +-> change / add to link needs to work again then - links with link status diff --git a/hunks/template.js b/hunks/template.js index dc0a41d8ac67452370f58d1972e71702888ad05f..ae107b4c10babc94019fb348de25c80502154791 100644 --- a/hunks/template.js +++ b/hunks/template.js @@ -11,7 +11,7 @@ let Output = Hunk.Output let State = Hunk.State function Name() { - Hunkify(this, 'Name') + Hunkify(this) let inA = new Input('type', 'name', this) this.inputs.push(inA) diff --git a/hunks/view.js b/hunks/view.js index 822787b4c3232754f2803a47d12eba1c66f0879c..732b01957f2844d3975671d209c1aaba091b8629 100644 --- a/hunks/view.js +++ b/hunks/view.js @@ -373,53 +373,36 @@ function View() { console.log('GO FIND RECIP', next) } - let isOnTier(l) => { + let isOnTier = (l) => { // l - level ... // ... do by link-input-level: assume views->route->route-> 'terminate' at a link.inputs[1], [0] being dataport, [1] being mgrmsgs } + let assembleTree = () => { + // walk links ? walk graph ? how ? + } + // need to consider heirarchy traversal, probably we will // want to use the same tools for saving systems // maybe don't worry about it just yet, focus on getting to - // a ponyo devboard + // a ponyo devboard this.globalOrganize = () => { console.log("GO-ING") + let links = [] // views are our touchstones for this, for (let df of defs) { - if (df.type === 'view' && df.name !== 'tlview') { - // need a nesting level to properly do this, - // we actually need to open the lower level, to find the terminal - // manager, to determine which context this is for - // let's see, for now, some pseudocode - let view = findAllViews() - // have to traverse heirarchy, so first step is just this: - for(let vw of views){ - // we (toplevel) are tier 0 - if(isOnTier(1)){ - vw.refresh().then(() => { - // ?? search the net again, find more teirs ?? - }) - } - } - /* - df.hunk.refresh().then((view) => { - // resovles itself, - for(let vdf of view.defs){ - // we *have* to take for granted that 1th-positioned mgrMsgs - // are hooked to a manager, not *thru* to another manager, otherwise - // we can't know if the link we are opening ... is it - console.log('have', vdf.name) - } - console.log('GO REFRESHED') - }) - */ - //$(df.deg.native).children('.view').addClass('offwhite') - // find a route to it's link ... - + // but links are the way home, so + if (df.type === 'link') { + links.push(df) } } + // ok + if (links.length > 0) { + console.log(`GO finds ${links.length} links`) + } } + this.expandLink = (linkDef) => { return new Promise((resolve, reject) => { // i.e. requestAddHunk isn't necessarily hooked to this