From 534d0d804c6b92d8498fbd37a947e3712aaa9e3e Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Sat, 8 Aug 2009 10:44:28 +0000 Subject: [PATCH] Fix for removing the first occurance of the duplicate nickname in textarea when NoticeReply() is used. --- js/util.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/util.js b/js/util.js index 1ab711cd13..0ffa92ca92 100644 --- a/js/util.js +++ b/js/util.js @@ -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; -- 2.39.5