From: Sarven Capadisli Date: Sat, 8 Aug 2009 10:44:28 +0000 (+0000) Subject: Fix for removing the first occurance of the duplicate nickname in X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=534d0d804c6b92d8498fbd37a947e3712aaa9e3e;p=quix0rs-gnu-social.git Fix for removing the first occurance of the duplicate nickname in textarea when NoticeReply() is used. --- 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;