annotate media/js/bio.js @ 265:1ba2c6bf6eb7

Closing #98. Animated GIFs were losing their transparency and animated properties when saved as avatars. Reworked the avatar save process to only run the avatar through PIL if it is too big. This preserves the original uploaded file if it is within the desired size settings. This may still mangle big animated gifs. If this becomes a problem, then maybe look into calling the PIL Image.resize() method directly. Moved the PIL image specific functions from bio.forms to a new module: core.image for better reusability in the future.
author Brian Neal <bgneal@gmail.com>
date Fri, 24 Sep 2010 02:12:09 +0000
parents 7ea842744a57
children
rev   line source
gremmie@1 1 $(document).ready(function() {
bgneal@138 2 var bday = $('#id_birthday');
bgneal@138 3 // jquery ui may not always be loaded
bgneal@138 4 if (bday.length) {
bgneal@138 5 bday.datepicker({changeMonth: true,
bgneal@138 6 changeYear: true,
bgneal@138 7 dateFormat: 'yy-mm-dd',
bgneal@138 8 defaultDate: '-30y',
bgneal@138 9 minDate: new Date(1909, 0, 1),
bgneal@138 10 maxDate: new Date(),
bgneal@138 11 yearRange: '-100:+0'});
bgneal@138 12 }
bgneal@138 13 $('a.profile-flag').click(function() {
bgneal@138 14 var id = this.id;
bgneal@138 15 if (id.match(/fp-(\d+)/)) {
bgneal@138 16 id = RegExp.$1;
bgneal@138 17 if (confirm('Only report a profile if you feel it is spam, abuse, ' +
bgneal@138 18 'violates site rules, or is not appropriate. ' +
bgneal@138 19 'A moderator will be notified and will review the profile. ' +
bgneal@138 20 'Are you sure you want to report this profile?')) {
bgneal@138 21 $.ajax({
bgneal@138 22 url: '/profile/flag/' + id + '/',
bgneal@138 23 type: 'POST',
bgneal@138 24 dataType: 'text',
bgneal@138 25 success: function (response, textStatus) {
bgneal@138 26 alert(response);
bgneal@138 27 },
bgneal@138 28 error: function (xhr, textStatus, ex) {
bgneal@138 29 alert('Oops, an error occurred: ' + xhr.statusText + ' - ' + xhr.responseText);
bgneal@138 30 }
bgneal@138 31 });
bgneal@138 32 }
bgneal@138 33 }
bgneal@138 34 return false;
bgneal@138 35 });
gremmie@1 36 });