X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=js%2Futil.js;h=3ad0386122c53891bda591b85f6ed767cb7796b0;hb=7b9e69eb8923ef3018f0ce3e6042d9901ed16abd;hp=bb68c25879dc4f82b121c032cae9ed12914b4c77;hpb=0824bb2e1df68fd6634ca915e4c87664ee2ef872;p=quix0rs-gnu-social.git diff --git a/js/util.js b/js/util.js index bb68c25879..3ad0386122 100644 --- a/js/util.js +++ b/js/util.js @@ -108,16 +108,16 @@ $(document).ready(function(){ $("form.form_group_join").each(addAjaxHidden); $("form.form_group_leave").each(addAjaxHidden); - $("#nudge").ajaxForm ({ dataType: 'xml', - beforeSubmit: function(xml) { $("form#nudge input[type=submit]").attr("disabled", "disabled"); - $("form#nudge input[type=submit]").addClass("disabled"); - }, - success: function(xml) { $("#nudge").replaceWith(document._importNode($("#nudge_response", xml).get(0),true)); - $("#nudge input[type=submit]").removeAttr("disabled"); - $("#nudge input[type=submit]").removeClass("disabled"); - } - }); - $("#nudge").each(addAjaxHidden); + $("#form_user_nudge").ajaxForm ({ dataType: 'xml', + beforeSubmit: function(xml) { $("#form_user_nudge input[type=submit]").attr("disabled", "disabled"); + $("#form_user_nudge input[type=submit]").addClass("disabled"); + }, + success: function(xml) { $("#form_user_nudge").replaceWith(document._importNode($("#nudge_response", xml).get(0),true)); + $("#form_user_nudge input[type=submit]").removeAttr("disabled"); + $("#form_user_nudge input[type=submit]").removeClass("disabled"); + } + }); + $("#form_user_nudge").each(addAjaxHidden); var Subscribe = { dataType: 'xml', beforeSubmit: function(formData, jqForm, options) { $(".form_user_subscribe input[type=submit]").attr("disabled", "disabled"); @@ -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,7 +186,12 @@ $(document).ready(function(){ $("#form_notice").ajaxForm(PostNotice); $("#form_notice").each(addAjaxHidden); - $(".notice").hover( + 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 + " ";