]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - js/util.js
integrate URL routing into core code
[quix0rs-gnu-social.git] / js / util.js
index de486cf7405b2be54349e3ec0096274ae1b2e3ac..3ad0386122c53891bda591b85f6ed767cb7796b0 100644 (file)
@@ -176,6 +176,8 @@ $(document).ready(function(){
                                                                                                        counter();
                                                                                                        $("#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");
@@ -184,6 +186,11 @@ $(document).ready(function(){
        $("#form_notice").ajaxForm(PostNotice);
        $("#form_notice").each(addAjaxHidden);
 
+    NoticeHover();
+    NoticeReply();
+});
+
+function NoticeHover() {
     $("#content .notice").hover(
         function () {
             $(this).addClass('hover');
@@ -192,9 +199,22 @@ $(document).ready(function(){
             $(this).removeClass('hover');
         }
     );
-});
+}
+
+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 doreply(nick,id) {
+function NoticeReplySet(nick,id) {
        rgx_username = /^[0-9a-zA-Z\-_.]*$/;
        if (nick.match(rgx_username)) {
                replyto = "@" + nick + " ";