2018-06-05 15:54:03 +02:00
|
|
|
<template>
|
2018-06-08 00:43:12 +02:00
|
|
|
<x-column :menu="menu" :name="name" :column="column" :is-stacked="isStacked">
|
2018-06-07 21:21:06 +02:00
|
|
|
<span slot="header">
|
|
|
|
<template v-if="column.type == 'home'">%fa:home%</template>
|
|
|
|
<template v-if="column.type == 'local'">%fa:R comments%</template>
|
2018-07-11 06:43:09 +02:00
|
|
|
<template v-if="column.type == 'hybrid'">%fa:share-alt%</template>
|
2018-06-07 21:21:06 +02:00
|
|
|
<template v-if="column.type == 'global'">%fa:globe%</template>
|
|
|
|
<template v-if="column.type == 'list'">%fa:list%</template>
|
2018-09-17 02:00:20 +02:00
|
|
|
<template v-if="column.type == 'hashtag'">%fa:hashtag%</template>
|
2018-06-07 21:21:06 +02:00
|
|
|
<span>{{ name }}</span>
|
|
|
|
</span>
|
2018-06-05 22:18:08 +02:00
|
|
|
|
2018-06-09 18:01:28 +02:00
|
|
|
<div class="editor" style="padding:0 12px" v-if="edit">
|
2018-09-27 05:55:10 +02:00
|
|
|
<ui-switch v-model="column.isMediaOnly" @change="onChangeSettings">%i18n:@is-media-only%</ui-switch>
|
|
|
|
<ui-switch v-model="column.isMediaView" @change="onChangeSettings">%i18n:@is-media-view%</ui-switch>
|
2018-06-07 21:21:06 +02:00
|
|
|
</div>
|
2018-10-19 08:03:23 +02:00
|
|
|
|
|
|
|
<x-list-tl v-if="column.type == 'list'"
|
|
|
|
:list="column.list"
|
|
|
|
:media-only="column.isMediaOnly"
|
|
|
|
:media-view="column.isMediaView"
|
|
|
|
ref="tl"
|
2018-10-19 19:40:37 +02:00
|
|
|
@parentFocus="parentFocus"
|
2018-10-19 08:03:23 +02:00
|
|
|
/>
|
|
|
|
<x-hashtag-tl v-else-if="column.type == 'hashtag'"
|
|
|
|
:tag-tl="$store.state.settings.tagTimelines.find(x => x.id == column.tagTlId)"
|
|
|
|
:media-only="column.isMediaOnly"
|
|
|
|
:media-view="column.isMediaView"
|
|
|
|
ref="tl"
|
2018-10-19 19:40:37 +02:00
|
|
|
@parentFocus="parentFocus"
|
2018-10-19 08:03:23 +02:00
|
|
|
/>
|
|
|
|
<x-tl v-else
|
|
|
|
:src="column.type"
|
|
|
|
:media-only="column.isMediaOnly"
|
|
|
|
:media-view="column.isMediaView"
|
|
|
|
ref="tl"
|
2018-10-19 19:40:37 +02:00
|
|
|
@parentFocus="parentFocus"
|
2018-10-19 08:03:23 +02:00
|
|
|
/>
|
2018-06-07 21:21:06 +02:00
|
|
|
</x-column>
|
2018-06-05 15:54:03 +02:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
|
|
|
import XColumn from './deck.column.vue';
|
|
|
|
import XTl from './deck.tl.vue';
|
2018-06-05 22:18:08 +02:00
|
|
|
import XListTl from './deck.list-tl.vue';
|
2018-09-17 02:00:20 +02:00
|
|
|
import XHashtagTl from './deck.hashtag-tl.vue';
|
2018-06-05 15:54:03 +02:00
|
|
|
|
|
|
|
export default Vue.extend({
|
|
|
|
components: {
|
|
|
|
XColumn,
|
2018-06-05 22:18:08 +02:00
|
|
|
XTl,
|
2018-09-17 02:00:20 +02:00
|
|
|
XListTl,
|
|
|
|
XHashtagTl
|
2018-06-05 15:54:03 +02:00
|
|
|
},
|
|
|
|
|
2018-06-07 22:48:27 +02:00
|
|
|
props: {
|
|
|
|
column: {
|
|
|
|
type: Object,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
isStacked: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true
|
|
|
|
}
|
|
|
|
},
|
2018-06-06 23:13:57 +02:00
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
edit: false,
|
|
|
|
menu: [{
|
2018-06-08 04:46:45 +02:00
|
|
|
icon: '%fa:cog%',
|
|
|
|
text: '%i18n:@edit%',
|
|
|
|
action: () => {
|
2018-06-06 23:13:57 +02:00
|
|
|
this.edit = !this.edit;
|
|
|
|
}
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
name(): string {
|
|
|
|
if (this.column.name) return this.column.name;
|
|
|
|
|
|
|
|
switch (this.column.type) {
|
|
|
|
case 'home': return '%i18n:common.deck.home%';
|
|
|
|
case 'local': return '%i18n:common.deck.local%';
|
2018-07-11 06:43:09 +02:00
|
|
|
case 'hybrid': return '%i18n:common.deck.hybrid%';
|
2018-06-06 23:13:57 +02:00
|
|
|
case 'global': return '%i18n:common.deck.global%';
|
|
|
|
case 'list': return this.column.list.title;
|
2018-09-17 02:00:20 +02:00
|
|
|
case 'hashtag': return this.$store.state.settings.tagTimelines.find(x => x.id == this.column.tagTlId).title;
|
2018-06-06 23:13:57 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
onChangeSettings(v) {
|
|
|
|
this.$store.dispatch('settings/saveDeck');
|
2018-10-19 08:03:23 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
focus() {
|
|
|
|
this.$refs.tl.focus();
|
2018-10-19 19:40:37 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
parentFocus(direction) {
|
|
|
|
this.$emit('parentFocus', direction);
|
|
|
|
},
|
2018-06-05 22:18:08 +02:00
|
|
|
}
|
2018-06-05 15:54:03 +02:00
|
|
|
});
|
|
|
|
</script>
|