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}); } } }