From ca408541066fb80189a47821e189d82dd296710e Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Thu, 5 Nov 2020 22:21:52 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE?= =?UTF-8?q?=D1=80=D0=B8=D0=BD=D0=B3,=20=D0=B2=D0=B5=D1=80=D1=81=D0=B8?= =?UTF-8?q?=D1=8F=200.9.6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Reader/Reader.vue | 152 +------------ .../Reader/ReaderDialogs/ReaderDialogs.vue | 201 ++++++++++++++++++ client/components/Reader/versionHistory.js | 12 ++ 3 files changed, 221 insertions(+), 144 deletions(-) create mode 100644 client/components/Reader/ReaderDialogs/ReaderDialogs.vue diff --git a/client/components/Reader/Reader.vue b/client/components/Reader/Reader.vue index c3a6fdf2..5b252535 100644 --- a/client/components/Reader/Reader.vue +++ b/client/components/Reader/Reader.vue @@ -96,64 +96,7 @@ - - - -
- - Посмотреть историю версий - - Больше не показывать - -
- - - - -
- Стартовала ежегодная акция "Оплатим хостинг вместе".

- - Для оплаты годового хостинга читалки, необходимо собрать около 2000 рублей. - В настоящий момент у автора эта сумма есть в наличии. Однако будет справедливо, если каждый - сможет проголосовать рублем за то, чтобы читалка так и оставалась: - -
    -
  • непрерывно улучшаемой
  • -
  • без рекламы
  • -
  • без регистрации
  • -
  • Open Source
  • -
- - Автор также обращается с просьбой о помощи в распространении - ссылки - - Скопировать - - на читалку через тематические форумы, соцсети, мессенджеры и пр. - Чем нас больше, тем легче оставаться на плаву и тем больше мотивации у разработчика, чтобы продолжать работать над проектом. - -

- Если соберется бóльшая сумма, то разработка децентрализованной библиотеки для свободного обмена книгами будет по возможности ускорена. -

- P.S. При необходимости можно воспользоваться подходящим обменником на bestchange.ru - -

-
- Помочь проекту -
-
- - - Больше не показывать -
- Напомнить позже -
-
- + @@ -178,13 +121,12 @@ import SettingsPage from './SettingsPage/SettingsPage.vue'; import HelpPage from './HelpPage/HelpPage.vue'; import ClickMapPage from './ClickMapPage/ClickMapPage.vue'; import ServerStorage from './ServerStorage/ServerStorage.vue'; -import Dialog from '../share/Dialog.vue'; +import ReaderDialogs from './ReaderDialogs/ReaderDialogs.vue'; import bookManager from './share/bookManager'; import rstore from '../../store/modules/reader'; import readerApi from '../../api/reader'; import * as utils from '../../share/utils'; -import {versionHistory} from './versionHistory'; export default @Component({ components: { @@ -201,7 +143,7 @@ export default @Component({ HelpPage, ClickMapPage, ServerStorage, - Dialog, + ReaderDialogs, }, watch: { bookPos: function(newValue) { @@ -339,8 +281,7 @@ class Reader extends Vue { this.updateRoute(); - await this.showWhatsNew(); - await this.showDonation(); + await this.$refs.dialogs.init(); })(); } @@ -351,8 +292,6 @@ class Reader extends Vue { this.showClickMapPage = settings.showClickMapPage; this.clickControl = settings.clickControl; this.blinkCachedLoad = settings.blinkCachedLoad; - this.showWhatsNewDialog = settings.showWhatsNewDialog; - this.showDonationDialog2020 = settings.showDonationDialog2020; this.showToolButton = settings.showToolButton; this.enableSitesFilter = settings.enableSitesFilter; @@ -416,64 +355,6 @@ class Reader extends Vue { } } - async showWhatsNew() { - await utils.sleep(2000); - - const whatsNew = versionHistory[0]; - if (this.showWhatsNewDialog && - whatsNew.showUntil >= utils.formatDate(new Date(), 'coDate') && - whatsNew.header != this.whatsNewContentHash) { - this.whatsNewContent = 'Версия ' + whatsNew.header + whatsNew.content; - this.whatsNewVisible = true; - } - } - - async showDonation() { - await utils.sleep(3000); - const today = utils.formatDate(new Date(), 'coDate'); - - if ((this.mode == 'omnireader' || this.mode == 'liberama.top') && today < '2020-03-01' && this.showDonationDialog2020 && this.donationRemindDate != today) { - this.donationVisible = true; - } - } - - donationDialogDisable() { - this.donationVisible = false; - if (this.showDonationDialog2020) { - const newSettings = Object.assign({}, this.settings, { showDonationDialog2020: false }); - this.commit('reader/setSettings', newSettings); - } - } - - donationDialogRemind() { - this.donationVisible = false; - this.commit('reader/setDonationRemindDate', utils.formatDate(new Date(), 'coDate')); - } - - openDonate() { - this.donationVisible = false; - this.donateToggle(); - } - - async copyLink(link) { - const result = await utils.copyTextToClipboard(link); - if (result) - this.$root.notify.success(`Ссылка ${link} успешно скопирована в буфер обмена`); - else - this.$root.notify.error('Копирование не удалось'); - } - - openVersionHistory() { - this.whatsNewVisible = false; - this.versionHistoryToggle(); - } - - whatsNewDisable() { - this.whatsNewVisible = false; - const whatsNew = versionHistory[0]; - this.commit('reader/setWhatsNewContentHash', whatsNew.header); - } - get routeParamPos() { let result = undefined; const q = this.$route.query; @@ -577,14 +458,6 @@ class Reader extends Vue { return this.$store.state.reader.settings; } - get whatsNewContentHash() { - return this.$store.state.reader.whatsNewContentHash; - } - - get donationRemindDate() { - return this.$store.state.reader.donationRemindDate; - } - addAction(pos) { let a = this.actionList; if (!a.length || a[a.length - 1] != pos) { @@ -1228,9 +1101,12 @@ class Reader extends Vue { keyHook(event) { let result = false; if (this.$root.rootRoute() == '/reader') { - if (this.$root.stdDialog.active || this.$refs.dialog1.active || this.$refs.dialog2.active) + if (this.$root.stdDialog.active) return result; + if (!result) + result = this.$refs.dialogs.keyHook(event); + if (!result && this.helpActive) result = this.$refs.helpPage.keyHook(event); @@ -1339,16 +1215,4 @@ class Reader extends Vue { .clear { color: rgba(0,0,0,0); } - -.clickable { - color: blue; - text-decoration: underline; - cursor: pointer; -} - -.copy-icon { - cursor: pointer; - font-size: 120%; - color: blue; -} diff --git a/client/components/Reader/ReaderDialogs/ReaderDialogs.vue b/client/components/Reader/ReaderDialogs/ReaderDialogs.vue new file mode 100644 index 00000000..d5356c30 --- /dev/null +++ b/client/components/Reader/ReaderDialogs/ReaderDialogs.vue @@ -0,0 +1,201 @@ + + + + + diff --git a/client/components/Reader/versionHistory.js b/client/components/Reader/versionHistory.js index 85336aff..02038499 100644 --- a/client/components/Reader/versionHistory.js +++ b/client/components/Reader/versionHistory.js @@ -1,4 +1,16 @@ export const versionHistory = [ +{ + showUntil: '2020-11-05', + header: '0.9.6 (2020-11-06)', + content: +` + +` +}, + { showUntil: '2020-10-31', header: '0.9.5 (2020-11-01)',