diff --git a/src/public/javascripts/dialogs/branch_prefix.js b/src/public/javascripts/dialogs/branch_prefix.js index 292877c8e..3614b1883 100644 --- a/src/public/javascripts/dialogs/branch_prefix.js +++ b/src/public/javascripts/dialogs/branch_prefix.js @@ -15,7 +15,7 @@ async function showDialog() { await $dialog.dialog({ modal: true, - width: 500 + width: 600 }); const currentNode = treeService.getCurrentNode(); diff --git a/src/public/javascripts/dialogs/note_revisions.js b/src/public/javascripts/dialogs/note_revisions.js index 42543565f..0ad8a9b9d 100644 --- a/src/public/javascripts/dialogs/note_revisions.js +++ b/src/public/javascripts/dialogs/note_revisions.js @@ -63,10 +63,10 @@ $list.on('change', () => { } }); -$(document).on('click', "a[action='note-revision']", event => { +$(document).on('click', "a[data-action='note-revision']", event => { const linkEl = $(event.target); - const noteId = linkEl.attr('note-path'); - const noteRevisionId = linkEl.attr('note-revision-id'); + const noteId = linkEl.attr('data-note-path'); + const noteRevisionId = linkEl.attr('data-note-revision-id'); showNoteRevisionsDialog(noteId, noteRevisionId); diff --git a/src/public/javascripts/dialogs/recent_changes.js b/src/public/javascripts/dialogs/recent_changes.js index 38507e1ac..faf91f9c9 100644 --- a/src/public/javascripts/dialogs/recent_changes.js +++ b/src/public/javascripts/dialogs/recent_changes.js @@ -30,9 +30,9 @@ async function showDialog() { const revLink = $("", { href: 'javascript:', text: 'rev' - }).attr('action', 'note-revision') - .attr('note-path', change.noteId) - .attr('note-revision-id', change.noteRevisionId); + }).attr('data-action', 'note-revision') + .attr('data-note-path', change.noteId) + .attr('data-note-revision-id', change.noteRevisionId); let noteLink; diff --git a/src/public/javascripts/services/bootstrap.js b/src/public/javascripts/services/bootstrap.js index 684b83c54..57d801919 100644 --- a/src/public/javascripts/services/bootstrap.js +++ b/src/public/javascripts/services/bootstrap.js @@ -71,6 +71,14 @@ window.onerror = function (msg, url, lineNo, columnNo, error) { return false; }; +const wikiBaseUrl = "https://github.com/zadam/trilium/wiki/"; + +$(document).on("click", "button[data-help-page]", e => { + const $button = $(e.target); + + window.open(wikiBaseUrl + $button.attr("data-help-page"), '_blank'); +}); + $("#logout-button").toggle(!utils.isElectron()); if (utils.isElectron()) { diff --git a/src/public/javascripts/services/link.js b/src/public/javascripts/services/link.js index 1c57b8428..c80c9f739 100644 --- a/src/public/javascripts/services/link.js +++ b/src/public/javascripts/services/link.js @@ -33,8 +33,8 @@ async function createNoteLink(notePath, noteTitle = null) { const noteLink = $("", { href: 'javascript:', text: noteTitle - }).attr('action', 'note') - .attr('note-path', notePath); + }).attr('data-action', 'note') + .attr('data-note-path', notePath); return noteLink; } @@ -43,10 +43,10 @@ function goToLink(e) { e.preventDefault(); const $link = $(e.target); - let notePath = $link.attr("note-path"); + let notePath = $link.attr("data-note-path"); if (!notePath) { - const address = $link.attr("note-path") ? $link.attr("note-path") : $link.attr('href'); + const address = $link.attr("data-note-path") ? $link.attr("data-note-path") : $link.attr('href'); if (!address) { return; @@ -104,7 +104,7 @@ ko.bindingHandlers.noteLink = { // when click on link popup, in case of internal link, just go the the referenced note instead of default behavior // of opening the link in new window/tab -$(document).on('click', "a[action='note']", goToLink); +$(document).on('click', "a[data-action='note']", goToLink); $(document).on('click', 'div.popover-content a, div.ui-tooltip-content a', goToLink); $(document).on('dblclick', '#note-detail-text a', goToLink); diff --git a/src/public/javascripts/services/note_detail.js b/src/public/javascripts/services/note_detail.js index bc7503cb5..b6bd2cd2e 100644 --- a/src/public/javascripts/services/note_detail.js +++ b/src/public/javascripts/services/note_detail.js @@ -209,7 +209,7 @@ async function showChildrenOverview(hideChildrenOverview) { const link = $('', { href: 'javascript:', text: await treeUtils.getNoteTitle(childBranch.noteId, childBranch.parentNoteId) - }).attr('action', 'note').attr('note-path', notePath + '/' + childBranch.noteId); + }).attr('data-action', 'note').attr('data-note-path', notePath + '/' + childBranch.noteId); const childEl = $('
').html(link); $childrenOverview.append(childEl); diff --git a/src/public/javascripts/services/search_notes.js b/src/public/javascripts/services/search_notes.js index d1b69dfc0..714a4c9fe 100644 --- a/src/public/javascripts/services/search_notes.js +++ b/src/public/javascripts/services/search_notes.js @@ -58,7 +58,7 @@ async function doSearch(searchText) { const link = $('', { href: 'javascript:', text: result.title - }).attr('action', 'note').attr('note-path', result.path); + }).attr('data-action', 'note').attr('data-note-path', result.path); const $result = $('
  • ').append(link); diff --git a/src/public/javascripts/services/tooltip.js b/src/public/javascripts/services/tooltip.js index 43c42693c..86fc5178e 100644 --- a/src/public/javascripts/services/tooltip.js +++ b/src/public/javascripts/services/tooltip.js @@ -9,7 +9,7 @@ function setupTooltip() { let notePath = linkService.getNotePathFromLink($(this).attr("href")); if (!notePath) { - notePath = $(this).attr("note-path"); + notePath = $(this).attr("data-note-path"); } if (notePath) { diff --git a/src/views/index.ejs b/src/views/index.ejs index 83459361f..e08da22b0 100644 --- a/src/views/index.ejs +++ b/src/views/index.ejs @@ -220,7 +220,9 @@ @abc @def some search string - same combination
  • -
    Documentation on search +

    @@ -301,11 +303,13 @@ - +
    + -         - - Documentation on links + +
    @@ -396,7 +400,13 @@ - +
    + + + +
    @@ -408,7 +418,13 @@
    - +
    + + + +
    @@ -430,7 +446,13 @@
    - +
    + + + +

    Sync test

    @@ -509,7 +531,15 @@
    -

    +
    +

    + +
    + +
    +
    @@ -526,11 +556,17 @@ @@ -553,12 +589,12 @@