comparison gpp/weblinks/static/js/weblinks.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 $('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 });