view gcalendar/static/js/gcalendar_edit.js @ 1094:110bbc78a482

GCalendar V3 conversion in progress.
author Brian Neal <bgneal@gmail.com>
date Sun, 29 May 2016 23:09:23 -0500
parents ee87ea74d46b
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 rowId = '#gcal-row-' + id;
                  $(rowId).fadeOut(800);
               }, 
               error: function (xhr, textStatus, ex) {
                  alert('Oops, an error occurred. ' + xhr.statusText + ' - ' + 
                     xhr.responseText);
               }
            });
         }
      }
      return false;
      });
});