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 @@