diff --git a/object_database/web/content/src/CellHandler.js b/object_database/web/content/src/CellHandler.js index a8a40a5c..9fe7a236 100644 --- a/object_database/web/content/src/CellHandler.js +++ b/object_database/web/content/src/CellHandler.js @@ -519,6 +519,28 @@ class CellHandler { // listent to only devtools content-script messages if (event.data.type == "cells_devtools_CS") { console.log("receiving message from CS: ", event.data); + // when we click on a tree node in devtools we expect info + // about the cell to be sent back (props, source etc) + if (event.data.request == "info") { + const nodeId = event.data.nodeId; + // the cell objet can't be cloned and sent over + // the window message API as is + const cell = this.activeCells[nodeId]; + const dataToSend = cell.props // TODO; + const msg = { + status: "info", + nodeId: nodeId, + data: dataToSend + } + this.sendMessageToDevtools(msg); + } else if (event.data.request == "propChange") { + const nodeId = event.data.nodeId; + const cell = this.activeCells[nodeId]; + const data = cell.props; + data[event.data.name] = event.data.value; + this.updateCell(nodeId, cell.namedChildren, data); + cell.rebuildDomElement(); + } } } }) diff --git a/object_database/web/devtools/background.js b/object_database/web/devtools/background.js index 7e56bad1..7725ce07 100644 --- a/object_database/web/devtools/background.js +++ b/object_database/web/devtools/background.js @@ -2,7 +2,7 @@ * The background script handles communication to and from * the content script, embedded in the document, and * the panel scripts, living in devtools. - * These communiccation are handled by chrome.runtime connection + * These communication are handled by chrome.runtime connection * ports. * The connections are initialized int he content and panel scripts, * respectively. Here we listen for these connection and create diff --git a/object_database/web/devtools/cells_panel.css b/object_database/web/devtools/cells_panel.css index 369acfdb..546b6370 100644 --- a/object_database/web/devtools/cells_panel.css +++ b/object_database/web/devtools/cells_panel.css @@ -7,6 +7,7 @@ body { display: flex; flex-direction: row; margin: 0px; + background-color: black; } div#main { @@ -19,12 +20,34 @@ div#main { div#cell-info { display: flex; + flex-direction: column; justify-content: center; align-items: center; min-width: 30%; text-align: center; font-family: Roboto; font-size: 20px; + color: white; + border-left: 1px ridge rgb(135, 210, 173); +} + +div#cell-info span#node-args { + border-bottom: 1px solid rgb(135, 210, 173); + margin-top: 5px; + margin-bottom: 5px; + color: rgb(135, 210, 173); +} + +div#cell-info > table { + border: 1px dotted; +} + +div#cell-info > table td { + border: 1px solid rgb(135, 210, 173); +} + +div#cell-info > table input { + border: 1px solid rgb(135, 210, 173); } .node { diff --git a/object_database/web/devtools/cells_panel.html b/object_database/web/devtools/cells_panel.html index b53cefe6..8ac18bee 100644 --- a/object_database/web/devtools/cells_panel.html +++ b/object_database/web/devtools/cells_panel.html @@ -10,7 +10,7 @@
-