mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-22 04:03:49 +01:00
Improve tags settings (#3569)
This commit is contained in:
parent
c088437429
commit
ea1b5596e2
@ -990,6 +990,12 @@ desktop/views/components/sub-note-content.vue:
|
||||
media-count: "{}つのメディア"
|
||||
poll: "アンケート"
|
||||
|
||||
desktop/views/components/settings.tags.vue:
|
||||
title: "タグ"
|
||||
query: "クエリ (省略可)"
|
||||
add: "追加"
|
||||
save: "保存"
|
||||
|
||||
desktop/views/components/taskmanager.vue:
|
||||
title: "タスクマネージャ"
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="ui-textarea" :class="{ focused, filled, tall }">
|
||||
<div class="ui-textarea" :class="{ focused, filled, tall, pre }">
|
||||
<div class="input">
|
||||
<span class="label" ref="label"><slot></slot></span>
|
||||
<textarea ref="input"
|
||||
@ -46,6 +46,11 @@ export default Vue.extend({
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
pre: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -175,6 +180,11 @@ root(fill)
|
||||
> textarea
|
||||
min-height 200px
|
||||
|
||||
&.pre
|
||||
> .input
|
||||
> textarea
|
||||
white-space pre
|
||||
|
||||
.ui-textarea.fill
|
||||
root(true)
|
||||
|
||||
|
@ -1,15 +1,15 @@
|
||||
<template>
|
||||
<div class="vfcitkilproprqtbnpoertpsziierwzi">
|
||||
<div v-for="timeline in timelines" class="timeline">
|
||||
<div v-for="timeline in timelines" class="timeline" :key="timeline.id">
|
||||
<ui-input v-model="timeline.title" @change="save">
|
||||
<span>{{ $t('title') }}</span>
|
||||
</ui-input>
|
||||
<ui-textarea :value="timeline.query ? timeline.query.map(tags => tags.join(' ')).join('\n') : ''" @input="onQueryChange(timeline, $event)">
|
||||
<ui-textarea :value="timeline.query ? timeline.query.map(tags => tags.join(' ')).join('\n') : ''" :pre="true" @input="onQueryChange(timeline, $event)">
|
||||
<span>{{ $t('query') }}</span>
|
||||
</ui-textarea>
|
||||
<ui-button class="save" @click="save">{{ $t('save') }}</ui-button>
|
||||
</div>
|
||||
<ui-button class="add" @click="add">{{ $t('add') }}</ui-button>
|
||||
<ui-button class="save" @click="save">{{ $t('save') }}</ui-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -33,12 +33,19 @@ export default Vue.extend({
|
||||
title: '',
|
||||
query: ''
|
||||
});
|
||||
|
||||
this.save();
|
||||
},
|
||||
|
||||
save() {
|
||||
this.$store.dispatch('settings/set', { key: 'tagTimelines', value: this.timelines });
|
||||
const timelines = this.timelines
|
||||
.filter(timeline => timeline.title)
|
||||
.map(timeline => {
|
||||
if (!(timeline.query && timeline.query[0] && timeline.query[0][0])) {
|
||||
timeline.query = timeline.title.split('\n').map(tags => tags.split(' '));
|
||||
}
|
||||
return timeline;
|
||||
});
|
||||
|
||||
this.$store.dispatch('settings/set', { key: 'tagTimelines', value: timelines });
|
||||
},
|
||||
|
||||
onQueryChange(timeline, value) {
|
||||
|
Loading…
Reference in New Issue
Block a user