Skip to content

Build your personal knowledge base with Trilium Notes

Add history backwards/forwards buttons, fixes #94

azivnera30734f1bc8f
diff --git a/src/public/images/icons/back.png b/src/public/images/icons/back.png
new file mode 100644
index 0000000000..c02e77fc8c
Binary files /dev/null and b/src/public/images/icons/back.png differ
diff --git a/src/public/images/icons/forward.png b/src/public/images/icons/forward.png
new file mode 100644
index 0000000000..06ee238faf
Binary files /dev/null and b/src/public/images/icons/forward.png differ
diff --git a/src/public/javascripts/services/entrypoints.js b/src/public/javascripts/services/entrypoints.js
index a2a7b2abdb..8af5b838a5 100644
--- a/src/public/javascripts/services/entrypoints.js
+++ b/src/public/javascripts/services/entrypoints.js
@@ -45,6 +45,10 @@ function registerEntrypoints() {
utils.bindShortcut('alt+o', sqlConsoleDialog.showDialog);
if (utils.isElectron()) {
+ $("#history-navigation").show();
+ $("#history-back-button").click(window.history.back);
+ $("#history-forward-button").click(window.history.forward);
+
utils.bindShortcut('alt+left', window.history.back);
utils.bindShortcut('alt+right', window.history.forward);
}
diff --git a/src/public/stylesheets/style.css b/src/public/stylesheets/style.css
index 9f9fbf81a9..e48fcf11fc 100644
--- a/src/public/stylesheets/style.css
+++ b/src/public/stylesheets/style.css
@@ -366,4 +366,9 @@ div.ui-tooltip {
#sql-console-query .CodeMirror {
height: 150px;
+}
+
+#history-navigation {
+ margin: 0 20px 0 5px;
+ display: flex;
}
\ No newline at end of file
diff --git a/src/views/index.ejs b/src/views/index.ejs
index c6bd928fd3..7c5f0681e9 100644
--- a/src/views/index.ejs
+++ b/src/views/index.ejs
@@ -13,6 +13,16 @@
Trilium Notes
</div>
+ <div id="history-navigation" style="display: none;">
+ <a id="history-back-button" title="Go to previous note." class="icon-action"
+ style="background: url('/images/icons/back.png')"></a>
+
+ &nbsp; &nbsp;
+
+ <a id="history-forward-button" title="Go to next note." class="icon-action"
+ style="background: url('/images/icons/forward.png')"></a>
+ </div>
+
<div style="flex-grow: 100;">
<button class="btn btn-xs" id="jump-to-note-button" title="CTRL+J">Jump to note</button>
<button class="btn btn-xs" id="recent-notes-button" title="CTRL+E">Recent notes</button>