From 15316764dfcc1d230efdc6cd2f2f0bd47be3efd8 Mon Sep 17 00:00:00 2001 From: anika-ahluwalia Date: Tue, 14 Apr 2020 18:32:27 -0500 Subject: add on finish button and change button drag out --- src/.DS_Store | Bin 6148 -> 8196 bytes src/client/documents/Documents.ts | 7 ++++++- src/client/views/nodes/ScriptingBox.scss | 12 +++++++++--- src/client/views/nodes/ScriptingBox.tsx | 17 ++++++----------- 4 files changed, 21 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/.DS_Store b/src/.DS_Store index 5b35884bd..942a5672b 100644 Binary files a/src/.DS_Store and b/src/.DS_Store differ diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index e6f3b21ca..aea4867cd 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -648,7 +648,12 @@ export namespace Docs { } export function ButtonDocument(options?: DocumentOptions) { - return InstanceFromProto(Prototypes.get(DocumentType.BUTTON), undefined, { ...(options || {}), "onClick-rawScript": "-script-" }); + const btn = InstanceFromProto(Prototypes.get(DocumentType.BUTTON), undefined, { ...(options || {}), "onClick-rawScript": "-script-" }); + btn.layoutKey = "layout_onClick"; + btn.height = 250; + btn.width = 200; + btn.layout_onClick = ScriptingBox.LayoutString("onClick"); + return btn; } export function SliderDocument(options?: DocumentOptions) { diff --git a/src/client/views/nodes/ScriptingBox.scss b/src/client/views/nodes/ScriptingBox.scss index 678a1a22d..3dfd65bc1 100644 --- a/src/client/views/nodes/ScriptingBox.scss +++ b/src/client/views/nodes/ScriptingBox.scss @@ -6,16 +6,20 @@ pointer-events: all; background-color: rgb(241, 239, 235); padding: 10px; + .scriptingBox-inputDiv { display: flex; flex-direction: column; height: calc(100% - 30px); + .scriptingBox-errorMessage { overflow: auto; } + .scripting-params { background: "beige"; } + .scriptingBox-textArea { width: 100%; height: 100%; @@ -28,9 +32,11 @@ .scriptingBox-toolbar { width: 100%; height: 30px; + .scriptingBox-button { - width: 50% + width: 33%; + resize: auto; + } } -} - +} \ No newline at end of file diff --git a/src/client/views/nodes/ScriptingBox.tsx b/src/client/views/nodes/ScriptingBox.tsx index 552086790..7fcb9a8d0 100644 --- a/src/client/views/nodes/ScriptingBox.tsx +++ b/src/client/views/nodes/ScriptingBox.tsx @@ -41,18 +41,11 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent { + onFinish = () => { const result = CompileScript(this.rawScript, {}); - this._errorMessage = ""; - if (result.compiled) { - this._errorMessage = ""; - this.props.Document.data = new ScriptField(result); - - //button - } - else { - // - } + this.rootDoc.layoutKey = "layout"; + this.rootDoc.height = 50; + this.rootDoc.width = 100; this.props.Document.documentText = this.rawScript; } @@ -106,6 +99,8 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent + {this.rootDoc.layoutKey === "layout_onClick" ? : null} ); -- cgit v1.2.3-70-g09d2