Added changelog link

This commit is contained in:
benweet 2018-02-15 08:40:20 +00:00
parent c4651fcb3f
commit b4e274df66
10 changed files with 68 additions and 40 deletions

View File

@ -371,18 +371,12 @@ export default {
&:hover, &:hover,
&:focus { &:focus {
background-color: rgba(0, 0, 0, 0.067); background-color: rgba(0, 0, 0, 0.05);
} }
} }
.tabs__tab--active > a { .tabs__tab--active > a {
border-bottom: 2px solid $link-color; border-bottom: 2px solid $link-color;
color: inherit; color: inherit;
cursor: auto;
&:hover,
&:focus {
background-color: transparent;
}
} }
</style> </style>

View File

@ -162,7 +162,7 @@ export default {
.side-bar__info { .side-bar__info {
padding: 10px; padding: 10px;
margin: -10px -10px 0; margin: -10px -10px 10px;
background-color: $info-bg; background-color: $info-bg;
p { p {

View File

@ -122,7 +122,7 @@ textarea {
&:hover, &:hover,
.hidden-file:focus + & { .hidden-file:focus + & {
color: #333; color: #333;
background-color: rgba(0, 0, 0, 0.067); background-color: rgba(0, 0, 0, 0.05);
outline: 0; outline: 0;
text-decoration: none; text-decoration: none;
} }

View File

@ -1,5 +1,9 @@
<template> <template>
<div class="history side-bar__panel"> <div class="history side-bar__panel">
<div class="side-bar__info" v-if="!syncToken">
<p>You have to <a href="javascript:void(0)" @click="signin">sign in with Google</a> to enable revision history.</p>
<p><b>Note:</b> This will sync your main workspace.</p>
</div>
<div class="revision" v-for="revision in revisionsWithSpacer" :key="revision.id"> <div class="revision" v-for="revision in revisionsWithSpacer" :key="revision.id">
<div class="history__spacer" v-if="revision.spacer"></div> <div class="history__spacer" v-if="revision.spacer"></div>
<a class="revision__button button flex flex--row" href="javascript:void(0)" @click="open(revision)"> <a class="revision__button button flex flex--row" href="javascript:void(0)" @click="open(revision)">
@ -20,7 +24,7 @@
</template> </template>
<script> <script>
import { mapMutations } from 'vuex'; import { mapMutations, mapGetters } from 'vuex';
import providerRegistry from '../../services/providers/providerRegistry'; import providerRegistry from '../../services/providers/providerRegistry';
import MenuEntry from './common/MenuEntry'; import MenuEntry from './common/MenuEntry';
import UserImage from '../UserImage'; import UserImage from '../UserImage';
@ -29,6 +33,8 @@ import EditorClassApplier from '../common/EditorClassApplier';
import PreviewClassApplier from '../common/PreviewClassApplier'; import PreviewClassApplier from '../common/PreviewClassApplier';
import utils from '../../services/utils'; import utils from '../../services/utils';
import editorSvc from '../../services/editorSvc'; import editorSvc from '../../services/editorSvc';
import googleHelper from '../../services/providers/helpers/googleHelper';
import syncSvc from '../../services/syncSvc';
let editorClassAppliers = []; let editorClassAppliers = [];
let previewClassAppliers = []; let previewClassAppliers = [];
@ -50,6 +56,9 @@ export default {
showCount: pageSize, showCount: pageSize,
}), }),
computed: { computed: {
...mapGetters('workspace', [
'syncToken',
]),
revisions() { revisions() {
return this.allRevisions.slice(0, this.showCount); return this.allRevisions.slice(0, this.showCount);
}, },
@ -67,11 +76,24 @@ export default {
showMoreButton() { showMoreButton() {
return this.showCount < this.allRevisions.length; return this.showCount < this.allRevisions.length;
}, },
refreshTrigger() {
return utils.serializeObject([
this.$store.getters['file/current'].id,
this.syncToken,
]);
},
}, },
methods: { methods: {
...mapMutations('content', [ ...mapMutations('content', [
'setRevisionContent', 'setRevisionContent',
]), ]),
signin() {
return googleHelper.signin()
.then(
() => syncSvc.requestSync(),
() => {}, // Cancel
);
},
close() { close() {
this.$store.dispatch('data/setSideBarPanel', 'menu'); this.$store.dispatch('data/setSideBarPanel', 'menu');
}, },
@ -82,7 +104,7 @@ export default {
let revisionContentPromise = revisionContentPromises[revision.id]; let revisionContentPromise = revisionContentPromises[revision.id];
if (!revisionContentPromise) { if (!revisionContentPromise) {
revisionContentPromise = new Promise((resolve, reject) => { revisionContentPromise = new Promise((resolve, reject) => {
const syncToken = this.$store.getters['workspace/syncToken']; const syncToken = this.syncToken;
const currentFile = this.$store.getters['file/current']; const currentFile = this.$store.getters['file/current'];
this.$store.dispatch('queue/enqueue', this.$store.dispatch('queue/enqueue',
() => Promise.resolve() () => Promise.resolve()
@ -132,31 +154,34 @@ export default {
// Watch file changes // Watch file changes
this.$watch( this.$watch(
() => this.$store.getters['file/current'].id, () => this.refreshTrigger,
(id) => { () => {
this.allRevisions = []; this.allRevisions = [];
if (id) { const id = this.$store.getters['file/current'].id;
const syncToken = this.syncToken;
if (id && syncToken) {
if (id !== cachedFileId) { if (id !== cachedFileId) {
this.setRevisionContent(); this.setRevisionContent();
cachedFileId = id; cachedFileId = id;
revisionContentPromises = {}; revisionContentPromises = {};
const syncToken = this.$store.getters['workspace/syncToken'];
const currentFile = this.$store.getters['file/current']; const currentFile = this.$store.getters['file/current'];
revisionsPromise = new Promise((resolve, reject) => { revisionsPromise = new Promise((resolve, reject) => {
this.$store.dispatch('queue/enqueue', this.$store.dispatch('queue/enqueue',
() => Promise.resolve() () => Promise.resolve()
.then(() => this.workspaceProvider.listRevisions(syncToken, currentFile.id)) .then(() => this.workspaceProvider.listRevisions(syncToken, currentFile.id))
.then(resolve, reject)); .then(resolve, reject));
}); })
revisionsPromise.catch(() => { .catch(() => {
cachedFileId = null; cachedFileId = null;
return []; return [];
}); });
} }
if (revisionsPromise) {
revisionsPromise.then((revisions) => { revisionsPromise.then((revisions) => {
this.allRevisions = revisions; this.allRevisions = revisions;
}); });
} }
}
}, { immediate: true }); }, { immediate: true });
const loadOne = () => { const loadOne = () => {
@ -166,7 +191,7 @@ export default {
let loadPromise; let loadPromise;
this.revisions.some((revision) => { this.revisions.some((revision) => {
if (!revision.created) { if (!revision.created) {
const syncToken = this.$store.getters['workspace/syncToken']; const syncToken = this.syncToken;
const currentFile = this.$store.getters['file/current']; const currentFile = this.$store.getters['file/current'];
loadPromise = this.workspaceProvider loadPromise = this.workspaceProvider
.loadRevision(syncToken, currentFile.id, revision) .loadRevision(syncToken, currentFile.id, revision)

View File

@ -41,7 +41,7 @@
<div>Publish</div> <div>Publish</div>
<span>Export your files to the web.</span> <span>Export your files to the web.</span>
</menu-entry> </menu-entry>
<menu-entry @click.native="history"> <menu-entry @click.native="setPanel('history')">
<icon-history slot="icon"></icon-history> <icon-history slot="icon"></icon-history>
<div>File history</div> <div>File history</div>
<span>Track and restore file revisions.</span> <span>Track and restore file revisions.</span>
@ -114,17 +114,6 @@ export default {
return this.$store.dispatch('modal/open', 'fileProperties') return this.$store.dispatch('modal/open', 'fileProperties')
.catch(() => {}); // Cancel .catch(() => {}); // Cancel
}, },
history() {
if (!this.syncToken) {
this.$store.dispatch('modal/signInForHistory', {
onResolve: () => googleHelper.signin()
.then(() => syncSvc.requestSync()),
})
.catch(() => { }); // Cancel
} else {
this.setPanel('history');
}
},
print() { print() {
print(); print();
}, },

View File

@ -1,5 +1,8 @@
<template> <template>
<div class="side-bar__panel side-bar__panel--menu"> <div class="side-bar__panel side-bar__panel--menu">
<div class="side-bar__info" v-if="noToken">
<p>You have to <b>link an account</b> to start publishing files.</p>
</div>
<div class="side-bar__info" v-if="publishLocations.length"> <div class="side-bar__info" v-if="publishLocations.length">
<p><b>{{currentFileName}}</b> is already published.</p> <p><b>{{currentFileName}}</b> is already published.</p>
<menu-entry @click.native="requestPublish"> <menu-entry @click.native="requestPublish">
@ -147,6 +150,14 @@ export default {
zendeskTokens() { zendeskTokens() {
return tokensToArray(this.$store.getters['data/zendeskTokens']); return tokensToArray(this.$store.getters['data/zendeskTokens']);
}, },
noToken() {
return !this.googleDriveTokens.length
&& !this.dropboxTokens.length
&& !this.githubTokens.length
&& !this.wordpressTokens.length
&& !this.bloggerTokens.length
&& !this.zendeskTokens.length;
},
}, },
methods: { methods: {
requestPublish() { requestPublish() {

View File

@ -1,5 +1,8 @@
<template> <template>
<div class="side-bar__panel side-bar__panel--menu"> <div class="side-bar__panel side-bar__panel--menu">
<div class="side-bar__info" v-if="noToken">
<p>You have to <b>link an account</b> to start syncing files.</p>
</div>
<div class="side-bar__info" v-if="syncLocations.length"> <div class="side-bar__info" v-if="syncLocations.length">
<p><b>{{currentFileName}}</b> is already synchronized.</p> <p><b>{{currentFileName}}</b> is already synchronized.</p>
<menu-entry v-if="isSyncPossible" @click.native="requestSync"> <menu-entry v-if="isSyncPossible" @click.native="requestSync">
@ -128,6 +131,11 @@ export default {
githubTokens() { githubTokens() {
return tokensToArray(this.$store.getters['data/githubTokens']); return tokensToArray(this.$store.getters['data/githubTokens']);
}, },
noToken() {
return !this.googleDriveTokens.length
&& !this.dropboxTokens.length
&& !this.githubTokens.length;
},
}, },
methods: { methods: {
requestSync() { requestSync() {

View File

@ -4,14 +4,15 @@
<div class="logo-background"></div> <div class="logo-background"></div>
<small>v{{version}} © 2018 Benoit Schweblin</small> <small>v{{version}} © 2018 Benoit Schweblin</small>
<hr> <hr>
<a target="_blank" href="https://github.com/benweet/stackedit/">GitHub repo</a> StackEdit on <a target="_blank" href="https://github.com/benweet/stackedit/">GitHub</a>
<a target="_blank" href="https://github.com/benweet/stackedit/issues">issue tracker</a>
<br> <br>
<a target="_blank" href="https://community.stackedit.io/">Community</a> <a target="_blank" href="https://github.com/benweet/stackedit/issues">Issue tracker</a> <a target="_blank" href="https://github.com/benweet/stackedit/blob/master/CHANGELOG.md">Changelog</a>
<br> <br>
<a target="_blank" href="https://chrome.google.com/webstore/detail/stackedit/iiooodelglhkcpgbajoejffhijaclcdg">Chrome app</a> thanks for your review! <a target="_blank" href="https://chrome.google.com/webstore/detail/stackedit/iiooodelglhkcpgbajoejffhijaclcdg">Chrome app</a> thanks for your review!
<br> <br>
StackEdit on <a target="_blank" href="https://twitter.com/stackedit/">Twitter</a> StackEdit on <a target="_blank" href="https://twitter.com/stackedit/">Twitter</a>
<br>
<a target="_blank" href="https://community.stackedit.io/">Community</a>
<hr> <hr>
<h3>FAQ</h3> <h3>FAQ</h3>
<div class="faq" v-html="faq"></div> <div class="faq" v-html="faq"></div>

View File

@ -5,7 +5,7 @@
<icon-close></icon-close> <icon-close></icon-close>
</button> </button>
<div class="modal__sponsor-button" v-if="showSponsorButton"> <div class="modal__sponsor-button" v-if="showSponsorButton">
StackEdit is open source! Please consider StackEdit is <a class="not-tabbable" target="_blank" href="https://github.com/benweet/stackedit/">open source</a>. Please consider
<a class="not-tabbable" href="javascript:void(0)" @click="sponsor">sponsoring</a> for just $5. <a class="not-tabbable" href="javascript:void(0)" @click="sponsor">sponsoring</a> for just $5.
</div> </div>
<slot></slot> <slot></slot>

View File

@ -62,7 +62,7 @@
.button:focus, .button:focus,
.button:hover { .button:hover {
color: #333; color: #333;
background-color: rgba(0, 0, 0, 0.067); background-color: rgba(0, 0, 0, 0.05);
outline: 0; outline: 0;
text-decoration: none; text-decoration: none;
} }