diff --git a/src/public/images/icons/clock-16.png b/src/public/images/icons/clock-16.png new file mode 100644 index 000000000..bd48c1347 Binary files /dev/null and b/src/public/images/icons/clock-16.png differ diff --git a/src/public/javascripts/dialogs/add_link.js b/src/public/javascripts/dialogs/add_link.js index 72ac73ac8..cbe619f5d 100644 --- a/src/public/javascripts/dialogs/add_link.js +++ b/src/public/javascripts/dialogs/add_link.js @@ -15,6 +15,7 @@ const $prefixFormGroup = $("#add-link-prefix-form-group"); const $linkTypeDiv = $("#add-link-type-div"); const $linkTypes = $("input[name='add-link-type']"); const $linkTypeHtml = $linkTypes.filter('input[value="html"]'); +const $showRecentNotesButton = $("#add-link-show-recent-notes"); function setLinkType(linkType) { $linkTypes.each(function () { @@ -74,6 +75,10 @@ async function showDialog() { }, minLength: 0, change: async (event, ui) => { + if (!ui.item) { + return; + } + const notePath = linkService.getNodePathFromLabel(ui.item.value); if (!notePath) { @@ -103,7 +108,7 @@ async function showDialog() { } }); - $autoComplete.autocomplete("search", ""); + showRecentNotes(); } $form.submit(() => { @@ -167,8 +172,14 @@ function linkTypeChanged() { $linkTypeDiv.toggle(!hasSelection()); } +function showRecentNotes() { + $autoComplete.autocomplete("search", ""); +} + $linkTypes.change(linkTypeChanged); +$showRecentNotesButton.click(showRecentNotes); + export default { showDialog }; \ No newline at end of file diff --git a/src/public/javascripts/dialogs/jump_to_note.js b/src/public/javascripts/dialogs/jump_to_note.js index 32b5cce11..0fd59e0a1 100644 --- a/src/public/javascripts/dialogs/jump_to_note.js +++ b/src/public/javascripts/dialogs/jump_to_note.js @@ -1,11 +1,11 @@ import treeService from '../services/tree.js'; -import linkService from '../services/link.js'; import server from '../services/server.js'; import searchNotesService from '../services/search_notes.js'; const $dialog = $("#jump-to-note-dialog"); const $autoComplete = $("#jump-to-note-autocomplete"); const $showInFullTextButton = $("#show-in-full-text-button"); +const $showRecentNotesButton = $("#jump-to-note-show-recent-notes"); async function showDialog() { glob.activeDialog = $dialog; @@ -48,7 +48,7 @@ async function showDialog() { } }); - $autoComplete.autocomplete("search", ""); + showRecentNotes(); } function showInFullText(e) { @@ -65,8 +65,14 @@ function showInFullText(e) { $dialog.dialog('close'); } +function showRecentNotes() { + $autoComplete.autocomplete("search", ""); +} + $showInFullTextButton.click(showInFullText); +$showRecentNotesButton.click(showRecentNotes); + $dialog.bind('keydown', 'ctrl+return', showInFullText); export default { diff --git a/src/public/javascripts/dialogs/labels.js b/src/public/javascripts/dialogs/labels.js index 32f0666b6..7855334a5 100644 --- a/src/public/javascripts/dialogs/labels.js +++ b/src/public/javascripts/dialogs/labels.js @@ -1,5 +1,4 @@ import noteDetailService from '../services/note_detail.js'; -import utils from '../services/utils.js'; import server from '../services/server.js'; import infoService from "../services/info.js"; diff --git a/src/views/index.ejs b/src/views/index.ejs index 95f83358f..bc8c413c3 100644 --- a/src/views/index.ejs +++ b/src/views/index.ejs @@ -279,27 +279,36 @@