Mercurial > public > sg101
comparison weblinks/static/js/weblinks.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/weblinks/static/js/weblinks.js@88b2b9cb8c1f |
children |
comparison
equal
deleted
inserted
replaced
580:c525f3e0b5d0 | 581:ee87ea74d46b |
---|---|
1 $(document).ready(function() { | |
2 $('a.weblinks-broken').click(function () { | |
3 var id = this.id; | |
4 if (id.match(/^link-(\d+)$/)) { | |
5 id = RegExp.$1; | |
6 if (confirm('Do you really want to report this link as broken? ' + | |
7 'This will notify the site staff that the link is dead and that ' + | |
8 'it may need to be deleted or revised.')) { | |
9 $.ajax({ | |
10 url: '/links/report/' + id + '/', | |
11 type: 'POST', | |
12 dataType: 'text', | |
13 success: function (response, textStatus) { | |
14 alert(response); | |
15 }, | |
16 error: function (xhr, textStatus, ex) { | |
17 alert('Oops, an error occurred: ' + xhr.statusText + ' - ' + xhr.responseText); | |
18 } | |
19 }); | |
20 } | |
21 } | |
22 return false; | |
23 }); | |
24 }); |