diff --git a/ShadowEditor.Web/src/editor2/sidebar/ScriptPanel.jsx b/ShadowEditor.Web/src/editor2/sidebar/ScriptPanel.jsx index df03dfbe..52340eca 100644 --- a/ShadowEditor.Web/src/editor2/sidebar/ScriptPanel.jsx +++ b/ShadowEditor.Web/src/editor2/sidebar/ScriptPanel.jsx @@ -102,10 +102,7 @@ class ScriptPanel extends React.Component { handleAddScript() { const window = app.createElement(ScriptWindow); - app.addElement(window, () => { - let win1 = window; - debugger - }); + app.addElement(window); } handleEditScript(uuid) { diff --git a/ShadowEditor.Web/src/editor2/sidebar/window/ScriptWindow.jsx b/ShadowEditor.Web/src/editor2/sidebar/window/ScriptWindow.jsx index 07d13256..4e8181a9 100644 --- a/ShadowEditor.Web/src/editor2/sidebar/window/ScriptWindow.jsx +++ b/ShadowEditor.Web/src/editor2/sidebar/window/ScriptWindow.jsx @@ -8,37 +8,70 @@ import { classNames, PropTypes, Window, Content, Form, FormControl, Label, Input class ScriptWindow extends React.Component { constructor(props) { super(props); - } - render() { - const options = { + this.scriptTypes = { 'javascript': 'JavaScript', 'vertexShader': L_VERTEX_SHADER, 'fragmentShader': L_FRAGMENT_SHADER, 'json': L_SHADER_PROGRAM_INFO }; + this.state = { + name: L_NO_NAME, + type: 'javascript', + }; + + this.handleNameChange = this.handleNameChange.bind(this); + this.handleTypeChange = this.handleTypeChange.bind(this); + this.handleOK = this.handleOK.bind(this); + this.handleCancel = this.handleCancel.bind(this); + } + + render() { + const { name, type } = this.state; + return + title={L_CREATE_SCRIPT} + onClose={this.handleCancel}>
- + - +
- - + +
; } + + handleNameChange(value) { + this.setState({ + name: value, + }); + } + + handleTypeChange(value) { + this.setState({ + type: value, + }); + } + + handleOK() { + debugger + } + + handleCancel() { + app.removeElement(this); + } } export default ScriptWindow; \ No newline at end of file