mirror of
https://github.com/fergalmoran/dss.radio.git
synced 2025-12-22 09:48:21 +00:00
19 lines
504 B
JavaScript
19 lines
504 B
JavaScript
function getCookie(name) {
|
|
var r = document.cookie.match("\\b" + name + "=([^;]*)\\b");
|
|
return r ? r[1] : undefined;
|
|
}
|
|
|
|
$(document).ready(function () {
|
|
var xsrf = getCookie("_xsrf");
|
|
$('#play_audio').click(function () {
|
|
$.post("/a/play", JSON.stringify({
|
|
_xsrf: xsrf,
|
|
audio_file: $('#audio_file').val()
|
|
}), 'json');
|
|
});
|
|
$('#stop_audio').click(function () {
|
|
$.post("/a/stop", {
|
|
_xsrf: xsrf
|
|
}, 'json');
|
|
});
|
|
}); |