Mercurial > public > sg101
annotate media/js/weblinks.js @ 184:4e1abeb593c2
Updating jQuery and jQuery UI. This is for ticket #57. Noticed GCalendar wasn't opening the datepicker on the correct date until I set a dateFormat option. Fixed member map to undisable the update button if you type in a location that can't be geocoded.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 28 Mar 2010 22:19:08 +0000 |
parents | 952e05cb3d80 |
children |
rev | line source |
---|---|
bgneal@165 | 1 $(document).ready(function() { |
bgneal@165 | 2 $('a.weblinks-broken').click(function () { |
bgneal@165 | 3 var id = this.id; |
bgneal@165 | 4 if (id.match(/^link-(\d+)$/)) { |
bgneal@165 | 5 id = RegExp.$1; |
bgneal@165 | 6 if (confirm('Do you really want to report this link as broken? ' + |
bgneal@165 | 7 'This will notify the site staff that the link is dead and that ' + |
bgneal@165 | 8 'it may need to be deleted or revised.')) { |
bgneal@165 | 9 $.ajax({ |
bgneal@165 | 10 url: '/links/report/' + id + '/', |
bgneal@165 | 11 type: 'POST', |
bgneal@165 | 12 dataType: 'text', |
bgneal@165 | 13 success: function (response, textStatus) { |
bgneal@165 | 14 alert(response); |
bgneal@165 | 15 }, |
bgneal@165 | 16 error: function (xhr, textStatus, ex) { |
bgneal@165 | 17 alert('Oops, an error occurred: ' + xhr.statusText + ' - ' + xhr.responseText); |
bgneal@165 | 18 } |
bgneal@165 | 19 }); |
bgneal@165 | 20 } |
bgneal@165 | 21 } |
bgneal@165 | 22 return false; |
bgneal@165 | 23 }); |
bgneal@165 | 24 }); |