From 96c1d280db28d6c5a291e79a5f3ee9a0b06e1193 Mon Sep 17 00:00:00 2001 From: cynic Date: Sun, 18 Apr 2021 19:48:19 +0000 Subject: [PATCH] fix thumbnail link generation --- catalog.html | 2 +- js/chapter_list.js | 3 ++- js/title_list.js | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/catalog.html b/catalog.html index f655ffd..41779c2 100644 --- a/catalog.html +++ b/catalog.html @@ -41,7 +41,7 @@ diff --git a/js/chapter_list.js b/js/chapter_list.js index 742bd9d..fac1b6a 100644 --- a/js/chapter_list.js +++ b/js/chapter_list.js @@ -3,12 +3,13 @@ // ---------------------------------------------------- function load_info(remote, id) { + base = remote; remote += "/manga/from_id?id=" + id; fetch(remote) .then(manga => manga.json()) .then(function (manga) { var text = document.querySelector("#info #text"); - document.getElementById("cover").src = remote+"/manga/thumbnail?id="+id; + document.getElementById("cover").src = base+"/manga/thumbnail?id="+id; text.appendChild(Object.assign( document.createElement("h2"), diff --git a/js/title_list.js b/js/title_list.js index 87ae13f..d2ab0fd 100644 --- a/js/title_list.js +++ b/js/title_list.js @@ -6,6 +6,8 @@ function load_titles(remote) { if(remote == ""){ return; } + base = remote; + remote += "/manga/search?title=a"; fetch(remote) .then(res => res.json()) .then(function (res) { @@ -27,9 +29,8 @@ function load_titles(remote) { )) .appendChild(Object.assign( document.createElement("img"), - {className: "thumbnail", src: "img/covers/"+manga["id"]+".jpg"} + {className: "thumbnail", src: base+"/manga/thumbnail?id="+manga["id"]} )); - //title first_row.appendChild(Object.assign( document.createElement("td"),