diff --git a/src/templates/app.html b/src/templates/app.html index 6bbe54bc0..06fe76687 100644 --- a/src/templates/app.html +++ b/src/templates/app.html @@ -8,24 +8,25 @@
  +
-
-
+
+
-
+
-
+
diff --git a/static/js/html2notecase.js b/static/js/html2notecase.js index f39bea486..03ba143b8 100644 --- a/static/js/html2notecase.js +++ b/static/js/html2notecase.js @@ -3,6 +3,7 @@ function html2notecase(contents, note) { contents = contents.replace(/
/g, '\n'); contents = contents.replace(/<\/p>/g, '\n'); contents = contents.replace(/

/g, ''); + contents = contents.replace(/ /g, ' '); let index = 0; diff --git a/static/js/note.js b/static/js/note.js index 8a37792d5..cfaae36ca 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 c3c569496..4eef20a38 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, '
'); + noteText = noteText.replace(/ /g, '  '); + return noteText; } \ No newline at end of file diff --git a/static/js/tree.js b/static/js/tree.js index ae2951333..beb401eb2 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 53aa59a31..071437c85 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 8aab96ef6..969f3138e 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