diff media/js/forums.js @ 98:d0d779dd0832

Forums: flag posts.
author Brian Neal <bgneal@gmail.com>
date Sun, 13 Sep 2009 21:45:35 +0000
parents 23035afdeae8
children 10d6182b9f6e
line wrap: on
line diff
--- a/media/js/forums.js	Sun Sep 13 19:58:31 2009 +0000
+++ b/media/js/forums.js	Sun Sep 13 21:45:35 2009 +0000
@@ -31,5 +31,20 @@
          });
       return false;
    });
+   $('a.post-flag').click(function () {
+      var id = this.id;
+      if (id.match(/fp-(\d)/)) {
+         id = RegExp.$1;
+         if (confirm('Only flag a post if you feel it is spam, abuse, violates site rules, ' +
+                 'or is not appropriate. ' +
+                 'A moderator will be notified and will review the post. ' +
+                 'Are you sure you want to flag this post?')) {
+             $.post('/forums/flag-post/', { id : id }, function(response) {
+                 alert(response);
+                 }, 'text');
+         }
+     }
+     return false;
+   });
    $('#id_body').markItUp(mySettings);
 });