This commit is contained in:
syuilo 2018-02-11 23:26:35 +09:00
parent a0f3182a0a
commit ea2b5a5aac
6 changed files with 105 additions and 59 deletions

View file

@ -32,7 +32,7 @@
<div class="text" ref="text">
<p class="channel" v-if="p.channel"><a :href="`${_CH_URL_}/${p.channel.id}`" target="_blank">{{ p.channel.title }}</a>:</p>
<a class="reply" v-if="p.reply">%fa:reply%</a>
<p class="dummy"></p>
<mk-post-html :ast="p.ast" :i="$root.$data.os.i"/>
<a class="quote" v-if="p.repost">RP:</a>
</div>
<div class="media" v-if="p.media">
@ -94,7 +94,7 @@ export default Vue.extend({
return this.isRepost ? this.post.repost : this.post;
},
reactionsCount(): number {
return this.p.reaction_counts ? Object.keys(this.p.reaction_counts).map(key => this.p.reaction_counts[key]).reduce((a, b) => a + b) : 0;
return this.p.reaction_counts ? Object.keys(this.p.reaction_counts).map(key => this.p.reaction_counts[key]).reduce((a, b) => a + b) : 0;
},
title(): string {
return dateStringify(this.p.created_at);
@ -117,12 +117,6 @@ export default Vue.extend({
if (this.p.text) {
const tokens = this.p.ast;
this.$refs.text.innerHTML = this.$refs.text.innerHTML.replace('<p class="dummy"></p>', compile(tokens));
Array.from(this.$refs.text.children).forEach(e => {
if (e.tagName == 'MK-URL') riot.mount(e);
});
// URL
tokens
.filter(t => (t.type == 'url' || t.type == 'link') && !t.silent)

View file

@ -7,7 +7,7 @@
<footer data-yield="footer">
<yield from="footer"/>
</footer>
</div>
</div>
</template>
<script lang="ts">
@ -31,7 +31,7 @@ export default Vue.extend({
},
methods: {
focus() {
this.$refs.root.children[0].focus();
(this.$refs.root as any).children[0].focus();
}
}
});

View file

@ -27,7 +27,7 @@
<script lang="ts">
import Vue from 'vue';
import anime from 'animejs';
import contains from '../../common/scripts/contains';
import contains from '../../../common/scripts/contains';
const minHeight = 40;
const minWidth = 200;