Skip to content

Commit 72d7ba0

Browse files
committed
Update to remind note max length limit on the status bar length div
1 parent 3175616 commit 72d7ba0

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

public/js/index.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,18 @@ function updateStatusBar() {
677677
statusCursor.text(cursorText);
678678
var fileText = ' — ' + editor.lineCount() + ' Lines';
679679
statusFile.text(fileText);
680-
statusLength.text('Length ' + editor.getValue().length);
680+
var docLength = editor.getValue().length;
681+
statusLength.text('Length ' + docLength);
682+
if (docLength > (docmaxlength * 0.95)) {
683+
statusLength.css('color', 'red');
684+
statusLength.attr('title', 'Your almost reach note max length limit.');
685+
} else if (docLength > (docmaxlength * 0.8)) {
686+
statusLength.css('color', 'orange');
687+
statusLength.attr('title', 'You nearly fill the note, consider to make more pieces.');
688+
} else {
689+
statusLength.css('color', 'white');
690+
statusLength.attr('title', 'You could write up to ' + docmaxlength + ' characters in this note.');
691+
}
681692
}
682693

683694
//ui vars

0 commit comments

Comments
 (0)