Merge branch 'release/1.2.3'
This commit is contained in:
@@ -594,7 +594,7 @@ class RecentBooksPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async handleDel(item) {
|
async handleDel(item) {
|
||||||
if (item.group) {
|
if (item.group?.length) {
|
||||||
const keys = [{key: item.key}];
|
const keys = [{key: item.key}];
|
||||||
for (const book of item.group)
|
for (const book of item.group)
|
||||||
keys.push({key: book.key});
|
keys.push({key: book.key});
|
||||||
@@ -615,14 +615,14 @@ class RecentBooksPage {
|
|||||||
} else {
|
} else {
|
||||||
if (await this.$root.stdDialog.confirm('Подтвердите удаление книги из архива:', ' ')) {
|
if (await this.$root.stdDialog.confirm('Подтвердите удаление книги из архива:', ' ')) {
|
||||||
await bookManager.delRecentBooks([{key: item.key}], 2);
|
await bookManager.delRecentBooks([{key: item.key}], 2);
|
||||||
this.$root.notify.info('Книга удалено безвозвратно');
|
this.$root.notify.info('Книга удалена безвозвратно');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async handleRestore(item) {
|
async handleRestore(item) {
|
||||||
if (item.group) {
|
if (item.group?.length) {
|
||||||
const keys = [{key: item.key}];
|
const keys = [{key: item.key}];
|
||||||
for (const book of item.group)
|
for (const book of item.group)
|
||||||
keys.push({key: book.key});
|
keys.push({key: book.key});
|
||||||
@@ -637,7 +637,7 @@ class RecentBooksPage {
|
|||||||
|
|
||||||
async loadBook(item, force = false) {
|
async loadBook(item, force = false) {
|
||||||
if (item.deleted)
|
if (item.deleted)
|
||||||
await this.handleRestore(item.key);
|
await this.handleRestore(item);
|
||||||
|
|
||||||
this.$emit('load-book', {url: item.url, path: item.path, force});
|
this.$emit('load-book', {url: item.url, path: item.path, force});
|
||||||
this.close();
|
this.close();
|
||||||
|
|||||||
@@ -14,6 +14,11 @@ export default class DrawHelper {
|
|||||||
return this.context.measureText(text).width;
|
return this.context.measureText(text).width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
measureTextMetrics(text, style) {// eslint-disable-line no-unused-vars
|
||||||
|
this.context.font = this.fontByStyle(style);
|
||||||
|
return this.context.measureText(text);
|
||||||
|
}
|
||||||
|
|
||||||
measureTextFont(text, font) {// eslint-disable-line no-unused-vars
|
measureTextFont(text, font) {// eslint-disable-line no-unused-vars
|
||||||
this.context.font = font;
|
this.context.font = font;
|
||||||
return this.context.measureText(text).width;
|
return this.context.measureText(text).width;
|
||||||
@@ -39,7 +44,6 @@ export default class DrawHelper {
|
|||||||
let center = false;
|
let center = false;
|
||||||
let space = 0;
|
let space = 0;
|
||||||
let j = 0;
|
let j = 0;
|
||||||
const pad = this.fontSize/2;
|
|
||||||
//формируем строку
|
//формируем строку
|
||||||
for (const part of line.parts) {
|
for (const part of line.parts) {
|
||||||
let tOpen = '';
|
let tOpen = '';
|
||||||
@@ -47,10 +51,20 @@ export default class DrawHelper {
|
|||||||
tOpen += (part.style.italic ? '<i>' : '');
|
tOpen += (part.style.italic ? '<i>' : '');
|
||||||
tOpen += (part.style.sup ? '<span style="vertical-align: baseline; position: relative; line-height: 0; top: -0.3em">' : '');
|
tOpen += (part.style.sup ? '<span style="vertical-align: baseline; position: relative; line-height: 0; top: -0.3em">' : '');
|
||||||
tOpen += (part.style.sub ? '<span style="vertical-align: baseline; position: relative; line-height: 0; top: 0.3em">' : '');
|
tOpen += (part.style.sub ? '<span style="vertical-align: baseline; position: relative; line-height: 0; top: 0.3em">' : '');
|
||||||
tOpen += (part.style.note ? `<span style="position: relative;">` +
|
if (part.style.note) {
|
||||||
|
const t = part.text;
|
||||||
|
const m = this.measureTextMetrics(t, part.style);
|
||||||
|
const d = this.fontSize - 1.1*m.fontBoundingBoxAscent;
|
||||||
|
const w = m.width;
|
||||||
|
const size = (this.fontSize > 18 ? this.fontSize : 18);
|
||||||
|
const pad = size/2;
|
||||||
|
const btnW = (w >= size ? w : size) + pad*2;
|
||||||
|
|
||||||
|
tOpen += `<span style="position: relative;">` +
|
||||||
`<span style="position: absolute; background-color: ${this.textColor}; opacity: 0.1; cursor: pointer; pointer-events: auto; ` +
|
`<span style="position: absolute; background-color: ${this.textColor}; opacity: 0.1; cursor: pointer; pointer-events: auto; ` +
|
||||||
`height: ${this.fontSize + pad*2}px; padding: ${pad}px; left: -${pad}px; top: -${pad*0.9}px; border-radius: ${this.fontSize}px;" ` +
|
`height: ${this.fontSize + pad*2}px; padding: ${pad}px; left: -${(btnW - w)/2 - pad*0.05}px; top: -${pad + d}px; width: ${btnW}px; border-radius: ${size}px;" ` +
|
||||||
`onclick="onNoteClickLiberama('${part.style.note.id}', ${part.style.note.orig ? 1 : 0})"><span style="visibility: hidden;">__TEXT</span></span>` : '');
|
`onclick="onNoteClickLiberama('${part.style.note.id}', ${part.style.note.orig ? 1 : 0})"><span style="visibility: hidden;" class="dborder">${t}</span></span>`;
|
||||||
|
}
|
||||||
let tClose = '';
|
let tClose = '';
|
||||||
tClose += (part.style.note ? '</span>' : '');
|
tClose += (part.style.note ? '</span>' : '');
|
||||||
tClose += (part.style.sub ? '</span>' : '');
|
tClose += (part.style.sub ? '</span>' : '');
|
||||||
@@ -70,9 +84,6 @@ export default class DrawHelper {
|
|||||||
if (text && text.trim() == '')
|
if (text && text.trim() == '')
|
||||||
text = `<span style="white-space: pre">${text}</span>`;
|
text = `<span style="white-space: pre">${text}</span>`;
|
||||||
|
|
||||||
if (part.style.note)
|
|
||||||
tOpen = tOpen.replace('__TEXT', text);
|
|
||||||
|
|
||||||
lineText += `${tOpen}${text}${tClose}`;
|
lineText += `${tOpen}${text}${tClose}`;
|
||||||
|
|
||||||
center = center || part.style.center;
|
center = center || part.style.center;
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
v-show="clickControl" ref="layoutEvents" class="layout events"
|
v-show="clickControl" ref="layoutEvents" class="layout events"
|
||||||
oncontextmenu="return false;"
|
oncontextmenu="return false;"
|
||||||
@mousedown.prevent.stop="onMouseDown" @mouseup.prevent.stop="onMouseUp"
|
@mousedown.prevent.stop="onMouseDown" @mouseup.prevent.stop="onMouseUp"
|
||||||
|
@mouseover.prevent.stop="onMouseEvent" @mouseout.prevent.stop="onMouseEvent" @mousemove.prevent.stop="onMouseEvent"
|
||||||
@wheel.prevent.stop="onMouseWheel"
|
@wheel.prevent.stop="onMouseWheel"
|
||||||
@touchstart.stop="onTouchStart" @touchend.stop="onTouchEnd" @touchmove.stop="onTouchMove" @touchcancel.prevent.stop="onTouchCancel"
|
@touchstart.stop="onTouchStart" @touchend.stop="onTouchEnd" @touchmove.stop="onTouchMove" @touchcancel.prevent.stop="onTouchCancel"
|
||||||
>
|
>
|
||||||
@@ -38,9 +39,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>
|
||||||
@@ -49,7 +50,7 @@
|
|||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="row col">
|
<div class="row col">
|
||||||
<q-btn class="q-px-md q-mr-md" color="btn2" text-color="app" dense no-caps @click="goToNotes">
|
<q-btn class="q-px-md q-mr-md" color="btn2" text-color="app" dense no-caps @click="goToNotes">
|
||||||
В примечаниях
|
В примечания
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -148,6 +149,7 @@ class TextPage {
|
|||||||
|
|
||||||
noteDialogVisible = false;
|
noteDialogVisible = false;
|
||||||
noteId = '';
|
noteId = '';
|
||||||
|
noteTitle = '';
|
||||||
noteHtml = '';
|
noteHtml = '';
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
@@ -1072,6 +1074,7 @@ class TextPage {
|
|||||||
if (this.startTouch) {
|
if (this.startTouch) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
|
this.endClickRepeat();
|
||||||
}
|
}
|
||||||
|
|
||||||
onTouchEnd(event) {
|
onTouchEnd(event) {
|
||||||
@@ -1156,6 +1159,9 @@ class TextPage {
|
|||||||
onMouseWheel(event) {
|
onMouseWheel(event) {
|
||||||
if (this.$root.isMobileDevice)
|
if (this.$root.isMobileDevice)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
this.endClickRepeat();
|
||||||
|
|
||||||
if (event.deltaY > 0) {
|
if (event.deltaY > 0) {
|
||||||
this.doDown();
|
this.doDown();
|
||||||
} else if (event.deltaY < 0) {
|
} else if (event.deltaY < 0) {
|
||||||
@@ -1163,6 +1169,12 @@ class TextPage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMouseEvent() {
|
||||||
|
if (this.$root.isMobileDevice)
|
||||||
|
return;
|
||||||
|
this.endClickRepeat();
|
||||||
|
}
|
||||||
|
|
||||||
onStatusBarClick() {
|
onStatusBarClick() {
|
||||||
const url = this.meta.url;
|
const url = this.meta.url;
|
||||||
if (url && url.indexOf('disk://') != 0) {
|
if (url && url.indexOf('disk://') != 0) {
|
||||||
@@ -1271,6 +1283,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) => {
|
||||||
|
|||||||
@@ -1,8 +1,21 @@
|
|||||||
export const versionHistory = [
|
export const versionHistory = [
|
||||||
|
{
|
||||||
|
version: '1.2.3',
|
||||||
|
releaseDate: '2024-08-02',
|
||||||
|
showUntil: '2024-08-01',
|
||||||
|
content:
|
||||||
|
`
|
||||||
|
<ul>
|
||||||
|
<li>исправление багов</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
`
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
version: '1.2.2',
|
version: '1.2.2',
|
||||||
releaseDate: '2024-07-28',
|
releaseDate: '2024-07-28',
|
||||||
showUntil: '2024-08-04',
|
showUntil: '2024-07-27',
|
||||||
content:
|
content:
|
||||||
`
|
`
|
||||||
<ul>
|
<ul>
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "liberama",
|
"name": "liberama",
|
||||||
"version": "1.2.0",
|
"version": "1.2.3",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "liberama",
|
"name": "liberama",
|
||||||
"version": "1.2.0",
|
"version": "1.2.3",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "CC0-1.0",
|
"license": "CC0-1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "liberama",
|
"name": "liberama",
|
||||||
"version": "1.2.2",
|
"version": "1.2.3",
|
||||||
"author": "Book Pauk <bookpauk@gmail.com>",
|
"author": "Book Pauk <bookpauk@gmail.com>",
|
||||||
"license": "CC0-1.0",
|
"license": "CC0-1.0",
|
||||||
"repository": "bookpauk/liberama",
|
"repository": "bookpauk/liberama",
|
||||||
|
|||||||
Reference in New Issue
Block a user