comparison gpp/bio/static/js/bio.js @ 312:88b2b9cb8c1f

Fixing #142; cut over to the django.contrib.staticfiles app.
author Brian Neal <bgneal@gmail.com>
date Thu, 27 Jan 2011 02:56:10 +0000
parents
children
comparison
equal deleted inserted replaced
311:b1c39788e511 312:88b2b9cb8c1f
1 $(document).ready(function() {
2 var bday = $('#id_birthday');
3 // jquery ui may not always be loaded
4 if (bday.length) {
5 bday.datepicker({changeMonth: true,
6 changeYear: true,
7 dateFormat: 'yy-mm-dd',
8 defaultDate: '-30y',
9 minDate: new Date(1909, 0, 1),
10 maxDate: new Date(),
11 yearRange: '-100:+0'});
12 }
13 $('a.profile-flag').click(function() {
14 var id = this.id;
15 if (id.match(/fp-(\d+)/)) {
16 id = RegExp.$1;
17 if (confirm('Only report a profile if you feel it is spam, abuse, ' +
18 'violates site rules, or is not appropriate. ' +
19 'A moderator will be notified and will review the profile. ' +
20 'Are you sure you want to report this profile?')) {
21 $.ajax({
22 url: '/profile/flag/' + id + '/',
23 type: 'POST',
24 dataType: 'text',
25 success: function (response, textStatus) {
26 alert(response);
27 },
28 error: function (xhr, textStatus, ex) {
29 alert('Oops, an error occurred: ' + xhr.statusText + ' - ' + xhr.responseText);
30 }
31 });
32 }
33 }
34 return false;
35 });
36 });