From 89a58dc5964f4df8c54c9c216d8fff3a63d86462 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 17 May 2018 23:38:35 +0900 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E4=BB=98=E3=81=95=E3=82=8C=E3=81=9F?= =?UTF-8?q?=E3=83=A1=E3=83=87=E3=82=A3=E3=82=A2=E3=81=AEURL=E3=81=AF?= =?UTF-8?q?=E7=9C=81=E7=95=A5=E3=81=97=E3=81=A6=E8=A1=A8=E7=A4=BA=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= 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 ++++++++++++++++ .../desktop/views/components/notes.note.vue | 18 ++++++++++++++++-- .../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 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 @@