diff --git a/client/components/ExternalLibs/ExternalLibs.vue b/client/components/ExternalLibs/ExternalLibs.vue index 043b1e3f..3b4a9243 100644 --- a/client/components/ExternalLibs/ExternalLibs.vue +++ b/client/components/ExternalLibs/ExternalLibs.vue @@ -4,6 +4,13 @@ {{ header }} + +
@@ -53,6 +64,10 @@ import _ from 'lodash'; import Window from '../share/Window.vue'; import * as utils from '../../share/utils'; +const proxySubst = { + 'http://flibusta.is': 'http://b.liberama.top:23480', +}; + export default @Component({ components: { Window @@ -79,9 +94,11 @@ class ExternalLibs extends Vue { frameSrc = ''; bookUrl = ''; libs = {}; + fullScreenActive = false; created() { this.$root.addKeyHook(this.keyHook); + //this.commit = this.$store.commit; //this.commit('reader/setLibs', rstore.libsDefaults); } @@ -237,7 +254,7 @@ class ExternalLibs extends Vue { if (!this.ready) return; - this.frameSrc = this.libs.startLink; + this.frameSrc = this.makeProxySubst(this.libs.startLink); this.frameVisible = false; this.$nextTick(() => { this.frameVisible = true; @@ -285,19 +302,46 @@ class ExternalLibs extends Vue { return ''; } + makeProxySubst(url, reverse = false) { + for (const [key, value] of Object.entries(proxySubst)) { + if (reverse && value == url.substring(0, value.length)) { + return key + url.substring(value.length); + } else if (key == url.substring(0, key.length)) { + return value + url.substring(key.length); + } + } + + return url; + } + onInputFocus() { this.$refs.input.select(); } submitUrl() { if (this.bookUrl) { - this.sendMessage({type: 'submitUrl', data: {url: this.addProtocol(this.bookUrl), force: true}}); + this.sendMessage({type: 'submitUrl', data: { + url: this.makeProxySubst(this.addProtocol(this.bookUrl), true), + force: true + }}); this.bookUrl = ''; if (this.libs.closeAfterSubmit) this.close(); } } + addBookmark() { + } + + fullScreenToggle() { + this.fullScreenActive = !this.fullScreenActive; + if (this.fullScreenActive) { + this.$q.fullscreen.request(); + } else { + this.$q.fullscreen.exit(); + } + } + close() { this.sendMessage({type: 'close'}); } @@ -325,4 +369,15 @@ class ExternalLibs extends Vue { height: 1px; background-color: #A0A0A0; } + +.full-screen-button { + width: 30px; + height: 30px; + cursor: pointer; +} + +.full-screen-button:hover { + background-color: #69C05F; +} + diff --git a/client/components/Reader/Reader.vue b/client/components/Reader/Reader.vue index 4d586476..4bc3ba8a 100644 --- a/client/components/Reader/Reader.vue +++ b/client/components/Reader/Reader.vue @@ -85,7 +85,7 @@ @stop-text-search="stopTextSearch"> - + diff --git a/client/components/share/Window.vue b/client/components/share/Window.vue index 33279ccd..62a0a558 100644 --- a/client/components/share/Window.vue +++ b/client/components/share/Window.vue @@ -5,6 +5,7 @@
+
diff --git a/client/store/modules/reader.js b/client/store/modules/reader.js index 2501959a..3db50b94 100644 --- a/client/store/modules/reader.js +++ b/client/store/modules/reader.js @@ -264,6 +264,9 @@ const libsDefaults = { {r: 'http://samlib.ru', s: 'http://samlib.ru', list: [ {l: 'http://samlib.ru', c: 'Журнал "Самиздат"'}, ]}, + {r: 'http://lib.ru', s: 'http://lib.ru', list: [ + {l: 'http://lib.ru', c: 'Библиотека Максима Мошкова'}, + ]}, ] };