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,IAAK,WACtB,EAAa,MAAM,EACvB,EACJ,EACJ,EAGsB,SAAS,CAAQ,EAGnC,EAAa,IAAI,CAAC,qCAAqC,IAAI,CAAC,WAAY,CAAA,GAGvC,KAAA,IAAtB,EAAS,QAAQ,EACxB,EAAS,QAAQ,CAAC,OAAO,CAAC,SAAA,CAD9B,EAEQ,EAAa,IAAI,CAAC,wBAAwB,MAAM,CAAC,QAAU,EAAU,SACzE,EAGR,EAKJ,GAEJ","sources":["","www.nrla.org.uk/src/js/member-forum.js"],"sourcesContent":["(function () {\n(function() {\n // toggle the thanks that the member wants to give to the post\n $(\".member-forum-post-wrapper\").on(\"click\", 'i[data-action=\"thank\"]', zeno_debounce(200, function(event) {\n var $this = $(this);\n zeno_ajax_request(\"/advice/member-forum/actions/thank-post\", {\n \"forumPostID\": $this.closest(\".member-forum-post\").data(\"forumpostid\")\n }, function(response) {\n if ($this.closest(\".thank-this-member\").is('[data-alreadythanked=\"0\"]')) $this.closest(\".thank-this-member\").attr(\"data-alreadythanked\", -1).find(\"span\").text(function(index, current) {\n return parseInt(current, 10) + 1;\n });\n else $this.closest(\".thank-this-member\").attr(\"data-alreadythanked\", 0).find(\"span\").text(function(index, current) {\n console.log(current);\n return parseInt(current, 10) - 1;\n });\n });\n }));\n // allow a post to be reported\n $(\".member-forum-post-wrapper\").on(\"click\", 'i[data-action=\"report-post\"]', zeno_debounce(200, function(event) {\n //\n var $this = $(this), $popupWindow = zeno_popup_window(\"Report Post\", zeno_template(\"member-forum-report-post\"));\n //\n var forumTopicID = $this.closest(\".member-forum-post\").data(\"forumtopicid\");\n var forumPostID = $this.closest(\".member-forum-post\").data(\"forumpostid\");\n //\n $popupWindow.on(\"click\", 'button[data-action=\"report-post\"]', zeno_debounce(200, function(event) {\n //\n $popupWindow.find(\".form-status-message\").empty();\n $popupWindow.find('button[data-action=\"report-post\"]').prop(\"disabled\", true);\n //\n var forumReportReason = $popupWindow.find(':input[name=\"forumReportReason\"]:checked').val();\n var forumReportMessage = $popupWindow.find(':input[name=\"forumReportMessage\"]').val();\n //\n var successCallback = function successCallback(response) {\n zeno_confirm_window(\"Thank you\", \"Thank you for reporting this post, our moderation team will take appropriate action.\", \"Close\", function() {\n $popupWindow.fadeOut(300, function() {\n $popupWindow.remove();\n });\n });\n };\n //\n var errorCallback = function errorCallback(response) {\n //\n $popupWindow.find('button[data-action=\"report-post\"]').prop(\"disabled\", false);\n //\n if (typeof response.messages !== \"undefined\") response.messages.forEach(function(message) {\n $popupWindow.find(\".form-status-message\").append(\"
\" + message + \"
\");\n });\n };\n //\n zeno_ajax_request(\"/advice/member-forum/actions/report-post\", {\n \"forumTopicID\": forumTopicID,\n \"forumPostID\": forumPostID,\n \"reportReason\": forumReportReason,\n \"reportMessage\": forumReportMessage\n }, successCallback, errorCallback);\n }));\n }));\n})();\n\n})();\n//# sourceMappingURL=member-forum.min.js.map\n","(function() {\r\n\r\n // toggle the thanks that the member wants to give to the post\r\n $('.member-forum-post-wrapper').on('click', 'i[data-action=\"thank\"]', zeno_debounce(200, function(event) {\r\n var $this = $(this); zeno_ajax_request('/advice/member-forum/actions/thank-post', { 'forumPostID' : $this.closest('.member-forum-post').data('forumpostid') }, function(response) {\r\n if ($this.closest('.thank-this-member').is('[data-alreadythanked=\"0\"]')) {\r\n $this.closest('.thank-this-member').attr('data-alreadythanked', -1).find('span').text(function(index, current) {\r\n return (parseInt(current, 10) + 1);\r\n });\r\n } else {\r\n $this.closest('.thank-this-member').attr('data-alreadythanked', 0).find('span').text(function(index, current) {\r\n console.log(current)\r\n return (parseInt(current, 10) - 1);\r\n });\r\n }\r\n });\r\n }));\r\n\r\n // allow a post to be reported\r\n $('.member-forum-post-wrapper').on('click', 'i[data-action=\"report-post\"]', zeno_debounce(200, function(event) {\r\n\r\n //\r\n const $this = $(this), $popupWindow = zeno_popup_window('Report Post', zeno_template('member-forum-report-post'));\r\n\r\n //\r\n const forumTopicID = $this.closest('.member-forum-post').data('forumtopicid');\r\n const forumPostID = $this.closest('.member-forum-post').data('forumpostid');\r\n\r\n //\r\n $popupWindow.on('click', 'button[data-action=\"report-post\"]', zeno_debounce(200, function(event) {\r\n\r\n //\r\n $popupWindow.find('.form-status-message').empty();\r\n $popupWindow.find('button[data-action=\"report-post\"]').prop('disabled', true);\r\n\r\n //\r\n const forumReportReason = $popupWindow.find(':input[name=\"forumReportReason\"]:checked').val();\r\n const forumReportMessage = $popupWindow.find(':input[name=\"forumReportMessage\"]').val();\r\n\r\n //\r\n const successCallback = function(response) {\r\n zeno_confirm_window('Thank you', 'Thank you for reporting this post, our moderation team will take appropriate action.', 'Close', function() {\r\n $popupWindow.fadeOut(300, function() {\r\n $popupWindow.remove();\r\n });\r\n });\r\n }\r\n\r\n //\r\n const errorCallback = function(response) {\r\n\r\n //\r\n $popupWindow.find('button[data-action=\"report-post\"]').prop('disabled', false);\r\n\r\n //\r\n if (typeof response.messages !== 'undefined') {\r\n response.messages.forEach(message => {\r\n $popupWindow.find('.form-status-message').append('
' + message + '
');\r\n });\r\n }\r\n\r\n }\r\n\r\n //\r\n zeno_ajax_request('/advice/member-forum/actions/report-post', { 'forumTopicID' : forumTopicID, 'forumPostID' : forumPostID, 'reportReason' : forumReportReason, 'reportMessage' : forumReportMessage }, successCallback, errorCallback);\r\n\r\n }));\r\n\r\n }));\r\n\r\n})();"],"names":["$","on","zeno_debounce","event","$this","zeno_ajax_request","closest","data","response","is","attr","find","text","index","current","parseInt","console","log","$popupWindow","zeno_popup_window","zeno_template","forumTopicID","forumPostID","empty","prop","val","zeno_confirm_window","fadeOut","remove","messages","forEach","message","append"],"version":3,"file":"member-forum.min.js.map"}