mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	reactivate "cut to note", closes #795
This commit is contained in:
		| @@ -241,7 +241,7 @@ | |||||||
|      |      | ||||||
|     <dt class="tag-source">Source:</dt> |     <dt class="tag-source">Source:</dt> | ||||||
|     <dd class="tag-source"><ul class="dummy"><li> |     <dd class="tag-source"><ul class="dummy"><li> | ||||||
|         <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line17">line 17</a> |         <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line16">line 16</a> | ||||||
|     </li></ul></dd> |     </li></ul></dd> | ||||||
|      |      | ||||||
|  |  | ||||||
| @@ -357,7 +357,7 @@ | |||||||
|      |      | ||||||
|     <dt class="tag-source">Source:</dt> |     <dt class="tag-source">Source:</dt> | ||||||
|     <dd class="tag-source"><ul class="dummy"><li> |     <dd class="tag-source"><ul class="dummy"><li> | ||||||
|         <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line13">line 13</a> |         <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line12">line 12</a> | ||||||
|     </li></ul></dd> |     </li></ul></dd> | ||||||
|      |      | ||||||
|  |  | ||||||
| @@ -415,7 +415,7 @@ | |||||||
|      |      | ||||||
|     <dt class="tag-source">Source:</dt> |     <dt class="tag-source">Source:</dt> | ||||||
|     <dd class="tag-source"><ul class="dummy"><li> |     <dd class="tag-source"><ul class="dummy"><li> | ||||||
|         <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line11">line 11</a> |         <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line10">line 10</a> | ||||||
|     </li></ul></dd> |     </li></ul></dd> | ||||||
|      |      | ||||||
|  |  | ||||||
| @@ -473,7 +473,7 @@ | |||||||
|      |      | ||||||
|     <dt class="tag-source">Source:</dt> |     <dt class="tag-source">Source:</dt> | ||||||
|     <dd class="tag-source"><ul class="dummy"><li> |     <dd class="tag-source"><ul class="dummy"><li> | ||||||
|         <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line15">line 15</a> |         <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line14">line 14</a> | ||||||
|     </li></ul></dd> |     </li></ul></dd> | ||||||
|      |      | ||||||
|  |  | ||||||
| @@ -549,7 +549,7 @@ | |||||||
|      |      | ||||||
|     <dt class="tag-source">Source:</dt> |     <dt class="tag-source">Source:</dt> | ||||||
|     <dd class="tag-source"><ul class="dummy"><li> |     <dd class="tag-source"><ul class="dummy"><li> | ||||||
|         <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line21">line 21</a> |         <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line20">line 20</a> | ||||||
|     </li></ul></dd> |     </li></ul></dd> | ||||||
|      |      | ||||||
|  |  | ||||||
| @@ -651,7 +651,7 @@ | |||||||
|      |      | ||||||
|     <dt class="tag-source">Source:</dt> |     <dt class="tag-source">Source:</dt> | ||||||
|     <dd class="tag-source"><ul class="dummy"><li> |     <dd class="tag-source"><ul class="dummy"><li> | ||||||
|         <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line26">line 26</a> |         <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line25">line 25</a> | ||||||
|     </li></ul></dd> |     </li></ul></dd> | ||||||
|      |      | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										4
									
								
								libraries/ckeditor/ckeditor.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								libraries/ckeditor/ckeditor.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -637,12 +637,6 @@ async function createNote(node, parentNoteId, target, extraOptions = {}) { | |||||||
|     if (noteDetailService.getActiveTabNoteType() !== 'text') { |     if (noteDetailService.getActiveTabNoteType() !== 'text') { | ||||||
|         extraOptions.saveSelection = false; |         extraOptions.saveSelection = false; | ||||||
|     } |     } | ||||||
|     else { |  | ||||||
|         // just disable this feature altogether - there's a problem that note containing image or table at the beginning |  | ||||||
|         // of the content will be auto-selected by CKEditor and then CTRL-P with no user interaction will automatically save |  | ||||||
|         // the selection - see https://github.com/ckeditor/ckeditor5/issues/1384 |  | ||||||
|         extraOptions.saveSelection = false; |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     if (extraOptions.saveSelection) { |     if (extraOptions.saveSelection) { | ||||||
|         [extraOptions.title, extraOptions.content] = parseSelectedHtml(window.cutToNote.getSelectedHtml()); |         [extraOptions.title, extraOptions.content] = parseSelectedHtml(window.cutToNote.getSelectedHtml()); | ||||||
| @@ -820,13 +814,13 @@ keyboardActionService.setGlobalActionHandler('CreateNoteAfter', async () => { | |||||||
|     }); |     }); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| async function createNoteInto() { | async function createNoteInto(saveSelection = false) { | ||||||
|     const node = getActiveNode(); |     const node = getActiveNode(); | ||||||
|  |  | ||||||
|     if (node) { |     if (node) { | ||||||
|         await createNote(node, node.data.noteId, 'into', { |         await createNote(node, node.data.noteId, 'into', { | ||||||
|             isProtected: node.data.isProtected, |             isProtected: node.data.isProtected, | ||||||
|             saveSelection: true |             saveSelection: saveSelection | ||||||
|         }); |         }); | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @@ -875,7 +869,9 @@ async function reloadNotes(noteIds, activateNotePath = null) { | |||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| window.glob.createNoteInto = createNoteInto; | window.glob.cutIntoNote = () => createNoteInto(true); | ||||||
|  |  | ||||||
|  | keyboardActionService.setGlobalActionHandler('CutIntoNote', () => createNoteInto(true)); | ||||||
|  |  | ||||||
| keyboardActionService.setGlobalActionHandler('CreateNoteInto', createNoteInto); | keyboardActionService.setGlobalActionHandler('CreateNoteInto', createNoteInto); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -255,6 +255,11 @@ const DEFAULT_KEYBOARD_ACTIONS = [ | |||||||
|         defaultShortcuts: [], |         defaultShortcuts: [], | ||||||
|         description: "Pastes Markdown from clipboard into text note" |         description: "Pastes Markdown from clipboard into text note" | ||||||
|     }, |     }, | ||||||
|  |     { | ||||||
|  |         actionName: "CutIntoNote", | ||||||
|  |         defaultShortcuts: [], | ||||||
|  |         description: "Cuts the selection from the current note and creates subnote with the selected text" | ||||||
|  |     }, | ||||||
|  |  | ||||||
|     { |     { | ||||||
|         separator: "Other" |         separator: "Other" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user