author/op subheading

main
BuildTools 4 years ago
parent d172bbea2a
commit be176bf58a
  1. 1
      index.html
  2. 9
      js/main.js

@ -35,6 +35,7 @@ load();
</head>
<body>
<h1 id="title">loading...</h1>
<h3 id="op">anonymous</h3>
<table id="listing">
<tr>
<td><b id="c1">title</b></td>

@ -1,6 +1,7 @@
function setheader(header)
function setheader(header, author = null)
{
document.getElementById("title").innerHTML = header;
document.getElementById("op").innerHTML = author;
}
function loadmangos(info, url)
{
@ -23,19 +24,17 @@ function loadmangos(info, url)
let time = row.insertCell(-1);
time.innerHTML = new Date(manga["last_updated"]).toLocaleDateString("en-US");
});
console.log(info);
}
function loadchapters(manga, chapters)
{
if (manga)
{
setheader(manga["titles"][0]);
setheader(manga["titles"][0], manga["authors"][0]);
}
if (chapters)
{
document.getElementById("c2").innerHTML = "pages";
document.getElementById("c3").innerHTML = "date";
console.log(chapters);
let listing = document.getElementById("listing");
chapters.forEach(chapter =>
{
@ -70,7 +69,7 @@ function load(url = "https://test.cynic.moe")
{
fetch(url+"/info")
.then(response => response.json())
.then(data => setheader(data["name"]+" v"+data["version"]));
.then(data => setheader(data["name"]+" v"+data["version"], data["operator"]));
fetch(url+"/manga/search?sort")
.then(response => response.json())
.then(data => loadmangos(data, url));

Loading…
Cancel
Save