Mercurial > public > sg101
annotate media/js/gcalendar_edit.js @ 198:7e3ed3eb9b99
Fix #71: problems with editing existing gcalendar dates; the date format wasn't what the datepicker expected.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 11 Apr 2010 17:58:09 +0000 |
parents | b43e1288ff80 |
children |
rev | line source |
---|---|
gremmie@1 | 1 $(document).ready(function() { |
gremmie@1 | 2 $('.gcal-del').click(function () { |
gremmie@1 | 3 if (confirm('Really delete this event?')) { |
gremmie@1 | 4 var id = this.id; |
gremmie@1 | 5 if (id.match(/gcal-(\d+)/)) { |
bgneal@150 | 6 $.ajax({ |
bgneal@150 | 7 url: '/calendar/delete/', |
bgneal@150 | 8 type: 'POST', |
bgneal@150 | 9 data: { id : RegExp.$1 }, |
bgneal@150 | 10 dataType: 'text', |
bgneal@150 | 11 success: function (id) { |
bgneal@150 | 12 var id = '#gcal-' + id; |
bgneal@150 | 13 $(id).parents('li').hide('normal'); |
bgneal@150 | 14 }, |
bgneal@150 | 15 error: function (xhr, textStatus, ex) { |
bgneal@150 | 16 alert('Oops, an error occurred. ' + xhr.statusText + ' - ' + |
bgneal@150 | 17 xhr.responseText); |
bgneal@150 | 18 } |
bgneal@150 | 19 }); |
gremmie@1 | 20 } |
gremmie@1 | 21 } |
gremmie@1 | 22 return false; |
bgneal@150 | 23 }); |
gremmie@1 | 24 }); |