This prototype version supports basic editing, including some formatting (bold, italic, strike-through, underscore), images (just paste it into editor) and links. To edit the note, just click on title or content and you can directly modify it. Changes are saved immediatelly.
+
+
You can work with the tree using following keyboard shortcuts:
+
+
+
insert - create new note on current tree level
+
shift + insert - create new sub-note
+
delete - delete current note (and it's sub-notes)
+
shift + up - move current note up in the current tree level
+
shift + down - move current note down in the current tree level
+
shift + left - move current note up in the tree hierarchy
+
shift + right - move current note down in the tree hierarchy
+
+
@@ -40,6 +56,8 @@
+
+
diff --git a/frontend/note.js b/frontend/note.js
index 40dc3965d..9f5f15f39 100644
--- a/frontend/note.js
+++ b/frontend/note.js
@@ -9,7 +9,13 @@ let tags = {
10: ""
};
+let noteChangeDisabled = false;
+
function noteChanged() {
+ if (noteChangeDisabled) {
+ return;
+ }
+
let note = globalNote;
let contents = $('#noteDetail').summernote('code');
@@ -40,6 +46,7 @@ $(document).ready(function() {
$('#noteDetail').summernote({
airMode: true,
+ height: 300,
callbacks: {
onChange: noteChanged
}
@@ -61,6 +68,12 @@ function setParent(noteId, newParentKey, successCallback) {
});
}
+function createNewTopLevelNote() {
+ let rootNode = $("#tree").fancytree("getRootNode");
+
+ createNote(rootNode, "root", "into");
+}
+
function createNote(node, parentKey, target) {
let newNoteName = "new note";
@@ -103,6 +116,10 @@ function loadNote(noteId) {
let noteText = notecase2html(note);
+ noteChangeDisabled = true;
+
$('#noteDetail').summernote('code', noteText);
+
+ noteChangeDisabled = false;
});
}
\ No newline at end of file
diff --git a/frontend/style.css b/frontend/style.css
new file mode 100644
index 000000000..8aab96ef6
--- /dev/null
+++ b/frontend/style.css
@@ -0,0 +1,12 @@
+.note-editable {
+ /* This is because with empty content height of editor is 0 and it's impossible to click into it */
+ min-height: 400px;
+}
+
+#top-message {
+ display: none; /* initial state is hidden */
+ background-color: greenyellow;
+ color: green;
+ padding: 5px;
+ border-radius: 10px;
+}
\ No newline at end of file