From e1c47c60d6b37d36d2a11ece06ccc33d2ea535da Mon Sep 17 00:00:00 2001 From: Jake <jake.read@cba.mit.edu> Date: Thu, 30 May 2019 16:49:55 -0400 Subject: [PATCH] hookup view doms to link defs --- README.md | 8 +++++++- hunks/view.js | 15 ++++++++++++--- style.css | 4 ++++ view/vdef.js | 11 ++++++----- 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 4bd3ed5..b2b025e 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,12 @@ Native Cuttlefish 'Hunks' are given access to a DOM/div element, making them nic # Scratch +- sleeper .hidden +- sleeper append to link, +- view doms can expand ? +- hidden .insideout backgrounds ? +- link walls, etc + - view ... compartmentalize, then .makeTopLevel(dom) - not going to change messaging structure - but only top level can run routines like 'expand link' ... @@ -35,7 +41,7 @@ Native Cuttlefish 'Hunks' are given access to a DOM/div element, making them nic - link exists - view appears, - routes connect - - then we can draw + - then we can draw - considering more link complexity: when a link is NC on the other end, inputs to it should vanish into aether, same as an nc output in a program, no? this also means we don't have to keep track of whether a manager is hooked up anywhere or not diff --git a/hunks/view.js b/hunks/view.js index c1f10de..ef50410 100644 --- a/hunks/view.js +++ b/hunks/view.js @@ -374,10 +374,14 @@ function View() { $(this.plane).append(def.de) dt.writeTransform(def.de, { s: 1, - x: 500, - y: 500 + x: 1, + y: 1 }) defs.push(def) + // oh .. eventually this will hook to a link, but for now ... + if(def.name !== 'tlview'){ + $(def.de).append($(native.dom).addClass('sleeper')) + } } else { console.error('cannot find view dom or ref', def) } @@ -906,7 +910,12 @@ function View() { // i.e. requestAddHunk isn't necessarily hooked to this // it's always tlview.requestAddHunk this.requestAddHunk('view').then((viewDef) => { - console.log('new view', viewDef) + // jquery moves automatically ? + let viewDe = $(viewDef.de).find('.sleeper').get(0) + $(linkDef.de).append(viewDe) + $(viewDe).removeClass('sleeper') + linkDef.setPlaneWidth(1200) + // hook it 2 ur veins console.log('adding one link...') this.requestAddLink(linkDef.outputs[1], viewDef.inputs[0]) .then(() => { diff --git a/style.css b/style.css index 0581558..7ddd682 100644 --- a/style.css +++ b/style.css @@ -54,6 +54,10 @@ body { background-size: 100px 100px; } +.view.sleeper{ + display: none; +} + .msgbox { width: 300px; height: 90%; diff --git a/view/vdef.js b/view/vdef.js index 6402e80..56e0a64 100644 --- a/view/vdef.js +++ b/view/vdef.js @@ -160,16 +160,17 @@ function HunkDefinition(spec, view, dt, debug) { /* --------------------- SOME ARE UNIQUE --------------------- */ /* --------------------------- ---------------------------- */ - // inside-out defs, this.makeInsideOut = () => { - console.error('make inside out') - console.log(this) - console.log(this.de) + // much work could be done to beautify this // can we do ... $(this.de).find('.inputs').addClass('insideout') $(this.de).find('.outputs').addClass('insideout') - + this.de.style.zIndex = '-1' + } + + this.addResizers = () => { + } // set width, -- GitLab