mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	we now add link to exact history revision to recent changes
This commit is contained in:
		
							
								
								
									
										4
									
								
								TODO
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								TODO
									
									
									
									
									
								
							| @@ -4,10 +4,10 @@ New features: | |||||||
| - what links here | - what links here | ||||||
|   - link between encrypted notes could be done by encrypting note_ids of both sides of relations. Encryption must be |   - link between encrypted notes could be done by encrypting note_ids of both sides of relations. Encryption must be | ||||||
|     deterministic to allow lookup by cipher text |     deterministic to allow lookup by cipher text | ||||||
| - recent changes - link to note should lead to the revision | - recent changes - links don't look like links (no underline, black) | ||||||
| - db upgrade / migration | - db upgrade / migration | ||||||
| - db backup into directory | - db backup into directory | ||||||
| - recent notes can either go to or add link | - DONE: recent notes can either go to or add link | ||||||
| - might do the same thing with alt-j and alt-l | - might do the same thing with alt-j and alt-l | ||||||
| - ctrl-b nad linkem by mohlo byt goto do notu | - ctrl-b nad linkem by mohlo byt goto do notu | ||||||
| - potencialne nova navigace back - forward | - potencialne nova navigace back - forward | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| let globalHistoryItems = null; | let globalHistoryItems = null; | ||||||
|  |  | ||||||
| $(document).bind('keydown', 'alt+h', function() { | function showNoteHistoryDialog(noteId, noteHistoryId) { | ||||||
|     $("#noteHistoryDialog").dialog({ |     $("#noteHistoryDialog").dialog({ | ||||||
|         modal: true, |         modal: true, | ||||||
|         width: 800, |         width: 800, | ||||||
| @@ -11,7 +11,7 @@ $(document).bind('keydown', 'alt+h', function() { | |||||||
|     $("#noteHistoryContent").empty(); |     $("#noteHistoryContent").empty(); | ||||||
|  |  | ||||||
|     $.ajax({ |     $.ajax({ | ||||||
|         url: baseApiUrl + 'notes-history/' + globalCurrentNote.detail.note_id, |         url: baseApiUrl + 'notes-history/' + noteId, | ||||||
|         type: 'GET', |         type: 'GET', | ||||||
|         success: function (result) { |         success: function (result) { | ||||||
|             globalHistoryItems = result; |             globalHistoryItems = result; | ||||||
| @@ -26,13 +26,19 @@ $(document).bind('keydown', 'alt+h', function() { | |||||||
|             } |             } | ||||||
|  |  | ||||||
|             if (result.length > 0) { |             if (result.length > 0) { | ||||||
|                 const firstOptionValue = $("#noteHistoryList option:first").val(); |                 if (!noteHistoryId) { | ||||||
|  |                     noteHistoryId = $("#noteHistoryList option:first").val(); | ||||||
|  |                 } | ||||||
|  |  | ||||||
|                 $("#noteHistoryList").val(firstOptionValue).trigger('change'); |                 $("#noteHistoryList").val(noteHistoryId).trigger('change'); | ||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         error: () => alert("Error getting note history.") |         error: () => alert("Error getting note history.") | ||||||
|     }); |     }); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | $(document).bind('keydown', 'alt+h', function() { | ||||||
|  |     showNoteHistoryDialog(globalCurrentNote.detail.note_id); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| $("#noteHistoryList").on('change', () => { | $("#noteHistoryList").on('change', () => { | ||||||
|   | |||||||
| @@ -27,6 +27,7 @@ $(document).bind('keydown', 'alt+r', function() { | |||||||
|                 dateDay.setSeconds(0); |                 dateDay.setSeconds(0); | ||||||
|                 dateDay.setMilliseconds(0); |                 dateDay.setMilliseconds(0); | ||||||
|  |  | ||||||
|  |                 // FIXME: we can use Map object instead to avoid this hack | ||||||
|                 const dateDayTS = dateDay.getTime(); // we can't use dateDay as key because complex objects can't be keys |                 const dateDayTS = dateDay.getTime(); // we can't use dateDay as key because complex objects can't be keys | ||||||
|  |  | ||||||
|                 if (!groupedByDate[dateDayTS]) { |                 if (!groupedByDate[dateDayTS]) { | ||||||
| @@ -55,7 +56,15 @@ $(document).bind('keydown', 'alt+r', function() { | |||||||
|                         text: dayChanges.note_title |                         text: dayChanges.note_title | ||||||
|                     }); |                     }); | ||||||
|  |  | ||||||
|                     changesListEl.append($('<li>').append(formattedTime + ' - ').append(noteLink)); |                     const revLink = $("<a>", { | ||||||
|  |                         href: "javascript: showNoteHistoryDialog('" + dayChanges.note_id + "', " + dayChanges.id + ");", | ||||||
|  |                         text: 'rev' | ||||||
|  |                     }); | ||||||
|  |  | ||||||
|  |                     changesListEl.append($('<li>') | ||||||
|  |                         .append(formattedTime + ' - ') | ||||||
|  |                         .append(noteLink) | ||||||
|  |                         .append(' (').append(revLink).append(')')); | ||||||
|                 } |                 } | ||||||
|  |  | ||||||
|                 $("#recentChangesDialog").append(dayEl); |                 $("#recentChangesDialog").append(dayEl); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user