mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 03:46:37 +01:00
moved all sources to src directory
This commit is contained in:
38
src/public/javascripts/dialogs/event_log.js
Normal file
38
src/public/javascripts/dialogs/event_log.js
Normal file
@@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
|
||||
const eventLog = (function() {
|
||||
const dialogEl = $("#event-log-dialog");
|
||||
const listEl = $("#event-log-list");
|
||||
|
||||
async function showDialog() {
|
||||
glob.activeDialog = dialogEl;
|
||||
|
||||
dialogEl.dialog({
|
||||
modal: true,
|
||||
width: 800,
|
||||
height: 700
|
||||
});
|
||||
|
||||
const result = await server.get('event-log');
|
||||
|
||||
listEl.html('');
|
||||
|
||||
for (const event of result) {
|
||||
const dateTime = formatDateTime(parseDate(event.dateAdded));
|
||||
|
||||
if (event.noteId) {
|
||||
const noteLink = link.createNoteLink(event.noteId).prop('outerHTML');
|
||||
|
||||
event.comment = event.comment.replace('<note>', noteLink);
|
||||
}
|
||||
|
||||
const eventEl = $('<li>').html(dateTime + " - " + event.comment);
|
||||
|
||||
listEl.append(eventEl);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
showDialog
|
||||
};
|
||||
})();
|
||||
Reference in New Issue
Block a user