mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
converted event log to module
This commit is contained in:
parent
1d0e96a314
commit
fd48a97c6d
@ -1,5 +1,9 @@
|
|||||||
async function showEventLog() {
|
const eventLog = (function() {
|
||||||
$("#event-log-dialog").dialog({
|
const dialogEl = $("#event-log-dialog");
|
||||||
|
const listEl = $("#event-log-list");
|
||||||
|
|
||||||
|
async function showDialog() {
|
||||||
|
dialogEl.dialog({
|
||||||
modal: true,
|
modal: true,
|
||||||
width: 800,
|
width: 800,
|
||||||
height: 700
|
height: 700
|
||||||
@ -11,8 +15,7 @@ async function showEventLog() {
|
|||||||
error: () => error("Error getting event log.")
|
error: () => error("Error getting event log.")
|
||||||
});
|
});
|
||||||
|
|
||||||
const eventLogList = $("#event-log-list");
|
listEl.html('');
|
||||||
eventLogList.html('');
|
|
||||||
|
|
||||||
for (const event of result) {
|
for (const event of result) {
|
||||||
const dateTime = formatDateTime(getDateFromTS(event.date_added));
|
const dateTime = formatDateTime(getDateFromTS(event.date_added));
|
||||||
@ -23,19 +26,22 @@ async function showEventLog() {
|
|||||||
text: getFullName(event.note_id)
|
text: getFullName(event.note_id)
|
||||||
}).prop('outerHTML');
|
}).prop('outerHTML');
|
||||||
|
|
||||||
console.log(noteLink);
|
|
||||||
|
|
||||||
event.comment = event.comment.replace('<note>', noteLink);
|
event.comment = event.comment.replace('<note>', noteLink);
|
||||||
}
|
}
|
||||||
|
|
||||||
const eventEl = $('<li>').html(dateTime + " - " + event.comment);
|
const eventEl = $('<li>').html(dateTime + " - " + event.comment);
|
||||||
|
|
||||||
eventLogList.append(eventEl);
|
listEl.append(eventEl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$(document).on('click', '#event-log-dialog a', e => {
|
$(document).on('click', '#event-log-dialog a', e => {
|
||||||
goToInternalNote(e, () => {
|
goToInternalNote(e, () => {
|
||||||
$("#event-log-dialog").dialog('close');
|
dialogEl.dialog('close');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
showDialog
|
||||||
|
};
|
||||||
|
})();
|
@ -15,7 +15,7 @@
|
|||||||
<button class="btn btn-xs" onclick="recentChanges.showDialog();">Recent changes</button>
|
<button class="btn btn-xs" onclick="recentChanges.showDialog();">Recent changes</button>
|
||||||
<button class="btn btn-xs" onclick="recentNotes.showDialog();">Recent notes</button>
|
<button class="btn btn-xs" onclick="recentNotes.showDialog();">Recent notes</button>
|
||||||
<button class="btn btn-xs" onclick="jumpToNote.showDialog();">Jump to note</button>
|
<button class="btn btn-xs" onclick="jumpToNote.showDialog();">Jump to note</button>
|
||||||
<button class="btn btn-xs" onclick="showEventLog();">Event log</button>
|
<button class="btn btn-xs" onclick="eventLog.showDialog();">Event log</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user