From 64749a6541963564eec8f9f97f6eb59f2cb1b61c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=AB=8B=E5=B8=AE?= <3294713004@qq.com> Date: Sun, 21 Jul 2024 10:16:51 +0800 Subject: [PATCH] =?UTF-8?q?Update:=20Blockly=E5=B7=A5=E4=BD=9C=E5=8C=BA?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0Comment=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/modules/mixly-modules/common/editor-blockly.js | 2 +- common/modules/mixly-modules/common/loader.js | 2 -- common/modules/mixly-modules/common/mixly2-api.js | 3 +++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/common/modules/mixly-modules/common/editor-blockly.js b/common/modules/mixly-modules/common/editor-blockly.js index f205f3c1..966d1ba7 100644 --- a/common/modules/mixly-modules/common/editor-blockly.js +++ b/common/modules/mixly-modules/common/editor-blockly.js @@ -100,7 +100,7 @@ class EditorBlockly extends EditorBase { this.addPlugins = () => { const { editor } = this; - // Blockly.ContextMenuItems.registerCommentOptions(); + Blockly.ContextMenuItems.registerCommentOptions(); editor.configureContextMenu = (menuOptions, e) => { const workspaceSearchOption = { text: Blockly.Msg['WORKSPACE_SEARCH_OPEN'], diff --git a/common/modules/mixly-modules/common/loader.js b/common/modules/mixly-modules/common/loader.js index db0a88bb..8433c592 100644 --- a/common/modules/mixly-modules/common/loader.js +++ b/common/modules/mixly-modules/common/loader.js @@ -41,8 +41,6 @@ const { const { LibManager, File } = goog.isElectron? Electron : Web; const { Socket } = WebSocket; -Mixly.Editor = Mixly.Editor ?? {}; - window.addEventListener('load', () => { const app = new App($('body')[0]); diff --git a/common/modules/mixly-modules/common/mixly2-api.js b/common/modules/mixly-modules/common/mixly2-api.js index 92d8ee79..6d5c61c7 100644 --- a/common/modules/mixly-modules/common/mixly2-api.js +++ b/common/modules/mixly-modules/common/mixly2-api.js @@ -42,6 +42,9 @@ API2.init = () => { Editor.blockEditor = blockPage.getEditor(); Editor.codeEditor = codePage.getEditor(); Object.assign(Blockly.Msg, HUES); + Blockly.ALIGN_LEFT = Blockly.inputs.Align.LEFT; + Blockly.ALIGN_CENTRE = Blockly.inputs.Align.CENTRE; + Blockly.ALIGN_RIGHT = Blockly.inputs.Align.RIGHT; } }); \ No newline at end of file