Compare commits

..

32 Commits

Author SHA1 Message Date
syuilo
dd509333a3 v5051 2018-04-20 13:39:08 +09:00
syuilo
8ccfbbf24c Darken 2018-04-20 13:38:28 +09:00
syuilo
4953842ff1 ✌️ 2018-04-20 13:31:43 +09:00
syuilo
8a8d97b8c7 🎨 2018-04-20 13:03:51 +09:00
syuilo
5916fcca6a Improve usability 2018-04-20 12:55:18 +09:00
syuilo
2105e4964b ✌️ 2018-04-20 12:38:31 +09:00
syuilo
8ed30d1ff3 ✌️ 2018-04-20 12:18:50 +09:00
syuilo
6f546efdb7 Darken 2018-04-20 12:13:33 +09:00
syuilo
c4f62296a4 Fix bug 2018-04-20 08:05:57 +09:00
syuilo
324477c1c0 v5042 2018-04-20 07:59:13 +09:00
syuilo
160f441a95 [wip] darkmode 2018-04-20 07:59:01 +09:00
syuilo
63fdd0aec4 [wip] darkmode 2018-04-20 07:55:46 +09:00
syuilo
b3cb9c7537 [wip] darkmode 2018-04-20 07:50:49 +09:00
syuilo
8daa9c8062 [wip] darkmode 2018-04-20 07:45:37 +09:00
syuilo
9b3ee877a6 [wip] darkmode 2018-04-20 05:06:32 +09:00
syuilo
5ace37e3db [wip] darkmode 2018-04-20 04:51:04 +09:00
syuilo
2145730409 [wip] darkmode 2018-04-20 04:16:48 +09:00
syuilo
cba07d08d0 [wip] darkmode 2018-04-20 03:56:58 +09:00
syuilo
f2fea7f3cd [wip] darkmode 2018-04-20 03:41:24 +09:00
syuilo
d4a2c6cef4 🎨 2018-04-20 02:16:58 +09:00
syuilo
51f0a5e30b 🎨 2018-04-20 02:09:53 +09:00
syuilo
25e4cebc0f v5030 2018-04-19 19:00:45 +09:00
syuilo
5d0ded2a69 Better error handling 2018-04-19 18:58:57 +09:00
syuilo
bd207b5012 Implement suspend account 2018-04-19 18:54:34 +09:00
syuilo
38b9ed3f27 ✌️ 2018-04-19 18:11:44 +09:00
syuilo
e2202b084b 🎨 2018-04-19 18:10:36 +09:00
syuilo
45b6a6bc54 make logger great again 2018-04-19 18:03:46 +09:00
syuilo
d87e3a0ee3 oops 2018-04-19 15:19:18 +09:00
syuilo
a35b5eb279 v5023 2018-04-19 15:06:07 +09:00
syuilo
7a270275ef Add new text syntax
And some fixes
2018-04-19 15:05:39 +09:00
syuilo
f6a041559f Add doc 2018-04-19 14:32:14 +09:00
syuilo
6ea168485a Fix bug 2018-04-19 14:32:00 +09:00
77 changed files with 1189 additions and 833 deletions

18
cli/suspend.js Normal file
View File

@@ -0,0 +1,18 @@
const mongo = require('mongodb');
const User = require('../built/models/user').default;
const args = process.argv.slice(2);
const userId = new mongo.ObjectID(args[0]);
console.log(`Suspending ${userId}...`);
User.update({ _id: userId }, {
$set: {
isSuspended: true
}
}).then(() => {
console.log(`Suspended ${userId}`);
}, e => {
console.error(e);
});

View File

@@ -98,7 +98,9 @@ common/views/components/nav.vue:
feedback: "Feedback"
common/views/components/note-menu.vue:
favorite: "Favorite this note"
pin: "Pin to profile page"
remote: "Show on origin"
common/views/components/poll.vue:
vote-to: "Vote for '{}'"
@@ -367,9 +369,11 @@ desktop/views/components/settings.profile.vue:
desktop/views/components/ui.header.account.vue:
profile: "Your profile"
drive: "Drive"
favorites: "Favorites"
customize: "Customize"
settings: "Settings"
signout: "Sign out"
dark: "Fall in dark"
desktop/views/components/ui.header.nav.vue:
home: "Home"
@@ -406,6 +410,7 @@ desktop/views/pages/user/user.friends.vue:
no-users: "No users"
desktop/views/pages/user/user.header.vue:
is-suspended: "This account has been suspended."
is-remote: "This user is a remote user, so the information is not accurate. "
view-remote: "See accurate information"
@@ -594,6 +599,7 @@ mobile/views/pages/user.vue:
overview: "Overview"
timeline: "Timeline"
media: "Media"
is-suspended: "This account has been suspended."
is-remote: "This user is a remote user, so the information is not accurate. "
view-remote: "See accurate information"

View File

@@ -98,7 +98,9 @@ common/views/components/nav.vue:
feedback: "フィードバック"
common/views/components/note-menu.vue:
favorite: "Favorite this note"
pin: "Épingler sur votre profile"
remote: "投稿元で見る"
common/views/components/poll.vue:
vote-to: "Voter pour '{}'"
@@ -367,9 +369,11 @@ desktop/views/components/settings.profile.vue:
desktop/views/components/ui.header.account.vue:
profile: "Votre profil"
drive: "Drive"
favorites: "Favorites"
customize: "Modifications"
settings: "Réglages"
signout: "Déconnexion"
dark: "Fall in dark"
desktop/views/components/ui.header.nav.vue:
home: "Accueil"
@@ -406,6 +410,7 @@ desktop/views/pages/user/user.friends.vue:
no-users: "Pas d'utilisateurs"
desktop/views/pages/user/user.header.vue:
is-suspended: "This account has been suspended."
is-remote: "Cet utilisateur n'est pas un utilisateur de Misskey. Certaines informations peuvent être erronées "
view-remote: "Voir les informations détaillées"
@@ -594,6 +599,7 @@ mobile/views/pages/user.vue:
overview: "Aperçu"
timeline: "Fil d'actualité"
media: "Media"
is-suspended: "This account has been suspended."
is-remote: "Cet utilisateur n'est pas un utilisateur de Misskey. Certaines informations peuvent être erronées "
view-remote: "Voir les informations détaillées"

View File

@@ -98,7 +98,9 @@ common/views/components/nav.vue:
feedback: "フィードバック"
common/views/components/note-menu.vue:
favorite: "お気に入り"
pin: "ピン留め"
remote: "投稿元で見る"
common/views/components/poll.vue:
vote-to: "「{}」に投票する"
@@ -367,9 +369,11 @@ desktop/views/components/settings.profile.vue:
desktop/views/components/ui.header.account.vue:
profile: "プロフィール"
drive: "ドライブ"
favorites: "お気に入り"
customize: "カスタマイズ"
settings: "設定"
signout: "サインアウト"
dark: "闇に飲まれる"
desktop/views/components/ui.header.nav.vue:
home: "ホーム"
@@ -406,7 +410,8 @@ desktop/views/pages/user/user.friends.vue:
no-users: "よく話すユーザーはいません"
desktop/views/pages/user/user.header.vue:
is-remote: "このユーザーはリモートユーザーのため情報が正確ではありません。"
is-suspended: "このユーザーは凍結されています。"
is-remote: "このユーザーはリモートユーザーです。"
view-remote: "正確な情報を見る"
desktop/views/pages/user/user.home.vue:
@@ -594,7 +599,8 @@ mobile/views/pages/user.vue:
overview: "概要"
timeline: "タイムライン"
media: "メディア"
is-remote: "このユーザーはリモートユーザーのため情報が正確ではありません。"
is-suspended: "このユーザーは凍結されています。"
is-remote: "このユーザーはリモートユーザーです。"
view-remote: "正確な情報を見る"
mobile/views/pages/user/home.vue:

View File

@@ -1,7 +1,7 @@
{
"name": "misskey",
"author": "syuilo <i@syuilo.com>",
"version": "0.0.5018",
"version": "0.0.5051",
"codename": "nighthike",
"license": "MIT",
"description": "A miniblog-based SNS",
@@ -56,6 +56,7 @@
"@types/koa-bodyparser": "4.2.0",
"@types/koa-compress": "^2.0.8",
"@types/koa-favicon": "2.0.19",
"@types/koa-logger": "^3.1.0",
"@types/koa-mount": "3.0.1",
"@types/koa-multer": "1.0.0",
"@types/koa-router": "7.0.27",
@@ -141,6 +142,7 @@
"koa-compress": "3.0.0",
"koa-favicon": "2.0.1",
"koa-json-body": "^5.3.0",
"koa-logger": "^3.2.0",
"koa-mount": "3.0.0",
"koa-multer": "1.0.2",
"koa-router": "7.4.0",

View File

@@ -62,6 +62,14 @@
app = isMobile ? 'mobile' : 'desktop';
}
// Dark/Light
const me = JSON.parse(localStorage.getItem('me') || null);
if (me && me.clientSettings) {
if ((app == 'desktop' && me.clientSettings.dark) || (app == 'mobile' && me.clientSettings.darkMobile)) {
document.documentElement.setAttribute('data-darkmode', 'true');
}
}
// Script version
const ver = localStorage.getItem('v') || VERSION;

View File

@@ -169,7 +169,7 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
.mk-messaging
root(isDark)
&[data-compact]
font-size 0.8em
@@ -209,7 +209,7 @@ export default Vue.extend({
> .form
padding 8px
background #f7f7f7
background isDark ? #282c37 : #f7f7f7
> label
display block
@@ -241,13 +241,14 @@ export default Vue.extend({
line-height 38px
color #000
outline none
border solid 1px #eee
background isDark ? #191b22 : #fff
border solid 1px isDark ? #495156 : #eee
border-radius 5px
box-shadow none
transition color 0.5s ease, border 0.5s ease
&:hover
border solid 1px #ddd
border solid 1px isDark ? #b0b0b0 : #ddd
transition border 0.2s ease
&:focus
@@ -328,21 +329,21 @@ export default Vue.extend({
> a
display block
text-decoration none
background #fff
border-bottom solid 1px #eee
background isDark ? #282c37 : #fff
border-bottom solid 1px isDark ? #1c2023 : #eee
*
pointer-events none
user-select none
&:hover
background #fafafa
background isDark ? #1e2129 : #fafafa
> .avatar
filter saturate(200%)
&:active
background #eee
background isDark ? #14161b : #eee
&[data-is-read]
&[data-is-me]
@@ -382,17 +383,17 @@ export default Vue.extend({
overflow hidden
text-overflow ellipsis
font-size 1em
color rgba(0, 0, 0, 0.9)
color isDark ? #fff : rgba(0, 0, 0, 0.9)
font-weight bold
transition all 0.1s ease
> .username
margin 0 8px
color rgba(0, 0, 0, 0.5)
color isDark ? #606984 : rgba(0, 0, 0, 0.5)
> .mk-time
margin 0 0 0 auto
color rgba(0, 0, 0, 0.5)
color isDark ? #606984 : rgba(0, 0, 0, 0.5)
font-size 80%
> .avatar
@@ -412,10 +413,10 @@ export default Vue.extend({
overflow hidden
overflow-wrap break-word
font-size 1.1em
color rgba(0, 0, 0, 0.8)
color isDark ? #fff : rgba(0, 0, 0, 0.8)
.me
color rgba(0, 0, 0, 0.4)
color isDark ? rgba(#fff, 0.7) : rgba(0, 0, 0, 0.4)
> .image
display block
@@ -460,4 +461,10 @@ export default Vue.extend({
> .avatar
margin 0 12px 0 0
.mk-messaging[data-darkmode]
root(true)
.mk-messaging:not([data-darkmode])
root(false)
</style>

View File

@@ -97,7 +97,9 @@ export default Vue.component('mk-note-html', {
}, token.content);
case 'code':
return createElement('pre', [
return createElement('pre', {
class: 'code'
}, [
createElement('code', {
domProps: {
innerHTML: token.html
@@ -132,6 +134,13 @@ export default Vue.component('mk-note-html', {
}, text2.replace(/\n/g, ' '));
}
case 'title':
return createElement('div', {
attrs: {
class: 'title'
}
}, token.title);
case 'emoji':
const emoji = emojilib.lib[token.emoji];
return createElement('span', emoji ? emoji.char : token.content);
@@ -144,7 +153,7 @@ export default Vue.component('mk-note-html', {
const _els = [];
els.forEach((el, i) => {
if (el.tag == 'br') {
if (els[i - 1].tag != 'div') {
if (!['div', 'pre'].includes(els[i - 1].tag)) {
_els.push(el);
}
} else {

View File

@@ -2,6 +2,7 @@
<div class="mk-note-menu">
<div class="backdrop" ref="backdrop" @click="close"></div>
<div class="popover" :class="{ compact }" ref="popover">
<button @click="favorite">%i18n:@favorite%</button>
<button v-if="note.userId == os.i.id" @click="pin">%i18n:@pin%</button>
<a v-if="note.uri" :href="note.uri" target="_blank">%i18n:@remote%</a>
</div>
@@ -58,6 +59,14 @@ export default Vue.extend({
});
},
favorite() {
(this as any).api('notes/favorites/create', {
noteId: this.note.id
}).then(() => {
this.$destroy();
});
},
close() {
(this.$refs.backdrop as any).style.pointerEvents = 'none';
anime({
@@ -142,6 +151,7 @@ $border-color = rgba(27, 31, 35, 0.15)
> a
display block
padding 8px 16px
width 100%
&:hover
color $theme-color-foreground

View File

@@ -68,7 +68,7 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
.mk-poll
root(isDark)
> ul
display block
@@ -81,7 +81,8 @@ export default Vue.extend({
margin 4px 0
padding 4px 8px
width 100%
border solid 1px #eee
color isDark ? #fff : #000
border solid 1px isDark ? #5e636f : #eee
border-radius 4px
overflow hidden
cursor pointer
@@ -108,6 +109,8 @@ export default Vue.extend({
margin-left 4px
> p
color isDark ? #a3aebf : #000
a
color inherit
@@ -121,4 +124,10 @@ export default Vue.extend({
&:active
background transparent
.mk-poll[data-darkmode]
root(true)
.mk-poll:not([data-darkmode])
root(false)
</style>

View File

@@ -110,7 +110,7 @@ export default Vue.extend({
$border-color = rgba(27, 31, 35, 0.15)
.mk-reaction-picker
root(isDark)
position initial
> .backdrop
@@ -124,9 +124,10 @@ $border-color = rgba(27, 31, 35, 0.15)
opacity 0
> .popover
$bgcolor = isDark ? #2c303c : #fff
position absolute
z-index 10001
background #fff
background $bgcolor
border 1px solid $border-color
border-radius 4px
box-shadow 0 3px 12px rgba(27, 31, 35, 0.15)
@@ -159,15 +160,15 @@ $border-color = rgba(27, 31, 35, 0.15)
border-top solid $balloon-size transparent
border-left solid $balloon-size transparent
border-right solid $balloon-size transparent
border-bottom solid $balloon-size #fff
border-bottom solid $balloon-size $bgcolor
> p
display block
margin 0
padding 8px 10px
font-size 14px
color #586069
border-bottom solid 1px #e1e4e8
color isDark ? #d6dce2 : #586069
border-bottom solid 1px isDark ? #1c2023 : #e1e4e8
> div
padding 4px
@@ -182,10 +183,16 @@ $border-color = rgba(27, 31, 35, 0.15)
border-radius 2px
&:hover
background #eee
background isDark ? #252731 : #eee
&:active
background $theme-color
box-shadow inset 0 0.15em 0.3em rgba(27, 31, 35, 0.15)
.mk-reaction-picker[data-darkmode]
root(true)
.mk-reaction-picker:not([data-darkmode])
root(false)
</style>

View File

@@ -1,15 +1,15 @@
<template>
<div class="mk-reactions-viewer">
<template v-if="reactions">
<span v-if="reactions.like"><mk-reaction-icon reaction='like'/><span>{{ reactions.like }}</span></span>
<span v-if="reactions.love"><mk-reaction-icon reaction='love'/><span>{{ reactions.love }}</span></span>
<span v-if="reactions.laugh"><mk-reaction-icon reaction='laugh'/><span>{{ reactions.laugh }}</span></span>
<span v-if="reactions.hmm"><mk-reaction-icon reaction='hmm'/><span>{{ reactions.hmm }}</span></span>
<span v-if="reactions.surprise"><mk-reaction-icon reaction='surprise'/><span>{{ reactions.surprise }}</span></span>
<span v-if="reactions.congrats"><mk-reaction-icon reaction='congrats'/><span>{{ reactions.congrats }}</span></span>
<span v-if="reactions.angry"><mk-reaction-icon reaction='angry'/><span>{{ reactions.angry }}</span></span>
<span v-if="reactions.confused"><mk-reaction-icon reaction='confused'/><span>{{ reactions.confused }}</span></span>
<span v-if="reactions.pudding"><mk-reaction-icon reaction='pudding'/><span>{{ reactions.pudding }}</span></span>
<span v-if="reactions.like"><mk-reaction-icon reaction="like"/><span>{{ reactions.like }}</span></span>
<span v-if="reactions.love"><mk-reaction-icon reaction="love"/><span>{{ reactions.love }}</span></span>
<span v-if="reactions.laugh"><mk-reaction-icon reaction="laugh"/><span>{{ reactions.laugh }}</span></span>
<span v-if="reactions.hmm"><mk-reaction-icon reaction="hmm"/><span>{{ reactions.hmm }}</span></span>
<span v-if="reactions.surprise"><mk-reaction-icon reaction="surprise"/><span>{{ reactions.surprise }}</span></span>
<span v-if="reactions.congrats"><mk-reaction-icon reaction="congrats"/><span>{{ reactions.congrats }}</span></span>
<span v-if="reactions.angry"><mk-reaction-icon reaction="angry"/><span>{{ reactions.angry }}</span></span>
<span v-if="reactions.confused"><mk-reaction-icon reaction="confused"/><span>{{ reactions.confused }}</span></span>
<span v-if="reactions.pudding"><mk-reaction-icon reaction="pudding"/><span>{{ reactions.pudding }}</span></span>
</template>
</div>
</template>
@@ -27,9 +27,10 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
.mk-reactions-viewer
border-top dashed 1px #eee
border-bottom dashed 1px #eee
root(isDark)
$borderColor = isDark ? #5e6673 : #eee
border-top dashed 1px $borderColor
border-bottom dashed 1px $borderColor
margin 4px 0
&:empty
@@ -44,6 +45,12 @@ export default Vue.extend({
> span
margin-left 4px
font-size 1.2em
color #444
color isDark ? #d1d5dc : #444
.mk-reactions-viewer[data-darkmode]
root(true)
.mk-reactions-viewer:not([data-darkmode])
root(false)
</style>

View File

@@ -87,7 +87,7 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
.mk-switch
root(isDark)
display flex
margin 12px 0
cursor pointer
@@ -121,11 +121,12 @@ export default Vue.extend({
&:hover
> .label
> span
color #2e3338
color isDark ? #fff : #2e3338
> .button
background #ced2da
border-color #ced2da
$color = isDark ? #15181d : #ced2da
background $color
border-color $color
> input
position absolute
@@ -147,14 +148,16 @@ export default Vue.extend({
border-radius 14px
> .button
$color = isDark ? #1c1f25 : #dcdfe6
display inline-block
margin 0
width 40px
min-width 40px
height 20px
min-height 20px
background #dcdfe6
border 1px solid #dcdfe6
background $color
border 1px solid $color
outline none
border-radius 10px
transition inherit
@@ -179,12 +182,18 @@ export default Vue.extend({
> span
display block
line-height 20px
color #4a535a
color isDark ? #c4ccd2 : #4a535a
transition inherit
> p
margin 0
//font-size 90%
color #9daab3
color isDark ? #78858e : #9daab3
.mk-switch[data-darkmode]
root(true)
.mk-switch:not([data-darkmode])
root(false)
</style>

View File

@@ -50,8 +50,6 @@ export default Vue.extend({
<style lang="stylus" scoped>
.mk-twitter-setting
color #4a535a
.account
border solid 1px #e1e8ed
border-radius 4px

View File

@@ -109,10 +109,10 @@ export default define({
<style lang="stylus" scoped>
@import '~const.styl'
.mkw-calendar
root(isDark)
padding 16px 0
color #777
background #fff
color isDark ? #c5ced6 :#777
background isDark ? #282C37 : #fff
border solid 1px rgba(0, 0, 0, 0.075)
border-radius 6px
@@ -171,7 +171,7 @@ export default define({
margin 0 0 2px 0
font-size 12px
line-height 18px
color #888
color isDark ? #7a8692 : #888
> b
margin-left 2px
@@ -179,7 +179,7 @@ export default define({
> .meter
width 100%
overflow hidden
background #eee
background isDark ? #1c1f25 : #eee
border-radius 8px
> .val
@@ -198,4 +198,10 @@ export default define({
> .meter > .val
background #41ddde
.mkw-calendar[data-darkmode]
root(true)
.mkw-calendar:not([data-darkmode])
root(false)
</style>

View File

@@ -19,9 +19,9 @@ export default define({
</script>
<style lang="stylus" scoped>
.mkw-donation
background #fff
border solid 1px #ead8bb
root(isDark)
background isDark ? #282c37 : #fff
border solid 1px isDark ? #c3831c : #ead8bb
border-radius 6px
> article
@@ -30,7 +30,7 @@ export default define({
> h1
margin 0 0 5px 0
font-size 1em
color #888
color isDark ? #b2bac1 : #888
> [data-fa]
margin-right 0.25em
@@ -40,7 +40,7 @@ export default define({
z-index 1
margin 0
font-size 0.8em
color #999
color isDark ? #a1a6ab : #999
&[data-mobile]
border none
@@ -55,4 +55,10 @@ export default define({
> p
color #777d71
.mkw-donation[data-darkmode]
root(true)
.mkw-donation:not([data-darkmode])
root(false)
</style>

View File

@@ -1,7 +1,7 @@
<template>
<div class="mkw-nav">
<mk-widget-container>
<div :class="$style.body">
<div class="mkw-nav--body">
<mk-nav/>
</div>
</mk-widget-container>
@@ -15,17 +15,24 @@ export default define({
});
</script>
<style lang="stylus" module>
.body
padding 16px
font-size 12px
color #aaa
background #fff
<style lang="stylus" scoped>
root(isDark)
.mkw-nav--body
padding 16px
font-size 12px
color isDark ? #9aa4b3 : #aaa
background isDark ? #282c37 : #fff
a
color #999
a
color isDark ? #9aa4b3 : #999
i
color #ccc
i
color isDark ? #9aa4b3 : #ccc
.mkw-nav[data-darkmode]
root(true)
.mkw-nav:not([data-darkmode])
root(false)
</style>

View File

@@ -4,9 +4,11 @@
<template slot="header">%fa:rss-square%RSS</template>
<button slot="func" title="設定" @click="setting">%fa:cog%</button>
<p :class="$style.fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:common.loading%<mk-ellipsis/></p>
<div :class="$style.feed" v-else>
<a v-for="item in items" :href="item.link" target="_blank">{{ item.title }}</a>
<div class="mkw-rss--body">
<p class="fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:common.loading%<mk-ellipsis/></p>
<div class="feed" v-else>
<a v-for="item in items" :href="item.link" target="_blank">{{ item.title }}</a>
</div>
</div>
</mk-widget-container>
</div>
@@ -56,38 +58,46 @@ export default define({
});
</script>
<style lang="stylus" module>
.feed
padding 12px 16px
font-size 0.9em
<style lang="stylus" scoped>
root(isDark)
.mkw-rss--body
.feed
padding 12px 16px
font-size 0.9em
> a
display block
padding 4px 0
color #666
border-bottom dashed 1px #eee
> a
display block
padding 4px 0
color isDark ? #9aa4b3 : #666
border-bottom dashed 1px isDark ? #1c2023 : #eee
&:last-child
border-bottom none
&:last-child
border-bottom none
.fetching
margin 0
padding 16px
text-align center
color #aaa
.fetching
margin 0
padding 16px
text-align center
color #aaa
> [data-fa]
margin-right 4px
> [data-fa]
margin-right 4px
&[data-mobile]
.feed
padding 0
font-size 1em
&[data-mobile]
.feed
padding 0
font-size 1em
> a
padding 8px 16px
> a
padding 8px 16px
&:nth-child(even)
background rgba(0, 0, 0, 0.05)
&:nth-child(even)
background rgba(0, 0, 0, 0.05)
.mkw-rss[data-darkmode]
root(true)
.mkw-rss:not([data-darkmode])
root(false)
</style>

View File

@@ -100,7 +100,7 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
.cpu-memory
root(isDark)
> svg
display block
padding 10px
@@ -115,7 +115,7 @@ export default Vue.extend({
> text
font-size 5px
fill rgba(0, 0, 0, 0.55)
fill isDark ? rgba(#fff, 0.55) : rgba(#000, 0.55)
> tspan
opacity 0.5
@@ -124,4 +124,11 @@ export default Vue.extend({
content ""
display block
clear both
.cpu-memory[data-darkmode]
root(true)
.cpu-memory:not([data-darkmode])
root(false)
</style>

View File

@@ -38,7 +38,7 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
.cpu
root(isDark)
> .pie
padding 10px
height 100px
@@ -52,7 +52,7 @@ export default Vue.extend({
> p
margin 0
font-size 12px
color #505050
color isDark ? #a8b4bd : #505050
&:first-child
font-weight bold
@@ -65,4 +65,10 @@ export default Vue.extend({
display block
clear both
.cpu[data-darkmode]
root(true)
.cpu:not([data-darkmode])
root(false)
</style>

View File

@@ -46,7 +46,7 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
.disk
root(isDark)
> .pie
padding 10px
height 100px
@@ -60,7 +60,7 @@ export default Vue.extend({
> p
margin 0
font-size 12px
color #505050
color isDark ? #a8b4bd : #505050
&:first-child
font-weight bold
@@ -73,4 +73,10 @@ export default Vue.extend({
display block
clear both
.disk[data-darkmode]
root(true)
.disk:not([data-darkmode])
root(false)
</style>

View File

@@ -46,7 +46,7 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
.memory
root(isDark)
> .pie
padding 10px
height 100px
@@ -60,7 +60,7 @@ export default Vue.extend({
> p
margin 0
font-size 12px
color #505050
color isDark ? #a8b4bd : #505050
&:first-child
font-weight bold
@@ -73,4 +73,10 @@ export default Vue.extend({
display block
clear both
.memory[data-darkmode]
root(true)
.memory:not([data-darkmode])
root(false)
</style>

View File

@@ -45,7 +45,7 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
svg
root(isDark)
display block
height 100%
@@ -56,6 +56,12 @@ svg
> text
font-size 0.15px
fill rgba(0, 0, 0, 0.6)
fill isDark ? rgba(#fff, 0.6) : rgba(0, 0, 0, 0.6)
svg[data-darkmode]
root(true)
svg:not([data-darkmode])
root(false)
</style>

View File

@@ -2,6 +2,7 @@
* Desktop Client
*/
import Vue from 'vue';
import VueRouter from 'vue-router';
// Style
@@ -24,6 +25,7 @@ import updateBanner from './api/update-banner';
import MkIndex from './views/pages/index.vue';
import MkUser from './views/pages/user/user.vue';
import MkFavorites from './views/pages/favorites.vue';
import MkSelectDrive from './views/pages/selectdrive.vue';
import MkDrive from './views/pages/drive.vue';
import MkHomeCustomize from './views/pages/home-customize.vue';
@@ -49,6 +51,7 @@ init(async (launch) => {
routes: [
{ path: '/', name: 'index', component: MkIndex },
{ path: '/i/customize-home', component: MkHomeCustomize },
{ path: '/i/favorites', component: MkFavorites },
{ path: '/i/messaging/:user', component: MkMessagingRoom },
{ path: '/i/drive', component: MkDrive },
{ path: '/i/drive/folder/:folder', component: MkDrive },

View File

@@ -44,6 +44,25 @@ html
height 100%
background #f7f7f7
&[data-darkmode]
background #191B22
&, *
&::-webkit-scrollbar-track
background-color #282C37
&::-webkit-scrollbar
width 6px
&::-webkit-scrollbar-thumb
background-color #454954
&:hover
background-color #535660
&:active
background-color $theme-color
body
display flex
flex-direction column

View File

@@ -123,3 +123,59 @@ textarea.ui
font-size 90%
font-weight bold
color rgba(#373a3c, 0.9)
html[data-darkmode]
button.ui
.button.ui
color #fff
background linear-gradient(to bottom, #313543 0%, #282c37 100%)
border-color #1c2023
&:hover
background linear-gradient(to bottom, #2c2f3c 0%, #22262f 100%)
border-color #151a1d
&:active
background #22262f
border-color #151a1d
&.primary
color $theme-color-foreground
background linear-gradient(to bottom, lighten($theme-color, 25%) 0%, lighten($theme-color, 10%) 100%)
border solid 1px lighten($theme-color, 15%)
&:hover:not(:disabled)
background linear-gradient(to bottom, lighten($theme-color, 8%) 0%, darken($theme-color, 8%) 100%)
border-color $theme-color
&:active:not(:disabled)
background $theme-color
border-color $theme-color
input:not([type]).ui
input[type='text'].ui
input[type='password'].ui
input[type='email'].ui
input[type='date'].ui
input[type='number'].ui
textarea.ui
display block
padding 10px
width 100%
height 40px
font-family sans-serif
font-size 16px
color #dee4e8
background #191b22
border solid 1px #495156
border-radius 4px
&:hover
border-color #b0b0b0
&:focus
border-color $theme-color
.ui.from.group
> p:first-child
color #c0c7cc

View File

@@ -1,14 +1,15 @@
<template>
<div class="mk-activity" :data-melt="design == 2">
<template v-if="design == 0">
<p class="title">%fa:chart-bar%%i18n:@title%</p>
<button @click="toggle" title="%i18n:@toggle%">%fa:sort%</button>
</template>
<p class="fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:common.loading%<mk-ellipsis/></p>
<template v-else>
<x-calendar v-show="view == 0" :data="[].concat(activity)"/>
<x-chart v-show="view == 1" :data="[].concat(activity)"/>
</template>
<div class="mk-activity">
<mk-widget-container :show-header="design == 0" :naked="design == 2">
<template slot="header">%fa:chart-bar%%i18n:@title%</template>
<button slot="func" title="%i18n:@toggle%" @click="toggle">%fa:sort%</button>
<p :class="$style.fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:common.loading%<mk-ellipsis/></p>
<template v-else>
<x-calendar v-show="view == 0" :data="[].concat(activity)"/>
<x-chart v-show="view == 1" :data="[].concat(activity)"/>
</template>
</mk-widget-container>
</div>
</template>
@@ -64,53 +65,14 @@ export default Vue.extend({
});
</script>
<style lang="stylus" scoped>
.mk-activity
background #fff
border solid 1px rgba(0, 0, 0, 0.075)
border-radius 6px
<style lang="stylus" module>
.fetching
margin 0
padding 16px
text-align center
color #aaa
&[data-melt]
background transparent !important
border none !important
> .title
z-index 1
margin 0
padding 0 16px
line-height 42px
font-size 0.9em
font-weight bold
color #888
box-shadow 0 1px rgba(0, 0, 0, 0.07)
> [data-fa]
margin-right 4px
> button
position absolute
z-index 2
top 0
right 0
padding 0
width 42px
font-size 0.9em
line-height 42px
color #ccc
&:hover
color #aaa
&:active
color #999
> .fetching
margin 0
padding 16px
text-align center
color #aaa
> [data-fa]
margin-right 4px
> [data-fa]
margin-right 4px
</style>

View File

@@ -133,9 +133,9 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
.mk-calendar
color #777
background #fff
root(isDark)
color isDark ? #c5ced6 : #777
background isDark ? #282C37 : #fff
border solid 1px rgba(0, 0, 0, 0.075)
border-radius 6px
@@ -249,4 +249,10 @@ export default Vue.extend({
&:active > div
background darken($theme-color, 10%)
.mk-calendar[data-darkmode]
root(true)
.mk-calendar:not([data-darkmode])
root(false)
</style>

View File

@@ -31,7 +31,7 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
.menu
root(isDark)
$width = 240px
$item-height = 38px
$padding = 10px
@@ -46,7 +46,7 @@ export default Vue.extend({
&.divider
margin-top $padding
padding-top $padding
border-top solid 1px #eee
border-top solid 1px isDark ? #1c2023 : #eee
&.nest
> p
@@ -75,7 +75,7 @@ export default Vue.extend({
margin 0
padding 0 32px 0 38px
line-height $item-height
color #868C8C
color isDark ? #c8cece : #868C8C
text-decoration none
cursor pointer
@@ -104,11 +104,17 @@ export default Vue.extend({
left $width
margin-top -($padding)
width $width
background #fff
background isDark ? #282c37 :#fff
border-radius 0 4px 4px 4px
box-shadow 2px 2px 8px rgba(0, 0, 0, 0.2)
transition visibility 0s linear 0.2s
.menu[data-darkmode]
root(true)
.menu:not([data-darkmode])
root(false)
</style>
<style lang="stylus" module>

View File

@@ -54,7 +54,7 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
.context-menu
root(isDark)
$width = 240px
$item-height = 38px
$padding = 10px
@@ -66,9 +66,15 @@ export default Vue.extend({
z-index 4096
width $width
font-size 0.8em
background #fff
background isDark ? #282c37 : #fff
border-radius 0 4px 4px 4px
box-shadow 2px 2px 8px rgba(0, 0, 0, 0.2)
opacity 0
.context-menu[data-darkmode]
root(true)
.context-menu:not([data-darkmode])
root(false)
</style>

View File

@@ -186,7 +186,7 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
.root.file
root(isDark)
padding 8px 0 0 0
height 180px
border-radius 4px
@@ -308,10 +308,16 @@ export default Vue.extend({
font-size 0.8em
text-align center
word-break break-all
color #444
color isDark ? #fff : #444
overflow hidden
> .ext
opacity 0.5
.root.file[data-darkmode]
root(true)
.root.file:not([data-darkmode])
root(false)
</style>

View File

@@ -577,7 +577,7 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
.mk-drive
root(isDark)
> nav
display block
@@ -585,9 +585,8 @@ export default Vue.extend({
width 100%
overflow auto
font-size 0.9em
color #555
background #fff
//border-bottom 1px solid #dfdfdf
color isDark ? #d2d9dc : #555
background isDark ? #282c37 : #fff
box-shadow 0 1px 0 rgba(0, 0, 0, 0.05)
&, *
@@ -665,6 +664,7 @@ export default Vue.extend({
padding 8px
height calc(100% - 38px)
overflow auto
background isDark ? #191b22 : #fff
&, *
user-select none
@@ -770,4 +770,10 @@ export default Vue.extend({
> input
display none
.mk-drive[data-darkmode]
root(true)
.mk-drive:not([data-darkmode])
root(false)
</style>

View File

@@ -94,7 +94,7 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
.mk-follow-button
root(isDark)
display block
cursor pointer
padding 0
@@ -121,17 +121,17 @@ export default Vue.extend({
border-radius 8px
&.follow
color #888
background linear-gradient(to bottom, #ffffff 0%, #f5f5f5 100%)
border solid 1px #e2e2e2
color isDark ? #fff : #888
background isDark ? linear-gradient(to bottom, #313543 0%, #282c37 100%) : linear-gradient(to bottom, #ffffff 0%, #f5f5f5 100%)
border solid 1px isDark ? #1c2023 : #e2e2e2
&:hover
background linear-gradient(to bottom, #f9f9f9 0%, #ececec 100%)
border-color #dcdcdc
background isDark ? linear-gradient(to bottom, #2c2f3c 0%, #22262f 100%) : linear-gradient(to bottom, #f9f9f9 0%, #ececec 100%)
border-color isDark ? #151a1d : #dcdcdc
&:active
background #ececec
border-color #dcdcdc
background isDark ? #22262f : #ececec
border-color isDark ? #151a1d : #dcdcdc
&.unfollow
color $theme-color-foreground
@@ -161,4 +161,10 @@ export default Vue.extend({
i
margin-right 8px
.mk-follow-button[data-darkmode]
root(true)
.mk-follow-button:not([data-darkmode])
root(false)
</style>

View File

@@ -33,19 +33,14 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
.mk-note-preview
root(isDark)
font-size 0.9em
background #fff
&:after
content ""
display block
clear both
&:hover
> .main > footer > button
color #888
> .avatar-anchor
display block
float left
@@ -70,7 +65,7 @@ export default Vue.extend({
> .name
margin 0 .5em 0 0
padding 0
color #607073
color isDark ? #fff : #607073
font-size 1em
font-weight bold
text-decoration none
@@ -81,11 +76,11 @@ export default Vue.extend({
> .username
margin 0 .5em 0 0
color #d1d8da
color isDark ? #606984 : #d1d8da
> .time
margin-left auto
color #b2b8bb
color isDark ? #606984 : #b2b8bb
> .body
@@ -94,6 +89,12 @@ export default Vue.extend({
margin 0
padding 0
font-size 1.1em
color #717171
color isDark ? #959ba7 : #717171
.mk-note-preview[data-darkmode]
root(true)
.mk-note-preview:not([data-darkmode])
root(false)
</style>

View File

@@ -33,7 +33,7 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
.sub
root(isDark)
margin 0
padding 16px
font-size 0.9em
@@ -43,10 +43,6 @@ export default Vue.extend({
display block
clear both
&:hover
> .main > footer > button
color #888
> .avatar-anchor
display block
float left
@@ -75,7 +71,7 @@ export default Vue.extend({
margin 0 .5em 0 0
padding 0
overflow hidden
color #607073
color isDark ? #fff : #607073
font-size 1em
font-weight bold
text-decoration none
@@ -86,23 +82,31 @@ export default Vue.extend({
> .username
margin 0 .5em 0 0
color #d1d8da
color isDark ? #606984 : #d1d8da
> .created-at
margin-left auto
color #b2b8bb
color isDark ? #606984 : #b2b8bb
> .body
max-height 128px
overflow hidden
> .text
cursor default
margin 0
padding 0
font-size 1.1em
color #717171
color isDark ? #959ba7 : #717171
pre
max-height 120px
font-size 80%
.sub[data-darkmode]
root(true)
.sub:not([data-darkmode])
root(false)
</style>

View File

@@ -291,20 +291,21 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
.note
root(isDark)
margin 0
padding 0
background #fff
border-bottom solid 1px #eaeaea
background isDark ? #282C37 : #fff
border-bottom solid 1px isDark ? #1c2023 : #eaeaea
&:first-child
border-top-left-radius 6px
border-top-right-radius 6px
> .renote
&[data-round]
&:first-child
border-top-left-radius 6px
border-top-right-radius 6px
> .renote
border-top-left-radius 6px
border-top-right-radius 6px
&:last-of-type
border-bottom none
@@ -324,7 +325,7 @@ export default Vue.extend({
> .renote
color #9dbb00
background linear-gradient(to bottom, #edfde2 0%, #fff 100%)
background isDark ? linear-gradient(to bottom, #314027 0%, #282c37 100%) : linear-gradient(to bottom, #edfde2 0%, #fff 100%)
> p
margin 0
@@ -374,7 +375,7 @@ export default Vue.extend({
&:hover
> .main > footer > button
color #888
color isDark ? #707b97 : #888
> .avatar-anchor
display block
@@ -407,7 +408,7 @@ export default Vue.extend({
margin 0 .5em 0 0
padding 0
overflow hidden
color #627079
color isDark ? #fff : #627079
font-size 1em
font-weight bold
text-decoration none
@@ -426,7 +427,7 @@ export default Vue.extend({
> .username
margin 0 .5em 0 0
color #ccc
color isDark ? #606984 : #ccc
> .info
margin-left auto
@@ -434,7 +435,7 @@ export default Vue.extend({
> .mobile
margin-right 8px
color #ccc
color isDark ? #606984 : #ccc
> .app
margin-right 8px
@@ -443,7 +444,7 @@ export default Vue.extend({
border-right solid 1px #eaeaea
> .created-at
color #c0c0c0
color isDark ? #606984 : #c0c0c0
> .body
@@ -454,17 +455,29 @@ export default Vue.extend({
padding 0
overflow-wrap break-word
font-size 1.1em
color #717171
color isDark ? #fff : #717171
>>> .title
display block
margin-bottom 4px
padding 4px
font-size 90%
text-align center
background isDark ? #2f3944 : #eef1f3
border-radius 4px
>>> .code
margin 8px 0
>>> .quote
margin 8px
padding 6px 12px
color #aaa
border-left solid 3px #eee
color isDark ? #6f808e : #aaa
border-left solid 3px isDark ? #637182 : #eee
> .reply
margin-right 8px
color #717171
color isDark ? #99abbf : #717171
> .rp
margin-left 4px
@@ -535,13 +548,13 @@ export default Vue.extend({
padding 0 8px
line-height 32px
font-size 1em
color #ddd
color isDark ? #606984 : #ddd
background transparent
border none
cursor pointer
&:hover
color #666
color isDark ? #9198af : #666
> .count
display inline
@@ -560,6 +573,12 @@ export default Vue.extend({
padding-top 4px
background rgba(0, 0, 0, 0.0125)
.note[data-darkmode]
root(true)
.note:not([data-darkmode])
root(false)
</style>
<style lang="stylus" module>

View File

@@ -50,17 +50,16 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
.mk-notes
root(isDark)
> .date
display block
margin 0
line-height 32px
font-size 14px
text-align center
color #aaa
background #fdfdfd
border-bottom solid 1px #eaeaea
color isDark ? #666b79 : #aaa
background isDark ? #242731 : #fdfdfd
border-bottom solid 1px isDark ? #1c2023 : #eaeaea
span
margin 0 16px
@@ -86,4 +85,11 @@ export default Vue.extend({
&:active
background #eee
.mk-notes[data-darkmode]
root(true)
.mk-notes:not([data-darkmode])
root(false)
</style>

View File

@@ -185,14 +185,14 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
.mk-notifications
root(isDark)
> .notifications
> .notification
margin 0
padding 16px
overflow-wrap break-word
font-size 0.9em
border-bottom solid 1px rgba(0, 0, 0, 0.05)
border-bottom solid 1px isDark ? #1c2023 : rgba(0, 0, 0, 0.05)
&:last-child
border-bottom none
@@ -203,7 +203,7 @@ export default Vue.extend({
top 16px
right 12px
vertical-align top
color rgba(0, 0, 0, 0.6)
color isDark ? #606984 : rgba(0, 0, 0, 0.6)
font-size small
&:after
@@ -238,10 +238,10 @@ export default Vue.extend({
margin-right 4px
.note-preview
color rgba(0, 0, 0, 0.7)
color isDark ? #c2cad4 : rgba(0, 0, 0, 0.7)
.note-ref
color rgba(0, 0, 0, 0.7)
color isDark ? #c2cad4 : rgba(0, 0, 0, 0.7)
[data-fa]
font-size 1em
@@ -268,9 +268,9 @@ export default Vue.extend({
line-height 32px
text-align center
font-size 0.8em
color #aaa
background #fdfdfd
border-bottom solid 1px rgba(0, 0, 0, 0.05)
color isDark ? #666b79 : #aaa
background isDark ? #242731 : #fdfdfd
border-bottom solid 1px isDark ? #1c2023 : rgba(0, 0, 0, 0.05)
span
margin 0 16px
@@ -312,4 +312,10 @@ export default Vue.extend({
> [data-fa]
margin-right 4px
.mk-notifications[data-darkmode]
root(true)
.mk-notifications:not([data-darkmode])
root(false)
</style>

View File

@@ -281,10 +281,10 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
.mk-post-form
root(isDark)
display block
padding 16px
background lighten($theme-color, 95%)
background isDark ? #282C37 : lighten($theme-color, 95%)
&:after
content ""
@@ -303,7 +303,7 @@ export default Vue.extend({
min-height calc(16px + 12px + 12px)
font-size 16px
color #333
background #fff
background isDark ? #191d23 : #fff
outline none
border solid 1px rgba($theme-color, 0.1)
border-radius 4px
@@ -341,7 +341,7 @@ export default Vue.extend({
> .medias
margin 0
padding 0
background lighten($theme-color, 98%)
background isDark ? #181b23 : lighten($theme-color, 98%)
border solid 1px rgba($theme-color, 0.1)
border-top none
border-radius 0 0 4px 4px
@@ -496,7 +496,7 @@ export default Vue.extend({
width 40px
height 40px
font-size 1em
color rgba($theme-color, 0.5)
color isDark ? $theme-color : rgba($theme-color, 0.5)
background transparent
outline none
border solid 1px transparent
@@ -504,11 +504,11 @@ export default Vue.extend({
&:hover
background transparent
border-color rgba($theme-color, 0.3)
border-color isDark ? rgba($theme-color, 0.5) : rgba($theme-color, 0.3)
&:active
color rgba($theme-color, 0.6)
background linear-gradient(to bottom, lighten($theme-color, 80%) 0%, lighten($theme-color, 90%) 100%)
background isDark ? transparent : linear-gradient(to bottom, lighten($theme-color, 80%) 0%, lighten($theme-color, 90%) 100%)
border-color rgba($theme-color, 0.5)
box-shadow 0 2px 4px rgba(0, 0, 0, 0.15) inset
@@ -533,4 +533,10 @@ export default Vue.extend({
border dashed 2px rgba($theme-color, 0.5)
pointer-events none
.mk-post-form[data-darkmode]
root(true)
.mk-post-form:not([data-darkmode])
root(false)
</style>

View File

@@ -4,8 +4,8 @@
<template v-if="!quote">
<footer>
<a class="quote" v-if="!quote" @click="onQuote">%i18n:@quote%</a>
<button class="cancel" @click="cancel">%i18n:@cancel%</button>
<button class="ok" @click="ok" :disabled="wait">{{ wait ? '%i18n:!@reposting%' : '%i18n:!@renote%' }}</button>
<button class="ui cancel" @click="cancel">%i18n:@cancel%</button>
<button class="ui primary ok" @click="ok" :disabled="wait">{{ wait ? '%i18n:!@reposting%' : '%i18n:!@renote%' }}</button>
</footer>
</template>
<template v-if="quote">
@@ -59,14 +59,14 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
.mk-renote-form
root(isDark)
> .mk-note-preview
margin 16px 22px
> footer
height 72px
background lighten($theme-color, 95%)
background isDark ? #313543 : lighten($theme-color, 95%)
> .quote
position absolute
@@ -78,54 +78,19 @@ export default Vue.extend({
display block
position absolute
bottom 16px
cursor pointer
padding 0
margin 0
width 120px
height 40px
font-size 1em
outline none
border-radius 4px
&:focus
&:after
content ""
pointer-events none
position absolute
top -5px
right -5px
bottom -5px
left -5px
border 2px solid rgba($theme-color, 0.3)
border-radius 8px
&.cancel
right 148px
> .cancel
right 148px
color #888
background linear-gradient(to bottom, #ffffff 0%, #f5f5f5 100%)
border solid 1px #e2e2e2
&.ok
right 16px
&:hover
background linear-gradient(to bottom, #f9f9f9 0%, #ececec 100%)
border-color #dcdcdc
.mk-renote-form[data-darkmode]
root(true)
&:active
background #ececec
border-color #dcdcdc
> .ok
right 16px
font-weight bold
color $theme-color-foreground
background linear-gradient(to bottom, lighten($theme-color, 25%) 0%, lighten($theme-color, 10%) 100%)
border solid 1px lighten($theme-color, 15%)
&:hover
background linear-gradient(to bottom, lighten($theme-color, 8%) 0%, darken($theme-color, 8%) 100%)
border-color $theme-color
&:active
background $theme-color
border-color $theme-color
.mk-renote-form:not([data-darkmode])
root(false)
</style>

View File

@@ -1,131 +0,0 @@
<template>
<div class="mk-renote-form">
<mk-note-preview :note="note"/>
<template v-if="!quote">
<footer>
<a class="quote" v-if="!quote" @click="onQuote">%i18n:desktop.tags.mk-renote-form.quote%</a>
<button class="cancel" @click="cancel">%i18n:desktop.tags.mk-renote-form.cancel%</button>
<button class="ok" @click="ok" :disabled="wait">{{ wait ? '%i18n:!desktop.tags.mk-renote-form.reposting%' : '%i18n:!desktop.tags.mk-renote-form.renote%' }}</button>
</footer>
</template>
<template v-if="quote">
<mk-post-form ref="form" :renote="note" @posted="onChildFormPosted"/>
</template>
</div>
</template>
<script lang="ts">
import Vue from 'vue';
export default Vue.extend({
props: ['note'],
data() {
return {
wait: false,
quote: false
};
},
methods: {
ok() {
this.wait = true;
(this as any).api('notes/create', {
renoteId: this.note.id
}).then(data => {
this.$emit('posted');
(this as any).apis.notify('%i18n:!desktop.tags.mk-renote-form.success%');
}).catch(err => {
(this as any).apis.notify('%i18n:!desktop.tags.mk-renote-form.failure%');
}).then(() => {
this.wait = false;
});
},
cancel() {
this.$emit('canceled');
},
onQuote() {
this.quote = true;
this.$nextTick(() => {
(this.$refs.form as any).focus();
});
},
onChildFormPosted() {
this.$emit('posted');
}
}
});
</script>
<style lang="stylus" scoped>
@import '~const.styl'
.mk-renote-form
> .mk-note-preview
margin 16px 22px
> footer
height 72px
background lighten($theme-color, 95%)
> .quote
position absolute
bottom 16px
left 28px
line-height 40px
button
display block
position absolute
bottom 16px
cursor pointer
padding 0
margin 0
width 120px
height 40px
font-size 1em
outline none
border-radius 4px
&:focus
&:after
content ""
pointer-events none
position absolute
top -5px
right -5px
bottom -5px
left -5px
border 2px solid rgba($theme-color, 0.3)
border-radius 8px
> .cancel
right 148px
color #888
background linear-gradient(to bottom, #ffffff 0%, #f5f5f5 100%)
border solid 1px #e2e2e2
&:hover
background linear-gradient(to bottom, #f9f9f9 0%, #ececec 100%)
border-color #dcdcdc
&:active
background #ececec
border-color #dcdcdc
> .ok
right 16px
font-weight bold
color $theme-color-foreground
background linear-gradient(to bottom, lighten($theme-color, 25%) 0%, lighten($theme-color, 10%) 100%)
border solid 1px lighten($theme-color, 15%)
&:hover
background linear-gradient(to bottom, lighten($theme-color, 8%) 0%, darken($theme-color, 8%) 100%)
border-color $theme-color
&:active
background $theme-color
border-color $theme-color
</style>

View File

@@ -29,8 +29,6 @@ export default Vue.extend({
<style lang="stylus" scoped>
.root.api
color #4a535a
code
display inline-block
padding 4px 6px

View File

@@ -37,14 +37,17 @@
<section class="web" v-show="page == 'web'">
<h1>デザインと表示</h1>
<div class="div">
<button class="ui button" @click="customizeHome">ホームをカスタマイズ</button>
<button class="ui button" @click="customizeHome" style="margin-bottom: 16px">ホームをカスタマイズ</button>
</div>
<div class="div">
<mk-switch v-model="os.i.clientSettings.dark" @change="onChangeDark" text="ダークモード"/>
<mk-switch v-model="os.i.clientSettings.gradientWindowHeader" @change="onChangeGradientWindowHeader" text="ウィンドウのタイトルバーにグラデーションを使用"/>
</div>
<mk-switch v-model="os.i.clientSettings.showPostFormOnTopOfTl" @change="onChangeShowPostFormOnTopOfTl" text="タイムライン上部に投稿フォームを表示する"/>
<mk-switch v-model="os.i.clientSettings.showReplyTarget" @change="onChangeShowReplyTarget" text="リプライ先を表示する"/>
<mk-switch v-model="os.i.clientSettings.showMaps" @change="onChangeShowMaps" text="マップの自動展開">
<span>位置情報が添付された投稿のマップを自動的に展開します</span>
</mk-switch>
<mk-switch v-model="os.i.clientSettings.gradientWindowHeader" @change="onChangeGradientWindowHeader" text="ウィンドウのタイトルバーにグラデーションを使用"/>
</section>
<section class="web" v-show="page == 'web'">
@@ -298,6 +301,12 @@ export default Vue.extend({
autoWatch: v
});
},
onChangeDark(v) {
(this as any).api('i/update_client_setting', {
name: 'dark',
value: v
});
},
onChangeShowPostFormOnTopOfTl(v) {
(this as any).api('i/update_client_setting', {
name: 'showPostFormOnTopOfTl',
@@ -365,7 +374,7 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
.mk-settings
root(isDark)
display flex
width 100%
height 100%
@@ -376,13 +385,13 @@ export default Vue.extend({
height 100%
padding 16px 0 0 0
overflow auto
border-right solid 1px #ddd
border-right solid 1px isDark ? #1c2023 : #ddd
> p
display block
padding 10px 16px
margin 0
color #666
color isDark ? #9aa2a7 : #666
cursor pointer
user-select none
transition margin-left 0.2s ease
@@ -391,7 +400,7 @@ export default Vue.extend({
margin-right 4px
&:hover
color #555
color isDark ? #fff : #555
&.active
margin-left 8px
@@ -405,14 +414,14 @@ export default Vue.extend({
> section
margin 32px
color #4a535a
color isDark ? #c4ccd2 : #4a535a
> h1
margin 0 0 1em 0
padding 0 0 8px 0
font-size 1em
color #555
border-bottom solid 1px #eee
color isDark ? #e3e7ea : #555
border-bottom solid 1px isDark ? #1c2023 : #eee
&, >>> *
.ui.button.block
@@ -425,13 +434,18 @@ export default Vue.extend({
margin 0 0 1em 0
padding 0 0 8px 0
font-size 1em
color #555
border-bottom solid 1px #eee
color isDark ? #e3e7ea : #555
border-bottom solid 1px isDark ? #1c2023 : #eee
> .web
> .div
border-bottom solid 1px #eee
padding 0 0 16px 0
margin 0 0 16px 0
border-bottom solid 1px isDark ? #1c2023 : #eee
margin 16px 0
.mk-settings[data-darkmode]
root(true)
.mk-settings:not([data-darkmode])
root(false)
</style>

View File

@@ -66,14 +66,16 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
.mk-timeline
background #fff
root(isDark)
background isDark ? #282C37 : #fff
border solid 1px rgba(0, 0, 0, 0.075)
border-radius 6px
> header
padding 0 8px
z-index 10
background isDark ? #313543 : #fff
border-radius 6px 6px 0 0
box-shadow 0 1px rgba(0, 0, 0, 0.08)
> span
@@ -99,10 +101,16 @@ export default Vue.extend({
background $theme-color
&:not([data-is-active])
color #6f7477
color isDark ? #9aa2a7 : #6f7477
cursor pointer
&:hover
color #525a5f
color isDark ? #d9dcde : #525a5f
.mk-timeline[data-darkmode]
root(true)
.mk-timeline:not([data-darkmode])
root(false)
</style>

View File

@@ -8,23 +8,31 @@
<div class="menu" v-if="isOpen">
<ul>
<li>
<router-link :to="`/@${ os.i.username }`">%fa:user%%i18n:@profile%%fa:angle-right%</router-link>
<router-link :to="`/@${ os.i.username }`">%fa:user%<span>%i18n:@profile%</span>%fa:angle-right%</router-link>
</li>
<li @click="drive">
<p>%fa:cloud%%i18n:@drive%%fa:angle-right%</p>
<p>%fa:cloud%<span>%i18n:@drive%</span>%fa:angle-right%</p>
</li>
<li>
<router-link to="/i/favorites">%fa:star%<span>%i18n:@favorites%</span>%fa:angle-right%</router-link>
</li>
</ul>
<ul>
<li>
<a href="/i/customize-home">%fa:wrench%%i18n:@customize%%fa:angle-right%</a>
<a href="/i/customize-home">%fa:wrench%<span>%i18n:@customize%</span>%fa:angle-right%</a>
</li>
<li @click="settings">
<p>%fa:cog%%i18n:@settings%%fa:angle-right%</p>
<p>%fa:cog%<span>%i18n:@settings%</span>%fa:angle-right%</p>
</li>
</ul>
<ul>
<li @click="signout">
<p>%fa:power-off%%i18n:@signout%%fa:angle-right%</p>
<p class="signout">%fa:power-off%<span>%i18n:@signout%</span></p>
</li>
</ul>
<ul>
<li @click="dark">
<p><span>%i18n:@dark%</span><template v-if="_darkmode_">%fa:moon%</template><template v-else>%fa:R moon%</template></p>
</li>
</ul>
</div>
@@ -78,6 +86,12 @@ export default Vue.extend({
},
signout() {
(this as any).os.signout();
},
dark() {
(this as any).api('i/update_client_setting', {
name: 'dark',
value: !(this as any)._darkmode_
});
}
}
});
@@ -86,7 +100,7 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
.account
root(isDark)
> .header
display block
margin 0
@@ -101,13 +115,13 @@ export default Vue.extend({
&:hover
&[data-active='true']
color darken(#9eaba8, 20%)
color isDark ? #fff : darken(#9eaba8, 20%)
> .avatar
filter saturate(150%)
&:active
color darken(#9eaba8, 30%)
color isDark ? #fff : darken(#9eaba8, 30%)
> .username
display block
@@ -134,13 +148,14 @@ export default Vue.extend({
transition filter 100ms ease
> .menu
$bgcolor = isDark ? #282c37 : #fff
display block
position absolute
top 56px
right -2px
width 230px
font-size 0.8em
background #fff
background $bgcolor
border-radius 4px
box-shadow 0 1px 4px rgba(0, 0, 0, 0.25)
@@ -165,7 +180,7 @@ export default Vue.extend({
right 12px
border-top solid 14px transparent
border-right solid 14px transparent
border-bottom solid 14px #fff
border-bottom solid 14px $bgcolor
border-left solid 14px transparent
ul
@@ -176,7 +191,7 @@ export default Vue.extend({
& + ul
padding-top 10px
border-top solid 1px #eee
border-top solid 1px isDark ? #1c2023 : #eee
> li
display block
@@ -190,16 +205,20 @@ export default Vue.extend({
padding 0 28px
margin 0
line-height 40px
color #868C8C
color isDark ? #c8cece : #868C8C
cursor pointer
*
pointer-events none
> [data-fa]:first-of-type
margin-right 6px
> span:first-child
padding-left 22px
> [data-fa]:last-of-type
> [data-fa]:first-child
margin-right 6px
width 16px
> [data-fa]:last-child
display block
position absolute
top 0
@@ -217,9 +236,25 @@ export default Vue.extend({
&:active
background darken($theme-color, 10%)
&.signout
$color = #e64137
&:hover, &:active
background $color
color #fff
&:active
background darken($color, 10%)
.zoom-in-top-enter-active,
.zoom-in-top-leave-active {
transform-origin: center -16px;
}
.account[data-darkmode]
root(true)
.account:not([data-darkmode])
root(false)
</style>

View File

@@ -99,7 +99,7 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
.nav
root(isDark)
display inline-block
margin 0
padding 0
@@ -131,7 +131,7 @@ export default Vue.extend({
padding 0 24px
font-size 13px
font-variant small-caps
color #9eaba8
color isDark ? #b8c5ca : #9eaba8
text-decoration none
transition none
cursor pointer
@@ -140,7 +140,7 @@ export default Vue.extend({
pointer-events none
&:hover
color darken(#9eaba8, 20%)
color isDark ? #fff : darken(#9eaba8, 20%)
text-decoration none
> [data-fa]:first-child
@@ -164,4 +164,10 @@ export default Vue.extend({
@media (max-width 700px)
padding 0 12px
.nav[data-darkmode]
root(true)
.nav:not([data-darkmode])
root(false)
</style>

View File

@@ -84,7 +84,7 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
.notifications
root(isDark)
> button
display block
@@ -101,10 +101,10 @@ export default Vue.extend({
&:hover
&[data-active='true']
color darken(#9eaba8, 20%)
color isDark ? #fff : darken(#9eaba8, 20%)
&:active
color darken(#9eaba8, 30%)
color isDark ? #fff : darken(#9eaba8, 30%)
> [data-fa].bell
font-size 1.2em
@@ -117,12 +117,13 @@ export default Vue.extend({
color $theme-color
> .pop
$bgcolor = isDark ? #282c37 : #fff
display block
position absolute
top 56px
right -72px
width 300px
background #fff
background $bgcolor
border-radius 4px
box-shadow 0 1px 4px rgba(0, 0, 0, 0.25)
@@ -147,7 +148,7 @@ export default Vue.extend({
right 74px
border-top solid 14px transparent
border-right solid 14px transparent
border-bottom solid 14px #fff
border-bottom solid 14px $bgcolor
border-left solid 14px transparent
> .mk-notifications
@@ -155,4 +156,10 @@ export default Vue.extend({
font-size 1rem
overflow auto
.notifications[data-darkmode]
root(true)
.notifications:not([data-darkmode])
root(false)
</style>

View File

@@ -169,10 +169,10 @@ root(isDark)
> .mk-ui-header-search
display none
.header[data-is-darkmode]
.header[data-darkmode]
root(true)
.header
.header:not([data-darkmode])
root(false)
</style>

View File

@@ -6,7 +6,7 @@
<img :src="`${u.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
<div class="title">
<router-link class="name" :to="u | userPage">{{ u.name }}</router-link>
<router-link class="name" :to="u | userPage">{{ u | userName }}</router-link>
<p class="username">@{{ u | acct }}</p>
</div>
<div class="description">{{ u.description }}</div>
@@ -87,12 +87,12 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
.mk-user-preview
root(isDark)
position absolute
z-index 2048
margin-top -8px
width 250px
background #fff
background isDark ? #282c37 : #fff
background-clip content-box
border solid 1px rgba(0, 0, 0, 0.1)
border-radius 4px
@@ -101,7 +101,7 @@ export default Vue.extend({
> .banner
height 84px
background-color #f5f5f5
background-color isDark ? #1c1e26 : #f5f5f5
background-size cover
background-position center
@@ -117,7 +117,7 @@ export default Vue.extend({
width 58px
height 58px
margin 0
border solid 3px #fff
border solid 3px isDark ? #282c37 : #fff
border-radius 8px
> .title
@@ -129,19 +129,19 @@ export default Vue.extend({
margin 0
font-weight bold
line-height 16px
color #656565
color isDark ? #fff : #656565
> .username
display block
margin 0
line-height 16px
font-size 0.8em
color #999
color isDark ? #606984 : #999
> .description
padding 0 16px
font-size 0.7em
color #555
color isDark ? #9ea4ad : #555
> .status
padding 8px 16px
@@ -164,4 +164,10 @@ export default Vue.extend({
top 92px
right 8px
.mk-user-preview[data-darkmode]
root(true)
.mk-user-preview:not([data-darkmode])
root(false)
</style>

View File

@@ -34,8 +34,8 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
.mk-widget-container
background #fff
root(isDark)
background isDark ? #282C37 : #fff
border solid 1px rgba(0, 0, 0, 0.075)
border-radius 6px
overflow hidden
@@ -45,6 +45,8 @@ export default Vue.extend({
border none !important
> header
background isDark ? #313543 : #fff
> .title
z-index 1
margin 0
@@ -52,7 +54,7 @@ export default Vue.extend({
line-height 42px
font-size 0.9em
font-weight bold
color #888
color isDark ? #e3e5e8 : #888
box-shadow 0 1px rgba(0, 0, 0, 0.07)
> [data-fa]
@@ -70,16 +72,23 @@ export default Vue.extend({
width 42px
font-size 0.9em
line-height 42px
color #ccc
color isDark ? #9baec8 : #ccc
&:hover
color #aaa
color isDark ? #b2c1d5 : #aaa
&:active
color #999
color isDark ? #b2c1d5 : #999
&.withGradient
> .title
background linear-gradient(to bottom, #fff, #ececec)
background isDark ? linear-gradient(to bottom, #313543, #1d2027) : linear-gradient(to bottom, #fff, #ececec)
box-shadow 0 1px rgba(#000, 0.11)
.mk-widget-container[data-darkmode]
root(true)
.mk-widget-container:not([data-darkmode])
root(false)
</style>

View File

@@ -465,7 +465,7 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
.mk-window
root(isDark)
display block
> .bg
@@ -559,7 +559,7 @@ export default Vue.extend({
> .body
height 100%
overflow hidden
background #fff
background isDark ? #282C37 : #fff
border-radius 6px
box-shadow 0 2px 6px 0 rgba(0, 0, 0, 0.2)
@@ -571,12 +571,12 @@ export default Vue.extend({
overflow hidden
white-space nowrap
cursor move
background #fff
background isDark ? #313543 : #fff
border-radius 6px 6px 0 0
box-shadow 0 1px 0 rgba(#000, 0.1)
&.withGradient
background linear-gradient(to bottom, #fff, #ececec)
background isDark ? linear-gradient(to bottom, #313543, #1d2027) : linear-gradient(to bottom, #fff, #ececec)
box-shadow 0 1px 0 rgba(#000, 0.15)
&, *
@@ -593,7 +593,7 @@ export default Vue.extend({
font-size 1em
line-height $header-height
font-weight normal
color #666
color isDark ? #e3e5e8 : #666
> div:last-child
position absolute
@@ -608,16 +608,16 @@ export default Vue.extend({
padding 0
cursor pointer
font-size 1em
color rgba(#000, 0.4)
color isDark ? #9baec8 : rgba(#000, 0.4)
border none
outline none
background transparent
&:hover
color rgba(#000, 0.6)
color isDark ? #b2c1d5 : rgba(#000, 0.6)
&:active
color darken(#000, 30%)
color isDark ? #b2c1d5 : darken(#000, 30%)
> [data-fa]
padding 0
@@ -632,4 +632,10 @@ export default Vue.extend({
> .main > .body > .content
height calc(100% - 40px)
.mk-window[data-darkmode]
root(true)
.mk-window:not([data-darkmode])
root(false)
</style>

View File

@@ -0,0 +1,73 @@
<template>
<mk-ui>
<main v-if="!fetching">
<template v-for="favorite in favorites">
<mk-note-detail :note="favorite.note" :key="favorite.note.id"/>
</template>
<a v-if="existMore" @click="more">さらに読み込む</a>
</main>
</mk-ui>
</template>
<script lang="ts">
import Vue from 'vue';
import Progress from '../../../common/scripts/loading';
export default Vue.extend({
data() {
return {
fetching: true,
favorites: [],
existMore: false,
moreFetching: false
};
},
created() {
this.fetch();
},
methods: {
fetch() {
Progress.start();
this.fetching = true;
(this as any).api('i/favorites', {
limit: 11
}).then(favorites => {
if (favorites.length == 11) {
this.existMore = true;
favorites.pop();
}
this.favorites = favorites;
this.fetching = false;
Progress.done();
});
},
more() {
this.moreFetching = true;
(this as any).api('i/favorites', {
limit: 11,
maxId: this.favorites[this.favorites.length - 1].id
}).then(favorites => {
if (favorites.length == 11) {
this.existMore = true;
favorites.pop();
} else {
this.existMore = false;
}
this.favorites = this.favorites.concat(favorites);
this.moreFetching = false;
});
}
}
});
</script>
<style lang="stylus" scoped>
main
margin 0 auto
padding 16px
max-width 700px
</style>

View File

@@ -1,5 +1,6 @@
<template>
<div class="header" :data-is-dark-background="user.bannerUrl != null">
<div class="is-suspended" v-if="user.isSuspended"><p>%fa:exclamation-triangle% %i18n:@is-suspended%</p></div>
<div class="is-remote" v-if="user.host != null"><p>%fa:exclamation-triangle% %i18n:@is-remote%<a :href="user.url || user.uri" target="_blank">%i18n:@view-remote%</a></p></div>
<div class="banner-container" :style="user.bannerUrl ? `background-image: url(${user.bannerUrl}?thumbnail&size=2048)` : ''">
<div class="banner" ref="banner" :style="user.bannerUrl ? `background-image: url(${user.bannerUrl}?thumbnail&size=2048)` : ''" @click="onBannerClick"></div>
@@ -73,14 +74,21 @@ export default Vue.extend({
background #f7f7f7
box-shadow 0 1px 1px rgba(0, 0, 0, 0.075)
> .is-suspended
> .is-remote
padding 16px
color #573c08
background #fff0db
&.is-suspended
color #570808
background #ffdbdb
&.is-remote
color #573c08
background #fff0db
> p
margin 0 auto
max-width 1024px
padding 14px 16px
max-width 1200px
font-size 14px
> a
font-weight bold

View File

@@ -1,13 +1,18 @@
<template>
<div class="mkw-messaging">
<p class="title" v-if="props.design == 0">%fa:comments%%i18n:@title%</p>
<mk-messaging ref="index" compact @navigate="navigate"/>
<mk-widget-container :show-header="props.design == 0">
<template slot="header">%fa:comments%%i18n:@title%</template>
<button slot="func" @click="add">%fa:plus%</button>
<mk-messaging ref="index" compact @navigate="navigate"/>
</mk-widget-container>
</div>
</template>
<script lang="ts">
import define from '../../../common/define-widget';
import MkMessagingRoomWindow from '../components/messaging-room-window.vue';
import MkMessagingWindow from '../components/messaging-window.vue';
export default define({
name: 'messaging',
@@ -21,6 +26,9 @@ export default define({
user: user
});
},
add() {
(this as any).os.new(MkMessagingWindow);
},
func() {
if (this.props.design == 1) {
this.props.design = 0;
@@ -34,25 +42,7 @@ export default define({
<style lang="stylus" scoped>
.mkw-messaging
overflow hidden
background #fff
border solid 1px rgba(0, 0, 0, 0.075)
border-radius 6px
> .title
z-index 2
margin 0
padding 0 16px
line-height 42px
font-size 0.9em
font-weight bold
color #888
box-shadow 0 1px rgba(0, 0, 0, 0.07)
> [data-fa]
margin-right 4px
> .mk-messaging
.mk-messaging
max-height 250px
overflow auto

View File

@@ -1,10 +1,11 @@
<template>
<div class="mkw-notifications">
<template v-if="!props.compact">
<p class="title">%fa:R bell%%i18n:@title%</p>
<button @click="settings" title="%i18n:@settings%">%fa:cog%</button>
</template>
<mk-notifications/>
<mk-widget-container :show-header="!props.compact">
<template slot="header">%fa:R bell%%i18n:@title%</template>
<button slot="func" title="%i18n:@settings%" @click="settings">%fa:cog%</button>
<mk-notifications :class="$style.notifications"/>
</mk-widget-container>
</div>
</template>
@@ -27,44 +28,9 @@ export default define({
});
</script>
<style lang="stylus" scoped>
.mkw-notifications
background #fff
border solid 1px rgba(0, 0, 0, 0.075)
border-radius 6px
> .title
z-index 1
margin 0
padding 0 16px
line-height 42px
font-size 0.9em
font-weight bold
color #888
box-shadow 0 1px rgba(0, 0, 0, 0.07)
> [data-fa]
margin-right 4px
> button
position absolute
z-index 2
top 0
right 0
padding 0
width 42px
font-size 0.9em
line-height 42px
color #ccc
&:hover
color #aaa
&:active
color #999
> .mk-notifications
max-height 300px
overflow auto
<style lang="stylus" module>
.notifications
max-height 300px
overflow auto
</style>

View File

@@ -1,16 +1,19 @@
<template>
<div class="mkw-polls">
<template v-if="!props.compact">
<p class="title">%fa:chart-pie%%i18n:@title%</p>
<button @click="fetch" title="%i18n:@refresh%">%fa:sync%</button>
</template>
<div class="poll" v-if="!fetching && poll != null">
<p v-if="poll.text"><router-link to="poll | notePage">{{ poll.text }}</router-link></p>
<p v-if="!poll.text"><router-link to="poll | notePage">%fa:link%</router-link></p>
<mk-poll :note="poll"/>
</div>
<p class="empty" v-if="!fetching && poll == null">%i18n:@nothing%</p>
<p class="fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:common.loading%<mk-ellipsis/></p>
<mk-widget-container :show-header="!props.compact">
<template slot="header">%fa:chart-pie%%i18n:@title%</template>
<button slot="func" title="%i18n:@refresh%" @click="fetch">%fa:sync%</button>
<div class="mkw-polls--body" :data-darkmode="_darkmode_">
<div class="poll" v-if="!fetching && poll != null">
<p v-if="poll.text"><router-link to="poll | notePage">{{ poll.text }}</router-link></p>
<p v-if="!poll.text"><router-link to="poll | notePage">%fa:link%</router-link></p>
<mk-poll :note="poll"/>
</div>
<p class="empty" v-if="!fetching && poll == null">%i18n:@nothing%</p>
<p class="fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:common.loading%<mk-ellipsis/></p>
</div>
</mk-widget-container>
</div>
</template>
@@ -60,44 +63,11 @@ export default define({
</script>
<style lang="stylus" scoped>
.mkw-polls
background #fff
border solid 1px rgba(0, 0, 0, 0.075)
border-radius 6px
> .title
margin 0
padding 0 16px
line-height 42px
font-size 0.9em
font-weight bold
color #888
border-bottom solid 1px #eee
> [data-fa]
margin-right 4px
> button
position absolute
z-index 2
top 0
right 0
padding 0
width 42px
font-size 0.9em
line-height 42px
color #ccc
&:hover
color #aaa
&:active
color #999
root(isDark)
> .poll
padding 16px
font-size 12px
color #555
color isDark ? #9ea4ad : #555
> p
margin 0 0 8px 0
@@ -120,4 +90,10 @@ export default define({
> [data-fa]
margin-right 4px
.mkw-polls--body[data-darkmode]
root(true)
.mkw-polls--body:not([data-darkmode])
root(false)
</style>

View File

@@ -42,9 +42,9 @@ export default define({
</script>
<style lang="stylus" scoped>
.mkw-profile
root(isDark)
overflow hidden
background #fff
background isDark ? #282c37 : #fff
border solid 1px rgba(0, 0, 0, 0.075)
border-radius 6px
@@ -104,7 +104,7 @@ export default define({
width 58px
height 58px
margin 0
border solid 3px #fff
border solid 3px isDark ? #282c37 : #fff
border-radius 8px
vertical-align bottom
cursor pointer
@@ -114,13 +114,19 @@ export default define({
margin 10px 0 0 84px
line-height 16px
font-weight bold
color #555
color isDark ? #fff : #555
> .username
display block
margin 4px 0 8px 84px
line-height 16px
font-size 0.9em
color #999
color isDark ? #606984 : #999
.mkw-profile[data-darkmode]
root(true)
.mkw-profile:not([data-darkmode])
root(false)
</style>

View File

@@ -1,15 +1,18 @@
<template>
<div class="mkw-trends">
<template v-if="!props.compact">
<p class="title">%fa:fire%%i18n:@title%</p>
<button @click="fetch" title="%i18n:@refresh%">%fa:sync%</button>
</template>
<p class="fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:common.loading%<mk-ellipsis/></p>
<div class="note" v-else-if="note != null">
<p class="text"><router-link :to="note | notePage">{{ note.text }}</router-link></p>
<p class="author"><router-link :to="note.user | userPage">@{{ note.user | acct }}</router-link></p>
</div>
<p class="empty" v-else>%i18n:@nothing%</p>
<mk-widget-container :show-header="!props.compact">
<template slot="header">%fa:fire%%i18n:@title%</template>
<button slot="func" title="%i18n:@refresh%" @click="fetch">%fa:sync%</button>
<div class="mkw-trends--body">
<p class="fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:common.loading%<mk-ellipsis/></p>
<div class="note" v-else-if="note != null">
<p class="text"><router-link :to="note | notePage">{{ note.text }}</router-link></p>
<p class="author"><router-link :to="note.user | userPage">@{{ note.user | acct }}</router-link></p>
</div>
<p class="empty" v-else>%i18n:@nothing%</p>
</div>
</mk-widget-container>
</div>
</template>
@@ -63,67 +66,41 @@ export default define({
</script>
<style lang="stylus" scoped>
.mkw-trends
background #fff
border solid 1px rgba(0, 0, 0, 0.075)
border-radius 6px
root(isDark)
.mkw-trends--body
> .note
padding 16px
font-size 12px
font-style oblique
color #555
> .title
margin 0
padding 0 16px
line-height 42px
font-size 0.9em
font-weight bold
color #888
border-bottom solid 1px #eee
> p
margin 0
> [data-fa]
margin-right 4px
> .text,
> .author
> a
color inherit
> button
position absolute
z-index 2
top 0
right 0
padding 0
width 42px
font-size 0.9em
line-height 42px
color #ccc
&:hover
> .empty
margin 0
padding 16px
text-align center
color #aaa
&:active
color #999
> .note
padding 16px
font-size 12px
font-style oblique
color #555
> p
> .fetching
margin 0
padding 16px
text-align center
color #aaa
> .text,
> .author
> a
color inherit
> [data-fa]
margin-right 4px
> .empty
margin 0
padding 16px
text-align center
color #aaa
.mkw-trends[data-darkmode]
root(true)
> .fetching
margin 0
padding 16px
text-align center
color #aaa
> [data-fa]
margin-right 4px
.mkw-trends:not([data-darkmode])
root(false)
</style>

View File

@@ -1,23 +1,26 @@
<template>
<div class="mkw-users">
<template v-if="!props.compact">
<p class="title">%fa:users%%i18n:@title%</p>
<button @click="refresh" title="%i18n:@refresh%">%fa:sync%</button>
</template>
<p class="fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:common.loading%<mk-ellipsis/></p>
<template v-else-if="users.length != 0">
<div class="user" v-for="_user in users">
<router-link class="avatar-anchor" :to="_user | userPage">
<img class="avatar" :src="`${_user.avatarUrl}?thumbnail&size=42`" alt="" v-user-preview="_user.id"/>
</router-link>
<div class="body">
<router-link class="name" :to="_user | userPage" v-user-preview="_user.id">{{ _user | userName }}</router-link>
<p class="username">@{{ _user | acct }}</p>
</div>
<mk-follow-button :user="_user"/>
<mk-widget-container :show-header="!props.compact">
<template slot="header">%fa:users%%i18n:@title%</template>
<button slot="func" title="%i18n:@refresh%" @click="refresh">%fa:sync%</button>
<div class="mkw-users--body">
<p class="fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:common.loading%<mk-ellipsis/></p>
<template v-else-if="users.length != 0">
<div class="user" v-for="_user in users">
<router-link class="avatar-anchor" :to="_user | userPage">
<img class="avatar" :src="`${_user.avatarUrl}?thumbnail&size=42`" alt="" v-user-preview="_user.id"/>
</router-link>
<div class="body">
<router-link class="name" :to="_user | userPage" v-user-preview="_user.id">{{ _user | userName }}</router-link>
<p class="username">@{{ _user | acct }}</p>
</div>
<mk-follow-button :user="_user"/>
</div>
</template>
<p class="empty" v-else>%i18n:@no-one%</p>
</div>
</template>
<p class="empty" v-else>%i18n:@no-one%</p>
</mk-widget-container>
</div>
</template>
@@ -71,100 +74,74 @@ export default define({
</script>
<style lang="stylus" scoped>
.mkw-users
background #fff
border solid 1px rgba(0, 0, 0, 0.075)
border-radius 6px
root(isDark)
.mkw-users--body
> .user
padding 16px
border-bottom solid 1px isDark ? #1c2023 : #eee
> .title
margin 0
padding 0 16px
line-height 42px
font-size 0.9em
font-weight bold
color #888
border-bottom solid 1px #eee
&:last-child
border-bottom none
> [data-fa]
margin-right 4px
&:after
content ""
display block
clear both
> button
position absolute
z-index 2
top 0
right 0
padding 0
width 42px
font-size 0.9em
line-height 42px
color #ccc
> .avatar-anchor
display block
float left
margin 0 12px 0 0
&:hover
> .avatar
display block
width 42px
height 42px
margin 0
border-radius 8px
vertical-align bottom
> .body
float left
width calc(100% - 54px)
> .name
margin 0
font-size 16px
line-height 24px
color isDark ? #fff : #555
> .username
display block
margin 0
font-size 15px
line-height 16px
color isDark ? #606984 : #ccc
> .mk-follow-button
position absolute
top 16px
right 16px
> .empty
margin 0
padding 16px
text-align center
color #aaa
&:active
color #999
> .fetching
margin 0
padding 16px
text-align center
color #aaa
> .user
padding 16px
border-bottom solid 1px #eee
> [data-fa]
margin-right 4px
&:last-child
border-bottom none
.mkw-users[data-darkmode]
root(true)
&:after
content ""
display block
clear both
> .avatar-anchor
display block
float left
margin 0 12px 0 0
> .avatar
display block
width 42px
height 42px
margin 0
border-radius 8px
vertical-align bottom
> .body
float left
width calc(100% - 54px)
> .name
margin 0
font-size 16px
line-height 24px
color #555
> .username
display block
margin 0
font-size 15px
line-height 16px
color #ccc
> .mk-follow-button
position absolute
top 16px
right 16px
> .empty
margin 0
padding 16px
text-align center
color #aaa
> .fetching
margin 0
padding 16px
text-align center
color #aaa
> [data-fa]
margin-right 4px
.mkw-users:not([data-darkmode])
root(false)
</style>

View File

@@ -56,6 +56,13 @@ body > noscript {
animation-delay: 0.32s;
}
html[data-darkmode] #ini {
background: #191b22;
}
html[data-darkmode] #ini > p {
color: #fff;
}
@keyframes ini {
0%, 80%, 100% {
opacity: 1;

View File

@@ -47,6 +47,43 @@ Vue.mixin({
}
});
// Dark/Light
Vue.mixin({
data() {
return {
_darkmode_: false
};
},
beforeCreate() {
// なぜか警告が出るため
this._darkmode_ = false;
},
mounted() {
const set = () => {
if (!this.$el || !this.$el.setAttribute || !this.os || !this.os.i) return;
if (this.os.i.clientSettings.dark) {
document.documentElement.setAttribute('data-darkmode', 'true');
this.$el.setAttribute('data-darkmode', 'true');
this._darkmode_ = true;
this.$forceUpdate();
} else {
document.documentElement.removeAttribute('data-darkmode');
this.$el.removeAttribute('data-darkmode');
this._darkmode_ = false;
this.$forceUpdate();
}
};
set();
this.$watch('os.i.clientSettings', i => {
set();
}, {
deep: true
});
}
});
/**
* APP ENTRY POINT!
*/

View File

@@ -93,6 +93,8 @@ export default Vue.extend({
color #b2b8bb
> .body
max-height 128px
overflow hidden
> .text
cursor default

View File

@@ -391,6 +391,18 @@ export default Vue.extend({
font-size 1.1em
color #717171
>>> .title
display block
margin-bottom 4px
padding 4px
font-size 90%
text-align center
background #eef1f3
border-radius 4px
>>> .code
margin 8px 0
>>> .quote
margin 8px
padding 6px 12px

View File

@@ -150,6 +150,9 @@ export default Vue.extend({
width 100%
box-shadow 0 1px 0 rgba(#000, 0.075)
&, *
user-select none
> .main
color rgba(#fff, 0.9)

View File

@@ -1,7 +1,8 @@
<template>
<mk-ui>
<span slot="header" v-if="!fetching">%fa:user% {{ user | userName }}</span>
<template slot="header" v-if="!fetching"><img :src="`${user.avatarUrl}?thumbnail&size=64`" alt="">{{ user | userName }}</template>
<main v-if="!fetching">
<div class="is-suspended" v-if="user.isSuspended"><p>%fa:exclamation-triangle% %i18n:@is-suspended%</p></div>
<div class="is-remote" v-if="user.host != null"><p>%fa:exclamation-triangle% %i18n:@is-remote%<a :href="user.url || user.uri" target="_blank">%i18n:@view-remote%</a></p></div>
<header>
<div class="banner" :style="user.bannerUrl ? `background-image: url(${user.bannerUrl}?thumbnail&size=1024)` : ''"></div>
@@ -110,20 +111,27 @@ export default Vue.extend({
@import '~const.styl'
main
> .is-suspended
> .is-remote
padding 16px
color #573c08
background #fff0db
&.is-suspended
color #570808
background #ffdbdb
&.is-remote
color #573c08
background #fff0db
> p
margin 0 auto
max-width 1024px
padding 14px
max-width 600px
font-size 14px
> a
font-weight bold
@media (max-width 500px)
padding 12px
font-size 12px
> header

View File

@@ -0,0 +1,9 @@
h1 フォロー
p ユーザーをフォローすると、タイムラインにそのユーザーの投稿が表示されるようになります。ただし、他のユーザーに対する返信は含まれません。
p ユーザーをフォローするには、ユーザーページの「フォロー」ボタンをクリックします。フォローを解除するには、もう一度クリックします。
section
h2 ストーキング
p ユーザーをフォローしている状態では、さらに「ストーキング」モードをオンにすることができます。ストーキングを行うと、タイムラインにそのユーザーの全ての投稿が表示されるようになります。つまり、他のユーザーに対する返信も含まれることになります。
p ストーキングするには、ユーザーページの「ストークする」をクリックします。ストーキングをやめるには、もう一度クリックします。
p ストーキングしていることは相手に通知されません。

View File

@@ -1,7 +1,10 @@
import * as mongo from 'mongodb';
import deepcopy = require('deepcopy');
import db from '../db/mongodb';
import { pack as packNote } from './note';
const Favorite = db.get<IFavorite>('favorites');
Favorite.createIndex(['userId', 'noteId'], { unique: true });
export default Favorite;
export type IFavorite = {
@@ -37,3 +40,35 @@ export async function deleteFavorite(favorite: string | mongo.ObjectID | IFavori
_id: f._id
});
}
/**
* Pack a favorite for API response
*/
export const pack = (
favorite: any,
me: any
) => new Promise<any>(async (resolve, reject) => {
let _favorite: any;
// Populate the favorite if 'favorite' is ID
if (mongo.ObjectID.prototype.isPrototypeOf(favorite)) {
_favorite = await Favorite.findOne({
_id: favorite
});
} else if (typeof favorite === 'string') {
_favorite = await Favorite.findOne({
_id: new mongo.ObjectID(favorite)
});
} else {
_favorite = deepcopy(favorite);
}
// Rename _id to id
_favorite.id = _favorite._id;
delete _favorite._id;
// Populate note
_favorite.note = await packNote(_favorite.noteId, me);
resolve(_favorite);
});

View File

@@ -11,6 +11,11 @@ const log = debug('misskey:activitypub');
* Imageを作成します。
*/
export async function createImage(actor: IRemoteUser, value): Promise<IDriveFile> {
// 投稿者が凍結されていたらスキップ
if (actor.isSuspended) {
return null;
}
const image = await new Resolver().resolve(value);
if (image.url == null) {

View File

@@ -58,6 +58,11 @@ export async function createNote(value: any, resolver?: Resolver, silent = false
// 投稿者をフェッチ
const actor = await resolvePerson(note.attributedTo) as IRemoteUser;
// 投稿者が凍結されていたらスキップ
if (actor.isSuspended) {
return null;
}
//#region Visibility
let visibility = 'public';
if (!note.to.includes('https://www.w3.org/ns/activitystreams#Public')) visibility = 'unlisted';

View File

@@ -80,27 +80,38 @@ export async function createPerson(value: any, resolver?: Resolver): Promise<IUs
const summaryDOM = JSDOM.fragment(person.summary);
// Create user
const user = await User.insert({
avatarId: null,
bannerId: null,
createdAt: Date.parse(person.published) || null,
description: summaryDOM.textContent,
followersCount,
followingCount,
notesCount,
name: person.name,
driveCapacity: 1024 * 1024 * 8, // 8MiB
username: person.preferredUsername,
usernameLower: person.preferredUsername.toLowerCase(),
host,
publicKey: {
id: person.publicKey.id,
publicKeyPem: person.publicKey.publicKeyPem
},
inbox: person.inbox,
uri: person.id,
url: person.url
}) as IRemoteUser;
let user: IRemoteUser;
try {
user = await User.insert({
avatarId: null,
bannerId: null,
createdAt: Date.parse(person.published) || null,
description: summaryDOM.textContent,
followersCount,
followingCount,
notesCount,
name: person.name,
driveCapacity: 1024 * 1024 * 8, // 8MiB
username: person.preferredUsername,
usernameLower: person.preferredUsername.toLowerCase(),
host,
publicKey: {
id: person.publicKey.id,
publicKeyPem: person.publicKey.publicKeyPem
},
inbox: person.inbox,
uri: person.id,
url: person.url
}) as IRemoteUser;
} catch (e) {
// duplicate key error
if (e.code === 11000) {
throw new Error('already registered');
}
console.error(e);
throw e;
}
//#region アイコンとヘッダー画像をフェッチ
const [avatarId, bannerId] = (await Promise.all([

View File

@@ -233,6 +233,12 @@ const endpoints: Endpoint[] = [
kind: 'notification-read'
},
{
name: 'i/favorites',
withCredential: true,
kind: 'favorites-read'
},
{
name: 'othello/match',
withCredential: true

View File

@@ -2,43 +2,52 @@
* Module dependencies
*/
import $ from 'cafy';
import Favorite from '../../../../models/favorite';
import { pack } from '../../../../models/note';
import Favorite, { pack } from '../../../../models/favorite';
/**
* Get followers of a user
*
* @param {any} params
* @param {any} user
* @return {Promise<any>}
* Get favorited notes
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'limit' parameter
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$;
if (limitErr) return rej('invalid limit param');
// Get 'offset' parameter
const [offset = 0, offsetErr] = $(params.offset).optional.number().min(0).$;
if (offsetErr) return rej('invalid offset param');
// Get 'sinceId' parameter
const [sinceId, sinceIdErr] = $(params.sinceId).optional.id().$;
if (sinceIdErr) return rej('invalid sinceId param');
// Get 'sort' parameter
const [sort = 'desc', sortError] = $(params.sort).optional.string().or('desc asc').$;
if (sortError) return rej('invalid sort param');
// Get 'untilId' parameter
const [untilId, untilIdErr] = $(params.untilId).optional.id().$;
if (untilIdErr) return rej('invalid untilId param');
// Check if both of sinceId and untilId is specified
if (sinceId && untilId) {
return rej('cannot set sinceId and untilId');
}
const query = {
userId: user._id
} as any;
const sort = {
_id: -1
};
if (sinceId) {
sort._id = 1;
query._id = {
$gt: sinceId
};
} else if (untilId) {
query._id = {
$lt: untilId
};
}
// Get favorites
const favorites = await Favorite
.find({
userId: user._id
}, {
limit: limit,
skip: offset,
sort: {
_id: sort == 'asc' ? 1 : -1
}
});
.find(query, { limit, sort });
// Serialize
res(await Promise.all(favorites.map(async favorite =>
await pack(favorite.noteId)
)));
res(await Promise.all(favorites.map(favorite => pack(favorite, user))));
});

View File

@@ -10,6 +10,7 @@ import * as Koa from 'koa';
import * as Router from 'koa-router';
import * as mount from 'koa-mount';
import * as compress from 'koa-compress';
import * as logger from 'koa-logger';
import activityPub from './activitypub';
import webFinger from './webfinger';
@@ -19,6 +20,12 @@ import config from '../config';
const app = new Koa();
app.proxy = true;
if (process.env.NODE_ENV != 'production') {
// Logger
app.use(logger());
}
// Compress response
app.use(compress({
flush: zlib.constants.Z_SYNC_FLUSH
}));

View File

@@ -150,8 +150,11 @@ export default async (user: IUser, data: {
const follower = following._follower;
if (isLocalUser(follower)) {
// この投稿が返信かつstalkフォローでないならスキップ
if (note.replyId && !following.stalk) return;
// ストーキングしていない場合
if (!following.stalk) {
// この投稿が返信ならスキップ
if (note.replyId && !note._reply.userId.equals(following.followerId) && !note._reply.userId.equals(note.userId)) return;
}
// Publish event to followers stream
stream(following.followerId, 'note', noteObj);

View File

@@ -54,6 +54,12 @@ const handlers = {
document.body.appendChild(blockquote);
},
title({ document }, { title }) {
const h1 = document.createElement('h1');
h1.textContent = title;
document.body.appendChild(h1);
},
text({ document }, { content }) {
for (const text of content.split('\n')) {
const node = document.createTextNode(text);

View File

@@ -0,0 +1,14 @@
/**
* Title
*/
module.exports = text => {
const match = text.match(/^【(.+?)】\n/);
if (!match) return null;
const title = match[0];
return {
type: 'title',
content: title,
title: title.substr(1, title.length - 3)
};
};

View File

@@ -4,6 +4,7 @@
const elements = [
require('./elements/bold'),
require('./elements/title'),
require('./elements/url'),
require('./elements/link'),
require('./elements/mention'),