diff --git a/src/public/javascripts/api.js b/src/public/javascripts/api.js index ca5b9dd28..247586f9f 100644 --- a/src/public/javascripts/api.js +++ b/src/public/javascripts/api.js @@ -3,8 +3,8 @@ function ScriptContext(startNote, allNotes) { return { modules: modules, - notes: toObject(allNotes, note => [note.noteId, note]), - apis: toObject(allNotes, note => [note.noteId, ScriptApi(startNote, note)]), + notes: utils.toObject(allNotes, note => [note.noteId, note]), + apis: utils.toObject(allNotes, note => [note.noteId, ScriptApi(startNote, note)]), require: moduleNoteIds => { return moduleName => { const candidates = allNotes.filter(note => moduleNoteIds.includes(note.noteId)); diff --git a/src/public/javascripts/context_menu.js b/src/public/javascripts/context_menu.js index 0f1506e5a..8056c43cf 100644 --- a/src/public/javascripts/context_menu.js +++ b/src/public/javascripts/context_menu.js @@ -26,7 +26,7 @@ const contextMenu = (function() { // just do nothing } else { - throwError("Unrecognized clipboard mode=" + clipboardMode); + utils.throwError("Unrecognized clipboard mode=" + clipboardMode); } } @@ -49,7 +49,7 @@ const contextMenu = (function() { // just do nothing } else { - throwError("Unrecognized clipboard mode=" + mode); + utils.throwError("Unrecognized clipboard mode=" + mode); } } @@ -57,14 +57,14 @@ const contextMenu = (function() { clipboardIds = nodes.map(node => node.data.noteId); clipboardMode = 'copy'; - showMessage("Note(s) have been copied into clipboard."); + utils.showMessage("Note(s) have been copied into clipboard."); } function cut(nodes) { clipboardIds = nodes.map(node => node.key); clipboardMode = 'cut'; - showMessage("Note(s) have been cut into clipboard."); + utils.showMessage("Note(s) have been cut into clipboard."); } const contextMenuSettings = { diff --git a/src/public/javascripts/dialogs/event_log.js b/src/public/javascripts/dialogs/event_log.js index 1d223e68f..affa63dc7 100644 --- a/src/public/javascripts/dialogs/event_log.js +++ b/src/public/javascripts/dialogs/event_log.js @@ -18,7 +18,7 @@ const eventLog = (function() { $list.html(''); for (const event of result) { - const dateTime = formatDateTime(parseDate(event.dateAdded)); + const dateTime = utils.formatDateTime(utils.parseDate(event.dateAdded)); if (event.noteId) { const noteLink = link.createNoteLink(event.noteId).prop('outerHTML'); diff --git a/src/public/javascripts/dialogs/jump_to_note.js b/src/public/javascripts/dialogs/jump_to_note.js index f7c19bbf0..c6b33c01a 100644 --- a/src/public/javascripts/dialogs/jump_to_note.js +++ b/src/public/javascripts/dialogs/jump_to_note.js @@ -17,7 +17,7 @@ const jumpToNote = (function() { }); await $autoComplete.autocomplete({ - source: await stopWatch("building autocomplete", treeService.getAutocompleteItems), + source: await utils.stopWatch("building autocomplete", treeService.getAutocompleteItems), minLength: 0 }); } diff --git a/src/public/javascripts/dialogs/labels.js b/src/public/javascripts/dialogs/labels.js index 6d1e5d95d..1ffd9c91f 100644 --- a/src/public/javascripts/dialogs/labels.js +++ b/src/public/javascripts/dialogs/labels.js @@ -91,7 +91,7 @@ const labelsDialog = (function() { addLastEmptyRow(); - showMessage("Labels have been saved."); + utils.showMessage("Labels have been saved."); noteEditor.loadLabelList(); }; diff --git a/src/public/javascripts/dialogs/note_history.js b/src/public/javascripts/dialogs/note_history.js index 928b98c1a..3c04679aa 100644 --- a/src/public/javascripts/dialogs/note_history.js +++ b/src/public/javascripts/dialogs/note_history.js @@ -28,11 +28,11 @@ const noteHistory = (function() { historyItems = await server.get('notes-history/' + noteId); for (const item of historyItems) { - const dateModified = parseDate(item.dateModifiedFrom); + const dateModified = utils.parseDate(item.dateModifiedFrom); $list.append($('