mirror of
https://github.com/etnguyen03/tjdests.git
synced 2025-04-20 17:50:16 -04:00
feat(profile): add character count for biography
This commit is contained in:
parent
5d58bb68a0
commit
fcf78a0f9b
|
@ -97,3 +97,8 @@ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left:
|
||||||
.codehilite .vi { color: #19177C } /* Name.Variable.Instance */
|
.codehilite .vi { color: #19177C } /* Name.Variable.Instance */
|
||||||
.codehilite .vm { color: #19177C } /* Name.Variable.Magic */
|
.codehilite .vm { color: #19177C } /* Name.Variable.Magic */
|
||||||
.codehilite .il { color: #666666 } /* Literal.Number.Integer.Long */
|
.codehilite .il { color: #666666 } /* Literal.Number.Integer.Long */
|
||||||
|
|
||||||
|
small#count {
|
||||||
|
float: right;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
|
@ -16,10 +16,14 @@ $(document).ready(function(){
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
/* Hide "Use nickname" checkbox if person doesn't have a nickname
|
function characterCount() {
|
||||||
The box won't do anything if they don't have a nickname,
|
return $("#id_biography").val().length.toString() + "/1500 characters";
|
||||||
but it's nice to just get it out of the way, you know? */
|
|
||||||
if ($("#without-nickname").length) {
|
|
||||||
$("#div_id_use_nickname").hide();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$("#div_id_biography").append("<small id=\"count\" class=\"form-text text-muted\"></small>");
|
||||||
|
$("#count").text(characterCount());
|
||||||
|
|
||||||
|
$("#id_biography").keyup(function(){
|
||||||
|
$("#count").text(characterCount());
|
||||||
|
});
|
||||||
})
|
})
|
Loading…
Reference in New Issue
Block a user