Notes/src/public/javascripts/services/dialog_command_executor.js

63 lines
1.8 KiB
JavaScript
Raw Normal View History

2020-01-20 22:35:52 +01:00
import Component from "../widgets/component.js";
2020-02-15 10:41:21 +01:00
export default class DialogCommandExecutor extends Component {
jumpToNoteCommand() {
2020-01-20 22:35:52 +01:00
import("../dialogs/jump_to_note.js").then(d => d.showDialog());
}
2020-02-15 10:41:21 +01:00
showRecentChangesCommand() {
2020-01-20 22:35:52 +01:00
import("../dialogs/recent_changes.js").then(d => d.showDialog());
}
2020-02-15 10:41:21 +01:00
showAttributesCommand() {
2020-01-20 22:35:52 +01:00
import("../dialogs/attributes.js").then(d => d.showDialog());
}
2020-02-15 10:41:21 +01:00
showNoteInfoCommand() {
2020-01-20 22:35:52 +01:00
import("../dialogs/note_info.js").then(d => d.showDialog());
}
2020-02-15 10:41:21 +01:00
showNoteRevisionsCommand() {
2020-01-20 22:35:52 +01:00
import("../dialogs/note_revisions.js").then(d => d.showCurrentNoteRevisions());
}
2020-02-15 10:41:21 +01:00
showNoteSourceCommand() {
2020-01-20 22:35:52 +01:00
import("../dialogs/note_source.js").then(d => d.showDialog());
}
2020-02-15 10:41:21 +01:00
showLinkMapCommand() {
2020-01-20 22:35:52 +01:00
import("../dialogs/link_map.js").then(d => d.showDialog());
}
2020-02-15 10:41:21 +01:00
pasteMarkdownIntoTextCommand() {
2020-01-20 22:35:52 +01:00
import("../dialogs/markdown_import.js").then(d => d.importMarkdownInline());
}
2020-02-15 10:41:21 +01:00
async cloneNotesToCommand() {
// FIXME
2020-01-20 22:35:52 +01:00
const selectedOrActiveNodes = this.appContext.getMainNoteTree().getSelectedOrActiveNodes();
const noteIds = selectedOrActiveNodes.map(node => node.data.noteId);
const d = await import("../dialogs/clone_to.js");
d.showDialog(noteIds);
}
2020-02-15 10:41:21 +01:00
async editBranchPrefixCommand() {
2020-02-14 21:21:47 +01:00
const notePath = this.appContext.tabManager.getActiveTabNotePath();
2020-01-20 22:35:52 +01:00
2020-02-14 21:21:47 +01:00
if (notePath) {
const editBranchPrefixDialog = await import("../dialogs/branch_prefix.js");
editBranchPrefixDialog.showDialog(notePath);
}
2020-01-20 22:35:52 +01:00
}
2020-02-15 10:41:21 +01:00
addLinkToTextCommand() {
2020-01-20 22:35:52 +01:00
import("../dialogs/add_link.js").then(d => d.showDialog());
}
2020-02-15 10:41:21 +01:00
async moveBranchIdsToCommand({branchIds}) {
const d = await import("../dialogs/move_to.js");
d.showDialog(branchIds);
}
2020-01-20 22:35:52 +01:00
}