Mercurial > public > sg101
comparison 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 |
comparison
equal
deleted
inserted
replaced
12:f408971657b9 | 13:777451a98f9d |
---|---|
5 indicator : 'Saving...', | 5 indicator : 'Saving...', |
6 tooltip : 'Click to edit your shout...', | 6 tooltip : 'Click to edit your shout...', |
7 submit : 'OK', | 7 submit : 'OK', |
8 cancel : 'Cancel' | 8 cancel : 'Cancel' |
9 }); | 9 }); |
10 $('.shout-del').click(function () { | 10 $('a.shout-del').click(function () { |
11 if (confirm('Really delete this shout?')) { | 11 if (confirm('Really delete this shout?')) { |
12 var id = this.id; | 12 var id = this.id; |
13 if (id.match(/shout-del-(\d+)/)) { | 13 if (id.match(/^shout-del-(\d+)/)) { |
14 $.post('/shout/delete/', { id : RegExp.$1 }, function (id) { | 14 $.post('/shout/delete/', { id : RegExp.$1 }, function (id) { |
15 var id = '#shout-del-' + id; | 15 var id = '#shout-del-' + id; |
16 $(id).parents('tr').fadeOut(1500, function () { | 16 $(id).parents('tr').fadeOut(1500, function () { |
17 $('div.shoutbox-history table tr:visible:even').removeClass('odd'); | 17 $('div.shoutbox-history table tr:visible:even').removeClass('odd'); |
18 $('div.shoutbox-history table tr:visible:odd').addClass('odd'); | 18 $('div.shoutbox-history table tr:visible:odd').addClass('odd'); |
20 }, 'text'); | 20 }, 'text'); |
21 } | 21 } |
22 } | 22 } |
23 return false; | 23 return false; |
24 }); | 24 }); |
25 $('.shout-flag').click(function () { | |
26 var id = this.id; | |
27 if (id.match(/^shout-flag-(\d+)/)) { | |
28 id = RegExp.$1; | |
29 if (confirm('Only flag a shout if you feel it is spam, abuse, violates site rules, ' + | |
30 'or is not appropriate. ' + | |
31 'A moderator will be notified and will review the shout. ' + | |
32 'Are you sure you want to flag this shout?')) { | |
33 $.post('/shout/flag/', { id : id }, function(response) { | |
34 alert(response); | |
35 }, 'text'); | |
36 } | |
37 } | |
38 return false; | |
39 }); | |
25 }); | 40 }); |