8000 remove old code and bypass some warning · robinboot/pyscript@cb61908 · GitHub
[go: up one dir, main page]

Skip to content

Commit cb61908

Browse files
committed
remove old code and bypass some warning
1 parent b207db9 commit cb61908

File tree

2 files changed

+1
-27
lines changed

2 files changed

+1
-27
lines changed

pyscriptjs/src/components/pybox.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export class PyBox extends HTMLElement {
5656

5757
this.widths.forEach((width, index)=>{
5858
const node: ChildNode = mainDiv.childNodes[index];
59+
// @ts-ignore
5960
addClasses(node, [width, 'mx-4'])
6061

6162
})

pyscriptjs/src/components/pyscript.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@ mode.subscribe(value => {
3939
currentMode = value;
4040
});
4141

42-
function createCmdHandler(el) {
43-
// Creates a codemirror cmd handler that calls the el.evaluate when an event
44-
// triggers that specific cmd
45-
const toggleCheckbox: StateCommand = ({ state, dispatch }) => {
46-
return el.evaluate(state);
47-
};
48-
return toggleCheckbox;
49-
}
5042

5143
// TODO: use type declaractions
5244
type PyodideInterface = {
@@ -104,25 +96,6 @@ export class PyScript extends BaseEvalElement {
10496
this.checkId();
10597
this.code = this.innerHTML;
10698
this.innerHTML = '';
107-
const startState = EditorState.create({
108-
doc: this.code,
109-
extensions: [
110-
keymap.of([
111-
...defaultKeymap,
112-
{ key: 'Ctrl-Enter', run: createCmdHandler(this) },
113-
{ key: 'Shift-Enter', run: createCmdHandler(this) },
114-
]),
115-
oneDarkTheme,
116-
python(),
117-
// Event listener function that is called every time an user types something on this editor
118-
// EditorView.updateListener.of((v:ViewUpdate) => {
119-
// if (v.docChanged) {
120-
// console.log(v.changes);
121-
122-
// }
123-
// })
124-
],
125-
});
12699

127100
const mainDiv = document.createElement('div');
128101
addClasses(mainDiv, ['parentBox', 'flex', 'flex-col', 'mx-8']);

0 commit comments

Comments
 (0)
0