refactor(core): 将 菜单项生成 从Mixly.ContextMenu调整到Mixly.Menu
This commit is contained in:
@@ -9,7 +9,6 @@ goog.require('Mixly.Msg');
|
||||
goog.require('Mixly.Drag');
|
||||
goog.require('Mixly.Nav');
|
||||
goog.require('Mixly.Menu');
|
||||
goog.require('Mixly.ContextMenu');
|
||||
goog.require('Mixly.Workspace');
|
||||
goog.require('Mixly.FooterBar');
|
||||
goog.require('Mixly.HTMLTemplate');
|
||||
@@ -44,7 +43,6 @@ const {
|
||||
Drag,
|
||||
Nav,
|
||||
Menu,
|
||||
ContextMenu,
|
||||
Workspace,
|
||||
FooterBar,
|
||||
HTMLTemplate,
|
||||
@@ -467,7 +465,7 @@ class App extends Component {
|
||||
},
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['nav.btn.file.new'], 'Ctrl+N'),
|
||||
name: Menu.getItem(Msg.Lang['nav.btn.file.new'], 'Ctrl+N', 'icon-doc-new'),
|
||||
callback: () => File.new()
|
||||
}
|
||||
});
|
||||
@@ -486,7 +484,7 @@ class App extends Component {
|
||||
},
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['nav.btn.file.open'], 'Ctrl+O'),
|
||||
name: Menu.getItem(Msg.Lang['nav.btn.file.open'], 'Ctrl+O', 'icon-doc'),
|
||||
callback: (key, opt) => File.open()
|
||||
}
|
||||
});
|
||||
@@ -510,7 +508,7 @@ class App extends Component {
|
||||
},
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['nav.btn.file.save'], 'Ctrl+S'),
|
||||
name: Menu.getItem(Msg.Lang['nav.btn.file.save'], 'Ctrl+S', 'icon-floppy'),
|
||||
callback: () => File.save()
|
||||
}
|
||||
});
|
||||
@@ -528,7 +526,7 @@ class App extends Component {
|
||||
},
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['nav.btn.file.saveAs'], 'Ctrl+Shift+S'),
|
||||
name: Menu.getItem(Msg.Lang['nav.btn.file.saveAs'], 'Ctrl+Shift+S', 'icon-save-as'),
|
||||
callback: () => File.saveAs()
|
||||
}
|
||||
});
|
||||
@@ -555,7 +553,7 @@ class App extends Component {
|
||||
},
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['nav.btn.file.exportAs'], 'Ctrl+E'),
|
||||
name: Menu.getItem(Msg.Lang['nav.btn.file.exportAs'], 'Ctrl+E', 'icon-export'),
|
||||
callback: () => File.exportLib()
|
||||
}
|
||||
});
|
||||
@@ -575,7 +573,7 @@ class App extends Component {
|
||||
},
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['nav.btn.setting.manageLibs'], 'Ctrl+M'),
|
||||
name: Menu.getItem(Msg.Lang['nav.btn.setting.manageLibs'], 'Ctrl+M', 'icon-menu'),
|
||||
callback: () => LibManager.showManageDialog()
|
||||
}
|
||||
});
|
||||
@@ -603,7 +601,7 @@ class App extends Component {
|
||||
},
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['nav.btn.setting.feedback'], 'Ctrl+Shift+F'),
|
||||
name: Menu.getItem(Msg.Lang['nav.btn.setting.feedback'], 'Ctrl+Shift+F', 'icon-comment-1'),
|
||||
callback: () => {
|
||||
const href = 'https://gitee.com/bnu_mixly/mixly3/issues';
|
||||
Url.open(href);
|
||||
@@ -624,7 +622,7 @@ class App extends Component {
|
||||
},
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem('文档', 'Ctrl+H'),
|
||||
name: Menu.getItem(Msg.Lang['nav.btn.setting.wiki'], 'Ctrl+H', 'icon-book-open'),
|
||||
callback: () => {
|
||||
const href = 'https://mixly.readthedocs.io/zh-cn/latest/contents.html';
|
||||
Url.open(href);
|
||||
|
||||
@@ -1,30 +1,20 @@
|
||||
goog.loadJs('common', () => {
|
||||
|
||||
goog.require('$.contextMenu');
|
||||
goog.require('Mixly.XML');
|
||||
goog.require('Mixly.Env');
|
||||
goog.require('Mixly.Menu');
|
||||
goog.require('Mixly.Events');
|
||||
goog.require('Mixly.Registry');
|
||||
goog.require('Mixly.HTMLTemplate');
|
||||
goog.provide('Mixly.ContextMenu');
|
||||
|
||||
const {
|
||||
XML,
|
||||
Env,
|
||||
Menu,
|
||||
Events,
|
||||
Registry,
|
||||
HTMLTemplate
|
||||
Registry
|
||||
} = Mixly;
|
||||
|
||||
|
||||
class ContextMenu {
|
||||
static {
|
||||
HTMLTemplate.add(
|
||||
'html/context-menu-item.html',
|
||||
new HTMLTemplate(goog.readFileSync(path.join(Env.templatePath, 'html/context-menu-item.html')))
|
||||
);
|
||||
|
||||
this.getItem = (name, hotKey) => HTMLTemplate.get('html/context-menu-item.html').render({ name, hotKey });
|
||||
|
||||
this.generate = (menu, $trigger) => {
|
||||
let menuItems = {};
|
||||
for (let item of menu.getAllItems()) {
|
||||
|
||||
@@ -6,9 +6,9 @@ goog.require('Mixly.Config');
|
||||
goog.require('Mixly.XML');
|
||||
goog.require('Mixly.Env');
|
||||
goog.require('Mixly.Msg');
|
||||
goog.require('Mixly.Menu');
|
||||
goog.require('Mixly.ContextMenu');
|
||||
goog.require('Mixly.IdGenerator');
|
||||
goog.require('Mixly.Menu');
|
||||
goog.require('Mixly.EditorMonaco');
|
||||
goog.provide('Mixly.EditorCode');
|
||||
|
||||
@@ -17,9 +17,9 @@ const {
|
||||
XML,
|
||||
Env,
|
||||
Msg,
|
||||
Menu,
|
||||
ContextMenu,
|
||||
IdGenerator,
|
||||
Menu,
|
||||
EditorMonaco
|
||||
} = Mixly;
|
||||
const { USER } = Config;
|
||||
@@ -54,7 +54,7 @@ class EditorCode extends EditorMonaco {
|
||||
id: 'cut',
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['editor.contextMenu.cut'], 'Ctrl+X'),
|
||||
name: Menu.getItem(Msg.Lang['editor.contextMenu.cut'], 'Ctrl+X'),
|
||||
callback: (key, opt) => this.cut()
|
||||
}
|
||||
});
|
||||
@@ -63,7 +63,7 @@ class EditorCode extends EditorMonaco {
|
||||
id: 'copy',
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['editor.contextMenu.copy'], 'Ctrl+C'),
|
||||
name: Menu.getItem(Msg.Lang['editor.contextMenu.copy'], 'Ctrl+C'),
|
||||
callback: (key, opt) => this.copy()
|
||||
}
|
||||
});
|
||||
@@ -72,7 +72,7 @@ class EditorCode extends EditorMonaco {
|
||||
id: 'paste',
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['editor.contextMenu.paste'], 'Ctrl+V'),
|
||||
name: Menu.getItem(Msg.Lang['editor.contextMenu.paste'], 'Ctrl+V'),
|
||||
callback: (key, opt) => this.paste()
|
||||
}
|
||||
});
|
||||
@@ -86,7 +86,7 @@ class EditorCode extends EditorMonaco {
|
||||
id: 'togglecomment',
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['editor.contextMenu.togglecomment'], 'Ctrl+/'),
|
||||
name: Menu.getItem(Msg.Lang['editor.contextMenu.togglecomment'], 'Ctrl+/'),
|
||||
callback: (key, opt) => this.commentLine()
|
||||
}
|
||||
});
|
||||
@@ -95,7 +95,7 @@ class EditorCode extends EditorMonaco {
|
||||
id: 'toggleBlockComment',
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['editor.contextMenu.toggleBlockComment'], 'Shift+Alt+A'),
|
||||
name: Menu.getItem(Msg.Lang['editor.contextMenu.toggleBlockComment'], 'Shift+Alt+A'),
|
||||
callback: (key, opt) => this.blockComment()
|
||||
}
|
||||
});
|
||||
|
||||
@@ -10,12 +10,11 @@ goog.require('Mixly.XML');
|
||||
goog.require('Mixly.Msg');
|
||||
goog.require('Mixly.Config');
|
||||
goog.require('Mixly.Env');
|
||||
goog.require('Mixly.LayerExt');
|
||||
goog.require('Mixly.ContextMenu');
|
||||
goog.require('Mixly.Debug');
|
||||
goog.require('Mixly.Menu');
|
||||
goog.require('Mixly.Boards');
|
||||
goog.require('Mixly.MJson');
|
||||
goog.require('Mixly.LayerExt');
|
||||
goog.require('Mixly.HTMLTemplate');
|
||||
goog.require('Mixly.EditorBlockly');
|
||||
goog.require('Mixly.EditorCode');
|
||||
@@ -33,7 +32,6 @@ const {
|
||||
Msg,
|
||||
Config,
|
||||
Env,
|
||||
ContextMenu,
|
||||
Debug,
|
||||
Menu,
|
||||
Boards,
|
||||
@@ -45,6 +43,7 @@ const { BOARD, SOFTWARE } = Config;
|
||||
|
||||
const { form } = layui;
|
||||
|
||||
|
||||
class EditorMix extends EditorBase {
|
||||
static {
|
||||
HTMLTemplate.add(
|
||||
@@ -112,7 +111,7 @@ class EditorMix extends EditorBase {
|
||||
id: 'copy',
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['editor.contextMenu.copy'], 'Ctrl+C'),
|
||||
name: Menu.getItem(Msg.Lang['editor.contextMenu.copy'], 'Ctrl+C'),
|
||||
callback: (key, opt) => codePage.copy()
|
||||
}
|
||||
});
|
||||
|
||||
@@ -257,7 +257,7 @@ class FileTree extends Component {
|
||||
},
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['fileTree.newFolder'], ''),
|
||||
name: Menu.getItem(Msg.Lang['fileTree.newFolder'], ''),
|
||||
callback: (_, { $trigger }) => {
|
||||
let type = $trigger.attr('type');
|
||||
if (type === 'root') {
|
||||
@@ -279,7 +279,7 @@ class FileTree extends Component {
|
||||
},
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['fileTree.newFile'], ''),
|
||||
name: Menu.getItem(Msg.Lang['fileTree.newFile'], ''),
|
||||
callback: (_, { $trigger }) => {
|
||||
let type = $trigger.attr('type');
|
||||
if (type === 'root') {
|
||||
@@ -310,7 +310,7 @@ class FileTree extends Component {
|
||||
},
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['editor.contextMenu.cut'], ''),
|
||||
name: Menu.getItem(Msg.Lang['editor.contextMenu.cut'], ''),
|
||||
callback: (_, { $trigger }) => {
|
||||
let id = $trigger.attr('id');
|
||||
this.cutNode(id);
|
||||
@@ -326,7 +326,7 @@ class FileTree extends Component {
|
||||
},
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['editor.contextMenu.copy'], ''),
|
||||
name: Menu.getItem(Msg.Lang['editor.contextMenu.copy'], ''),
|
||||
callback: (_, { $trigger }) => {
|
||||
let id = $trigger.attr('id');
|
||||
this.copyNode(id);
|
||||
@@ -342,7 +342,7 @@ class FileTree extends Component {
|
||||
},
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['editor.contextMenu.paste'], ''),
|
||||
name: Menu.getItem(Msg.Lang['editor.contextMenu.paste'], ''),
|
||||
callback: (_, { $trigger }) => {
|
||||
let id = $trigger.attr('id');
|
||||
this.pasteNode(id);
|
||||
@@ -359,7 +359,7 @@ class FileTree extends Component {
|
||||
id: 'copy_path',
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['fileTree.copyPath'], ''),
|
||||
name: Menu.getItem(Msg.Lang['fileTree.copyPath'], ''),
|
||||
callback: (_, { $trigger }) => {
|
||||
let outPath = null;
|
||||
let type = $trigger.attr('type');
|
||||
@@ -382,7 +382,7 @@ class FileTree extends Component {
|
||||
},
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['fileTree.rename'], ''),
|
||||
name: Menu.getItem(Msg.Lang['fileTree.rename'], ''),
|
||||
callback: (_, { $trigger }) => {
|
||||
let type = $trigger.attr('type');
|
||||
let id = $trigger.attr('id');
|
||||
@@ -403,7 +403,7 @@ class FileTree extends Component {
|
||||
},
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['fileTree.delete'], ''),
|
||||
name: Menu.getItem(Msg.Lang['fileTree.delete'], ''),
|
||||
callback: (_, { $trigger }) => {
|
||||
let type = $trigger.attr('type');
|
||||
let id = $trigger.attr('id');
|
||||
|
||||
@@ -1,17 +1,33 @@
|
||||
goog.loadJs('common', () => {
|
||||
|
||||
goog.require('Mixly.Env');
|
||||
goog.require('Mixly.Debug');
|
||||
goog.require('Mixly.IdGenerator');
|
||||
goog.require('Mixly.Events');
|
||||
goog.require('Mixly.IdGenerator');
|
||||
goog.require('Mixly.HTMLTemplate');
|
||||
goog.provide('Mixly.Menu');
|
||||
|
||||
const {
|
||||
Env,
|
||||
Debug,
|
||||
Events,
|
||||
IdGenerator,
|
||||
Events
|
||||
HTMLTemplate
|
||||
} = Mixly;
|
||||
|
||||
|
||||
class Menu {
|
||||
static {
|
||||
HTMLTemplate.add(
|
||||
'html/menu-item.html',
|
||||
new HTMLTemplate(goog.readFileSync(path.join(Env.templatePath, 'html/menu-item.html')))
|
||||
);
|
||||
|
||||
this.getItem = (name, hotKey = '', icon = '') => {
|
||||
return HTMLTemplate.get('html/menu-item.html').render({ name, hotKey, icon });
|
||||
};
|
||||
}
|
||||
|
||||
#menuItems_ = [];
|
||||
#ids_ = {};
|
||||
#isDynamic_ = false;
|
||||
|
||||
@@ -7,8 +7,6 @@ goog.require('Mixly.XML');
|
||||
goog.require('Mixly.Msg');
|
||||
goog.require('Mixly.HTMLTemplate');
|
||||
goog.require('Mixly.Component');
|
||||
goog.require('Mixly.Menu');
|
||||
goog.require('Mixly.ContextMenu');
|
||||
goog.require('Mixly.DropdownMenuGroup');
|
||||
goog.provide('Mixly.Nav');
|
||||
|
||||
@@ -18,8 +16,6 @@ const {
|
||||
Msg,
|
||||
HTMLTemplate,
|
||||
Component,
|
||||
Menu,
|
||||
ContextMenu,
|
||||
DropdownMenuGroup
|
||||
} = Mixly;
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ goog.require('Mixly.IdGenerator');
|
||||
goog.require('Mixly.XML');
|
||||
goog.require('Mixly.Env');
|
||||
goog.require('Mixly.HTMLTemplate');
|
||||
goog.require('Mixly.ContextMenu');
|
||||
goog.require('Mixly.Debug');
|
||||
goog.require('Mixly.Menu');
|
||||
goog.require('Mixly.PageBase');
|
||||
@@ -21,7 +20,6 @@ const {
|
||||
XML,
|
||||
Env,
|
||||
HTMLTemplate,
|
||||
ContextMenu,
|
||||
Debug,
|
||||
Menu,
|
||||
PageBase,
|
||||
@@ -78,7 +76,7 @@ class SideBarLocalStorage extends PageBase {
|
||||
},
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem('打开新文件夹', ''),
|
||||
name: Menu.getItem('打开新文件夹', ''),
|
||||
callback: () => {
|
||||
this.showDirectoryPicker();
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ goog.require('Mixly.HTMLTemplate');
|
||||
goog.require('Mixly.DragV');
|
||||
goog.require('Mixly.StatusBar');
|
||||
goog.require('Mixly.Serial');
|
||||
goog.require('Mixly.ContextMenu');
|
||||
goog.require('Mixly.Menu');
|
||||
goog.require('Mixly.AmpyFileTree');
|
||||
goog.provide('Mixly.StatusBarAmpy');
|
||||
|
||||
@@ -21,7 +21,7 @@ const {
|
||||
DragV,
|
||||
StatusBar,
|
||||
Serial,
|
||||
ContextMenu,
|
||||
Menu,
|
||||
AmpyFileTree
|
||||
} = Mixly;
|
||||
|
||||
@@ -168,7 +168,7 @@ class StatusBarAmpy extends PageBase {
|
||||
},
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['statusbar.ampy.refresh'], ''),
|
||||
name: Menu.getItem(Msg.Lang['statusbar.ampy.refresh'], ''),
|
||||
callback: (_, { $trigger }) => {
|
||||
let type = $trigger.attr('type');
|
||||
if (type === 'root') {
|
||||
@@ -205,7 +205,7 @@ class StatusBarAmpy extends PageBase {
|
||||
},
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['statusbar.ampy.exit'], ''),
|
||||
name: Menu.getItem(Msg.Lang['statusbar.ampy.exit'], ''),
|
||||
callback: () => {
|
||||
this.closeFS();
|
||||
}
|
||||
@@ -227,7 +227,7 @@ class StatusBarAmpy extends PageBase {
|
||||
id: 'cut',
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['editor.contextMenu.cut'], 'Ctrl+X'),
|
||||
name: Menu.getItem(Msg.Lang['editor.contextMenu.cut'], 'Ctrl+X'),
|
||||
callback: () => this.#editor_.cut()
|
||||
}
|
||||
});
|
||||
@@ -236,7 +236,7 @@ class StatusBarAmpy extends PageBase {
|
||||
id: 'copy',
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['editor.contextMenu.copy'], 'Ctrl+C'),
|
||||
name: Menu.getItem(Msg.Lang['editor.contextMenu.copy'], 'Ctrl+C'),
|
||||
callback: () => this.#editor_.copy()
|
||||
}
|
||||
});
|
||||
@@ -245,7 +245,7 @@ class StatusBarAmpy extends PageBase {
|
||||
id: 'paste',
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['editor.contextMenu.paste'], 'Ctrl+V'),
|
||||
name: Menu.getItem(Msg.Lang['editor.contextMenu.paste'], 'Ctrl+V'),
|
||||
callback: () => this.#editor_.paste()
|
||||
}
|
||||
});
|
||||
@@ -259,7 +259,7 @@ class StatusBarAmpy extends PageBase {
|
||||
id: 'togglecomment',
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['editor.contextMenu.togglecomment'], 'Ctrl+/'),
|
||||
name: Menu.getItem(Msg.Lang['editor.contextMenu.togglecomment'], 'Ctrl+/'),
|
||||
callback: () => this.#editor_.commentLine()
|
||||
}
|
||||
});
|
||||
@@ -268,7 +268,7 @@ class StatusBarAmpy extends PageBase {
|
||||
id: 'toggleBlockComment',
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['editor.contextMenu.toggleBlockComment'], 'Shift+Alt+A'),
|
||||
name: Menu.getItem(Msg.Lang['editor.contextMenu.toggleBlockComment'], 'Shift+Alt+A'),
|
||||
callback: (key, opt) => this.#editor_.blockComment()
|
||||
}
|
||||
});*/
|
||||
@@ -290,7 +290,7 @@ class StatusBarAmpy extends PageBase {
|
||||
},
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['file.save'], 'Ctrl+S'),
|
||||
name: Menu.getItem(Msg.Lang['file.save'], 'Ctrl+S'),
|
||||
callback: async () => {
|
||||
await this.put();
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ goog.require('Mixly.StatusBar');
|
||||
goog.require('Mixly.SideBarsManager');
|
||||
goog.require('Mixly.HTMLTemplate');
|
||||
goog.require('Mixly.PageBase');
|
||||
goog.require('Mixly.ContextMenu');
|
||||
goog.require('Mixly.Menu');
|
||||
goog.require('Mixly.StatusBarSerialOutput');
|
||||
goog.require('Mixly.StatusBarSerialChart');
|
||||
goog.require('Mixly.Electron.Serial');
|
||||
@@ -29,7 +29,7 @@ const {
|
||||
RightSideBarsManager,
|
||||
HTMLTemplate,
|
||||
PageBase,
|
||||
ContextMenu,
|
||||
Menu,
|
||||
StatusBarSerialOutput,
|
||||
StatusBarSerialChart,
|
||||
Electron = {},
|
||||
@@ -186,7 +186,7 @@ class StatusBarSerial extends PageBase {
|
||||
},
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['statusbar.serial.interrupt'], 'Ctrl+C'),
|
||||
name: Menu.getItem(Msg.Lang['statusbar.serial.interrupt'], 'Ctrl+C'),
|
||||
callback: (key, opt) => this.interrupt().catch(Debug.error)
|
||||
}
|
||||
});
|
||||
@@ -200,7 +200,7 @@ class StatusBarSerial extends PageBase {
|
||||
},
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['statusbar.serial.reset'], 'Ctrl+D'),
|
||||
name: Menu.getItem(Msg.Lang['statusbar.serial.reset'], 'Ctrl+D'),
|
||||
callback: (key, opt) => this.reset().catch(Debug.error)
|
||||
}
|
||||
});
|
||||
@@ -213,7 +213,7 @@ class StatusBarSerial extends PageBase {
|
||||
},
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['statusbar.serial.toggle'], ''),
|
||||
name: Menu.getItem(Msg.Lang['statusbar.serial.toggle'], ''),
|
||||
callback: (key, opt) => this.toggle().catch(Debug.error)
|
||||
}
|
||||
});
|
||||
|
||||
@@ -22,6 +22,7 @@ const {
|
||||
} = Mixly;
|
||||
const { USER } = Config;
|
||||
|
||||
|
||||
class StatusBar extends EditorAce {
|
||||
#contextMenu_ = null;
|
||||
constructor() {
|
||||
@@ -44,7 +45,7 @@ class StatusBar extends EditorAce {
|
||||
id: 'copy',
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['editor.contextMenu.copy'], 'Ctrl+C'),
|
||||
name: Menu.getItem(Msg.Lang['editor.contextMenu.copy'], 'Ctrl+C'),
|
||||
callback: (key, opt) => this.copy()
|
||||
}
|
||||
});
|
||||
|
||||
@@ -14,7 +14,6 @@ goog.require('Mixly.StatusBarFS');
|
||||
goog.require('Mixly.StatusBarLibs');
|
||||
goog.require('Mixly.StatusBarAmpy')
|
||||
goog.require('Mixly.PagesManager');
|
||||
goog.require('Mixly.ContextMenu');
|
||||
goog.require('Mixly.DropdownMenu');
|
||||
goog.require('Mixly.Menu');
|
||||
goog.require('Mixly.IdGenerator');
|
||||
@@ -36,7 +35,6 @@ const {
|
||||
StatusBarLibs,
|
||||
StatusBarAmpy,
|
||||
PagesManager,
|
||||
ContextMenu,
|
||||
DropdownMenu,
|
||||
Menu,
|
||||
IdGenerator,
|
||||
@@ -158,7 +156,7 @@ class StatusBarsManager extends PagesManager {
|
||||
},
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['statusbar.openSelectedPort'], ''),
|
||||
name: Menu.getItem(Msg.Lang['statusbar.openSelectedPort'], ''),
|
||||
callback: (key, opt) => {
|
||||
this.openSelectedPort();
|
||||
}
|
||||
@@ -170,7 +168,7 @@ class StatusBarsManager extends PagesManager {
|
||||
children: serialChildMenu,
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['statusbar.openPort'], '')
|
||||
name: Menu.getItem(Msg.Lang['statusbar.openPort'], '')
|
||||
}
|
||||
});
|
||||
|
||||
@@ -179,7 +177,7 @@ class StatusBarsManager extends PagesManager {
|
||||
id: 'lib',
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem('第三方库管理', ''),
|
||||
name: Menu.getItem('第三方库管理', ''),
|
||||
callback: (key, opt) => {
|
||||
this.add('libs', 'libs', '第三方库管理');
|
||||
this.changeTo('libs');
|
||||
@@ -199,7 +197,7 @@ class StatusBarsManager extends PagesManager {
|
||||
id: 'ampy',
|
||||
data: {
|
||||
isHtmlName: true,
|
||||
name: ContextMenu.getItem(Msg.Lang['statusbar.ampy'], ''),
|
||||
name: Menu.getItem(Msg.Lang['statusbar.ampy'], ''),
|
||||
callback: (key, opt) => {
|
||||
this.add({
|
||||
id: 'ampy',
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
"Mixly.Drag",
|
||||
"Mixly.Nav",
|
||||
"Mixly.Menu",
|
||||
"Mixly.ContextMenu",
|
||||
"Mixly.Workspace",
|
||||
"Mixly.FooterBar",
|
||||
"Mixly.HTMLTemplate",
|
||||
@@ -149,11 +148,9 @@
|
||||
"path": "/common/context-menu.js",
|
||||
"require": [
|
||||
"$.contextMenu",
|
||||
"Mixly.XML",
|
||||
"Mixly.Env",
|
||||
"Mixly.Menu",
|
||||
"Mixly.Events",
|
||||
"Mixly.Registry",
|
||||
"Mixly.HTMLTemplate"
|
||||
"Mixly.Registry"
|
||||
],
|
||||
"provide": [
|
||||
"Mixly.ContextMenu"
|
||||
@@ -282,9 +279,9 @@
|
||||
"Mixly.XML",
|
||||
"Mixly.Env",
|
||||
"Mixly.Msg",
|
||||
"Mixly.Menu",
|
||||
"Mixly.ContextMenu",
|
||||
"Mixly.IdGenerator",
|
||||
"Mixly.Menu",
|
||||
"Mixly.EditorMonaco"
|
||||
],
|
||||
"provide": [
|
||||
@@ -322,12 +319,11 @@
|
||||
"Mixly.Msg",
|
||||
"Mixly.Config",
|
||||
"Mixly.Env",
|
||||
"Mixly.LayerExt",
|
||||
"Mixly.ContextMenu",
|
||||
"Mixly.Debug",
|
||||
"Mixly.Menu",
|
||||
"Mixly.Boards",
|
||||
"Mixly.MJson",
|
||||
"Mixly.LayerExt",
|
||||
"Mixly.HTMLTemplate",
|
||||
"Mixly.EditorBlockly",
|
||||
"Mixly.EditorCode",
|
||||
@@ -700,9 +696,11 @@
|
||||
{
|
||||
"path": "/common/menu.js",
|
||||
"require": [
|
||||
"Mixly.Env",
|
||||
"Mixly.Debug",
|
||||
"Mixly.Events",
|
||||
"Mixly.IdGenerator",
|
||||
"Mixly.Events"
|
||||
"Mixly.HTMLTemplate"
|
||||
],
|
||||
"provide": [
|
||||
"Mixly.Menu"
|
||||
@@ -787,8 +785,6 @@
|
||||
"Mixly.Msg",
|
||||
"Mixly.HTMLTemplate",
|
||||
"Mixly.Component",
|
||||
"Mixly.Menu",
|
||||
"Mixly.ContextMenu",
|
||||
"Mixly.DropdownMenuGroup"
|
||||
],
|
||||
"provide": [
|
||||
@@ -908,7 +904,6 @@
|
||||
"Mixly.XML",
|
||||
"Mixly.Env",
|
||||
"Mixly.HTMLTemplate",
|
||||
"Mixly.ContextMenu",
|
||||
"Mixly.Debug",
|
||||
"Mixly.Menu",
|
||||
"Mixly.PageBase",
|
||||
@@ -963,7 +958,7 @@
|
||||
"Mixly.DragV",
|
||||
"Mixly.StatusBar",
|
||||
"Mixly.Serial",
|
||||
"Mixly.ContextMenu",
|
||||
"Mixly.Menu",
|
||||
"Mixly.AmpyFileTree"
|
||||
],
|
||||
"provide": [
|
||||
@@ -1093,7 +1088,7 @@
|
||||
"Mixly.SideBarsManager",
|
||||
"Mixly.HTMLTemplate",
|
||||
"Mixly.PageBase",
|
||||
"Mixly.ContextMenu",
|
||||
"Mixly.Menu",
|
||||
"Mixly.StatusBarSerialOutput",
|
||||
"Mixly.StatusBarSerialChart",
|
||||
"Mixly.Electron.Serial",
|
||||
@@ -1137,7 +1132,6 @@
|
||||
"Mixly.StatusBarLibs",
|
||||
"Mixly.StatusBarAmpy",
|
||||
"Mixly.PagesManager",
|
||||
"Mixly.ContextMenu",
|
||||
"Mixly.DropdownMenu",
|
||||
"Mixly.Menu",
|
||||
"Mixly.IdGenerator",
|
||||
|
||||
Reference in New Issue
Block a user