Commit 7ea8d95e authored by davidzagi93@gmail.com's avatar davidzagi93@gmail.com

getting response from scriptRunnser

parent 6dbe5547
...@@ -92,18 +92,18 @@ class Terminal extends Plugin { ...@@ -92,18 +92,18 @@ class Terminal extends Plugin {
} }
onActivation () { onActivation () {
this.on('scriptRunner', 'log', (msg) => { // this.on('scriptRunner', 'log', (msg) => {
this.commands.log.apply(this.commands, msg.data) // this.commands.log.apply(this.commands, msg.data)
}) // })
this.on('scriptRunner', 'info', (msg) => { // this.on('scriptRunner', 'info', (msg) => {
this.commands.info.apply(this.commands, msg.data) // this.commands.info.apply(this.commands, msg.data)
}) // })
this.on('scriptRunner', 'warn', (msg) => { // this.on('scriptRunner', 'warn', (msg) => {
this.commands.warn.apply(this.commands, msg.data) // this.commands.warn.apply(this.commands, msg.data)
}) // })
this.on('scriptRunner', 'error', (msg) => { // this.on('scriptRunner', 'error', (msg) => {
this.commands.error.apply(this.commands, msg.data) // this.commands.error.apply(this.commands, msg.data)
}) // })
this.renderComponent() this.renderComponent()
} }
......
...@@ -217,6 +217,10 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { ...@@ -217,6 +217,10 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
// events // events
useEffect(() => { useEffect(() => {
registerLogScriptRunnerAction(props.thisState, 'log', newstate.commands, scriptRunnerDispatch)
registerInfoScriptRunnerAction(props.thisState, 'info', newstate.commands, scriptRunnerDispatch)
registerWarnScriptRunnerAction(props.thisState, 'warn', newstate.commands, scriptRunnerDispatch)
registerErrorScriptRunnerAction(props.thisState, 'error', newstate.commands, scriptRunnerDispatch)
registerCommandAction('html', _blocksRenderer('html'), { activate: true }, dispatch) registerCommandAction('html', _blocksRenderer('html'), { activate: true }, dispatch)
registerCommandAction('log', _blocksRenderer('log'), { activate: true }, dispatch) registerCommandAction('log', _blocksRenderer('log'), { activate: true }, dispatch)
registerCommandAction('info', _blocksRenderer('info'), { activate: true }, dispatch) registerCommandAction('info', _blocksRenderer('info'), { activate: true }, dispatch)
...@@ -234,6 +238,10 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { ...@@ -234,6 +238,10 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
filterFnAction('warn', basicFilter, filterDispatch) filterFnAction('warn', basicFilter, filterDispatch)
filterFnAction('error', basicFilter, filterDispatch) filterFnAction('error', basicFilter, filterDispatch)
filterFnAction('script', basicFilter, filterDispatch) filterFnAction('script', basicFilter, filterDispatch)
registerLogScriptRunnerAction(props.thisState, 'log', newstate.commands, scriptRunnerDispatch)
registerInfoScriptRunnerAction(props.thisState, 'info', newstate.commands, scriptRunnerDispatch)
registerWarnScriptRunnerAction(props.thisState, 'warn', newstate.commands, scriptRunnerDispatch)
registerErrorScriptRunnerAction(props.thisState, 'error', newstate.commands, scriptRunnerDispatch)
// console.log({ htmlresullt }, { logresult }) // console.log({ htmlresullt }, { logresult })
// dispatch({ type: 'html', payload: { commands: htmlresullt.commands } }) // dispatch({ type: 'html', payload: { commands: htmlresullt.commands } })
// dispatch({ type: 'log', payload: { _commands: logresult._commands } }) // dispatch({ type: 'log', payload: { _commands: logresult._commands } })
...@@ -398,10 +406,26 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { ...@@ -398,10 +406,26 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
/* end of mouse event */ /* end of mouse event */
useEffect(() => { useEffect(() => {
// document.addEventListener('mousemove', changeBg)
// function changeBg () {
// document.getElementById('dragId').style.backgroundColor = 'skyblue'
// }
// document.addEventListener('mouseup', changeBg2)
// function changeBg2 () {
// document.getElementById('dragId').style.backgroundColor = ''
// }
document.addEventListener('mousemove', onMouseMove) document.addEventListener('mousemove', onMouseMove)
document.addEventListener('mouseup', onMouseUp) document.addEventListener('mouseup', onMouseUp)
return () => { return () => {
// document.addEventListener('mousemove', changeBg)
// function changeBg () {
// document.getElementById('dragId').style.backgroundColor = 'skyblue'
// }
// document.addEventListener('mouseup', changeBg2)
// function changeBg2 () {
// document.getElementById('dragId').style.backgroundColor = ''
// }
document.removeEventListener('mousemove', onMouseMove) document.removeEventListener('mousemove', onMouseMove)
document.removeEventListener('mouseup', onMouseUp) document.removeEventListener('mouseup', onMouseUp)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment