Skip to content

Commit

Permalink
SQUASHED: SQUASHED-SQUASHED-SQUASHED-AUTO-COMMIT-src-components-tools…
Browse files Browse the repository at this point in the history
…-astro-view.html-AUTO-COMMIT-src-components-tools-astro-view.js-AUTO-COMMIT-src-components-tools-astro-view.js.l4a,
  • Loading branch information
phischdev committed Jun 20, 2024
1 parent 4e5556a commit 00c2a34
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
11 changes: 8 additions & 3 deletions src/components/tools/astro-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,16 @@

<div>
<div class="pane tool layout-column">
<div id="navigationPane" class="layout-row">
<b>Project Name</b>
<div class="layout-row">
<input type="text" id="projectName" value="">
</div>

<b>Code Transformer</b>
<div class="layout-row">
<input type="text" id="transformerSourcePath" value="">
</div>
<lively-editor class="pane editor" id="transformerSource"></lively-editor>

<div>
<button class="toggle" id="runQuery" title="Query ASTs">
Expand All @@ -148,8 +155,6 @@
<div id="status"/>
</div>

<b>Code Transformer</b>
<lively-editor class="pane editor" id="transformerSource"></lively-editor>
</div>
</div>
</div>
Expand Down
10 changes: 9 additions & 1 deletion src/components/tools/astro-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export default class AstroView extends Morph {
set sourceURL(urlString) { this.sourcePath.value = urlString; }
onSourcePathEntered(urlString) { this.loadSourceFile(urlString); }

// Project Name
get projectNameInput() { return this.get('#projectName'); }
get projectName() { return this.projectNameInput.value; }
set projectName(text) { this.projectNameInput.value = text; }

// Transformer Code
get transformerSourceEditor() { return this.get("#transformerSource"); }
Expand Down Expand Up @@ -144,6 +148,8 @@ export default class AstroView extends Morph {
const transformerSource = this.getAttribute("transformerSource");
if (transformerSource) this.loadTransformerSourceFile(transformerSource);

this.projectName = this.getAttribute("projectName") || "";

this.autoUpdate = true;

this.dispatchEvent(new CustomEvent("initialize"));
Expand Down Expand Up @@ -304,7 +310,9 @@ export default class AstroView extends Morph {

livelyPrepareSave() {
this.setAttribute('source', this.sourceURL);
this.setAttribute('transformerSource', this.transformerSourceURL)
this.setAttribute('transformerSource', this.transformerSourceURL);
this.setAttribute('projectName', this.projectName);

console.log("PREPARE SAVE (AST Explorer)");
}

Expand Down
Loading

0 comments on commit 00c2a34

Please sign in to comment.