2018-06-05 14:36:21 +02:00
|
|
|
<template>
|
|
|
|
<mk-ui :class="$style.root">
|
2018-06-05 21:00:48 +02:00
|
|
|
<div class="qlvquzbjribqcaozciifydkngcwtyzje" :data-darkmode="$store.state.device.darkmode">
|
2018-06-05 20:12:06 +02:00
|
|
|
<template v-for="column in columns">
|
2018-06-06 12:22:45 +02:00
|
|
|
<x-widgets-column v-if="column.type == 'widgets'" :key="column.id" :column="column"/>
|
2018-06-05 22:18:08 +02:00
|
|
|
<x-notifications-column v-if="column.type == 'notifications'" :key="column.id" :id="column.id"/>
|
|
|
|
<x-tl-column v-if="column.type == 'home'" :key="column.id" :column="column"/>
|
|
|
|
<x-tl-column v-if="column.type == 'local'" :key="column.id" :column="column"/>
|
|
|
|
<x-tl-column v-if="column.type == 'global'" :key="column.id" :column="column"/>
|
|
|
|
<x-tl-column v-if="column.type == 'list'" :key="column.id" :column="column"/>
|
2018-06-05 20:12:06 +02:00
|
|
|
</template>
|
2018-06-06 18:17:29 +02:00
|
|
|
<button ref="add" @click="add" title="%i18n:common.deck.add-column%">%fa:plus%</button>
|
2018-06-05 14:36:21 +02:00
|
|
|
</div>
|
|
|
|
</mk-ui>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
2018-06-05 15:54:03 +02:00
|
|
|
import XTlColumn from './deck.tl-column.vue';
|
2018-06-05 16:19:04 +02:00
|
|
|
import XNotificationsColumn from './deck.notifications-column.vue';
|
2018-06-06 12:22:45 +02:00
|
|
|
import XWidgetsColumn from './deck.widgets-column.vue';
|
2018-06-05 22:18:08 +02:00
|
|
|
import Menu from '../../../../common/views/components/menu.vue';
|
|
|
|
import MkUserListsWindow from '../../components/user-lists-window.vue';
|
2018-06-05 20:12:06 +02:00
|
|
|
import * as uuid from 'uuid';
|
2018-06-05 14:36:21 +02:00
|
|
|
|
|
|
|
export default Vue.extend({
|
|
|
|
components: {
|
2018-06-05 16:19:04 +02:00
|
|
|
XTlColumn,
|
2018-06-06 12:22:45 +02:00
|
|
|
XNotificationsColumn,
|
|
|
|
XWidgetsColumn
|
2018-06-05 20:12:06 +02:00
|
|
|
},
|
2018-06-06 18:00:38 +02:00
|
|
|
|
2018-06-05 20:12:06 +02:00
|
|
|
computed: {
|
|
|
|
columns() {
|
|
|
|
if (this.$store.state.settings.deck == null) return [];
|
|
|
|
return this.$store.state.settings.deck.columns;
|
|
|
|
}
|
|
|
|
},
|
2018-06-06 18:00:38 +02:00
|
|
|
|
2018-06-05 20:12:06 +02:00
|
|
|
created() {
|
|
|
|
if (this.$store.state.settings.deck == null) {
|
|
|
|
const deck = {
|
|
|
|
columns: [/*{
|
|
|
|
type: 'widgets',
|
|
|
|
widgets: []
|
|
|
|
}, */{
|
|
|
|
id: uuid(),
|
|
|
|
type: 'home'
|
|
|
|
}, {
|
|
|
|
id: uuid(),
|
|
|
|
type: 'notifications'
|
|
|
|
}, {
|
|
|
|
id: uuid(),
|
|
|
|
type: 'local'
|
|
|
|
}, {
|
|
|
|
id: uuid(),
|
|
|
|
type: 'global'
|
|
|
|
}]
|
|
|
|
};
|
|
|
|
|
|
|
|
this.$store.dispatch('settings/set', {
|
|
|
|
key: 'deck',
|
|
|
|
value: deck
|
|
|
|
});
|
|
|
|
}
|
2018-06-05 22:18:08 +02:00
|
|
|
},
|
|
|
|
|
2018-06-06 18:00:38 +02:00
|
|
|
mounted() {
|
|
|
|
document.documentElement.style.overflow = 'hidden';
|
|
|
|
},
|
|
|
|
|
|
|
|
beforeDestroy() {
|
|
|
|
document.documentElement.style.overflow = 'auto';
|
|
|
|
},
|
|
|
|
|
2018-06-05 22:18:08 +02:00
|
|
|
methods: {
|
|
|
|
add() {
|
|
|
|
this.os.new(Menu, {
|
|
|
|
source: this.$refs.add,
|
|
|
|
compact: true,
|
|
|
|
items: [{
|
2018-06-06 18:17:29 +02:00
|
|
|
content: '%i18n:common.deck.home%',
|
2018-06-05 22:18:08 +02:00
|
|
|
onClick: () => {
|
|
|
|
this.$store.dispatch('settings/addDeckColumn', {
|
|
|
|
id: uuid(),
|
|
|
|
type: 'home'
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}, {
|
2018-06-06 18:17:29 +02:00
|
|
|
content: '%i18n:common.deck.local%',
|
2018-06-05 22:18:08 +02:00
|
|
|
onClick: () => {
|
|
|
|
this.$store.dispatch('settings/addDeckColumn', {
|
|
|
|
id: uuid(),
|
|
|
|
type: 'local'
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}, {
|
2018-06-06 18:17:29 +02:00
|
|
|
content: '%i18n:common.deck.global%',
|
2018-06-05 22:18:08 +02:00
|
|
|
onClick: () => {
|
|
|
|
this.$store.dispatch('settings/addDeckColumn', {
|
|
|
|
id: uuid(),
|
|
|
|
type: 'global'
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}, {
|
2018-06-06 18:17:29 +02:00
|
|
|
content: '%i18n:common.deck.list%',
|
2018-06-05 22:18:08 +02:00
|
|
|
onClick: () => {
|
|
|
|
const w = (this as any).os.new(MkUserListsWindow);
|
|
|
|
w.$once('choosen', list => {
|
|
|
|
this.$store.dispatch('settings/addDeckColumn', {
|
|
|
|
id: uuid(),
|
|
|
|
type: 'list',
|
|
|
|
list: list
|
|
|
|
});
|
|
|
|
w.close();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}, {
|
2018-06-06 18:17:29 +02:00
|
|
|
content: '%i18n:common.deck.notifications%',
|
2018-06-05 22:18:08 +02:00
|
|
|
onClick: () => {
|
|
|
|
this.$store.dispatch('settings/addDeckColumn', {
|
|
|
|
id: uuid(),
|
|
|
|
type: 'notifications'
|
|
|
|
});
|
|
|
|
}
|
2018-06-06 12:22:45 +02:00
|
|
|
}, {
|
2018-06-06 18:17:29 +02:00
|
|
|
content: '%i18n:common.deck.widgets%',
|
2018-06-06 12:22:45 +02:00
|
|
|
onClick: () => {
|
|
|
|
this.$store.dispatch('settings/addDeckColumn', {
|
|
|
|
id: uuid(),
|
|
|
|
type: 'widgets',
|
|
|
|
widgets: []
|
|
|
|
});
|
|
|
|
}
|
2018-06-05 22:18:08 +02:00
|
|
|
}]
|
|
|
|
});
|
|
|
|
}
|
2018-06-05 14:36:21 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="stylus" module>
|
|
|
|
.root
|
|
|
|
height 100vh
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<style lang="stylus" scoped>
|
|
|
|
@import '~const.styl'
|
|
|
|
|
|
|
|
root(isDark)
|
|
|
|
display flex
|
|
|
|
flex 1
|
2018-06-06 17:53:31 +02:00
|
|
|
justify-content center
|
2018-06-05 14:44:02 +02:00
|
|
|
padding 16px 0 16px 16px
|
|
|
|
overflow auto
|
2018-06-05 14:36:21 +02:00
|
|
|
|
2018-06-05 21:00:48 +02:00
|
|
|
> div
|
2018-06-06 18:17:29 +02:00
|
|
|
margin-right 8px
|
2018-06-05 21:00:48 +02:00
|
|
|
|
|
|
|
&:last-of-type
|
|
|
|
margin-right 0
|
|
|
|
|
|
|
|
> button
|
|
|
|
padding 0 16px
|
|
|
|
color isDark ? #93a0a5 : #888
|
|
|
|
|
|
|
|
&:hover
|
|
|
|
color isDark ? #b8c5ca : #777
|
|
|
|
|
|
|
|
&:active
|
|
|
|
color isDark ? #fff : #555
|
|
|
|
|
2018-06-05 14:36:21 +02:00
|
|
|
.qlvquzbjribqcaozciifydkngcwtyzje[data-darkmode]
|
|
|
|
root(true)
|
|
|
|
|
|
|
|
.qlvquzbjribqcaozciifydkngcwtyzje:not([data-darkmode])
|
|
|
|
root(false)
|
|
|
|
|
|
|
|
</style>
|