annotate media/js/shoutbox_app.js @ 9:b3b11edf91d8

News: removed the lxml stuff. Based on Jacob Kaplan-Moss suggestion, use html5lib to clean html. Added that functionality in a new core.html module.
author Brian Neal <bgneal@gmail.com>
date Sun, 12 Apr 2009 02:03:03 +0000
parents dbd703f7d63a
children 777451a98f9d
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 });
gremmie@1 10 $('.shout-del').click(function () {
gremmie@1 11 if (confirm('Really delete this shout?')) {
gremmie@1 12 var id = this.id;
gremmie@1 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 });
gremmie@1 25 });