]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fix for removing the first occurance of the duplicate nickname in
authorSarven Capadisli <csarven@controlyourself.ca>
Sat, 8 Aug 2009 10:44:28 +0000 (10:44 +0000)
committerSarven Capadisli <csarven@controlyourself.ca>
Sat, 8 Aug 2009 10:44:28 +0000 (10:44 +0000)
textarea when NoticeReply() is used.

js/util.js

index 1ab711cd134747f2762d6a813cb647c4938957a0..0ffa92ca92bf4a8dc83627ae90619ff8a711840c 100644 (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;