На страницу загрузки добавлена возможность загрузки книги из буфера обмена
This commit is contained in:
@@ -18,6 +18,10 @@
|
|||||||
Загрузить файл с диска
|
Загрузить файл с диска
|
||||||
</el-button>
|
</el-button>
|
||||||
<div class="space"></div>
|
<div class="space"></div>
|
||||||
|
<el-button size="mini" @click="loadBufferClick">
|
||||||
|
Из буфера обмена
|
||||||
|
</el-button>
|
||||||
|
<div class="space"></div>
|
||||||
<span v-if="mode == 'omnireader'" class="bottom-span clickable" @click="openComments">Комментарии</span>
|
<span v-if="mode == 'omnireader'" class="bottom-span clickable" @click="openComments">Комментарии</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -26,6 +30,8 @@
|
|||||||
<span class="bottom-span clickable" @click="openDonate">Помочь проекту</span>
|
<span class="bottom-span clickable" @click="openDonate">Помочь проекту</span>
|
||||||
<span class="bottom-span">{{ version }}</span>
|
<span class="bottom-span">{{ version }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<PasteTextPage v-if="pasteTextActive" ref="pasteTextPage" @paste-text-toggle="pasteTextToggle" @load-buffer="loadBuffer"></PasteTextPage>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -33,12 +39,17 @@
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import Component from 'vue-class-component';
|
import Component from 'vue-class-component';
|
||||||
|
import PasteTextPage from './PasteTextPage/PasteTextPage.vue';
|
||||||
|
|
||||||
export default @Component({
|
export default @Component({
|
||||||
|
components: {
|
||||||
|
PasteTextPage,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
class LoaderPage extends Vue {
|
class LoaderPage extends Vue {
|
||||||
bookUrl = null;
|
bookUrl = null;
|
||||||
loadPercent = 0;
|
loadPercent = 0;
|
||||||
|
pasteTextActive = false;
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.commit = this.$store.commit;
|
this.commit = this.$store.commit;
|
||||||
@@ -89,6 +100,21 @@ class LoaderPage extends Vue {
|
|||||||
this.$emit('load-file', {file});
|
this.$emit('load-file', {file});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
loadBufferClick() {
|
||||||
|
this.pasteTextToggle();
|
||||||
|
}
|
||||||
|
|
||||||
|
loadBuffer(opts) {
|
||||||
|
if (opts.buffer.length) {
|
||||||
|
const file = new File([opts.buffer], 'dummyName-PasteFromClipboard');
|
||||||
|
this.$emit('load-file', {file});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pasteTextToggle() {
|
||||||
|
this.pasteTextActive = !this.pasteTextActive;
|
||||||
|
}
|
||||||
|
|
||||||
openHelp() {
|
openHelp() {
|
||||||
this.$emit('help-toggle');
|
this.$emit('help-toggle');
|
||||||
}
|
}
|
||||||
@@ -102,6 +128,10 @@ class LoaderPage extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
keyHook(event) {
|
keyHook(event) {
|
||||||
|
if (this.pasteTextActive) {
|
||||||
|
return this.$refs.pasteTextPage.keyHook(event);
|
||||||
|
}
|
||||||
|
|
||||||
//недостатки сторонних ui
|
//недостатки сторонних ui
|
||||||
const input = this.$refs.input.$refs.input;
|
const input = this.$refs.input.$refs.input;
|
||||||
if (document.activeElement === input && event.type == 'keydown' && event.code == 'Enter') {
|
if (document.activeElement === input && event.type == 'keydown' && event.code == 'Enter') {
|
||||||
|
|||||||
@@ -0,0 +1,93 @@
|
|||||||
|
<template>
|
||||||
|
<div ref="main" class="main" @click="close">
|
||||||
|
<div class="mainWindow" @click.stop>
|
||||||
|
<Window @close="close">
|
||||||
|
<template slot="header">
|
||||||
|
Вставьте текст и нажмите
|
||||||
|
<el-button size="mini" style="font-size: 120%; color: blue" @click="loadBuffer">Загрузить</el-button>
|
||||||
|
или F2
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<textarea ref="textArea" class="text"></textarea>
|
||||||
|
</Window>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
import Vue from 'vue';
|
||||||
|
import Component from 'vue-class-component';
|
||||||
|
|
||||||
|
import Window from '../../../share/Window.vue';
|
||||||
|
|
||||||
|
export default @Component({
|
||||||
|
components: {
|
||||||
|
Window,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
class PasteTextPage extends Vue {
|
||||||
|
created() {
|
||||||
|
}
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
this.$refs.textArea.focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
loadBuffer() {
|
||||||
|
this.$emit('load-buffer', {buffer: this.$refs.textArea.value});
|
||||||
|
this.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
close() {
|
||||||
|
this.$emit('paste-text-toggle');
|
||||||
|
}
|
||||||
|
|
||||||
|
keyHook(event) {
|
||||||
|
if (event.type == 'keydown') {
|
||||||
|
switch (event.code) {
|
||||||
|
case 'F2':
|
||||||
|
this.loadBuffer();
|
||||||
|
break;
|
||||||
|
case 'Escape':
|
||||||
|
this.close();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.main {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 40;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mainWindow {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
flex: 1;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding: 0 10px 0 10px;
|
||||||
|
position: relative;
|
||||||
|
font-size: 120%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -780,7 +780,7 @@ class Reader extends Vue {
|
|||||||
|
|
||||||
this.progressActive = true;
|
this.progressActive = true;
|
||||||
|
|
||||||
await this.$nextTick()
|
await this.$nextTick();
|
||||||
|
|
||||||
const progress = this.$refs.page;
|
const progress = this.$refs.page;
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ export const versionHistory = [
|
|||||||
<li>в справку добавлена история версий проекта</li>
|
<li>в справку добавлена история версий проекта</li>
|
||||||
<li>добавлена возможность настройки отображаемых кнопок на панели управления</li>
|
<li>добавлена возможность настройки отображаемых кнопок на панели управления</li>
|
||||||
<li>некоторые кнопки на панели управления были скрыты по-умолчанию</li>
|
<li>некоторые кнопки на панели управления были скрыты по-умолчанию</li>
|
||||||
|
<li>на страницу загрузки добавлена возможность загрузки книги из буфера обмена</li>
|
||||||
<li>исправления багов и недочетов</li>
|
<li>исправления багов и недочетов</li>
|
||||||
</ul>
|
</ul>
|
||||||
`
|
`
|
||||||
|
|||||||
Reference in New Issue
Block a user