| 
									
										
										
										
											2020-01-20 22:35:52 +01:00
										 |  |  | import Component from "../widgets/component.js"; | 
					
						
							| 
									
										
										
										
											2020-02-17 22:14:39 +01:00
										 |  |  | import appContext from "./app_context.js"; | 
					
						
							| 
									
										
										
										
											2020-05-08 23:39:46 +02:00
										 |  |  | import dateNoteService from "../services/date_notes.js"; | 
					
						
							|  |  |  | import noteCreateService from "../services/note_create.js"; | 
					
						
							| 
									
										
										
										
											2020-01-20 22:35:52 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											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
										 |  |  |     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 editBranchPrefixCommand() { | 
					
						
							| 
									
										
										
										
											2020-02-17 22:14:39 +01:00
										 |  |  |         const notePath = 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 18:41:32 +01:00
										 |  |  |     async cloneNoteIdsToCommand({noteIds}) { | 
					
						
							|  |  |  |         const d = await import("../dialogs/clone_to.js"); | 
					
						
							|  |  |  |         d.showDialog(noteIds); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-02-15 10:41:21 +01:00
										 |  |  |     async moveBranchIdsToCommand({branchIds}) { | 
					
						
							|  |  |  |         const d = await import("../dialogs/move_to.js"); | 
					
						
							|  |  |  |         d.showDialog(branchIds); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2020-02-16 19:54:11 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     showOptionsCommand() { | 
					
						
							| 
									
										
										
										
											2020-05-08 23:39:46 +02:00
										 |  |  |         import("../dialogs/options.js").then(d => d.showDialog()); | 
					
						
							| 
									
										
										
										
											2020-02-16 19:54:11 +01:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     showHelpCommand() { | 
					
						
							| 
									
										
										
										
											2020-05-08 23:39:46 +02:00
										 |  |  |         import("../dialogs/help.js").then(d => d.showDialog()); | 
					
						
							| 
									
										
										
										
											2020-02-16 19:54:11 +01:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-08 23:39:46 +02:00
										 |  |  |     async showSQLConsoleCommand() { | 
					
						
							|  |  |  |         const sqlConsoleNote = await dateNoteService.createSqlConsole(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         const tabContext = await appContext.tabManager.openTabWithNote(sqlConsoleNote.noteId, true); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         appContext.triggerCommand('focusOnDetail', {tabId: tabContext.tabId}); | 
					
						
							| 
									
										
										
										
											2020-02-16 19:54:11 +01:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-25 23:02:12 +01:00
										 |  |  |     async searchNotesCommand() { | 
					
						
							|  |  |  |         const searchNote = await dateNoteService.createSearchNote(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         const tabContext = await appContext.tabManager.openTabWithNote(searchNote.noteId, true); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         appContext.triggerCommand('focusOnDetail', {tabId: tabContext.tabId}); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-02-16 19:54:11 +01:00
										 |  |  |     showBackendLogCommand() { | 
					
						
							| 
									
										
										
										
											2020-05-08 23:39:46 +02:00
										 |  |  |         import("../dialogs/backend_log.js").then(d => d.showDialog()); | 
					
						
							| 
									
										
										
										
											2020-02-16 19:54:11 +01:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2020-07-04 10:18:01 +02:00
										 |  |  | } |