summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/util.js23
1 files changed, 13 insertions, 10 deletions
diff --git a/js/util.js b/js/util.js
index 50c311f99..d0116574b 100644
--- a/js/util.js
+++ b/js/util.js
@@ -13,20 +13,23 @@ $(document).ready(function(){
counter.attr("class", "");
}
}
-
+
if ($("#status_textarea").length) {
$("#status_textarea").bind("keyup", counter);
// run once in case there's something in there
counter();
}
-
});
- function doreply(nick) {
- rgx_username = /^[0-9a-zA-Z\-_.]*$/;
- if (nick.match(rgx_username)) {
- replyto = "@" + nick + " ";
- document.getElementById("status_textarea").value=replyto;
- document.getElementById("status_textarea").focus();
- }
- }
+function doreply(nick) {
+ rgx_username = /^[0-9a-zA-Z\-_.]*$/;
+ if (nick.match(rgx_username)) {
+ replyto = "@" + nick + " ";
+ if ($("#status_textarea")) {
+ $("#status_textarea").value=replyto;
+ $("#status_textarea").focus();
+ }
+ }
+ return false;
+}
+