diff --git a/client/components/Reader/LibsPage/LibsPage.vue b/client/components/Reader/LibsPage/LibsPage.vue new file mode 100644 index 00000000..611e9d3f --- /dev/null +++ b/client/components/Reader/LibsPage/LibsPage.vue @@ -0,0 +1,113 @@ + + + + Библиотеки (выбрана {{ startLink }}) + + + + + + + + + + + + + + + + + Открыть + + + + + + + + + + diff --git a/client/components/Reader/Reader.vue b/client/components/Reader/Reader.vue index 5657d24b..458722f4 100644 --- a/client/components/Reader/Reader.vue +++ b/client/components/Reader/Reader.vue @@ -85,6 +85,7 @@ @stop-text-search="stopTextSearch"> + @@ -167,6 +168,7 @@ import ProgressPage from './ProgressPage/ProgressPage.vue'; import SetPositionPage from './SetPositionPage/SetPositionPage.vue'; import SearchPage from './SearchPage/SearchPage.vue'; import CopyTextPage from './CopyTextPage/CopyTextPage.vue'; +import LibsPage from './LibsPage/LibsPage.vue'; import RecentBooksPage from './RecentBooksPage/RecentBooksPage.vue'; import SettingsPage from './SettingsPage/SettingsPage.vue'; import HelpPage from './HelpPage/HelpPage.vue'; @@ -189,6 +191,7 @@ export default @Component({ SetPositionPage, SearchPage, CopyTextPage, + LibsPage, RecentBooksPage, SettingsPage, HelpPage, @@ -599,6 +602,7 @@ class Reader extends Vue { closeAllWindows() { this.setPositionActive = false; this.copyTextActive = false; + this.libsActive = false; this.recentBooksActive = false; this.settingsActive = false; this.stopScrolling(); @@ -711,6 +715,17 @@ class Reader extends Vue { } } + libsToogle() { + this.libsActive = !this.libsActive; + if (this.libsActive) { + this.closeAllWindows(); + this.$refs.libsPage.init(); + this.libsActive = true; + } else { + this.libsActive = false; + } + } + offlineModeToggle() { this.offlineModeActive = !this.offlineModeActive; this.$refs.serverStorage.offlineModeActive = this.offlineModeActive; @@ -1205,6 +1220,9 @@ class Reader extends Vue { if (!handled && this.copyTextActive) handled = this.$refs.copyTextPage.keyHook(event); + if (!handled && this.libsActive) + handled = this.$refs.libsPage.keyHook(event); + if (!handled && this.$refs.page && this.$refs.page.keyHook) handled = this.$refs.page.keyHook(event); diff --git a/client/store/modules/reader.js b/client/store/modules/reader.js index 4ba12b4b..261f2a5d 100644 --- a/client/store/modules/reader.js +++ b/client/store/modules/reader.js @@ -253,6 +253,18 @@ const settingDefaults = { userHotKeys: {}, }; +const libsDefaults = { + startLink: 'http://flibusta.is', + links: [ + {r: 'http://flibusta.is', s: 'http://flibusta.is', list: [ + {l: 'http://flibusta.is', c: 'Флибуста - книжное братство'} + ]}, + {r: 'http://samlib.ru', s: 'http://samlib.ru', list: [ + {l: 'http://samlib.ru', c: 'Журнал "Самиздат"'} + ]}, + ] +}; + for (const font of fonts) settingDefaults.fontShifts[font.name] = font.fontVertShift; for (const font of webFonts) @@ -275,6 +287,8 @@ const state = { currentProfile: '', settings: Object.assign({}, settingDefaults), settingsRev: {}, + libs: Object.assign({}, libsDefaults), + libsRev: 0, }; // getters @@ -318,6 +332,12 @@ const mutations = { setSettingsRev(state, value) { state.settingsRev = Object.assign({}, state.settingsRev, value); }, + setLibs(state, value) { + state.libs = value; + }, + setLibsRev(state, value) { + state.libsRev = value; + }, }; export default {