Ver código fonte

В справку добавлена история версий проекта

Book Pauk 6 anos atrás
pai
commit
b51a09efcc

+ 9 - 0
client/components/Reader/HelpPage/HelpPage.vue

@@ -16,6 +16,9 @@
                     <el-tab-pane label="Мышь/тачпад">
                         <MouseHelpPage></MouseHelpPage>
                     </el-tab-pane>
+                    <el-tab-pane label="История версий" name="releases">
+                        <VersionHistoryPage></VersionHistoryPage>
+                    </el-tab-pane>
                     <el-tab-pane label="Помочь проекту" name="donate">
                         <DonateHelpPage></DonateHelpPage>
                     </el-tab-pane>
@@ -36,6 +39,7 @@ import CommonHelpPage from './CommonHelpPage/CommonHelpPage.vue';
 import HotkeysHelpPage from './HotkeysHelpPage/HotkeysHelpPage.vue';
 import MouseHelpPage from './MouseHelpPage/MouseHelpPage.vue';
 import DonateHelpPage from './DonateHelpPage/DonateHelpPage.vue';
+import VersionHistoryPage from './VersionHistoryPage/VersionHistoryPage.vue';
 
 export default @Component({
     components: {
@@ -44,6 +48,7 @@ export default @Component({
         HotkeysHelpPage,
         MouseHelpPage,
         DonateHelpPage,
+        VersionHistoryPage,
     },
 })
 class HelpPage extends Vue {
@@ -57,6 +62,10 @@ class HelpPage extends Vue {
         this.selectedTab = 'donate';
     }
 
+    activateVersionHistoryHelpPage() {
+        this.selectedTab = 'releases';
+    }
+
     keyHook(event) {
         if (event.type == 'keydown' && (event.code == 'Escape')) {
             this.close();

+ 81 - 0
client/components/Reader/HelpPage/VersionHistoryPage/VersionHistoryPage.vue

@@ -0,0 +1,81 @@
+<template>
+    <div id="versionHistoryPage" class="page">
+        <span class="clickable" v-for="item in versionHeader" :key="item" @click="showRelease(item)">
+            <p>
+            {{ item }}
+            </p>
+        </span>
+
+        <br>
+        <h4>История версий:</h4>
+        <br>
+
+        <div v-for="item in versionContent" :id="item.key" :key="item.key">
+            <span v-html="item.content"></span>
+            <br>
+        </div>
+    </div>
+</template>
+
+<script>
+//-----------------------------------------------------------------------------
+import Vue from 'vue';
+import Component from 'vue-class-component';
+import {versionHistory} from '../../versionHistory';
+
+export default @Component({
+})
+class VersionHistoryPage extends Vue {
+    versionHeader = [];
+    versionContent = [];
+
+    created() {
+    }
+
+    mounted() {
+        let vh = [];
+        for (const version of versionHistory) {
+            vh.push(version.header);
+        }
+        this.versionHeader = vh;
+
+        let vc = [];
+        for (const version of versionHistory) {
+            vc.push({key: version.header, content: 'Версия ' + version.header + version.content});
+        }
+        this.versionContent = vc;
+    }
+
+    showRelease(id) {
+        let el = document.getElementById(id);
+        if (el) {
+            document.getElementById('versionHistoryPage').scrollTop = el.offsetTop;
+        }
+    }
+}
+//-----------------------------------------------------------------------------
+</script>
+
+<style scoped>
+.page {
+    flex: 1;
+    padding: 15px;
+    overflow-y: auto;
+    font-size: 120%;
+    line-height: 130%;
+}
+
+h4 {
+    margin: 0;
+}
+
+p {
+    line-height: 15px;
+}
+
+.clickable {
+    color: blue;
+    text-decoration: underline;
+    cursor: pointer;
+}
+</style>

+ 16 - 2
client/components/Reader/Reader.vue

@@ -249,6 +249,7 @@ class Reader extends Vue {
             }
 
             this.checkSetStorageAccessKey();
+            this.checkActivateDonateHelpPage();
             this.loading = false;
 
             await this.showWhatsNew();
@@ -279,14 +280,27 @@ class Reader extends Vue {
         }
     }
 
+    checkActivateDonateHelpPage() {
+        const q = this.$route.query;
+
+        if (q['donate']) {
+            this.$router.replace(`/reader`);
+            this.helpToggle();
+            this.$nextTick(() => {
+                this.$refs.helpPage.activateDonateHelpPage();
+            });
+        }
+    }
+
     async showWhatsNew() {
         await utils.sleep(2000);
 
         const whatsNew = versionHistory[0];
+        const content = 'Версия ' + whatsNew.header + whatsNew.content;
         if (this.showWhatsNewDialog &&
             whatsNew.showUntil >= utils.formatDate(new Date(), 'coDate') &&
-            utils.stringToHex(cryptoUtils.sha256(whatsNew.content)) != this.whatsNewContentHash) {
-            this.whatsNewContent = whatsNew.content;
+            utils.stringToHex(cryptoUtils.sha256(content)) != this.whatsNewContentHash) {
+            this.whatsNewContent = content;
             this.whatsNewVisible = true;
         }
     }

+ 9 - 8
client/components/Reader/versionHistory.js

@@ -1,11 +1,12 @@
 export const versionHistory = [
 {
-    showUntil: '2019-05-05',
+    showUntil: '2019-06-05',
+    header: '0.6.7 (2019-)',
     content:
 `
-Версия 0.6.7 (2019-05-01)
 <ul>
     <li>добавлен диалог "Что нового"</li>
+    <li>в справку добавлена история версий проекта</li>
     <li>добавлена возможность настройки отображаемых кнопок на панели управления</li>
     <li>исправления багов и недочетов</li>
 </ul>
@@ -14,9 +15,9 @@ export const versionHistory = [
 
 {
     showUntil: '2019-03-29',
+    header: '0.6.6 (2019-03-29)',
     content:
 `
-Версия 0.6.6 (2019-03-29)
 <ul>
     <li>в справку добавлено описание настройки браузеров для автономной работы читалки (без доступа к интернету)</li>
     <li>оптимизации процесса синхронизации, внутренние переделки</li>
@@ -26,9 +27,9 @@ export const versionHistory = [
 
 {
     showUntil: '2019-03-24',
+    header: '0.6.4 (2019-03-24)',
     content:
 `
-Версия 0.6.4 (2019-03-24)
 <ul>
     <li>исправления багов, оптимизации</li>
     <li>добавлена возможность синхронизации данных между устройствами</li>
@@ -38,9 +39,9 @@ export const versionHistory = [
 
 {
     showUntil: '2019-03-04',
+    header: '0.5.4 (2019-03-04)',
     content:
 `
-Версия 0.5.4 (2019-03-04)
 <ul>
     <li>добавлена поддержка форматов pdf, epub, mobi</li>
     <li>(0.5.2) добавлена поддержка форматов rtf, doc, docx</li>
@@ -52,9 +53,9 @@ export const versionHistory = [
 
 {
     showUntil: '2019-02-17',
+    header: '0.3.0 (2019-02-17)',
     content:
 `
-Версия 0.3.0 (2019-02-17)
 <ul>
     <li>поправки багов</li>
     <li>улучшено распознавание текста</li>
@@ -65,9 +66,9 @@ export const versionHistory = [
 
 {
     showUntil: '2019-02-14',
+    header: '0.1.7 (2019-02-14)',
     content:
 `
-Версия 0.1.7 (2019-02-14)
 <ul>
     <li>увеличены верхние границы отступов и др.размеров</li>
     <li>добавлена настройка для удаления/вставки пустых параграфов</li>
@@ -80,9 +81,9 @@ export const versionHistory = [
 
 {
     showUntil: '2019-02-12',
+    header: '0.1.0 (2019-02-12)',
     content:
 `
-Версия 0.1.0 (2019-02-12)
 <ul>
     <li>первый деплой проекта, длительность разработки - 2 месяца</li>
 </ul>