mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-23 17:13:08 +02:00
To able to store local only visibilities (#3298)
This commit is contained in:
parent
6c72545fc8
commit
35db61f1b4
4 changed files with 36 additions and 27 deletions
|
@ -111,7 +111,7 @@ export default Vue.extend({
|
||||||
useCw: false,
|
useCw: false,
|
||||||
cw: null,
|
cw: null,
|
||||||
geo: null,
|
geo: null,
|
||||||
visibility: this.$store.state.settings.rememberNoteVisibility ? (this.$store.state.device.visibility || this.$store.state.settings.defaultNoteVisibility) : this.$store.state.settings.defaultNoteVisibility,
|
visibility: 'public',
|
||||||
visibleUsers: [],
|
visibleUsers: [],
|
||||||
localOnly: false,
|
localOnly: false,
|
||||||
autocomplete: null,
|
autocomplete: null,
|
||||||
|
@ -195,6 +195,9 @@ export default Vue.extend({
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// デフォルト公開範囲
|
||||||
|
this.applyVisibility(this.$store.state.settings.rememberNoteVisibility ? (this.$store.state.device.visibility || this.$store.state.settings.defaultNoteVisibility) : this.$store.state.settings.defaultNoteVisibility);
|
||||||
|
|
||||||
// 公開以外へのリプライ時は元の公開範囲を引き継ぐ
|
// 公開以外へのリプライ時は元の公開範囲を引き継ぐ
|
||||||
if (this.reply && ['home', 'followers', 'specified', 'private'].includes(this.reply.visibility)) {
|
if (this.reply && ['home', 'followers', 'specified', 'private'].includes(this.reply.visibility)) {
|
||||||
this.visibility = this.reply.visibility;
|
this.visibility = this.reply.visibility;
|
||||||
|
@ -365,6 +368,11 @@ export default Vue.extend({
|
||||||
source: this.$refs.visibilityButton
|
source: this.$refs.visibilityButton
|
||||||
});
|
});
|
||||||
w.$once('chosen', v => {
|
w.$once('chosen', v => {
|
||||||
|
this.applyVisibility(v);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
applyVisibility(v :string) {
|
||||||
const m = v.match(/^local-(.+)/);
|
const m = v.match(/^local-(.+)/);
|
||||||
if (m) {
|
if (m) {
|
||||||
this.localOnly = true;
|
this.localOnly = true;
|
||||||
|
@ -373,7 +381,6 @@ export default Vue.extend({
|
||||||
this.localOnly = false;
|
this.localOnly = false;
|
||||||
this.visibility = v;
|
this.visibility = v;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
addVisibleUser() {
|
addVisibleUser() {
|
||||||
|
|
|
@ -85,6 +85,9 @@
|
||||||
<option value="followers">{{ $t('@.note-visibility.followers') }}</option>
|
<option value="followers">{{ $t('@.note-visibility.followers') }}</option>
|
||||||
<option value="specified">{{ $t('@.note-visibility.specified') }}</option>
|
<option value="specified">{{ $t('@.note-visibility.specified') }}</option>
|
||||||
<option value="private">{{ $t('@.note-visibility.private') }}</option>
|
<option value="private">{{ $t('@.note-visibility.private') }}</option>
|
||||||
|
<option value="local-public">{{ $t('@.note-visibility.local-public') }}</option>
|
||||||
|
<option value="local-home">{{ $t('@.note-visibility.local-home') }}</option>
|
||||||
|
<option value="local-followers">{{ $t('@.note-visibility.local-followers') }}</option>
|
||||||
</ui-select>
|
</ui-select>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
@ -100,7 +100,7 @@ export default Vue.extend({
|
||||||
files: [],
|
files: [],
|
||||||
poll: false,
|
poll: false,
|
||||||
geo: null,
|
geo: null,
|
||||||
visibility: this.$store.state.settings.rememberNoteVisibility ? (this.$store.state.device.visibility || this.$store.state.settings.defaultNoteVisibility) : this.$store.state.settings.defaultNoteVisibility,
|
visibility: 'public',
|
||||||
visibleUsers: [],
|
visibleUsers: [],
|
||||||
localOnly: false,
|
localOnly: false,
|
||||||
useCw: false,
|
useCw: false,
|
||||||
|
@ -184,6 +184,9 @@ export default Vue.extend({
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// デフォルト公開範囲
|
||||||
|
this.applyVisibility(this.$store.state.settings.rememberNoteVisibility ? (this.$store.state.device.visibility || this.$store.state.settings.defaultNoteVisibility) : this.$store.state.settings.defaultNoteVisibility);
|
||||||
|
|
||||||
// 公開以外へのリプライ時は元の公開範囲を引き継ぐ
|
// 公開以外へのリプライ時は元の公開範囲を引き継ぐ
|
||||||
if (this.reply && ['home', 'followers', 'specified', 'private'].includes(this.reply.visibility)) {
|
if (this.reply && ['home', 'followers', 'specified', 'private'].includes(this.reply.visibility)) {
|
||||||
this.visibility = this.reply.visibility;
|
this.visibility = this.reply.visibility;
|
||||||
|
@ -275,6 +278,11 @@ export default Vue.extend({
|
||||||
compact: true
|
compact: true
|
||||||
});
|
});
|
||||||
w.$once('chosen', v => {
|
w.$once('chosen', v => {
|
||||||
|
this.applyVisibility(v);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
applyVisibility(v :string) {
|
||||||
const m = v.match(/^local-(.+)/);
|
const m = v.match(/^local-(.+)/);
|
||||||
if (m) {
|
if (m) {
|
||||||
this.localOnly = true;
|
this.localOnly = true;
|
||||||
|
@ -283,18 +291,6 @@ export default Vue.extend({
|
||||||
this.localOnly = false;
|
this.localOnly = false;
|
||||||
this.visibility = v;
|
this.visibility = v;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
addVisibleUser() {
|
|
||||||
this.$input({
|
|
||||||
title: this.$t('username-prompt')
|
|
||||||
}).then(acct => {
|
|
||||||
if (acct.startsWith('@')) acct = acct.substr(1);
|
|
||||||
this.$root.api('users/show', parseAcct(acct)).then(user => {
|
|
||||||
this.visibleUsers.push(user);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
removeVisibleUser(user) {
|
removeVisibleUser(user) {
|
||||||
|
|
|
@ -80,6 +80,9 @@
|
||||||
<option value="followers">{{ $t('@.note-visibility.followers') }}</option>
|
<option value="followers">{{ $t('@.note-visibility.followers') }}</option>
|
||||||
<option value="specified">{{ $t('@.note-visibility.specified') }}</option>
|
<option value="specified">{{ $t('@.note-visibility.specified') }}</option>
|
||||||
<option value="private">{{ $t('@.note-visibility.private') }}</option>
|
<option value="private">{{ $t('@.note-visibility.private') }}</option>
|
||||||
|
<option value="local-public">{{ $t('@.note-visibility.local-public') }}</option>
|
||||||
|
<option value="local-home">{{ $t('@.note-visibility.local-home') }}</option>
|
||||||
|
<option value="local-followers">{{ $t('@.note-visibility.local-followers') }}</option>
|
||||||
</ui-select>
|
</ui-select>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
|
Loading…
Reference in a new issue