51 lines
1.3 KiB
JavaScript
51 lines
1.3 KiB
JavaScript
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() { }
|
|
} |