Merge branch 'develop'

This commit is contained in:
syuilo 2019-04-14 20:38:55 +09:00
commit d66e4b7ff9
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
661 changed files with 15350 additions and 15328 deletions

View file

@ -22,7 +22,7 @@
<div>
<span class="type"><mk-file-type-icon :type="file.type"/> {{ file.type }}</span>
<span class="separator"></span>
<span class="data-size">{{ file.datasize | bytes }}</span>
<span class="data-size">{{ file.size | bytes }}</span>
<span class="separator"></span>
<span class="created-at" @click="showCreatedAt"><fa :icon="['far', 'clock']"/><mk-time :time="file.createdAt"/></span>
<template v-if="file.isSensitive">
@ -85,8 +85,8 @@ export default Vue.extend({
},
style(): any {
return this.file.properties.avgColor && this.file.properties.avgColor.length == 3 ? {
'background-color': `rgb(${ this.file.properties.avgColor.join(',') })`
return this.file.properties.avgColor ? {
'background-color': this.file.properties.avgColor
} : {};
},

View file

@ -10,7 +10,7 @@
<footer>
<span class="type"><mk-file-type-icon :type="file.type"/>{{ file.type }}</span>
<span class="separator"></span>
<span class="data-size">{{ file.datasize | bytes }}</span>
<span class="data-size">{{ file.size | bytes }}</span>
<span class="separator"></span>
<span class="created-at"><fa :icon="['far', 'clock']"/><mk-time :time="file.createdAt"/></span>
<template v-if="file.isSensitive">

View file

@ -21,8 +21,8 @@
</template>
</component>
<footer v-if="cursor != null">
<button @click="more" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }">
<footer v-if="more">
<button @click="fetchMore()" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }">
<template v-if="!moreFetching">{{ $t('@.load-more') }}</template>
<template v-if="moreFetching"><fa icon="spinner" pulse fixed-width/></template>
</button>
@ -53,7 +53,7 @@ export default Vue.extend({
fetching: true,
moreFetching: false,
inited: false,
cursor: null
more: false
};
},
@ -113,7 +113,7 @@ export default Vue.extend({
this.notes = x;
} else {
this.notes = x.notes;
this.cursor = x.cursor;
this.more = x.more;
}
this.inited = true;
this.fetching = false;
@ -123,12 +123,12 @@ export default Vue.extend({
});
},
more() {
if (this.cursor == null || this.moreFetching) return;
fetchMore() {
if (!this.more || this.moreFetching) return;
this.moreFetching = true;
this.makePromise(this.cursor).then(x => {
this.makePromise(this.notes[this.notes.length - 1].id).then(x => {
this.notes = this.notes.concat(x.notes);
this.cursor = x.cursor;
this.more = x.more;
this.moreFetching = false;
}, e => {
this.moreFetching = false;
@ -151,7 +151,7 @@ export default Vue.extend({
// 稿
if (this.notes.length >= displayLimit) {
this.notes = this.notes.slice(0, displayLimit);
this.cursor = this.notes[this.notes.length - 1].id
this.more = true;
}
} else {
this.queue.push(note);
@ -182,7 +182,7 @@ export default Vue.extend({
if (this.$el.offsetHeight == 0) return;
const current = window.scrollY + window.innerHeight;
if (current > document.body.offsetHeight - 8) this.more();
if (current > document.body.offsetHeight - 8) this.fetchMore();
}
}
}

View file

@ -54,7 +54,7 @@
</div>
</template>
<template v-if="notification.type == 'poll_vote'">
<template v-if="notification.type == 'pollVote'">
<mk-avatar class="avatar" :user="notification.user"/>
<div class="text">
<p><fa icon="chart-pie"/><mk-user-name :user="notification.user"/></p>

View file

@ -54,7 +54,7 @@
</div>
</div>
<div class="notification poll_vote" v-if="notification.type == 'poll_vote'">
<div class="notification pollVote" v-if="notification.type == 'pollVote'">
<mk-avatar class="avatar" :user="notification.user"/>
<div>
<header>

View file

@ -21,13 +21,7 @@
</div>
<input v-show="useCw" ref="cw" v-model="cw" :placeholder="$t('annotations')" v-autocomplete="{ model: 'cw' }">
<textarea v-model="text" ref="text" :disabled="posting" :placeholder="placeholder" v-autocomplete="{ model: 'text' }"></textarea>
<div class="attaches" v-show="files.length != 0">
<x-draggable class="files" :list="files" :options="{ animation: 150 }">
<div class="file" v-for="file in files" :key="file.id">
<div class="img" :style="`background-image: url(${file.thumbnailUrl})`" @click="detachMedia(file)"></div>
</div>
</x-draggable>
</div>
<x-post-form-attaches class="attaches" :files="files"/>
<mk-poll-editor v-if="poll" ref="poll" @destroyed="poll = false" @updated="onPollUpdate()"/>
<mk-uploader ref="uploader" @uploaded="attachMedia" @change="onChangeUploadings"/>
<footer>
@ -57,7 +51,6 @@
import Vue from 'vue';
import i18n from '../../../i18n';
import insertTextAtCursor from 'insert-text-at-cursor';
import * as XDraggable from 'vuedraggable';
import MkVisibilityChooser from '../../../common/views/components/visibility-chooser.vue';
import getFace from '../../../common/scripts/get-face';
import { parse } from '../../../../../mfm/parse';
@ -66,11 +59,12 @@ import { erase, unique } from '../../../../../prelude/array';
import { length } from 'stringz';
import { toASCII } from 'punycode';
import extractMentions from '../../../../../misc/extract-mentions';
import XPostFormAttaches from '../../../common/views/components/post-form-attaches.vue';
export default Vue.extend({
i18n: i18n('mobile/views/components/post-form.vue'),
components: {
XDraggable
XPostFormAttaches
},
props: {
@ -264,8 +258,8 @@ export default Vue.extend({
this.$emit('change-attached-files', this.files);
},
detachMedia(file) {
this.files = this.files.filter(x => x.id != file.id);
detachMedia(id) {
this.files = this.files.filter(x => x.id != id);
this.$emit('change-attached-files', this.files);
},
@ -481,32 +475,6 @@ export default Vue.extend({
min-width 100%
min-height 80px
> .attaches
> .files
display block
margin 0
padding 4px
list-style none
&:after
content ""
display block
clear both
> .file
display block
float left
margin 0
padding 0
border solid 4px transparent
> .img
width 64px
height 64px
background-size cover
background-position center center
> .mk-uploader
margin 8px 0 0 0
padding 8px

View file

@ -27,12 +27,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
cursor: notes[notes.length - 1].id
more: true
};
} else {
return {
notes: notes,
cursor: null
more: false
};
}
})

View file

@ -27,12 +27,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
cursor: new Date(notes[notes.length - 1].createdAt).getTime()
more: true
};
} else {
return {
notes: notes,
cursor: null
more: false
};
}
})

View file

@ -8,7 +8,7 @@
<mk-note-detail class="post" :note="favorite.note" :key="favorite.note.id"/>
</template>
</sequential-entrance>
<ui-button v-if="existMore" @click="more">{{ $t('@.load-more') }}</ui-button>
<ui-button v-if="existMore" @click="fetchMore()">{{ $t('@.load-more') }}</ui-button>
</main>
</mk-ui>
</template>
@ -53,7 +53,7 @@ export default Vue.extend({
Progress.done();
});
},
more() {
fetchMore() {
this.moreFetching = true;
this.$root.api('i/favorites', {
limit: 11,

View file

@ -59,7 +59,7 @@ export default Vue.extend({
};
if (this.src == 'tag') {
this.endpoint = 'notes/search_by_tag';
this.endpoint = 'notes/search-by-tag';
this.query = {
query: this.tagTl.query
};
@ -114,12 +114,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
cursor: notes[notes.length - 1].id
more: true
};
} else {
return {
notes: notes,
cursor: null
more: false
};
}
});

View file

@ -9,7 +9,7 @@
<span v-if="src == 'global'"><fa icon="globe"/>{{ $t('global') }}</span>
<span v-if="src == 'mentions'"><fa icon="at"/>{{ $t('mentions') }}</span>
<span v-if="src == 'messages'"><fa :icon="['far', 'envelope']"/>{{ $t('messages') }}</span>
<span v-if="src == 'list'"><fa icon="list"/>{{ list.title }}</span>
<span v-if="src == 'list'"><fa icon="list"/>{{ list.name }}</span>
<span v-if="src == 'tag'"><fa icon="hashtag"/>{{ tagTl.title }}</span>
</span>
<span style="margin-left:8px">

View file

@ -21,19 +21,19 @@ export default Vue.extend({
return {
makePromise: cursor => this.$root.api('notes/search', {
limit: limit + 1,
offset: cursor ? cursor : undefined,
untilId: cursor ? cursor : undefined,
query: this.q
}).then(notes => {
if (notes.length == limit + 1) {
notes.pop();
return {
notes: notes,
cursor: cursor ? cursor + limit : limit
more: true
};
} else {
return {
notes: notes,
cursor: null
more: false
};
}
})

View file

@ -19,21 +19,21 @@ export default Vue.extend({
i18n: i18n('mobile/views/pages/tag.vue'),
data() {
return {
makePromise: cursor => this.$root.api('notes/search_by_tag', {
makePromise: cursor => this.$root.api('notes/search-by-tag', {
limit: limit + 1,
offset: cursor ? cursor : undefined,
untilId: cursor ? cursor : undefined,
tag: this.$route.params.tag
}).then(notes => {
if (notes.length == limit + 1) {
notes.pop();
return {
notes: notes,
cursor: cursor ? cursor + limit : limit
more: true
};
} else {
return {
notes: notes,
cursor: null
more: false
};
}
})

View file

@ -1,6 +1,6 @@
<template>
<mk-ui>
<template #header v-if="!fetching"><fa icon="list"/>{{ list.title }}</template>
<template #header v-if="!fetching"><fa icon="list"/>{{ list.name }}</template>
<main v-if="!fetching">
<x-editor :list="list"/>

View file

@ -5,7 +5,7 @@
<main>
<ul>
<li v-for="list in lists" :key="list.id"><router-link :to="`/i/lists/${list.id}`">{{ list.title }}</router-link></li>
<li v-for="list in lists" :key="list.id"><router-link :to="`/i/lists/${list.id}`">{{ list.name }}</router-link></li>
</ul>
</main>
</mk-ui>

View file

@ -4,7 +4,7 @@
<div class="stream" v-if="!fetching && images.length > 0">
<a v-for="(image, i) in images" :key="i"
class="img"
:style="`background-image: url(${thumbnail(image.media)})`"
:style="`background-image: url(${thumbnail(image.file)})`"
:href="image.note | notePage"
></a>
</div>
@ -40,11 +40,11 @@ export default Vue.extend({
untilDate: new Date().getTime() + 1000 * 86400 * 365
}).then(notes => {
for (const note of notes) {
for (const media of note.media) {
for (const file of note.files) {
if (this.images.length < 9) {
this.images.push({
note,
media
file
});
}
}

View file

@ -5,7 +5,7 @@
</template>
<div class="wwtwuxyh" v-if="!fetching">
<div class="is-suspended" v-if="user.isSuspended"><p><fa icon="exclamation-triangle"/> {{ $t('@.user-suspended') }}</p></div>
<div class="is-remote" v-if="user.host != null"><p><fa icon="exclamation-triangle"/> {{ $t('@.is-remote-user') }}<a :href="user.url || user.uri" target="_blank">{{ $t('@.view-on-remote') }}</a></p></div>
<div class="is-remote" v-if="user.host != null"><p><fa icon="exclamation-triangle"/> {{ $t('@.is-remote-user') }}<a :href="user.url" target="_blank">{{ $t('@.view-on-remote') }}</a></p></div>
<header>
<div class="banner" :style="style"></div>
<div class="body">
@ -36,11 +36,11 @@
</dl>
</div>
<div class="info">
<p class="location" v-if="user.host === null && user.profile.location">
<fa icon="map-marker"/>{{ user.profile.location }}
<p class="location" v-if="user.host === null && user.location">
<fa icon="map-marker"/>{{ user.location }}
</p>
<p class="birthday" v-if="user.host === null && user.profile.birthday">
<fa icon="birthday-cake"/>{{ user.profile.birthday.replace('-', '年').replace('-', '月') + '日' }} ({{ $t('years-old', { age }) }})
<p class="birthday" v-if="user.host === null && user.birthday">
<fa icon="birthday-cake"/>{{ user.birthday.replace('-', '年').replace('-', '月') + '日' }} ({{ $t('years-old', { age }) }})
</p>
</div>
<div class="status">
@ -104,7 +104,7 @@ export default Vue.extend({
},
computed: {
age(): number {
return age(this.user.profile.birthday);
return age(this.user.birthday);
},
avator(): string {
return this.$store.state.device.disableShowingAnimatedImages
@ -114,7 +114,7 @@ export default Vue.extend({
style(): any {
if (this.user.bannerUrl == null) return {};
return {
backgroundColor: this.user.bannerColor && this.user.bannerColor.length == 3 ? `rgb(${ this.user.bannerColor.join(',') })` : null,
backgroundColor: this.user.bannerColor,
backgroundImage: `url(${ this.user.bannerUrl })`
};
}

View file

@ -3,10 +3,10 @@
<div class="banner" :style="{ backgroundImage: banner ? `url(${banner})` : null }"></div>
<div>
<img svg-inline src="../../../../assets/title.svg" :alt="name">
<img svg-inline src="../../../../assets/title.svg" alt="Misskey">
<p class="host">{{ host }}</p>
<div class="about">
<h2>{{ name }}</h2>
<h2>{{ name || 'Misskey' }}</h2>
<p v-html="description || this.$t('@.about')"></p>
<router-link class="signup" to="/signup">{{ $t('@.signup') }}</router-link>
</div>
@ -62,7 +62,7 @@
</article>
<div class="info" v-if="meta">
<p>Version: <b>{{ meta.version }}</b></p>
<p>Maintainer: <b><a :href="'mailto:' + meta.maintainer.email" target="_blank">{{ meta.maintainer.name }}</a></b></p>
<p>Maintainer: <b><a :href="'mailto:' + meta.maintainerEmail" target="_blank">{{ meta.maintainerName }}</a></b></p>
</div>
<footer>
<small>{{ copyright }}</small>
@ -87,7 +87,7 @@ export default Vue.extend({
stats: null,
banner: null,
host: toUnicode(host),
name: 'Misskey',
name: null,
description: '',
photos: [],
announcements: []

View file

@ -119,7 +119,7 @@ export default Vue.extend({
},
addWidget() {
this.$store.dispatch('settings/addMobileHomeWidget', {
this.$store.commit('settings/addMobileHomeWidget', {
name: this.widgetAdderSelected,
id: uuid(),
data: {}
@ -127,14 +127,11 @@ export default Vue.extend({
},
removeWidget(widget) {
this.$store.dispatch('settings/removeMobileHomeWidget', widget);
this.$store.commit('settings/removeMobileHomeWidget', widget);
},
saveHome() {
this.$store.commit('settings/setMobileHome', this.widgets);
this.$root.api('i/update_mobile_home', {
home: this.widgets
});
}
}
});