summaryrefslogtreecommitdiff
path: root/gentoobrowse/js/pkgtracking.js
blob: 1c171b69758e1db96acdad6902b9a6f94b6b372a (plain)
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
function track(pid)
{
	xmlhttp = new XMLHttpRequest();
	xmlhttp.open("POST", "/track", false);
	xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	xmlhttp.send("packageid=" + pid);
	if (xmlhttp.status == 200) {
		toggleTracking();
	}
}

function untrack(pid)
{
	xmlhttp = new XMLHttpRequest();
	xmlhttp.open("POST", "/untrack", false);
	xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	xmlhttp.send("packageid=" + pid);
	if (xmlhttp.status == 200) {
		toggleTracking();
	}
}

function toggleTracking()
{
	$('#dotrack').toggle();
	$('#dountrack').toggle();
}