Вырезал ненужный код
This commit is contained in:
@@ -70,20 +70,6 @@
|
|||||||
Другое
|
Другое
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="sets-item row">
|
|
||||||
<div class="sets-label label">
|
|
||||||
Обработка
|
|
||||||
</div>
|
|
||||||
<q-checkbox v-model="form.lazyParseEnabled" size="xs" label="Предварительная подготовка текста">
|
|
||||||
<q-tooltip :delay="1000" anchor="top middle" self="bottom middle" content-style="font-size: 80%">
|
|
||||||
Включение этой опции позволяет делать предварительную<br>
|
|
||||||
подготовку всего текста в ленивом режиме сразу после<br>
|
|
||||||
загрузки книги. Это может повысить отзывчивость читалки,<br>
|
|
||||||
но нагружает процессор каждый раз при открытии книги.
|
|
||||||
</q-tooltip>
|
|
||||||
</q-checkbox>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="sets-item row">
|
<div class="sets-item row">
|
||||||
<div class="sets-label label">
|
<div class="sets-label label">
|
||||||
Парам. в URL
|
Парам. в URL
|
||||||
|
|||||||
@@ -433,10 +433,6 @@ class TextPage {
|
|||||||
if (this.lastBook) {
|
if (this.lastBook) {
|
||||||
(async() => {
|
(async() => {
|
||||||
try {
|
try {
|
||||||
//подождем ленивый парсинг
|
|
||||||
this.stopLazyParse = true;
|
|
||||||
while (this.doingLazyParse) await utils.sleep(10);
|
|
||||||
|
|
||||||
const isParsed = await bookManager.hasBookParsed(this.lastBook);
|
const isParsed = await bookManager.hasBookParsed(this.lastBook);
|
||||||
if (!isParsed) {
|
if (!isParsed) {
|
||||||
return;
|
return;
|
||||||
@@ -460,8 +456,6 @@ class TextPage {
|
|||||||
await this.calcPropsAndLoadFonts();
|
await this.calcPropsAndLoadFonts();
|
||||||
|
|
||||||
this.refreshTime();
|
this.refreshTime();
|
||||||
if (this.lazyParseEnabled)
|
|
||||||
this.lazyParsePara();
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.$root.stdDialog.alert(e.message, 'Ошибка', {color: 'negative'});
|
this.$root.stdDialog.alert(e.message, 'Ошибка', {color: 'negative'});
|
||||||
}
|
}
|
||||||
@@ -838,36 +832,6 @@ class TextPage {
|
|||||||
this.drawStatusBar();
|
this.drawStatusBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
async lazyParsePara() {
|
|
||||||
if (!this.parsed || this.doingLazyParse)
|
|
||||||
return;
|
|
||||||
this.doingLazyParse = true;
|
|
||||||
let j = 0;
|
|
||||||
let k = 0;
|
|
||||||
let prevPerc = 0;
|
|
||||||
this.stopLazyParse = false;
|
|
||||||
for (let i = 0; i < this.parsed.para.length; i++) {
|
|
||||||
j++;
|
|
||||||
if (j > 1) {
|
|
||||||
await utils.sleep(1);
|
|
||||||
j = 0;
|
|
||||||
}
|
|
||||||
if (this.stopLazyParse)
|
|
||||||
break;
|
|
||||||
this.parsed.parsePara(i);
|
|
||||||
k++;
|
|
||||||
if (k > 100) {
|
|
||||||
let perc = Math.round(i/this.parsed.para.length*100);
|
|
||||||
if (perc != prevPerc)
|
|
||||||
this.drawStatusBar(`Обработка текста ${perc}%`);
|
|
||||||
prevPerc = perc;
|
|
||||||
k = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.drawStatusBar();
|
|
||||||
this.doingLazyParse = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
async refreshTime() {
|
async refreshTime() {
|
||||||
if (!this.timeRefreshing) {
|
if (!this.timeRefreshing) {
|
||||||
this.timeRefreshing = true;
|
this.timeRefreshing = true;
|
||||||
|
|||||||
@@ -172,7 +172,6 @@ const settingDefaults = {
|
|||||||
pageChangeAnimationSpeed: 80, //0-100%
|
pageChangeAnimationSpeed: 80, //0-100%
|
||||||
|
|
||||||
allowUrlParamBookPos: false,
|
allowUrlParamBookPos: false,
|
||||||
lazyParseEnabled: false,
|
|
||||||
copyFullText: false,
|
copyFullText: false,
|
||||||
showClickMapPage: true,
|
showClickMapPage: true,
|
||||||
clickControl: true,
|
clickControl: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user