Улучшение отображения примечаний
This commit is contained in:
@@ -38,9 +38,9 @@
|
|||||||
|
|
||||||
<!-- Примечание -->
|
<!-- Примечание -->
|
||||||
<Dialog ref="dialog1" v-model="noteDialogVisible">
|
<Dialog ref="dialog1" v-model="noteDialogVisible">
|
||||||
<!--template #header>
|
<template #header>
|
||||||
Примечание
|
{{ noteTitle }}
|
||||||
</template-->
|
</template>
|
||||||
|
|
||||||
<div class="column col" style="line-height: 20px; max-width: 400px; max-height: 200px; overflow-x: hidden; overflow-y: auto">
|
<div class="column col" style="line-height: 20px; max-width: 400px; max-height: 200px; overflow-x: hidden; overflow-y: auto">
|
||||||
<div v-html="noteHtml"></div>
|
<div v-html="noteHtml"></div>
|
||||||
@@ -148,6 +148,7 @@ class TextPage {
|
|||||||
|
|
||||||
noteDialogVisible = false;
|
noteDialogVisible = false;
|
||||||
noteId = '';
|
noteId = '';
|
||||||
|
noteTitle = '';
|
||||||
noteHtml = '';
|
noteHtml = '';
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
@@ -1271,6 +1272,7 @@ class TextPage {
|
|||||||
if (note) {
|
if (note) {
|
||||||
if (orig) {//show dialog
|
if (orig) {//show dialog
|
||||||
this.noteId = noteId;
|
this.noteId = noteId;
|
||||||
|
this.noteTitle = `[${note.title?.trim()}]`;
|
||||||
this.noteHtml = note.xml
|
this.noteHtml = note.xml
|
||||||
.replace(/<p>/g, '<p class="note-para">')
|
.replace(/<p>/g, '<p class="note-para">')
|
||||||
.replace(/<stanza>/g, '<br>').replace(/<\/stanza>/g, '')
|
.replace(/<stanza>/g, '<br>').replace(/<\/stanza>/g, '')
|
||||||
|
|||||||
@@ -402,17 +402,6 @@ export default class BookParser {
|
|||||||
bodyIndex++;
|
bodyIndex++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tag == 'title') {
|
|
||||||
newParagraph();
|
|
||||||
isFirstTitlePara = true;
|
|
||||||
bold = true;
|
|
||||||
center = true;
|
|
||||||
|
|
||||||
inTitle = true;
|
|
||||||
curTitle = {paraIndex, title: '', inset: sectionLevel, bodyIndex, subtitles: []};
|
|
||||||
this.contents.push(curTitle);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tag == 'section') {
|
if (tag == 'section') {
|
||||||
if (!isFirstSection)
|
if (!isFirstSection)
|
||||||
newParagraph();
|
newParagraph();
|
||||||
@@ -431,12 +420,24 @@ export default class BookParser {
|
|||||||
|
|
||||||
note.noteParaIndex = paraIndex;
|
note.noteParaIndex = paraIndex;
|
||||||
note.xml = '';
|
note.xml = '';
|
||||||
|
note.title = '';
|
||||||
noteId = id;
|
noteId = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tag == 'title') {
|
||||||
|
newParagraph();
|
||||||
|
isFirstTitlePara = true;
|
||||||
|
bold = true;
|
||||||
|
center = true;
|
||||||
|
|
||||||
|
inTitle = true;
|
||||||
|
curTitle = {paraIndex, title: '', inset: sectionLevel, bodyIndex, subtitles: []};
|
||||||
|
this.contents.push(curTitle);
|
||||||
|
}
|
||||||
|
|
||||||
if (tag == 'emphasis' || tag == 'strong' || tag == 'sup' || tag == 'sub') {
|
if (tag == 'emphasis' || tag == 'strong' || tag == 'sup' || tag == 'sub') {
|
||||||
growParagraph(`<${tag}>`, 0);
|
growParagraph(`<${tag}>`, 0);
|
||||||
}
|
}
|
||||||
@@ -642,10 +643,14 @@ export default class BookParser {
|
|||||||
else
|
else
|
||||||
growParagraph(' ', 1);
|
growParagraph(' ', 1);
|
||||||
|
|
||||||
if (!inTitle && inNotesBody && noteId) {
|
if (inNotesBody && noteId) {
|
||||||
|
if (inTitle) {
|
||||||
|
this.notes[noteId].title += text;
|
||||||
|
} else {
|
||||||
this.notes[noteId].xml += text;
|
this.notes[noteId].xml += text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onProgress = async(prog) => {
|
const onProgress = async(prog) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user