mirror of
https://github.com/derf/travelynx
synced 2024-12-14 06:52:35 +00:00
27 lines
723 B
JavaScript
27 lines
723 B
JavaScript
|
$(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);
|
||
|
});
|
||
|
});
|
||
|
});
|