Fix for removing the first occurance of the duplicate nickname in

textarea when NoticeReply() is used.
This commit is contained in:
Sarven Capadisli 2009-08-08 10:44:28 +00:00
parent 468252ee6a
commit 534d0d804c
1 changed files with 2 additions and 2 deletions

View File

@ -257,10 +257,10 @@ function NoticeReply() {
function NoticeReplySet(nick,id) {
rgx_username = /^[0-9a-zA-Z\-_.]*$/;
if (nick.match(rgx_username)) {
replyto = "@" + nick + " ";
var text = $("#notice_data-text");
if (text.length) {
text.val(replyto + text.val());
replyto = "@" + nick + " ";
text.val(replyto + text.val().replace(RegExp(replyto, 'i'), ''));
$("#form_notice input#notice_in-reply-to").val(id);
if (text.get(0).setSelectionRange) {
var len = text.val().length;