X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=js%2Futil.js;h=3ad0386122c53891bda591b85f6ed767cb7796b0;hb=7b9e69eb8923ef3018f0ce3e6042d9901ed16abd;hp=6ca5f8cbca5d5879aa359aeac24110a6b51f58bb;hpb=0daf242100925396aad4cc9fea5de0de2ec98ce8;p=quix0rs-gnu-social.git diff --git a/js/util.js b/js/util.js index 6ca5f8cbca..3ad0386122 100644 --- a/js/util.js +++ b/js/util.js @@ -177,6 +177,7 @@ $(document).ready(function(){ $("#notices_primary .notice:first").css({display:"none"}); $("#notices_primary .notice:first").fadeIn(2500); NoticeHover(); + NoticeReply(); } $("#notice_action-submit").removeAttr("disabled"); $("#notice_action-submit").removeClass("disabled"); @@ -186,15 +187,7 @@ $(document).ready(function(){ $("#form_notice").each(addAjaxHidden); NoticeHover(); - - $('#content .notice').each(function() { - var notice = $(this); - $('.notice_reply', $(this)).click(function() { - var nickname = ($('.author .nickname', notice).length > 0) ? $('.author .nickname', notice) : $('.author .nickname'); - NoticeReply(nickname.text(), $('.notice_id', notice).text()); - return false; - }); - }); + NoticeReply(); }); function NoticeHover() { @@ -208,7 +201,20 @@ function NoticeHover() { ); } -function NoticeReply(nick,id) { +function NoticeReply() { + if ($('#notice_data-text').length > 0) { + $('#content .notice').each(function() { + var notice = $(this); + $('.notice_reply', $(this)).click(function() { + var nickname = ($('.author .nickname', notice).length > 0) ? $('.author .nickname', notice) : $('.author .nickname'); + NoticeReplySet(nickname.text(), $('.notice_id', notice).text()); + return false; + }); + }); + } +} + +function NoticeReplySet(nick,id) { rgx_username = /^[0-9a-zA-Z\-_.]*$/; if (nick.match(rgx_username)) { replyto = "@" + nick + " ";