1 $(document).ready(function(){
2 // count character on keyup
5 var currentLength = $("#status_textarea").val()
6 .replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, "drry")
7 .replace(/[\u0800-\uFFFF]/g, "drr")
8 .replace(/[\u0080-\u07FF]/g, "dr")
10 var remaining = maxLength - currentLength;
11 var counter = $("#counter");
12 counter.text(remaining);
15 counter.attr("class", "toomuch");
17 counter.attr("class", "");
21 if ($("#status_textarea").length) {
22 $("#status_textarea").bind("keyup", counter);
23 // run once in case there's something in there
28 function doreply(nick) {
29 rgx_username = /^[0-9a-zA-Z\-_.]*$/;
30 if (nick.match(rgx_username)) {
31 replyto = "@" + nick + " ";
32 if ($("#status_textarea")) {
33 $("#status_textarea").val(replyto);
34 $("#status_textarea").focus();