Skip to content

Build your personal knowledge base with Trilium Notes

various small usability improvements

azivner6fe81cd93ac8
diff --git a/src/templates/app.html b/src/templates/app.html
index 6bbe54bc09..06fe76687e 100644
--- a/src/templates/app.html
+++ b/src/templates/app.html
@@ -8,24 +8,25 @@
<div id="top" style="text-align: center;">
&nbsp;
<span id="top-message"></span>
+ <span id="error-message"></span>
</div>
- <div style="margin-left: auto; margin-right: auto; width: 1000px">
- <div style="width: 200px; float: left;">
+ <div style="margin-left: auto; margin-right: auto; width: 1100px">
+ <div style="width: 300px; height: 800px; float: left; overflow: scroll;">
<button type="button" class="btn" onclick="createNewTopLevelNote()">Create new note</button>
<div id="tree">
</div>
</div>
- <div style="width: 750px; float: left; margin-left: 20px;">
+ <div style="width: 750px; float: left; margin-left: 30px;">
<div style="float: right;">
<form action="logout" method="POST">
<input type="submit" class="btn btn-sm" value="Logout">
</form>
</div>
- <div style="float: left;">
+ <div style="float: left; margin: 5px;">
<input type="text" autocomplete="off" value="Welcome to Notecase web app!" id="noteTitle" style="font-size: x-large; border: 0; width: 100%;">
</div>
diff --git a/static/js/html2notecase.js b/static/js/html2notecase.js
index f39bea4862..03ba143b89 100644
--- a/static/js/html2notecase.js
+++ b/static/js/html2notecase.js
@@ -3,6 +3,7 @@ function html2notecase(contents, note) {
contents = contents.replace(/<br>/g, '\n');
contents = contents.replace(/<\/p>/g, '\n');
contents = contents.replace(/<p>/g, '');
+ contents = contents.replace(/&nbsp;/g, ' ');
let index = 0;
diff --git a/static/js/note.js b/static/js/note.js
index 8a37792d55..cfaae36caf 100644
--- a/static/js/note.js
+++ b/static/js/note.js
@@ -35,6 +35,9 @@ function noteChanged() {
contentType: "application/json",
success: function(result) {
message("Saved!");
+ },
+ error: function(result) {
+ error("Error saving the note!");
}
});
}
diff --git a/static/js/notecase2html.js b/static/js/notecase2html.js
index c3c5694965..4eef20a381 100644
--- a/static/js/notecase2html.js
+++ b/static/js/notecase2html.js
@@ -44,5 +44,7 @@ function notecase2html(note) {
noteText = noteText.replace(/(?:\r\n|\r|\n)/g, '<br />');
+ noteText = noteText.replace(/ /g, '&nbsp;&nbsp;');
+
return noteText;
}
\ No newline at end of file
diff --git a/static/js/tree.js b/static/js/tree.js
index ae2951333f..beb401eb23 100644
--- a/static/js/tree.js
+++ b/static/js/tree.js
@@ -127,6 +127,10 @@ $(function(){
}
});
}
+ },
+ "return": function(node) {
+ // doesn't work :-/
+ $('#noteDetail').summernote('focus');
}
}
}
diff --git a/static/js/utils.js b/static/js/utils.js
index 53aa59a314..071437c853 100644
--- a/static/js/utils.js
+++ b/static/js/utils.js
@@ -2,4 +2,10 @@ function message(str) {
$("#top-message").show();
$("#top-message").html(str);
$("#top-message").fadeOut(3000);
+}
+
+function error(str) {
+ $("#error-message").show();
+ $("#error-message").html(str);
+ $("#error-message").fadeOut(10000);
}
\ No newline at end of file
diff --git a/static/style.css b/static/style.css
index 8aab96ef6c..969f3138e5 100644
--- a/static/style.css
+++ b/static/style.css
@@ -9,4 +9,12 @@
color: green;
padding: 5px;
border-radius: 10px;
+}
+
+#error-message {
+ display: none; /* initial state is hidden */
+ background-color: red;
+ color: white;
+ padding: 5px;
+ border-radius: 10px;
}
\ No newline at end of file