mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-27 00:06:30 +01:00 
			
		
		
		
	Merge pull request #52 from manto89/feature/keep-title
Keep the title when adding notes
This commit is contained in:
		| @@ -27,6 +27,10 @@ | ||||
|   <div id="save-link-with-note-wrapper"> | ||||
|     <textarea id="save-link-with-note-textarea" rows="5"></textarea> | ||||
|  | ||||
|     <div> | ||||
|       <input type="checkbox" id="keep-title-checkbox" name="keep-title-checkbox" value="Bike"> | ||||
|       <label for="keep-title-checkbox">Keep page title as note title</label><br> | ||||
|     </div> | ||||
|     <div style="display: flex;"> | ||||
|       <button type="submit" class="button wide" id="save-button">Save</button> | ||||
|  | ||||
|   | ||||
| @@ -35,6 +35,7 @@ $saveTabsButton.on("click", () => sendMessage({name: 'save-tabs'})); | ||||
|  | ||||
| const $saveLinkWithNoteWrapper = $("#save-link-with-note-wrapper"); | ||||
| const $textNote = $("#save-link-with-note-textarea"); | ||||
| const $keepTitle = $("#keep-title-checkbox"); | ||||
|  | ||||
| $textNote.on('keypress', function (event) { | ||||
|     if ((event.which === 10 || event.which === 13) && event.ctrlKey) { | ||||
| @@ -66,6 +67,10 @@ async function saveLinkWithNote() { | ||||
|         title = ''; | ||||
|         content = ''; | ||||
|     } | ||||
|     else if ($keepTitle[0].checked){ | ||||
|         title = ''; | ||||
|         content = textNoteVal; | ||||
|     } | ||||
|     else { | ||||
|         const match = /^(.*?)([.?!]\s|\n)/.exec(textNoteVal); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user