diff --git a/apps/remix-ide/src/app/panels/terminal.js b/apps/remix-ide/src/app/panels/terminal.js index db4e5abc34..9882531263 100644 --- a/apps/remix-ide/src/app/panels/terminal.js +++ b/apps/remix-ide/src/app/panels/terminal.js @@ -92,18 +92,18 @@ class Terminal extends Plugin { } onActivation () { - this.on('scriptRunner', 'log', (msg) => { - this.commands.log.apply(this.commands, msg.data) - }) - this.on('scriptRunner', 'info', (msg) => { - this.commands.info.apply(this.commands, msg.data) - }) - this.on('scriptRunner', 'warn', (msg) => { - this.commands.warn.apply(this.commands, msg.data) - }) - this.on('scriptRunner', 'error', (msg) => { - this.commands.error.apply(this.commands, msg.data) - }) + // this.on('scriptRunner', 'log', (msg) => { + // this.commands.log.apply(this.commands, msg.data) + // }) + // this.on('scriptRunner', 'info', (msg) => { + // this.commands.info.apply(this.commands, msg.data) + // }) + // this.on('scriptRunner', 'warn', (msg) => { + // this.commands.warn.apply(this.commands, msg.data) + // }) + // this.on('scriptRunner', 'error', (msg) => { + // this.commands.error.apply(this.commands, msg.data) + // }) this.renderComponent() } diff --git a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx index 09382a8899..eb85d32dfb 100644 --- a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx +++ b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx @@ -217,6 +217,10 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { // events 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('log', _blocksRenderer('log'), { activate: true }, dispatch) registerCommandAction('info', _blocksRenderer('info'), { activate: true }, dispatch) @@ -234,6 +238,10 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { filterFnAction('warn', basicFilter, filterDispatch) filterFnAction('error', 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 }) // dispatch({ type: 'html', payload: { commands: htmlresullt.commands } }) // dispatch({ type: 'log', payload: { _commands: logresult._commands } }) @@ -398,10 +406,26 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { /* end of mouse event */ 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('mouseup', onMouseUp) 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('mouseup', onMouseUp) }