Skip to content

Build your personal knowledge base with Trilium Notes

moved search behind tree action button

azivner2e8787ff91be
diff --git a/TODO b/TODO
index 7bfd60e5ac..ef2f9e593a 100644
--- a/TODO
+++ b/TODO
@@ -1,8 +1,27 @@
-- deleting cloned nodes ends with 500 (probably only on folders)
+- pick new name for the project
+
+New features:
- what links here
+ - link between encrypted notes could be done by encrypting note_ids of both sides of relations. Encryption must be
+ deterministic to allow lookup by cipher text
- recent changes - link to note should lead to the revision
- db upgrade / migration
-- dates should be stored in UTC to work correctly with time zones
- - we should also record timezone info so that we display the date correctly with respect to the local date at the time of recording it
+
+Refactorings:
- modularize frontend
- - unify handling of global variables
\ No newline at end of file
+ - unify handling of global variables
+- unify handling of dialogs and their forms - they all follow the same pattern - e.g. have one main dialog window/el
+
+UI:
+- need to represent global actions somehow - e.g. recent changes, settings
+- better way how to represent per-note actions - what links here, encryption
+
+Encryption:
+- we don't have IV or encryption specific counter
+
+Bugs:
+- deleting cloned nodes ends with 500 (probably only on folders)
+
+Others:
+- dates should be stored in UTC to work correctly with time zones
+ - we should also record timezone info so that we display the date correctly with respect to the local date at the time of recording it
\ No newline at end of file
diff --git a/src/templates/app.html b/src/templates/app.html
index b89b937160..568d139056 100644
--- a/src/templates/app.html
+++ b/src/templates/app.html
@@ -6,30 +6,36 @@
</head>
<body>
<div id="container">
- <div class="hide-toggle" style="grid-area: search">
- <p>
- <label>Search:</label>
- <input name="search" autocomplete="off">
- <button id="btnResetSearch">&times;</button>
- <span id="matches"></span>
- </p>
- </div>
+ <div style="grid-area: tree">
+ <div class="hide-toggle">
+ <a onclick="createNewTopLevelNote()" title="Create new top level note" class="icon-action">
+ <img src="stat/icons/file-plus.png" alt="Create new top level note"/>
+ </a>
- <div class="hide-toggle" style="grid-area: tree-buttons;">
- <a onclick="createNewTopLevelNote()" title="Create new top level note" class="icon-action">
- <img src="stat/icons/file-plus.png" alt="Create new top level note"/>
- </a>
+ <a onclick="collapseTree()" title="Collapse tree" class="icon-action">
+ <img src="stat/icons/list.png" alt="Collapse tree"/>
+ </a>
- <a onclick="collapseTree()" title="Collapse tree" class="icon-action">
- <img src="stat/icons/list.png" alt="Collapse tree"/>
- </a>
+ <a onclick="scrollToCurrentNote()" title="Scroll to current note" class="icon-action">
+ <img src="stat/icons/crosshair.png" alt="Collapse tree"/>
+ </a>
- <a onclick="scrollToCurrentNote()" title="Scroll to current note" class="icon-action">
- <img src="stat/icons/crosshair.png" alt="Collapse tree"/>
- </a>
- </div>
+ <a onclick="toggleSearch()" title="Search in notes" class="icon-action">
+ <img src="stat/icons/search.png" alt="Search in notes"/>
+ </a>
- <div id="tree" class="hide-toggle" style="overflow: auto; grid-area: tree">
+ <div id="search-box" style="display: none; padding: 10px; margin-top: 10px;">
+ <p>
+ <label>Search:</label>
+ <input name="search" autocomplete="off">
+ <button id="btnResetSearch">&times;</button>
+ <span id="matches"></span>
+ </p>
+ </div>
+ </div>
+
+ <div id="tree" class="hide-toggle" style="overflow: auto;">
+ </div>
</div>
<div class="hide-toggle" style="grid-area: title;">
diff --git a/static/icons/search.png b/static/icons/search.png
new file mode 100644
index 0000000000..d890955eca
Binary files /dev/null and b/static/icons/search.png differ
diff --git a/static/js/init.js b/static/js/init.js
index 9fd0d4b58f..9222adb1d5 100644
--- a/static/js/init.js
+++ b/static/js/init.js
@@ -11,10 +11,6 @@ $(document).bind('keydown', 'alt+m', function() {
$("#noteDetailWrapper").css("width", hidden ? "750px" : "100%");
});
-$(document).bind('keydown', 'alt+s', function() {
- $("input[name=search]").focus();
-});
-
// hide (toggle) everything except for the note content for distraction free writing
$(document).bind('keydown', 'alt+t', function() {
const date = new Date();
diff --git a/static/js/tree.js b/static/js/tree.js
index f4e85401da..ea59a6f86f 100644
--- a/static/js/tree.js
+++ b/static/js/tree.js
@@ -215,4 +215,14 @@ function scrollToCurrentNote() {
}
}
+$(document).bind('keydown', 'alt+s', function() {
+ $("#search-box").show();
+
+ $("input[name=search]").focus();
+});
+
+function toggleSearch() {
+ $("#search-box").toggle();
+}
+
$(document).bind('keydown', 'alt+c', collapseTree);
\ No newline at end of file
diff --git a/static/style.css b/static/style.css
index 2188007331..b7edd5481b 100644
--- a/static/style.css
+++ b/static/style.css
@@ -4,8 +4,8 @@
height: 100vh;
display: grid;
- grid-template-areas: "search title"
- "tree-buttons note-content"
+ grid-template-areas: "tree title"
+ "tree note-content"
"tree note-content";
grid-template-columns: 2fr 5fr;
grid-template-rows: auto