Merge branch 'develop'

This commit is contained in:
syuilo 2019-06-07 20:47:56 +09:00
commit 7b6e717e23
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
26 changed files with 538 additions and 392 deletions

View file

@ -23,11 +23,11 @@
</div>
<div class="board">
<div class="labels-x" v-if="this.$store.state.settings.games.reversi.showBoardLabels">
<div class="labels-x" v-if="$store.state.settings.gamesReversiShowBoardLabels">
<span v-for="i in game.map[0].length">{{ String.fromCharCode(64 + i) }}</span>
</div>
<div class="flex">
<div class="labels-y" v-if="this.$store.state.settings.games.reversi.showBoardLabels">
<div class="labels-y" v-if="$store.state.settings.gamesReversiShowBoardLabels">
<div v-for="i in game.map.length">{{ i }}</div>
</div>
<div class="cells" :style="cellsStyle">
@ -35,7 +35,7 @@
:class="{ empty: stone == null, none: o.map[i] == 'null', isEnded: game.isEnded, myTurn: !game.isEnded && isMyTurn, can: turnUser ? o.canPut(turnUser.id == blackUser.id, i) : null, prev: o.prevPos == i }"
@click="set(i)"
:title="`${String.fromCharCode(65 + o.transformPosToXy(i)[0])}${o.transformPosToXy(i)[1] + 1}`">
<template v-if="$store.state.settings.games.reversi.useAvatarStones">
<template v-if="$store.state.settings.gamesReversiUseAvatarStones">
<img v-if="stone === true" :src="blackUser.avatarUrl" alt="black">
<img v-if="stone === false" :src="whiteUser.avatarUrl" alt="white">
</template>
@ -45,11 +45,11 @@
</template>
</div>
</div>
<div class="labels-y" v-if="this.$store.state.settings.games.reversi.showBoardLabels">
<div class="labels-y" v-if="this.$store.state.settings.gamesReversiShowBoardLabels">
<div v-for="i in game.map.length">{{ i }}</div>
</div>
</div>
<div class="labels-x" v-if="this.$store.state.settings.games.reversi.showBoardLabels">
<div class="labels-x" v-if="this.$store.state.settings.gamesReversiShowBoardLabels">
<span v-for="i in game.map[0].length">{{ String.fromCharCode(64 + i) }}</span>
</div>
</div>

View file

@ -472,13 +472,13 @@ export default Vue.extend({
},
games_reversi_showBoardLabels: {
get() { return this.$store.state.settings.games.reversi.showBoardLabels; },
set(value) { this.$store.dispatch('settings/set', { key: 'games.reversi.showBoardLabels', value }); }
get() { return this.$store.state.settings.gamesReversiShowBoardLabels; },
set(value) { this.$store.dispatch('settings/set', { key: 'gamesReversiShowBoardLabels', value }); }
},
games_reversi_useAvatarStones: {
get() { return this.$store.state.settings.games.reversi.useAvatarStones; },
set(value) { this.$store.dispatch('settings/set', { key: 'games.reversi.useAvatarStones', value }); }
get() { return this.$store.state.settings.gamesReversiUseAvatarStones; },
set(value) { this.$store.dispatch('settings/set', { key: 'gamesReversiUseAvatarStones', value }); }
},
disableAnimatedMfm: {

View file

@ -43,7 +43,7 @@
</i18n>
</ui-switch>
<div v-if="meta.enableRecaptcha" class="g-recaptcha" :data-sitekey="meta.recaptchaSiteKey" style="margin: 16px 0;"></div>
<ui-button type="submit" :disabled="!(meta.ToSUrl ? ToSAgreement : true)">{{ $t('create') }}</ui-button>
<ui-button type="submit" :disabled="!(meta.ToSUrl ? ToSAgreement : true) || passwordRetypeState == 'not-match'">{{ $t('create') }}</ui-button>
</template>
</form>
</template>

View file

@ -21,10 +21,10 @@ export default Vue.extend({
props: ['url', 'rel'],
data() {
const isSelf = this.url.startsWith(local);
const hasRoute =
const hasRoute = isSelf && (
this.url.substr(local.length).startsWith('/@') ||
this.url.substr(local.length).startsWith('/notes/') ||
this.url.substr(local.length).startsWith('/pages/');
this.url.substr(local.length).startsWith('/pages/'));
return {
local,
schema: null,

View file

@ -1,5 +1,5 @@
<template>
<div v-if="page" class="iroscrza" :class="{ shadow: $store.state.device.useShadow, round: $store.state.device.roundedCorners, center: page.alignCenter }" :style="{ fontFamily: page.font }">
<div v-if="page" class="iroscrza" :class="{ shadow: $store.state.device.useShadow, round: $store.state.device.roundedCorners, center: page.alignCenter }" :style="{ fontFamily: page.font }" :key="path">
<header>
<div class="title">{{ page.title }}</div>
</header>
@ -85,30 +85,46 @@ export default Vue.extend({
};
},
computed: {
path(): string {
return this.username + '/' + this.pageName;
}
},
watch: {
path() {
this.fetch();
}
},
created() {
this.$root.api('pages/show', {
name: this.pageName,
username: this.username,
}).then(page => {
this.page = page;
this.$emit('init', {
title: this.page.title,
icon: faStickyNote
});
const pageVars = this.getPageVars();
this.script = new Script(new ASEvaluator(this.page.variables, pageVars, {
randomSeed: Math.random(),
user: page.user,
visitor: this.$store.state.i,
page: page,
url: url
}), e => {
console.dir(e);
});
});
this.fetch();
},
methods: {
fetch() {
this.$root.api('pages/show', {
name: this.pageName,
username: this.username,
}).then(page => {
this.page = page;
this.$emit('init', {
title: this.page.title,
icon: faStickyNote
});
const pageVars = this.getPageVars();
this.script = new Script(new ASEvaluator(this.page.variables, pageVars, {
randomSeed: Math.random(),
user: page.user,
visitor: this.$store.state.i,
page: page,
url: url
}), e => {
console.dir(e);
});
});
},
getPageVars() {
return collectPageVars(this.page.content);
},

View file

@ -282,7 +282,7 @@ export default class MiOS extends EventEmitter {
// トークンが再生成されたとき
// このままではMisskeyが利用できないので強制的にサインアウトさせる
main.on('myTokenRegenerated', () => {
alert(locale['common']['my-token-regenerated'])
alert(locale['common']['my-token-regenerated']);
this.signout();
});
}

View file

@ -31,12 +31,8 @@ const defaultSettings = {
wallpaper: null,
webSearchEngine: 'https://www.google.com/?#q={{query}}',
mutedWords: [],
games: {
reversi: {
showBoardLabels: false,
useAvatarStones: true,
}
}
gamesReversiShowBoardLabels: false,
gamesReversiUseAvatarStones: true,
};
const defaultDeviceSettings = {

View file

@ -165,6 +165,7 @@ export class NoteRepository extends Repository<Note> {
renoteCount: note.renoteCount,
repliesCount: note.repliesCount,
reactions: note.reactions,
tags: note.tags.length > 0 ? note.tags : undefined,
emojis: reactionEmojis.length > 0 ? Emojis.find({
name: In(reactionEmojis),
host: host

View file

@ -12,7 +12,8 @@ export const meta = {
export default define(meta, async (ps, me) => {
const files = await DriveFiles.find({
userHost: Not(IsNull())
userHost: Not(IsNull()),
isLink: false,
});
for (const file of files) {

View file

@ -40,7 +40,7 @@ export const meta = {
params: {
visibility: {
validator: $.optional.str.or(['public', 'home', 'followers', 'specified', 'private']),
validator: $.optional.str.or(['public', 'home', 'followers', 'specified']),
default: 'public',
desc: {
'ja-JP': '投稿の公開範囲'