Mercurial > public > sg101
comparison gcalendar/static/js/gcalendar_edit.js @ 581:ee87ea74d46b
For Django 1.4, rearranged project structure for new manage.py.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 05 May 2012 17:10:48 -0500 |
parents | gpp/gcalendar/static/js/gcalendar_edit.js@88b2b9cb8c1f |
children | 110bbc78a482 |
comparison
equal
deleted
inserted
replaced
580:c525f3e0b5d0 | 581:ee87ea74d46b |
---|---|
1 $(document).ready(function() { | |
2 $('.gcal-del').click(function () { | |
3 if (confirm('Really delete this event?')) { | |
4 var id = this.id; | |
5 if (id.match(/gcal-(\d+)/)) { | |
6 $.ajax({ | |
7 url: '/calendar/delete/', | |
8 type: 'POST', | |
9 data: { id : RegExp.$1 }, | |
10 dataType: 'text', | |
11 success: function (id) { | |
12 var id = '#gcal-' + id; | |
13 $(id).parents('li').hide('normal'); | |
14 }, | |
15 error: function (xhr, textStatus, ex) { | |
16 alert('Oops, an error occurred. ' + xhr.statusText + ' - ' + | |
17 xhr.responseText); | |
18 } | |
19 }); | |
20 } | |
21 } | |
22 return false; | |
23 }); | |
24 }); |