Mercurial > public > sg101
diff media/js/shoutbox_app.js @ 13:777451a98f9d
Shoutbox work: shouts now have absolute URLs. Shouts can now be flagged as abuse. Minor tweak to breadcrumbs css. Added flag date to comments admin.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Thu, 16 Apr 2009 02:00:17 +0000 |
parents | dbd703f7d63a |
children | b43e1288ff80 |
line wrap: on
line diff
--- a/media/js/shoutbox_app.js Wed Apr 15 01:13:17 2009 +0000 +++ b/media/js/shoutbox_app.js Thu Apr 16 02:00:17 2009 +0000 @@ -7,10 +7,10 @@ submit : 'OK', cancel : 'Cancel' }); - $('.shout-del').click(function () { + $('a.shout-del').click(function () { if (confirm('Really delete this shout?')) { var id = this.id; - if (id.match(/shout-del-(\d+)/)) { + if (id.match(/^shout-del-(\d+)/)) { $.post('/shout/delete/', { id : RegExp.$1 }, function (id) { var id = '#shout-del-' + id; $(id).parents('tr').fadeOut(1500, function () { @@ -22,4 +22,19 @@ } return false; }); + $('.shout-flag').click(function () { + var id = this.id; + if (id.match(/^shout-flag-(\d+)/)) { + id = RegExp.$1; + if (confirm('Only flag a shout if you feel it is spam, abuse, violates site rules, ' + + 'or is not appropriate. ' + + 'A moderator will be notified and will review the shout. ' + + 'Are you sure you want to flag this shout?')) { + $.post('/shout/flag/', { id : id }, function(response) { + alert(response); + }, 'text'); + } + } + return false; + }); });