mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 11:26:15 +01:00
using ES6 modules for whole frontend SPA app
This commit is contained in:
@@ -1,38 +1,39 @@
|
||||
"use strict";
|
||||
|
||||
const eventLog = (function() {
|
||||
const $dialog = $("#event-log-dialog");
|
||||
const $list = $("#event-log-list");
|
||||
import link from '../link.js';
|
||||
import utils from '../utils.js';
|
||||
|
||||
async function showDialog() {
|
||||
glob.activeDialog = $dialog;
|
||||
const $dialog = $("#event-log-dialog");
|
||||
const $list = $("#event-log-list");
|
||||
|
||||
$dialog.dialog({
|
||||
modal: true,
|
||||
width: 800,
|
||||
height: 700
|
||||
});
|
||||
async function showDialog() {
|
||||
glob.activeDialog = $dialog;
|
||||
|
||||
const result = await server.get('event-log');
|
||||
$dialog.dialog({
|
||||
modal: true,
|
||||
width: 800,
|
||||
height: 700
|
||||
});
|
||||
|
||||
$list.html('');
|
||||
const result = await server.get('event-log');
|
||||
|
||||
for (const event of result) {
|
||||
const dateTime = utils.formatDateTime(utils.parseDate(event.dateAdded));
|
||||
$list.html('');
|
||||
|
||||
if (event.noteId) {
|
||||
const noteLink = link.createNoteLink(event.noteId).prop('outerHTML');
|
||||
for (const event of result) {
|
||||
const dateTime = utils.formatDateTime(utils.parseDate(event.dateAdded));
|
||||
|
||||
event.comment = event.comment.replace('<note>', noteLink);
|
||||
}
|
||||
if (event.noteId) {
|
||||
const noteLink = link.createNoteLink(event.noteId).prop('outerHTML');
|
||||
|
||||
const eventEl = $('<li>').html(dateTime + " - " + event.comment);
|
||||
|
||||
$list.append(eventEl);
|
||||
event.comment = event.comment.replace('<note>', noteLink);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
showDialog
|
||||
};
|
||||
})();
|
||||
const eventEl = $('<li>').html(dateTime + " - " + event.comment);
|
||||
|
||||
$list.append(eventEl);
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
showDialog
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user