diff --git a/README.md b/README.md
index dc094b2adc00e7a8534741ede03ebd156e3832e5..3876ba9c6573969adeb1684c30cc977c0ad55c3d 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,13 @@ Native Cuttlefish 'Hunks' are given access to a DOM/div element, making them nic
IAA ... it's all addressing -> ->
-still notekeeping ... peep the below, then ... manager walking, type completion, and back to nautilus, tonight the ponyo return
+... towards decent views
+ - patchload is nice, ok, this direction
+ - layout ...
+ - context menu in place ...
+ - ... link work ? ... links agreeing with one another before startup ?
+ - results in link saying 'updatehunkdefinition' and manager ... reporting ? or not ?
+ - load -> then load -> then log, up through a few links
## On Friday the Hardware Singeth
diff --git a/hunks/link.js b/hunks/link.js
index 933a07805e9e9c9d3d48cc1eb522b89e6c3aef7d..f75a3d6db359a6f3f9964bf2c36c6b662f24ee80 100644
--- a/hunks/link.js
+++ b/hunks/link.js
@@ -180,6 +180,7 @@ function Link() {
})
if(phy === undefined) throw new Error(`type not found at serialization: ${type}`)
msg.push(phy.key)
+ // HERE entry - phy.write is all powerful, places key for us
msg = msg.concat(phy.write(data))
outbuffer.push(msg)
}
diff --git a/hunks/view.js b/hunks/view.js
index 81d90ec0044e02ddea339ca34f0ee2dea66c61d0..184ef1a591226a428ccdfd6f8a6dd698eb99ae8e 100644
--- a/hunks/view.js
+++ b/hunks/view.js
@@ -129,7 +129,7 @@ function View() {
} else if (evt.keyCode === 27) {
// escapekey
console.log('escape!')
- $(this.plane).children('.contextmenu').remove()
+ $(this.dom).find('.contextmenu').remove()
// also find floaters ...
}
})
@@ -193,7 +193,7 @@ function View() {
// CONTEXT MENU
let onContextMenu = (evt) => {
- $(this.plane).find('.contextmenu').remove()
+ $(this.dom).find('.contextmenu').remove()
//console.log(evt)
evt.preventDefault()
evt.stopPropagation()
@@ -201,18 +201,14 @@ function View() {
console.log('context...', evt)
// make the menu,
let menu = $('<div>').addClass('contextmenu').get(0)
- // and place,
- let pt = dt.readTransform(this.plane)
- console.log('plane transform', pt)
- // HERE: there's still some mess, not landing in the right place,
// (and there's compounding scale issues on dragging the canvas)
dt.writeTransform(menu, {
s: 1,
- x: ((evt.clientX - pt.x) / pt.s), // (pt.s + -0.1 * (pt.s-1))),
- y: ((evt.clientY - pt.y) / pt.s) // + -0.1 * (pt.s-1)))
+ x: evt.layerX, // (pt.s + -0.1 * (pt.s-1))),
+ y: evt.layerY // + -0.1 * (pt.s-1)))
})
//
- $(this.plane).append(menu)
+ $(this.dom).append(menu)
// hmmm
this.changeContextTitle('you can... ')
// on of the options will ...
@@ -235,52 +231,18 @@ function View() {
// takes 'under' argument
this.addContextOption = (text, click) => {
- $(this.plane).find('.contextmenu').get(0).append($('<li>' + text + '</li>').click((click)).get(0))
+ $(this.dom).find('.contextmenu').get(0).append($('<li>' + text + '</li>').click((click)).get(0))
}
this.changeContextTitle = (text) => {
// clear,
- $(this.plane).find('.contextmenu').children().remove()
+ $(this.dom).find('.contextmenu').children().remove()
// overkill, but fun
- let menu = $(this.plane).find('.contextmenu').get(0)
+ let menu = $(this.dom).find('.contextmenu').get(0)
let title = $(`<div>${text}</div>`).addClass('contextTitle').get(0)
- title.onmousedown = (evt) => {
- evt.preventDefault()
- evt.stopPropagation()
- let domElemMouseMove = (evt) => {
- // TRANSFORMS here to move div about on drag
- evt.preventDefault()
- evt.stopPropagation()
- let ct = dt.readTransform(menu)
- let pt = dt.readTransform(menu.parentElement) // think that's just this.plane ?
- ct.x += evt.movementX / pt.s
- ct.y += evt.movementY / pt.s
- dt.writeTransform(menu, ct)
- this.drawLinks()
- }
-
- function rmOnMouseUp(evt) {
- document.removeEventListener('mousemove', domElemMouseMove)
- document.removeEventListener('mouseup', rmOnMouseUp)
- }
- document.addEventListener('mousemove', domElemMouseMove)
- document.addEventListener('mouseup', rmOnMouseUp)
- }
- $(this.plane).find('.contextmenu').append(title)
+ $(this.dom).find('.contextmenu').append(title)
}
- /*
- this.changeContextTitle('list of available:')
- for(let item of list){
- this.addContextOption(item, (evt) => {
- let msg = [MK.REQADDHUNK]
- MSGS.writeTo(msg, item, 'string')
- writeMessage(msg)
- $(evt.target).append(' > requested ... ')
- })
- }
- */
-
/* --------------------------- ---------------------------- */
/* ---------------------- FORCE LAYOUT ----------------------- */
/* --------------------------- ---------------------------- */
diff --git a/style.css b/style.css
index e9640d2b51573b574d6b629e14676a05ab540ea2..76a51257cf3e3451f9692faa8338164eebbec85c 100644
--- a/style.css
+++ b/style.css
@@ -269,10 +269,13 @@ li:active{
padding: 7px 5px 6px 5px;
}
+
+/*
.contextTitle:hover {
background-color: #969696;
cursor: grab;
}
+*/
.contextTitle:active {
background-color: #d1d1d1;
diff --git a/view/vdef.js b/view/vdef.js
index 0acc23a4700cdcc58b2b6f643ce99638700518e7..a9b805534864b600eccfa6ff28b320c3dbc68696 100644
--- a/view/vdef.js
+++ b/view/vdef.js
@@ -285,6 +285,7 @@ function StateDefinition(stspec, ind, def, view, debug){
this.set = (value) => {
if(typeof value === 'string'){
strinput.value = value
+ this.value = value
} else {
throw new Error('bad type put into state dom')
}
@@ -303,6 +304,7 @@ function StateDefinition(stspec, ind, def, view, debug){
if(typeof value === 'number'){
// quite sure js does this conversion no problem
ninput.value = value
+ this.value = value
} else {
throw new Error('bad type put into state dom')
}
@@ -322,6 +324,7 @@ function StateDefinition(stspec, ind, def, view, debug){
this.set = (value) => {
if(typeof value === boolean){
$(span).text(value.toString())
+ this.value = value
} else {
throw new Error('bad type put into state dom')
}
diff --git a/view/vptch.js b/view/vptch.js
index 55d1d8b9e58968a16fbf5044135336fc70cc41e4..fa45a1922cc89dbd6feb716b5deb033cd78f53c0 100644
--- a/view/vptch.js
+++ b/view/vptch.js
@@ -27,7 +27,7 @@ function PatchSet(View, MsgBox) {
} catch (err) {
msgbox.write('caught an error while starting program load')
}
- $(view.plane).find('.contextmenu').remove()
+ $(view.dom).find('.contextmenu').remove()
})
}
})
@@ -191,7 +191,7 @@ function PatchSet(View, MsgBox) {
$(evt.target).append(anchor)
anchor.click()
// finally, rip
- $(view.plane).find('.contextmenu').remove()
+ $(view.dom).find('.contextmenu').remove()
//saveAs(bleb, 'file.json')
}
})