Lines 7-22
$(document).ready(function() {
Link Here
|
7 |
url: "/cgi-bin/koha/svc/mana/increment", |
7 |
url: "/cgi-bin/koha/svc/mana/increment", |
8 |
data: {id: mana_id, resource: resource, field: fieldvalue, step: stepvalue}, |
8 |
data: {id: mana_id, resource: resource, field: fieldvalue, step: stepvalue}, |
9 |
datatype: "json", |
9 |
datatype: "json", |
10 |
}) |
10 |
}).done(function(result) { |
|
|
11 |
data = JSON.parse(result); |
12 |
|
13 |
html = data.message + ' (' + data.new_count + ')'; |
14 |
comment = $('li.mana-comment[data-id="' + data.id + '"] a').html(html); |
15 |
}); |
11 |
} |
16 |
} |
12 |
|
17 |
|
13 |
function mana_comment( target_id, manamsg, resource_type ) { |
18 |
function mana_comment( target_id, manamsg, resource_type ) { |
14 |
$.ajax( { |
19 |
$.ajax( { |
15 |
type: "POST", |
20 |
type: "POST", |
16 |
url: "/cgi-bin/koha/svc/mana/share", |
21 |
url: "/cgi-bin/koha/svc/mana/comment", |
17 |
data: {message: manamsg, resource: resource_type , resource_id: target_id}, |
22 |
data: {message: manamsg, resource: resource_type , resource_id: target_id}, |
18 |
datatype: "json", |
23 |
datatype: "json", |
19 |
}) |
24 |
}).done(function(result) { |
|
|
25 |
data = JSON.parse(result); |
26 |
comment = $('<li></li>').addClass('mana-comment') |
27 |
.attr('data-id', data.id) |
28 |
.append('<a>' + manamsg + ' (1)</a>'); |
29 |
|
30 |
$('.mana-comment-divider').before(comment); |
31 |
}); |
20 |
} |
32 |
} |
21 |
|
33 |
|
22 |
$(document).on('click', 'ul li.mana-comment', function() { |
34 |
$(document).on('click', 'ul li.mana-comment', function() { |