Mercurial > public > sg101
comparison bio/static/js/bio.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/bio/static/js/bio.js@88b2b9cb8c1f |
children |
comparison
equal
deleted
inserted
replaced
580:c525f3e0b5d0 | 581:ee87ea74d46b |
---|---|
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 }); |