mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-18 14:11:10 +00:00
Add minimum/maximum word lengths to session types
This commit is contained in:
parent
8a7efa65d7
commit
57520bb7a9
19 changed files with 133 additions and 61 deletions
|
|
@ -62,7 +62,7 @@ $(function() {
|
|||
$("#comments-div").hide();
|
||||
});
|
||||
|
||||
function word_count(text, divId) {
|
||||
function word_count(text, divId, maxcount) {
|
||||
var r = 0;
|
||||
var input = text.value.replace(/\s/g,' ');
|
||||
var word_array = input.split(' ');
|
||||
|
|
@ -71,4 +71,11 @@ function word_count(text, divId) {
|
|||
}
|
||||
|
||||
$('#' + divId).text(r);
|
||||
if (r > maxcount) {
|
||||
console.log("R is greater than maxcount");
|
||||
$('#' + divId).css('color', 'red');
|
||||
} else {
|
||||
console.log("R is less than maxcount");
|
||||
$('#' + divId).css('color', '#333');
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue