2017-07-23 18:42:08 +00:00
|
|
|
<template>
|
2017-08-04 08:20:50 +00:00
|
|
|
<div class="side-bar flex flex--column">
|
2017-08-06 00:58:39 +00:00
|
|
|
<div class="side-title flex flex--row">
|
2017-10-07 11:22:24 +00:00
|
|
|
<button v-if="panel !== 'menu'" class="side-title__button button" @click="setPanel('menu')" v-title="'Main menu'">
|
2017-08-06 00:58:39 +00:00
|
|
|
<icon-arrow-left></icon-arrow-left>
|
|
|
|
</button>
|
|
|
|
<div class="side-title__title">
|
|
|
|
{{panelName}}
|
2017-08-04 08:20:50 +00:00
|
|
|
</div>
|
2017-10-07 11:22:24 +00:00
|
|
|
<button class="side-title__button button" @click="toggleSideBar(false)" v-title="'Close side bar'">
|
2017-08-04 08:20:50 +00:00
|
|
|
<icon-close></icon-close>
|
|
|
|
</button>
|
|
|
|
</div>
|
2017-08-04 20:46:06 +00:00
|
|
|
<div class="side-bar__inner">
|
2017-09-23 19:01:50 +00:00
|
|
|
<main-menu v-if="panel === 'menu'"></main-menu>
|
2017-12-10 23:49:20 +00:00
|
|
|
<workspaces-menu v-if="panel === 'workspaces'"></workspaces-menu>
|
2017-09-23 19:01:50 +00:00
|
|
|
<sync-menu v-else-if="panel === 'sync'"></sync-menu>
|
|
|
|
<publish-menu v-else-if="panel === 'publish'"></publish-menu>
|
2017-11-26 20:58:24 +00:00
|
|
|
<history-menu v-else-if="panel === 'history'"></history-menu>
|
2017-09-23 19:01:50 +00:00
|
|
|
<export-menu v-else-if="panel === 'export'"></export-menu>
|
2018-02-13 23:04:54 +00:00
|
|
|
<import-menu v-else-if="panel === 'import'"></import-menu>
|
2017-09-23 19:01:50 +00:00
|
|
|
<more-menu v-else-if="panel === 'more'"></more-menu>
|
2017-08-06 00:58:39 +00:00
|
|
|
<div v-else-if="panel === 'help'" class="side-bar__panel side-bar__panel--help">
|
|
|
|
<pre class="markdown-highlighting" v-html="markdownSample"></pre>
|
2017-08-04 20:46:06 +00:00
|
|
|
</div>
|
|
|
|
<div class="side-bar__panel side-bar__panel--toc" :class="{'side-bar__panel--hidden': panel !== 'toc'}">
|
|
|
|
<toc>
|
|
|
|
</toc>
|
|
|
|
</div>
|
2017-08-04 08:20:50 +00:00
|
|
|
</div>
|
2017-07-23 18:42:08 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2017-09-23 19:01:50 +00:00
|
|
|
import { mapActions } from 'vuex';
|
2017-07-23 18:42:08 +00:00
|
|
|
import Toc from './Toc';
|
2017-09-23 19:01:50 +00:00
|
|
|
import MainMenu from './menus/MainMenu';
|
2017-12-10 23:49:20 +00:00
|
|
|
import WorkspacesMenu from './menus/WorkspacesMenu';
|
2017-09-23 19:01:50 +00:00
|
|
|
import SyncMenu from './menus/SyncMenu';
|
|
|
|
import PublishMenu from './menus/PublishMenu';
|
2017-11-26 20:58:24 +00:00
|
|
|
import HistoryMenu from './menus/HistoryMenu';
|
2017-09-23 19:01:50 +00:00
|
|
|
import ExportMenu from './menus/ExportMenu';
|
2018-02-13 23:04:54 +00:00
|
|
|
import ImportMenu from './menus/ImportMenu';
|
2017-09-23 19:01:50 +00:00
|
|
|
import MoreMenu from './menus/MoreMenu';
|
2017-08-06 00:58:39 +00:00
|
|
|
import markdownSample from '../data/markdownSample.md';
|
|
|
|
import markdownConversionSvc from '../services/markdownConversionSvc';
|
2017-08-04 20:46:06 +00:00
|
|
|
|
|
|
|
const panelNames = {
|
|
|
|
menu: 'Menu',
|
2017-12-10 23:49:20 +00:00
|
|
|
workspaces: 'Workspaces',
|
2017-08-06 00:58:39 +00:00
|
|
|
help: 'Markdown cheat sheet',
|
|
|
|
toc: 'Table of contents',
|
2017-09-17 15:32:39 +00:00
|
|
|
sync: 'Synchronize',
|
|
|
|
publish: 'Publish',
|
2017-11-26 20:58:24 +00:00
|
|
|
history: 'File history',
|
2017-09-17 15:32:39 +00:00
|
|
|
export: 'Export to disk',
|
2018-02-13 23:04:54 +00:00
|
|
|
import: 'Import from disk',
|
2017-09-17 15:32:39 +00:00
|
|
|
more: 'More',
|
2017-08-04 20:46:06 +00:00
|
|
|
};
|
2017-07-23 18:42:08 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
Toc,
|
2017-09-23 19:01:50 +00:00
|
|
|
MainMenu,
|
2017-12-10 23:49:20 +00:00
|
|
|
WorkspacesMenu,
|
2017-09-23 19:01:50 +00:00
|
|
|
SyncMenu,
|
|
|
|
PublishMenu,
|
2017-11-26 20:58:24 +00:00
|
|
|
HistoryMenu,
|
2017-09-23 19:01:50 +00:00
|
|
|
ExportMenu,
|
2018-02-13 23:04:54 +00:00
|
|
|
ImportMenu,
|
2017-09-23 19:01:50 +00:00
|
|
|
MoreMenu,
|
2017-08-04 20:46:06 +00:00
|
|
|
},
|
|
|
|
data: () => ({
|
2017-08-06 00:58:39 +00:00
|
|
|
markdownSample: markdownConversionSvc.highlight(markdownSample),
|
2017-08-04 20:46:06 +00:00
|
|
|
}),
|
|
|
|
computed: {
|
2017-09-17 15:32:39 +00:00
|
|
|
panel() {
|
2018-03-30 12:44:23 +00:00
|
|
|
return !this.$store.state.light && this.$store.getters['data/layoutSettings'].sideBarPanel;
|
2017-09-17 15:32:39 +00:00
|
|
|
},
|
2017-08-04 20:46:06 +00:00
|
|
|
panelName() {
|
|
|
|
return panelNames[this.panel];
|
|
|
|
},
|
2017-07-23 18:42:08 +00:00
|
|
|
},
|
2017-08-04 08:20:50 +00:00
|
|
|
methods: {
|
|
|
|
...mapActions('data', [
|
|
|
|
'toggleSideBar',
|
|
|
|
]),
|
2017-09-17 15:32:39 +00:00
|
|
|
...mapActions('data', {
|
|
|
|
setPanel: 'setSideBarPanel',
|
|
|
|
}),
|
2017-08-04 08:20:50 +00:00
|
|
|
},
|
2017-07-23 18:42:08 +00:00
|
|
|
};
|
|
|
|
</script>
|
2017-08-04 08:20:50 +00:00
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
@import 'common/variables.scss';
|
|
|
|
|
|
|
|
.side-bar {
|
|
|
|
overflow: hidden;
|
2017-08-04 20:46:06 +00:00
|
|
|
height: 100%;
|
2017-08-25 10:37:46 +00:00
|
|
|
|
|
|
|
hr {
|
2017-10-02 22:48:01 +00:00
|
|
|
margin: 10px 40px;
|
2017-09-23 19:01:50 +00:00
|
|
|
display: none;
|
2017-11-26 20:58:24 +00:00
|
|
|
border-top: 1px solid $hr-color;
|
2017-09-23 19:01:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
* + hr {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
|
|
|
hr + hr {
|
|
|
|
display: none;
|
2017-08-25 10:37:46 +00:00
|
|
|
}
|
2017-08-04 20:46:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.side-bar__inner {
|
2017-08-06 00:58:39 +00:00
|
|
|
position: relative;
|
2017-08-04 20:46:06 +00:00
|
|
|
height: 100%;
|
2017-08-04 08:20:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.side-bar__panel {
|
|
|
|
position: absolute;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
2017-08-06 00:58:39 +00:00
|
|
|
overflow: auto;
|
2017-12-23 18:25:14 +00:00
|
|
|
|
|
|
|
&::after {
|
|
|
|
content: '';
|
|
|
|
display: block;
|
|
|
|
height: 40px;
|
|
|
|
}
|
2017-08-04 08:20:50 +00:00
|
|
|
}
|
|
|
|
|
2017-08-04 20:46:06 +00:00
|
|
|
.side-bar__panel--hidden {
|
2017-08-04 08:20:50 +00:00
|
|
|
left: 1000px;
|
|
|
|
}
|
2017-08-06 00:58:39 +00:00
|
|
|
|
2017-08-15 10:43:26 +00:00
|
|
|
.side-bar__panel--menu {
|
2017-12-23 18:25:14 +00:00
|
|
|
padding: 10px;
|
2017-08-15 10:43:26 +00:00
|
|
|
}
|
|
|
|
|
2017-08-06 00:58:39 +00:00
|
|
|
.side-bar__panel--help {
|
2017-12-23 18:25:14 +00:00
|
|
|
padding: 0 10px 0 20px;
|
2017-08-06 00:58:39 +00:00
|
|
|
|
|
|
|
pre {
|
|
|
|
font-size: 0.9em;
|
|
|
|
font-variant-ligatures: no-common-ligatures;
|
|
|
|
line-height: 1.25;
|
|
|
|
white-space: pre-wrap;
|
|
|
|
word-break: break-word;
|
|
|
|
word-wrap: break-word;
|
|
|
|
}
|
|
|
|
|
|
|
|
.code,
|
|
|
|
.img,
|
|
|
|
.imgref,
|
|
|
|
.cl-toc {
|
|
|
|
background-color: rgba(0, 0, 0, 0.05);
|
|
|
|
}
|
|
|
|
}
|
2017-09-23 19:01:50 +00:00
|
|
|
|
2017-10-05 07:18:21 +00:00
|
|
|
.side-bar__info {
|
2017-09-23 19:01:50 +00:00
|
|
|
padding: 10px;
|
2018-02-15 08:40:20 +00:00
|
|
|
margin: -10px -10px 10px;
|
2017-10-05 07:18:21 +00:00
|
|
|
background-color: $info-bg;
|
2017-09-23 19:01:50 +00:00
|
|
|
|
|
|
|
p {
|
|
|
|
margin: 10px;
|
|
|
|
line-height: 1.4;
|
|
|
|
}
|
|
|
|
}
|
2017-08-04 08:20:50 +00:00
|
|
|
</style>
|