feat(board): python_pyodide下添加 Teachable Machine (待完善)
This commit is contained in:
51
boards/default_src/python_pyodide/others/statusbar-tool.js
Normal file
51
boards/default_src/python_pyodide/others/statusbar-tool.js
Normal file
@@ -0,0 +1,51 @@
|
||||
import $ from 'jquery';
|
||||
import { Msg } from 'blockly/core';
|
||||
import {
|
||||
PageBase,
|
||||
HTMLTemplate,
|
||||
StatusBarsManager,
|
||||
Workspace
|
||||
} from 'mixly';
|
||||
import '../language/loader';
|
||||
import STATUS_BAR_TOOL_TEMPLATE from '../templates/html/statusbar-tool.html';
|
||||
|
||||
|
||||
export default class StatusBarTool extends PageBase {
|
||||
static {
|
||||
HTMLTemplate.add(
|
||||
'html/statusbar/statusbar-tool.html',
|
||||
new HTMLTemplate(STATUS_BAR_TOOL_TEMPLATE)
|
||||
);
|
||||
|
||||
this.init = function () {
|
||||
StatusBarsManager.typesRegistry.register(['tool'], StatusBarTool);
|
||||
const mainWorkspace = Workspace.getMain();
|
||||
const statusBarsManager = mainWorkspace.getStatusBarsManager();
|
||||
statusBarsManager.add({
|
||||
type: 'tool',
|
||||
id: 'tool',
|
||||
name: Msg.PYTHON_PYODIDE_TOOL,
|
||||
title: Msg.PYTHON_PYODIDE_TOOL
|
||||
});
|
||||
statusBarsManager.changeTo('output');
|
||||
return statusBarsManager.get('tool');
|
||||
}
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
const $content = $(HTMLTemplate.get('html/statusbar/statusbar-tool.html').render());
|
||||
this.setContent($content);
|
||||
}
|
||||
|
||||
init() {
|
||||
super.init();
|
||||
this.hideCloseBtn();
|
||||
}
|
||||
|
||||
onMounted() { }
|
||||
|
||||
onUnmounted() { }
|
||||
|
||||
resize() { }
|
||||
}
|
||||
Reference in New Issue
Block a user