"use strict"; const noteHistory = (function() { const dialogEl = $("#note-history-dialog"); const listEl = $("#note-history-list"); const contentEl = $("#note-history-content"); const titleEl = $("#note-history-title"); let historyItems = []; async function showCurrentNoteHistory() { await showNoteHistoryDialog(noteEditor.getCurrentNoteId()); } async function showNoteHistoryDialog(noteId, noteHistoryId) { glob.activeDialog = dialogEl; dialogEl.dialog({ modal: true, width: 800, height: 700 }); listEl.empty(); contentEl.empty(); historyItems = await $.ajax({ url: baseApiUrl + 'notes-history/' + noteId, type: 'GET', error: () => showError("Error getting note history.") }); for (const item of historyItems) { const dateModified = getDateFromTS(item.date_modified_to); $("#note-history-list").append($('