summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--public/js/index.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/public/js/index.js b/public/js/index.js
index 5681dcf3..57658d69 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -677,7 +677,18 @@ function updateStatusBar() {
statusCursor.text(cursorText);
var fileText = ' — ' + editor.lineCount() + ' Lines';
statusFile.text(fileText);
- statusLength.text('Length ' + editor.getValue().length);
+ var docLength = editor.getValue().length;
+ statusLength.text('Length ' + docLength);
+ if (docLength > (docmaxlength * 0.95)) {
+ statusLength.css('color', 'red');
+ statusLength.attr('title', 'Your almost reach note max length limit.');
+ } else if (docLength > (docmaxlength * 0.8)) {
+ statusLength.css('color', 'orange');
+ statusLength.attr('title', 'You nearly fill the note, consider to make more pieces.');
+ } else {
+ statusLength.css('color', 'white');
+ statusLength.attr('title', 'You could write up to ' + docmaxlength + ' characters in this note.');
+ }
}
//ui vars