This repository has been archived by the owner on Oct 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
privacybadge.html
51 lines (48 loc) · 1.91 KB
/
privacybadge.html
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
49
50
<html>
<head>
<title>Check for Tor</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#PrivacyBox").ready(function() {
function anonymous(value) {
var box = $('#PrivacyBox');
if (value) {
//box.children("#image").addClass("anonymous");
box.children("#image").replaceWith('<img src="anonymous.png"/>');
box.children("#status").replaceWith('<p id="status">Anonymous</p>');
} else {
//box.children("#image").addClass("notanonymous");
box.children("#image").replaceWith('<img src="notanonymous.png"/>');
box.children("#status").replaceWith('<p id="status">Not Anonymous</p>');
}
}
if ( $.cookie('privacystatus') ){
console.log("hehe");
if ($.cookie('privacystatus') == "True") {
anonymous(true);
} else {
anonymous(false);
}
} else {
$.getJSON('http://server.globaleaks.org/torcheck.php?callback=?', function(data) {
if (data.Tor) {
anonymous(data.Tor);
$.cookie('privacystatus', 'True', { expires: 1, path: '/' });
} else {
anonymous(data.Tor);
$.cookie('privacystatus', 'False', { expires: 1, path: '/' });
}
});
}
});
});
</script>
</head>
<body>
<div id="PrivacyBox">
<div id="image"></div>
<p id="status"></p>
</div>
</body>
</html>