summaryrefslogtreecommitdiff
path: root/src/client/components
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2020-07-29 01:15:02 +0900
committersyuilo <syuilotan@yahoo.co.jp>2020-07-29 01:15:02 +0900
commit30df8ea1213013072f139aa26a635330457cf2bc (patch)
tree3edeeed1f53475f0ebc9e181295c6c91a90c9ca4 /src/client/components
parentfeat(client): プラグインを無効にできるように (diff)
downloadsharkey-30df8ea1213013072f139aa26a635330457cf2bc.tar.gz
sharkey-30df8ea1213013072f139aa26a635330457cf2bc.tar.bz2
sharkey-30df8ea1213013072f139aa26a635330457cf2bc.zip
feat(client): AiScript: ノート書き換えAPI
Diffstat (limited to 'src/client/components')
-rw-r--r--src/client/components/note.vue16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/client/components/note.vue b/src/client/components/note.vue
index c3a199a805..a359287b41 100644
--- a/src/client/components/note.vue
+++ b/src/client/components/note.vue
@@ -35,19 +35,19 @@
</div>
</div>
<article class="article">
- <mk-avatar class="avatar" :user="appearNote.user" v-once/>
+ <mk-avatar class="avatar" :user="appearNote.user"/>
<div class="main">
<x-note-header class="header" :note="appearNote" :mini="true"/>
<div class="body" ref="noteBody">
<p v-if="appearNote.cw != null" class="cw">
- <mfm v-if="appearNote.cw != ''" class="text" :text="appearNote.cw" :author="appearNote.user" :i="$store.state.i" :custom-emojis="appearNote.emojis" v-once/>
+ <mfm v-if="appearNote.cw != ''" class="text" :text="appearNote.cw" :author="appearNote.user" :i="$store.state.i" :custom-emojis="appearNote.emojis"/>
<x-cw-button v-model="showContent" :note="appearNote"/>
</p>
<div class="content" v-show="appearNote.cw == null || showContent">
<div class="text">
<span v-if="appearNote.isHidden" style="opacity: 0.5">({{ $t('private') }})</span>
<router-link class="reply" v-if="appearNote.replyId" :to="`/notes/${appearNote.replyId}`"><fa :icon="faReply"/></router-link>
- <mfm v-if="appearNote.text" :text="appearNote.text" :author="appearNote.user" :i="$store.state.i" :custom-emojis="appearNote.emojis" v-once/>
+ <mfm v-if="appearNote.text" :text="appearNote.text" :author="appearNote.user" :i="$store.state.i" :custom-emojis="appearNote.emojis"/>
<a class="rp" v-if="appearNote.renote != null">RN:</a>
</div>
<div class="files" v-if="appearNote.files.length > 0">
@@ -114,6 +114,7 @@ import { focusPrev, focusNext } from '../scripts/focus';
import { url } from '../config';
import copyToClipboard from '../scripts/copy-to-clipboard';
import { checkWordMute } from '../scripts/check-word-mute';
+import { utils } from '@syuilo/aiscript';
export default Vue.extend({
model: {
@@ -246,6 +247,15 @@ export default Vue.extend({
this.connection = this.$root.stream;
}
+ // plugin
+ if (this.$store.state.noteViewInterruptors.length > 0) {
+ let result = this.note;
+ for (const interruptor of this.$store.state.noteViewInterruptors) {
+ result = utils.valToJs(await interruptor.handler(JSON.parse(JSON.stringify(result))));
+ }
+ this.$emit('updated', Object.freeze(result));
+ }
+
this.muted = await checkWordMute(this.appearNote, this.$store.state.i, this.$store.state.settings.mutedWords);
if (this.detail) {