Compare commits

...

10 Commits

Author SHA1 Message Date
Book Pauk
3943fc7d95 Merge branch 'release/0.9.8-3' 2020-11-14 23:27:09 +07:00
Book Pauk
3999dc930c Рефакторинг, плюс небольшие изменения внешнего вида 2020-11-14 23:24:20 +07:00
Book Pauk
d4dea16456 Убрал неиспользуемые компоненты 2020-11-14 23:23:51 +07:00
Book Pauk
ed38cb33a5 Merge tag '0.9.8-2' into develop
0.9.8-2
2020-11-14 12:01:44 +07:00
Book Pauk
4cf5a0f4c8 Merge branch 'release/0.9.8-2' 2020-11-14 12:01:39 +07:00
Book Pauk
8f0d526af2 Скрыл хоткей для "Библиотека" в режиме omnireader 2020-11-14 12:00:55 +07:00
Book Pauk
6ca3881841 Merge tag '0.9.8-1' into develop
0.9.8-1
2020-11-14 11:49:06 +07:00
Book Pauk
d8e765a04f Merge branch 'release/0.9.8-1' 2020-11-14 11:49:02 +07:00
Book Pauk
40ff572f94 Добавил проксирование для fantasy-worlds.org 2020-11-14 11:48:03 +07:00
Book Pauk
cc4275dc03 Merge tag '0.9.8' into develop
0.9.8
2020-11-14 00:05:14 +07:00
6 changed files with 106 additions and 52 deletions

View File

@@ -159,6 +159,7 @@ import * as lu from './linkUtils';
const proxySubst = { const proxySubst = {
'http://flibusta.is': 'http://b.liberama.top:23480', 'http://flibusta.is': 'http://b.liberama.top:23480',
'http://fantasy-worlds.org': 'http://b.liberama.top:23580',
}; };
export default @Component({ export default @Component({

View File

@@ -24,36 +24,30 @@
<div class="tab-panel" v-show="selectedTab == 'contents'"> <div class="tab-panel" v-show="selectedTab == 'contents'">
<div> <div>
<div class="row" v-for="item in contents" :key="item.key"> <div v-for="item in contents" :key="item.key" class="column" style="width: 540px">
<q-expansion-item v-if="item.list.length" <div class="row item q-px-sm no-wrap">
class="item separator-bottom" <div v-if="item.list.length" class="row justify-center items-center expand-button clickable" @click="expandClick(item.key)">
expand-icon-toggle <q-icon name="la la-arrow-circle-down" class="icon" :class="{'expanded-icon': item.expanded}" color="green-8" size="24px"/>
switch-toggle-side </div>
expand-icon="la la-arrow-circle-down" <div v-else class="no-expand-button clickable" @click="setBookPos(item.offset)">
> </div>
<template slot="header"> <div class="col row clickable" @click="setBookPos(item.offset)">
<div class="row no-wrap clickable" style="width: 465px" @click="setBookPos(item.offset)"> <div :style="item.indentStyle"></div>
<div :style="item.style"></div>
<div class="q-mr-sm col overflow-hidden column justify-center" v-html="item.label"></div>
<div class="column justify-center">{{ item.perc }}%</div>
</div>
</template>
<q-item class="subitem separator-top column justify-center" v-for="subitem in item.list" :key="subitem.key">
<div class="row no-wrap clickable" style="padding-left: 55px; width: 520px" @click="setBookPos(subitem.offset)">
<div :style="subitem.style"></div>
<div class="q-mr-sm col overflow-hidden column justify-center" v-html="subitem.label"></div>
<div class="column justify-center">{{ subitem.perc }}%</div>
</div>
</q-item>
</q-expansion-item>
<q-item v-else class="item separator-bottom">
<div class="row no-wrap clickable" style="padding-left: 55px; width: 520px" @click="setBookPos(item.offset)">
<div :style="item.style"></div>
<div class="q-mr-sm col overflow-hidden column justify-center" v-html="item.label"></div> <div class="q-mr-sm col overflow-hidden column justify-center" v-html="item.label"></div>
<div class="column justify-center">{{ item.perc }}%</div> <div class="column justify-center">{{ item.perc }}%</div>
</div> </div>
</q-item> </div>
<div v-if="item.expanded" :ref="`subitem${item.key}`" class="subitems-transition">
<div v-for="subitem in item.list" :key="subitem.key" class="row subitem q-px-sm no-wrap">
<div class="col row clickable" @click="setBookPos(subitem.offset)">
<div class="no-expand-button"></div>
<div :style="subitem.indentStyle"></div>
<div class="q-mr-sm col overflow-hidden column justify-center" v-html="subitem.label"></div>
<div class="column justify-center">{{ subitem.perc }}%</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -74,7 +68,7 @@ import Component from 'vue-class-component';
//import _ from 'lodash'; //import _ from 'lodash';
import Window from '../../share/Window.vue'; import Window from '../../share/Window.vue';
//import * as utils from '../../../share/utils'; import * as utils from '../../../share/utils';
export default @Component({ export default @Component({
components: { components: {
@@ -93,11 +87,15 @@ class ContentsPage extends Vue {
async init(currentBook, parsed) { async init(currentBook, parsed) {
this.$refs.window.init(); this.$refs.window.init();
if (this.parsed != parsed) { //закладки
this.contents = [];
await this.$nextTick(); //далее формаирование оглавления
this.parsed = parsed; if (this.parsed == parsed)
} return;
this.parsed = parsed;
this.contents = [];
await this.$nextTick();
const prepareLabel = (title, bolder = false) => { const prepareLabel = (title, bolder = false) => {
let titleParts = title.split('<p>'); let titleParts = title.split('<p>');
@@ -137,7 +135,7 @@ class ContentsPage extends Vue {
const newContents = []; const newContents = [];
newpc.forEach((cont) => { newpc.forEach((cont) => {
const label = prepareLabel(cont.title, true); const label = prepareLabel(cont.title, true);
const style = insetStyle(cont.inset); const indentStyle = insetStyle(cont.inset);
let j = 0; let j = 0;
const list = []; const list = [];
@@ -145,12 +143,12 @@ class ContentsPage extends Vue {
const l = prepareLabel(sub.title); const l = prepareLabel(sub.title);
const s = insetStyle(sub.inset + 1); const s = insetStyle(sub.inset + 1);
const p = parsed.para[sub.paraIndex]; const p = parsed.para[sub.paraIndex];
list.push({perc: (p.offset/parsed.textLength*100).toFixed(2), label: l, key: j, offset: p.offset, style: s}); list[j] = {perc: (p.offset/parsed.textLength*100).toFixed(2), label: l, key: j, offset: p.offset, indentStyle: s};
j++; j++;
}); });
const p = parsed.para[cont.paraIndex]; const p = parsed.para[cont.paraIndex];
newContents.push({perc: (p.offset/parsed.textLength*100).toFixed(0), label, key: i, offset: p.offset, style, list}); newContents[i] = {perc: (p.offset/parsed.textLength*100).toFixed(0), label, key: i, offset: p.offset, indentStyle, expanded: false, list};
i++; i++;
}); });
@@ -158,6 +156,25 @@ class ContentsPage extends Vue {
this.contents = newContents; this.contents = newContents;
} }
async expandClick(key) {
const item = this.contents[key];
const expanded = !item.expanded;
if (!expanded) {
const subitems = this.$refs[`subitem${key}`][0];
subitems.style.height = '0';
await utils.sleep(200);
}
this.$set(this.contents, key, Object.assign({}, item, {expanded}));
if (expanded) {
await this.$nextTick();
const subitems = this.$refs[`subitem${key}`][0];
subitems.style.height = subitems.scrollHeight + 'px';
}
}
async setBookPos(newValue) { async setBookPos(newValue) {
this.$emit('book-pos-changed', {bookPos: newValue}); this.$emit('book-pos-changed', {bookPos: newValue});
await this.$nextTick(); await this.$nextTick();
@@ -190,18 +207,36 @@ class ContentsPage extends Vue {
cursor: pointer; cursor: pointer;
} }
.item:hover { .item, .subitem {
height: 40px;
border-bottom: 1px solid #e0e0e0;
}
.item:hover, .subitem:hover {
background-color: #f0f0f0; background-color: #f0f0f0;
} }
.subitem:hover { .expand-button, .no-expand-button {
background-color: #e0e0e0; width: 40px;
} }
.separator-top { .expand-button:hover {
border-top: 1px solid #e0e0e0; background-color: white;
border-radius: 15px;
border: 1px solid #d0d0d0;
} }
.separator-bottom {
border-top: 1px solid #e0e0e0; .subitems-transition {
height: 0;
transition: height 0.2s linear;
overflow: hidden;
}
.icon {
transition: transform 0.2s;
}
.expanded-icon {
transform: rotate(180deg);
} }
</style> </style>

View File

@@ -104,8 +104,12 @@ class UserHotKeys extends UserHotKeysProps {
this.updateTableData(); this.updateTableData();
} }
get mode() {
return this.$store.state.config.mode;
}
updateTableData() { updateTableData() {
let result = rstore.hotKeys.map(hk => hk.name); let result = rstore.hotKeys.map(hk => hk.name).filter(name => (this.mode == 'liberama.top' || name != 'libs'));
const search = this.search.toLowerCase(); const search = this.search.toLowerCase();
const codesIncludeSearch = (action) => { const codesIncludeSearch = (action) => {

View File

@@ -21,7 +21,7 @@ import {QSlider} from 'quasar/src/components/slider';
import {QTabs, QTab} from 'quasar/src/components/tabs'; import {QTabs, QTab} from 'quasar/src/components/tabs';
//import {QTabPanels, QTabPanel} from 'quasar/src/components/tab-panels'; //import {QTabPanels, QTabPanel} from 'quasar/src/components/tab-panels';
import {QSeparator} from 'quasar/src/components/separator'; import {QSeparator} from 'quasar/src/components/separator';
import {QList, QItem, QItemSection, QItemLabel} from 'quasar/src/components/item'; //import {QList, QItem, QItemSection, QItemLabel} from 'quasar/src/components/item';
import {QTooltip} from 'quasar/src/components/tooltip'; import {QTooltip} from 'quasar/src/components/tooltip';
import {QSpinner} from 'quasar/src/components/spinner'; import {QSpinner} from 'quasar/src/components/spinner';
import {QTable, QTh, QTr, QTd} from 'quasar/src/components/table'; import {QTable, QTh, QTr, QTd} from 'quasar/src/components/table';
@@ -32,8 +32,7 @@ import {QPopupProxy} from 'quasar/src/components/popup-proxy';
import {QDialog} from 'quasar/src/components/dialog'; import {QDialog} from 'quasar/src/components/dialog';
import {QChip} from 'quasar/src/components/chip'; import {QChip} from 'quasar/src/components/chip';
import {QTree} from 'quasar/src/components/tree'; import {QTree} from 'quasar/src/components/tree';
import {QExpansionItem} from 'quasar/src/components/expansion-item'; //import {QExpansionItem} from 'quasar/src/components/expansion-item';
const components = { const components = {
//QLayout, //QLayout,
@@ -50,7 +49,7 @@ const components = {
QTabs, QTab, QTabs, QTab,
//QTabPanels, QTabPanel, //QTabPanels, QTabPanel,
QSeparator, QSeparator,
QList, QItem, QItemSection, QItemLabel, //QList, QItem, QItemSection, QItemLabel,
QTooltip, QTooltip,
QSpinner, QSpinner,
QTable, QTh, QTr, QTd, QTable, QTh, QTr, QTd,
@@ -61,7 +60,7 @@ const components = {
QDialog, QDialog,
QChip, QChip,
QTree, QTree,
QExpansionItem, //QExpansionItem,
}; };
//directives //directives

View File

@@ -297,15 +297,15 @@ const libsDefaults = {
{r: 'https://flibs.in', s: 'https://flibs.in', list: [ {r: 'https://flibs.in', s: 'https://flibs.in', list: [
{l: 'https://flibs.in', c: 'Flibs'}, {l: 'https://flibs.in', c: 'Flibs'},
]}, ]},
{r: 'http://fantasy-worlds.org', s: 'http://fantasy-worlds.org', list: [
{l: 'http://fantasy-worlds.org', c: 'Миры Фэнтези'},
]},
{r: 'http://samlib.ru', s: 'http://samlib.ru', list: [ {r: 'http://samlib.ru', s: 'http://samlib.ru', list: [
{l: 'http://samlib.ru', c: 'Журнал "Самиздат"'}, {l: 'http://samlib.ru', c: 'Журнал "Самиздат"'},
]}, ]},
{r: 'http://lib.ru', s: 'http://lib.ru', list: [ {r: 'http://lib.ru', s: 'http://lib.ru', list: [
{l: 'http://lib.ru', c: 'Библиотека Максима Мошкова'}, {l: 'http://lib.ru', c: 'Библиотека Максима Мошкова'},
]}, ]},
{r: 'http://fantasy-worlds.org', s: 'http://fantasy-worlds.org', list: [
{l: 'http://fantasy-worlds.org', c: 'Миры Фэнтези'},
]},
{r: 'https://aldebaran.ru', s: 'https://aldebaran.ru', list: [ {r: 'https://aldebaran.ru', s: 'https://aldebaran.ru', list: [
{l: 'https://aldebaran.ru', c: 'АЛЬДЕБАРАН | Электронная библиотека книг'}, {l: 'https://aldebaran.ru', c: 'АЛЬДЕБАРАН | Электронная библиотека книг'},
]}, ]},

View File

@@ -126,3 +126,18 @@ server {
proxy_set_header Referer ""; proxy_set_header Referer "";
} }
} }
server {
listen 23580;
server_name fw_proxy;
valid_referers liberama.top b.liberama.top;
if ($invalid_referer) {
return 403;
}
location / {
proxy_pass http://fantasy-worlds.org;
}
}