Добавлена кнопка 'Загрузить из буфера обмена'
This commit is contained in:
@@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
<div class="q-my-sm"></div>
|
<div class="q-my-sm"></div>
|
||||||
<q-btn no-caps dense class="q-px-sm" color="primary" size="13px" @click="loadBufferClick">
|
<q-btn no-caps dense class="q-px-sm" color="primary" size="13px" @click="loadBufferClick">
|
||||||
|
<q-icon class="q-mr-xs" name="la la-comment" size="24px" />
|
||||||
Из буфера обмена
|
Из буфера обмена
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
||||||
@@ -65,6 +66,7 @@ import GithubCorner from './GithubCorner/GithubCorner.vue';
|
|||||||
|
|
||||||
import PasteTextPage from './PasteTextPage/PasteTextPage.vue';
|
import PasteTextPage from './PasteTextPage/PasteTextPage.vue';
|
||||||
import {versionHistory} from '../versionHistory';
|
import {versionHistory} from '../versionHistory';
|
||||||
|
import * as utils from '../../../share/utils';
|
||||||
|
|
||||||
const componentOptions = {
|
const componentOptions = {
|
||||||
components: {
|
components: {
|
||||||
@@ -171,8 +173,9 @@ class LoaderPage {
|
|||||||
window.open('http://old.omnireader.ru', '_blank');
|
window.open('http://old.omnireader.ru', '_blank');
|
||||||
}
|
}
|
||||||
|
|
||||||
onInputKeydown(event) {
|
async onInputKeydown(event) {
|
||||||
if (event.key == 'Enter') {
|
if (event.key == 'Enter') {
|
||||||
|
await utils.sleep(100);
|
||||||
this.submitUrl();
|
this.submitUrl();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -183,6 +186,10 @@ class LoaderPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const input = this.$refs.input.getNativeElement();
|
const input = this.$refs.input.getNativeElement();
|
||||||
|
if (event.type == 'keydown' && document.activeElement === input)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
/*const input = this.$refs.input.getNativeElement();
|
||||||
if (event.type == 'keydown' && document.activeElement !== input) {
|
if (event.type == 'keydown' && document.activeElement !== input) {
|
||||||
const action = this.$root.readerActionByKeyEvent(event);
|
const action = this.$root.readerActionByKeyEvent(event);
|
||||||
switch (action) {
|
switch (action) {
|
||||||
@@ -190,7 +197,7 @@ class LoaderPage {
|
|||||||
this.openHelp(event);
|
this.openHelp(event);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,13 @@
|
|||||||
</q-tooltip>
|
</q-tooltip>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<button v-show="showToolButton['loadBuffer']" ref="loadBuffer" v-ripple class="tool-button" :class="buttonActiveClass('loadBuffer')" @click="buttonClick('loadBuffer')">
|
||||||
|
<q-icon name="la la-comment" size="32px" />
|
||||||
|
<q-tooltip :delay="1500" anchor="bottom right" content-style="font-size: 80%">
|
||||||
|
{{ rstore.readerActions['loadBuffer'] }}
|
||||||
|
</q-tooltip>
|
||||||
|
</button>
|
||||||
|
|
||||||
<button v-show="showToolButton['help']" ref="help" v-ripple class="tool-button" :class="buttonActiveClass('help')" @click="buttonClick('help')">
|
<button v-show="showToolButton['help']" ref="help" v-ripple class="tool-button" :class="buttonActiveClass('help')" @click="buttonClick('help')">
|
||||||
<q-icon name="la la-question" size="32px" />
|
<q-icon name="la la-question" size="32px" />
|
||||||
<q-tooltip :delay="1500" anchor="bottom right" content-style="font-size: 80%">
|
<q-tooltip :delay="1500" anchor="bottom right" content-style="font-size: 80%">
|
||||||
@@ -260,6 +267,7 @@ class Reader {
|
|||||||
|
|
||||||
loaderActive = false;
|
loaderActive = false;
|
||||||
loadFileActive = false;
|
loadFileActive = false;
|
||||||
|
loadBufferActive = false;
|
||||||
fullScreenActive = false;
|
fullScreenActive = false;
|
||||||
setPositionActive = false;
|
setPositionActive = false;
|
||||||
searchActive = false;
|
searchActive = false;
|
||||||
@@ -700,6 +708,17 @@ class Reader {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
loadBufferToggle() {
|
||||||
|
if (!this.loaderActive)
|
||||||
|
this.loaderToggle();
|
||||||
|
this.$nextTick(() => {
|
||||||
|
const page = this.$refs.page;
|
||||||
|
if (this.activePage == 'LoaderPage' && page.showPasteText) {
|
||||||
|
page.showPasteText();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
setPositionToggle() {
|
setPositionToggle() {
|
||||||
this.setPositionActive = !this.setPositionActive;
|
this.setPositionActive = !this.setPositionActive;
|
||||||
const page = this.$refs.page;
|
const page = this.$refs.page;
|
||||||
@@ -915,6 +934,8 @@ class Reader {
|
|||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case 'loader':
|
case 'loader':
|
||||||
|
case 'loadFile':
|
||||||
|
case 'loadBuffer':
|
||||||
case 'help':
|
case 'help':
|
||||||
case 'fullScreen':
|
case 'fullScreen':
|
||||||
case 'setPosition':
|
case 'setPosition':
|
||||||
@@ -1232,6 +1253,9 @@ class Reader {
|
|||||||
case 'loadFile':
|
case 'loadFile':
|
||||||
this.loadFileToggle();
|
this.loadFileToggle();
|
||||||
break;
|
break;
|
||||||
|
case 'loadBuffer':
|
||||||
|
this.loadBufferToggle();
|
||||||
|
break;
|
||||||
case 'help':
|
case 'help':
|
||||||
this.helpToggle();
|
this.helpToggle();
|
||||||
break;
|
break;
|
||||||
@@ -1376,13 +1400,14 @@ class Reader {
|
|||||||
if (!result && event.type == 'keydown') {
|
if (!result && event.type == 'keydown') {
|
||||||
const action = this.$root.readerActionByKeyEvent(event);
|
const action = this.$root.readerActionByKeyEvent(event);
|
||||||
|
|
||||||
if (action == 'loader') {
|
/*if (action == 'loader') {
|
||||||
result = this.doAction({action, event});
|
result = this.doAction({action, event});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!result && this.activePage == 'TextPage') {
|
if (!result && this.activePage == 'TextPage') {
|
||||||
result = this.doAction({action, event});
|
result = this.doAction({action, event});
|
||||||
}
|
}*/
|
||||||
|
result = this.doAction({action, event});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -83,6 +83,7 @@
|
|||||||
<br><br>
|
<br><br>
|
||||||
Если же вы пытаетесь вставить текст в читалку из буфера обмена, пожалуйста воспользуйтесь кнопкой
|
Если же вы пытаетесь вставить текст в читалку из буфера обмена, пожалуйста воспользуйтесь кнопкой
|
||||||
<q-btn no-caps dense class="q-px-sm" color="primary" size="13px" @click="loadBufferClick">
|
<q-btn no-caps dense class="q-px-sm" color="primary" size="13px" @click="loadBufferClick">
|
||||||
|
<q-icon class="q-mr-xs" name="la la-comment" size="24px" />
|
||||||
Из буфера обмена
|
Из буфера обмена
|
||||||
</q-btn>
|
</q-btn>
|
||||||
на странице загрузки.
|
на странице загрузки.
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import googleFonts from './fonts/fonts.json';
|
|||||||
const readerActions = {
|
const readerActions = {
|
||||||
'loader': 'На страницу загрузки',
|
'loader': 'На страницу загрузки',
|
||||||
'loadFile': 'Загрузить файл с диска',
|
'loadFile': 'Загрузить файл с диска',
|
||||||
|
'loadBuffer': 'Загрузить из буфера обмена',
|
||||||
'help': 'Вызвать cправку',
|
'help': 'Вызвать cправку',
|
||||||
'settings': 'Настроить',
|
'settings': 'Настроить',
|
||||||
'undoAction': 'Действие назад',
|
'undoAction': 'Действие назад',
|
||||||
@@ -37,6 +38,7 @@ const readerActions = {
|
|||||||
//readerActions[name]
|
//readerActions[name]
|
||||||
const toolButtons = [
|
const toolButtons = [
|
||||||
{name: 'loadFile', show: true},
|
{name: 'loadFile', show: true},
|
||||||
|
{name: 'loadBuffer', show: true},
|
||||||
{name: 'help', show: true},
|
{name: 'help', show: true},
|
||||||
{name: 'undoAction', show: true},
|
{name: 'undoAction', show: true},
|
||||||
{name: 'redoAction', show: true},
|
{name: 'redoAction', show: true},
|
||||||
@@ -57,6 +59,7 @@ const toolButtons = [
|
|||||||
const hotKeys = [
|
const hotKeys = [
|
||||||
{name: 'loader', codes: ['Escape']},
|
{name: 'loader', codes: ['Escape']},
|
||||||
{name: 'loadFile', codes: ['F3']},
|
{name: 'loadFile', codes: ['F3']},
|
||||||
|
{name: 'loadBuffer', codes: ['F4']},
|
||||||
{name: 'help', codes: ['F1', 'H']},
|
{name: 'help', codes: ['F1', 'H']},
|
||||||
{name: 'settings', codes: ['S']},
|
{name: 'settings', codes: ['S']},
|
||||||
{name: 'undoAction', codes: ['Ctrl+BracketLeft']},
|
{name: 'undoAction', codes: ['Ctrl+BracketLeft']},
|
||||||
|
|||||||
Reference in New Issue
Block a user