From f83c0f4425dc150c4b4c3a3b1140d83825946402 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 25 Dec 2018 17:26:55 +0300 Subject: offline list: use es template strings --- js/offline.js | 57 ++++++++++++++++++++++----------------------------------- 1 file changed, 22 insertions(+), 35 deletions(-) (limited to 'js/offline.js') diff --git a/js/offline.js b/js/offline.js index 4f9a13a..424ead4 100644 --- a/js/offline.js +++ b/js/offline.js @@ -89,47 +89,34 @@ function populate_list() { const lastread = results[2]; if (lastread) { - in_progress = lastread.page > 0; is_read = lastread.total > 0 && lastread.total - lastread.page < 5; } - let cell = "
"; - - const cover_read = is_read ? "read" : ""; + const thumb_class = is_read ? "read" : ""; const title_class = in_progress ? "in_progress" : ""; - cell += "
"; - cell += ""; - - cell += "
"; - cell += "
" + - info.title + "
"; - - cell += "
" + info.author_sort + "
"; - - if (info.series_name) { - cell += "
" + - info.series_name + " [" + info.series_index + "]
"; - } - - cell += "
"; - - cell += "
"; - cell += "" + - "More..."; - - cell += ""; - - cell += "
"; - - cell += "
"; - cell += "
"; - - cell = $(cell); + const series_link = info.series_name ? `
${info.series_name + " [" + info.series_index + "]"}
` : ""; + + const cell = $(`
+
+ + + +
+
${info.title}
+
${info.author_sort}
+ ${series_link} +
+ +
+
`); if (cover) { -- cgit v1.2.3