summaryrefslogtreecommitdiff
path: root/src/client/app/common/views/components/settings
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2019-11-04 20:44:01 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2019-11-04 20:44:01 +0900
commitcc7fec4b9fa92afc8e9253d01c64107a114c3fa7 (patch)
treea9971df7a413116d81067db325abefcc51a553d1 /src/client/app/common/views/components/settings
parentUpdate README.md [AUTOGEN] (#5574) (diff)
downloadmisskey-cc7fec4b9fa92afc8e9253d01c64107a114c3fa7.tar.gz
misskey-cc7fec4b9fa92afc8e9253d01c64107a114c3fa7.tar.bz2
misskey-cc7fec4b9fa92afc8e9253d01c64107a114c3fa7.zip
Improve reaction setting
Fix #5577
Diffstat (limited to 'src/client/app/common/views/components/settings')
-rw-r--r--src/client/app/common/views/components/settings/settings.vue25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/client/app/common/views/components/settings/settings.vue b/src/client/app/common/views/components/settings/settings.vue
index 49239a597b..3a0ba561af 100644
--- a/src/client/app/common/views/components/settings/settings.vue
+++ b/src/client/app/common/views/components/settings/settings.vue
@@ -113,6 +113,10 @@
<ui-textarea v-model="reactions">
{{ $t('@._settings.reactions') }}<template #desc>{{ $t('@._settings.reactions-description') }}</template>
</ui-textarea>
+ <ui-horizon-group>
+ <ui-button @click="save('reactions', reactions.trim().split('\n'))" primary><fa :icon="faSave"/> {{ $t('@._settings.save') }}</ui-button>
+ <ui-button @click="previewReaction()" ref="reactionsPreviewButton"><fa :icon="faEye"/> {{ $t('@._settings.preview') }}</ui-button>
+ </ui-horizon-group>
</section>
<section>
@@ -311,11 +315,12 @@ import XApi from './api.vue';
import XLanguage from './language.vue';
import XAppType from './app-type.vue';
import XNotification from './notification.vue';
+import MkReactionPicker from '../reaction-picker.vue';
import { url, version } from '../../../../config';
import checkForUpdate from '../../../scripts/check-for-update';
import { formatTimeString } from '../../../../../../misc/format-time-string';
-import { faSave } from '@fortawesome/free-regular-svg-icons';
+import { faSave, faEye } from '@fortawesome/free-regular-svg-icons';
export default Vue.extend({
i18n: i18n(),
@@ -346,11 +351,12 @@ export default Vue.extend({
return {
meta: null,
version,
+ reactions: this.$store.state.settings.reactions.join('\n'),
webSearchEngine: this.$store.state.settings.webSearchEngine,
pastedFileName : this.$store.state.settings.pastedFileName,
latestVersion: undefined,
checkingForUpdate: false,
- faSave
+ faSave, faEye
};
},
computed: {
@@ -414,11 +420,6 @@ export default Vue.extend({
set(value) { this.$store.dispatch('settings/set', { key: 'disableViaMobile', value }); }
},
- reactions: {
- get() { return this.$store.state.settings.reactions.join('\n'); },
- set(value: string) { this.$store.dispatch('settings/set', { key: 'reactions', value: value.trim().split('\n') }); }
- },
-
useShadow: {
get() { return this.$store.state.device.useShadow; },
set(value) { this.$store.commit('device/set', { key: 'useShadow', value }); }
@@ -655,6 +656,16 @@ export default Vue.extend({
pastedFileNamePreview() {
return `${formatTimeString(new Date(), this.pastedFileName).replace(/{{number}}/g, `1`)}.png`
},
+ previewReaction() {
+ const picker = this.$root.new(MkReactionPicker, {
+ source: this.$refs.reactionsPreviewButton.$el,
+ reactions: this.reactions.trim().split('\n'),
+ showFocus: false,
+ });
+ picker.$once('chosen', reaction => {
+ picker.close();
+ });
+ }
}
});
</script>