gremmie@1: $(document).ready(function() { gremmie@1: $('div.shoutbox-history table tr:odd').addClass('odd'); gremmie@1: $('.edit').editable('/shout/edit/', { gremmie@1: loadurl : '/shout/text/', gremmie@1: indicator : 'Saving...', gremmie@1: tooltip : 'Click to edit your shout...', gremmie@1: submit : 'OK', gremmie@1: cancel : 'Cancel' gremmie@1: }); bgneal@13: $('a.shout-del').click(function () { gremmie@1: if (confirm('Really delete this shout?')) { gremmie@1: var id = this.id; bgneal@13: if (id.match(/^shout-del-(\d+)/)) { gremmie@1: $.post('/shout/delete/', { id : RegExp.$1 }, function (id) { gremmie@1: var id = '#shout-del-' + id; gremmie@1: $(id).parents('tr').fadeOut(1500, function () { gremmie@1: $('div.shoutbox-history table tr:visible:even').removeClass('odd'); gremmie@1: $('div.shoutbox-history table tr:visible:odd').addClass('odd'); gremmie@1: }); gremmie@1: }, 'text'); gremmie@1: } gremmie@1: } gremmie@1: return false; gremmie@1: }); bgneal@13: $('.shout-flag').click(function () { bgneal@13: var id = this.id; bgneal@13: if (id.match(/^shout-flag-(\d+)/)) { bgneal@13: id = RegExp.$1; bgneal@13: if (confirm('Only flag a shout if you feel it is spam, abuse, violates site rules, ' + bgneal@13: 'or is not appropriate. ' + bgneal@13: 'A moderator will be notified and will review the shout. ' + bgneal@13: 'Are you sure you want to flag this shout?')) { bgneal@13: $.post('/shout/flag/', { id : id }, function(response) { bgneal@13: alert(response); bgneal@13: }, 'text'); bgneal@13: } bgneal@13: } bgneal@13: return false; bgneal@13: }); gremmie@1: });