From a1692ebc7cfa7b3c6943d552ae059261fa5d18d3 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 17 May 2018 16:24:01 +0900 Subject: モバイル版のウィジェット復活 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/app/common/scripts/streaming/home.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/client/app/common/scripts') diff --git a/src/client/app/common/scripts/streaming/home.ts b/src/client/app/common/scripts/streaming/home.ts index 32685f3c2c..09d830bece 100644 --- a/src/client/app/common/scripts/streaming/home.ts +++ b/src/client/app/common/scripts/streaming/home.ts @@ -48,6 +48,17 @@ export class HomeStream extends Stream { } }); + this.on('mobile_home_updated', x => { + if (x.home) { + os.store.commit('settings/setMobileHome', x.home); + } else { + os.store.commit('settings/setMobileHomeWidget', { + id: x.id, + data: x.data + }); + } + }); + // トークンが再生成されたとき // このままではMisskeyが利用できないので強制的にサインアウトさせる this.on('my_token_regenerated', () => { -- cgit v1.2.3-freya From 89a58dc5964f4df8c54c9c216d8fff3a63d86462 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 17 May 2018 23:38:35 +0900 Subject: 添付されたメディアのURLは省略して表示するように MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/app/common/scripts/can-hide-text.ts | 16 ++++++++++++++++ src/client/app/desktop/views/components/notes.note.vue | 18 ++++++++++++++++-- src/client/app/mobile/views/components/note.vue | 15 ++++++++++++++- src/models/drive-file.ts | 1 + 4 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 src/client/app/common/scripts/can-hide-text.ts (limited to 'src/client/app/common/scripts') diff --git a/src/client/app/common/scripts/can-hide-text.ts b/src/client/app/common/scripts/can-hide-text.ts new file mode 100644 index 0000000000..4a4be8d9d0 --- /dev/null +++ b/src/client/app/common/scripts/can-hide-text.ts @@ -0,0 +1,16 @@ +export default function(note) { + if (note.text == null) return true; + + let txt = note.text; + + if (note.media) { + note.media.forEach(file => { + txt = txt.replace(file.url, ''); + if (file.src) txt = txt.replace(file.src, ''); + }); + + if (txt == '') return true; + } + + return false; +} diff --git a/src/client/app/desktop/views/components/notes.note.vue b/src/client/app/desktop/views/components/notes.note.vue index 057c3c0956..3ecef33d9a 100644 --- a/src/client/app/desktop/views/components/notes.note.vue +++ b/src/client/app/desktop/views/components/notes.note.vue @@ -44,7 +44,7 @@
(この投稿は非公開です) %fa:reply% - + RP:
@@ -94,6 +94,7 @@