From 8b7c397c2a0449edb00240f58de553493dd44a1c Mon Sep 17 00:00:00 2001 From: Princiya Sequeira Date: Thu, 28 Apr 2022 18:47:39 +0200 Subject: [PATCH] nit fixes --- pyscriptjs/examples/repl.css | 16 ++++++++++++++++ pyscriptjs/examples/repl2.html | 20 +------------------- pyscriptjs/src/components/pyrepl.ts | 26 +++----------------------- 3 files changed, 20 insertions(+), 42 deletions(-) create mode 100644 pyscriptjs/examples/repl.css diff --git a/pyscriptjs/examples/repl.css b/pyscriptjs/examples/repl.css new file mode 100644 index 0000000..ba7e510 --- /dev/null +++ b/pyscriptjs/examples/repl.css @@ -0,0 +1,16 @@ +#output > div { + font-family: 'monospace'; + background-color: #e5e5e5; + border: 1px solid lightgray; + border-top: 0; + font-size: 0.875rem; + padding: 0.5rem; + } + + #output > div:first-child { + border-top: 1px solid lightgray; + } + + #output > div:nth-child(even) { + border: 0; + } \ No newline at end of file diff --git a/pyscriptjs/examples/repl2.html b/pyscriptjs/examples/repl2.html index 5aa917a..df05d06 100644 --- a/pyscriptjs/examples/repl2.html +++ b/pyscriptjs/examples/repl2.html @@ -8,27 +8,9 @@ + - - diff --git a/pyscriptjs/src/components/pyrepl.ts b/pyscriptjs/src/components/pyrepl.ts index d577cbb..d1360e2 100644 --- a/pyscriptjs/src/components/pyrepl.ts +++ b/pyscriptjs/src/components/pyrepl.ts @@ -97,29 +97,9 @@ export class PyRepl extends BaseEvalElement { const mainDiv = document.createElement('div'); addClasses(mainDiv, ["parentBox", "group", "flex", "flex-col", "mt-2", "mx-8", "relative"]) - mainDiv.appendChild(this.editorNode); // add Editor to main PyScript div - - // Settings button - // this.btnConfig = document.createElement('button'); - // this.btnConfig.innerHTML = - // ''; - // this.btnConfig.onclick = function toggleNavBar(evt) { - // console.log('clicked'); - // componentDetailsNavOpen.set(!propertiesNavOpen); - - // currentComponentDetails.set([ - // { key: 'auto-generate', value: true }, - // { key: 'output', value: 'default' }, - // { key: 'source', value: 'self' }, - // { key: 'output-mode', value: 'clear' }, - // ]); - // }; - - // addClasses(this.btnConfig, buttonClasses); - // addClasses(this.btnConfig, ['bg-blue-500']); - // eDiv.appendChild(this.btnConfig); - + mainDiv.appendChild(this.editorNode); + // Butons DIV const eDiv = document.createElement('div'); addClasses(eDiv, "buttons-box opacity-0 group-hover:opacity-100 relative right-0 -top-4 z-10 flex flex-row-reverse space-x-reverse space-x-4 font-mono text-white text-sm font-bold leading-6 dev-buttons-group".split(" ")) @@ -171,7 +151,7 @@ export class PyRepl extends BaseEvalElement { // In this case neither output or std-out have been provided so we need // to create a new output div to output to this.outputElement = document.createElement('div'); - this.outputElement.classList.add('output', 'font-mono', 'ml-8', 'mt-4','text-sm'); + this.outputElement.classList.add('output', 'font-mono', 'ml-8', 'text-sm'); this.outputElement.hidden = true; this.outputElement.id = this.id + '-' + this.getAttribute('exec-id');