Files
dss.radio/static/js/app.js
Fergal Moran 4f831b18fc Fix up
2015-09-22 22:02:19 +01:00

19 lines
472 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", {
_xsrf: xsrf,
audio_file: $('#audio_file').val()
});
});
$('#stop_audio').click(function () {
$.post("/a/stop", {
_xsrf: xsrf
});
});
});