From a091cbb93aa4f204b2c8af6574b5b5c62eafd853 Mon Sep 17 00:00:00 2001
From: MeiMei <30769358+mei23@users.noreply.github.com>
Date: Wed, 10 Jul 2019 03:47:07 +0900
Subject: Prevent duplicate user registration (#5129)
---
src/client/app/common/views/components/signup.vue | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
(limited to 'src/client/app/common')
diff --git a/src/client/app/common/views/components/signup.vue b/src/client/app/common/views/components/signup.vue
index 421d09a4dd..893f6575fb 100644
--- a/src/client/app/common/views/components/signup.vue
+++ b/src/client/app/common/views/components/signup.vue
@@ -43,7 +43,7 @@
- {{ $t('create') }}
+ {{ $t('create') }}
@@ -70,6 +70,7 @@ export default Vue.extend({
passwordStrength: '',
passwordRetypeState: null,
meta: {},
+ submitting: false,
ToSAgreement: false
}
},
@@ -145,6 +146,9 @@ export default Vue.extend({
},
onSubmit() {
+ if (this.submitting) return;
+ this.submitting = true;
+
this.$root.api('signup', {
username: this.username,
password: this.password,
@@ -159,6 +163,8 @@ export default Vue.extend({
location.href = '/';
});
}).catch(() => {
+ this.submitting = false;
+
this.$root.dialog({
type: 'error',
text: this.$t('some-error')
--
cgit v1.2.3-freya
From feec5e88fcb0b0d89931dba1c2032ea315b553bf Mon Sep 17 00:00:00 2001
From: syuilo
Date: Wed, 10 Jul 2019 18:30:51 +0900
Subject: Pages: Implement radio button
---
locales/ja-JP.yml | 7 +++
src/client/app/common/scripts/collect-page-vars.ts | 6 +++
.../common/views/components/page/page.block.vue | 3 +-
.../views/components/page/page.radio-button.vue | 37 +++++++++++++++
.../els/page-editor.el.radio-button.vue | 53 ++++++++++++++++++++++
.../views/pages/page-editor/page-editor.blocks.vue | 3 +-
.../common/views/pages/page-editor/page-editor.vue | 1 +
7 files changed, 108 insertions(+), 2 deletions(-)
create mode 100644 src/client/app/common/views/components/page/page.radio-button.vue
create mode 100644 src/client/app/common/views/pages/page-editor/els/page-editor.el.radio-button.vue
(limited to 'src/client/app/common')
diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml
index d2776c45b1..2efe8461ea 100644
--- a/locales/ja-JP.yml
+++ b/locales/ja-JP.yml
@@ -2066,6 +2066,13 @@ pages:
variable: "送信する変数"
no-variable: "なし"
+ radioButton: "選択肢"
+ _radioButton:
+ name: "変数名"
+ title: "タイトル"
+ values: "改行で区切った選択肢"
+ default: "デフォルト値"
+
script:
categories:
flow: "制御"
diff --git a/src/client/app/common/scripts/collect-page-vars.ts b/src/client/app/common/scripts/collect-page-vars.ts
index 4c40d5d88e..a4096fb2c2 100644
--- a/src/client/app/common/scripts/collect-page-vars.ts
+++ b/src/client/app/common/scripts/collect-page-vars.ts
@@ -32,6 +32,12 @@ export function collectPageVars(content) {
type: 'number',
value: 0
});
+ } else if (x.type === 'radioButton') {
+ pageVars.push({
+ name: x.name,
+ type: 'string',
+ value: x.default || ''
+ });
} else if (x.children) {
collect(x.children);
}
diff --git a/src/client/app/common/views/components/page/page.block.vue b/src/client/app/common/views/components/page/page.block.vue
index 1c421fc2c0..56d1822013 100644
--- a/src/client/app/common/views/components/page/page.block.vue
+++ b/src/client/app/common/views/components/page/page.block.vue
@@ -16,10 +16,11 @@ import XIf from './page.if.vue';
import XTextarea from './page.textarea.vue';
import XPost from './page.post.vue';
import XCounter from './page.counter.vue';
+import XRadioButton from './page.radio-button.vue';
export default Vue.extend({
components: {
- XText, XSection, XImage, XButton, XNumberInput, XTextInput, XTextareaInput, XTextarea, XPost, XSwitch, XIf, XCounter
+ XText, XSection, XImage, XButton, XNumberInput, XTextInput, XTextareaInput, XTextarea, XPost, XSwitch, XIf, XCounter, XRadioButton
},
props: {
diff --git a/src/client/app/common/views/components/page/page.radio-button.vue b/src/client/app/common/views/components/page/page.radio-button.vue
new file mode 100644
index 0000000000..27c11bebad
--- /dev/null
+++ b/src/client/app/common/views/components/page/page.radio-button.vue
@@ -0,0 +1,37 @@
+
+
+
{{ script.interpolate(value.title) }}
+
{{ x }}
+
+
+
+
+
+
diff --git a/src/client/app/common/views/pages/page-editor/els/page-editor.el.radio-button.vue b/src/client/app/common/views/pages/page-editor/els/page-editor.el.radio-button.vue
new file mode 100644
index 0000000000..3401c46f47
--- /dev/null
+++ b/src/client/app/common/views/pages/page-editor/els/page-editor.el.radio-button.vue
@@ -0,0 +1,53 @@
+
+ $emit('remove')" :draggable="true">
+ {{ $t('blocks.radioButton') }}
+
+
+ {{ $t('blocks._radioButton.name') }}
+ {{ $t('blocks._radioButton.title') }}
+ {{ $t('blocks._radioButton.values') }}
+ {{ $t('blocks._radioButton.default') }}
+
+
+
+
+
diff --git a/src/client/app/common/views/pages/page-editor/page-editor.blocks.vue b/src/client/app/common/views/pages/page-editor/page-editor.blocks.vue
index c5f3419e7b..4d7293231f 100644
--- a/src/client/app/common/views/pages/page-editor/page-editor.blocks.vue
+++ b/src/client/app/common/views/pages/page-editor/page-editor.blocks.vue
@@ -19,10 +19,11 @@ import XSwitch from './els/page-editor.el.switch.vue';
import XIf from './els/page-editor.el.if.vue';
import XPost from './els/page-editor.el.post.vue';
import XCounter from './els/page-editor.el.counter.vue';
+import XRadioButton from './els/page-editor.el.radio-button.vue';
export default Vue.extend({
components: {
- XDraggable, XSection, XText, XImage, XButton, XTextarea, XTextInput, XTextareaInput, XNumberInput, XSwitch, XIf, XPost, XCounter
+ XDraggable, XSection, XText, XImage, XButton, XTextarea, XTextInput, XTextareaInput, XNumberInput, XSwitch, XIf, XPost, XCounter, XRadioButton
},
props: {
diff --git a/src/client/app/common/views/pages/page-editor/page-editor.vue b/src/client/app/common/views/pages/page-editor/page-editor.vue
index ade7d86991..0162915c38 100644
--- a/src/client/app/common/views/pages/page-editor/page-editor.vue
+++ b/src/client/app/common/views/pages/page-editor/page-editor.vue
@@ -342,6 +342,7 @@ export default Vue.extend({
label: this.$t('input-blocks'),
items: [
{ value: 'button', text: this.$t('blocks.button') },
+ { value: 'radioButton', text: this.$t('blocks.radioButton') },
{ value: 'textInput', text: this.$t('blocks.textInput') },
{ value: 'textareaInput', text: this.$t('blocks.textareaInput') },
{ value: 'numberInput', text: this.$t('blocks.numberInput') },
--
cgit v1.2.3-freya
From b2030e840318445751c44fd11d41518e2c4507df Mon Sep 17 00:00:00 2001
From: syuilo
Date: Fri, 12 Jul 2019 00:40:10 +0900
Subject: :art:
---
src/client/app/common/views/components/reaction-picker.vue | 1 +
1 file changed, 1 insertion(+)
(limited to 'src/client/app/common')
diff --git a/src/client/app/common/views/components/reaction-picker.vue b/src/client/app/common/views/components/reaction-picker.vue
index 970d430069..ff534d37ce 100644
--- a/src/client/app/common/views/components/reaction-picker.vue
+++ b/src/client/app/common/views/components/reaction-picker.vue
@@ -276,6 +276,7 @@ export default Vue.extend({
font-size 14px
color var(--popupFg)
border-bottom solid var(--lineWidth) var(--faceDivider)
+ line-height 20px
> .buttons
padding 4px 4px 8px 4px
--
cgit v1.2.3-freya
From ebbf5268ac96157780c5a591e07c5a8381652c9e Mon Sep 17 00:00:00 2001
From: syuilo
Date: Fri, 12 Jul 2019 02:08:13 +0900
Subject: Improve usability
---
src/client/app/common/views/components/url-preview.vue | 1 +
src/client/app/common/views/components/url.vue | 1 +
2 files changed, 2 insertions(+)
(limited to 'src/client/app/common')
diff --git a/src/client/app/common/views/components/url-preview.vue b/src/client/app/common/views/components/url-preview.vue
index 476c671e77..80aae5999d 100644
--- a/src/client/app/common/views/components/url-preview.vue
+++ b/src/client/app/common/views/components/url-preview.vue
@@ -66,6 +66,7 @@ export default Vue.extend({
(this.url.substr(local.length) === '/') ||
this.url.substr(local.length).startsWith('/@') ||
this.url.substr(local.length).startsWith('/notes/') ||
+ this.url.substr(local.length).startsWith('/tags/') ||
this.url.substr(local.length).startsWith('/pages/');
return {
local,
diff --git a/src/client/app/common/views/components/url.vue b/src/client/app/common/views/components/url.vue
index b1ca3f285c..3a304ad6e7 100644
--- a/src/client/app/common/views/components/url.vue
+++ b/src/client/app/common/views/components/url.vue
@@ -28,6 +28,7 @@ export default Vue.extend({
(this.url.substr(local.length) === '/') ||
this.url.substr(local.length).startsWith('/@') ||
this.url.substr(local.length).startsWith('/notes/') ||
+ this.url.substr(local.length).startsWith('/tags/') ||
this.url.substr(local.length).startsWith('/pages/'));
return {
local,
--
cgit v1.2.3-freya
From b3c6e28717dca26d4b35fad311b74956019b7689 Mon Sep 17 00:00:00 2001
From: Satsuki Yanagi <17376330+u1-liquid@users.noreply.github.com>
Date: Fri, 12 Jul 2019 22:24:29 +0900
Subject: Improve usability (#5142)
Fix #3862
---
locales/ja-JP.yml | 2 ++
.../common/views/components/settings/app-type.vue | 19 ++++++++++-
.../common/views/components/settings/settings.vue | 39 ++++++++++++++--------
3 files changed, 46 insertions(+), 14 deletions(-)
(limited to 'src/client/app/common')
diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml
index 2efe8461ea..19bbec2de9 100644
--- a/locales/ja-JP.yml
+++ b/locales/ja-JP.yml
@@ -290,6 +290,8 @@ common:
load-raw-images: "添付された画像を高画質で表示する"
load-remote-media: "リモートサーバーのメディアを表示する"
sync: "同期"
+ save: "保存"
+ saved: "保存しました"
home-profile: "ホームのプロファイル"
deck-profile: "デッキのプロファイル"
diff --git a/src/client/app/common/views/components/settings/app-type.vue b/src/client/app/common/views/components/settings/app-type.vue
index 90ff28803b..d163f1e746 100644
--- a/src/client/app/common/views/components/settings/app-type.vue
+++ b/src/client/app/common/views/components/settings/app-type.vue
@@ -29,8 +29,25 @@ export default Vue.extend({
computed: {
appTypeForce: {
get() { return this.$store.state.device.appTypeForce; },
- set(value) { this.$store.commit('device/set', { key: 'appTypeForce', value }); }
+ set(value) {
+ this.$store.commit('device/set', { key: 'appTypeForce', value });
+ this.reload();
+ }
},
},
+
+ methods: {
+ reload() {
+ this.$root.dialog({
+ type: 'warning',
+ text: this.$t('@.reload-to-apply-the-setting'),
+ showCancelButton: true
+ }).then(({ canceled }) => {
+ if (!canceled) {
+ location.reload();
+ }
+ });
+ },
+ }
});
diff --git a/src/client/app/common/views/components/settings/settings.vue b/src/client/app/common/views/components/settings/settings.vue
index 281524979e..401d9423ae 100644
--- a/src/client/app/common/views/components/settings/settings.vue
+++ b/src/client/app/common/views/components/settings/settings.vue
@@ -143,13 +143,17 @@
{{ $t('@._settings.web-search-engine') }}
{{ $t('@._settings.web-search-engine-desc') }}
+ {{ $t('@._settings.save') }}
{{ $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 01e7716170aff833c9432184e16162a274390d44 Mon Sep 17 00:00:00 2001
From: Satsuki Yanagi <17376330+u1-liquid@users.noreply.github.com>
Date: Mon, 15 Jul 2019 02:28:30 +0900
Subject: (コ`・ヘ・´ケ) (#5156)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/client/app/common/scripts/get-face.ts | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'src/client/app/common')
diff --git a/src/client/app/common/scripts/get-face.ts b/src/client/app/common/scripts/get-face.ts
index b523948bd3..19f2bdb064 100644
--- a/src/client/app/common/scripts/get-face.ts
+++ b/src/client/app/common/scripts/get-face.ts
@@ -4,7 +4,8 @@ const faces = [
'🐡( \'-\' 🐡 )フグパンチ!!!!',
'✌️(´・_・`)✌️',
'(。>﹏<。)',
- '(Δ・x・Δ)'
+ '(Δ・x・Δ)',
+ '(コ`・ヘ・´ケ)'
];
export default () => faces[Math.floor(Math.random() * faces.length)];
--
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')
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')
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 {
description: profile!.description,
location: profile!.location,
birthday: profile!.birthday,
+ fields: profile!.fields,
followersCount: user.followersCount,
followingCount: user.followingCount,
notesCount: user.notesCount,
diff --git a/src/remote/activitypub/renderer/person.ts b/src/remote/activitypub/renderer/person.ts
index efe52cdefb..d4c018fb78 100644
--- a/src/remote/activitypub/renderer/person.ts
+++ b/src/remote/activitypub/renderer/person.ts
@@ -21,13 +21,24 @@ export async function renderPerson(user: ILocalUser) {
]);
const attachment: {
- type: string,
+ type: 'PropertyValue',
name: string,
value: string,
- verified_at?: string,
identifier?: IIdentifier
}[] = [];
+ if (profile.fields) {
+ for (const field of profile.fields) {
+ attachment.push({
+ type: 'PropertyValue',
+ name: field.name,
+ value: (field.value != null && field.value.match(/^https?:/))
+ ? `${new URL(field.value).href}`
+ : field.value
+ });
+ }
+ }
+
if (profile.twitter) {
attachment.push({
type: 'PropertyValue',
diff --git a/src/server/api/endpoints/i/update.ts b/src/server/api/endpoints/i/update.ts
index a454cdb940..149081e50b 100644
--- a/src/server/api/endpoints/i/update.ts
+++ b/src/server/api/endpoints/i/update.ts
@@ -77,6 +77,13 @@ export const meta = {
}
},
+ fields: {
+ validator: $.optional.arr($.object()).range(1, 4),
+ desc: {
+ 'ja-JP': 'プロフィール補足情報'
+ }
+ },
+
isLocked: {
validator: $.optional.bool,
desc: {
@@ -226,6 +233,14 @@ export default define(meta, async (ps, user, app) => {
profileUpdates.pinnedPageId = null;
}
+ if (ps.fields) {
+ profileUpdates.fields = ps.fields
+ .filter(x => typeof x.name === 'string' && x.name !== '' && typeof x.value === 'string' && x.value !== '')
+ .map(x => {
+ return { name: x.name, value: x.value };
+ });
+ }
+
//#region emojis/tags
let emojis = [] as string[];
diff --git a/src/server/web/index.ts b/src/server/web/index.ts
index 8cf6a75208..6c41bbde46 100644
--- a/src/server/web/index.ts
+++ b/src/server/web/index.ts
@@ -156,11 +156,17 @@ router.get('/@:user', async (ctx, next) => {
if (user != null) {
const profile = await UserProfiles.findOne(user.id).then(ensure);
const meta = await fetchMeta();
+ const me = profile.fields
+ ? profile.fields
+ .filter(filed => filed.value != null && filed.value.match(/^https?:/))
+ .map(field => field.value)
+ : [];
+
await ctx.render('user', {
- user, profile,
+ user, profile, me,
instanceName: meta.name || 'Misskey'
});
- ctx.set('Cache-Control', 'public, max-age=180');
+ ctx.set('Cache-Control', 'public, max-age=30');
} else {
// リモートユーザーなので
await next();
diff --git a/src/server/web/views/base.pug b/src/server/web/views/base.pug
index 733a306d56..16bea853e7 100644
--- a/src/server/web/views/base.pug
+++ b/src/server/web/views/base.pug
@@ -44,3 +44,4 @@ html
+ block content
diff --git a/src/server/web/views/user.pug b/src/server/web/views/user.pug
index 9b257afb7b..6ff86b09be 100644
--- a/src/server/web/views/user.pug
+++ b/src/server/web/views/user.pug
@@ -36,3 +36,8 @@ block meta
link(rel='alternate' href=user.uri type='application/activity+json')
if profile.url
link(rel='alternate' href=profile.url type='text/html')
+
+block content
+ div#me
+ each m in me
+ a(rel='me' href=`${m}`) #{m}
--
cgit v1.2.3-freya
From f6ac6f9c6f59bc846409f8e5f7fdfca51a42b51e Mon Sep 17 00:00:00 2001
From: Oni-Men
Date: Thu, 18 Jul 2019 20:56:48 +0900
Subject: fix #5071 (#5184)
---
src/client/app/common/views/components/poll-editor.vue | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
(limited to 'src/client/app/common')
diff --git a/src/client/app/common/views/components/poll-editor.vue b/src/client/app/common/views/components/poll-editor.vue
index f7a4d3af8c..49940134c7 100644
--- a/src/client/app/common/views/components/poll-editor.vue
+++ b/src/client/app/common/views/components/poll-editor.vue
@@ -26,13 +26,19 @@
- {{ $t('deadline-date') }}
- {{ $t('deadline-time') }}
+
+ {{ $t('deadline-date') }}
+
+
+ {{ $t('deadline-time') }}
+
- {{ $t('interval') }}
+
+ {{ $t('interval') }}
+
- {{ $t('unit') }}
+ {{ $t('unit') }}
--
cgit v1.2.3-freya
From 2af79e98551a295199672c338a38559411ce2bc3 Mon Sep 17 00:00:00 2001
From: rinsuki <428rinsuki+git@gmail.com>
Date: Fri, 19 Jul 2019 03:13:47 +0900
Subject: 特定ホストへのメンションの特別処理をクライアントに追加 (#5185)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* 特定ホストへのメンションの特別処理をクライアントに追加
Fix #5168
* Apply suggestions from code review
Co-Authored-By: Acid Chicken (硫酸鶏)
* Apply suggestions from code review
Co-Authored-By: Acid Chicken (硫酸鶏)
* Apply suggestions from code review
Co-Authored-By: Acid Chicken (硫酸鶏)
* Fix indent
---
src/client/app/common/views/components/mention.vue | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
(limited to 'src/client/app/common')
diff --git a/src/client/app/common/views/components/mention.vue b/src/client/app/common/views/components/mention.vue
index f212fd3ca5..4e9f9e90d6 100644
--- a/src/client/app/common/views/components/mention.vue
+++ b/src/client/app/common/views/components/mention.vue
@@ -1,11 +1,17 @@
-
+
{{ $t('@.you') }}
@{{ username }}
@{{ toUnicode(host) }}
+
+
+ @{{ username }}
+ @{{ toUnicode(host) }}
+
+