diff --git a/client/components/Reader/Reader.vue b/client/components/Reader/Reader.vue index 0bfb350b..9fff27ab 100644 --- a/client/components/Reader/Reader.vue +++ b/client/components/Reader/Reader.vue @@ -87,6 +87,87 @@ + +
+ Появилась httpS-версия сайта по адресу https://omnireader.ru
+ Работа по httpS-протоколу, помимо безопасности соединения, позволяет воспользоваться всеми возможностями + современных браузеров, а именно, применительно к нашему ресурсу: + + + + Для того, чтобы перейти на новую версию с сохранением настроек и читаемых книг необходимо сделать следующее: + + + + Старая http-версия сайта будет доступна до конца 2019 года.
+ Приносим извинения за доставленные неудобства. +
+ + + Больше не показывать + Напомнить позже + +
+ + +
+ Информация для пользователей старой версии читалки по адресу http://omnireader.ru
+ Для того, чтобы перейти на новую httpS-версию с сохранением настроек и читаемых книг необходимо сделать следующее: + + + + Старая http-версия сайта будет доступна до конца 2019 года.
+ Приносим извинения за доставленные неудобства. +
+ + + Больше не показывать + Напомнить позже + +
+ @@ -192,6 +273,8 @@ class Reader extends Vue { whatsNewVisible = false; whatsNewContent = ''; + migrationVisible1 = false; + migrationVisible2 = false; created() { this.loading = true; @@ -265,6 +348,7 @@ class Reader extends Vue { this.loading = false; await this.showWhatsNew(); + await this.showMigration(); })(); } @@ -276,6 +360,7 @@ class Reader extends Vue { this.clickControl = settings.clickControl; this.blinkCachedLoad = settings.blinkCachedLoad; this.showWhatsNewDialog = settings.showWhatsNewDialog; + this.showMigrationDialog = settings.showMigrationDialog; this.showToolButton = settings.showToolButton; this.updateHeaderMinWidth(); @@ -340,6 +425,33 @@ class Reader extends Vue { } } + async showMigration() { + await utils.sleep(3000); + if (!this.settingsActive && + this.mode == 'omnireader' && this.showMigrationDialog && this.migrationRemindDate != utils.formatDate(new Date(), 'coDate')) { + if (window.location.protocol == 'http:') { + this.migrationVisible1 = true; + } else if (window.location.protocol == 'https:') { + this.migrationVisible2 = true; + } + } + } + + migrationDialogDisable() { + this.migrationVisible1 = false; + this.migrationVisible2 = false; + if (this.showMigrationDialog) { + const newSettings = Object.assign({}, this.settings, { showMigrationDialog: false }); + this.commit('reader/setSettings', newSettings); + } + } + + migrationDialogRemind() { + this.migrationVisible1 = false; + this.migrationVisible2 = false; + this.commit('reader/setMigrationRemindDate', utils.formatDate(new Date(), 'coDate')); + } + openVersionHistory() { this.whatsNewVisible = false; this.versionHistoryToggle(); @@ -376,6 +488,10 @@ class Reader extends Vue { } + get mode() { + return this.$store.state.config.mode; + } + get routeParamUrl() { let result = ''; const path = this.$route.fullPath; @@ -456,6 +572,10 @@ class Reader extends Vue { return this.$store.state.reader.whatsNewContentHash; } + get migrationRemindDate() { + return this.$store.state.reader.migrationRemindDate; + } + addAction(pos) { let a = this.actionList; if (!a.length || a[a.length - 1] != pos) { diff --git a/client/components/Reader/SettingsPage/SettingsPage.vue b/client/components/Reader/SettingsPage/SettingsPage.vue index 9e446687..64edc202 100644 --- a/client/components/Reader/SettingsPage/SettingsPage.vue +++ b/client/components/Reader/SettingsPage/SettingsPage.vue @@ -458,6 +458,14 @@ Показывать уведомление "Что нового" + + + + Уведомлять о переходе на httpS-версию + + @@ -645,7 +653,7 @@ class SettingsPage extends Vue { } get setStorageKeyLink() { - return `http://${window.location.host}/#/reader?setStorageAccessKey=${utils.toBase58(this.serverStorageKey)}`; + return `https://${window.location.host}/#/reader?setStorageAccessKey=${utils.toBase58(this.serverStorageKey)}`; } get predefineTextColors() { diff --git a/client/components/Reader/versionHistory.js b/client/components/Reader/versionHistory.js index e3ec6321..b7cbbd41 100644 --- a/client/components/Reader/versionHistory.js +++ b/client/components/Reader/versionHistory.js @@ -1,13 +1,15 @@ export const versionHistory = [ { - showUntil: '2019-08-10', + showUntil: '2019-09-10', header: '0.7.0 (2019-08-??)', content: ` ` diff --git a/client/store/modules/reader.js b/client/store/modules/reader.js index 683c57bd..620c5152 100644 --- a/client/store/modules/reader.js +++ b/client/store/modules/reader.js @@ -181,6 +181,7 @@ const settingDefaults = { imageFitWidth: true, showServerStorageMessages: true, showWhatsNewDialog: true, + showMigrationDialog: true, fontShifts: {}, showToolButton: {}, @@ -202,6 +203,7 @@ const state = { profilesRev: 0, allowProfilesSave: false,//подстраховка для разработки whatsNewContentHash: '', + migrationRemindDate: '', currentProfile: '', settings: Object.assign({}, settingDefaults), settingsRev: {}, @@ -236,6 +238,9 @@ const mutations = { setWhatsNewContentHash(state, value) { state.whatsNewContentHash = value; }, + setMigrationRemindDate(state, value) { + state.migrationRemindDate = value; + }, setCurrentProfile(state, value) { state.currentProfile = value; },