diff options
author | Wu Cheng-Han | 2016-10-10 20:33:17 +0800 |
---|---|---|
committer | Wu Cheng-Han | 2016-10-10 20:33:17 +0800 |
commit | 72d7ba0f313eb1c72d11f5a8406acb41aa844588 (patch) | |
tree | b6ffb5ec95cd736f52a4220202359ad71649a735 /public/js | |
parent | 3175616573a9346f8ae2731a8a963b28c42224c3 (diff) |
Update to remind note max length limit on the status bar length div
Diffstat (limited to '')
-rw-r--r-- | public/js/index.js | 13 |
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 |