2018-06-05 13:54:03 +00:00
|
|
|
<template>
|
2018-06-07 22:43:12 +00:00
|
|
|
<x-column :menu="menu" :name="name" :column="column" :is-stacked="isStacked">
|
2019-02-18 02:13:56 +00:00
|
|
|
<template #header>
|
2018-11-15 20:53:17 +00:00
|
|
|
<fa v-if="column.type == 'home'" icon="home"/>
|
|
|
|
<fa v-if="column.type == 'local'" :icon="['far', 'comments']"/>
|
2019-04-07 12:50:36 +00:00
|
|
|
<fa v-if="column.type == 'social'" icon="share-alt"/>
|
2018-11-15 20:53:17 +00:00
|
|
|
<fa v-if="column.type == 'global'" icon="globe"/>
|
|
|
|
<fa v-if="column.type == 'list'" icon="list"/>
|
|
|
|
<fa v-if="column.type == 'hashtag'" icon="hashtag"/>
|
2018-06-07 19:21:06 +00:00
|
|
|
<span>{{ name }}</span>
|
2019-02-18 00:48:00 +00:00
|
|
|
</template>
|
2018-06-05 20:18:08 +00:00
|
|
|
|
2018-11-28 20:02:35 +00:00
|
|
|
<div class="editor" style="padding:12px" v-if="edit">
|
2018-11-08 18:44:35 +00:00
|
|
|
<ui-switch v-model="column.isMediaOnly" @change="onChangeSettings">{{ $t('is-media-only') }}</ui-switch>
|
2018-06-07 19:21:06 +00:00
|
|
|
</div>
|
2018-10-19 06:03:23 +00:00
|
|
|
|
|
|
|
<x-list-tl v-if="column.type == 'list'"
|
|
|
|
:list="column.list"
|
|
|
|
:media-only="column.isMediaOnly"
|
|
|
|
ref="tl"
|
|
|
|
/>
|
|
|
|
<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"
|
|
|
|
ref="tl"
|
|
|
|
/>
|
|
|
|
<x-tl v-else
|
|
|
|
:src="column.type"
|
|
|
|
:media-only="column.isMediaOnly"
|
|
|
|
ref="tl"
|
|
|
|
/>
|
2018-06-07 19:21:06 +00:00
|
|
|
</x-column>
|
2018-06-05 13:54:03 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
2019-02-14 20:08:59 +00:00
|
|
|
import i18n from '../../../i18n';
|
2018-06-05 13:54:03 +00:00
|
|
|
import XColumn from './deck.column.vue';
|
|
|
|
import XTl from './deck.tl.vue';
|
2018-06-05 20:18:08 +00:00
|
|
|
import XListTl from './deck.list-tl.vue';
|
2018-09-17 00:00:20 +00:00
|
|
|
import XHashtagTl from './deck.hashtag-tl.vue';
|
2018-06-05 13:54:03 +00:00
|
|
|
|
|
|
|
export default Vue.extend({
|
2018-11-08 18:44:35 +00:00
|
|
|
i18n: i18n('deck/deck.tl-column.vue'),
|
2018-06-05 13:54:03 +00:00
|
|
|
components: {
|
|
|
|
XColumn,
|
2018-06-05 20:18:08 +00:00
|
|
|
XTl,
|
2018-09-17 00:00:20 +00:00
|
|
|
XListTl,
|
|
|
|
XHashtagTl
|
2018-06-05 13:54:03 +00:00
|
|
|
},
|
|
|
|
|
2018-06-07 20:48:27 +00:00
|
|
|
props: {
|
|
|
|
column: {
|
|
|
|
type: Object,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
isStacked: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true
|
|
|
|
}
|
|
|
|
},
|
2018-06-06 21:13:57 +00:00
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
edit: false,
|
|
|
|
menu: [{
|
2018-11-05 16:40:11 +00:00
|
|
|
icon: 'cog',
|
2018-11-08 18:44:35 +00:00
|
|
|
text: this.$t('edit'),
|
2018-06-08 02:46:45 +00:00
|
|
|
action: () => {
|
2018-06-06 21:13:57 +00:00
|
|
|
this.edit = !this.edit;
|
|
|
|
}
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
name(): string {
|
|
|
|
if (this.column.name) return this.column.name;
|
|
|
|
|
|
|
|
switch (this.column.type) {
|
2018-11-08 18:44:35 +00:00
|
|
|
case 'home': return this.$t('@deck.home');
|
|
|
|
case 'local': return this.$t('@deck.local');
|
2019-04-07 12:50:36 +00:00
|
|
|
case 'social': return this.$t('@deck.social');
|
2018-11-08 18:44:35 +00:00
|
|
|
case 'global': return this.$t('@deck.global');
|
2019-04-07 12:50:36 +00:00
|
|
|
case 'list': return this.column.list.name;
|
2018-09-17 00:00:20 +00:00
|
|
|
case 'hashtag': return this.$store.state.settings.tagTimelines.find(x => x.id == this.column.tagTlId).title;
|
2018-06-06 21:13:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
onChangeSettings(v) {
|
2019-02-25 10:45:00 +00:00
|
|
|
this.$store.commit('device/updateDeckColumn', this.column);
|
2018-10-19 06:03:23 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
focus() {
|
|
|
|
this.$refs.tl.focus();
|
2018-10-21 07:18:02 +00:00
|
|
|
}
|
2018-06-05 20:18:08 +00:00
|
|
|
}
|
2018-06-05 13:54:03 +00:00
|
|
|
});
|
|
|
|
</script>
|