From d7c94de07e17e31513780ceabf824a3d0760ff80 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 4 Mar 2018 09:39:25 +0900 Subject: #172 --- src/web/app/desktop/views/components/posts.post.vue | 5 +++++ src/web/app/desktop/views/components/settings.vue | 11 +++++++++++ src/web/app/mobile/views/components/post-form.vue | 4 +++- src/web/app/mobile/views/components/posts.post.vue | 19 ++++++++++++++----- src/web/docs/api/entities/post.yaml | 6 ++++++ 5 files changed, 39 insertions(+), 6 deletions(-) (limited to 'src/web') diff --git a/src/web/app/desktop/views/components/posts.post.vue b/src/web/app/desktop/views/components/posts.post.vue index 4a95918c48..ce0a31d183 100644 --- a/src/web/app/desktop/views/components/posts.post.vue +++ b/src/web/app/desktop/views/components/posts.post.vue @@ -26,6 +26,7 @@ @{{ p.user.username }}
via {{ p.app.name }} + %fa:mobile-alt% @@ -399,6 +400,10 @@ export default Vue.extend({ margin-left auto font-size 0.9em + > .mobile + margin-right 8px + color #ccc + > .app margin-right 8px padding-right 8px diff --git a/src/web/app/desktop/views/components/settings.vue b/src/web/app/desktop/views/components/settings.vue index 182a9a1d5e..20d7a77715 100644 --- a/src/web/app/desktop/views/components/settings.vue +++ b/src/web/app/desktop/views/components/settings.vue @@ -26,6 +26,11 @@ +
+

モバイル

+ +
+

言語

@@ -192,6 +197,12 @@ export default Vue.extend({ value: v }); }, + onChangeDisableViaMobile(v) { + (this as any).api('i/update_client_setting', { + name: 'disableViaMobile', + value: v + }); + }, checkForUpdate() { this.checkingForUpdate = true; checkForUpdate((this as any).os, true, true).then(newer => { diff --git a/src/web/app/mobile/views/components/post-form.vue b/src/web/app/mobile/views/components/post-form.vue index 63b75b92f0..009012b0b6 100644 --- a/src/web/app/mobile/views/components/post-form.vue +++ b/src/web/app/mobile/views/components/post-form.vue @@ -91,11 +91,13 @@ export default Vue.extend({ }, post() { this.posting = true; + const viaMobile = (this as any).os.i.client_settings.disableViaMobile !== true; (this as any).api('posts/create', { text: this.text == '' ? undefined : this.text, media_ids: this.files.length > 0 ? this.files.map(f => f.id) : undefined, reply_id: this.reply ? this.reply.id : undefined, - poll: this.poll ? (this.$refs.poll as any).get() : undefined + poll: this.poll ? (this.$refs.poll as any).get() : undefined, + via_mobile: viaMobile }).then(data => { this.$emit('post'); this.$destroy(); diff --git a/src/web/app/mobile/views/components/posts.post.vue b/src/web/app/mobile/views/components/posts.post.vue index 3c02e1e990..d0a897db65 100644 --- a/src/web/app/mobile/views/components/posts.post.vue +++ b/src/web/app/mobile/views/components/posts.post.vue @@ -24,9 +24,12 @@ {{ p.user.name }} bot @{{ p.user.username }} - - - +
+ %fa:mobile-alt% + + + +
@@ -336,10 +339,16 @@ export default Vue.extend({ margin 0 0.5em 0 0 color #ccc - > .created-at + > .info margin-left auto font-size 0.9em - color #c0c0c0 + + > .mobile + margin-right 6px + color #c0c0c0 + + > .created-at + color #c0c0c0 > .body diff --git a/src/web/docs/api/entities/post.yaml b/src/web/docs/api/entities/post.yaml index 551f3b7c3e..e4359ffd0c 100644 --- a/src/web/docs/api/entities/post.yaml +++ b/src/web/docs/api/entities/post.yaml @@ -17,6 +17,12 @@ props: desc: ja: "投稿日時" en: "The posted date of this post" + - name: "via_mobile" + type: "boolean" + optional: true + desc: + ja: "モバイル端末から投稿したか否か(自己申告であることに留意)" + en: "Whether this post sent via a mobile device" - name: "text" type: "string" optional: true -- cgit v1.2.3-freya