diff --git a/static/js/app.mjs b/static/js/app.mjs index 4d97a3f..45becb6 100644 --- a/static/js/app.mjs +++ b/static/js/app.mjs @@ -1,3 +1,4 @@ +import { Component } from '@component' import { Editor } from '@editor' import { MessageBus } from '@mbus' import { SelectType, SelectNodeDialog, ConnectionDataDialog } from '@select_node' @@ -54,7 +55,7 @@ export class App { const uri = `${location.protocol}//${location.host}/nodes/${event.detail}` const img = document.querySelector('#editor-node .copy-path') img.classList.add('highlight') - setTimeout(()=>img.classList.remove('highlight'), 150) + setTimeout(() => img.classList.remove('highlight'), 150) navigator.clipboard.writeText(uri) break @@ -190,7 +191,11 @@ export class App { this.typesList.fetchTypes().then(() => { mbus.dispatch('TYPES_LIST_FETCHED') }) + break + case 'script': + document.getElementById('scripts').classList.add('show') + document.getElementById('editor-script').classList.add('show') break } }// }}} @@ -693,8 +698,9 @@ export class TreeNode { }// }}} } -export class TypesList { - constructur() {// {{{ +class TypesList extends Component { + constructor() {// {{{ + super() this.types = [] }// }}} async fetchTypes() {// {{{ @@ -712,7 +718,7 @@ export class TypesList { .catch(err => reject(err)) }) }// }}} - render() {// {{{ + renderComponent() {// {{{ const div = document.createElement('div') const create = document.createElement('img') @@ -775,11 +781,12 @@ export class TypesList { }// }}} } -class TypeSchemaEditor { +class TypeSchemaEditor extends Component { constructor(dataType) {// {{{ + super() this.type = dataType }// }}} - render() {// {{{ + renderComponent() {// {{{ const tmpl = document.createElement('template') tmpl.innerHTML = `