mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	note actions now work again
This commit is contained in:
		| @@ -126,7 +126,9 @@ if (utils.isElectron()) { | |||||||
|     }); |     }); | ||||||
| } | } | ||||||
|  |  | ||||||
| $("#export-note-button").click(function () { | const $noteTabContainer = $("#note-tab-container"); | ||||||
|  |  | ||||||
|  | $noteTabContainer.on("click", ".export-note-button", function () { | ||||||
|     if ($(this).hasClass("disabled")) { |     if ($(this).hasClass("disabled")) { | ||||||
|         return; |         return; | ||||||
|     } |     } | ||||||
| @@ -134,12 +136,12 @@ $("#export-note-button").click(function () { | |||||||
|     exportDialog.showDialog('single'); |     exportDialog.showDialog('single'); | ||||||
| }); | }); | ||||||
|  |  | ||||||
|  | $noteTabContainer.on("click", ".import-files-button", importDialog.showDialog); | ||||||
|  |  | ||||||
| $('[data-toggle="tooltip"]').tooltip({ | $('[data-toggle="tooltip"]').tooltip({ | ||||||
|     html: true |     html: true | ||||||
| }); | }); | ||||||
|  |  | ||||||
| $("#import-files-button").click(importDialog.showDialog); |  | ||||||
|  |  | ||||||
| macInit.init(); | macInit.init(); | ||||||
|  |  | ||||||
| searchNotesService.init(); // should be in front of treeService since that one manipulates address bar hash | searchNotesService.init(); // should be in front of treeService since that one manipulates address bar hash | ||||||
|   | |||||||
| @@ -7,7 +7,7 @@ import messagingService from "../services/messaging.js"; | |||||||
|  |  | ||||||
| const $dialog = $("#import-dialog"); | const $dialog = $("#import-dialog"); | ||||||
| const $form = $("#import-form"); | const $form = $("#import-form"); | ||||||
| const $noteTitle = $dialog.find(".note-title"); | const $noteTitle = $dialog.find(".import-note-title"); | ||||||
| const $fileUploadInput = $("#import-file-upload-input"); | const $fileUploadInput = $("#import-file-upload-input"); | ||||||
| const $importProgressCountWrapper = $("#import-progress-count-wrapper"); | const $importProgressCountWrapper = $("#import-progress-count-wrapper"); | ||||||
| const $importProgressCount = $("#import-progress-count"); | const $importProgressCount = $("#import-progress-count"); | ||||||
|   | |||||||
| @@ -28,22 +28,6 @@ function registerEntrypoints() { | |||||||
|     $("#jump-to-note-dialog-button").click(jumpToNoteDialog.showDialog); |     $("#jump-to-note-dialog-button").click(jumpToNoteDialog.showDialog); | ||||||
|     utils.bindShortcut('ctrl+j', jumpToNoteDialog.showDialog); |     utils.bindShortcut('ctrl+j', jumpToNoteDialog.showDialog); | ||||||
|  |  | ||||||
|     $("#show-note-revisions-button").click(function() { |  | ||||||
|         if ($(this).hasClass("disabled")) { |  | ||||||
|             return; |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         noteRevisionsDialog.showCurrentNoteRevisions(); |  | ||||||
|     }); |  | ||||||
|  |  | ||||||
|     $("#show-source-button").click(function() { |  | ||||||
|         if ($(this).hasClass("disabled")) { |  | ||||||
|             return; |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         noteSourceDialog.showDialog(); |  | ||||||
|     }); |  | ||||||
|  |  | ||||||
|     $("#recent-changes-button").click(recentChangesDialog.showDialog); |     $("#recent-changes-button").click(recentChangesDialog.showDialog); | ||||||
|  |  | ||||||
|     $("#enter-protected-session-button").click(protectedSessionService.enterProtectedSession); |     $("#enter-protected-session-button").click(protectedSessionService.enterProtectedSession); | ||||||
| @@ -52,9 +36,28 @@ function registerEntrypoints() { | |||||||
|     $("#toggle-search-button").click(searchNotesService.toggleSearch); |     $("#toggle-search-button").click(searchNotesService.toggleSearch); | ||||||
|     utils.bindShortcut('ctrl+s', searchNotesService.toggleSearch); |     utils.bindShortcut('ctrl+s', searchNotesService.toggleSearch); | ||||||
|  |  | ||||||
|     $(".show-attributes-button").click(attributesDialog.showDialog); |     const $noteTabContainer = $("#note-tab-container"); | ||||||
|  |     $noteTabContainer.on("click", ".show-attributes-button", attributesDialog.showDialog); | ||||||
|     utils.bindShortcut('alt+a', attributesDialog.showDialog); |     utils.bindShortcut('alt+a', attributesDialog.showDialog); | ||||||
|  |  | ||||||
|  |     $noteTabContainer.on("click", ".show-note-info-button", noteInfoDialog.showDialog); | ||||||
|  |  | ||||||
|  |     $noteTabContainer.on("click", ".show-note-revisions-button", function() { | ||||||
|  |         if ($(this).hasClass("disabled")) { | ||||||
|  |             return; | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         noteRevisionsDialog.showCurrentNoteRevisions(); | ||||||
|  |     }); | ||||||
|  |  | ||||||
|  |     $noteTabContainer.on("click", ".show-source-button", function() { | ||||||
|  |         if ($(this).hasClass("disabled")) { | ||||||
|  |             return; | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         noteSourceDialog.showDialog(); | ||||||
|  |     }); | ||||||
|  |  | ||||||
|     $("#options-button").click(optionsDialog.showDialog); |     $("#options-button").click(optionsDialog.showDialog); | ||||||
|  |  | ||||||
|     $("#show-help-button").click(helpDialog.showDialog); |     $("#show-help-button").click(helpDialog.showDialog); | ||||||
| @@ -63,8 +66,6 @@ function registerEntrypoints() { | |||||||
|     $("#open-sql-console-button").click(sqlConsoleDialog.showDialog); |     $("#open-sql-console-button").click(sqlConsoleDialog.showDialog); | ||||||
|     utils.bindShortcut('alt+o', sqlConsoleDialog.showDialog); |     utils.bindShortcut('alt+o', sqlConsoleDialog.showDialog); | ||||||
|  |  | ||||||
|     $("#show-note-info-button").click(noteInfoDialog.showDialog); |  | ||||||
|  |  | ||||||
|     $("#show-about-dialog-button").click(aboutDialog.showDialog); |     $("#show-about-dialog-button").click(aboutDialog.showDialog); | ||||||
|  |  | ||||||
|     if (utils.isElectron()) { |     if (utils.isElectron()) { | ||||||
|   | |||||||
| @@ -148,13 +148,11 @@ async function loadNoteDetail(noteId, newTab = false) { | |||||||
|  |  | ||||||
|     if (utils.isDesktop()) { |     if (utils.isDesktop()) { | ||||||
|         // needs to happen after loading the note itself because it references active noteId |         // needs to happen after loading the note itself because it references active noteId | ||||||
|         // FIXME |         ctx.attributes.refreshAttributes(); | ||||||
|         //attributeService.refreshAttributes(); |  | ||||||
|     } |     } | ||||||
|     else { |     else { | ||||||
|         // mobile usually doesn't need attributes so we just invalidate |         // mobile usually doesn't need attributes so we just invalidate | ||||||
|         // FIXME |         ctx.attributes.invalidateAttributes(); | ||||||
|         //attributeService.invalidateAttributes(); |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     ctx.updateNoteView(); |     ctx.updateNoteView(); | ||||||
|   | |||||||
| @@ -0,0 +1,18 @@ | |||||||
|  | class NoteDetailImage { | ||||||
|  |     /** | ||||||
|  |      * @param {NoteContext} ctx | ||||||
|  |      */ | ||||||
|  |     constructor(ctx) { | ||||||
|  |         this.ctx = ctx; | ||||||
|  |         this.$component = ctx.$noteTabContent.find(".protected-session-password-component"); | ||||||
|  |         const $passwordForms = ctx.$noteTabContent.find(".protected-session-password-form"); | ||||||
|  |         const $passwordInputs = ctx.$noteTabContent.find(".protected-session-password"); | ||||||
|  |         const $passwordInModal = ctx.$noteTabContent.find(".protected-session-password-in-modal"); | ||||||
|  |         const $protectButton = ctx.$noteTabContent.find(".protect-button"); | ||||||
|  |         const $unprotectButton = ctx.$noteTabContent.find(".unprotect-button"); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     show() { | ||||||
|  |         this.$component.show(); | ||||||
|  |     } | ||||||
|  | } | ||||||
| @@ -10,7 +10,7 @@ const $component = $("#protected-session-password-component"); | |||||||
| const $passwordForms = $(".protected-session-password-form"); | const $passwordForms = $(".protected-session-password-form"); | ||||||
| const $passwordInputs = $(".protected-session-password"); | const $passwordInputs = $(".protected-session-password"); | ||||||
| const $passwordInModal = $("#protected-session-password-in-modal"); | const $passwordInModal = $("#protected-session-password-in-modal"); | ||||||
| const $tabContent = $(".note-tab-content"); // FIXME TAB | const $tabContent = $(".note-tab-content"); | ||||||
| const $protectButton = $("#protect-button"); | const $protectButton = $("#protect-button"); | ||||||
| const $unprotectButton = $("#unprotect-button"); | const $unprotectButton = $("#unprotect-button"); | ||||||
| const $enterProtectedSessionButton = $("#enter-protected-session-button"); | const $enterProtectedSessionButton = $("#enter-protected-session-button"); | ||||||
|   | |||||||
| @@ -147,7 +147,7 @@ li.dropdown-submenu:hover > ul.dropdown-menu { | |||||||
|     border: 1px solid var(--main-border-color); |     border: 1px solid var(--main-border-color); | ||||||
| } | } | ||||||
|  |  | ||||||
| .note-info-table td, .note-info-table th { | #note-info-table td, #note-info-table th { | ||||||
|     padding: 15px; |     padding: 15px; | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -18,7 +18,7 @@ | |||||||
|  |  | ||||||
|                         <input type="file" id="import-file-upload-input" class="form-control-file" multiple /> |                         <input type="file" id="import-file-upload-input" class="form-control-file" multiple /> | ||||||
|  |  | ||||||
|                         <p>Content of the file will be imported as child note(s) into <strong class="note-title"></strong>. |                         <p>Content of the file will be imported as child note(s) into <strong class="import-note-title"></strong>. | ||||||
|                     </div> |                     </div> | ||||||
|  |  | ||||||
|                     <div class="form-group"> |                     <div class="form-group"> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user