annotate media/js/shoutbox_app.js @ 143:1ed461fd2030

Podcast enhancements for #39. Provide channel level keyword support. Provide an alternate download URL so we can support both m4a and mp3 formats.
author Brian Neal <bgneal@gmail.com>
date Sun, 06 Dec 2009 21:28:31 +0000
parents 777451a98f9d
children b43e1288ff80
rev   line source
gremmie@1 1 $(document).ready(function() {
gremmie@1 2 $('div.shoutbox-history table tr:odd').addClass('odd');
gremmie@1 3 $('.edit').editable('/shout/edit/', {
gremmie@1 4 loadurl : '/shout/text/',
gremmie@1 5 indicator : 'Saving...',
gremmie@1 6 tooltip : 'Click to edit your shout...',
gremmie@1 7 submit : 'OK',
gremmie@1 8 cancel : 'Cancel'
gremmie@1 9 });
bgneal@13 10 $('a.shout-del').click(function () {
gremmie@1 11 if (confirm('Really delete this shout?')) {
gremmie@1 12 var id = this.id;
bgneal@13 13 if (id.match(/^shout-del-(\d+)/)) {
gremmie@1 14 $.post('/shout/delete/', { id : RegExp.$1 }, function (id) {
gremmie@1 15 var id = '#shout-del-' + id;
gremmie@1 16 $(id).parents('tr').fadeOut(1500, function () {
gremmie@1 17 $('div.shoutbox-history table tr:visible:even').removeClass('odd');
gremmie@1 18 $('div.shoutbox-history table tr:visible:odd').addClass('odd');
gremmie@1 19 });
gremmie@1 20 }, 'text');
gremmie@1 21 }
gremmie@1 22 }
gremmie@1 23 return false;
gremmie@1 24 });
bgneal@13 25 $('.shout-flag').click(function () {
bgneal@13 26 var id = this.id;
bgneal@13 27 if (id.match(/^shout-flag-(\d+)/)) {
bgneal@13 28 id = RegExp.$1;
bgneal@13 29 if (confirm('Only flag a shout if you feel it is spam, abuse, violates site rules, ' +
bgneal@13 30 'or is not appropriate. ' +
bgneal@13 31 'A moderator will be notified and will review the shout. ' +
bgneal@13 32 'Are you sure you want to flag this shout?')) {
bgneal@13 33 $.post('/shout/flag/', { id : id }, function(response) {
bgneal@13 34 alert(response);
bgneal@13 35 }, 'text');
bgneal@13 36 }
bgneal@13 37 }
bgneal@13 38 return false;
bgneal@13 39 });
gremmie@1 40 });