mirror of
https://github.com/gmemstr/pogo.git
synced 2024-09-20 01:31:09 +01:00
e61bcb91c4
Implemented basic login using standard WWW-Authenticate method
47 lines
1.3 KiB
HTML
47 lines
1.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>CMS Loading</title>
|
|
<link rel="stylesheet" href="/assets/styles.css">
|
|
|
|
</head>
|
|
<body>
|
|
<h1 id="title" class="title">Loading</h1>
|
|
|
|
<div id="podcasts">
|
|
|
|
</div>
|
|
<footer>
|
|
<p>White Rabbit licensed under the GPLv3 | <a href="/rss">RSS</a> <a href="/json">JSON</a></p>
|
|
</footer>
|
|
<script>
|
|
get("/json", function(data){
|
|
json = JSON.parse(data);
|
|
document.title = json.title;
|
|
document.getElementById("title").innerHTML = json.title;
|
|
|
|
for (i=0;i<json.items.length; i++){
|
|
var div = document.createElement('div');
|
|
div.className = 'podcast';
|
|
// Todo: Add audio element (must modify feeds fork first!)
|
|
div.innerHTML = '<h3>'+json.items[i].title+'</h3><p>'+json.items[i].summary+'</p>'+
|
|
'<audio controls><source src="'+json.items[i].url+'">';
|
|
|
|
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>
|
|
</body>
|
|
</html> |