-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathsend-anonymously.js
More file actions
48 lines (32 loc) · 1.42 KB
/
send-anonymously.js
File metadata and controls
48 lines (32 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
$(document).ready(function() {
var forwarding_result = $('#forwarding-result');
forwarding_result.hide();
var button = $('#create-forwarding').find('button');
button.click(function() {
$(this).text('Working...').attr('disabled', true);
var address = $.trim($('#create-forwarding').find('input[name="input-address"]').val());
$.post("/forwarder", { action : "create-mix", address : address }, function(obj) {
button.text('Create New Forwarding Address').attr('disabled', false);
if (obj.destination != address) {
throw 'Mismatch between requested and returned destination address';
}
forwarding_result.show(500);
forwarding_result.find('.input_address').text(obj.input_address);
forwarding_result.find('.output_address').text(obj.destination);
forwarding_result.find('.fee_percent').text(obj.fee_percent);
$('.bonus,.fee,.free').hide();
if (obj.fee_percent < 0) {
$('.bonus').show();
}
if (obj.fee_percent > 0) {
$('.fee').show();
}
if (obj.fee_percent > 0) {
$('.free').show();
}
}).error(function(data) {
button.text('Create New Forwarding Address').attr('disabled', false);
alert(data.responseText);
});
});
});