From 2589bdbe9d74dceaa4fc88844f2dd920d447c30d Mon Sep 17 00:00:00 2001 From: dteviot Date: Sun, 15 Oct 2023 11:46:39 +1300 Subject: [PATCH] Update site https://bookalb.com/ See: https://github.com/dteviot/WebToEpub/issues/1031 --- plugin/js/parsers/BookalbParser.js | 56 ----------------------------- plugin/js/parsers/NoblemtlParser.js | 1 + plugin/popup.html | 1 - 3 files changed, 1 insertion(+), 57 deletions(-) delete mode 100644 plugin/js/parsers/BookalbParser.js diff --git a/plugin/js/parsers/BookalbParser.js b/plugin/js/parsers/BookalbParser.js deleted file mode 100644 index ba34381e..00000000 --- a/plugin/js/parsers/BookalbParser.js +++ /dev/null @@ -1,56 +0,0 @@ -"use strict"; - -parserFactory.register("bookalb.com", () => new BookalbParser()); - -class BookalbParser extends Parser{ - constructor() { - super(); - } - - async getChapterUrls(dom, chapterUrlsUI) { - return (await this.getChapterUrlsFromMultipleTocPages(dom, - this.extractPartialChapterList, - this.getUrlsOfTocPages, - chapterUrlsUI - )).reverse(); - }; - - getUrlsOfTocPages(dom) { - let tocUrls = []; - let tocLinks = [...dom.querySelectorAll("a.page-numbers:not(.next)")] - .map(a => a.href); - if (0 < tocLinks.length) { - let maxPageUrl = tocLinks.pop(); - let index = maxPageUrl.lastIndexOf("/", maxPageUrl.length - 2); - let base = maxPageUrl.substring(0, index + 1); - let maxPage = parseInt(maxPageUrl.substring(index + 1)); - if (1 < maxPage) { - for(let i = 2; i <= maxPage; ++i) { - tocUrls.push(`${base}${i}/`); - } - } - } - return tocUrls; - } - - extractPartialChapterList(dom) { - return [...dom.querySelectorAll("h2.entry-title a")] - .map(a => util.hyperLinkToChapter(a)) - } - - findContent(dom) { - return dom.querySelector("div.entry-content"); - } - - extractTitleImpl(dom) { - return dom.querySelector("h1.page-title"); - } - - findChapterTitle(dom) { - return dom.querySelector("h1.entry-title"); - } - - findCoverImageUrl(dom) { - return util.getFirstImgSrc(dom, "#primary"); - } -} diff --git a/plugin/js/parsers/NoblemtlParser.js b/plugin/js/parsers/NoblemtlParser.js index ca4cb80d..7e7199d6 100644 --- a/plugin/js/parsers/NoblemtlParser.js +++ b/plugin/js/parsers/NoblemtlParser.js @@ -1,5 +1,6 @@ "use strict"; +parserFactory.register("bookalb.com", () => new NoblemtlParser()); parserFactory.register("ckandawrites.online", () => new NoblemtlParser()); parserFactory.register("daotranslate.com", () => new NoblemtlParser()); parserFactory.register("genesistls.com", () => new NoblemtlParser()); diff --git a/plugin/popup.html b/plugin/popup.html index 4d3f4f3b..f7c5e60a 100644 --- a/plugin/popup.html +++ b/plugin/popup.html @@ -542,7 +542,6 @@

Instructions

-