Merge branch 'develop'
This commit is contained in:
commit
ea9b48db3c
@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "misskey",
|
"name": "misskey",
|
||||||
"author": "syuilo <i@syuilo.com>",
|
"author": "syuilo <i@syuilo.com>",
|
||||||
"version": "8.21.1",
|
"version": "8.22.0",
|
||||||
"clientVersion": "1.0.9264",
|
"clientVersion": "1.0.9273",
|
||||||
"codename": "nighthike",
|
"codename": "nighthike",
|
||||||
"main": "./built/index.js",
|
"main": "./built/index.js",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mk-menu">
|
<div class="onchrpzrvnoruiaenfcqvccjfuupzzwv">
|
||||||
<div class="backdrop" ref="backdrop" @click="close"></div>
|
<div class="backdrop" ref="backdrop" @click="close"></div>
|
||||||
<div class="popover" :class="{ hukidasi }" ref="popover">
|
<div class="popover" :class="{ hukidasi }" ref="popover">
|
||||||
<template v-for="item in items">
|
<template v-for="item in items">
|
||||||
@ -119,9 +119,10 @@ export default Vue.extend({
|
|||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
@import '~const.styl'
|
@import '~const.styl'
|
||||||
|
|
||||||
$border-color = rgba(27, 31, 35, 0.15)
|
root(isDark)
|
||||||
|
$bg-color = isDark ? #2c303c : #fff
|
||||||
|
$border-color = rgba(27, 31, 35, 0.15)
|
||||||
|
|
||||||
.mk-menu
|
|
||||||
position initial
|
position initial
|
||||||
|
|
||||||
> .backdrop
|
> .backdrop
|
||||||
@ -131,14 +132,14 @@ $border-color = rgba(27, 31, 35, 0.15)
|
|||||||
z-index 10000
|
z-index 10000
|
||||||
width 100%
|
width 100%
|
||||||
height 100%
|
height 100%
|
||||||
background rgba(#000, 0.1)
|
background rgba(#000, isDark ? 0.5 : 0.1)
|
||||||
opacity 0
|
opacity 0
|
||||||
|
|
||||||
> .popover
|
> .popover
|
||||||
position absolute
|
position absolute
|
||||||
z-index 10001
|
z-index 10001
|
||||||
padding 8px 0
|
padding 8px 0
|
||||||
background #fff
|
background $bg-color
|
||||||
border 1px solid $border-color
|
border 1px solid $border-color
|
||||||
border-radius 4px
|
border-radius 4px
|
||||||
box-shadow 0 3px 12px rgba(27, 31, 35, 0.15)
|
box-shadow 0 3px 12px rgba(27, 31, 35, 0.15)
|
||||||
@ -172,12 +173,13 @@ $border-color = rgba(27, 31, 35, 0.15)
|
|||||||
border-top solid $balloon-size transparent
|
border-top solid $balloon-size transparent
|
||||||
border-left solid $balloon-size transparent
|
border-left solid $balloon-size transparent
|
||||||
border-right solid $balloon-size transparent
|
border-right solid $balloon-size transparent
|
||||||
border-bottom solid $balloon-size #fff
|
border-bottom solid $balloon-size $bg-color
|
||||||
|
|
||||||
> button
|
> button
|
||||||
display block
|
display block
|
||||||
padding 8px 16px
|
padding 8px 16px
|
||||||
width 100%
|
width 100%
|
||||||
|
color isDark ? #d6dce2 : #111
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
color $theme-color-foreground
|
color $theme-color-foreground
|
||||||
@ -191,6 +193,12 @@ $border-color = rgba(27, 31, 35, 0.15)
|
|||||||
> div
|
> div
|
||||||
margin 8px 0
|
margin 8px 0
|
||||||
height 1px
|
height 1px
|
||||||
background #eee
|
background isDark ? #1c2023 : #eee
|
||||||
|
|
||||||
|
.onchrpzrvnoruiaenfcqvccjfuupzzwv[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.onchrpzrvnoruiaenfcqvccjfuupzzwv:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mk-drive-file-chooser">
|
<div class="cdxzvcfawjxdyxsekbxbfgtplebnoneb">
|
||||||
<div class="body">
|
<div class="body">
|
||||||
<header>
|
<header>
|
||||||
<h1>%i18n:@select-file%<span class="count" v-if="files.length > 0">({{ files.length }})</span></h1>
|
<h1>%i18n:@select-file%<span class="count" v-if="files.length > 0">({{ files.length }})</span></h1>
|
||||||
<button class="close" @click="cancel">%fa:times%</button>
|
<button class="close" @click="cancel">%fa:times%</button>
|
||||||
<button v-if="multiple" class="ok" @click="ok">%fa:check%</button>
|
<button v-if="multiple" class="ok" @click="ok">%fa:check%</button>
|
||||||
</header>
|
</header>
|
||||||
<mk-drive ref="browser"
|
<mk-drive class="drive" ref="browser"
|
||||||
:select-file="true"
|
:select-file="true"
|
||||||
:multiple="multiple"
|
:multiple="multiple"
|
||||||
@change-selection="onChangeSelection"
|
@change-selection="onChangeSelection"
|
||||||
@ -46,7 +46,7 @@ export default Vue.extend({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
.mk-drive-file-chooser
|
root(isDark)
|
||||||
position fixed
|
position fixed
|
||||||
z-index 20000
|
z-index 20000
|
||||||
top 0
|
top 0
|
||||||
@ -59,10 +59,11 @@ export default Vue.extend({
|
|||||||
> .body
|
> .body
|
||||||
width 100%
|
width 100%
|
||||||
height 100%
|
height 100%
|
||||||
background #fff
|
background isDark ? #282c37 : #fff
|
||||||
|
|
||||||
> header
|
> header
|
||||||
border-bottom solid 1px #eee
|
border-bottom solid 1px isDark ? #1b1f29 : #eee
|
||||||
|
color isDark ? #fff : #111
|
||||||
|
|
||||||
> h1
|
> h1
|
||||||
margin 0
|
margin 0
|
||||||
@ -90,9 +91,15 @@ export default Vue.extend({
|
|||||||
line-height 42px
|
line-height 42px
|
||||||
width 42px
|
width 42px
|
||||||
|
|
||||||
> .mk-drive
|
> .drive
|
||||||
height calc(100% - 42px)
|
height calc(100% - 42px)
|
||||||
overflow scroll
|
overflow scroll
|
||||||
-webkit-overflow-scrolling touch
|
-webkit-overflow-scrolling touch
|
||||||
|
|
||||||
|
.cdxzvcfawjxdyxsekbxbfgtplebnoneb[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.cdxzvcfawjxdyxsekbxbfgtplebnoneb:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -471,10 +471,6 @@ root(isDark)
|
|||||||
&.reacted
|
&.reacted
|
||||||
color $theme-color
|
color $theme-color
|
||||||
|
|
||||||
&.menu
|
|
||||||
@media (max-width 350px)
|
|
||||||
display none
|
|
||||||
|
|
||||||
.note[data-darkmode]
|
.note[data-darkmode]
|
||||||
root(true)
|
root(true)
|
||||||
|
|
||||||
|
43
src/server/api/endpoints/users/lists/delete.ts
Normal file
43
src/server/api/endpoints/users/lists/delete.ts
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
import $ from 'cafy';
|
||||||
|
import ID from '../../../../../misc/cafy-id';
|
||||||
|
import UserList, { deleteUserList } from '../../../../../models/user-list';
|
||||||
|
import { ILocalUser } from '../../../../../models/user';
|
||||||
|
import getParams from '../../../get-params';
|
||||||
|
|
||||||
|
export const meta = {
|
||||||
|
desc: {
|
||||||
|
'ja-JP': '指定したユーザーリストを削除します。',
|
||||||
|
'en-US': 'Delete a user list'
|
||||||
|
},
|
||||||
|
|
||||||
|
requireCredential: true,
|
||||||
|
|
||||||
|
kind: 'account-write',
|
||||||
|
|
||||||
|
params: {
|
||||||
|
listId: $.type(ID).note({
|
||||||
|
desc: {
|
||||||
|
'ja-JP': '対象となるユーザーリストのID',
|
||||||
|
'en-US': 'ID of target user list'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||||
|
const [ps, psErr] = getParams(meta, params);
|
||||||
|
if (psErr) return rej(psErr);
|
||||||
|
|
||||||
|
const userList = await UserList.findOne({
|
||||||
|
_id: ps.listId,
|
||||||
|
userId: user._id
|
||||||
|
});
|
||||||
|
|
||||||
|
if (userList == null) {
|
||||||
|
return rej('list not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteUserList(userList);
|
||||||
|
|
||||||
|
res();
|
||||||
|
});
|
56
src/server/api/endpoints/users/lists/update.ts
Normal file
56
src/server/api/endpoints/users/lists/update.ts
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
import $ from 'cafy';
|
||||||
|
import ID from '../../../../../misc/cafy-id';
|
||||||
|
import UserList, { pack } from '../../../../../models/user-list';
|
||||||
|
import { ILocalUser } from '../../../../../models/user';
|
||||||
|
import getParams from '../../../get-params';
|
||||||
|
|
||||||
|
export const meta = {
|
||||||
|
desc: {
|
||||||
|
'ja-JP': '指定したユーザーリストを更新します。',
|
||||||
|
'en-US': 'Update a user list'
|
||||||
|
},
|
||||||
|
|
||||||
|
requireCredential: true,
|
||||||
|
|
||||||
|
kind: 'account-write',
|
||||||
|
|
||||||
|
params: {
|
||||||
|
listId: $.type(ID).note({
|
||||||
|
desc: {
|
||||||
|
'ja-JP': '対象となるユーザーリストのID',
|
||||||
|
'en-US': 'ID of target user list'
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
title: $.str.range(1, 100).note({
|
||||||
|
desc: {
|
||||||
|
'ja-JP': 'このユーザーリストの名前',
|
||||||
|
'en-US': 'name of this user list'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||||
|
const [ps, psErr] = getParams(meta, params);
|
||||||
|
if (psErr) throw psErr;
|
||||||
|
|
||||||
|
// Fetch the list
|
||||||
|
const userList = await UserList.findOne({
|
||||||
|
_id: ps.listId,
|
||||||
|
userId: user._id
|
||||||
|
});
|
||||||
|
|
||||||
|
if (userList == null) {
|
||||||
|
return rej('list not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
// update
|
||||||
|
await UserList.update({ _id: userList._id }, {
|
||||||
|
$set: {
|
||||||
|
title: ps.title
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Response
|
||||||
|
res(await pack(userList._id));
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user