|
@@ -8,7 +8,8 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
- <div ref="box" class="column q-mt-xs overflow-auto no-wrap" style="width: 200px; padding: 0px 10px 10px 10px;">
|
|
|
+ <div ref="box" class="column q-mt-xs overflow-auto no-wrap" style="padding: 0px 10px 10px 10px;">
|
|
|
+ <div v-html="annotation" />
|
|
|
</div>
|
|
|
|
|
|
<template #footer>
|
|
@@ -24,6 +25,7 @@
|
|
|
import vueComponent from '../../vueComponent.js';
|
|
|
|
|
|
import Dialog from '../../share/Dialog.vue';
|
|
|
+import XmlParser from '../../../../server/core/xml/XmlParser';
|
|
|
|
|
|
const componentOptions = {
|
|
|
components: {
|
|
@@ -36,23 +38,50 @@ const componentOptions = {
|
|
|
dialogVisible(newValue) {
|
|
|
this.$emit('update:modelValue', newValue);
|
|
|
},
|
|
|
+ bookInfo() {
|
|
|
+ this.parseBookInfo();
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
class BookInfoDialog {
|
|
|
_options = componentOptions;
|
|
|
_props = {
|
|
|
modelValue: Boolean,
|
|
|
+ bookInfo: Object,
|
|
|
};
|
|
|
|
|
|
dialogVisible = false;
|
|
|
|
|
|
+ //info props
|
|
|
+ annotation = '';
|
|
|
+
|
|
|
created() {
|
|
|
this.commit = this.$store.commit;
|
|
|
+ this.parseBookInfo();
|
|
|
}
|
|
|
|
|
|
mounted() {
|
|
|
}
|
|
|
|
|
|
+ parseBookInfo() {
|
|
|
+ const bookInfo = this.bookInfo;
|
|
|
+ const xml = new XmlParser();
|
|
|
+
|
|
|
+ //defaults
|
|
|
+ this.annotation = '';
|
|
|
+
|
|
|
+ if (bookInfo.fb2) {
|
|
|
+ const desc = xml.navigator(bookInfo.fb2);
|
|
|
+
|
|
|
+ //annotation
|
|
|
+ const annObj = desc.v('description/title-info/annotation');
|
|
|
+ if (annObj) {
|
|
|
+ this.annotation = xml.fromObject(annObj).toString({noHeader: true});
|
|
|
+ this.annotation = this.annotation.replace(/<p>/g, `<p class="p-annotation">`);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
okClick() {
|
|
|
this.dialogVisible = false;
|
|
|
}
|
|
@@ -63,4 +92,13 @@ export default vueComponent(BookInfoDialog);
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
-</style>
|
|
|
+</style>
|
|
|
+
|
|
|
+<style>
|
|
|
+.p-annotation {
|
|
|
+ text-indent: 20px;
|
|
|
+ text-align: justify;
|
|
|
+ padding: 0;
|
|
|
+ margin: 0;
|
|
|
+}
|
|
|
+</style>
|