This commit is contained in:
syuilo 2020-09-21 00:08:45 +09:00
parent 5fa695830d
commit 8812e0f0d0
11 changed files with 28 additions and 32 deletions

View File

@ -1,5 +1,5 @@
<template> <template>
<x-window ref="window" :width="800" :height="500" @close="$emit('done')" :with-ok-button="true" :ok-button-disabled="(type === 'file') && (selected.length === 0)" @ok="ok()"> <x-window :width="800" :height="500" @close="$emit('done')" :with-ok-button="true" :ok-button-disabled="(type === 'file') && (selected.length === 0)" @ok="ok()">
<template #header> <template #header>
{{ multiple ? ((type === 'file') ? $t('selectFiles') : $t('selectFolders')) : ((type === 'file') ? $t('selectFile') : $t('selectFolder')) }} {{ multiple ? ((type === 'file') ? $t('selectFiles') : $t('selectFolders')) : ((type === 'file') ? $t('selectFile') : $t('selectFolder')) }}
<span v-if="selected.length > 0" style="margin-left: 8px; opacity: 0.5;">({{ number(number) }})</span> <span v-if="selected.length > 0" style="margin-left: 8px; opacity: 0.5;">({{ number(number) }})</span>
@ -14,7 +14,7 @@
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import XDrive from './drive.vue'; import XDrive from './drive.vue';
import XWindow from './window.vue'; import XWindow from './window.vue';
import number from '../filters/number'; import number from '@/filters/number';
import * as os from '@/os'; import * as os from '@/os';
export default defineComponent({ export default defineComponent({

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="ncvczrfv" <div class="ncvczrfv"
:data-is-selected="isSelected" :class="{ isSelected }"
@click="onClick" @click="onClick"
draggable="true" draggable="true"
@dragstart="onDragstart" @dragstart="onDragstart"
@ -238,7 +238,7 @@ export default defineComponent({
} }
} }
&[data-is-selected] { &.isSelected {
background: var(--accent); background: var(--accent);
&:hover { &:hover {

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="rghtznwe" <div class="rghtznwe"
:data-draghover="draghover" :class="{ draghover }"
@click="onClick" @click="onClick"
@mouseover="onMouseover" @mouseover="onMouseover"
@mouseout="onMouseout" @mouseout="onMouseout"
@ -273,7 +273,7 @@ export default defineComponent({
} }
} }
&[data-draghover] { &.draghover {
&:after { &:after {
content: ""; content: "";
pointer-events: none; pointer-events: none;

View File

@ -50,6 +50,7 @@ export default defineComponent({
methods: { methods: {
draw() { draw() {
if (this.hash == null) return;
const pixels = decode(this.hash, this.size, this.size); const pixels = decode(this.hash, this.size, this.size);
const ctx = (this.$refs.canvas as HTMLCanvasElement).getContext('2d'); const ctx = (this.$refs.canvas as HTMLCanvasElement).getContext('2d');
const imageData = ctx!.createImageData(this.size, this.size); const imageData = ctx!.createImageData(this.size, this.size);

View File

@ -126,7 +126,7 @@ import { defineComponent } from 'vue';
import { faChartBar, faUser, faPencilAlt, faSync } from '@fortawesome/free-solid-svg-icons'; import { faChartBar, faUser, faPencilAlt, faSync } from '@fortawesome/free-solid-svg-icons';
import Chart from 'chart.js'; import Chart from 'chart.js';
import MkSelect from './ui/select.vue'; import MkSelect from './ui/select.vue';
import number from '../filters/number'; import number from '@/filters/number';
const sum = (...arr) => arr.reduce((r, a) => r.map((b, i) => a[i] + b)); const sum = (...arr) => arr.reduce((r, a) => r.map((b, i) => a[i] + b));
const negate = arr => arr.map(x => -x); const negate = arr => arr.map(x => -x);

View File

@ -149,7 +149,9 @@ export function selectDriveFile(multiple) {
type: 'file', type: 'file',
multiple multiple
}).then(files => { }).then(files => {
if (files) {
res(multiple ? files : files[0]); res(multiple ? files : files[0]);
}
}); });
}); });
} }

View File

@ -58,7 +58,7 @@ import { faChartLine, faPlus, faHashtag, faRocket } from '@fortawesome/free-soli
import { faBookmark, faCommentAlt } from '@fortawesome/free-regular-svg-icons'; import { faBookmark, faCommentAlt } from '@fortawesome/free-regular-svg-icons';
import XUserList from '@/components/user-list.vue'; import XUserList from '@/components/user-list.vue';
import MkContainer from '@/components/ui/container.vue'; import MkContainer from '@/components/ui/container.vue';
import number from '../filters/number'; import number from '@/filters/number';
import * as os from '@/os'; import * as os from '@/os';
export default defineComponent({ export default defineComponent({

View File

@ -7,9 +7,8 @@
<div class="history" v-if="messages.length > 0"> <div class="history" v-if="messages.length > 0">
<router-link v-for="(message, i) in messages" <router-link v-for="(message, i) in messages"
class="message _panel" class="message _panel"
:class="{ isMe: isMe(message), isRead: message.groupId ? message.reads.includes($store.state.i.id) : message.isRead }"
:to="message.groupId ? `/my/messaging/group/${message.groupId}` : `/my/messaging/${getAcct(isMe(message) ? message.recipient : message.user)}`" :to="message.groupId ? `/my/messaging/group/${message.groupId}` : `/my/messaging/${getAcct(isMe(message) ? message.recipient : message.user)}`"
:data-is-me="isMe(message)"
:data-is-read="message.groupId ? message.reads.includes($store.state.i.id) : message.isRead"
:data-index="i" :data-index="i"
:key="message.id" :key="message.id"
> >
@ -195,12 +194,12 @@ export default defineComponent({
&:active { &:active {
} }
&[data-is-read], &.isRead,
&[data-is-me] { &.isMe {
opacity: 0.8; opacity: 0.8;
} }
&:not([data-is-me]):not([data-is-read]) { &:not(.isMe):not(.isRead) {
> div { > div {
background-image: url("/assets/unread.svg"); background-image: url("/assets/unread.svg");
background-repeat: no-repeat; background-repeat: no-repeat;
@ -287,7 +286,7 @@ export default defineComponent({
&.max-width_400px { &.max-width_400px {
> .history { > .history {
> .message { > .message {
&:not([data-is-me]):not([data-is-read]) { &:not(.isMe):not(.isRead) {
> div { > div {
background-image: none; background-image: none;
border-left: solid 4px #3aa2dc; border-left: solid 4px #3aa2dc;

View File

@ -1,8 +1,8 @@
<template> <template>
<div class="thvuemwp" :data-is-me="isMe"> <div class="thvuemwp" :class="{ isMe }">
<mk-avatar class="avatar" :user="message.user"/> <mk-avatar class="avatar" :user="message.user"/>
<div class="content"> <div class="content">
<div class="balloon" :data-no-text="message.text == null"> <div class="balloon" :class="{ noText: message.text == null }" >
<button class="delete-button" v-if="isMe" :title="$t('delete')" @click="del"> <button class="delete-button" v-if="isMe" :title="$t('delete')" @click="del">
<img src="/assets/remove.png" alt="Delete"/> <img src="/assets/remove.png" alt="Delete"/>
</button> </button>
@ -241,7 +241,7 @@ export default defineComponent({
} }
} }
&:not([data-is-me]) { &:not(.isMe) {
padding-left: var(--margin); padding-left: var(--margin);
> .content { > .content {
@ -252,11 +252,11 @@ export default defineComponent({
$color: var(--messageBg); $color: var(--messageBg);
background: $color; background: $color;
&[data-no-text] { &.noText {
background: transparent; background: transparent;
} }
&:not([data-no-text]):before { &:not(.noText):before {
left: -14px; left: -14px;
border-top: solid 8px transparent; border-top: solid 8px transparent;
border-right: solid 8px $color; border-right: solid 8px $color;
@ -277,7 +277,7 @@ export default defineComponent({
} }
} }
&[data-is-me] { &.isMe {
flex-direction: row-reverse; flex-direction: row-reverse;
padding-right: var(--margin); padding-right: var(--margin);
@ -290,11 +290,11 @@ export default defineComponent({
background: $me-balloon-color; background: $me-balloon-color;
text-align: left; text-align: left;
&[data-no-text] { &.noText {
background: transparent; background: transparent;
} }
&:not([data-no-text]):before { &:not(.noText):before {
right: -14px; right: -14px;
left: auto; left: auto;
border-top: solid 8px transparent; border-top: solid 8px transparent;
@ -326,11 +326,5 @@ export default defineComponent({
} }
} }
} }
&[data-is-deleted] {
> .balloon {
opacity: 0.5;
}
}
} }
</style> </style>

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="mkw-calendar" :class="{ _panel: !props.transparent }"> <div class="mkw-calendar" :class="{ _panel: !props.transparent }">
<div class="calendar" :data-is-holiday="isHoliday"> <div class="calendar" :class="{ isHoliday }">
<p class="month-and-year"> <p class="month-and-year">
<span class="year">{{ $t('yearX', { year }) }}</span> <span class="year">{{ $t('yearX', { year }) }}</span>
<span class="month">{{ $t('monthX', { month }) }}</span> <span class="month">{{ $t('monthX', { month }) }}</span>
@ -121,7 +121,7 @@ export default defineComponent({
width: 60%; width: 60%;
text-align: center; text-align: center;
&[data-is-holiday] { &.isHoliday {
> .day { > .day {
color: #ef95a0; color: #ef95a0;
} }

View File

@ -1,5 +1,5 @@
<template> <template>
<mk-container :show-header="props.showHeader" :naked="props.transparent" :class="$style.root" :data-transparent="props.transparent"> <mk-container :show-header="props.showHeader" :naked="props.transparent" :class="$style.root" :data-transparent="props.transparent ? true : null">
<template #header><fa :icon="faCamera"/>{{ $t('_widgets.photos') }}</template> <template #header><fa :icon="faCamera"/>{{ $t('_widgets.photos') }}</template>
<div class=""> <div class="">