summaryrefslogtreecommitdiff
path: root/public/static/js/travelynx-actions.js
blob: 3fbbdea230b9cd5fa820be17b758b679a97534db (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
$(document).ready(function() {
	$('.action-checkin').click(function() {
		var link = $(this);
		req = {
			action: 'checkin',
			station: link.data('station'),
			train: link.data('train'),
		};
		link.replaceWith('<div class="progress"><div class="indeterminate"></div></div>');
		$.post('/action', req, function(data) {
			$(location).attr('href', '/');
		});
	});
	$('.action-checkout').click(function() {
		var link = $(this);
		req = {
			action: 'checkout',
			station: link.data('station'),
			force: link.data('force'),
		};
		link.replaceWith('<div class="progress"><div class="indeterminate"></div></div>');
		$.post('/action', req, function(data) {
			$(location).attr('href', '/' + req.station);
		});
	});
});