view media/js/gcalendar_edit.js @ 294:254db4cb6a86

Changes / scripts to import forums. Other tweaks and moving other import scripts to the legacy application.
author Brian Neal <bgneal@gmail.com>
date Wed, 05 Jan 2011 04:09:35 +0000
parents b43e1288ff80
children
line wrap: on
line source
$(document).ready(function() {
   $('.gcal-del').click(function () {
      if (confirm('Really delete this event?')) {
         var id = this.id;
         if (id.match(/gcal-(\d+)/)) {
            $.ajax({
               url: '/calendar/delete/', 
               type: 'POST',
               data: { id : RegExp.$1 }, 
               dataType: 'text',
               success: function (id) {
                  var id = '#gcal-' + id;
                  $(id).parents('li').hide('normal');
               }, 
               error: function (xhr, textStatus, ex) {
                  alert('Oops, an error occurred. ' + xhr.statusText + ' - ' + 
                     xhr.responseText);
               }
            });
         }
      }
      return false;
      });
});