view media/js/shoutbox_app.js @ 5:63696b279e35

Display news links and send to friend on the summary page. Use icons.
author Brian Neal <bgneal@gmail.com>
date Sat, 11 Apr 2009 19:45:17 +0000
parents dbd703f7d63a
children 777451a98f9d
line wrap: on
line source
$(document).ready(function() {
     $('div.shoutbox-history table tr:odd').addClass('odd');
     $('.edit').editable('/shout/edit/', {
         loadurl : '/shout/text/',
         indicator : 'Saving...',
         tooltip   : 'Click to edit your shout...',
         submit : 'OK',
         cancel : 'Cancel'
     });
     $('.shout-del').click(function () {
         if (confirm('Really delete this shout?')) {
             var id = this.id;
             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 () {
                        $('div.shoutbox-history table tr:visible:even').removeClass('odd');
                        $('div.shoutbox-history table tr:visible:odd').addClass('odd');
                        });
                    }, 'text');
             }            
         }
         return false;
     });
 });