mirror of
https://github.com/zadam/trilium.git
synced 2025-10-28 16:56:34 +01:00
basic executor / command mechanism
This commit is contained in:
63
src/public/javascripts/services/dialog_command_executor.js
Normal file
63
src/public/javascripts/services/dialog_command_executor.js
Normal file
@@ -0,0 +1,63 @@
|
||||
import Component from "../widgets/component.js";
|
||||
|
||||
export default class DialogCommandExecutor extends Component {
|
||||
jumpToNoteCommand() {
|
||||
import("../dialogs/jump_to_note.js").then(d => d.showDialog());
|
||||
}
|
||||
|
||||
showRecentChangesCommand() {
|
||||
import("../dialogs/recent_changes.js").then(d => d.showDialog());
|
||||
}
|
||||
|
||||
showAttributesCommand() {
|
||||
import("../dialogs/attributes.js").then(d => d.showDialog());
|
||||
}
|
||||
|
||||
showNoteInfoCommand() {
|
||||
import("../dialogs/note_info.js").then(d => d.showDialog());
|
||||
}
|
||||
|
||||
showNoteRevisionsCommand() {
|
||||
import("../dialogs/note_revisions.js").then(d => d.showCurrentNoteRevisions());
|
||||
}
|
||||
|
||||
showNoteSourceCommand() {
|
||||
import("../dialogs/note_source.js").then(d => d.showDialog());
|
||||
}
|
||||
|
||||
showLinkMapCommand() {
|
||||
import("../dialogs/link_map.js").then(d => d.showDialog());
|
||||
}
|
||||
|
||||
pasteMarkdownIntoTextCommand() {
|
||||
import("../dialogs/markdown_import.js").then(d => d.importMarkdownInline());
|
||||
}
|
||||
|
||||
async cloneNotesToCommand() {
|
||||
// FIXME
|
||||
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);
|
||||
}
|
||||
|
||||
async editBranchPrefixCommand() {
|
||||
const notePath = this.appContext.tabManager.getActiveTabNotePath();
|
||||
|
||||
if (notePath) {
|
||||
const editBranchPrefixDialog = await import("../dialogs/branch_prefix.js");
|
||||
editBranchPrefixDialog.showDialog(notePath);
|
||||
}
|
||||
}
|
||||
|
||||
addLinkToTextCommand() {
|
||||
import("../dialogs/add_link.js").then(d => d.showDialog());
|
||||
}
|
||||
|
||||
async moveBranchIdsToCommand({branchIds}) {
|
||||
const d = await import("../dialogs/move_to.js");
|
||||
d.showDialog(branchIds);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user