{{ $t('@._settings.paste') }}
{{ $t('@._settings.pasted-file-name') }}
- {{ $t('@._settings.pasted-file-name-desc') }}
+ {{ $t('@._settings.pasted-file-name-desc') }}
+ {{ pastedFileNamePreview() }}
+ {{ $t('@._settings.save') }}
+
{{ $t('@._settings.paste-dialog') }}
{{ $t('@._settings.paste-dialog-desc') }}
@@ -289,6 +293,8 @@ import XNotification from './notification.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';
export default Vue.extend({
i18n: i18n(),
@@ -319,8 +325,11 @@ export default Vue.extend({
return {
meta: null,
version,
+ webSearchEngine: this.$store.state.settings.webSearchEngine,
+ pastedFileName : this.$store.state.settings.pastedFileName,
latestVersion: undefined,
- checkingForUpdate: false
+ checkingForUpdate: false,
+ faSave
};
},
computed: {
@@ -419,16 +428,6 @@ export default Vue.extend({
set(value) { this.$store.dispatch('settings/set', { key: 'defaultNoteVisibility', value }); }
},
- webSearchEngine: {
- get() { return this.$store.state.settings.webSearchEngine; },
- set(value) { this.$store.dispatch('settings/set', { key: 'webSearchEngine', value }); }
- },
-
- pastedFileName: {
- get() { return this.$store.state.settings.pastedFileName; },
- set(value) { this.$store.dispatch('settings/set', { key: 'pastedFileName', value }); }
- },
-
pasteDialog: {
get() { return this.$store.state.settings.pasteDialog; },
set(value) { this.$store.dispatch('settings/set', { key: 'pasteDialog', value }); }
@@ -565,6 +564,17 @@ export default Vue.extend({
}
});
},
+ save(key, value) {
+ this.$store.dispatch('settings/set', {
+ key,
+ value
+ }).then(() => {
+ this.$root.dialog({
+ type: 'success',
+ text: this.$t('@._settings.saved')
+ })
+ });
+ },
customizeHome() {
location.href = '/?customize';
},
@@ -600,7 +610,10 @@ export default Vue.extend({
const sound = new Audio(`${url}/assets/message.mp3`);
sound.volume = this.$store.state.device.soundVolume;
sound.play();
- }
+ },
+ pastedFileNamePreview() {
+ return `${formatTimeString(new Date(), this.pastedFileName).replace(/{{number}}/g, `1`)}.png`
+ },
}
});
--
cgit v1.2.3-freya
From 9ca36021b05b448f969568fa6cb1118b70cb4230 Mon Sep 17 00:00:00 2001
From: Satsuki Yanagi <17376330+u1-liquid@users.noreply.github.com>
Date: Wed, 17 Jul 2019 13:28:27 +0900
Subject: Fix #5172 (#5174)
---
locales/ja-JP.yml | 4 ++++
.../common/views/components/settings/profile.vue | 23 ++++++++++++++++++++++
src/client/app/desktop/api/update-avatar.ts | 15 ++++++++++++++
src/client/app/desktop/api/update-banner.ts | 15 ++++++++++++++
4 files changed, 57 insertions(+)
(limited to 'src/client/app/common/views/components/settings')
diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml
index 3e315153cb..1c3f22dc2c 100644
--- a/locales/ja-JP.yml
+++ b/locales/ja-JP.yml
@@ -782,6 +782,9 @@ common/views/components/profile-editor.vue:
saved: "プロフィールを保存しました"
uploading: "アップロード中"
upload-failed: "アップロードに失敗しました"
+ unable-to-process: "操作を完了できません"
+ avatar-not-an-image: "アイコンとして指定したファイルは画像ではありません"
+ banner-not-an-image: "バナーとして指定したファイルは画像ではありません"
email: "メール設定"
email-address: "メールアドレス"
email-verified: "メールアドレスが確認されました"
@@ -927,6 +930,7 @@ desktop:
uploading-avatar: "新しいアバターをアップロードしています"
avatar-updated: "アバターを更新しました"
choose-avatar: "アバターにする画像を選択"
+ unable-to-process: "操作を完了できません"
invalid-filetype: "この形式のファイルはサポートされていません"
desktop/views/components/activity.chart.vue:
diff --git a/src/client/app/common/views/components/settings/profile.vue b/src/client/app/common/views/components/settings/profile.vue
index a22fd6df98..52ec8ceda3 100644
--- a/src/client/app/common/views/components/settings/profile.vue
+++ b/src/client/app/common/views/components/settings/profile.vue
@@ -265,6 +265,29 @@ export default Vue.extend({
text: this.$t('saved')
});
}
+ }).catch(err => {
+ this.saving = false;
+ switch(err.id) {
+ case 'f419f9f8-2f4d-46b1-9fb4-49d3a2fd7191':
+ this.$root.dialog({
+ type: 'error',
+ title: this.$t('unable-to-process'),
+ text: this.$t('avatar-not-an-image')
+ });
+ break;
+ case '75aedb19-2afd-4e6d-87fc-67941256fa60':
+ this.$root.dialog({
+ type: 'error',
+ title: this.$t('unable-to-process'),
+ text: this.$t('banner-not-an-image')
+ });
+ break;
+ default:
+ this.$root.dialog({
+ type: 'error',
+ text: this.$t('unable-to-process')
+ });
+ }
});
},
diff --git a/src/client/app/desktop/api/update-avatar.ts b/src/client/app/desktop/api/update-avatar.ts
index a095491b69..dad720827b 100644
--- a/src/client/app/desktop/api/update-avatar.ts
+++ b/src/client/app/desktop/api/update-avatar.ts
@@ -83,6 +83,21 @@ export default ($root: any) => {
});
return i;
+ }).catch(err => {
+ switch(err.id) {
+ case 'f419f9f8-2f4d-46b1-9fb4-49d3a2fd7191':
+ $root.dialog({
+ type: 'error',
+ title: locale['desktop']['unable-to-process'],
+ text: locale['desktop']['invalid-filetype']
+ });
+ break;
+ default:
+ $root.dialog({
+ type: 'error',
+ text: locale['desktop']['unable-to-process']
+ });
+ }
});
};
diff --git a/src/client/app/desktop/api/update-banner.ts b/src/client/app/desktop/api/update-banner.ts
index c23a325364..79d130f94b 100644
--- a/src/client/app/desktop/api/update-banner.ts
+++ b/src/client/app/desktop/api/update-banner.ts
@@ -83,6 +83,21 @@ export default ($root: any) => {
});
return i;
+ }).catch(err => {
+ switch(err.id) {
+ case '75aedb19-2afd-4e6d-87fc-67941256fa60':
+ $root.dialog({
+ type: 'error',
+ title: locale['desktop']['unable-to-process'],
+ text: locale['desktop']['invalid-filetype']
+ });
+ break;
+ default:
+ $root.dialog({
+ type: 'error',
+ text: locale['desktop']['unable-to-process']
+ });
+ }
});
};
--
cgit v1.2.3-freya
From ef44eda69eefbdeeb1efee1c8351be081938cae5 Mon Sep 17 00:00:00 2001
From: MeiMei <30769358+mei23@users.noreply.github.com>
Date: Thu, 18 Jul 2019 00:11:39 +0900
Subject: Mastodonのリンクの所有者認証に対応 (#5161)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Profile metadata を設定できるように
* API desc
---
locales/ja-JP.yml | 3 ++
.../common/views/components/settings/profile.vue | 46 ++++++++++++++++++++++
src/models/repositories/user.ts | 1 +
src/remote/activitypub/renderer/person.ts | 15 ++++++-
src/server/api/endpoints/i/update.ts | 15 +++++++
src/server/web/index.ts | 10 ++++-
src/server/web/views/base.pug | 1 +
src/server/web/views/user.pug | 5 +++
8 files changed, 92 insertions(+), 4 deletions(-)
(limited to 'src/client/app/common/views/components/settings')
diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml
index 76fc26381f..b6bbb7e963 100644
--- a/locales/ja-JP.yml
+++ b/locales/ja-JP.yml
@@ -804,6 +804,9 @@ common/views/components/profile-editor.vue:
danger-zone: "危険な設定"
delete-account: "アカウントを削除"
account-deleted: "アカウントが削除されました。データが消えるまで時間がかかる場合があります。"
+ profile-metadata: "プロフィール補足情報"
+ metadata-label: "ラベル"
+ metadata-content: "内容"
common/views/components/user-list-editor.vue:
users: "ユーザー"
diff --git a/src/client/app/common/views/components/settings/profile.vue b/src/client/app/common/views/components/settings/profile.vue
index 52ec8ceda3..edfc5a9edf 100644
--- a/src/client/app/common/views/components/settings/profile.vue
+++ b/src/client/app/common/views/components/settings/profile.vue
@@ -51,6 +51,26 @@
{{ $t('uploading') }}
+
+ {{ $t('profile-metadata') }}
+
+ {{ $t('metadata-label') }}
+ {{ $t('metadata-content') }}
+
+
+ {{ $t('metadata-label') }}
+ {{ $t('metadata-content') }}
+
+
+ {{ $t('metadata-label') }}
+ {{ $t('metadata-content') }}
+
+
+ {{ $t('metadata-label') }}
+ {{ $t('metadata-content') }}
+
+
+
{{ $t('save') }}
@@ -189,6 +209,17 @@ export default Vue.extend({
this.isLocked = this.$store.state.i.isLocked;
this.carefulBot = this.$store.state.i.carefulBot;
this.autoAcceptFollowed = this.$store.state.i.autoAcceptFollowed;
+
+ if (this.$store.state.i.fields) {
+ this.fieldName0 = this.$store.state.i.fields[0].name;
+ this.fieldValue0 = this.$store.state.i.fields[0].value;
+ this.fieldName1 = this.$store.state.i.fields[1].name;
+ this.fieldValue1 = this.$store.state.i.fields[1].value;
+ this.fieldName2 = this.$store.state.i.fields[2].name;
+ this.fieldValue2 = this.$store.state.i.fields[2].value;
+ this.fieldName3 = this.$store.state.i.fields[3].name;
+ this.fieldValue3 = this.$store.state.i.fields[3].value;
+ }
},
methods: {
@@ -237,6 +268,13 @@ export default Vue.extend({
},
save(notify) {
+ const fields = [
+ { name: this.fieldName0, value: this.fieldValue0 },
+ { name: this.fieldName1, value: this.fieldValue1 },
+ { name: this.fieldName2, value: this.fieldValue2 },
+ { name: this.fieldName3, value: this.fieldValue3 },
+ ];
+
this.saving = true;
this.$root.api('i/update', {
@@ -247,6 +285,7 @@ export default Vue.extend({
birthday: this.birthday || null,
avatarId: this.avatarId || undefined,
bannerId: this.bannerId || undefined,
+ fields,
isCat: !!this.isCat,
isBot: !!this.isBot,
isLocked: !!this.isLocked,
@@ -389,4 +428,11 @@ export default Vue.extend({
height 72px
margin auto
+.fields
+ > header
+ padding 8px 0px
+ font-weight bold
+ > div
+ padding-left 16px
+
diff --git a/src/models/repositories/user.ts b/src/models/repositories/user.ts
index 4e85fd7b93..a04b87f77c 100644
--- a/src/models/repositories/user.ts
+++ b/src/models/repositories/user.ts
@@ -148,6 +148,7 @@ export class UserRepository extends Repository