From 06cfa207fc1ec40c9604b69ede7170cb02d52a15 Mon Sep 17 00:00:00 2001 From: syuilo <syuilotan@yahoo.co.jp> Date: Fri, 22 Jun 2018 17:51:36 +0900 Subject: [PATCH] :v: --- src/client/app/common/scripts/can-hide-text.ts | 16 ---------------- .../app/desktop/views/components/notes.note.vue | 5 +---- .../app/desktop/views/pages/deck/deck.note.vue | 5 +---- src/client/app/mobile/views/components/note.vue | 5 +---- 4 files changed, 3 insertions(+), 28 deletions(-) delete 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 deleted file mode 100644 index 4a4be8d9d0..0000000000 --- a/src/client/app/common/scripts/can-hide-text.ts +++ /dev/null @@ -1,16 +0,0 @@ -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 6f466e576f..24f8d2f65b 100644 --- a/src/client/app/desktop/views/components/notes.note.vue +++ b/src/client/app/desktop/views/components/notes.note.vue @@ -25,7 +25,7 @@ <span v-if="p.isHidden" style="opacity: 0.5">%i18n:@private%</span> <span v-if="p.deletedAt" style="opacity: 0.5">%i18n:@deleted%</span> <a class="reply" v-if="p.reply">%fa:reply%</a> - <misskey-flavored-markdown v-if="p.text && !canHideText(p)" :text="p.text" :i="$store.state.i" :class="$style.text"/> + <misskey-flavored-markdown v-if="p.text" :text="p.text" :i="$store.state.i" :class="$style.text"/> <a class="rp" v-if="p.renote">RP:</a> </div> <div class="media" v-if="p.media.length > 0"> @@ -75,7 +75,6 @@ <script lang="ts"> import Vue from 'vue'; import dateStringify from '../../../common/scripts/date-stringify'; -import canHideText from '../../../common/scripts/can-hide-text'; import parse from '../../../../../mfm/parse'; import MkPostFormWindow from './post-form-window.vue'; @@ -190,8 +189,6 @@ export default Vue.extend({ }, methods: { - canHideText, - capture(withHandler = false) { if (this.$store.getters.isSignedIn) { this.connection.send({ diff --git a/src/client/app/desktop/views/pages/deck/deck.note.vue b/src/client/app/desktop/views/pages/deck/deck.note.vue index 617f633f56..f4139c1bd8 100644 --- a/src/client/app/desktop/views/pages/deck/deck.note.vue +++ b/src/client/app/desktop/views/pages/deck/deck.note.vue @@ -25,7 +25,7 @@ <span v-if="p.isHidden" style="opacity: 0.5">(%i18n:@private%)</span> <span v-if="p.deletedAt" style="opacity: 0.5">(%i18n:@deleted%)</span> <a class="reply" v-if="p.reply">%fa:reply%</a> - <misskey-flavored-markdown v-if="p.text && !canHideText(p)" :text="p.text" :i="$store.state.i"/> + <misskey-flavored-markdown v-if="p.text" :text="p.text" :i="$store.state.i"/> <a class="rp" v-if="p.renote != null">RP:</a> </div> <div class="media" v-if="p.media.length > 0"> @@ -68,7 +68,6 @@ <script lang="ts"> import Vue from 'vue'; import parse from '../../../../../../mfm/parse'; -import canHideText from '../../../../common/scripts/can-hide-text'; import MkNoteMenu from '../../../../common/views/components/note-menu.vue'; import MkReactionPicker from '../../../../common/views/components/reaction-picker.vue'; @@ -148,8 +147,6 @@ export default Vue.extend({ }, methods: { - canHideText, - capture(withHandler = false) { if (this.$store.getters.isSignedIn) { this.connection.send({ diff --git a/src/client/app/mobile/views/components/note.vue b/src/client/app/mobile/views/components/note.vue index bd0a0d1b5e..c3d4181a5d 100644 --- a/src/client/app/mobile/views/components/note.vue +++ b/src/client/app/mobile/views/components/note.vue @@ -25,7 +25,7 @@ <span v-if="p.isHidden" style="opacity: 0.5">(%i18n:@private%)</span> <span v-if="p.deletedAt" style="opacity: 0.5">(%i18n:@deleted%)</span> <a class="reply" v-if="p.reply">%fa:reply%</a> - <misskey-flavored-markdown v-if="p.text && !canHideText(p)" :text="p.text" :i="$store.state.i" :class="$style.text"/> + <misskey-flavored-markdown v-if="p.text" :text="p.text" :i="$store.state.i" :class="$style.text"/> <a class="rp" v-if="p.renote != null">RP:</a> </div> <div class="media" v-if="p.media.length > 0"> @@ -69,7 +69,6 @@ <script lang="ts"> import Vue from 'vue'; import parse from '../../../../../mfm/parse'; -import canHideText from '../../../common/scripts/can-hide-text'; import MkNoteMenu from '../../../common/views/components/note-menu.vue'; import MkReactionPicker from '../../../common/views/components/reaction-picker.vue'; @@ -165,8 +164,6 @@ export default Vue.extend({ }, methods: { - canHideText, - capture(withHandler = false) { if (this.$store.getters.isSignedIn) { this.connection.send({