From 32b83826411e57399e26d10eb5a0e43094fd6238 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Wed, 16 Dec 2020 16:09:35 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=B1=D0=B0=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reader/ContentsPage/ContentsPage.vue | 17 ++++++++++++----- client/components/Reader/share/BookParser.js | 6 +++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/client/components/Reader/ContentsPage/ContentsPage.vue b/client/components/Reader/ContentsPage/ContentsPage.vue index c24d8044..94dbc937 100644 --- a/client/components/Reader/ContentsPage/ContentsPage.vue +++ b/client/components/Reader/ContentsPage/ContentsPage.vue @@ -63,12 +63,13 @@
-
- +
+
JPG
PNG
+
INET
@@ -210,7 +211,7 @@ class ContentsPage extends Vue { const p = parsed.para[image.paraIndex]; newImages.push({perc: (p.offset/parsed.textLength*100).toFixed(0), label, key: i, offset: p.offset, - indentStyle, labelStyle, type, imageId: image.id}); + indentStyle, labelStyle, type, id: image.id, local: image.local}); } this.images = newImages; @@ -224,9 +225,12 @@ class ContentsPage extends Vue { await utils.sleep(50); (async() => { for (i = 0; i < ims.length; i++) { - const id = ims[i].id; + const {id, local} = ims[i]; const bin = this.parsed.binary[id]; - this.$set(this.imageSrc, id, (bin ? `data:${bin.type};base64,${bin.data}` : '')); + if (local) + this.$set(this.imageSrc, id, (bin ? `data:${bin.type};base64,${bin.data}` : '')); + else + this.$set(this.imageSrc, id, id); this.imageLoaded[id] = true; await utils.sleep(5); } @@ -323,6 +327,9 @@ class ContentsPage extends Vue { .it-png-color { background: linear-gradient(to right, #4bc4e5, #6bf4ff); } +.it-net-color { + background: linear-gradient(to right, #00c400, #00f400); +} .image-thumb-box { width: 120px; diff --git a/client/components/Reader/share/BookParser.js b/client/components/Reader/share/BookParser.js index 67f575c1..89127123 100644 --- a/client/components/Reader/share/BookParser.js +++ b/client/components/Reader/share/BookParser.js @@ -204,7 +204,7 @@ export default class BookParser { let attrs = sax.getAttrsSync(tail); if (attrs.href && attrs.href.value) { const href = attrs.href.value; - const {id} = this.imageHrefToId(href); + const {id, local} = this.imageHrefToId(href); if (href[0] == '#') {//local imageNum++; @@ -213,7 +213,7 @@ export default class BookParser { else newParagraph(`${' '.repeat(maxImageLineCount)}`, maxImageLineCount); - this.images.push({paraIndex, num: imageNum, id}); + this.images.push({paraIndex, num: imageNum, id, local}); if (inPara && this.showInlineImagesInCenter) newParagraph(' ', 1); @@ -223,7 +223,7 @@ export default class BookParser { dimPromises.push(getExternalImageDimensions(href)); newParagraph(`${' '.repeat(maxImageLineCount)}`, maxImageLineCount); - this.images.push({paraIndex, num: imageNum, id}); + this.images.push({paraIndex, num: imageNum, id, local}); } } }