summaryrefslogtreecommitdiff
path: root/src/client/app/common/scripts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-05-17 23:38:35 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-05-17 23:38:35 +0900
commit89a58dc5964f4df8c54c9c216d8fff3a63d86462 (patch)
tree0c7a26d26657a3d1c8663543e075b07353900f09 /src/client/app/common/scripts
parent:art: (diff)
downloadsharkey-89a58dc5964f4df8c54c9c216d8fff3a63d86462.tar.gz
sharkey-89a58dc5964f4df8c54c9c216d8fff3a63d86462.tar.bz2
sharkey-89a58dc5964f4df8c54c9c216d8fff3a63d86462.zip
添付されたメディアのURLは省略して表示するように
Diffstat (limited to 'src/client/app/common/scripts')
-rw-r--r--src/client/app/common/scripts/can-hide-text.ts16
1 files changed, 16 insertions, 0 deletions
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;
+}