2017-06-15 17:21:22 +01:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8">
|
2017-06-18 21:57:43 +01:00
|
|
|
<title>CMS Loading</title>
|
2017-06-15 17:21:22 +01:00
|
|
|
<link rel="stylesheet" href="/assets/styles.css">
|
2017-06-18 21:57:43 +01:00
|
|
|
|
2017-06-15 17:21:22 +01:00
|
|
|
</head>
|
|
|
|
<body>
|
2017-06-18 21:57:43 +01:00
|
|
|
<h1 id="title" class="title">Loading</h1>
|
|
|
|
|
|
|
|
<div id="podcasts">
|
2017-06-20 03:45:51 +01:00
|
|
|
|
2017-06-18 21:57:43 +01:00
|
|
|
</div>
|
2017-06-20 03:45:51 +01:00
|
|
|
<footer>
|
2017-07-15 16:06:37 +01:00
|
|
|
<p>White Rabbit licensed under the GPLv3 | <a href="/rss">RSS</a> <a href="/json">JSON</a></p>
|
2017-06-20 03:45:51 +01:00
|
|
|
</footer>
|
2017-06-18 21:57:43 +01:00
|
|
|
<script>
|
|
|
|
get("/json", function(data){
|
|
|
|
json = JSON.parse(data);
|
|
|
|
document.title = json.title;
|
|
|
|
document.getElementById("title").innerHTML = json.title;
|
|
|
|
|
2017-07-16 18:43:47 +01:00
|
|
|
for (i=0;i<=json.items.length; i++){
|
2017-06-18 21:57:43 +01:00
|
|
|
var div = document.createElement('div');
|
|
|
|
div.className = 'podcast';
|
|
|
|
// Todo: Add audio element (must modify feeds fork first!)
|
2017-06-20 03:45:51 +01:00
|
|
|
div.innerHTML = '<h3>'+json.items[i].title+'</h3><p>'+json.items[i].summary+'</p>'+
|
|
|
|
'<audio controls><source src="'+json.items[i].url+'">';
|
2017-06-18 21:57:43 +01:00
|
|
|
|
|
|
|
var element = document.getElementById("podcasts");
|
|
|
|
element.appendChild(div);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
function get(url, callback) {
|
|
|
|
var xmlHttp = new XMLHttpRequest();
|
|
|
|
xmlHttp.onreadystatechange = function() {
|
|
|
|
if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
|
|
|
|
callback(xmlHttp.responseText);
|
|
|
|
}
|
|
|
|
xmlHttp.open("GET", url, true);
|
|
|
|
xmlHttp.send(null);
|
|
|
|
}
|
|
|
|
</script>
|
2017-06-15 17:21:22 +01:00
|
|
|
</body>
|
2017-06-18 21:57:43 +01:00
|
|
|
</html>
|