Files
mangaDownloader/templates/index.html

91 lines
3.1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div class="grid-container">
<div class="header">Super Awesome Mange Downloading and Viewing Thing</div>
<div class="nav" align="left">
<ul>
<li><button class=button onclick="activeReturn()">Active</button>
<li><button class=button onclick="downloadReturn()">Download</button>
<!-- <li><a href="http://google.com"><button class=button>google<>/button></a></li>
<li><button class=button onclick="clickTest()">asdfl</button></li>-->
</ul>
</div>
<div class="main" id="main">
</div>
<div class="footer">
bottom stuffs
</div>
</div>
</body>
</html>
<script>
var x = '';
var bookTitle = '';
var bookCommand = '';
function activeReturn() {
document.getElementById('main').innerHTML= '';
fetch('/active')
.then(response => response.json())
.then(function(data) {
for (i=0; i < data.active.length; i++ )
{
x = data.active[i];
<!--console.log(x.title)-->
var div = document.createElement('div');
div.setAttribute('id', x.id);
div.setAttribute('class', 'activeList');
div.innerHTML = '<b>' + x.title + '</b><br>';
document.getElementById("main").appendChild(div);
};
});
};
function downloadReturn() {
document.getElementById('main').innerHTML='';
<!--Create the main.updated div-->
var div = document.createElement('div');
div.setAttribute('id','updated')
div.innerHTML = '<b>Updated</b>'
document.getElementById('main').appendChild(div);
<!--Create the main.missingFlags div-->
var div = document.createElement('div');
div.setAttribute('id', 'missingFlags');
div.innerHTML='<b>Missing Flags</b>';
document.getElementById('main').appendChild(div);
<!--Create the main.missingManga div-->
var div = document.createElement('div');
div.setAttribute('id', 'missingManga');
div.innerHTML='<b>Missing Manga</b>';
document.getElementById('main').appendChild(div);
<!--Create the main.notUpdated div-->
var div = document.createElement('div');
div.setAttribute('id','notUpdated');
div.innerHTML='<b>Not Updated</b>';
document.getElementById('main').appendChild(div);
fetch('/download')
.then(response => response.json())
.then(function(data){
for (i=0; data.updated.length; i++) {
bookTitle = data.book[i];
bookCommand = data.command[i];
var div = document.createElement('div');
div.setAttribute('id', 'book'+i);
div.innerHTML = bookTitle + "<br>";
document.getElementById("updated").appendChild(div);
};
});
};
</script>